From addb38dfc3708d883087ed4e0351b16535e05217 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 12:25:11 +0000 Subject: [PATCH 001/451] chore(internal): remove .eslintcache --- .eslintcache | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .eslintcache diff --git a/.eslintcache b/.eslintcache deleted file mode 100644 index cd44813307..0000000000 --- a/.eslintcache +++ /dev/null @@ -1 +0,0 @@ -[{"/home/tempuser-z687wq/run/codegen-output/cloudflare/cloudflare-node/src/resources/ai/to-markdown.ts":"1"},{"size":1733,"mtime":1759266822909}] \ No newline at end of file From 87bc28f3558be008d07e31b5ae7ecf48d5cbd2df Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 12:25:08 +0000 Subject: [PATCH 002/451] chore(api): update composite API spec --- .stats.yml | 4 +- api.md | 2 +- .../alerting/destinations/webhooks.ts | 6 +- src/resources/alerting/policies.ts | 6 +- src/resources/pages/index.ts | 1 + src/resources/pages/pages.ts | 6 +- src/resources/pages/projects/index.ts | 1 + src/resources/pages/projects/projects.ts | 22 ++++-- .../r2/super-slurper/connectivity-precheck.ts | 76 +++++++++++++------ src/resources/r2/super-slurper/jobs/jobs.ts | 52 +++++++------ src/resources/radar/as112/summary.ts | 34 ++------- .../radar/as112/timeseries-groups.ts | 36 ++------- src/resources/radar/attacks/layer3/summary.ts | 42 ++-------- .../radar/attacks/layer3/timeseries-groups.ts | 42 ++-------- src/resources/radar/attacks/layer7/summary.ts | 42 ++-------- .../radar/attacks/layer7/timeseries-groups.ts | 42 ++-------- src/resources/radar/dns/summary.ts | 54 +++---------- src/resources/radar/dns/timeseries-groups.ts | 60 +++------------ src/resources/radar/email/routing/summary.ts | 36 ++------- .../radar/email/routing/timeseries-groups.ts | 36 ++------- src/resources/radar/email/security/summary.ts | 54 +++---------- .../radar/email/security/timeseries-groups.ts | 54 +++---------- src/resources/radar/entities/asns.ts | 12 ++- src/resources/radar/netflows/netflows.ts | 2 +- src/resources/stream/downloads.ts | 5 +- src/resources/workers/scripts/versions.ts | 5 ++ src/resources/zones/settings.ts | 38 ++++------ .../alerting/destinations/webhooks.test.ts | 51 +++++-------- tests/api-resources/alerting/policies.test.ts | 24 +++--- .../pages/projects/projects.test.ts | 6 +- .../connectivity-precheck.test.ts | 20 ++++- .../r2/super-slurper/jobs/jobs.test.ts | 6 +- .../workers/scripts/versions.test.ts | 6 +- 33 files changed, 301 insertions(+), 582 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5637fc3e0e..d3fa9fc00d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ca8fbfa82d19dca400ec61b8c93392de1acd157860e435419f9a5e9ec8c586e0.yml -openapi_spec_hash: 77d55c70bc3824ac61bd056e2319ee18 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04d690a4c4e9c1e193ed3daed3e4a27fdb70dfd27aae505f16a2db4a59cd6793.yml +openapi_spec_hash: 902bd6518dab40dd55bfeb3ed94ffc7f config_hash: 107e0f1f8a98b007260b319226b88b3c diff --git a/api.md b/api.md index 7ffb0aa433..866462c86c 100644 --- a/api.md +++ b/api.md @@ -3925,7 +3925,7 @@ Types: Methods: - client.pages.projects.create({ ...params }) -> Project -- client.pages.projects.list({ ...params }) -> DeploymentsSinglePage +- client.pages.projects.list({ ...params }) -> DeploymentsV4PagePaginationArray - client.pages.projects.delete(projectName, { ...params }) -> ProjectDeleteResponse | null - client.pages.projects.edit(projectName, { ...params }) -> Project - client.pages.projects.get(projectName, { ...params }) -> Project diff --git a/src/resources/alerting/destinations/webhooks.ts b/src/resources/alerting/destinations/webhooks.ts index 279c67d0bf..605e015ae3 100644 --- a/src/resources/alerting/destinations/webhooks.ts +++ b/src/resources/alerting/destinations/webhooks.ts @@ -35,7 +35,7 @@ export class Webhooks extends APIResource { * ```ts * const webhook = * await client.alerting.destinations.webhooks.update( - * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + * 'b115d5ec15c641ee8b7692c449b5227b', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * name: 'Slack Webhook', @@ -90,7 +90,7 @@ export class Webhooks extends APIResource { * ```ts * const webhook = * await client.alerting.destinations.webhooks.delete( - * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + * 'b115d5ec15c641ee8b7692c449b5227b', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -114,7 +114,7 @@ export class Webhooks extends APIResource { * ```ts * const webhooks = * await client.alerting.destinations.webhooks.get( - * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + * 'b115d5ec15c641ee8b7692c449b5227b', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` diff --git a/src/resources/alerting/policies.ts b/src/resources/alerting/policies.ts index c2caed4005..5991ca0862 100644 --- a/src/resources/alerting/policies.ts +++ b/src/resources/alerting/policies.ts @@ -35,7 +35,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.update( - * '0da2b59e-f118-439d-8097-bdfb215203c9', + * '0da2b59ef118439d8097bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -85,7 +85,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.delete( - * '0da2b59e-f118-439d-8097-bdfb215203c9', + * '0da2b59ef118439d8097bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -105,7 +105,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.get( - * '0da2b59e-f118-439d-8097-bdfb215203c9', + * '0da2b59ef118439d8097bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` diff --git a/src/resources/pages/index.ts b/src/resources/pages/index.ts index 2b2862b5c1..ede14daf73 100644 --- a/src/resources/pages/index.ts +++ b/src/resources/pages/index.ts @@ -2,6 +2,7 @@ export { DeploymentsSinglePage, + DeploymentsV4PagePaginationArray, Projects, type Deployment, type Project, diff --git a/src/resources/pages/pages.ts b/src/resources/pages/pages.ts index e92779690f..e0331f786f 100644 --- a/src/resources/pages/pages.ts +++ b/src/resources/pages/pages.ts @@ -4,7 +4,7 @@ import { APIResource } from '../../resource'; import * as ProjectsAPI from './projects/projects'; import { Deployment, - DeploymentsSinglePage, + DeploymentsV4PagePaginationArray, Project, ProjectCreateParams, ProjectDeleteParams, @@ -23,7 +23,7 @@ export class Pages extends APIResource { } Pages.Projects = Projects; -Pages.DeploymentsSinglePage = DeploymentsSinglePage; +Pages.DeploymentsV4PagePaginationArray = DeploymentsV4PagePaginationArray; export declare namespace Pages { export { @@ -33,7 +33,7 @@ export declare namespace Pages { type Stage as Stage, type ProjectDeleteResponse as ProjectDeleteResponse, type ProjectPurgeBuildCacheResponse as ProjectPurgeBuildCacheResponse, - DeploymentsSinglePage as DeploymentsSinglePage, + DeploymentsV4PagePaginationArray as DeploymentsV4PagePaginationArray, type ProjectCreateParams as ProjectCreateParams, type ProjectListParams as ProjectListParams, type ProjectDeleteParams as ProjectDeleteParams, diff --git a/src/resources/pages/projects/index.ts b/src/resources/pages/projects/index.ts index a40f121ec5..867a3f7b6b 100644 --- a/src/resources/pages/projects/index.ts +++ b/src/resources/pages/projects/index.ts @@ -12,6 +12,7 @@ export { } from './deployments/index'; export { DeploymentsSinglePage, + DeploymentsV4PagePaginationArray, Projects, type Deployment, type Project, diff --git a/src/resources/pages/projects/projects.ts b/src/resources/pages/projects/projects.ts index 01225591dc..efac2c7d22 100644 --- a/src/resources/pages/projects/projects.ts +++ b/src/resources/pages/projects/projects.ts @@ -28,7 +28,7 @@ import { DeploymentRollbackParams, Deployments, } from './deployments/deployments'; -import { SinglePage } from '../../../pagination'; +import { SinglePage, V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; export class Projects extends APIResource { deployments: DeploymentsAPI.Deployments = new DeploymentsAPI.Deployments(this._client); @@ -69,9 +69,13 @@ export class Projects extends APIResource { list( params: ProjectListParams, options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id } = params; - return this._client.getAPIList(`/accounts/${account_id}/pages/projects`, DeploymentsSinglePage, options); + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/pages/projects`, + DeploymentsV4PagePaginationArray, + { query, ...options }, + ); } /** @@ -176,6 +180,8 @@ export class Projects extends APIResource { } } +export class DeploymentsV4PagePaginationArray extends V4PagePaginationArray {} + export class DeploymentsSinglePage extends SinglePage {} export interface Deployment { @@ -1641,9 +1647,9 @@ export namespace ProjectCreateParams { } } -export interface ProjectListParams { +export interface ProjectListParams extends V4PagePaginationArrayParams { /** - * Identifier + * Path param: Identifier */ account_id: string; } @@ -2270,7 +2276,7 @@ export interface ProjectPurgeBuildCacheParams { account_id: string; } -Projects.DeploymentsSinglePage = DeploymentsSinglePage; +Projects.DeploymentsV4PagePaginationArray = DeploymentsV4PagePaginationArray; Projects.Deployments = Deployments; Projects.Domains = Domains; Projects.DomainListResponsesSinglePage = DomainListResponsesSinglePage; @@ -2282,7 +2288,7 @@ export declare namespace Projects { type Stage as Stage, type ProjectDeleteResponse as ProjectDeleteResponse, type ProjectPurgeBuildCacheResponse as ProjectPurgeBuildCacheResponse, - DeploymentsSinglePage as DeploymentsSinglePage, + DeploymentsV4PagePaginationArray as DeploymentsV4PagePaginationArray, type ProjectCreateParams as ProjectCreateParams, type ProjectListParams as ProjectListParams, type ProjectDeleteParams as ProjectDeleteParams, diff --git a/src/resources/r2/super-slurper/connectivity-precheck.ts b/src/resources/r2/super-slurper/connectivity-precheck.ts index 654a8193d5..2283824388 100644 --- a/src/resources/r2/super-slurper/connectivity-precheck.ts +++ b/src/resources/r2/super-slurper/connectivity-precheck.ts @@ -13,6 +13,12 @@ export class ConnectivityPrecheck extends APIResource { * const response = * await client.r2.superSlurper.connectivityPrecheck.source({ * account_id: 'account_id', + * bucket: 'bucket', + * secret: { + * accessKeyId: 'accessKeyId', + * secretAccessKey: 'secretAccessKey', + * }, + * vendor: 's3', * }); * ``` */ @@ -37,6 +43,12 @@ export class ConnectivityPrecheck extends APIResource { * const response = * await client.r2.superSlurper.connectivityPrecheck.target({ * account_id: 'account_id', + * bucket: 'bucket', + * secret: { + * accessKeyId: 'accessKeyId', + * secretAccessKey: 'secretAccessKey', + * }, + * vendor: 'r2', * }); * ``` */ @@ -77,7 +89,17 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket?: string; + bucket: string; + + /** + * Body param: + */ + secret: R2SlurperS3SourceSchema.Secret; + + /** + * Body param: + */ + vendor: 's3'; /** * Body param: @@ -87,19 +109,19 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - secret?: R2SlurperS3SourceSchema.Secret; + pathPrefix?: string | null; /** * Body param: */ - vendor?: 's3'; + region?: string | null; } export namespace R2SlurperS3SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } @@ -112,24 +134,29 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket?: string; + bucket: string; + + /** + * Body param: + */ + secret: R2SlurperGcsSourceSchema.Secret; /** * Body param: */ - secret?: R2SlurperGcsSourceSchema.Secret; + vendor: 'gcs'; /** * Body param: */ - vendor?: 'gcs'; + pathPrefix?: string | null; } export namespace R2SlurperGcsSourceSchema { export interface Secret { - clientEmail?: string; + clientEmail: string; - privateKey?: string; + privateKey: string; } } @@ -142,29 +169,34 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket?: string; + bucket: string; /** * Body param: */ - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: R2SlurperR2SourceSchema.Secret; + + /** + * Body param: + */ + vendor: SippyAPI.ProviderParam; /** * Body param: */ - secret?: R2SlurperR2SourceSchema.Secret; + jurisdiction?: 'default' | 'eu' | 'fedramp'; /** * Body param: */ - vendor?: SippyAPI.ProviderParam; + pathPrefix?: string | null; } export namespace R2SlurperR2SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } } @@ -178,29 +210,29 @@ export interface ConnectivityPrecheckTargetParams { /** * Body param: */ - bucket?: string; + bucket: string; /** * Body param: */ - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: ConnectivityPrecheckTargetParams.Secret; /** * Body param: */ - secret?: ConnectivityPrecheckTargetParams.Secret; + vendor: SippyAPI.ProviderParam; /** * Body param: */ - vendor?: SippyAPI.ProviderParam; + jurisdiction?: 'default' | 'eu' | 'fedramp'; } export namespace ConnectivityPrecheckTargetParams { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } diff --git a/src/resources/r2/super-slurper/jobs/jobs.ts b/src/resources/r2/super-slurper/jobs/jobs.ts index 0e70bb10e5..7732e944b1 100644 --- a/src/resources/r2/super-slurper/jobs/jobs.ts +++ b/src/resources/r2/super-slurper/jobs/jobs.ts @@ -360,72 +360,80 @@ export interface JobCreateParams { export namespace JobCreateParams { export interface R2SlurperS3SourceSchema { - bucket?: string; + bucket: string; + + secret: R2SlurperS3SourceSchema.Secret; + + vendor: 's3'; endpoint?: string | null; - secret?: R2SlurperS3SourceSchema.Secret; + pathPrefix?: string | null; - vendor?: 's3'; + region?: string | null; } export namespace R2SlurperS3SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } export interface R2SlurperGcsSourceSchema { - bucket?: string; + bucket: string; - secret?: R2SlurperGcsSourceSchema.Secret; + secret: R2SlurperGcsSourceSchema.Secret; - vendor?: 'gcs'; + vendor: 'gcs'; + + pathPrefix?: string | null; } export namespace R2SlurperGcsSourceSchema { export interface Secret { - clientEmail?: string; + clientEmail: string; - privateKey?: string; + privateKey: string; } } export interface R2SlurperR2SourceSchema { - bucket?: string; + bucket: string; - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: R2SlurperR2SourceSchema.Secret; - secret?: R2SlurperR2SourceSchema.Secret; + vendor: SippyAPI.ProviderParam; + + jurisdiction?: 'default' | 'eu' | 'fedramp'; - vendor?: SippyAPI.ProviderParam; + pathPrefix?: string | null; } export namespace R2SlurperR2SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } export interface Target { - bucket?: string; + bucket: string; - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: Target.Secret; - secret?: Target.Secret; + vendor: SippyAPI.ProviderParam; - vendor?: SippyAPI.ProviderParam; + jurisdiction?: 'default' | 'eu' | 'fedramp'; } export namespace Target { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } } diff --git a/src/resources/radar/as112/summary.ts b/src/resources/radar/as112/summary.ts index c59fdaeb5a..d6034b19c4 100644 --- a/src/resources/radar/as112/summary.ts +++ b/src/resources/radar/as112/summary.ts @@ -9,10 +9,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by DNSSEC (DNS Security * Extensions) support. * - * @example - * ```ts - * const response = await client.radar.as112.summary.dnssec(); - * ``` + * @deprecated */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -34,10 +31,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by EDNS (Extension Mechanisms * for DNS) support. * - * @example - * ```ts - * const response = await client.radar.as112.summary.edns(); - * ``` + * @deprecated */ edns(query?: SummaryEdnsParams, options?: Core.RequestOptions): Core.APIPromise; edns(options?: Core.RequestOptions): Core.APIPromise; @@ -58,11 +52,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by IP version. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -86,11 +76,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by protocol. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.protocol(); - * ``` + * @deprecated */ protocol( query?: SummaryProtocolParams, @@ -114,11 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by type. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.queryType(); - * ``` + * @deprecated */ queryType( query?: SummaryQueryTypeParams, @@ -142,11 +124,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of AS112 DNS requests classified by response code. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.responseCodes(); - * ``` + * @deprecated */ responseCodes( query?: SummaryResponseCodesParams, diff --git a/src/resources/radar/as112/timeseries-groups.ts b/src/resources/radar/as112/timeseries-groups.ts index a9e2aa049c..e5593df35c 100644 --- a/src/resources/radar/as112/timeseries-groups.ts +++ b/src/resources/radar/as112/timeseries-groups.ts @@ -9,11 +9,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by DNSSEC (DNS Security * Extensions) support over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.dnssec(); - * ``` + * @deprecated */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -38,11 +34,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by EDNS (Extension Mechanisms * for DNS) support over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.edns(); - * ``` + * @deprecated */ edns( query?: TimeseriesGroupEdnsParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -96,11 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by protocol over * time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.protocol(); - * ``` + * @deprecated */ protocol( query?: TimeseriesGroupProtocolParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by type over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.queryType(); - * ``` + * @deprecated */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -154,11 +134,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by response code * over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.responseCodes(); - * ``` + * @deprecated */ responseCodes( query?: TimeseriesGroupResponseCodesParams, diff --git a/src/resources/radar/attacks/layer3/summary.ts b/src/resources/radar/attacks/layer3/summary.ts index 73ed7d7c70..bc4ccc4c81 100644 --- a/src/resources/radar/attacks/layer3/summary.ts +++ b/src/resources/radar/attacks/layer3/summary.ts @@ -8,11 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.bitrate(); - * ``` + * @deprecated */ bitrate( query?: SummaryBitrateParams, @@ -36,11 +32,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.duration(); - * ``` + * @deprecated */ duration( query?: SummaryDurationParams, @@ -64,11 +56,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.industry(); - * ``` + * @deprecated */ industry( query?: SummaryIndustryParams, @@ -92,11 +80,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -120,11 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.protocol(); - * ``` + * @deprecated */ protocol( query?: SummaryProtocolParams, @@ -148,11 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.vector(); - * ``` + * @deprecated */ vector(query?: SummaryVectorParams, options?: Core.RequestOptions): Core.APIPromise; vector(options?: Core.RequestOptions): Core.APIPromise; @@ -173,11 +149,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.vertical(); - * ``` + * @deprecated */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer3/timeseries-groups.ts b/src/resources/radar/attacks/layer3/timeseries-groups.ts index 740bb97cae..9f8d171a40 100644 --- a/src/resources/radar/attacks/layer3/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer3/timeseries-groups.ts @@ -8,11 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.bitrate(); - * ``` + * @deprecated */ bitrate( query?: TimeseriesGroupBitrateParams, @@ -37,11 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.duration(); - * ``` + * @deprecated */ duration( query?: TimeseriesGroupDurationParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.industry(); - * ``` + * @deprecated */ industry( query?: TimeseriesGroupIndustryParams, @@ -95,11 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.protocol(); - * ``` + * @deprecated */ protocol( query?: TimeseriesGroupProtocolParams, @@ -153,11 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.vector(); - * ``` + * @deprecated */ vector( query?: TimeseriesGroupVectorParams, @@ -182,11 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.vertical(); - * ``` + * @deprecated */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer7/summary.ts b/src/resources/radar/attacks/layer7/summary.ts index 4afa3d68d0..160eb24dd8 100644 --- a/src/resources/radar/attacks/layer7/summary.ts +++ b/src/resources/radar/attacks/layer7/summary.ts @@ -8,11 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.httpMethod(); - * ``` + * @deprecated */ httpMethod( query?: SummaryHTTPMethodParams, @@ -37,11 +33,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.httpVersion(); - * ``` + * @deprecated */ httpVersion( query?: SummaryHTTPVersionParams, @@ -66,11 +58,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.industry(); - * ``` + * @deprecated */ industry( query?: SummaryIndustryParams, @@ -94,11 +82,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -122,11 +106,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.managedRules(); - * ``` + * @deprecated */ managedRules( query?: SummaryManagedRulesParams, @@ -151,11 +131,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.mitigationProduct(); - * ``` + * @deprecated */ mitigationProduct( query?: SummaryMitigationProductParams, @@ -180,11 +156,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.vertical(); - * ``` + * @deprecated */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer7/timeseries-groups.ts b/src/resources/radar/attacks/layer7/timeseries-groups.ts index ab7e962788..ce7c62ce1e 100644 --- a/src/resources/radar/attacks/layer7/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer7/timeseries-groups.ts @@ -8,11 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.httpMethod(); - * ``` + * @deprecated */ httpMethod( query?: TimeseriesGroupHTTPMethodParams, @@ -37,11 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.httpVersion(); - * ``` + * @deprecated */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.industry(); - * ``` + * @deprecated */ industry( query?: TimeseriesGroupIndustryParams, @@ -95,11 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version used over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.managedRules(); - * ``` + * @deprecated */ managedRules( query?: TimeseriesGroupManagedRulesParams, @@ -153,11 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.mitigationProduct(); - * ``` + * @deprecated */ mitigationProduct( query?: TimeseriesGroupMitigationProductParams, @@ -182,11 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.vertical(); - * ``` + * @deprecated */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/dns/summary.ts b/src/resources/radar/dns/summary.ts index 9bc87aa1f9..575afc929b 100644 --- a/src/resources/radar/dns/summary.ts +++ b/src/resources/radar/dns/summary.ts @@ -8,10 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by cache status. * - * @example - * ```ts - * const response = await client.radar.dns.summary.cacheHit(); - * ``` + * @deprecated */ cacheHit( query?: SummaryCacheHitParams, @@ -36,10 +33,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support. * - * @example - * ```ts - * const response = await client.radar.dns.summary.dnssec(); - * ``` + * @deprecated */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -61,11 +55,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.dnssecAware(); - * ``` + * @deprecated */ dnssecAware( query?: SummaryDNSSECAwareParams, @@ -90,10 +80,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status. * - * @example - * ```ts - * const response = await client.radar.dns.summary.dnssecE2E(); - * ``` + * @deprecated */ dnssecE2E( query?: SummaryDNSSECE2EParams, @@ -117,10 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by IP version. * - * @example - * ```ts - * const response = await client.radar.dns.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -144,11 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.matchingAnswer(); - * ``` + * @deprecated */ matchingAnswer( query?: SummaryMatchingAnswerParams, @@ -172,10 +152,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol. * - * @example - * ```ts - * const response = await client.radar.dns.summary.protocol(); - * ``` + * @deprecated */ protocol( query?: SummaryProtocolParams, @@ -199,10 +176,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by type. * - * @example - * ```ts - * const response = await client.radar.dns.summary.queryType(); - * ``` + * @deprecated */ queryType( query?: SummaryQueryTypeParams, @@ -226,11 +200,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by response code. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.responseCode(); - * ``` + * @deprecated */ responseCode( query?: SummaryResponseCodeParams, @@ -254,11 +224,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by minimum response TTL. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.responseTTL(); - * ``` + * @deprecated */ responseTTL( query?: SummaryResponseTTLParams, diff --git a/src/resources/radar/dns/timeseries-groups.ts b/src/resources/radar/dns/timeseries-groups.ts index 9a242a93fb..5e1ea8a4e1 100644 --- a/src/resources/radar/dns/timeseries-groups.ts +++ b/src/resources/radar/dns/timeseries-groups.ts @@ -8,11 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by cache status over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.cacheHit(); - * ``` + * @deprecated */ cacheHit( query?: TimeseriesGroupCacheHitParams, @@ -37,11 +33,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.dnssec(); - * ``` + * @deprecated */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.dnssecAware(); - * ``` + * @deprecated */ dnssecAware( query?: TimeseriesGroupDNSSECAwareParams, @@ -96,11 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.dnssecE2E(); - * ``` + * @deprecated */ dnssecE2E( query?: TimeseriesGroupDNSSECE2EParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -152,11 +132,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.matchingAnswer(); - * ``` + * @deprecated */ matchingAnswer( query?: TimeseriesGroupMatchingAnswerParams, @@ -181,11 +157,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.protocol(); - * ``` + * @deprecated */ protocol( query?: TimeseriesGroupProtocolParams, @@ -209,11 +181,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by type over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.queryType(); - * ``` + * @deprecated */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -237,11 +205,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by response code over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.responseCode(); - * ``` + * @deprecated */ responseCode( query?: TimeseriesGroupResponseCodeParams, @@ -266,11 +230,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by minimum answer TTL over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.responseTTL(); - * ``` + * @deprecated */ responseTTL( query?: TimeseriesGroupResponseTTLParams, diff --git a/src/resources/radar/email/routing/summary.ts b/src/resources/radar/email/routing/summary.ts index 4085dc05e9..00defd2b84 100644 --- a/src/resources/radar/email/routing/summary.ts +++ b/src/resources/radar/email/routing/summary.ts @@ -10,11 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.arc(); - * ``` + * @deprecated */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -36,11 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.dkim(); - * ``` + * @deprecated */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -62,11 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.dmarc(); - * ``` + * @deprecated */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -88,11 +76,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted). * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.encrypted(); - * ``` + * @deprecated */ encrypted( query?: SummaryEncryptedParams, @@ -116,11 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by IP version. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -145,11 +125,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.spf(); - * ``` + * @deprecated */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/email/routing/timeseries-groups.ts b/src/resources/radar/email/routing/timeseries-groups.ts index c398945534..3a9801b143 100644 --- a/src/resources/radar/email/routing/timeseries-groups.ts +++ b/src/resources/radar/email/routing/timeseries-groups.ts @@ -10,11 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.arc(); - * ``` + * @deprecated */ arc( query?: TimeseriesGroupARCParams, @@ -40,11 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.dkim(); - * ``` + * @deprecated */ dkim( query?: TimeseriesGroupDKIMParams, @@ -70,11 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.dmarc(); - * ``` + * @deprecated */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -100,11 +88,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted) over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.encrypted(); - * ``` + * @deprecated */ encrypted( query?: TimeseriesGroupEncryptedParams, @@ -129,11 +113,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -159,11 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.spf(); - * ``` + * @deprecated */ spf( query?: TimeseriesGroupSPFParams, diff --git a/src/resources/radar/email/security/summary.ts b/src/resources/radar/email/security/summary.ts index 3a984c2f4f..5136a742ff 100644 --- a/src/resources/radar/email/security/summary.ts +++ b/src/resources/radar/email/security/summary.ts @@ -10,11 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.arc(); - * ``` + * @deprecated */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -36,11 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.dkim(); - * ``` + * @deprecated */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -62,11 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.dmarc(); - * ``` + * @deprecated */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -87,11 +75,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by malicious classification. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.malicious(); - * ``` + * @deprecated */ malicious( query?: SummaryMaliciousParams, @@ -115,11 +99,7 @@ export class Summary extends APIResource { /** * Retrieves the proportion of emails by spam classification (spam vs. non-spam). * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.spam(); - * ``` + * @deprecated */ spam(query?: SummarySpamParams, options?: Core.RequestOptions): Core.APIPromise; spam(options?: Core.RequestOptions): Core.APIPromise; @@ -141,11 +121,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.spf(); - * ``` + * @deprecated */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; @@ -167,11 +143,7 @@ export class Summary extends APIResource { * Retrieves the proportion of emails by spoof classification (spoof vs. * non-spoof). * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.spoof(); - * ``` + * @deprecated */ spoof(query?: SummarySpoofParams, options?: Core.RequestOptions): Core.APIPromise; spoof(options?: Core.RequestOptions): Core.APIPromise; @@ -192,11 +164,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by threat categories. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.threatCategory(); - * ``` + * @deprecated */ threatCategory( query?: SummaryThreatCategoryParams, @@ -221,11 +189,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by TLS version. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.tlsVersion(); - * ``` + * @deprecated */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/email/security/timeseries-groups.ts b/src/resources/radar/email/security/timeseries-groups.ts index 2fb9bbef99..aa620088a0 100644 --- a/src/resources/radar/email/security/timeseries-groups.ts +++ b/src/resources/radar/email/security/timeseries-groups.ts @@ -10,11 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.arc(); - * ``` + * @deprecated */ arc( query?: TimeseriesGroupARCParams, @@ -40,11 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.dkim(); - * ``` + * @deprecated */ dkim( query?: TimeseriesGroupDKIMParams, @@ -70,11 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.dmarc(); - * ``` + * @deprecated */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -99,11 +87,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by malicious classification over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.malicious(); - * ``` + * @deprecated */ malicious( query?: TimeseriesGroupMaliciousParams, @@ -129,11 +113,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spam classification (spam vs. non-spam) * over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.spam(); - * ``` + * @deprecated */ spam( query?: TimeseriesGroupSpamParams, @@ -159,11 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.spf(); - * ``` + * @deprecated */ spf( query?: TimeseriesGroupSPFParams, @@ -189,11 +165,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spoof classification (spoof vs. * non-spoof) over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.spoof(); - * ``` + * @deprecated */ spoof( query?: TimeseriesGroupSpoofParams, @@ -218,11 +190,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by threat category over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.threatCategory(); - * ``` + * @deprecated */ threatCategory( query?: TimeseriesGroupThreatCategoryParams, @@ -247,11 +215,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by TLS version over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.tlsVersion(); - * ``` + * @deprecated */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/entities/asns.ts b/src/resources/radar/entities/asns.ts index 66ecf4a6e9..7697e9dd84 100644 --- a/src/resources/radar/entities/asns.ts +++ b/src/resources/radar/entities/asns.ts @@ -194,10 +194,20 @@ export namespace ASNAsSetResponse { */ name: string; + /** + * The AS number following hierarchical AS-SET name + */ + hierarchical_asn?: number; + /** * The inferred AS number of the AS-SET */ - asn?: number; + inferred_asn?: number; + + /** + * The AS number matching PeeringDB record + */ + peeringdb_asn?: number; } } diff --git a/src/resources/radar/netflows/netflows.ts b/src/resources/radar/netflows/netflows.ts index c484510bb6..55c05d441b 100644 --- a/src/resources/radar/netflows/netflows.ts +++ b/src/resources/radar/netflows/netflows.ts @@ -13,7 +13,7 @@ export class Netflows extends APIResource { * Retrieves the distribution of network traffic (NetFlows) by HTTP vs other * protocols. * - * @deprecated + * @deprecated Use [Get Network Traffic Distribution By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/netflows/methods/summary_v2/) instead. */ summary( query?: NetflowSummaryParams, diff --git a/src/resources/stream/downloads.ts b/src/resources/stream/downloads.ts index a9d2589f13..1fd7a50c02 100644 --- a/src/resources/stream/downloads.ts +++ b/src/resources/stream/downloads.ts @@ -6,7 +6,8 @@ import * as Core from '../../core'; export class Downloads extends APIResource { /** * Creates a download for a video when a video is ready to view. Use - * `/downloads/{download_type}` instead for type-specific downloads. + * `/downloads/{download_type}` instead for type-specific downloads. Available + * types are `default` and `audio`. * * @example * ```ts @@ -35,7 +36,7 @@ export class Downloads extends APIResource { /** * Delete the downloads for a video. Use `/downloads/{download_type}` instead for - * type-specific downloads. + * type-specific downloads. Available types are `default` and `audio`. * * @example * ```ts diff --git a/src/resources/workers/scripts/versions.ts b/src/resources/workers/scripts/versions.ts index d4334609ad..c07bc881ba 100644 --- a/src/resources/workers/scripts/versions.ts +++ b/src/resources/workers/scripts/versions.ts @@ -1634,6 +1634,11 @@ export namespace VersionCreateParams { export namespace Metadata { export interface Annotations { + /** + * Associated alias for a version. + */ + 'workers/alias'?: string; + /** * Human-readable message about the version. Truncated to 100 bytes. */ diff --git a/src/resources/zones/settings.ts b/src/resources/zones/settings.ts index 0838680bb9..4a3ad6c613 100644 --- a/src/resources/zones/settings.ts +++ b/src/resources/zones/settings.ts @@ -301,13 +301,8 @@ export interface BrowserCacheTTL { id?: 'browser_cache_ttl'; /** - * The number of seconds to cache resources for. Minimum values by plan: - * - * - Free: 7200 seconds (2 hours) - * - Pro: 3600 seconds (1 hour) - * - Business: 1 second - * - Enterprise: 1 second Setting this to 0 enables "Respect Existing Headers" and - * is allowed for all plans. + * The number of seconds to cache resources for. Setting this to 0 enables "Respect + * Existing Headers". */ value?: number; } @@ -319,13 +314,8 @@ export interface BrowserCacheTTLParam { id?: 'browser_cache_ttl'; /** - * The number of seconds to cache resources for. Minimum values by plan: - * - * - Free: 7200 seconds (2 hours) - * - Pro: 3600 seconds (1 hour) - * - Business: 1 second - * - Enterprise: 1 second Setting this to 0 enables "Respect Existing Headers" and - * is allowed for all plans. + * The number of seconds to cache resources for. Setting this to 0 enables "Respect + * Existing Headers". */ value?: number; } @@ -1102,6 +1092,10 @@ export interface PseudoIPV4 { modified_on?: string | null; } +/** + * @deprecated This page rule is deprecated. This functionality is no longer + * supported. + */ export interface ResponseBuffering { /** * Turn on or off whether Cloudflare should wait for an entire file from the origin @@ -1116,6 +1110,10 @@ export interface ResponseBuffering { value?: 'on' | 'off'; } +/** + * @deprecated This page rule is deprecated. This functionality is no longer + * supported. + */ export interface ResponseBufferingParam { /** * Turn on or off whether Cloudflare should wait for an entire file from the origin @@ -2215,10 +2213,8 @@ export namespace SettingEditResponse { } /** - * Enables or disables buffering of responses from the proxied server. Cloudflare - * may buffer the whole payload to deliver it at once to the client versus allowing - * it to be delivered in chunks. By default, the proxied server streams directly - * and is not buffered by Cloudflare. This is limited to Enterprise Zones. + * @deprecated This zone setting is deprecated. This functionality is no longer + * supported. */ export interface ZonesSchemasResponseBuffering { /** @@ -3258,10 +3254,8 @@ export namespace SettingGetResponse { } /** - * Enables or disables buffering of responses from the proxied server. Cloudflare - * may buffer the whole payload to deliver it at once to the client versus allowing - * it to be delivered in chunks. By default, the proxied server streams directly - * and is not buffered by Cloudflare. This is limited to Enterprise Zones. + * @deprecated This zone setting is deprecated. This functionality is no longer + * supported. */ export interface ZonesSchemasResponseBuffering { /** diff --git a/tests/api-resources/alerting/destinations/webhooks.test.ts b/tests/api-resources/alerting/destinations/webhooks.test.ts index 400214bb31..f7e64ac407 100644 --- a/tests/api-resources/alerting/destinations/webhooks.test.ts +++ b/tests/api-resources/alerting/destinations/webhooks.test.ts @@ -38,14 +38,11 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('update: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.update( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'Slack Webhook', - url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', - }, - ); + const responsePromise = client.alerting.destinations.webhooks.update('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'Slack Webhook', + url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -57,15 +54,12 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('update: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.update( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'Slack Webhook', - url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', - secret: 'secret', - }, - ); + const response = await client.alerting.destinations.webhooks.update('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'Slack Webhook', + url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + secret: 'secret', + }); }); test('list: only required params', async () => { @@ -88,10 +82,9 @@ describe('resource webhooks', () => { }); test('delete: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.delete( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); + const responsePromise = client.alerting.destinations.webhooks.delete('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -102,18 +95,16 @@ describe('resource webhooks', () => { }); test('delete: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.delete( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); + const response = await client.alerting.destinations.webhooks.delete('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('get: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.get( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); + const responsePromise = client.alerting.destinations.webhooks.get('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -125,7 +116,7 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('get: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.get('b115d5ec-15c6-41ee-8b76-92c449b5227b', { + const response = await client.alerting.destinations.webhooks.get('b115d5ec15c641ee8b7692c449b5227b', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/alerting/policies.test.ts b/tests/api-resources/alerting/policies.test.ts index aed5640624..3de56f13b7 100644 --- a/tests/api-resources/alerting/policies.test.ts +++ b/tests/api-resources/alerting/policies.test.ts @@ -35,9 +35,9 @@ describe('resource policies', () => { alert_type: 'universal_ssl_event_type', enabled: true, mechanisms: { - email: [{ id: 'test@example.com' }], - pagerduty: [{ id: 'e8133a15-00a4-4d69-aec1-32f70c51f6e5' }], - webhooks: [{ id: '14cc1190-5d2b-4b98-a696-c424cb2ad05f' }], + email: [{ id: 'id' }], + pagerduty: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], + webhooks: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], }, name: 'SSL Notification Event Policy', alert_interval: '30m', @@ -91,7 +91,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('update: only required params', async () => { - const responsePromise = client.alerting.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', { + const responsePromise = client.alerting.policies.update('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -105,7 +105,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('update: required and optional params', async () => { - const response = await client.alerting.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', { + const response = await client.alerting.policies.update('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', alert_interval: '30m', alert_type: 'universal_ssl_event_type', @@ -156,9 +156,9 @@ describe('resource policies', () => { zones: ['string'], }, mechanisms: { - email: [{ id: 'test@example.com' }], - pagerduty: [{ id: 'e8133a15-00a4-4d69-aec1-32f70c51f6e5' }], - webhooks: [{ id: '14cc1190-5d2b-4b98-a696-c424cb2ad05f' }], + email: [{ id: 'id' }], + pagerduty: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], + webhooks: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], }, name: 'SSL Notification Event Policy', }); @@ -180,7 +180,7 @@ describe('resource policies', () => { }); test('delete: only required params', async () => { - const responsePromise = client.alerting.policies.delete('0da2b59e-f118-439d-8097-bdfb215203c9', { + const responsePromise = client.alerting.policies.delete('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -193,14 +193,14 @@ describe('resource policies', () => { }); test('delete: required and optional params', async () => { - const response = await client.alerting.policies.delete('0da2b59e-f118-439d-8097-bdfb215203c9', { + const response = await client.alerting.policies.delete('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('get: only required params', async () => { - const responsePromise = client.alerting.policies.get('0da2b59e-f118-439d-8097-bdfb215203c9', { + const responsePromise = client.alerting.policies.get('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -214,7 +214,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('get: required and optional params', async () => { - const response = await client.alerting.policies.get('0da2b59e-f118-439d-8097-bdfb215203c9', { + const response = await client.alerting.policies.get('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/pages/projects/projects.test.ts b/tests/api-resources/pages/projects/projects.test.ts index 2057a0124d..41a92b2403 100644 --- a/tests/api-resources/pages/projects/projects.test.ts +++ b/tests/api-resources/pages/projects/projects.test.ts @@ -115,7 +115,11 @@ describe('resource projects', () => { }); test('list: required and optional params', async () => { - const response = await client.pages.projects.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const response = await client.pages.projects.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + page: 1, + per_page: 10, + }); }); test('delete: only required params', async () => { diff --git a/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts b/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts index c3238ed19b..597bcca970 100644 --- a/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts +++ b/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts @@ -11,7 +11,12 @@ const client = new Cloudflare({ describe('resource connectivityPrecheck', () => { test('source: only required params', async () => { - const responsePromise = client.r2.superSlurper.connectivityPrecheck.source({ account_id: 'account_id' }); + const responsePromise = client.r2.superSlurper.connectivityPrecheck.source({ + account_id: 'account_id', + bucket: 'bucket', + secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, + vendor: 's3', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,14 +30,21 @@ describe('resource connectivityPrecheck', () => { const response = await client.r2.superSlurper.connectivityPrecheck.source({ account_id: 'account_id', bucket: 'bucket', - endpoint: 'endpoint', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 's3', + endpoint: 'endpoint', + pathPrefix: 'pathPrefix', + region: 'region', }); }); test('target: only required params', async () => { - const responsePromise = client.r2.superSlurper.connectivityPrecheck.target({ account_id: 'account_id' }); + const responsePromise = client.r2.superSlurper.connectivityPrecheck.target({ + account_id: 'account_id', + bucket: 'bucket', + secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, + vendor: 'r2', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -46,9 +58,9 @@ describe('resource connectivityPrecheck', () => { const response = await client.r2.superSlurper.connectivityPrecheck.target({ account_id: 'account_id', bucket: 'bucket', - jurisdiction: 'default', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 'r2', + jurisdiction: 'default', }); }); }); diff --git a/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts b/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts index 8376af108a..e2806bfb82 100644 --- a/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts +++ b/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts @@ -27,15 +27,17 @@ describe('resource jobs', () => { overwrite: true, source: { bucket: 'bucket', - endpoint: 'endpoint', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 's3', + endpoint: 'endpoint', + pathPrefix: 'pathPrefix', + region: 'region', }, target: { bucket: 'bucket', - jurisdiction: 'default', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 'r2', + jurisdiction: 'default', }, }); }); diff --git a/tests/api-resources/workers/scripts/versions.test.ts b/tests/api-resources/workers/scripts/versions.test.ts index 82c89f8328..437f382fd7 100644 --- a/tests/api-resources/workers/scripts/versions.test.ts +++ b/tests/api-resources/workers/scripts/versions.test.ts @@ -31,7 +31,11 @@ describe('resource versions', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', metadata: { main_module: 'worker.js', - annotations: { 'workers/message': 'Fixed worker code.', 'workers/tag': 'workers/tag' }, + annotations: { + 'workers/alias': 'staging', + 'workers/message': 'Fixed worker code.', + 'workers/tag': 'workers/tag', + }, bindings: [{ name: 'MY_ENV_VAR', text: 'my_data', type: 'plain_text' }], compatibility_date: '2021-01-01', compatibility_flags: ['nodejs_compat'], From 06f922349bd6240de4ada569b17d9e8b71c3c988 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 12:26:41 +0000 Subject: [PATCH 003/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d3fa9fc00d..a96cbaf996 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04d690a4c4e9c1e193ed3daed3e4a27fdb70dfd27aae505f16a2db4a59cd6793.yml -openapi_spec_hash: 902bd6518dab40dd55bfeb3ed94ffc7f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5172b3168331d41dc62cce06d8a009b0463d0c6265d4e582c7aa4541b36ddaa8.yml +openapi_spec_hash: 473cb4b65ccabb26fdee3e9df96b8afd config_hash: 107e0f1f8a98b007260b319226b88b3c From ff417daaa77c70e2e68aa5306174f16c5a0ee4b8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 12:28:24 +0000 Subject: [PATCH 004/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a96cbaf996..90aa103726 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5172b3168331d41dc62cce06d8a009b0463d0c6265d4e582c7aa4541b36ddaa8.yml -openapi_spec_hash: 473cb4b65ccabb26fdee3e9df96b8afd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9b6e8ab1bd98c31e547acd9a362dd37f6c99b5374b8704656bcacbd907b2fecf.yml +openapi_spec_hash: 3555741ffe1182a65afc82cc9d8a3b8e config_hash: 107e0f1f8a98b007260b319226b88b3c From 3e172d83bbf911d9b93f90bdf4eec5ed18fa8f5b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 13:10:54 +0000 Subject: [PATCH 005/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 90aa103726..a96cbaf996 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9b6e8ab1bd98c31e547acd9a362dd37f6c99b5374b8704656bcacbd907b2fecf.yml -openapi_spec_hash: 3555741ffe1182a65afc82cc9d8a3b8e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5172b3168331d41dc62cce06d8a009b0463d0c6265d4e582c7aa4541b36ddaa8.yml +openapi_spec_hash: 473cb4b65ccabb26fdee3e9df96b8afd config_hash: 107e0f1f8a98b007260b319226b88b3c From 4804e746b3d6725f2b9fb41f8aa7a16cfb1ef5c2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 13:12:31 +0000 Subject: [PATCH 006/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a96cbaf996..44ac413cd0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5172b3168331d41dc62cce06d8a009b0463d0c6265d4e582c7aa4541b36ddaa8.yml -openapi_spec_hash: 473cb4b65ccabb26fdee3e9df96b8afd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b67fbd6354a04a99b4aabe846de0e130c31d5fb3494350e1beda0673fc2d6b2e.yml +openapi_spec_hash: fd30c4d5c962417249bb0b108c17d2db config_hash: 107e0f1f8a98b007260b319226b88b3c From f42a3a7754216ce097b5fefca25b064460f7d94f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 13:26:42 +0000 Subject: [PATCH 007/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 44ac413cd0..3c1c2ab177 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b67fbd6354a04a99b4aabe846de0e130c31d5fb3494350e1beda0673fc2d6b2e.yml -openapi_spec_hash: fd30c4d5c962417249bb0b108c17d2db +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6aa366a0c97409615fe48ff1c4bee5ea9abf54903092b3b81c4047210bcad39d.yml +openapi_spec_hash: 0f692ae2fa408640947890f2d6245536 config_hash: 107e0f1f8a98b007260b319226b88b3c From aaf917c96218bcc574c7f1212b49d3186af3fc04 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 13:51:11 +0000 Subject: [PATCH 008/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3c1c2ab177..12ff249ce6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6aa366a0c97409615fe48ff1c4bee5ea9abf54903092b3b81c4047210bcad39d.yml -openapi_spec_hash: 0f692ae2fa408640947890f2d6245536 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1dc6364e113f0ef5fd5ad80a1bb0be3de5079fed0e7f106495ecd8cb570c240e.yml +openapi_spec_hash: 2019a1df67d77926725688aa6538cf4f config_hash: 107e0f1f8a98b007260b319226b88b3c From 40edffd63923b542ca759c7b64c386ba9642de9e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 13:52:57 +0000 Subject: [PATCH 009/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 12ff249ce6..f9aea78af0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1dc6364e113f0ef5fd5ad80a1bb0be3de5079fed0e7f106495ecd8cb570c240e.yml -openapi_spec_hash: 2019a1df67d77926725688aa6538cf4f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-24fe94e0d6636d4c7345aadcd03c593de56e7f5dd9ea4c23d9d06fbf534d2db2.yml +openapi_spec_hash: c4dda2fde35dec529d977a9f98071b9a config_hash: 107e0f1f8a98b007260b319226b88b3c From c295bdde067cd0e82461e7c77fa4487370713b5c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 14:24:58 +0000 Subject: [PATCH 010/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f9aea78af0..4c66979d72 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-24fe94e0d6636d4c7345aadcd03c593de56e7f5dd9ea4c23d9d06fbf534d2db2.yml -openapi_spec_hash: c4dda2fde35dec529d977a9f98071b9a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-571f1debc8e63cbc59b33302aa8c0f7e57779c3bf22ef1096864d296f18bb098.yml +openapi_spec_hash: 2b16a59b556bc2e2a2cb629675e270e9 config_hash: 107e0f1f8a98b007260b319226b88b3c From 710fdc56a21b790eca7ceb6fb9ddbb0407e9f553 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 14:26:35 +0000 Subject: [PATCH 011/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4c66979d72..af373819bc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-571f1debc8e63cbc59b33302aa8c0f7e57779c3bf22ef1096864d296f18bb098.yml -openapi_spec_hash: 2b16a59b556bc2e2a2cb629675e270e9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c9c26403ed2c9e6bfa7b83f1be66375b7b6b5642ac2c70209b599bd7517eaceb.yml +openapi_spec_hash: 9a1047da703e12d606096d20d61683ea config_hash: 107e0f1f8a98b007260b319226b88b3c From cd6f5f9bd2c905bc3373435311230cadc749a2ec Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 14:35:17 +0000 Subject: [PATCH 012/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index af373819bc..b91295b41a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c9c26403ed2c9e6bfa7b83f1be66375b7b6b5642ac2c70209b599bd7517eaceb.yml -openapi_spec_hash: 9a1047da703e12d606096d20d61683ea +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9be4234db8d3a4dc416a5377e8bdec2b3f724527526b1743b060799802f72498.yml +openapi_spec_hash: 4904dca83e16f0da9827d99c58338e8d config_hash: 107e0f1f8a98b007260b319226b88b3c From 2df62954a40feae7070f43266fcfe4671aa6c9db Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 14:36:56 +0000 Subject: [PATCH 013/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b91295b41a..af373819bc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9be4234db8d3a4dc416a5377e8bdec2b3f724527526b1743b060799802f72498.yml -openapi_spec_hash: 4904dca83e16f0da9827d99c58338e8d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c9c26403ed2c9e6bfa7b83f1be66375b7b6b5642ac2c70209b599bd7517eaceb.yml +openapi_spec_hash: 9a1047da703e12d606096d20d61683ea config_hash: 107e0f1f8a98b007260b319226b88b3c From 8ac1f02f8331b97a75b5b3663afdfcaa386cca11 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 14:38:36 +0000 Subject: [PATCH 014/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index af373819bc..e66e0c6bfa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c9c26403ed2c9e6bfa7b83f1be66375b7b6b5642ac2c70209b599bd7517eaceb.yml -openapi_spec_hash: 9a1047da703e12d606096d20d61683ea +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dc85b9602a2121470011eed2dc6e4c57d44b42c88e91421426a38a4bcdc5af4b.yml +openapi_spec_hash: 1cf30f6f7de381d58a0ab3ae2c256da4 config_hash: 107e0f1f8a98b007260b319226b88b3c From d2de6282906ef11d2a7386b9395e0856f0668746 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 15:19:28 +0000 Subject: [PATCH 015/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e66e0c6bfa..1b2d67b005 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dc85b9602a2121470011eed2dc6e4c57d44b42c88e91421426a38a4bcdc5af4b.yml -openapi_spec_hash: 1cf30f6f7de381d58a0ab3ae2c256da4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cd2e3166c140de7ce9aea4624294ca908024d6f69f940bbc1e1ecb3849024bc6.yml +openapi_spec_hash: b46a43636d5d233304475e2267c771fe config_hash: 107e0f1f8a98b007260b319226b88b3c From 10bfa92be31281375ec132134a413cfe80870a5e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 15:23:19 +0000 Subject: [PATCH 016/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1b2d67b005..5af9635fb7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cd2e3166c140de7ce9aea4624294ca908024d6f69f940bbc1e1ecb3849024bc6.yml -openapi_spec_hash: b46a43636d5d233304475e2267c771fe +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a3736df8c0ff4b844dd241b3568597757220226d32e6ae00d21c4dd282008edb.yml +openapi_spec_hash: 254d8cd4faecf90574a85dd47572f2ca config_hash: 107e0f1f8a98b007260b319226b88b3c From b1609d241ac08658aa5547a01c50b2ff7bd8938c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 15:29:47 +0000 Subject: [PATCH 017/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5af9635fb7..f9aea78af0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a3736df8c0ff4b844dd241b3568597757220226d32e6ae00d21c4dd282008edb.yml -openapi_spec_hash: 254d8cd4faecf90574a85dd47572f2ca +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-24fe94e0d6636d4c7345aadcd03c593de56e7f5dd9ea4c23d9d06fbf534d2db2.yml +openapi_spec_hash: c4dda2fde35dec529d977a9f98071b9a config_hash: 107e0f1f8a98b007260b319226b88b3c From 0e2e7090fc3ef234e2e01db0fe12e9c4e6842abd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 15:31:41 +0000 Subject: [PATCH 018/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f9aea78af0..3c1c2ab177 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-24fe94e0d6636d4c7345aadcd03c593de56e7f5dd9ea4c23d9d06fbf534d2db2.yml -openapi_spec_hash: c4dda2fde35dec529d977a9f98071b9a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6aa366a0c97409615fe48ff1c4bee5ea9abf54903092b3b81c4047210bcad39d.yml +openapi_spec_hash: 0f692ae2fa408640947890f2d6245536 config_hash: 107e0f1f8a98b007260b319226b88b3c From ebb7b3d2f1250a5cf29a523c384a85ca228f640f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 15:33:37 +0000 Subject: [PATCH 019/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3c1c2ab177..409dbf5a1f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6aa366a0c97409615fe48ff1c4bee5ea9abf54903092b3b81c4047210bcad39d.yml -openapi_spec_hash: 0f692ae2fa408640947890f2d6245536 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8e442fce0dce2e390b39c69d751c1b58044f37132fd9c5a6b62b0454b8e3d2b5.yml +openapi_spec_hash: 63128c5acd4c35d5adf4ffb260450f00 config_hash: 107e0f1f8a98b007260b319226b88b3c From b2ea18346b0aa9282478e5904d40c1fcc578829c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 15:37:36 +0000 Subject: [PATCH 020/451] chore(api): update composite API spec --- .stats.yml | 4 +- .../dispatch/namespaces/scripts/bindings.ts | 2 +- .../dispatch/namespaces/scripts/scripts.ts | 2 +- .../dispatch/namespaces/scripts/settings.ts | 6 +- .../workers/beta/workers/versions.ts | 4 +- src/resources/workers/beta/workers/workers.ts | 138 ++++++++++++++++++ .../scripts/script-and-version-settings.ts | 6 +- src/resources/workers/scripts/scripts.ts | 2 +- src/resources/workers/scripts/versions.ts | 6 +- 9 files changed, 154 insertions(+), 16 deletions(-) diff --git a/.stats.yml b/.stats.yml index 409dbf5a1f..4298fd9111 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8e442fce0dce2e390b39c69d751c1b58044f37132fd9c5a6b62b0454b8e3d2b5.yml -openapi_spec_hash: 63128c5acd4c35d5adf4ffb260450f00 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-da898c50e812b8d004199a66cbadb1ce43450928a6700f9fa0d7ae26d61df08b.yml +openapi_spec_hash: bd9a337e74a90fd0e886dbea5631766e config_hash: 107e0f1f8a98b007260b319226b88b3c diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts index 8b15a53e2d..4af2451c88 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts @@ -168,7 +168,7 @@ export namespace BindingGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; 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 9170366dbd..78e5e95423 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -616,7 +616,7 @@ export namespace ScriptUpdateParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; 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 fea3a53ffc..216456a041 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -247,7 +247,7 @@ export namespace SettingEditResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -999,7 +999,7 @@ export namespace SettingGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1769,7 +1769,7 @@ export namespace SettingEditParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; diff --git a/src/resources/workers/beta/workers/versions.ts b/src/resources/workers/beta/workers/versions.ts index 300510fc56..185cea7033 100644 --- a/src/resources/workers/beta/workers/versions.ts +++ b/src/resources/workers/beta/workers/versions.ts @@ -409,7 +409,7 @@ export namespace Version { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1263,7 +1263,7 @@ export namespace VersionCreateParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; diff --git a/src/resources/workers/beta/workers/workers.ts b/src/resources/workers/beta/workers/workers.ts index ba7791704e..d4e49b0055 100644 --- a/src/resources/workers/beta/workers/workers.ts +++ b/src/resources/workers/beta/workers/workers.ts @@ -193,6 +193,11 @@ export interface Worker { */ observability: Worker.Observability; + /** + * Other resources that reference the Worker and depend on it existing. + */ + references: Worker.References; + /** * Subdomain settings for the Worker. */ @@ -259,6 +264,139 @@ export namespace Worker { } } + /** + * Other resources that reference the Worker and depend on it existing. + */ + export interface References { + /** + * Other Workers that reference the Worker as an outbound for a dispatch namespace. + */ + dispatch_namespace_outbounds: Array; + + /** + * Custom domains connected to the Worker. + */ + domains: Array; + + /** + * Other Workers that reference Durable Object classes implemented by the Worker. + */ + durable_objects: Array; + + /** + * Queues that send messages to the Worker. + */ + queues: Array; + + /** + * Other Workers that reference the Worker using + * [service bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/). + */ + workers: Array; + } + + export namespace References { + export interface DispatchNamespaceOutbound { + /** + * ID of the dispatch namespace. + */ + namespace_id: string; + + /** + * Name of the dispatch namespace. + */ + namespace_name: string; + + /** + * ID of the Worker using the dispatch namespace. + */ + worker_id: string; + + /** + * Name of the Worker using the dispatch namespace. + */ + worker_name: string; + } + + export interface Domain { + /** + * ID of the custom domain. + */ + id: string; + + /** + * ID of the TLS certificate issued for the custom domain. + */ + certificate_id: string; + + /** + * Full hostname of the custom domain, including the zone name. + */ + hostname: string; + + /** + * ID of the zone. + */ + zone_id: string; + + /** + * Name of the zone. + */ + zone_name: string; + } + + export interface DurableObject { + /** + * ID of the Durable Object namespace being used. + */ + namespace_id: string; + + /** + * Name of the Durable Object namespace being used. + */ + namespace_name: string; + + /** + * ID of the Worker using the Durable Object implementation. + */ + worker_id: string; + + /** + * Name of the Worker using the Durable Object implementation. + */ + worker_name: string; + } + + export interface Queue { + /** + * ID of the queue consumer configuration. + */ + queue_consumer_id: string; + + /** + * ID of the queue. + */ + queue_id: string; + + /** + * Name of the queue. + */ + queue_name: string; + } + + export interface Worker { + /** + * ID of the referencing Worker. + */ + id: string; + + /** + * Name of the referencing Worker. + */ + name: string; + } + } + /** * Subdomain settings for the Worker. */ diff --git a/src/resources/workers/scripts/script-and-version-settings.ts b/src/resources/workers/scripts/script-and-version-settings.ts index 05bc7152a0..d6ef7552ca 100644 --- a/src/resources/workers/scripts/script-and-version-settings.ts +++ b/src/resources/workers/scripts/script-and-version-settings.ts @@ -243,7 +243,7 @@ export namespace ScriptAndVersionSettingEditResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -995,7 +995,7 @@ export namespace ScriptAndVersionSettingGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1765,7 +1765,7 @@ export namespace ScriptAndVersionSettingEditParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index d96bb354dc..70546d5580 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -925,7 +925,7 @@ export namespace ScriptUpdateParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; diff --git a/src/resources/workers/scripts/versions.ts b/src/resources/workers/scripts/versions.ts index c07bc881ba..c9027b6f0c 100644 --- a/src/resources/workers/scripts/versions.ts +++ b/src/resources/workers/scripts/versions.ts @@ -245,7 +245,7 @@ export namespace VersionCreateResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -981,7 +981,7 @@ export namespace VersionGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1745,7 +1745,7 @@ export namespace VersionCreateParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; From cb86be162fad39d06b7d9d8e6577c820584086ab Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 16:05:29 +0000 Subject: [PATCH 021/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4298fd9111..74d98e8eae 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-da898c50e812b8d004199a66cbadb1ce43450928a6700f9fa0d7ae26d61df08b.yml -openapi_spec_hash: bd9a337e74a90fd0e886dbea5631766e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e72bea1cac5e5deaf366b954dc79ebc69af2ff2ebaeba7db2d1c7b5c2c199422.yml +openapi_spec_hash: fd6022951e9e6a5bb2a436b3717ae0a2 config_hash: 107e0f1f8a98b007260b319226b88b3c From 12b6809278736db05c4bfed974e40ba37d07bc19 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 16:07:28 +0000 Subject: [PATCH 022/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 74d98e8eae..b3477d0701 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e72bea1cac5e5deaf366b954dc79ebc69af2ff2ebaeba7db2d1c7b5c2c199422.yml -openapi_spec_hash: fd6022951e9e6a5bb2a436b3717ae0a2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9c002df6c6110e7f2fa55aee367ae282e9a2c1448b577ecd209be6df21d98ead.yml +openapi_spec_hash: af2939e2bdae76e43d7e11d0528f394e config_hash: 107e0f1f8a98b007260b319226b88b3c From 57914061afef14cd9d39f63087c87b7c4914bcd6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 16:09:26 +0000 Subject: [PATCH 023/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b3477d0701..f01541f3ee 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9c002df6c6110e7f2fa55aee367ae282e9a2c1448b577ecd209be6df21d98ead.yml -openapi_spec_hash: af2939e2bdae76e43d7e11d0528f394e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b7533b344002c9ae4cddd499f99ed64fd80378c48e1bac2f350ae306278f963e.yml +openapi_spec_hash: 56c274598dcb75f3a4420b3eb7fee24d config_hash: 107e0f1f8a98b007260b319226b88b3c From 00fa5dbe22ff0d336de245cf5fedeac8e7d5fb2b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 16:11:24 +0000 Subject: [PATCH 024/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f01541f3ee..d212dc6903 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b7533b344002c9ae4cddd499f99ed64fd80378c48e1bac2f350ae306278f963e.yml -openapi_spec_hash: 56c274598dcb75f3a4420b3eb7fee24d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7e7cd547a7d0b9e18383f377c31a882520ef30173a79ef080108afe29cf8cdc1.yml +openapi_spec_hash: 4458adef537a902f28f046be44c814d4 config_hash: 107e0f1f8a98b007260b319226b88b3c From 199bc6c888938f307c2e36599d3e6479fe8d7c7e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 16:13:18 +0000 Subject: [PATCH 025/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d212dc6903..833a20f236 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7e7cd547a7d0b9e18383f377c31a882520ef30173a79ef080108afe29cf8cdc1.yml -openapi_spec_hash: 4458adef537a902f28f046be44c814d4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2871db6c3262a226c8faf8267f99594cfe2e2703c50668bcc583945960738797.yml +openapi_spec_hash: abf319e7a2d8f54b72159593ebb6a0a9 config_hash: 107e0f1f8a98b007260b319226b88b3c From 9bbbd7f4f2f6717d0a04931d49c82d46625b84e2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 16:14:54 +0000 Subject: [PATCH 026/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 833a20f236..466a4a72b6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2871db6c3262a226c8faf8267f99594cfe2e2703c50668bcc583945960738797.yml -openapi_spec_hash: abf319e7a2d8f54b72159593ebb6a0a9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6285010832480b69f3928734beb046f853a7d4d486af26a66a77c3d0b24bfa48.yml +openapi_spec_hash: 972234a7df41077ed962de19b1c971b6 config_hash: 107e0f1f8a98b007260b319226b88b3c From 96e4153bae080bea0f5809817c1decdcdac7e633 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 16:16:47 +0000 Subject: [PATCH 027/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 466a4a72b6..4125df33a7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6285010832480b69f3928734beb046f853a7d4d486af26a66a77c3d0b24bfa48.yml -openapi_spec_hash: 972234a7df41077ed962de19b1c971b6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f446e48d4dafa2c9794ec2b412699fef9a4e1b93c2b07f94ca793bcdb11b87cd.yml +openapi_spec_hash: 87c86f08a9a9cd39ba460cfd51043c3d config_hash: 107e0f1f8a98b007260b319226b88b3c From ec3ef70ff6d114315e535ff57f9bece456e6f7d6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 16:18:43 +0000 Subject: [PATCH 028/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4125df33a7..8973c9a945 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f446e48d4dafa2c9794ec2b412699fef9a4e1b93c2b07f94ca793bcdb11b87cd.yml -openapi_spec_hash: 87c86f08a9a9cd39ba460cfd51043c3d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-953e1af510667e5f98406d0398d734f21d6713690863fca8d22196f4d65c0915.yml +openapi_spec_hash: ac5752bb413db0f9201e5f2727a504ec config_hash: 107e0f1f8a98b007260b319226b88b3c From b618a380d28a5a95f1a1ca2d69a9108582d3a5d4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 16:26:22 +0000 Subject: [PATCH 029/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8973c9a945..e7d6132c63 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-953e1af510667e5f98406d0398d734f21d6713690863fca8d22196f4d65c0915.yml -openapi_spec_hash: ac5752bb413db0f9201e5f2727a504ec +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1b0c0a4571bda3df4507a5083833699b6a7231b99f46b6f269ea6c9c3df994d8.yml +openapi_spec_hash: ddb58f8c947acabbcf1720f01d50b496 config_hash: 107e0f1f8a98b007260b319226b88b3c From 8f4584edef342f1f62d2429b3a293d75b22af797 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 16:28:42 +0000 Subject: [PATCH 030/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e7d6132c63..382f6a750d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1b0c0a4571bda3df4507a5083833699b6a7231b99f46b6f269ea6c9c3df994d8.yml -openapi_spec_hash: ddb58f8c947acabbcf1720f01d50b496 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-22f5436065b535d4c9c61ee0e38663b28b3f8686ec004850570f9df78f40e239.yml +openapi_spec_hash: bde4d0471370dc8d0e66ecc31ef4f044 config_hash: 107e0f1f8a98b007260b319226b88b3c From 7d63a6353df57ca679d7ef0e2370df1c4acf3d3f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 16:30:38 +0000 Subject: [PATCH 031/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 382f6a750d..1cde3ac93f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-22f5436065b535d4c9c61ee0e38663b28b3f8686ec004850570f9df78f40e239.yml -openapi_spec_hash: bde4d0471370dc8d0e66ecc31ef4f044 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-550fcf5a8da88cc946f7dea5821a1645a287e289648ae68cdc1f634b68a75ccf.yml +openapi_spec_hash: 13f0ad5a5e110aa41a1c9bbd7eeb5334 config_hash: 107e0f1f8a98b007260b319226b88b3c From 87e246daa3860956922d9c9a36e8b212c93e8891 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 16:32:14 +0000 Subject: [PATCH 032/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1cde3ac93f..5ab9ad12f8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-550fcf5a8da88cc946f7dea5821a1645a287e289648ae68cdc1f634b68a75ccf.yml -openapi_spec_hash: 13f0ad5a5e110aa41a1c9bbd7eeb5334 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3a0147d11c6b749de3475fa20b20e8a759e0aeeef36413b4faf584dc5d44f7c2.yml +openapi_spec_hash: 1b299d0c174e2d28de5958758b5a2001 config_hash: 107e0f1f8a98b007260b319226b88b3c From c1895d3a429578da012386fd38e189a901120a41 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 16:51:58 +0000 Subject: [PATCH 033/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5ab9ad12f8..b75082cc2e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3a0147d11c6b749de3475fa20b20e8a759e0aeeef36413b4faf584dc5d44f7c2.yml -openapi_spec_hash: 1b299d0c174e2d28de5958758b5a2001 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-45c0ed4d92d7995c36daeb7c26163ecbdda2ed124a14a14bf8d6fc0ee89fbf5c.yml +openapi_spec_hash: 478f09f6efd702c9129f0236e91f3936 config_hash: 107e0f1f8a98b007260b319226b88b3c From f1f486d4d67a257e0e17fd065617b5da2be2031a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 16:53:55 +0000 Subject: [PATCH 034/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b75082cc2e..466a4a72b6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-45c0ed4d92d7995c36daeb7c26163ecbdda2ed124a14a14bf8d6fc0ee89fbf5c.yml -openapi_spec_hash: 478f09f6efd702c9129f0236e91f3936 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6285010832480b69f3928734beb046f853a7d4d486af26a66a77c3d0b24bfa48.yml +openapi_spec_hash: 972234a7df41077ed962de19b1c971b6 config_hash: 107e0f1f8a98b007260b319226b88b3c From 453828a6967bd654302823f84a37bd835007c491 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 17:23:30 +0000 Subject: [PATCH 035/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 466a4a72b6..37cacc49cd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6285010832480b69f3928734beb046f853a7d4d486af26a66a77c3d0b24bfa48.yml -openapi_spec_hash: 972234a7df41077ed962de19b1c971b6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-03b64425cfdbf051936f027e52eb9442d2b5e10ae571b197dcd97da2f7b3d9b0.yml +openapi_spec_hash: 6c1ad8cc9ec7e90daf15f4154d25791a config_hash: 107e0f1f8a98b007260b319226b88b3c From c788e2d9ba74017a6245efb18a96acd3a01c3519 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 17:44:33 +0000 Subject: [PATCH 036/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 37cacc49cd..5f1ff485c1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-03b64425cfdbf051936f027e52eb9442d2b5e10ae571b197dcd97da2f7b3d9b0.yml -openapi_spec_hash: 6c1ad8cc9ec7e90daf15f4154d25791a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-71417f591eca0bbd6ae202f5a763b5434d539feefea14b6883320c87b3bee939.yml +openapi_spec_hash: 14d04fe4571e0532a8bc0202e0a816ac config_hash: 107e0f1f8a98b007260b319226b88b3c From f8cfbd659bf8ff739505424026124211b098a94d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 17:46:28 +0000 Subject: [PATCH 037/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5f1ff485c1..d212dc6903 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-71417f591eca0bbd6ae202f5a763b5434d539feefea14b6883320c87b3bee939.yml -openapi_spec_hash: 14d04fe4571e0532a8bc0202e0a816ac +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7e7cd547a7d0b9e18383f377c31a882520ef30173a79ef080108afe29cf8cdc1.yml +openapi_spec_hash: 4458adef537a902f28f046be44c814d4 config_hash: 107e0f1f8a98b007260b319226b88b3c From 55571ca178c260c4dd426c1b2b81209e1ae85281 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 17:48:27 +0000 Subject: [PATCH 038/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d212dc6903..6dedc7eb99 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7e7cd547a7d0b9e18383f377c31a882520ef30173a79ef080108afe29cf8cdc1.yml -openapi_spec_hash: 4458adef537a902f28f046be44c814d4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-11760442735126f858083e3dda6dad148717429747b07e65ddfe81e3b29c0447.yml +openapi_spec_hash: 9e78c9ec5468b182551410d1eb522b60 config_hash: 107e0f1f8a98b007260b319226b88b3c From dbdfd47c604a13c7181f44f28f3c2c38a8934485 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 18:05:01 +0000 Subject: [PATCH 039/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6dedc7eb99..32f0629d05 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-11760442735126f858083e3dda6dad148717429747b07e65ddfe81e3b29c0447.yml -openapi_spec_hash: 9e78c9ec5468b182551410d1eb522b60 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e771e43866ebf265f94acb68fe8c565eff7eb07669766c9d316ba26798ca0cd5.yml +openapi_spec_hash: ddd24276a1bdfffe0e79f0099bf812b8 config_hash: 107e0f1f8a98b007260b319226b88b3c From 7f070f849fad43be57f0e1d7b03f56c643e80392 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 18:07:04 +0000 Subject: [PATCH 040/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 32f0629d05..466a4a72b6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e771e43866ebf265f94acb68fe8c565eff7eb07669766c9d316ba26798ca0cd5.yml -openapi_spec_hash: ddd24276a1bdfffe0e79f0099bf812b8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6285010832480b69f3928734beb046f853a7d4d486af26a66a77c3d0b24bfa48.yml +openapi_spec_hash: 972234a7df41077ed962de19b1c971b6 config_hash: 107e0f1f8a98b007260b319226b88b3c From 4d1456eadb332111a92f4a648010d0f085a17f19 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 18:20:45 +0000 Subject: [PATCH 041/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 466a4a72b6..7b37664f14 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6285010832480b69f3928734beb046f853a7d4d486af26a66a77c3d0b24bfa48.yml -openapi_spec_hash: 972234a7df41077ed962de19b1c971b6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-72f6a7c4a5bbe992c6f7100ae66a62fee1befb6b8aee9a189c169df76ca1ec27.yml +openapi_spec_hash: a3b05b450863be9e4e78da28ea3bcdbf config_hash: 107e0f1f8a98b007260b319226b88b3c From ea68e4ef11814adad24786b33568dfb7b28f4fc7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 18:24:04 +0000 Subject: [PATCH 042/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7b37664f14..2fdd64bf03 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-72f6a7c4a5bbe992c6f7100ae66a62fee1befb6b8aee9a189c169df76ca1ec27.yml -openapi_spec_hash: a3b05b450863be9e4e78da28ea3bcdbf +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-063ae8fad5c12bc83f1175532cbb5ae6e97a261dd91522f5733290f66a031fac.yml +openapi_spec_hash: 1315978f7cc6bbd06caff1e6c2481d15 config_hash: 107e0f1f8a98b007260b319226b88b3c From 0a840c3b81a14c9713f681fdb45d92ca5ce004d9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 18:26:01 +0000 Subject: [PATCH 043/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2fdd64bf03..044e0ee3f4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-063ae8fad5c12bc83f1175532cbb5ae6e97a261dd91522f5733290f66a031fac.yml -openapi_spec_hash: 1315978f7cc6bbd06caff1e6c2481d15 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-34fac9517dafa7a70a3de8f59b8fbff204199eb3c136ad1d375f5ef158f87d90.yml +openapi_spec_hash: 6a915873baf7fcdca625c90909492e28 config_hash: 107e0f1f8a98b007260b319226b88b3c From e7b03f5a4881b9f91a02397bda81ab913537983e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 18:28:01 +0000 Subject: [PATCH 044/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 044e0ee3f4..a381b2646e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-34fac9517dafa7a70a3de8f59b8fbff204199eb3c136ad1d375f5ef158f87d90.yml -openapi_spec_hash: 6a915873baf7fcdca625c90909492e28 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5a0a8eba270d75f3bba1a7568734b7e5608539b9ff6adf0f266555d85b849ec4.yml +openapi_spec_hash: 075f7dae6333e825e9d61299ef213783 config_hash: 107e0f1f8a98b007260b319226b88b3c From 6dd404e795e5e8b9e4087fc2fad7ba075477d0f8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 18:35:29 +0000 Subject: [PATCH 045/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a381b2646e..0a983f097f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5a0a8eba270d75f3bba1a7568734b7e5608539b9ff6adf0f266555d85b849ec4.yml -openapi_spec_hash: 075f7dae6333e825e9d61299ef213783 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7492bc33f84221ee63fe654c22680333788bfd2dfe8985c58f9d3db555ffca2b.yml +openapi_spec_hash: b454db8aa8af2160a780a5b69445f3a4 config_hash: 107e0f1f8a98b007260b319226b88b3c From 0af1302f0e0525980610eed4fa7ca2cc5ef9bf30 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 19:15:26 +0000 Subject: [PATCH 046/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0a983f097f..90bcc72500 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7492bc33f84221ee63fe654c22680333788bfd2dfe8985c58f9d3db555ffca2b.yml -openapi_spec_hash: b454db8aa8af2160a780a5b69445f3a4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ea2ee1798186868a7dd47b3afbbece4bd85f9a5425375195a4d7b64cd59907f0.yml +openapi_spec_hash: e9e0b5b59b267d960e765280f2f2fbd9 config_hash: 107e0f1f8a98b007260b319226b88b3c From 49c9ce2656676d00ec080f01d7e5429cce0f328c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 19:17:10 +0000 Subject: [PATCH 047/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 90bcc72500..fc5403188c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ea2ee1798186868a7dd47b3afbbece4bd85f9a5425375195a4d7b64cd59907f0.yml -openapi_spec_hash: e9e0b5b59b267d960e765280f2f2fbd9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-63b8350ae06828cd3ff3a440a34dc60f4205dce02c04ea20fd976bd7339a4640.yml +openapi_spec_hash: 17955e6cfc168a84c2154ab49906caab config_hash: 107e0f1f8a98b007260b319226b88b3c From 7cdfb53afcb74d9a73601f379b41533ab5a8a295 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 19:19:35 +0000 Subject: [PATCH 048/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index fc5403188c..e9206b4840 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-63b8350ae06828cd3ff3a440a34dc60f4205dce02c04ea20fd976bd7339a4640.yml -openapi_spec_hash: 17955e6cfc168a84c2154ab49906caab +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ebe03fcf85908149a91832a8145651eb2df1ec5c331716ab81a0403e54c023d2.yml +openapi_spec_hash: 832b81737e7605f27834256f85591544 config_hash: 107e0f1f8a98b007260b319226b88b3c From 2f78f989ae3ff8b49c0f9b00740a3e9856071b86 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 19:21:28 +0000 Subject: [PATCH 049/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e9206b4840..7c90e88838 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ebe03fcf85908149a91832a8145651eb2df1ec5c331716ab81a0403e54c023d2.yml -openapi_spec_hash: 832b81737e7605f27834256f85591544 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-abf02ffd59ffe6b3897731e47497336e6d6399cd49d3f097c7b9ace581727642.yml +openapi_spec_hash: 6125e56ed7bb75a72d09c4f9acf65d34 config_hash: 107e0f1f8a98b007260b319226b88b3c From ffabf908876da6c84a2d84c72c75d74b6771f986 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 19:25:19 +0000 Subject: [PATCH 050/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7c90e88838..044e0ee3f4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-abf02ffd59ffe6b3897731e47497336e6d6399cd49d3f097c7b9ace581727642.yml -openapi_spec_hash: 6125e56ed7bb75a72d09c4f9acf65d34 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-34fac9517dafa7a70a3de8f59b8fbff204199eb3c136ad1d375f5ef158f87d90.yml +openapi_spec_hash: 6a915873baf7fcdca625c90909492e28 config_hash: 107e0f1f8a98b007260b319226b88b3c From 3c169b4d4735e2374c44e9c88d68bf5e3339002e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 19:27:12 +0000 Subject: [PATCH 051/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 044e0ee3f4..567cf59238 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-34fac9517dafa7a70a3de8f59b8fbff204199eb3c136ad1d375f5ef158f87d90.yml -openapi_spec_hash: 6a915873baf7fcdca625c90909492e28 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aee423c17b926f1afe767922a4575edc0124072663364a2c3406a7b7195f277f.yml +openapi_spec_hash: 2cf3996fe0a6c6706788e5f1e072cf36 config_hash: 107e0f1f8a98b007260b319226b88b3c From 1b0680bc7dc780f13c47353a9fceaecf29189744 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 19:55:49 +0000 Subject: [PATCH 052/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 567cf59238..6a469e89c2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aee423c17b926f1afe767922a4575edc0124072663364a2c3406a7b7195f277f.yml -openapi_spec_hash: 2cf3996fe0a6c6706788e5f1e072cf36 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-352a4816985c297d8a280fd0add8eca0d15f056c8e9fa34d3496526ac753b82e.yml +openapi_spec_hash: 3c03db54250b75e7d446c7b9e35d303d config_hash: 107e0f1f8a98b007260b319226b88b3c From 6ec90aace2c6d051067a77e502626dd10b551c10 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 19:57:41 +0000 Subject: [PATCH 053/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6a469e89c2..08180c149b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-352a4816985c297d8a280fd0add8eca0d15f056c8e9fa34d3496526ac753b82e.yml -openapi_spec_hash: 3c03db54250b75e7d446c7b9e35d303d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-40178787343443c721e2a8a3f6c3fd8d78127f7ecb984d46d8eece2bf95015bc.yml +openapi_spec_hash: b784af904ab876932d74fd678d89a4f2 config_hash: 107e0f1f8a98b007260b319226b88b3c From 46be02bc504ad745daed148d223fa245c6c0cd44 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 20:01:22 +0000 Subject: [PATCH 054/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 08180c149b..044e0ee3f4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-40178787343443c721e2a8a3f6c3fd8d78127f7ecb984d46d8eece2bf95015bc.yml -openapi_spec_hash: b784af904ab876932d74fd678d89a4f2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-34fac9517dafa7a70a3de8f59b8fbff204199eb3c136ad1d375f5ef158f87d90.yml +openapi_spec_hash: 6a915873baf7fcdca625c90909492e28 config_hash: 107e0f1f8a98b007260b319226b88b3c From 52fda57f60361853412b3b40bc78d7ab340f69a9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 20:24:22 +0000 Subject: [PATCH 055/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 044e0ee3f4..86b0e81bca 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-34fac9517dafa7a70a3de8f59b8fbff204199eb3c136ad1d375f5ef158f87d90.yml -openapi_spec_hash: 6a915873baf7fcdca625c90909492e28 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6eea9aed3d1f9c62552736c6565fb80c9356bb3e49cf2dcd2755d958582ec229.yml +openapi_spec_hash: 22f228203c9f53196132085852317e4f config_hash: 107e0f1f8a98b007260b319226b88b3c From 2d20a6ce3e48c5e5892b9e57743938e184cd6903 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 20:27:09 +0000 Subject: [PATCH 056/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 86b0e81bca..2b95ac2fe1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6eea9aed3d1f9c62552736c6565fb80c9356bb3e49cf2dcd2755d958582ec229.yml -openapi_spec_hash: 22f228203c9f53196132085852317e4f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f3bdad647c2632923da769367c580bb650ef4f18a8f1f6d4a911e95018a3e015.yml +openapi_spec_hash: ce8cc9d02a08c4ab56d5ec624334b32f config_hash: 107e0f1f8a98b007260b319226b88b3c From 01e6012dc294c01a4dca5d448fdef6a786c23bf6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 20:34:52 +0000 Subject: [PATCH 057/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2b95ac2fe1..0133e9ed93 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f3bdad647c2632923da769367c580bb650ef4f18a8f1f6d4a911e95018a3e015.yml -openapi_spec_hash: ce8cc9d02a08c4ab56d5ec624334b32f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e832fad247781dd77df3158e12d1106dc6220dc89709cd7930ad793f3192e07c.yml +openapi_spec_hash: b703ba1646cdcc86a380c58062a6983d config_hash: 107e0f1f8a98b007260b319226b88b3c From 1d331d969cee3e1094f6375aecd5e6683f952075 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 20:36:33 +0000 Subject: [PATCH 058/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0133e9ed93..0a983f097f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e832fad247781dd77df3158e12d1106dc6220dc89709cd7930ad793f3192e07c.yml -openapi_spec_hash: b703ba1646cdcc86a380c58062a6983d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7492bc33f84221ee63fe654c22680333788bfd2dfe8985c58f9d3db555ffca2b.yml +openapi_spec_hash: b454db8aa8af2160a780a5b69445f3a4 config_hash: 107e0f1f8a98b007260b319226b88b3c From 336de3ff7745f606bd6c1454e10647fbcb21d113 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 20:38:12 +0000 Subject: [PATCH 059/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0a983f097f..3156197131 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7492bc33f84221ee63fe654c22680333788bfd2dfe8985c58f9d3db555ffca2b.yml -openapi_spec_hash: b454db8aa8af2160a780a5b69445f3a4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4e9d90b983d84904f3e1fd499fed3e179543d44f742fcf27d35cdf38f628ac4f.yml +openapi_spec_hash: 99841f78b73c890841459a4bdf739766 config_hash: 107e0f1f8a98b007260b319226b88b3c From cb255df1dd2c511562c11005207111f2062b2f5c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 21:27:50 +0000 Subject: [PATCH 060/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3156197131..64447303b1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4e9d90b983d84904f3e1fd499fed3e179543d44f742fcf27d35cdf38f628ac4f.yml -openapi_spec_hash: 99841f78b73c890841459a4bdf739766 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cd4a6a750ee22555bdd74a2ac5735afc694ae54451f088a8fbc2891d2230ece8.yml +openapi_spec_hash: 8d7ac055ab6c215cfeffaeedbba9f67c config_hash: 107e0f1f8a98b007260b319226b88b3c From c0b39fc802ad6af06a402a4000a6e5b6e66b9d6c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 21:29:58 +0000 Subject: [PATCH 061/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 64447303b1..044e0ee3f4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cd4a6a750ee22555bdd74a2ac5735afc694ae54451f088a8fbc2891d2230ece8.yml -openapi_spec_hash: 8d7ac055ab6c215cfeffaeedbba9f67c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-34fac9517dafa7a70a3de8f59b8fbff204199eb3c136ad1d375f5ef158f87d90.yml +openapi_spec_hash: 6a915873baf7fcdca625c90909492e28 config_hash: 107e0f1f8a98b007260b319226b88b3c From 211539333bc65b89c920ee9e3b3cff92ef3ea232 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 21:38:49 +0000 Subject: [PATCH 062/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 044e0ee3f4..4c4123cd99 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-34fac9517dafa7a70a3de8f59b8fbff204199eb3c136ad1d375f5ef158f87d90.yml -openapi_spec_hash: 6a915873baf7fcdca625c90909492e28 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c6563b6973fb591d95f5df9adeaa9e01ea139c88614d7b454b5f4e3f8748541a.yml +openapi_spec_hash: aff860d040d08352b10ca736c9cedfcc config_hash: 107e0f1f8a98b007260b319226b88b3c From a828dbd81bd28997cfa6934c94b72a3f059ce326 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 21:40:46 +0000 Subject: [PATCH 063/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4c4123cd99..2b95ac2fe1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c6563b6973fb591d95f5df9adeaa9e01ea139c88614d7b454b5f4e3f8748541a.yml -openapi_spec_hash: aff860d040d08352b10ca736c9cedfcc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f3bdad647c2632923da769367c580bb650ef4f18a8f1f6d4a911e95018a3e015.yml +openapi_spec_hash: ce8cc9d02a08c4ab56d5ec624334b32f config_hash: 107e0f1f8a98b007260b319226b88b3c From 23079b9f77d63b2a7cb8da14078003211bca441d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 22:24:55 +0000 Subject: [PATCH 064/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2b95ac2fe1..8443e994fa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f3bdad647c2632923da769367c580bb650ef4f18a8f1f6d4a911e95018a3e015.yml -openapi_spec_hash: ce8cc9d02a08c4ab56d5ec624334b32f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2fd2ca0c203204f81e365a4319e68ce937987823a9aebefe8ed8a486119a91a5.yml +openapi_spec_hash: c4f5e4bd3ee53a43318cf78a11cc8494 config_hash: 107e0f1f8a98b007260b319226b88b3c From f547584a140c7cb25c2636ed931e8d7deae43413 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 22:31:37 +0000 Subject: [PATCH 065/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8443e994fa..044e0ee3f4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2fd2ca0c203204f81e365a4319e68ce937987823a9aebefe8ed8a486119a91a5.yml -openapi_spec_hash: c4f5e4bd3ee53a43318cf78a11cc8494 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-34fac9517dafa7a70a3de8f59b8fbff204199eb3c136ad1d375f5ef158f87d90.yml +openapi_spec_hash: 6a915873baf7fcdca625c90909492e28 config_hash: 107e0f1f8a98b007260b319226b88b3c From 71c4a8b25bce012be9aa5420f5be6363cc91ba5e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 22:35:33 +0000 Subject: [PATCH 066/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 044e0ee3f4..0a983f097f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-34fac9517dafa7a70a3de8f59b8fbff204199eb3c136ad1d375f5ef158f87d90.yml -openapi_spec_hash: 6a915873baf7fcdca625c90909492e28 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7492bc33f84221ee63fe654c22680333788bfd2dfe8985c58f9d3db555ffca2b.yml +openapi_spec_hash: b454db8aa8af2160a780a5b69445f3a4 config_hash: 107e0f1f8a98b007260b319226b88b3c From 139dd063ef5fc36d5b674d27f67758937a010e19 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 22:48:13 +0000 Subject: [PATCH 067/451] chore(api): update composite API spec --- .stats.yml | 4 +- api.md | 2 +- .../alerting/destinations/webhooks.ts | 6 +- src/resources/alerting/policies.ts | 6 +- src/resources/pages/index.ts | 1 - src/resources/pages/pages.ts | 6 +- src/resources/pages/projects/index.ts | 1 - src/resources/pages/projects/projects.ts | 22 +-- .../r2/super-slurper/connectivity-precheck.ts | 76 +++------- src/resources/r2/super-slurper/jobs/jobs.ts | 52 +++---- src/resources/radar/as112/summary.ts | 34 ++++- .../radar/as112/timeseries-groups.ts | 36 ++++- src/resources/radar/attacks/layer3/summary.ts | 42 +++++- .../radar/attacks/layer3/timeseries-groups.ts | 42 +++++- src/resources/radar/attacks/layer7/summary.ts | 42 +++++- .../radar/attacks/layer7/timeseries-groups.ts | 42 +++++- src/resources/radar/dns/summary.ts | 54 +++++-- src/resources/radar/dns/timeseries-groups.ts | 60 ++++++-- src/resources/radar/email/routing/summary.ts | 36 ++++- .../radar/email/routing/timeseries-groups.ts | 36 ++++- src/resources/radar/email/security/summary.ts | 54 +++++-- .../radar/email/security/timeseries-groups.ts | 54 +++++-- src/resources/radar/entities/asns.ts | 12 +- src/resources/radar/netflows/netflows.ts | 2 +- src/resources/stream/downloads.ts | 5 +- .../dispatch/namespaces/scripts/bindings.ts | 2 +- .../dispatch/namespaces/scripts/scripts.ts | 2 +- .../dispatch/namespaces/scripts/settings.ts | 6 +- .../workers/beta/workers/versions.ts | 4 +- src/resources/workers/beta/workers/workers.ts | 138 ------------------ .../scripts/script-and-version-settings.ts | 6 +- src/resources/workers/scripts/scripts.ts | 2 +- src/resources/workers/scripts/versions.ts | 11 +- src/resources/zones/settings.ts | 38 +++-- .../alerting/destinations/webhooks.test.ts | 51 ++++--- tests/api-resources/alerting/policies.test.ts | 24 +-- .../pages/projects/projects.test.ts | 6 +- .../connectivity-precheck.test.ts | 20 +-- .../r2/super-slurper/jobs/jobs.test.ts | 6 +- .../workers/scripts/versions.test.ts | 6 +- 40 files changed, 596 insertions(+), 453 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0a983f097f..5637fc3e0e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7492bc33f84221ee63fe654c22680333788bfd2dfe8985c58f9d3db555ffca2b.yml -openapi_spec_hash: b454db8aa8af2160a780a5b69445f3a4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ca8fbfa82d19dca400ec61b8c93392de1acd157860e435419f9a5e9ec8c586e0.yml +openapi_spec_hash: 77d55c70bc3824ac61bd056e2319ee18 config_hash: 107e0f1f8a98b007260b319226b88b3c diff --git a/api.md b/api.md index 866462c86c..7ffb0aa433 100644 --- a/api.md +++ b/api.md @@ -3925,7 +3925,7 @@ Types: Methods: - client.pages.projects.create({ ...params }) -> Project -- client.pages.projects.list({ ...params }) -> DeploymentsV4PagePaginationArray +- client.pages.projects.list({ ...params }) -> DeploymentsSinglePage - client.pages.projects.delete(projectName, { ...params }) -> ProjectDeleteResponse | null - client.pages.projects.edit(projectName, { ...params }) -> Project - client.pages.projects.get(projectName, { ...params }) -> Project diff --git a/src/resources/alerting/destinations/webhooks.ts b/src/resources/alerting/destinations/webhooks.ts index 605e015ae3..279c67d0bf 100644 --- a/src/resources/alerting/destinations/webhooks.ts +++ b/src/resources/alerting/destinations/webhooks.ts @@ -35,7 +35,7 @@ export class Webhooks extends APIResource { * ```ts * const webhook = * await client.alerting.destinations.webhooks.update( - * 'b115d5ec15c641ee8b7692c449b5227b', + * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * name: 'Slack Webhook', @@ -90,7 +90,7 @@ export class Webhooks extends APIResource { * ```ts * const webhook = * await client.alerting.destinations.webhooks.delete( - * 'b115d5ec15c641ee8b7692c449b5227b', + * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -114,7 +114,7 @@ export class Webhooks extends APIResource { * ```ts * const webhooks = * await client.alerting.destinations.webhooks.get( - * 'b115d5ec15c641ee8b7692c449b5227b', + * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` diff --git a/src/resources/alerting/policies.ts b/src/resources/alerting/policies.ts index 5991ca0862..c2caed4005 100644 --- a/src/resources/alerting/policies.ts +++ b/src/resources/alerting/policies.ts @@ -35,7 +35,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.update( - * '0da2b59ef118439d8097bdfb215203c9', + * '0da2b59e-f118-439d-8097-bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -85,7 +85,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.delete( - * '0da2b59ef118439d8097bdfb215203c9', + * '0da2b59e-f118-439d-8097-bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -105,7 +105,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.get( - * '0da2b59ef118439d8097bdfb215203c9', + * '0da2b59e-f118-439d-8097-bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` diff --git a/src/resources/pages/index.ts b/src/resources/pages/index.ts index ede14daf73..2b2862b5c1 100644 --- a/src/resources/pages/index.ts +++ b/src/resources/pages/index.ts @@ -2,7 +2,6 @@ export { DeploymentsSinglePage, - DeploymentsV4PagePaginationArray, Projects, type Deployment, type Project, diff --git a/src/resources/pages/pages.ts b/src/resources/pages/pages.ts index e0331f786f..e92779690f 100644 --- a/src/resources/pages/pages.ts +++ b/src/resources/pages/pages.ts @@ -4,7 +4,7 @@ import { APIResource } from '../../resource'; import * as ProjectsAPI from './projects/projects'; import { Deployment, - DeploymentsV4PagePaginationArray, + DeploymentsSinglePage, Project, ProjectCreateParams, ProjectDeleteParams, @@ -23,7 +23,7 @@ export class Pages extends APIResource { } Pages.Projects = Projects; -Pages.DeploymentsV4PagePaginationArray = DeploymentsV4PagePaginationArray; +Pages.DeploymentsSinglePage = DeploymentsSinglePage; export declare namespace Pages { export { @@ -33,7 +33,7 @@ export declare namespace Pages { type Stage as Stage, type ProjectDeleteResponse as ProjectDeleteResponse, type ProjectPurgeBuildCacheResponse as ProjectPurgeBuildCacheResponse, - DeploymentsV4PagePaginationArray as DeploymentsV4PagePaginationArray, + DeploymentsSinglePage as DeploymentsSinglePage, type ProjectCreateParams as ProjectCreateParams, type ProjectListParams as ProjectListParams, type ProjectDeleteParams as ProjectDeleteParams, diff --git a/src/resources/pages/projects/index.ts b/src/resources/pages/projects/index.ts index 867a3f7b6b..a40f121ec5 100644 --- a/src/resources/pages/projects/index.ts +++ b/src/resources/pages/projects/index.ts @@ -12,7 +12,6 @@ export { } from './deployments/index'; export { DeploymentsSinglePage, - DeploymentsV4PagePaginationArray, Projects, type Deployment, type Project, diff --git a/src/resources/pages/projects/projects.ts b/src/resources/pages/projects/projects.ts index efac2c7d22..01225591dc 100644 --- a/src/resources/pages/projects/projects.ts +++ b/src/resources/pages/projects/projects.ts @@ -28,7 +28,7 @@ import { DeploymentRollbackParams, Deployments, } from './deployments/deployments'; -import { SinglePage, V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; +import { SinglePage } from '../../../pagination'; export class Projects extends APIResource { deployments: DeploymentsAPI.Deployments = new DeploymentsAPI.Deployments(this._client); @@ -69,13 +69,9 @@ export class Projects extends APIResource { list( params: ProjectListParams, options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id, ...query } = params; - return this._client.getAPIList( - `/accounts/${account_id}/pages/projects`, - DeploymentsV4PagePaginationArray, - { query, ...options }, - ); + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList(`/accounts/${account_id}/pages/projects`, DeploymentsSinglePage, options); } /** @@ -180,8 +176,6 @@ export class Projects extends APIResource { } } -export class DeploymentsV4PagePaginationArray extends V4PagePaginationArray {} - export class DeploymentsSinglePage extends SinglePage {} export interface Deployment { @@ -1647,9 +1641,9 @@ export namespace ProjectCreateParams { } } -export interface ProjectListParams extends V4PagePaginationArrayParams { +export interface ProjectListParams { /** - * Path param: Identifier + * Identifier */ account_id: string; } @@ -2276,7 +2270,7 @@ export interface ProjectPurgeBuildCacheParams { account_id: string; } -Projects.DeploymentsV4PagePaginationArray = DeploymentsV4PagePaginationArray; +Projects.DeploymentsSinglePage = DeploymentsSinglePage; Projects.Deployments = Deployments; Projects.Domains = Domains; Projects.DomainListResponsesSinglePage = DomainListResponsesSinglePage; @@ -2288,7 +2282,7 @@ export declare namespace Projects { type Stage as Stage, type ProjectDeleteResponse as ProjectDeleteResponse, type ProjectPurgeBuildCacheResponse as ProjectPurgeBuildCacheResponse, - DeploymentsV4PagePaginationArray as DeploymentsV4PagePaginationArray, + DeploymentsSinglePage as DeploymentsSinglePage, type ProjectCreateParams as ProjectCreateParams, type ProjectListParams as ProjectListParams, type ProjectDeleteParams as ProjectDeleteParams, diff --git a/src/resources/r2/super-slurper/connectivity-precheck.ts b/src/resources/r2/super-slurper/connectivity-precheck.ts index 2283824388..654a8193d5 100644 --- a/src/resources/r2/super-slurper/connectivity-precheck.ts +++ b/src/resources/r2/super-slurper/connectivity-precheck.ts @@ -13,12 +13,6 @@ export class ConnectivityPrecheck extends APIResource { * const response = * await client.r2.superSlurper.connectivityPrecheck.source({ * account_id: 'account_id', - * bucket: 'bucket', - * secret: { - * accessKeyId: 'accessKeyId', - * secretAccessKey: 'secretAccessKey', - * }, - * vendor: 's3', * }); * ``` */ @@ -43,12 +37,6 @@ export class ConnectivityPrecheck extends APIResource { * const response = * await client.r2.superSlurper.connectivityPrecheck.target({ * account_id: 'account_id', - * bucket: 'bucket', - * secret: { - * accessKeyId: 'accessKeyId', - * secretAccessKey: 'secretAccessKey', - * }, - * vendor: 'r2', * }); * ``` */ @@ -89,17 +77,7 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket: string; - - /** - * Body param: - */ - secret: R2SlurperS3SourceSchema.Secret; - - /** - * Body param: - */ - vendor: 's3'; + bucket?: string; /** * Body param: @@ -109,19 +87,19 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - pathPrefix?: string | null; + secret?: R2SlurperS3SourceSchema.Secret; /** * Body param: */ - region?: string | null; + vendor?: 's3'; } export namespace R2SlurperS3SourceSchema { export interface Secret { - accessKeyId: string; + accessKeyId?: string; - secretAccessKey: string; + secretAccessKey?: string; } } @@ -134,29 +112,24 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket: string; - - /** - * Body param: - */ - secret: R2SlurperGcsSourceSchema.Secret; + bucket?: string; /** * Body param: */ - vendor: 'gcs'; + secret?: R2SlurperGcsSourceSchema.Secret; /** * Body param: */ - pathPrefix?: string | null; + vendor?: 'gcs'; } export namespace R2SlurperGcsSourceSchema { export interface Secret { - clientEmail: string; + clientEmail?: string; - privateKey: string; + privateKey?: string; } } @@ -169,34 +142,29 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket: string; - - /** - * Body param: - */ - secret: R2SlurperR2SourceSchema.Secret; + bucket?: string; /** * Body param: */ - vendor: SippyAPI.ProviderParam; + jurisdiction?: 'default' | 'eu' | 'fedramp'; /** * Body param: */ - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret?: R2SlurperR2SourceSchema.Secret; /** * Body param: */ - pathPrefix?: string | null; + vendor?: SippyAPI.ProviderParam; } export namespace R2SlurperR2SourceSchema { export interface Secret { - accessKeyId: string; + accessKeyId?: string; - secretAccessKey: string; + secretAccessKey?: string; } } } @@ -210,29 +178,29 @@ export interface ConnectivityPrecheckTargetParams { /** * Body param: */ - bucket: string; + bucket?: string; /** * Body param: */ - secret: ConnectivityPrecheckTargetParams.Secret; + jurisdiction?: 'default' | 'eu' | 'fedramp'; /** * Body param: */ - vendor: SippyAPI.ProviderParam; + secret?: ConnectivityPrecheckTargetParams.Secret; /** * Body param: */ - jurisdiction?: 'default' | 'eu' | 'fedramp'; + vendor?: SippyAPI.ProviderParam; } export namespace ConnectivityPrecheckTargetParams { export interface Secret { - accessKeyId: string; + accessKeyId?: string; - secretAccessKey: string; + secretAccessKey?: string; } } diff --git a/src/resources/r2/super-slurper/jobs/jobs.ts b/src/resources/r2/super-slurper/jobs/jobs.ts index 7732e944b1..0e70bb10e5 100644 --- a/src/resources/r2/super-slurper/jobs/jobs.ts +++ b/src/resources/r2/super-slurper/jobs/jobs.ts @@ -360,80 +360,72 @@ export interface JobCreateParams { export namespace JobCreateParams { export interface R2SlurperS3SourceSchema { - bucket: string; - - secret: R2SlurperS3SourceSchema.Secret; - - vendor: 's3'; + bucket?: string; endpoint?: string | null; - pathPrefix?: string | null; + secret?: R2SlurperS3SourceSchema.Secret; - region?: string | null; + vendor?: 's3'; } export namespace R2SlurperS3SourceSchema { export interface Secret { - accessKeyId: string; + accessKeyId?: string; - secretAccessKey: string; + secretAccessKey?: string; } } export interface R2SlurperGcsSourceSchema { - bucket: string; - - secret: R2SlurperGcsSourceSchema.Secret; + bucket?: string; - vendor: 'gcs'; + secret?: R2SlurperGcsSourceSchema.Secret; - pathPrefix?: string | null; + vendor?: 'gcs'; } export namespace R2SlurperGcsSourceSchema { export interface Secret { - clientEmail: string; + clientEmail?: string; - privateKey: string; + privateKey?: string; } } export interface R2SlurperR2SourceSchema { - bucket: string; - - secret: R2SlurperR2SourceSchema.Secret; - - vendor: SippyAPI.ProviderParam; + bucket?: string; jurisdiction?: 'default' | 'eu' | 'fedramp'; - pathPrefix?: string | null; + secret?: R2SlurperR2SourceSchema.Secret; + + vendor?: SippyAPI.ProviderParam; } export namespace R2SlurperR2SourceSchema { export interface Secret { - accessKeyId: string; + accessKeyId?: string; - secretAccessKey: string; + secretAccessKey?: string; } } export interface Target { - bucket: string; + bucket?: string; - secret: Target.Secret; + jurisdiction?: 'default' | 'eu' | 'fedramp'; - vendor: SippyAPI.ProviderParam; + secret?: Target.Secret; - jurisdiction?: 'default' | 'eu' | 'fedramp'; + vendor?: SippyAPI.ProviderParam; } export namespace Target { export interface Secret { - accessKeyId: string; + accessKeyId?: string; - secretAccessKey: string; + secretAccessKey?: string; } } } diff --git a/src/resources/radar/as112/summary.ts b/src/resources/radar/as112/summary.ts index d6034b19c4..c59fdaeb5a 100644 --- a/src/resources/radar/as112/summary.ts +++ b/src/resources/radar/as112/summary.ts @@ -9,7 +9,10 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by DNSSEC (DNS Security * Extensions) support. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.as112.summary.dnssec(); + * ``` */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -31,7 +34,10 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by EDNS (Extension Mechanisms * for DNS) support. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.as112.summary.edns(); + * ``` */ edns(query?: SummaryEdnsParams, options?: Core.RequestOptions): Core.APIPromise; edns(options?: Core.RequestOptions): Core.APIPromise; @@ -52,7 +58,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by IP version. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.summary.ipVersion(); + * ``` */ ipVersion( query?: SummaryIPVersionParams, @@ -76,7 +86,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by protocol. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.summary.protocol(); + * ``` */ protocol( query?: SummaryProtocolParams, @@ -100,7 +114,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by type. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.summary.queryType(); + * ``` */ queryType( query?: SummaryQueryTypeParams, @@ -124,7 +142,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of AS112 DNS requests classified by response code. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.summary.responseCodes(); + * ``` */ responseCodes( query?: SummaryResponseCodesParams, diff --git a/src/resources/radar/as112/timeseries-groups.ts b/src/resources/radar/as112/timeseries-groups.ts index e5593df35c..a9e2aa049c 100644 --- a/src/resources/radar/as112/timeseries-groups.ts +++ b/src/resources/radar/as112/timeseries-groups.ts @@ -9,7 +9,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by DNSSEC (DNS Security * Extensions) support over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroups.dnssec(); + * ``` */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -34,7 +38,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by EDNS (Extension Mechanisms * for DNS) support over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroups.edns(); + * ``` */ edns( query?: TimeseriesGroupEdnsParams, @@ -58,7 +66,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by IP version over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroups.ipVersion(); + * ``` */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -84,7 +96,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by protocol over * time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroups.protocol(); + * ``` */ protocol( query?: TimeseriesGroupProtocolParams, @@ -108,7 +124,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by type over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroups.queryType(); + * ``` */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -134,7 +154,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by response code * over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroups.responseCodes(); + * ``` */ responseCodes( query?: TimeseriesGroupResponseCodesParams, diff --git a/src/resources/radar/attacks/layer3/summary.ts b/src/resources/radar/attacks/layer3/summary.ts index bc4ccc4c81..73ed7d7c70 100644 --- a/src/resources/radar/attacks/layer3/summary.ts +++ b/src/resources/radar/attacks/layer3/summary.ts @@ -8,7 +8,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.bitrate(); + * ``` */ bitrate( query?: SummaryBitrateParams, @@ -32,7 +36,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.duration(); + * ``` */ duration( query?: SummaryDurationParams, @@ -56,7 +64,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.industry(); + * ``` */ industry( query?: SummaryIndustryParams, @@ -80,7 +92,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.ipVersion(); + * ``` */ ipVersion( query?: SummaryIPVersionParams, @@ -104,7 +120,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.protocol(); + * ``` */ protocol( query?: SummaryProtocolParams, @@ -128,7 +148,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.vector(); + * ``` */ vector(query?: SummaryVectorParams, options?: Core.RequestOptions): Core.APIPromise; vector(options?: Core.RequestOptions): Core.APIPromise; @@ -149,7 +173,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.vertical(); + * ``` */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer3/timeseries-groups.ts b/src/resources/radar/attacks/layer3/timeseries-groups.ts index 9f8d171a40..740bb97cae 100644 --- a/src/resources/radar/attacks/layer3/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer3/timeseries-groups.ts @@ -8,7 +8,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.bitrate(); + * ``` */ bitrate( query?: TimeseriesGroupBitrateParams, @@ -33,7 +37,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.duration(); + * ``` */ duration( query?: TimeseriesGroupDurationParams, @@ -58,7 +66,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.industry(); + * ``` */ industry( query?: TimeseriesGroupIndustryParams, @@ -83,7 +95,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.ipVersion(); + * ``` */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -108,7 +124,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.protocol(); + * ``` */ protocol( query?: TimeseriesGroupProtocolParams, @@ -133,7 +153,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.vector(); + * ``` */ vector( query?: TimeseriesGroupVectorParams, @@ -158,7 +182,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.vertical(); + * ``` */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer7/summary.ts b/src/resources/radar/attacks/layer7/summary.ts index 160eb24dd8..4afa3d68d0 100644 --- a/src/resources/radar/attacks/layer7/summary.ts +++ b/src/resources/radar/attacks/layer7/summary.ts @@ -8,7 +8,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.httpMethod(); + * ``` */ httpMethod( query?: SummaryHTTPMethodParams, @@ -33,7 +37,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.httpVersion(); + * ``` */ httpVersion( query?: SummaryHTTPVersionParams, @@ -58,7 +66,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.industry(); + * ``` */ industry( query?: SummaryIndustryParams, @@ -82,7 +94,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.ipVersion(); + * ``` */ ipVersion( query?: SummaryIPVersionParams, @@ -106,7 +122,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.managedRules(); + * ``` */ managedRules( query?: SummaryManagedRulesParams, @@ -131,7 +151,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.mitigationProduct(); + * ``` */ mitigationProduct( query?: SummaryMitigationProductParams, @@ -156,7 +180,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.vertical(); + * ``` */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer7/timeseries-groups.ts b/src/resources/radar/attacks/layer7/timeseries-groups.ts index ce7c62ce1e..ab7e962788 100644 --- a/src/resources/radar/attacks/layer7/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer7/timeseries-groups.ts @@ -8,7 +8,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.httpMethod(); + * ``` */ httpMethod( query?: TimeseriesGroupHTTPMethodParams, @@ -33,7 +37,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.httpVersion(); + * ``` */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -58,7 +66,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.industry(); + * ``` */ industry( query?: TimeseriesGroupIndustryParams, @@ -83,7 +95,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version used over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.ipVersion(); + * ``` */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -108,7 +124,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.managedRules(); + * ``` */ managedRules( query?: TimeseriesGroupManagedRulesParams, @@ -133,7 +153,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.mitigationProduct(); + * ``` */ mitigationProduct( query?: TimeseriesGroupMitigationProductParams, @@ -158,7 +182,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.vertical(); + * ``` */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/dns/summary.ts b/src/resources/radar/dns/summary.ts index 575afc929b..9bc87aa1f9 100644 --- a/src/resources/radar/dns/summary.ts +++ b/src/resources/radar/dns/summary.ts @@ -8,7 +8,10 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by cache status. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.dns.summary.cacheHit(); + * ``` */ cacheHit( query?: SummaryCacheHitParams, @@ -33,7 +36,10 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.dns.summary.dnssec(); + * ``` */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -55,7 +61,11 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.summary.dnssecAware(); + * ``` */ dnssecAware( query?: SummaryDNSSECAwareParams, @@ -80,7 +90,10 @@ export class Summary extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.dns.summary.dnssecE2E(); + * ``` */ dnssecE2E( query?: SummaryDNSSECE2EParams, @@ -104,7 +117,10 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by IP version. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.dns.summary.ipVersion(); + * ``` */ ipVersion( query?: SummaryIPVersionParams, @@ -128,7 +144,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.summary.matchingAnswer(); + * ``` */ matchingAnswer( query?: SummaryMatchingAnswerParams, @@ -152,7 +172,10 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.dns.summary.protocol(); + * ``` */ protocol( query?: SummaryProtocolParams, @@ -176,7 +199,10 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by type. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.dns.summary.queryType(); + * ``` */ queryType( query?: SummaryQueryTypeParams, @@ -200,7 +226,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by response code. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.summary.responseCode(); + * ``` */ responseCode( query?: SummaryResponseCodeParams, @@ -224,7 +254,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by minimum response TTL. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.summary.responseTTL(); + * ``` */ responseTTL( query?: SummaryResponseTTLParams, diff --git a/src/resources/radar/dns/timeseries-groups.ts b/src/resources/radar/dns/timeseries-groups.ts index 5e1ea8a4e1..9a242a93fb 100644 --- a/src/resources/radar/dns/timeseries-groups.ts +++ b/src/resources/radar/dns/timeseries-groups.ts @@ -8,7 +8,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by cache status over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.cacheHit(); + * ``` */ cacheHit( query?: TimeseriesGroupCacheHitParams, @@ -33,7 +37,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.dnssec(); + * ``` */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -58,7 +66,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.dnssecAware(); + * ``` */ dnssecAware( query?: TimeseriesGroupDNSSECAwareParams, @@ -84,7 +96,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.dnssecE2E(); + * ``` */ dnssecE2E( query?: TimeseriesGroupDNSSECE2EParams, @@ -108,7 +124,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by IP version over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.ipVersion(); + * ``` */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -132,7 +152,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.matchingAnswer(); + * ``` */ matchingAnswer( query?: TimeseriesGroupMatchingAnswerParams, @@ -157,7 +181,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.protocol(); + * ``` */ protocol( query?: TimeseriesGroupProtocolParams, @@ -181,7 +209,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by type over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.queryType(); + * ``` */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -205,7 +237,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by response code over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.responseCode(); + * ``` */ responseCode( query?: TimeseriesGroupResponseCodeParams, @@ -230,7 +266,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by minimum answer TTL over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.responseTTL(); + * ``` */ responseTTL( query?: TimeseriesGroupResponseTTLParams, diff --git a/src/resources/radar/email/routing/summary.ts b/src/resources/radar/email/routing/summary.ts index 00defd2b84..4085dc05e9 100644 --- a/src/resources/radar/email/routing/summary.ts +++ b/src/resources/radar/email/routing/summary.ts @@ -10,7 +10,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.summary.arc(); + * ``` */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -32,7 +36,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.summary.dkim(); + * ``` */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -54,7 +62,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.summary.dmarc(); + * ``` */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -76,7 +88,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted). * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.summary.encrypted(); + * ``` */ encrypted( query?: SummaryEncryptedParams, @@ -100,7 +116,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by IP version. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.summary.ipVersion(); + * ``` */ ipVersion( query?: SummaryIPVersionParams, @@ -125,7 +145,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.summary.spf(); + * ``` */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/email/routing/timeseries-groups.ts b/src/resources/radar/email/routing/timeseries-groups.ts index 3a9801b143..c398945534 100644 --- a/src/resources/radar/email/routing/timeseries-groups.ts +++ b/src/resources/radar/email/routing/timeseries-groups.ts @@ -10,7 +10,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroups.arc(); + * ``` */ arc( query?: TimeseriesGroupARCParams, @@ -36,7 +40,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroups.dkim(); + * ``` */ dkim( query?: TimeseriesGroupDKIMParams, @@ -62,7 +70,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroups.dmarc(); + * ``` */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -88,7 +100,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted) over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroups.encrypted(); + * ``` */ encrypted( query?: TimeseriesGroupEncryptedParams, @@ -113,7 +129,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by IP version over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroups.ipVersion(); + * ``` */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -139,7 +159,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroups.spf(); + * ``` */ spf( query?: TimeseriesGroupSPFParams, diff --git a/src/resources/radar/email/security/summary.ts b/src/resources/radar/email/security/summary.ts index 5136a742ff..3a984c2f4f 100644 --- a/src/resources/radar/email/security/summary.ts +++ b/src/resources/radar/email/security/summary.ts @@ -10,7 +10,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.arc(); + * ``` */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -32,7 +36,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.dkim(); + * ``` */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -54,7 +62,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.dmarc(); + * ``` */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -75,7 +87,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by malicious classification. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.malicious(); + * ``` */ malicious( query?: SummaryMaliciousParams, @@ -99,7 +115,11 @@ export class Summary extends APIResource { /** * Retrieves the proportion of emails by spam classification (spam vs. non-spam). * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.spam(); + * ``` */ spam(query?: SummarySpamParams, options?: Core.RequestOptions): Core.APIPromise; spam(options?: Core.RequestOptions): Core.APIPromise; @@ -121,7 +141,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.spf(); + * ``` */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; @@ -143,7 +167,11 @@ export class Summary extends APIResource { * Retrieves the proportion of emails by spoof classification (spoof vs. * non-spoof). * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.spoof(); + * ``` */ spoof(query?: SummarySpoofParams, options?: Core.RequestOptions): Core.APIPromise; spoof(options?: Core.RequestOptions): Core.APIPromise; @@ -164,7 +192,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by threat categories. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.threatCategory(); + * ``` */ threatCategory( query?: SummaryThreatCategoryParams, @@ -189,7 +221,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by TLS version. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.tlsVersion(); + * ``` */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/email/security/timeseries-groups.ts b/src/resources/radar/email/security/timeseries-groups.ts index aa620088a0..2fb9bbef99 100644 --- a/src/resources/radar/email/security/timeseries-groups.ts +++ b/src/resources/radar/email/security/timeseries-groups.ts @@ -10,7 +10,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.arc(); + * ``` */ arc( query?: TimeseriesGroupARCParams, @@ -36,7 +40,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.dkim(); + * ``` */ dkim( query?: TimeseriesGroupDKIMParams, @@ -62,7 +70,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.dmarc(); + * ``` */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -87,7 +99,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by malicious classification over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.malicious(); + * ``` */ malicious( query?: TimeseriesGroupMaliciousParams, @@ -113,7 +129,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spam classification (spam vs. non-spam) * over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.spam(); + * ``` */ spam( query?: TimeseriesGroupSpamParams, @@ -139,7 +159,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.spf(); + * ``` */ spf( query?: TimeseriesGroupSPFParams, @@ -165,7 +189,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spoof classification (spoof vs. * non-spoof) over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.spoof(); + * ``` */ spoof( query?: TimeseriesGroupSpoofParams, @@ -190,7 +218,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by threat category over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.threatCategory(); + * ``` */ threatCategory( query?: TimeseriesGroupThreatCategoryParams, @@ -215,7 +247,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by TLS version over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.tlsVersion(); + * ``` */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/entities/asns.ts b/src/resources/radar/entities/asns.ts index 7697e9dd84..66ecf4a6e9 100644 --- a/src/resources/radar/entities/asns.ts +++ b/src/resources/radar/entities/asns.ts @@ -194,20 +194,10 @@ export namespace ASNAsSetResponse { */ name: string; - /** - * The AS number following hierarchical AS-SET name - */ - hierarchical_asn?: number; - /** * The inferred AS number of the AS-SET */ - inferred_asn?: number; - - /** - * The AS number matching PeeringDB record - */ - peeringdb_asn?: number; + asn?: number; } } diff --git a/src/resources/radar/netflows/netflows.ts b/src/resources/radar/netflows/netflows.ts index 55c05d441b..c484510bb6 100644 --- a/src/resources/radar/netflows/netflows.ts +++ b/src/resources/radar/netflows/netflows.ts @@ -13,7 +13,7 @@ export class Netflows extends APIResource { * Retrieves the distribution of network traffic (NetFlows) by HTTP vs other * protocols. * - * @deprecated Use [Get Network Traffic Distribution By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/netflows/methods/summary_v2/) instead. + * @deprecated */ summary( query?: NetflowSummaryParams, diff --git a/src/resources/stream/downloads.ts b/src/resources/stream/downloads.ts index 1fd7a50c02..a9d2589f13 100644 --- a/src/resources/stream/downloads.ts +++ b/src/resources/stream/downloads.ts @@ -6,8 +6,7 @@ import * as Core from '../../core'; export class Downloads extends APIResource { /** * Creates a download for a video when a video is ready to view. Use - * `/downloads/{download_type}` instead for type-specific downloads. Available - * types are `default` and `audio`. + * `/downloads/{download_type}` instead for type-specific downloads. * * @example * ```ts @@ -36,7 +35,7 @@ export class Downloads extends APIResource { /** * Delete the downloads for a video. Use `/downloads/{download_type}` instead for - * type-specific downloads. Available types are `default` and `audio`. + * type-specific downloads. * * @example * ```ts diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts index 4af2451c88..8b15a53e2d 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts @@ -168,7 +168,7 @@ export namespace BindingGetResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; 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 78e5e95423..9170366dbd 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -616,7 +616,7 @@ export namespace ScriptUpdateParams { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; 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 216456a041..fea3a53ffc 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -247,7 +247,7 @@ export namespace SettingEditResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -999,7 +999,7 @@ export namespace SettingGetResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -1769,7 +1769,7 @@ export namespace SettingEditParams { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; diff --git a/src/resources/workers/beta/workers/versions.ts b/src/resources/workers/beta/workers/versions.ts index 185cea7033..300510fc56 100644 --- a/src/resources/workers/beta/workers/versions.ts +++ b/src/resources/workers/beta/workers/versions.ts @@ -409,7 +409,7 @@ export namespace Version { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -1263,7 +1263,7 @@ export namespace VersionCreateParams { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; diff --git a/src/resources/workers/beta/workers/workers.ts b/src/resources/workers/beta/workers/workers.ts index d4e49b0055..ba7791704e 100644 --- a/src/resources/workers/beta/workers/workers.ts +++ b/src/resources/workers/beta/workers/workers.ts @@ -193,11 +193,6 @@ export interface Worker { */ observability: Worker.Observability; - /** - * Other resources that reference the Worker and depend on it existing. - */ - references: Worker.References; - /** * Subdomain settings for the Worker. */ @@ -264,139 +259,6 @@ export namespace Worker { } } - /** - * Other resources that reference the Worker and depend on it existing. - */ - export interface References { - /** - * Other Workers that reference the Worker as an outbound for a dispatch namespace. - */ - dispatch_namespace_outbounds: Array; - - /** - * Custom domains connected to the Worker. - */ - domains: Array; - - /** - * Other Workers that reference Durable Object classes implemented by the Worker. - */ - durable_objects: Array; - - /** - * Queues that send messages to the Worker. - */ - queues: Array; - - /** - * Other Workers that reference the Worker using - * [service bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/). - */ - workers: Array; - } - - export namespace References { - export interface DispatchNamespaceOutbound { - /** - * ID of the dispatch namespace. - */ - namespace_id: string; - - /** - * Name of the dispatch namespace. - */ - namespace_name: string; - - /** - * ID of the Worker using the dispatch namespace. - */ - worker_id: string; - - /** - * Name of the Worker using the dispatch namespace. - */ - worker_name: string; - } - - export interface Domain { - /** - * ID of the custom domain. - */ - id: string; - - /** - * ID of the TLS certificate issued for the custom domain. - */ - certificate_id: string; - - /** - * Full hostname of the custom domain, including the zone name. - */ - hostname: string; - - /** - * ID of the zone. - */ - zone_id: string; - - /** - * Name of the zone. - */ - zone_name: string; - } - - export interface DurableObject { - /** - * ID of the Durable Object namespace being used. - */ - namespace_id: string; - - /** - * Name of the Durable Object namespace being used. - */ - namespace_name: string; - - /** - * ID of the Worker using the Durable Object implementation. - */ - worker_id: string; - - /** - * Name of the Worker using the Durable Object implementation. - */ - worker_name: string; - } - - export interface Queue { - /** - * ID of the queue consumer configuration. - */ - queue_consumer_id: string; - - /** - * ID of the queue. - */ - queue_id: string; - - /** - * Name of the queue. - */ - queue_name: string; - } - - export interface Worker { - /** - * ID of the referencing Worker. - */ - id: string; - - /** - * Name of the referencing Worker. - */ - name: string; - } - } - /** * Subdomain settings for the Worker. */ diff --git a/src/resources/workers/scripts/script-and-version-settings.ts b/src/resources/workers/scripts/script-and-version-settings.ts index d6ef7552ca..05bc7152a0 100644 --- a/src/resources/workers/scripts/script-and-version-settings.ts +++ b/src/resources/workers/scripts/script-and-version-settings.ts @@ -243,7 +243,7 @@ export namespace ScriptAndVersionSettingEditResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -995,7 +995,7 @@ export namespace ScriptAndVersionSettingGetResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -1765,7 +1765,7 @@ export namespace ScriptAndVersionSettingEditParams { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index 70546d5580..d96bb354dc 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -925,7 +925,7 @@ export namespace ScriptUpdateParams { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; diff --git a/src/resources/workers/scripts/versions.ts b/src/resources/workers/scripts/versions.ts index c9027b6f0c..d4334609ad 100644 --- a/src/resources/workers/scripts/versions.ts +++ b/src/resources/workers/scripts/versions.ts @@ -245,7 +245,7 @@ export namespace VersionCreateResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -981,7 +981,7 @@ export namespace VersionGetResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -1634,11 +1634,6 @@ export namespace VersionCreateParams { export namespace Metadata { export interface Annotations { - /** - * Associated alias for a version. - */ - 'workers/alias'?: string; - /** * Human-readable message about the version. Truncated to 100 bytes. */ @@ -1745,7 +1740,7 @@ export namespace VersionCreateParams { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; diff --git a/src/resources/zones/settings.ts b/src/resources/zones/settings.ts index 4a3ad6c613..0838680bb9 100644 --- a/src/resources/zones/settings.ts +++ b/src/resources/zones/settings.ts @@ -301,8 +301,13 @@ export interface BrowserCacheTTL { id?: 'browser_cache_ttl'; /** - * The number of seconds to cache resources for. Setting this to 0 enables "Respect - * Existing Headers". + * The number of seconds to cache resources for. Minimum values by plan: + * + * - Free: 7200 seconds (2 hours) + * - Pro: 3600 seconds (1 hour) + * - Business: 1 second + * - Enterprise: 1 second Setting this to 0 enables "Respect Existing Headers" and + * is allowed for all plans. */ value?: number; } @@ -314,8 +319,13 @@ export interface BrowserCacheTTLParam { id?: 'browser_cache_ttl'; /** - * The number of seconds to cache resources for. Setting this to 0 enables "Respect - * Existing Headers". + * The number of seconds to cache resources for. Minimum values by plan: + * + * - Free: 7200 seconds (2 hours) + * - Pro: 3600 seconds (1 hour) + * - Business: 1 second + * - Enterprise: 1 second Setting this to 0 enables "Respect Existing Headers" and + * is allowed for all plans. */ value?: number; } @@ -1092,10 +1102,6 @@ export interface PseudoIPV4 { modified_on?: string | null; } -/** - * @deprecated This page rule is deprecated. This functionality is no longer - * supported. - */ export interface ResponseBuffering { /** * Turn on or off whether Cloudflare should wait for an entire file from the origin @@ -1110,10 +1116,6 @@ export interface ResponseBuffering { value?: 'on' | 'off'; } -/** - * @deprecated This page rule is deprecated. This functionality is no longer - * supported. - */ export interface ResponseBufferingParam { /** * Turn on or off whether Cloudflare should wait for an entire file from the origin @@ -2213,8 +2215,10 @@ export namespace SettingEditResponse { } /** - * @deprecated This zone setting is deprecated. This functionality is no longer - * supported. + * Enables or disables buffering of responses from the proxied server. Cloudflare + * may buffer the whole payload to deliver it at once to the client versus allowing + * it to be delivered in chunks. By default, the proxied server streams directly + * and is not buffered by Cloudflare. This is limited to Enterprise Zones. */ export interface ZonesSchemasResponseBuffering { /** @@ -3254,8 +3258,10 @@ export namespace SettingGetResponse { } /** - * @deprecated This zone setting is deprecated. This functionality is no longer - * supported. + * Enables or disables buffering of responses from the proxied server. Cloudflare + * may buffer the whole payload to deliver it at once to the client versus allowing + * it to be delivered in chunks. By default, the proxied server streams directly + * and is not buffered by Cloudflare. This is limited to Enterprise Zones. */ export interface ZonesSchemasResponseBuffering { /** diff --git a/tests/api-resources/alerting/destinations/webhooks.test.ts b/tests/api-resources/alerting/destinations/webhooks.test.ts index f7e64ac407..400214bb31 100644 --- a/tests/api-resources/alerting/destinations/webhooks.test.ts +++ b/tests/api-resources/alerting/destinations/webhooks.test.ts @@ -38,11 +38,14 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('update: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.update('b115d5ec15c641ee8b7692c449b5227b', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'Slack Webhook', - url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', - }); + const responsePromise = client.alerting.destinations.webhooks.update( + 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'Slack Webhook', + url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -54,12 +57,15 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('update: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.update('b115d5ec15c641ee8b7692c449b5227b', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'Slack Webhook', - url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', - secret: 'secret', - }); + const response = await client.alerting.destinations.webhooks.update( + 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'Slack Webhook', + url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + secret: 'secret', + }, + ); }); test('list: only required params', async () => { @@ -82,9 +88,10 @@ describe('resource webhooks', () => { }); test('delete: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.delete('b115d5ec15c641ee8b7692c449b5227b', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.alerting.destinations.webhooks.delete( + 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -95,16 +102,18 @@ describe('resource webhooks', () => { }); test('delete: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.delete('b115d5ec15c641ee8b7692c449b5227b', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const response = await client.alerting.destinations.webhooks.delete( + 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); }); // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('get: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.get('b115d5ec15c641ee8b7692c449b5227b', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.alerting.destinations.webhooks.get( + 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -116,7 +125,7 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('get: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.get('b115d5ec15c641ee8b7692c449b5227b', { + const response = await client.alerting.destinations.webhooks.get('b115d5ec-15c6-41ee-8b76-92c449b5227b', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/alerting/policies.test.ts b/tests/api-resources/alerting/policies.test.ts index 3de56f13b7..aed5640624 100644 --- a/tests/api-resources/alerting/policies.test.ts +++ b/tests/api-resources/alerting/policies.test.ts @@ -35,9 +35,9 @@ describe('resource policies', () => { alert_type: 'universal_ssl_event_type', enabled: true, mechanisms: { - email: [{ id: 'id' }], - pagerduty: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], - webhooks: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], + email: [{ id: 'test@example.com' }], + pagerduty: [{ id: 'e8133a15-00a4-4d69-aec1-32f70c51f6e5' }], + webhooks: [{ id: '14cc1190-5d2b-4b98-a696-c424cb2ad05f' }], }, name: 'SSL Notification Event Policy', alert_interval: '30m', @@ -91,7 +91,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('update: only required params', async () => { - const responsePromise = client.alerting.policies.update('0da2b59ef118439d8097bdfb215203c9', { + const responsePromise = client.alerting.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -105,7 +105,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('update: required and optional params', async () => { - const response = await client.alerting.policies.update('0da2b59ef118439d8097bdfb215203c9', { + const response = await client.alerting.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', alert_interval: '30m', alert_type: 'universal_ssl_event_type', @@ -156,9 +156,9 @@ describe('resource policies', () => { zones: ['string'], }, mechanisms: { - email: [{ id: 'id' }], - pagerduty: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], - webhooks: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], + email: [{ id: 'test@example.com' }], + pagerduty: [{ id: 'e8133a15-00a4-4d69-aec1-32f70c51f6e5' }], + webhooks: [{ id: '14cc1190-5d2b-4b98-a696-c424cb2ad05f' }], }, name: 'SSL Notification Event Policy', }); @@ -180,7 +180,7 @@ describe('resource policies', () => { }); test('delete: only required params', async () => { - const responsePromise = client.alerting.policies.delete('0da2b59ef118439d8097bdfb215203c9', { + const responsePromise = client.alerting.policies.delete('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -193,14 +193,14 @@ describe('resource policies', () => { }); test('delete: required and optional params', async () => { - const response = await client.alerting.policies.delete('0da2b59ef118439d8097bdfb215203c9', { + const response = await client.alerting.policies.delete('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('get: only required params', async () => { - const responsePromise = client.alerting.policies.get('0da2b59ef118439d8097bdfb215203c9', { + const responsePromise = client.alerting.policies.get('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -214,7 +214,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('get: required and optional params', async () => { - const response = await client.alerting.policies.get('0da2b59ef118439d8097bdfb215203c9', { + const response = await client.alerting.policies.get('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/pages/projects/projects.test.ts b/tests/api-resources/pages/projects/projects.test.ts index 41a92b2403..2057a0124d 100644 --- a/tests/api-resources/pages/projects/projects.test.ts +++ b/tests/api-resources/pages/projects/projects.test.ts @@ -115,11 +115,7 @@ describe('resource projects', () => { }); test('list: required and optional params', async () => { - const response = await client.pages.projects.list({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - page: 1, - per_page: 10, - }); + const response = await client.pages.projects.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); }); test('delete: only required params', async () => { diff --git a/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts b/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts index 597bcca970..c3238ed19b 100644 --- a/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts +++ b/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts @@ -11,12 +11,7 @@ const client = new Cloudflare({ describe('resource connectivityPrecheck', () => { test('source: only required params', async () => { - const responsePromise = client.r2.superSlurper.connectivityPrecheck.source({ - account_id: 'account_id', - bucket: 'bucket', - secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, - vendor: 's3', - }); + const responsePromise = client.r2.superSlurper.connectivityPrecheck.source({ account_id: 'account_id' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -30,21 +25,14 @@ describe('resource connectivityPrecheck', () => { const response = await client.r2.superSlurper.connectivityPrecheck.source({ account_id: 'account_id', bucket: 'bucket', + endpoint: 'endpoint', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 's3', - endpoint: 'endpoint', - pathPrefix: 'pathPrefix', - region: 'region', }); }); test('target: only required params', async () => { - const responsePromise = client.r2.superSlurper.connectivityPrecheck.target({ - account_id: 'account_id', - bucket: 'bucket', - secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, - vendor: 'r2', - }); + const responsePromise = client.r2.superSlurper.connectivityPrecheck.target({ account_id: 'account_id' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -58,9 +46,9 @@ describe('resource connectivityPrecheck', () => { const response = await client.r2.superSlurper.connectivityPrecheck.target({ account_id: 'account_id', bucket: 'bucket', + jurisdiction: 'default', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 'r2', - jurisdiction: 'default', }); }); }); diff --git a/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts b/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts index e2806bfb82..8376af108a 100644 --- a/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts +++ b/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts @@ -27,17 +27,15 @@ describe('resource jobs', () => { overwrite: true, source: { bucket: 'bucket', + endpoint: 'endpoint', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 's3', - endpoint: 'endpoint', - pathPrefix: 'pathPrefix', - region: 'region', }, target: { bucket: 'bucket', + jurisdiction: 'default', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 'r2', - jurisdiction: 'default', }, }); }); diff --git a/tests/api-resources/workers/scripts/versions.test.ts b/tests/api-resources/workers/scripts/versions.test.ts index 437f382fd7..82c89f8328 100644 --- a/tests/api-resources/workers/scripts/versions.test.ts +++ b/tests/api-resources/workers/scripts/versions.test.ts @@ -31,11 +31,7 @@ describe('resource versions', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', metadata: { main_module: 'worker.js', - annotations: { - 'workers/alias': 'staging', - 'workers/message': 'Fixed worker code.', - 'workers/tag': 'workers/tag', - }, + annotations: { 'workers/message': 'Fixed worker code.', 'workers/tag': 'workers/tag' }, bindings: [{ name: 'MY_ENV_VAR', text: 'my_data', type: 'plain_text' }], compatibility_date: '2021-01-01', compatibility_flags: ['nodejs_compat'], From fd5bffab1fd369b9ab609cff60f6e2f7208d2ffe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 22:56:10 +0000 Subject: [PATCH 068/451] chore(api): update composite API spec --- .stats.yml | 4 +- api.md | 2 +- .../alerting/destinations/webhooks.ts | 6 +- src/resources/alerting/policies.ts | 6 +- src/resources/pages/index.ts | 1 + src/resources/pages/pages.ts | 6 +- src/resources/pages/projects/index.ts | 1 + src/resources/pages/projects/projects.ts | 22 ++- .../r2/super-slurper/connectivity-precheck.ts | 76 +++++++--- src/resources/r2/super-slurper/jobs/jobs.ts | 52 ++++--- src/resources/radar/as112/summary.ts | 34 +---- .../radar/as112/timeseries-groups.ts | 36 +---- src/resources/radar/attacks/layer3/summary.ts | 42 +----- .../radar/attacks/layer3/timeseries-groups.ts | 42 +----- src/resources/radar/attacks/layer7/summary.ts | 42 +----- .../radar/attacks/layer7/timeseries-groups.ts | 42 +----- src/resources/radar/dns/summary.ts | 54 ++----- src/resources/radar/dns/timeseries-groups.ts | 60 ++------ src/resources/radar/email/routing/summary.ts | 36 +---- .../radar/email/routing/timeseries-groups.ts | 36 +---- src/resources/radar/email/security/summary.ts | 54 ++----- .../radar/email/security/timeseries-groups.ts | 54 ++----- src/resources/radar/entities/asns.ts | 12 +- src/resources/radar/netflows/netflows.ts | 2 +- src/resources/stream/downloads.ts | 5 +- .../dispatch/namespaces/scripts/bindings.ts | 2 +- .../dispatch/namespaces/scripts/scripts.ts | 2 +- .../dispatch/namespaces/scripts/settings.ts | 6 +- .../workers/beta/workers/versions.ts | 4 +- src/resources/workers/beta/workers/workers.ts | 138 ++++++++++++++++++ .../scripts/script-and-version-settings.ts | 6 +- src/resources/workers/scripts/scripts.ts | 2 +- src/resources/workers/scripts/versions.ts | 11 +- src/resources/zones/settings.ts | 38 ++--- .../alerting/destinations/webhooks.test.ts | 51 +++---- tests/api-resources/alerting/policies.test.ts | 24 +-- .../pages/projects/projects.test.ts | 6 +- .../connectivity-precheck.test.ts | 20 ++- .../r2/super-slurper/jobs/jobs.test.ts | 6 +- .../workers/scripts/versions.test.ts | 6 +- 40 files changed, 453 insertions(+), 596 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5637fc3e0e..0a983f097f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ca8fbfa82d19dca400ec61b8c93392de1acd157860e435419f9a5e9ec8c586e0.yml -openapi_spec_hash: 77d55c70bc3824ac61bd056e2319ee18 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7492bc33f84221ee63fe654c22680333788bfd2dfe8985c58f9d3db555ffca2b.yml +openapi_spec_hash: b454db8aa8af2160a780a5b69445f3a4 config_hash: 107e0f1f8a98b007260b319226b88b3c diff --git a/api.md b/api.md index 7ffb0aa433..866462c86c 100644 --- a/api.md +++ b/api.md @@ -3925,7 +3925,7 @@ Types: Methods: - client.pages.projects.create({ ...params }) -> Project -- client.pages.projects.list({ ...params }) -> DeploymentsSinglePage +- client.pages.projects.list({ ...params }) -> DeploymentsV4PagePaginationArray - client.pages.projects.delete(projectName, { ...params }) -> ProjectDeleteResponse | null - client.pages.projects.edit(projectName, { ...params }) -> Project - client.pages.projects.get(projectName, { ...params }) -> Project diff --git a/src/resources/alerting/destinations/webhooks.ts b/src/resources/alerting/destinations/webhooks.ts index 279c67d0bf..605e015ae3 100644 --- a/src/resources/alerting/destinations/webhooks.ts +++ b/src/resources/alerting/destinations/webhooks.ts @@ -35,7 +35,7 @@ export class Webhooks extends APIResource { * ```ts * const webhook = * await client.alerting.destinations.webhooks.update( - * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + * 'b115d5ec15c641ee8b7692c449b5227b', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * name: 'Slack Webhook', @@ -90,7 +90,7 @@ export class Webhooks extends APIResource { * ```ts * const webhook = * await client.alerting.destinations.webhooks.delete( - * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + * 'b115d5ec15c641ee8b7692c449b5227b', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -114,7 +114,7 @@ export class Webhooks extends APIResource { * ```ts * const webhooks = * await client.alerting.destinations.webhooks.get( - * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + * 'b115d5ec15c641ee8b7692c449b5227b', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` diff --git a/src/resources/alerting/policies.ts b/src/resources/alerting/policies.ts index c2caed4005..5991ca0862 100644 --- a/src/resources/alerting/policies.ts +++ b/src/resources/alerting/policies.ts @@ -35,7 +35,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.update( - * '0da2b59e-f118-439d-8097-bdfb215203c9', + * '0da2b59ef118439d8097bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -85,7 +85,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.delete( - * '0da2b59e-f118-439d-8097-bdfb215203c9', + * '0da2b59ef118439d8097bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -105,7 +105,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.get( - * '0da2b59e-f118-439d-8097-bdfb215203c9', + * '0da2b59ef118439d8097bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` diff --git a/src/resources/pages/index.ts b/src/resources/pages/index.ts index 2b2862b5c1..ede14daf73 100644 --- a/src/resources/pages/index.ts +++ b/src/resources/pages/index.ts @@ -2,6 +2,7 @@ export { DeploymentsSinglePage, + DeploymentsV4PagePaginationArray, Projects, type Deployment, type Project, diff --git a/src/resources/pages/pages.ts b/src/resources/pages/pages.ts index e92779690f..e0331f786f 100644 --- a/src/resources/pages/pages.ts +++ b/src/resources/pages/pages.ts @@ -4,7 +4,7 @@ import { APIResource } from '../../resource'; import * as ProjectsAPI from './projects/projects'; import { Deployment, - DeploymentsSinglePage, + DeploymentsV4PagePaginationArray, Project, ProjectCreateParams, ProjectDeleteParams, @@ -23,7 +23,7 @@ export class Pages extends APIResource { } Pages.Projects = Projects; -Pages.DeploymentsSinglePage = DeploymentsSinglePage; +Pages.DeploymentsV4PagePaginationArray = DeploymentsV4PagePaginationArray; export declare namespace Pages { export { @@ -33,7 +33,7 @@ export declare namespace Pages { type Stage as Stage, type ProjectDeleteResponse as ProjectDeleteResponse, type ProjectPurgeBuildCacheResponse as ProjectPurgeBuildCacheResponse, - DeploymentsSinglePage as DeploymentsSinglePage, + DeploymentsV4PagePaginationArray as DeploymentsV4PagePaginationArray, type ProjectCreateParams as ProjectCreateParams, type ProjectListParams as ProjectListParams, type ProjectDeleteParams as ProjectDeleteParams, diff --git a/src/resources/pages/projects/index.ts b/src/resources/pages/projects/index.ts index a40f121ec5..867a3f7b6b 100644 --- a/src/resources/pages/projects/index.ts +++ b/src/resources/pages/projects/index.ts @@ -12,6 +12,7 @@ export { } from './deployments/index'; export { DeploymentsSinglePage, + DeploymentsV4PagePaginationArray, Projects, type Deployment, type Project, diff --git a/src/resources/pages/projects/projects.ts b/src/resources/pages/projects/projects.ts index 01225591dc..efac2c7d22 100644 --- a/src/resources/pages/projects/projects.ts +++ b/src/resources/pages/projects/projects.ts @@ -28,7 +28,7 @@ import { DeploymentRollbackParams, Deployments, } from './deployments/deployments'; -import { SinglePage } from '../../../pagination'; +import { SinglePage, V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; export class Projects extends APIResource { deployments: DeploymentsAPI.Deployments = new DeploymentsAPI.Deployments(this._client); @@ -69,9 +69,13 @@ export class Projects extends APIResource { list( params: ProjectListParams, options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id } = params; - return this._client.getAPIList(`/accounts/${account_id}/pages/projects`, DeploymentsSinglePage, options); + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/pages/projects`, + DeploymentsV4PagePaginationArray, + { query, ...options }, + ); } /** @@ -176,6 +180,8 @@ export class Projects extends APIResource { } } +export class DeploymentsV4PagePaginationArray extends V4PagePaginationArray {} + export class DeploymentsSinglePage extends SinglePage {} export interface Deployment { @@ -1641,9 +1647,9 @@ export namespace ProjectCreateParams { } } -export interface ProjectListParams { +export interface ProjectListParams extends V4PagePaginationArrayParams { /** - * Identifier + * Path param: Identifier */ account_id: string; } @@ -2270,7 +2276,7 @@ export interface ProjectPurgeBuildCacheParams { account_id: string; } -Projects.DeploymentsSinglePage = DeploymentsSinglePage; +Projects.DeploymentsV4PagePaginationArray = DeploymentsV4PagePaginationArray; Projects.Deployments = Deployments; Projects.Domains = Domains; Projects.DomainListResponsesSinglePage = DomainListResponsesSinglePage; @@ -2282,7 +2288,7 @@ export declare namespace Projects { type Stage as Stage, type ProjectDeleteResponse as ProjectDeleteResponse, type ProjectPurgeBuildCacheResponse as ProjectPurgeBuildCacheResponse, - DeploymentsSinglePage as DeploymentsSinglePage, + DeploymentsV4PagePaginationArray as DeploymentsV4PagePaginationArray, type ProjectCreateParams as ProjectCreateParams, type ProjectListParams as ProjectListParams, type ProjectDeleteParams as ProjectDeleteParams, diff --git a/src/resources/r2/super-slurper/connectivity-precheck.ts b/src/resources/r2/super-slurper/connectivity-precheck.ts index 654a8193d5..2283824388 100644 --- a/src/resources/r2/super-slurper/connectivity-precheck.ts +++ b/src/resources/r2/super-slurper/connectivity-precheck.ts @@ -13,6 +13,12 @@ export class ConnectivityPrecheck extends APIResource { * const response = * await client.r2.superSlurper.connectivityPrecheck.source({ * account_id: 'account_id', + * bucket: 'bucket', + * secret: { + * accessKeyId: 'accessKeyId', + * secretAccessKey: 'secretAccessKey', + * }, + * vendor: 's3', * }); * ``` */ @@ -37,6 +43,12 @@ export class ConnectivityPrecheck extends APIResource { * const response = * await client.r2.superSlurper.connectivityPrecheck.target({ * account_id: 'account_id', + * bucket: 'bucket', + * secret: { + * accessKeyId: 'accessKeyId', + * secretAccessKey: 'secretAccessKey', + * }, + * vendor: 'r2', * }); * ``` */ @@ -77,7 +89,17 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket?: string; + bucket: string; + + /** + * Body param: + */ + secret: R2SlurperS3SourceSchema.Secret; + + /** + * Body param: + */ + vendor: 's3'; /** * Body param: @@ -87,19 +109,19 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - secret?: R2SlurperS3SourceSchema.Secret; + pathPrefix?: string | null; /** * Body param: */ - vendor?: 's3'; + region?: string | null; } export namespace R2SlurperS3SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } @@ -112,24 +134,29 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket?: string; + bucket: string; + + /** + * Body param: + */ + secret: R2SlurperGcsSourceSchema.Secret; /** * Body param: */ - secret?: R2SlurperGcsSourceSchema.Secret; + vendor: 'gcs'; /** * Body param: */ - vendor?: 'gcs'; + pathPrefix?: string | null; } export namespace R2SlurperGcsSourceSchema { export interface Secret { - clientEmail?: string; + clientEmail: string; - privateKey?: string; + privateKey: string; } } @@ -142,29 +169,34 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket?: string; + bucket: string; /** * Body param: */ - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: R2SlurperR2SourceSchema.Secret; + + /** + * Body param: + */ + vendor: SippyAPI.ProviderParam; /** * Body param: */ - secret?: R2SlurperR2SourceSchema.Secret; + jurisdiction?: 'default' | 'eu' | 'fedramp'; /** * Body param: */ - vendor?: SippyAPI.ProviderParam; + pathPrefix?: string | null; } export namespace R2SlurperR2SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } } @@ -178,29 +210,29 @@ export interface ConnectivityPrecheckTargetParams { /** * Body param: */ - bucket?: string; + bucket: string; /** * Body param: */ - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: ConnectivityPrecheckTargetParams.Secret; /** * Body param: */ - secret?: ConnectivityPrecheckTargetParams.Secret; + vendor: SippyAPI.ProviderParam; /** * Body param: */ - vendor?: SippyAPI.ProviderParam; + jurisdiction?: 'default' | 'eu' | 'fedramp'; } export namespace ConnectivityPrecheckTargetParams { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } diff --git a/src/resources/r2/super-slurper/jobs/jobs.ts b/src/resources/r2/super-slurper/jobs/jobs.ts index 0e70bb10e5..7732e944b1 100644 --- a/src/resources/r2/super-slurper/jobs/jobs.ts +++ b/src/resources/r2/super-slurper/jobs/jobs.ts @@ -360,72 +360,80 @@ export interface JobCreateParams { export namespace JobCreateParams { export interface R2SlurperS3SourceSchema { - bucket?: string; + bucket: string; + + secret: R2SlurperS3SourceSchema.Secret; + + vendor: 's3'; endpoint?: string | null; - secret?: R2SlurperS3SourceSchema.Secret; + pathPrefix?: string | null; - vendor?: 's3'; + region?: string | null; } export namespace R2SlurperS3SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } export interface R2SlurperGcsSourceSchema { - bucket?: string; + bucket: string; - secret?: R2SlurperGcsSourceSchema.Secret; + secret: R2SlurperGcsSourceSchema.Secret; - vendor?: 'gcs'; + vendor: 'gcs'; + + pathPrefix?: string | null; } export namespace R2SlurperGcsSourceSchema { export interface Secret { - clientEmail?: string; + clientEmail: string; - privateKey?: string; + privateKey: string; } } export interface R2SlurperR2SourceSchema { - bucket?: string; + bucket: string; - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: R2SlurperR2SourceSchema.Secret; - secret?: R2SlurperR2SourceSchema.Secret; + vendor: SippyAPI.ProviderParam; + + jurisdiction?: 'default' | 'eu' | 'fedramp'; - vendor?: SippyAPI.ProviderParam; + pathPrefix?: string | null; } export namespace R2SlurperR2SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } export interface Target { - bucket?: string; + bucket: string; - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: Target.Secret; - secret?: Target.Secret; + vendor: SippyAPI.ProviderParam; - vendor?: SippyAPI.ProviderParam; + jurisdiction?: 'default' | 'eu' | 'fedramp'; } export namespace Target { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } } diff --git a/src/resources/radar/as112/summary.ts b/src/resources/radar/as112/summary.ts index c59fdaeb5a..d6034b19c4 100644 --- a/src/resources/radar/as112/summary.ts +++ b/src/resources/radar/as112/summary.ts @@ -9,10 +9,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by DNSSEC (DNS Security * Extensions) support. * - * @example - * ```ts - * const response = await client.radar.as112.summary.dnssec(); - * ``` + * @deprecated */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -34,10 +31,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by EDNS (Extension Mechanisms * for DNS) support. * - * @example - * ```ts - * const response = await client.radar.as112.summary.edns(); - * ``` + * @deprecated */ edns(query?: SummaryEdnsParams, options?: Core.RequestOptions): Core.APIPromise; edns(options?: Core.RequestOptions): Core.APIPromise; @@ -58,11 +52,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by IP version. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -86,11 +76,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by protocol. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.protocol(); - * ``` + * @deprecated */ protocol( query?: SummaryProtocolParams, @@ -114,11 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by type. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.queryType(); - * ``` + * @deprecated */ queryType( query?: SummaryQueryTypeParams, @@ -142,11 +124,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of AS112 DNS requests classified by response code. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.responseCodes(); - * ``` + * @deprecated */ responseCodes( query?: SummaryResponseCodesParams, diff --git a/src/resources/radar/as112/timeseries-groups.ts b/src/resources/radar/as112/timeseries-groups.ts index a9e2aa049c..e5593df35c 100644 --- a/src/resources/radar/as112/timeseries-groups.ts +++ b/src/resources/radar/as112/timeseries-groups.ts @@ -9,11 +9,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by DNSSEC (DNS Security * Extensions) support over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.dnssec(); - * ``` + * @deprecated */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -38,11 +34,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by EDNS (Extension Mechanisms * for DNS) support over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.edns(); - * ``` + * @deprecated */ edns( query?: TimeseriesGroupEdnsParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -96,11 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by protocol over * time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.protocol(); - * ``` + * @deprecated */ protocol( query?: TimeseriesGroupProtocolParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by type over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.queryType(); - * ``` + * @deprecated */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -154,11 +134,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by response code * over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.responseCodes(); - * ``` + * @deprecated */ responseCodes( query?: TimeseriesGroupResponseCodesParams, diff --git a/src/resources/radar/attacks/layer3/summary.ts b/src/resources/radar/attacks/layer3/summary.ts index 73ed7d7c70..bc4ccc4c81 100644 --- a/src/resources/radar/attacks/layer3/summary.ts +++ b/src/resources/radar/attacks/layer3/summary.ts @@ -8,11 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.bitrate(); - * ``` + * @deprecated */ bitrate( query?: SummaryBitrateParams, @@ -36,11 +32,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.duration(); - * ``` + * @deprecated */ duration( query?: SummaryDurationParams, @@ -64,11 +56,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.industry(); - * ``` + * @deprecated */ industry( query?: SummaryIndustryParams, @@ -92,11 +80,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -120,11 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.protocol(); - * ``` + * @deprecated */ protocol( query?: SummaryProtocolParams, @@ -148,11 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.vector(); - * ``` + * @deprecated */ vector(query?: SummaryVectorParams, options?: Core.RequestOptions): Core.APIPromise; vector(options?: Core.RequestOptions): Core.APIPromise; @@ -173,11 +149,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.vertical(); - * ``` + * @deprecated */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer3/timeseries-groups.ts b/src/resources/radar/attacks/layer3/timeseries-groups.ts index 740bb97cae..9f8d171a40 100644 --- a/src/resources/radar/attacks/layer3/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer3/timeseries-groups.ts @@ -8,11 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.bitrate(); - * ``` + * @deprecated */ bitrate( query?: TimeseriesGroupBitrateParams, @@ -37,11 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.duration(); - * ``` + * @deprecated */ duration( query?: TimeseriesGroupDurationParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.industry(); - * ``` + * @deprecated */ industry( query?: TimeseriesGroupIndustryParams, @@ -95,11 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.protocol(); - * ``` + * @deprecated */ protocol( query?: TimeseriesGroupProtocolParams, @@ -153,11 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.vector(); - * ``` + * @deprecated */ vector( query?: TimeseriesGroupVectorParams, @@ -182,11 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.vertical(); - * ``` + * @deprecated */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer7/summary.ts b/src/resources/radar/attacks/layer7/summary.ts index 4afa3d68d0..160eb24dd8 100644 --- a/src/resources/radar/attacks/layer7/summary.ts +++ b/src/resources/radar/attacks/layer7/summary.ts @@ -8,11 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.httpMethod(); - * ``` + * @deprecated */ httpMethod( query?: SummaryHTTPMethodParams, @@ -37,11 +33,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.httpVersion(); - * ``` + * @deprecated */ httpVersion( query?: SummaryHTTPVersionParams, @@ -66,11 +58,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.industry(); - * ``` + * @deprecated */ industry( query?: SummaryIndustryParams, @@ -94,11 +82,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -122,11 +106,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.managedRules(); - * ``` + * @deprecated */ managedRules( query?: SummaryManagedRulesParams, @@ -151,11 +131,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.mitigationProduct(); - * ``` + * @deprecated */ mitigationProduct( query?: SummaryMitigationProductParams, @@ -180,11 +156,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.vertical(); - * ``` + * @deprecated */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer7/timeseries-groups.ts b/src/resources/radar/attacks/layer7/timeseries-groups.ts index ab7e962788..ce7c62ce1e 100644 --- a/src/resources/radar/attacks/layer7/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer7/timeseries-groups.ts @@ -8,11 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.httpMethod(); - * ``` + * @deprecated */ httpMethod( query?: TimeseriesGroupHTTPMethodParams, @@ -37,11 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.httpVersion(); - * ``` + * @deprecated */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.industry(); - * ``` + * @deprecated */ industry( query?: TimeseriesGroupIndustryParams, @@ -95,11 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version used over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.managedRules(); - * ``` + * @deprecated */ managedRules( query?: TimeseriesGroupManagedRulesParams, @@ -153,11 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.mitigationProduct(); - * ``` + * @deprecated */ mitigationProduct( query?: TimeseriesGroupMitigationProductParams, @@ -182,11 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.vertical(); - * ``` + * @deprecated */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/dns/summary.ts b/src/resources/radar/dns/summary.ts index 9bc87aa1f9..575afc929b 100644 --- a/src/resources/radar/dns/summary.ts +++ b/src/resources/radar/dns/summary.ts @@ -8,10 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by cache status. * - * @example - * ```ts - * const response = await client.radar.dns.summary.cacheHit(); - * ``` + * @deprecated */ cacheHit( query?: SummaryCacheHitParams, @@ -36,10 +33,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support. * - * @example - * ```ts - * const response = await client.radar.dns.summary.dnssec(); - * ``` + * @deprecated */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -61,11 +55,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.dnssecAware(); - * ``` + * @deprecated */ dnssecAware( query?: SummaryDNSSECAwareParams, @@ -90,10 +80,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status. * - * @example - * ```ts - * const response = await client.radar.dns.summary.dnssecE2E(); - * ``` + * @deprecated */ dnssecE2E( query?: SummaryDNSSECE2EParams, @@ -117,10 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by IP version. * - * @example - * ```ts - * const response = await client.radar.dns.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -144,11 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.matchingAnswer(); - * ``` + * @deprecated */ matchingAnswer( query?: SummaryMatchingAnswerParams, @@ -172,10 +152,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol. * - * @example - * ```ts - * const response = await client.radar.dns.summary.protocol(); - * ``` + * @deprecated */ protocol( query?: SummaryProtocolParams, @@ -199,10 +176,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by type. * - * @example - * ```ts - * const response = await client.radar.dns.summary.queryType(); - * ``` + * @deprecated */ queryType( query?: SummaryQueryTypeParams, @@ -226,11 +200,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by response code. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.responseCode(); - * ``` + * @deprecated */ responseCode( query?: SummaryResponseCodeParams, @@ -254,11 +224,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by minimum response TTL. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.responseTTL(); - * ``` + * @deprecated */ responseTTL( query?: SummaryResponseTTLParams, diff --git a/src/resources/radar/dns/timeseries-groups.ts b/src/resources/radar/dns/timeseries-groups.ts index 9a242a93fb..5e1ea8a4e1 100644 --- a/src/resources/radar/dns/timeseries-groups.ts +++ b/src/resources/radar/dns/timeseries-groups.ts @@ -8,11 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by cache status over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.cacheHit(); - * ``` + * @deprecated */ cacheHit( query?: TimeseriesGroupCacheHitParams, @@ -37,11 +33,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.dnssec(); - * ``` + * @deprecated */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.dnssecAware(); - * ``` + * @deprecated */ dnssecAware( query?: TimeseriesGroupDNSSECAwareParams, @@ -96,11 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.dnssecE2E(); - * ``` + * @deprecated */ dnssecE2E( query?: TimeseriesGroupDNSSECE2EParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -152,11 +132,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.matchingAnswer(); - * ``` + * @deprecated */ matchingAnswer( query?: TimeseriesGroupMatchingAnswerParams, @@ -181,11 +157,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.protocol(); - * ``` + * @deprecated */ protocol( query?: TimeseriesGroupProtocolParams, @@ -209,11 +181,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by type over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.queryType(); - * ``` + * @deprecated */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -237,11 +205,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by response code over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.responseCode(); - * ``` + * @deprecated */ responseCode( query?: TimeseriesGroupResponseCodeParams, @@ -266,11 +230,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by minimum answer TTL over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.responseTTL(); - * ``` + * @deprecated */ responseTTL( query?: TimeseriesGroupResponseTTLParams, diff --git a/src/resources/radar/email/routing/summary.ts b/src/resources/radar/email/routing/summary.ts index 4085dc05e9..00defd2b84 100644 --- a/src/resources/radar/email/routing/summary.ts +++ b/src/resources/radar/email/routing/summary.ts @@ -10,11 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.arc(); - * ``` + * @deprecated */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -36,11 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.dkim(); - * ``` + * @deprecated */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -62,11 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.dmarc(); - * ``` + * @deprecated */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -88,11 +76,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted). * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.encrypted(); - * ``` + * @deprecated */ encrypted( query?: SummaryEncryptedParams, @@ -116,11 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by IP version. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -145,11 +125,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.spf(); - * ``` + * @deprecated */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/email/routing/timeseries-groups.ts b/src/resources/radar/email/routing/timeseries-groups.ts index c398945534..3a9801b143 100644 --- a/src/resources/radar/email/routing/timeseries-groups.ts +++ b/src/resources/radar/email/routing/timeseries-groups.ts @@ -10,11 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.arc(); - * ``` + * @deprecated */ arc( query?: TimeseriesGroupARCParams, @@ -40,11 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.dkim(); - * ``` + * @deprecated */ dkim( query?: TimeseriesGroupDKIMParams, @@ -70,11 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.dmarc(); - * ``` + * @deprecated */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -100,11 +88,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted) over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.encrypted(); - * ``` + * @deprecated */ encrypted( query?: TimeseriesGroupEncryptedParams, @@ -129,11 +113,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -159,11 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.spf(); - * ``` + * @deprecated */ spf( query?: TimeseriesGroupSPFParams, diff --git a/src/resources/radar/email/security/summary.ts b/src/resources/radar/email/security/summary.ts index 3a984c2f4f..5136a742ff 100644 --- a/src/resources/radar/email/security/summary.ts +++ b/src/resources/radar/email/security/summary.ts @@ -10,11 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.arc(); - * ``` + * @deprecated */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -36,11 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.dkim(); - * ``` + * @deprecated */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -62,11 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.dmarc(); - * ``` + * @deprecated */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -87,11 +75,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by malicious classification. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.malicious(); - * ``` + * @deprecated */ malicious( query?: SummaryMaliciousParams, @@ -115,11 +99,7 @@ export class Summary extends APIResource { /** * Retrieves the proportion of emails by spam classification (spam vs. non-spam). * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.spam(); - * ``` + * @deprecated */ spam(query?: SummarySpamParams, options?: Core.RequestOptions): Core.APIPromise; spam(options?: Core.RequestOptions): Core.APIPromise; @@ -141,11 +121,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.spf(); - * ``` + * @deprecated */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; @@ -167,11 +143,7 @@ export class Summary extends APIResource { * Retrieves the proportion of emails by spoof classification (spoof vs. * non-spoof). * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.spoof(); - * ``` + * @deprecated */ spoof(query?: SummarySpoofParams, options?: Core.RequestOptions): Core.APIPromise; spoof(options?: Core.RequestOptions): Core.APIPromise; @@ -192,11 +164,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by threat categories. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.threatCategory(); - * ``` + * @deprecated */ threatCategory( query?: SummaryThreatCategoryParams, @@ -221,11 +189,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by TLS version. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.tlsVersion(); - * ``` + * @deprecated */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/email/security/timeseries-groups.ts b/src/resources/radar/email/security/timeseries-groups.ts index 2fb9bbef99..aa620088a0 100644 --- a/src/resources/radar/email/security/timeseries-groups.ts +++ b/src/resources/radar/email/security/timeseries-groups.ts @@ -10,11 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.arc(); - * ``` + * @deprecated */ arc( query?: TimeseriesGroupARCParams, @@ -40,11 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.dkim(); - * ``` + * @deprecated */ dkim( query?: TimeseriesGroupDKIMParams, @@ -70,11 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.dmarc(); - * ``` + * @deprecated */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -99,11 +87,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by malicious classification over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.malicious(); - * ``` + * @deprecated */ malicious( query?: TimeseriesGroupMaliciousParams, @@ -129,11 +113,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spam classification (spam vs. non-spam) * over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.spam(); - * ``` + * @deprecated */ spam( query?: TimeseriesGroupSpamParams, @@ -159,11 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.spf(); - * ``` + * @deprecated */ spf( query?: TimeseriesGroupSPFParams, @@ -189,11 +165,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spoof classification (spoof vs. * non-spoof) over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.spoof(); - * ``` + * @deprecated */ spoof( query?: TimeseriesGroupSpoofParams, @@ -218,11 +190,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by threat category over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.threatCategory(); - * ``` + * @deprecated */ threatCategory( query?: TimeseriesGroupThreatCategoryParams, @@ -247,11 +215,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by TLS version over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.tlsVersion(); - * ``` + * @deprecated */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/entities/asns.ts b/src/resources/radar/entities/asns.ts index 66ecf4a6e9..7697e9dd84 100644 --- a/src/resources/radar/entities/asns.ts +++ b/src/resources/radar/entities/asns.ts @@ -194,10 +194,20 @@ export namespace ASNAsSetResponse { */ name: string; + /** + * The AS number following hierarchical AS-SET name + */ + hierarchical_asn?: number; + /** * The inferred AS number of the AS-SET */ - asn?: number; + inferred_asn?: number; + + /** + * The AS number matching PeeringDB record + */ + peeringdb_asn?: number; } } diff --git a/src/resources/radar/netflows/netflows.ts b/src/resources/radar/netflows/netflows.ts index c484510bb6..55c05d441b 100644 --- a/src/resources/radar/netflows/netflows.ts +++ b/src/resources/radar/netflows/netflows.ts @@ -13,7 +13,7 @@ export class Netflows extends APIResource { * Retrieves the distribution of network traffic (NetFlows) by HTTP vs other * protocols. * - * @deprecated + * @deprecated Use [Get Network Traffic Distribution By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/netflows/methods/summary_v2/) instead. */ summary( query?: NetflowSummaryParams, diff --git a/src/resources/stream/downloads.ts b/src/resources/stream/downloads.ts index a9d2589f13..1fd7a50c02 100644 --- a/src/resources/stream/downloads.ts +++ b/src/resources/stream/downloads.ts @@ -6,7 +6,8 @@ import * as Core from '../../core'; export class Downloads extends APIResource { /** * Creates a download for a video when a video is ready to view. Use - * `/downloads/{download_type}` instead for type-specific downloads. + * `/downloads/{download_type}` instead for type-specific downloads. Available + * types are `default` and `audio`. * * @example * ```ts @@ -35,7 +36,7 @@ export class Downloads extends APIResource { /** * Delete the downloads for a video. Use `/downloads/{download_type}` instead for - * type-specific downloads. + * type-specific downloads. Available types are `default` and `audio`. * * @example * ```ts diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts index 8b15a53e2d..4af2451c88 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts @@ -168,7 +168,7 @@ export namespace BindingGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; 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 9170366dbd..78e5e95423 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -616,7 +616,7 @@ export namespace ScriptUpdateParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; 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 fea3a53ffc..216456a041 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -247,7 +247,7 @@ export namespace SettingEditResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -999,7 +999,7 @@ export namespace SettingGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1769,7 +1769,7 @@ export namespace SettingEditParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; diff --git a/src/resources/workers/beta/workers/versions.ts b/src/resources/workers/beta/workers/versions.ts index 300510fc56..185cea7033 100644 --- a/src/resources/workers/beta/workers/versions.ts +++ b/src/resources/workers/beta/workers/versions.ts @@ -409,7 +409,7 @@ export namespace Version { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1263,7 +1263,7 @@ export namespace VersionCreateParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; diff --git a/src/resources/workers/beta/workers/workers.ts b/src/resources/workers/beta/workers/workers.ts index ba7791704e..d4e49b0055 100644 --- a/src/resources/workers/beta/workers/workers.ts +++ b/src/resources/workers/beta/workers/workers.ts @@ -193,6 +193,11 @@ export interface Worker { */ observability: Worker.Observability; + /** + * Other resources that reference the Worker and depend on it existing. + */ + references: Worker.References; + /** * Subdomain settings for the Worker. */ @@ -259,6 +264,139 @@ export namespace Worker { } } + /** + * Other resources that reference the Worker and depend on it existing. + */ + export interface References { + /** + * Other Workers that reference the Worker as an outbound for a dispatch namespace. + */ + dispatch_namespace_outbounds: Array; + + /** + * Custom domains connected to the Worker. + */ + domains: Array; + + /** + * Other Workers that reference Durable Object classes implemented by the Worker. + */ + durable_objects: Array; + + /** + * Queues that send messages to the Worker. + */ + queues: Array; + + /** + * Other Workers that reference the Worker using + * [service bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/). + */ + workers: Array; + } + + export namespace References { + export interface DispatchNamespaceOutbound { + /** + * ID of the dispatch namespace. + */ + namespace_id: string; + + /** + * Name of the dispatch namespace. + */ + namespace_name: string; + + /** + * ID of the Worker using the dispatch namespace. + */ + worker_id: string; + + /** + * Name of the Worker using the dispatch namespace. + */ + worker_name: string; + } + + export interface Domain { + /** + * ID of the custom domain. + */ + id: string; + + /** + * ID of the TLS certificate issued for the custom domain. + */ + certificate_id: string; + + /** + * Full hostname of the custom domain, including the zone name. + */ + hostname: string; + + /** + * ID of the zone. + */ + zone_id: string; + + /** + * Name of the zone. + */ + zone_name: string; + } + + export interface DurableObject { + /** + * ID of the Durable Object namespace being used. + */ + namespace_id: string; + + /** + * Name of the Durable Object namespace being used. + */ + namespace_name: string; + + /** + * ID of the Worker using the Durable Object implementation. + */ + worker_id: string; + + /** + * Name of the Worker using the Durable Object implementation. + */ + worker_name: string; + } + + export interface Queue { + /** + * ID of the queue consumer configuration. + */ + queue_consumer_id: string; + + /** + * ID of the queue. + */ + queue_id: string; + + /** + * Name of the queue. + */ + queue_name: string; + } + + export interface Worker { + /** + * ID of the referencing Worker. + */ + id: string; + + /** + * Name of the referencing Worker. + */ + name: string; + } + } + /** * Subdomain settings for the Worker. */ diff --git a/src/resources/workers/scripts/script-and-version-settings.ts b/src/resources/workers/scripts/script-and-version-settings.ts index 05bc7152a0..d6ef7552ca 100644 --- a/src/resources/workers/scripts/script-and-version-settings.ts +++ b/src/resources/workers/scripts/script-and-version-settings.ts @@ -243,7 +243,7 @@ export namespace ScriptAndVersionSettingEditResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -995,7 +995,7 @@ export namespace ScriptAndVersionSettingGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1765,7 +1765,7 @@ export namespace ScriptAndVersionSettingEditParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index d96bb354dc..70546d5580 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -925,7 +925,7 @@ export namespace ScriptUpdateParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; diff --git a/src/resources/workers/scripts/versions.ts b/src/resources/workers/scripts/versions.ts index d4334609ad..c9027b6f0c 100644 --- a/src/resources/workers/scripts/versions.ts +++ b/src/resources/workers/scripts/versions.ts @@ -245,7 +245,7 @@ export namespace VersionCreateResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -981,7 +981,7 @@ export namespace VersionGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1634,6 +1634,11 @@ export namespace VersionCreateParams { export namespace Metadata { export interface Annotations { + /** + * Associated alias for a version. + */ + 'workers/alias'?: string; + /** * Human-readable message about the version. Truncated to 100 bytes. */ @@ -1740,7 +1745,7 @@ export namespace VersionCreateParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; diff --git a/src/resources/zones/settings.ts b/src/resources/zones/settings.ts index 0838680bb9..4a3ad6c613 100644 --- a/src/resources/zones/settings.ts +++ b/src/resources/zones/settings.ts @@ -301,13 +301,8 @@ export interface BrowserCacheTTL { id?: 'browser_cache_ttl'; /** - * The number of seconds to cache resources for. Minimum values by plan: - * - * - Free: 7200 seconds (2 hours) - * - Pro: 3600 seconds (1 hour) - * - Business: 1 second - * - Enterprise: 1 second Setting this to 0 enables "Respect Existing Headers" and - * is allowed for all plans. + * The number of seconds to cache resources for. Setting this to 0 enables "Respect + * Existing Headers". */ value?: number; } @@ -319,13 +314,8 @@ export interface BrowserCacheTTLParam { id?: 'browser_cache_ttl'; /** - * The number of seconds to cache resources for. Minimum values by plan: - * - * - Free: 7200 seconds (2 hours) - * - Pro: 3600 seconds (1 hour) - * - Business: 1 second - * - Enterprise: 1 second Setting this to 0 enables "Respect Existing Headers" and - * is allowed for all plans. + * The number of seconds to cache resources for. Setting this to 0 enables "Respect + * Existing Headers". */ value?: number; } @@ -1102,6 +1092,10 @@ export interface PseudoIPV4 { modified_on?: string | null; } +/** + * @deprecated This page rule is deprecated. This functionality is no longer + * supported. + */ export interface ResponseBuffering { /** * Turn on or off whether Cloudflare should wait for an entire file from the origin @@ -1116,6 +1110,10 @@ export interface ResponseBuffering { value?: 'on' | 'off'; } +/** + * @deprecated This page rule is deprecated. This functionality is no longer + * supported. + */ export interface ResponseBufferingParam { /** * Turn on or off whether Cloudflare should wait for an entire file from the origin @@ -2215,10 +2213,8 @@ export namespace SettingEditResponse { } /** - * Enables or disables buffering of responses from the proxied server. Cloudflare - * may buffer the whole payload to deliver it at once to the client versus allowing - * it to be delivered in chunks. By default, the proxied server streams directly - * and is not buffered by Cloudflare. This is limited to Enterprise Zones. + * @deprecated This zone setting is deprecated. This functionality is no longer + * supported. */ export interface ZonesSchemasResponseBuffering { /** @@ -3258,10 +3254,8 @@ export namespace SettingGetResponse { } /** - * Enables or disables buffering of responses from the proxied server. Cloudflare - * may buffer the whole payload to deliver it at once to the client versus allowing - * it to be delivered in chunks. By default, the proxied server streams directly - * and is not buffered by Cloudflare. This is limited to Enterprise Zones. + * @deprecated This zone setting is deprecated. This functionality is no longer + * supported. */ export interface ZonesSchemasResponseBuffering { /** diff --git a/tests/api-resources/alerting/destinations/webhooks.test.ts b/tests/api-resources/alerting/destinations/webhooks.test.ts index 400214bb31..f7e64ac407 100644 --- a/tests/api-resources/alerting/destinations/webhooks.test.ts +++ b/tests/api-resources/alerting/destinations/webhooks.test.ts @@ -38,14 +38,11 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('update: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.update( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'Slack Webhook', - url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', - }, - ); + const responsePromise = client.alerting.destinations.webhooks.update('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'Slack Webhook', + url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -57,15 +54,12 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('update: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.update( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'Slack Webhook', - url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', - secret: 'secret', - }, - ); + const response = await client.alerting.destinations.webhooks.update('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'Slack Webhook', + url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + secret: 'secret', + }); }); test('list: only required params', async () => { @@ -88,10 +82,9 @@ describe('resource webhooks', () => { }); test('delete: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.delete( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); + const responsePromise = client.alerting.destinations.webhooks.delete('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -102,18 +95,16 @@ describe('resource webhooks', () => { }); test('delete: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.delete( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); + const response = await client.alerting.destinations.webhooks.delete('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('get: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.get( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); + const responsePromise = client.alerting.destinations.webhooks.get('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -125,7 +116,7 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('get: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.get('b115d5ec-15c6-41ee-8b76-92c449b5227b', { + const response = await client.alerting.destinations.webhooks.get('b115d5ec15c641ee8b7692c449b5227b', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/alerting/policies.test.ts b/tests/api-resources/alerting/policies.test.ts index aed5640624..3de56f13b7 100644 --- a/tests/api-resources/alerting/policies.test.ts +++ b/tests/api-resources/alerting/policies.test.ts @@ -35,9 +35,9 @@ describe('resource policies', () => { alert_type: 'universal_ssl_event_type', enabled: true, mechanisms: { - email: [{ id: 'test@example.com' }], - pagerduty: [{ id: 'e8133a15-00a4-4d69-aec1-32f70c51f6e5' }], - webhooks: [{ id: '14cc1190-5d2b-4b98-a696-c424cb2ad05f' }], + email: [{ id: 'id' }], + pagerduty: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], + webhooks: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], }, name: 'SSL Notification Event Policy', alert_interval: '30m', @@ -91,7 +91,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('update: only required params', async () => { - const responsePromise = client.alerting.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', { + const responsePromise = client.alerting.policies.update('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -105,7 +105,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('update: required and optional params', async () => { - const response = await client.alerting.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', { + const response = await client.alerting.policies.update('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', alert_interval: '30m', alert_type: 'universal_ssl_event_type', @@ -156,9 +156,9 @@ describe('resource policies', () => { zones: ['string'], }, mechanisms: { - email: [{ id: 'test@example.com' }], - pagerduty: [{ id: 'e8133a15-00a4-4d69-aec1-32f70c51f6e5' }], - webhooks: [{ id: '14cc1190-5d2b-4b98-a696-c424cb2ad05f' }], + email: [{ id: 'id' }], + pagerduty: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], + webhooks: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], }, name: 'SSL Notification Event Policy', }); @@ -180,7 +180,7 @@ describe('resource policies', () => { }); test('delete: only required params', async () => { - const responsePromise = client.alerting.policies.delete('0da2b59e-f118-439d-8097-bdfb215203c9', { + const responsePromise = client.alerting.policies.delete('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -193,14 +193,14 @@ describe('resource policies', () => { }); test('delete: required and optional params', async () => { - const response = await client.alerting.policies.delete('0da2b59e-f118-439d-8097-bdfb215203c9', { + const response = await client.alerting.policies.delete('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('get: only required params', async () => { - const responsePromise = client.alerting.policies.get('0da2b59e-f118-439d-8097-bdfb215203c9', { + const responsePromise = client.alerting.policies.get('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -214,7 +214,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('get: required and optional params', async () => { - const response = await client.alerting.policies.get('0da2b59e-f118-439d-8097-bdfb215203c9', { + const response = await client.alerting.policies.get('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/pages/projects/projects.test.ts b/tests/api-resources/pages/projects/projects.test.ts index 2057a0124d..41a92b2403 100644 --- a/tests/api-resources/pages/projects/projects.test.ts +++ b/tests/api-resources/pages/projects/projects.test.ts @@ -115,7 +115,11 @@ describe('resource projects', () => { }); test('list: required and optional params', async () => { - const response = await client.pages.projects.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const response = await client.pages.projects.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + page: 1, + per_page: 10, + }); }); test('delete: only required params', async () => { diff --git a/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts b/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts index c3238ed19b..597bcca970 100644 --- a/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts +++ b/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts @@ -11,7 +11,12 @@ const client = new Cloudflare({ describe('resource connectivityPrecheck', () => { test('source: only required params', async () => { - const responsePromise = client.r2.superSlurper.connectivityPrecheck.source({ account_id: 'account_id' }); + const responsePromise = client.r2.superSlurper.connectivityPrecheck.source({ + account_id: 'account_id', + bucket: 'bucket', + secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, + vendor: 's3', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,14 +30,21 @@ describe('resource connectivityPrecheck', () => { const response = await client.r2.superSlurper.connectivityPrecheck.source({ account_id: 'account_id', bucket: 'bucket', - endpoint: 'endpoint', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 's3', + endpoint: 'endpoint', + pathPrefix: 'pathPrefix', + region: 'region', }); }); test('target: only required params', async () => { - const responsePromise = client.r2.superSlurper.connectivityPrecheck.target({ account_id: 'account_id' }); + const responsePromise = client.r2.superSlurper.connectivityPrecheck.target({ + account_id: 'account_id', + bucket: 'bucket', + secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, + vendor: 'r2', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -46,9 +58,9 @@ describe('resource connectivityPrecheck', () => { const response = await client.r2.superSlurper.connectivityPrecheck.target({ account_id: 'account_id', bucket: 'bucket', - jurisdiction: 'default', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 'r2', + jurisdiction: 'default', }); }); }); diff --git a/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts b/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts index 8376af108a..e2806bfb82 100644 --- a/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts +++ b/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts @@ -27,15 +27,17 @@ describe('resource jobs', () => { overwrite: true, source: { bucket: 'bucket', - endpoint: 'endpoint', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 's3', + endpoint: 'endpoint', + pathPrefix: 'pathPrefix', + region: 'region', }, target: { bucket: 'bucket', - jurisdiction: 'default', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 'r2', + jurisdiction: 'default', }, }); }); diff --git a/tests/api-resources/workers/scripts/versions.test.ts b/tests/api-resources/workers/scripts/versions.test.ts index 82c89f8328..437f382fd7 100644 --- a/tests/api-resources/workers/scripts/versions.test.ts +++ b/tests/api-resources/workers/scripts/versions.test.ts @@ -31,7 +31,11 @@ describe('resource versions', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', metadata: { main_module: 'worker.js', - annotations: { 'workers/message': 'Fixed worker code.', 'workers/tag': 'workers/tag' }, + annotations: { + 'workers/alias': 'staging', + 'workers/message': 'Fixed worker code.', + 'workers/tag': 'workers/tag', + }, bindings: [{ name: 'MY_ENV_VAR', text: 'my_data', type: 'plain_text' }], compatibility_date: '2021-01-01', compatibility_flags: ['nodejs_compat'], From d70b57dbc9635cca506fa164e0782687b843bb6a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 23:03:18 +0000 Subject: [PATCH 069/451] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 174 +- scripts/detect-breaking-changes | 19 - .../cloudforce-one/threat-events/index.ts | 6 +- .../threat-events/indicator-types.ts | 48 +- .../threat-events/threat-events.ts | 8 +- src/resources/custom-pages.ts | 48 +- .../email-security/investigate/investigate.ts | 46 + 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 | 139 +- src/resources/kv/namespaces/metadata.ts | 4 +- src/resources/kv/namespaces/namespaces.ts | 164 +- src/resources/kv/namespaces/values.ts | 27 +- .../leaked-credential-checks/detections.ts | 240 +-- .../leaked-credential-checks/index.ts | 13 +- .../leaked-credential-checks.ts | 121 +- 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 +- .../pages/projects/deployments/deployments.ts | 66 + src/resources/pages/projects/projects.ts | 547 +++++- src/resources/pipelines.ts | 138 +- src/resources/queues/consumers.ts | 35 - src/resources/queues/index.ts | 19 +- src/resources/queues/messages.ts | 217 +-- src/resources/queues/queues.ts | 40 +- src/resources/queues/subscriptions.ts | 871 +--------- 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 | 416 +---- src/resources/workflows/instances/status.ts | 54 +- src/resources/workflows/versions.ts | 87 +- src/resources/workflows/workflows.ts | 274 +-- src/resources/zero-trust/devices/dex-tests.ts | 80 +- src/resources/zero-trust/dex/colos.ts | 17 +- src/resources/zero-trust/dex/dex.ts | 5 + .../dex/fleet-status/fleet-status.ts | 75 +- .../zero-trust/dex/fleet-status/index.ts | 1 + src/resources/zero-trust/dex/index.ts | 1 + .../threat-events/indicator-types.test.ts | 33 - .../api-resources/kv/namespaces/keys.test.ts | 31 +- .../kv/namespaces/namespaces.test.ts | 33 +- .../kv/namespaces/values.test.ts | 3 +- .../detections.test.ts | 98 -- .../leaked-credential-checks.test.ts | 49 - .../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 - .../projects/deployments/deployments.test.ts | 14 +- .../pages/projects/projects.test.ts | 64 +- tests/api-resources/pipelines.test.ts | 20 +- tests/api-resources/queues/consumers.test.ts | 23 - tests/api-resources/queues/messages.test.ts | 43 - .../queues/subscriptions.test.ts | 101 -- .../workers/observability/telemetry.test.ts | 110 -- .../workflows/instances/events.test.ts | 32 - .../workflows/instances/instances.test.ts | 89 - .../workflows/instances/status.test.ts | 33 - .../api-resources/workflows/versions.test.ts | 50 - .../api-resources/workflows/workflows.test.ts | 85 - .../zero-trust/devices/dex-tests.test.ts | 8 +- 78 files changed, 1094 insertions(+), 6201 deletions(-) delete mode 100644 tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts delete mode 100644 tests/api-resources/leaked-credential-checks/detections.test.ts delete mode 100644 tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts 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/queues/subscriptions.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 0a983f097f..76df3072dc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7492bc33f84221ee63fe654c22680333788bfd2dfe8985c58f9d3db555ffca2b.yml -openapi_spec_hash: b454db8aa8af2160a780a5b69445f3a4 +configured_endpoints: 1784 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dc74d0ad57a48a9c661dba02d85a87e2a3d49a5e28dfadfe220d121dc8f923a3.yml +openapi_spec_hash: 74feca1304da3345536352544a3d4def config_hash: 107e0f1f8a98b007260b319226b88b3c diff --git a/api.md b/api.md index 866462c86c..4df6e7455e 100644 --- a/api.md +++ b/api.md @@ -1715,61 +1715,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: @@ -2259,18 +2214,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 @@ -2278,19 +2221,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 @@ -2300,14 +2242,12 @@ Types: - Key - KeyBulkDeleteResponse -- KeyBulkGetResponse - KeyBulkUpdateResponse Methods: - 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 ### Metadata @@ -2376,16 +2316,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 @@ -2411,24 +2347,9 @@ Methods: - 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 ## Subscriptions -Types: - -- SubscriptionCreateResponse -- SubscriptionUpdateResponse -- SubscriptionListResponse -- SubscriptionDeleteResponse - -Methods: - -- client.queues.subscriptions.create({ ...params }) -> SubscriptionCreateResponse -- client.queues.subscriptions.update(subscriptionId, { ...params }) -> SubscriptionUpdateResponse -- client.queues.subscriptions.list({ ...params }) -> SubscriptionListResponsesV4PagePaginationArray -- client.queues.subscriptions.delete(subscriptionId, { ...params }) -> SubscriptionDeleteResponse - # APIGateway ## Configurations @@ -5482,11 +5403,12 @@ Types: - LiveStat - FleetStatusLiveResponse +- FleetStatusOverTimeResponse Methods: - client.zeroTrust.dex.fleetStatus.live({ ...params }) -> FleetStatusLiveResponse -- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> void +- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> FleetStatusOverTimeResponse #### Devices @@ -8083,14 +8005,6 @@ Methods: ### IndicatorTypes -Types: - -- IndicatorTypeListResponse - -Methods: - -- client.cloudforceOne.threatEvents.indicatorTypes.list({ ...params }) -> IndicatorTypeListResponse - ### Raw Types: @@ -8363,68 +8277,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: @@ -8479,32 +8339,8 @@ Methods: # LeakedCredentialChecks -Types: - -- LeakedCredentialCheckCreateResponse -- LeakedCredentialCheckGetResponse - -Methods: - -- client.leakedCredentialChecks.create({ ...params }) -> LeakedCredentialCheckCreateResponse -- client.leakedCredentialChecks.get({ ...params }) -> LeakedCredentialCheckGetResponse - ## Detections -Types: - -- DetectionCreateResponse -- DetectionUpdateResponse -- DetectionListResponse -- DetectionDeleteResponse - -Methods: - -- client.leakedCredentialChecks.detections.create({ ...params }) -> DetectionCreateResponse -- client.leakedCredentialChecks.detections.update(detectionId, { ...params }) -> DetectionUpdateResponse -- client.leakedCredentialChecks.detections.list({ ...params }) -> DetectionListResponsesSinglePage -- client.leakedCredentialChecks.detections.delete(detectionId, { ...params }) -> DetectionDeleteResponse - # ContentScanning Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 4580a22d2d..8c8c3ce4bf 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -143,14 +143,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 @@ -191,8 +183,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 @@ -205,7 +195,6 @@ TEST_PATHS=( tests/api-resources/queues/messages.test.ts tests/api-resources/queues/purge.test.ts tests/api-resources/queues/consumers.test.ts - tests/api-resources/queues/subscriptions.test.ts tests/api-resources/api-gateway/api-gateway.test.ts tests/api-resources/api-gateway/configurations.test.ts tests/api-resources/api-gateway/discovery/discovery.test.ts @@ -684,7 +673,6 @@ TEST_PATHS=( tests/api-resources/cloudforce-one/threat-events/categories.test.ts tests/api-resources/cloudforce-one/threat-events/countries.test.ts tests/api-resources/cloudforce-one/threat-events/datasets/datasets.test.ts - tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts tests/api-resources/cloudforce-one/threat-events/raw.test.ts tests/api-resources/cloudforce-one/threat-events/relate.test.ts tests/api-resources/cloudforce-one/threat-events/tags.test.ts @@ -708,16 +696,9 @@ 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 - tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts - tests/api-resources/leaked-credential-checks/detections.test.ts tests/api-resources/content-scanning/content-scanning.test.ts tests/api-resources/content-scanning/payloads.test.ts tests/api-resources/content-scanning/settings.test.ts diff --git a/src/resources/cloudforce-one/threat-events/index.ts b/src/resources/cloudforce-one/threat-events/index.ts index 02c8bab160..d797682ddd 100644 --- a/src/resources/cloudforce-one/threat-events/index.ts +++ b/src/resources/cloudforce-one/threat-events/index.ts @@ -36,11 +36,7 @@ export { type EventTagCreateParams, type EventTagDeleteParams, } from './event-tags'; -export { - IndicatorTypes, - type IndicatorTypeListResponse, - type IndicatorTypeListParams, -} from './indicator-types'; +export { IndicatorTypes } from './indicator-types'; export { Insights } from './insights'; export { Raw, type RawEditResponse, type RawGetResponse, type RawEditParams, type RawGetParams } from './raw'; export { Relate, type RelateDeleteResponse, type RelateDeleteParams } from './relate'; diff --git a/src/resources/cloudforce-one/threat-events/indicator-types.ts b/src/resources/cloudforce-one/threat-events/indicator-types.ts index 7fa1b77a16..99e5ccc453 100644 --- a/src/resources/cloudforce-one/threat-events/indicator-types.ts +++ b/src/resources/cloudforce-one/threat-events/indicator-types.ts @@ -1,51 +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 IndicatorTypes extends APIResource { - /** - * Lists all indicator types - * - * @example - * ```ts - * const indicatorTypes = - * await client.cloudforceOne.threatEvents.indicatorTypes.list( - * { account_id: 'account_id' }, - * ); - * ``` - */ - list( - params: IndicatorTypeListParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return this._client.get(`/accounts/${account_id}/cloudforce-one/events/indicatorTypes`, options); - } -} - -export interface IndicatorTypeListResponse { - items: IndicatorTypeListResponse.Items; - - type: string; -} - -export namespace IndicatorTypeListResponse { - export interface Items { - type: string; - } -} - -export interface IndicatorTypeListParams { - /** - * Account ID. - */ - account_id: string; -} - -export declare namespace IndicatorTypes { - export { - type IndicatorTypeListResponse as IndicatorTypeListResponse, - type IndicatorTypeListParams as IndicatorTypeListParams, - }; -} +export class IndicatorTypes 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 119f0b95d8..d23c37b5db 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -31,7 +31,7 @@ import { EventTags, } from './event-tags'; import * as IndicatorTypesAPI from './indicator-types'; -import { IndicatorTypeListParams, IndicatorTypeListResponse, IndicatorTypes } from './indicator-types'; +import { IndicatorTypes } from './indicator-types'; import * as InsightsAPI from './insights'; import { Insights } from './insights'; import * as RawAPI from './raw'; @@ -821,11 +821,7 @@ export declare namespace ThreatEvents { type DatasetRawParams as DatasetRawParams, }; - export { - IndicatorTypes as IndicatorTypes, - type IndicatorTypeListResponse as IndicatorTypeListResponse, - type IndicatorTypeListParams as IndicatorTypeListParams, - }; + export { IndicatorTypes as IndicatorTypes }; export { RawAPIRaw as Raw, diff --git a/src/resources/custom-pages.ts b/src/resources/custom-pages.ts index 6bd1b13cf7..4c861b1e41 100644 --- a/src/resources/custom-pages.ts +++ b/src/resources/custom-pages.ts @@ -24,13 +24,15 @@ export class CustomPages extends APIResource { */ update( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params: CustomPageUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { @@ -123,36 +125,42 @@ export class CustomPages extends APIResource { */ get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params?: CustomPageGetParams, options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params: CustomPageGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { diff --git a/src/resources/email-security/investigate/investigate.ts b/src/resources/email-security/investigate/investigate.ts index a15d9630ba..7093627a0f 100644 --- a/src/resources/email-security/investigate/investigate.ts +++ b/src/resources/email-security/investigate/investigate.ts @@ -199,10 +199,33 @@ export namespace InvestigateListResponse { } export interface Finding { + attachment?: string | null; + detail?: string | null; + detection?: + | 'MALICIOUS' + | 'MALICIOUS-BEC' + | 'SUSPICIOUS' + | 'SPOOF' + | 'SPAM' + | 'BULK' + | 'ENCRYPTED' + | 'EXTERNAL' + | 'UNKNOWN' + | 'NONE' + | null; + + field?: string | null; + name?: string | null; + portion?: string | null; + + reason?: string | null; + + score?: number | null; + value?: string | null; } @@ -321,10 +344,33 @@ export namespace InvestigateGetResponse { } export interface Finding { + attachment?: string | null; + detail?: string | null; + detection?: + | 'MALICIOUS' + | 'MALICIOUS-BEC' + | 'SUSPICIOUS' + | 'SPOOF' + | 'SPAM' + | 'BULK' + | 'ENCRYPTED' + | 'EXTERNAL' + | 'UNKNOWN' + | 'NONE' + | null; + + field?: string | null; + name?: string | null; + portion?: string | null; + + reason?: string | null; + + score?: number | null; + value?: string | null; } 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 c581632a76..f8b3034d84 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 138942ad57..a4db89243d 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. @@ -120,12 +99,12 @@ export interface Key { /** * Arbitrary JSON that is associated with a key. */ - metadata?: unknown; + metadata?: { [key: string]: unknown }; } export interface KeyBulkDeleteResponse { /** - * Number of keys successfully updated. + * Number of keys successfully updated */ successful_key_count?: number; @@ -135,49 +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 { - /** - * The metadata associated with the key. - */ - metadata: unknown; - - /** - * The value associated with the key. - */ - 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; @@ -189,27 +128,26 @@ export interface KeyBulkUpdateResponse { export interface KeyListParams extends CursorPaginationAfterParams { /** - * Path param: Identifier. + * 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. + * Query param: The number of keys to return. 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. + * 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; @@ -219,31 +157,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; @@ -256,38 +172,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 }; /** - * Arbitrary JSON that is associated with a key. + * A UTF-8 encoded string to be stored, up to 25 MiB in length. */ - metadata?: unknown; + value?: string; } } @@ -297,12 +214,10 @@ export declare namespace Keys { export { type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, - type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorPaginationAfter as KeysCursorPaginationAfter, 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 927ba8a17d..5e16f872e9 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -37,11 +37,11 @@ export class Metadata extends APIResource { /** * Arbitrary JSON that is associated with a key. */ -export type MetadataGetResponse = unknown; +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 df179e53bb..3ec43aa7c5 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: [{}], * }, * ); * ``` @@ -272,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; @@ -286,49 +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 { - /** - * The metadata associated with the key. - */ - metadata: unknown; - - /** - * The value associated with the key. - */ - 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; @@ -340,7 +270,7 @@ export interface NamespaceBulkUpdateResponse { export interface NamespaceCreateParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -352,7 +282,7 @@ export interface NamespaceCreateParams { export interface NamespaceUpdateParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -364,7 +294,7 @@ export interface NamespaceUpdateParams { export interface NamespaceListParams extends V4PagePaginationArrayParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -381,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; @@ -398,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; @@ -435,44 +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 }; /** - * Arbitrary JSON that is associated with a key. + * A UTF-8 encoded string to be stored, up to 25 MiB in length. */ - metadata?: unknown; + value?: string; } } export interface NamespaceGetParams { /** - * Identifier. + * Identifier */ account_id: string; } @@ -481,14 +390,14 @@ Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; Namespaces.Keys = Keys; Namespaces.KeysCursorPaginationAfter = KeysCursorPaginationAfter; 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, @@ -496,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, }; @@ -505,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, KeysCursorPaginationAfter as KeysCursorPaginationAfter, type KeyListParams as KeyListParams, type KeyBulkDeleteParams as KeyBulkDeleteParams, - type KeyBulkGetParams as KeyBulkGetParams, type KeyBulkUpdateParams as KeyBulkUpdateParams, }; @@ -521,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 a8de1f25b5..1fa5ff39ed 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,11 +38,12 @@ export class Values extends APIResource { return ( this._client.put( `/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/values/${keyName}`, - Core.multipartFormRequestOptions({ + Core.maybeMultipartFormRequestOptions({ query: { expiration, expiration_ttl }, body, __multipartSyntax: 'json', ...options, + headers: { 'Content-Type': '*/*', ...options?.headers }, }), ) as Core.APIPromise<{ result: ValueUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); @@ -118,42 +120,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: Associates arbitrary JSON data with a key/value pair. - */ - metadata?: unknown; } export interface ValueDeleteParams { /** - * Identifier. + * Identifier */ account_id: string; } export interface ValueGetParams { /** - * Identifier. + * Identifier */ account_id: string; } diff --git a/src/resources/leaked-credential-checks/detections.ts b/src/resources/leaked-credential-checks/detections.ts index ca2e008bd9..2a6de390ad 100644 --- a/src/resources/leaked-credential-checks/detections.ts +++ b/src/resources/leaked-credential-checks/detections.ts @@ -1,243 +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 Detections extends APIResource { - /** - * Create user-defined detection pattern for Leaked Credential Checks. - * - * @example - * ```ts - * const detection = - * await client.leakedCredentialChecks.detections.create({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - create( - params: DetectionCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.post(`/zones/${zone_id}/leaked-credential-checks/detections`, { - body, - ...options, - }) as Core.APIPromise<{ result: DetectionCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Update user-defined detection pattern for Leaked Credential Checks. - * - * @example - * ```ts - * const detection = - * await client.leakedCredentialChecks.detections.update( - * '18a14bafaa8eb1df04ce683ec18c765e', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - update( - detectionId: string, - params: DetectionUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.put(`/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: DetectionUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * List user-defined detection patterns for Leaked Credential Checks. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const detectionListResponse of client.leakedCredentialChecks.detections.list( - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` - */ - list( - params: DetectionListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { zone_id } = params; - return this._client.getAPIList( - `/zones/${zone_id}/leaked-credential-checks/detections`, - DetectionListResponsesSinglePage, - options, - ); - } - - /** - * Remove user-defined detection pattern for Leaked Credential Checks. - * - * @example - * ```ts - * const detection = - * await client.leakedCredentialChecks.detections.delete( - * '18a14bafaa8eb1df04ce683ec18c765e', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - delete( - detectionId: string, - params: DetectionDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id } = params; - return ( - this._client.delete( - `/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, - options, - ) as Core.APIPromise<{ result: DetectionDeleteResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export class DetectionListResponsesSinglePage extends SinglePage {} - -/** - * Defines a custom set of username/password expressions to match Leaked Credential - * Checks on. - */ -export interface DetectionCreateResponse { - /** - * Defines the unique ID for this custom detection. - */ - id?: string; - - /** - * Defines ehe ruleset expression to use in matching the password in a request. - */ - password?: string; - - /** - * Defines the ruleset expression to use in matching the username in a request. - */ - username?: string; -} - -/** - * Defines a custom set of username/password expressions to match Leaked Credential - * Checks on. - */ -export interface DetectionUpdateResponse { - /** - * Defines the unique ID for this custom detection. - */ - id?: string; - - /** - * Defines ehe ruleset expression to use in matching the password in a request. - */ - password?: string; - - /** - * Defines the ruleset expression to use in matching the username in a request. - */ - username?: string; -} - -/** - * Defines a custom set of username/password expressions to match Leaked Credential - * Checks on. - */ -export interface DetectionListResponse { - /** - * Defines the unique ID for this custom detection. - */ - id?: string; - - /** - * Defines ehe ruleset expression to use in matching the password in a request. - */ - password?: string; - - /** - * Defines the ruleset expression to use in matching the username in a request. - */ - username?: string; -} - -export type DetectionDeleteResponse = unknown; - -export interface DetectionCreateParams { - /** - * Path param: Defines an identifier. - */ - zone_id: string; - - /** - * Body param: Defines ehe ruleset expression to use in matching the password in a - * request. - */ - password?: string; - - /** - * Body param: Defines the ruleset expression to use in matching the username in a - * request. - */ - username?: string; -} - -export interface DetectionUpdateParams { - /** - * Path param: Defines an identifier. - */ - zone_id: string; - - /** - * Body param: Defines ehe ruleset expression to use in matching the password in a - * request. - */ - password?: string; - - /** - * Body param: Defines the ruleset expression to use in matching the username in a - * request. - */ - username?: string; -} - -export interface DetectionListParams { - /** - * Defines an identifier. - */ - zone_id: string; -} - -export interface DetectionDeleteParams { - /** - * Defines an identifier. - */ - zone_id: string; -} - -Detections.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; - -export declare namespace Detections { - export { - type DetectionCreateResponse as DetectionCreateResponse, - type DetectionUpdateResponse as DetectionUpdateResponse, - type DetectionListResponse as DetectionListResponse, - type DetectionDeleteResponse as DetectionDeleteResponse, - DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, - type DetectionCreateParams as DetectionCreateParams, - type DetectionUpdateParams as DetectionUpdateParams, - type DetectionListParams as DetectionListParams, - type DetectionDeleteParams as DetectionDeleteParams, - }; -} +export class Detections extends APIResource {} diff --git a/src/resources/leaked-credential-checks/index.ts b/src/resources/leaked-credential-checks/index.ts index 1844848bf2..7e3e1a0dd7 100644 --- a/src/resources/leaked-credential-checks/index.ts +++ b/src/resources/leaked-credential-checks/index.ts @@ -1,15 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { - DetectionListResponsesSinglePage, - Detections, - type DetectionCreateResponse, - type DetectionUpdateResponse, - type DetectionListResponse, - type DetectionDeleteResponse, - type DetectionCreateParams, - type DetectionUpdateParams, - type DetectionListParams, - type DetectionDeleteParams, -} from './detections'; +export { Detections } from './detections'; export { LeakedCredentialChecks } from './leaked-credential-checks'; diff --git a/src/resources/leaked-credential-checks/leaked-credential-checks.ts b/src/resources/leaked-credential-checks/leaked-credential-checks.ts index d8d8de90c1..c89821160c 100644 --- a/src/resources/leaked-credential-checks/leaked-credential-checks.ts +++ b/src/resources/leaked-credential-checks/leaked-credential-checks.ts @@ -1,132 +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 DetectionsAPI from './detections'; -import { - DetectionCreateParams, - DetectionCreateResponse, - DetectionDeleteParams, - DetectionDeleteResponse, - DetectionListParams, - DetectionListResponse, - DetectionListResponsesSinglePage, - DetectionUpdateParams, - DetectionUpdateResponse, - Detections, -} from './detections'; +import { Detections } from './detections'; export class LeakedCredentialChecks extends APIResource { detections: DetectionsAPI.Detections = new DetectionsAPI.Detections(this._client); - - /** - * Updates the current status of Leaked Credential Checks. - * - * @example - * ```ts - * const leakedCredentialCheck = - * await client.leakedCredentialChecks.create({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - create( - params: LeakedCredentialCheckCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.post(`/zones/${zone_id}/leaked-credential-checks`, { - body, - ...options, - }) as Core.APIPromise<{ result: LeakedCredentialCheckCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the current status of Leaked Credential Checks. - * - * @example - * ```ts - * const leakedCredentialCheck = - * await client.leakedCredentialChecks.get({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - get( - params: LeakedCredentialCheckGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id } = params; - return ( - this._client.get(`/zones/${zone_id}/leaked-credential-checks`, options) as Core.APIPromise<{ - result: LeakedCredentialCheckGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -/** - * Defines the overall status for Leaked Credential Checks. - */ -export interface LeakedCredentialCheckCreateResponse { - /** - * Determines whether or not Leaked Credential Checks are enabled. - */ - enabled?: boolean; -} - -/** - * Defines the overall status for Leaked Credential Checks. - */ -export interface LeakedCredentialCheckGetResponse { - /** - * Determines whether or not Leaked Credential Checks are enabled. - */ - enabled?: boolean; -} - -export interface LeakedCredentialCheckCreateParams { - /** - * Path param: Defines an identifier. - */ - zone_id: string; - - /** - * Body param: Determines whether or not Leaked Credential Checks are enabled. - */ - enabled?: boolean; -} - -export interface LeakedCredentialCheckGetParams { - /** - * Defines an identifier. - */ - zone_id: string; } LeakedCredentialChecks.Detections = Detections; -LeakedCredentialChecks.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; export declare namespace LeakedCredentialChecks { - export { - type LeakedCredentialCheckCreateResponse as LeakedCredentialCheckCreateResponse, - type LeakedCredentialCheckGetResponse as LeakedCredentialCheckGetResponse, - type LeakedCredentialCheckCreateParams as LeakedCredentialCheckCreateParams, - type LeakedCredentialCheckGetParams as LeakedCredentialCheckGetParams, - }; - - export { - Detections as Detections, - type DetectionCreateResponse as DetectionCreateResponse, - type DetectionUpdateResponse as DetectionUpdateResponse, - type DetectionListResponse as DetectionListResponse, - type DetectionDeleteResponse as DetectionDeleteResponse, - DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, - type DetectionCreateParams as DetectionCreateParams, - type DetectionUpdateParams as DetectionUpdateParams, - type DetectionListParams as DetectionListParams, - type DetectionDeleteParams as DetectionDeleteParams, - }; + export { Detections as Detections }; } 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 6e40d6cfa9..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 5e289166d6..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 6f0ab3dbaa..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/pages/projects/deployments/deployments.ts b/src/resources/pages/projects/deployments/deployments.ts index 97b2b41db9..e1a307e7bf 100644 --- a/src/resources/pages/projects/deployments/deployments.ts +++ b/src/resources/pages/projects/deployments/deployments.ts @@ -192,11 +192,77 @@ export interface DeploymentCreateParams { */ account_id: string; + /** + * Body param: Headers configuration file for the deployment. + */ + _headers?: Core.Uploadable; + + /** + * Body param: Redirects configuration file for the deployment. + */ + _redirects?: Core.Uploadable; + + /** + * Body param: Routes configuration file defining routing rules. + */ + '_routes.json'?: Core.Uploadable; + + /** + * Body param: Worker bundle file in multipart/form-data format. Mutually exclusive + * with `_worker.js`. Cannot specify both `_worker.js` and `_worker.bundle` in the + * same request. Maximum size: 25 MiB. + */ + '_worker.bundle'?: Core.Uploadable; + + /** + * Body param: Worker JavaScript file. Mutually exclusive with `_worker.bundle`. + * Cannot specify both `_worker.js` and `_worker.bundle` in the same request. + */ + '_worker.js'?: Core.Uploadable; + /** * Body param: The branch to build the new deployment from. The `HEAD` of the * branch will be used. If omitted, the production branch will be used by default. */ branch?: string; + + /** + * Body param: Boolean string indicating if the working directory has uncommitted + * changes. + */ + commit_dirty?: 'true' | 'false'; + + /** + * Body param: Git commit SHA associated with this deployment. + */ + commit_hash?: string; + + /** + * Body param: Git commit message associated with this deployment. + */ + commit_message?: string; + + /** + * Body param: Functions routing configuration file. + */ + 'functions-filepath-routing-config.json'?: Core.Uploadable; + + /** + * Body param: JSON string containing a manifest of files to deploy. Maps file + * paths to their content hashes. Required for direct upload deployments. Maximum + * 20,000 entries. + */ + manifest?: string; + + /** + * Body param: The build output directory path. + */ + pages_build_output_dir?: string; + + /** + * Body param: Hash of the Wrangler configuration file used for this deployment. + */ + wrangler_config_hash?: string; } export interface DeploymentListParams { diff --git a/src/resources/pages/projects/projects.ts b/src/resources/pages/projects/projects.ts index efac2c7d22..f14c2e99bf 100644 --- a/src/resources/pages/projects/projects.ts +++ b/src/resources/pages/projects/projects.ts @@ -41,6 +41,8 @@ export class Projects extends APIResource { * ```ts * const project = await client.pages.projects.create({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * name: 'my-pages-app', + * production_branch: 'main', * }); * ``` */ @@ -111,7 +113,11 @@ export class Projects extends APIResource { * ```ts * const project = await client.pages.projects.edit( * 'this-is-my-project-01', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * name: 'my-pages-app', + * production_branch: 'main', + * }, * ); * ``` */ @@ -215,7 +221,7 @@ export interface Deployment { */ env_vars?: { [key: string]: Deployment.PagesPlainTextEnvVar | null | Deployment.PagesSecretTextEnvVar | null; - }; + } | null; /** * Type of deploy. @@ -365,31 +371,74 @@ export namespace Deployment { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } @@ -397,17 +446,27 @@ export namespace Deployment { export interface Project { /** - * Id of the project. + * ID of the project. */ - id?: string; + id: string; + + /** + * Name of the project. + */ + name: string; + + /** + * Production branch of the project. Used to identify production deployments. + */ + production_branch: string; /** * Configs for the project build process. */ - build_config?: Project.BuildConfig; + build_config?: Project.BuildConfig | null; /** - * Most recent deployment to the repo. + * Most recent production deployment of the project. */ canonical_deployment?: Deployment | null; @@ -419,7 +478,7 @@ export interface Project { /** * Configs for deployments in a project. */ - deployment_configs?: Project.DeploymentConfigs; + deployment_configs?: Project.DeploymentConfigs | null; /** * A list of associated custom domains for the project. @@ -427,19 +486,29 @@ export interface Project { domains?: Array; /** - * Most recent deployment to the repo. + * Framework the project is using. + */ + framework?: string; + + /** + * Version of the framework the project is using. + */ + framework_version?: string; + + /** + * Most recent deployment of the project. */ latest_deployment?: Deployment | null; /** - * Name of the project. + * Name of the preview script. */ - name?: string; + preview_script_name?: string; /** - * Production branch of the project. Used to identify production deployments. + * Name of the production script. */ - production_branch?: string; + production_script_name?: string; source?: Project.Source; @@ -447,6 +516,11 @@ export interface Project { * The Cloudflare subdomain associated with the project. */ subdomain?: string; + + /** + * Whether the project uses functions. + */ + uses_functions?: boolean; } export namespace Project { @@ -492,12 +566,12 @@ export namespace Project { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview; + preview?: DeploymentConfigs.Preview | null; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production; + production?: DeploymentConfigs.Production | null; } export namespace DeploymentConfigs { @@ -510,6 +584,11 @@ export namespace Project { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -520,6 +599,11 @@ export namespace Project { */ browsers?: { [key: string]: Preview.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -528,7 +612,7 @@ export namespace Project { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -545,7 +629,12 @@ export namespace Project { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -557,6 +646,11 @@ export namespace Project { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Preview.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -582,10 +676,20 @@ export namespace Project { */ services?: { [key: string]: Preview.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Preview { @@ -672,6 +776,16 @@ export namespace Project { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -751,6 +865,11 @@ export namespace Project { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -761,6 +880,11 @@ export namespace Project { */ browsers?: { [key: string]: Production.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -769,7 +893,7 @@ export namespace Project { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -786,7 +910,12 @@ export namespace Project { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -798,6 +927,11 @@ export namespace Project { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Production.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -823,10 +957,20 @@ export namespace Project { */ services?: { [key: string]: Production.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Production { @@ -913,6 +1057,16 @@ export namespace Project { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -987,31 +1141,74 @@ export namespace Project { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } @@ -1053,25 +1250,25 @@ export interface ProjectCreateParams { account_id: string; /** - * Body param: Configs for the project build process. + * Body param: Name of the project. */ - build_config?: ProjectCreateParams.BuildConfig; + name: string; /** - * Body param: Configs for deployments in a project. + * Body param: Production branch of the project. Used to identify production + * deployments. */ - deployment_configs?: ProjectCreateParams.DeploymentConfigs; + production_branch: string; /** - * Body param: Name of the project. + * Body param: Configs for the project build process. */ - name?: string; + build_config?: ProjectCreateParams.BuildConfig | null; /** - * Body param: Production branch of the project. Used to identify production - * deployments. + * Body param: Configs for deployments in a project. */ - production_branch?: string; + deployment_configs?: ProjectCreateParams.DeploymentConfigs | null; /** * Body param: @@ -1122,12 +1319,12 @@ export namespace ProjectCreateParams { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview; + preview?: DeploymentConfigs.Preview | null; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production; + production?: DeploymentConfigs.Production | null; } export namespace DeploymentConfigs { @@ -1140,6 +1337,11 @@ export namespace ProjectCreateParams { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -1150,6 +1352,11 @@ export namespace ProjectCreateParams { */ browsers?: { [key: string]: Preview.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -1158,7 +1365,7 @@ export namespace ProjectCreateParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -1175,7 +1382,12 @@ export namespace ProjectCreateParams { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -1187,6 +1399,11 @@ export namespace ProjectCreateParams { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Preview.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -1212,10 +1429,20 @@ export namespace ProjectCreateParams { */ services?: { [key: string]: Preview.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Preview { @@ -1302,6 +1529,16 @@ export namespace ProjectCreateParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -1381,6 +1618,11 @@ export namespace ProjectCreateParams { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -1391,6 +1633,11 @@ export namespace ProjectCreateParams { */ browsers?: { [key: string]: Production.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -1399,7 +1646,7 @@ export namespace ProjectCreateParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -1416,7 +1663,12 @@ export namespace ProjectCreateParams { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -1428,6 +1680,11 @@ export namespace ProjectCreateParams { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Production.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -1453,10 +1710,20 @@ export namespace ProjectCreateParams { */ services?: { [key: string]: Production.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Production { @@ -1543,6 +1810,16 @@ export namespace ProjectCreateParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -1617,31 +1894,74 @@ export namespace ProjectCreateParams { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } @@ -1668,25 +1988,25 @@ export interface ProjectEditParams { account_id: string; /** - * Body param: Configs for the project build process. + * Body param: Name of the project. */ - build_config?: ProjectEditParams.BuildConfig; + name: string; /** - * Body param: Configs for deployments in a project. + * Body param: Production branch of the project. Used to identify production + * deployments. */ - deployment_configs?: ProjectEditParams.DeploymentConfigs; + production_branch: string; /** - * Body param: Name of the project. + * Body param: Configs for the project build process. */ - name?: string; + build_config?: ProjectEditParams.BuildConfig | null; /** - * Body param: Production branch of the project. Used to identify production - * deployments. + * Body param: Configs for deployments in a project. */ - production_branch?: string; + deployment_configs?: ProjectEditParams.DeploymentConfigs | null; /** * Body param: @@ -1737,12 +2057,12 @@ export namespace ProjectEditParams { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview; + preview?: DeploymentConfigs.Preview | null; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production; + production?: DeploymentConfigs.Production | null; } export namespace DeploymentConfigs { @@ -1755,6 +2075,11 @@ export namespace ProjectEditParams { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -1765,6 +2090,11 @@ export namespace ProjectEditParams { */ browsers?: { [key: string]: Preview.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -1773,7 +2103,7 @@ export namespace ProjectEditParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -1790,7 +2120,12 @@ export namespace ProjectEditParams { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -1802,6 +2137,11 @@ export namespace ProjectEditParams { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Preview.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -1827,10 +2167,20 @@ export namespace ProjectEditParams { */ services?: { [key: string]: Preview.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Preview { @@ -1917,6 +2267,16 @@ export namespace ProjectEditParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -1996,6 +2356,11 @@ export namespace ProjectEditParams { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -2006,6 +2371,11 @@ export namespace ProjectEditParams { */ browsers?: { [key: string]: Production.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -2014,7 +2384,7 @@ export namespace ProjectEditParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -2031,7 +2401,12 @@ export namespace ProjectEditParams { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -2043,6 +2418,11 @@ export namespace ProjectEditParams { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Production.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -2068,10 +2448,20 @@ export namespace ProjectEditParams { */ services?: { [key: string]: Production.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Production { @@ -2158,6 +2548,16 @@ export namespace ProjectEditParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -2232,31 +2632,74 @@ export namespace ProjectEditParams { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } diff --git a/src/resources/pipelines.ts b/src/resources/pipelines.ts index 02e40368e4..cfc4b0add9 100644 --- a/src/resources/pipelines.ts +++ b/src/resources/pipelines.ts @@ -5,29 +5,10 @@ import * as Core from '../core'; export class Pipelines extends APIResource { /** - * Create a new pipeline. + * [DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint + * instead. * - * @example - * ```ts - * const pipeline = await client.pipelines.create({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * destination: { - * batch: {}, - * compression: {}, - * credentials: { - * access_key_id: '', - * endpoint: - * 'https://123f8a8258064ed892a347f173372359.r2.cloudflarestorage.com', - * secret_access_key: '', - * }, - * format: 'json', - * path: { bucket: 'bucket' }, - * type: 'r2', - * }, - * name: 'sample_pipeline', - * source: [{ format: 'json', type: 'type' }], - * }); - * ``` + * @deprecated */ create( params: PipelineCreateParams, @@ -42,26 +23,10 @@ export class Pipelines extends APIResource { } /** - * Update an existing pipeline. + * [DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines + * endpoint instead. * - * @example - * ```ts - * const pipeline = await client.pipelines.update( - * 'sample_pipeline', - * { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * destination: { - * batch: {}, - * compression: {}, - * format: 'json', - * path: { bucket: 'bucket' }, - * type: 'r2', - * }, - * name: 'sample_pipeline', - * source: [{ format: 'json', type: 'type' }], - * }, - * ); - * ``` + * @deprecated */ update( pipelineName: string, @@ -78,14 +43,10 @@ export class Pipelines extends APIResource { } /** - * List, filter, and paginate pipelines in an account. + * [DEPRECATED] List, filter, and paginate pipelines in an account. Use the new + * /pipelines/v1/pipelines endpoint instead. * - * @example - * ```ts - * const pipelines = await client.pipelines.list({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` + * @deprecated */ list(params: PipelineListParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...query } = params; @@ -93,14 +54,10 @@ export class Pipelines extends APIResource { } /** - * Delete a pipeline. + * [DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint + * instead. * - * @example - * ```ts - * await client.pipelines.delete('sample_pipeline', { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` + * @deprecated */ delete( pipelineName: string, @@ -115,15 +72,10 @@ export class Pipelines extends APIResource { } /** - * Get configuration of a pipeline. + * [DEPRECATED] Get configuration of a pipeline. Use the new + * /pipelines/v1/pipelines endpoint instead. * - * @example - * ```ts - * const pipeline = await client.pipelines.get( - * 'sample_pipeline', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` + * @deprecated */ get( pipelineName: string, @@ -140,7 +92,8 @@ export class Pipelines extends APIResource { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface PipelineCreateResponse { /** @@ -238,6 +191,10 @@ export namespace PipelineCreateResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -263,6 +220,10 @@ export namespace PipelineCreateResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -274,7 +235,8 @@ export namespace PipelineCreateResponse { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface PipelineUpdateResponse { /** @@ -372,6 +334,10 @@ export namespace PipelineUpdateResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -397,6 +363,10 @@ export namespace PipelineUpdateResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -442,7 +412,8 @@ export namespace PipelineListResponse { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface Result { /** @@ -540,6 +511,10 @@ export namespace PipelineListResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -565,6 +540,10 @@ export namespace PipelineListResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -577,7 +556,8 @@ export namespace PipelineListResponse { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface PipelineGetResponse { /** @@ -675,6 +655,10 @@ export namespace PipelineGetResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -700,6 +684,10 @@ export namespace PipelineGetResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -821,6 +809,10 @@ export namespace PipelineCreateParams { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -846,6 +838,10 @@ export namespace PipelineCreateParams { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -967,6 +963,10 @@ export namespace PipelineUpdateParams { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -992,6 +992,10 @@ export namespace PipelineUpdateParams { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. diff --git a/src/resources/queues/consumers.ts b/src/resources/queues/consumers.ts index 43eae71410..93596e00ee 100644 --- a/src/resources/queues/consumers.ts +++ b/src/resources/queues/consumers.ts @@ -106,33 +106,6 @@ export class Consumers extends APIResource { const { account_id } = params; return this._client.delete(`/accounts/${account_id}/queues/${queueId}/consumers/${consumerId}`, options); } - - /** - * Fetches the consumer for a queue by consumer id - * - * @example - * ```ts - * const consumer = await client.queues.consumers.get( - * '023e105f4ecef8ad9ca31a8372d0c353', - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - get( - queueId: string, - consumerId: string, - params: ConsumerGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - 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); - } } export class ConsumersSinglePage extends SinglePage {} @@ -491,13 +464,6 @@ export interface ConsumerDeleteParams { account_id: string; } -export interface ConsumerGetParams { - /** - * A Resource identifier. - */ - account_id: string; -} - Consumers.ConsumersSinglePage = ConsumersSinglePage; export declare namespace Consumers { @@ -509,6 +475,5 @@ export declare namespace Consumers { 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 ebf2923861..32568cd469 100644 --- a/src/resources/queues/index.ts +++ b/src/resources/queues/index.ts @@ -9,30 +9,15 @@ export { type ConsumerUpdateParams, type ConsumerListParams, type ConsumerDeleteParams, - 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'; -export { - SubscriptionListResponsesV4PagePaginationArray, - Subscriptions, - type SubscriptionCreateResponse, - type SubscriptionUpdateResponse, - type SubscriptionListResponse, - type SubscriptionDeleteResponse, - type SubscriptionCreateParams, - type SubscriptionUpdateParams, - type SubscriptionListParams, - type SubscriptionDeleteParams, -} from './subscriptions'; +export { Subscriptions } from './subscriptions'; 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 667ab7a44a..15d1651711 100644 --- a/src/resources/queues/queues.ts +++ b/src/resources/queues/queues.ts @@ -9,7 +9,6 @@ import { ConsumerCreateParams, ConsumerDeleteParams, ConsumerDeleteResponse, - ConsumerGetParams, ConsumerListParams, ConsumerUpdateParams, Consumers, @@ -19,29 +18,15 @@ import * as MessagesAPI from './messages'; import { MessageAckParams, MessageAckResponse, - MessageBulkPushParams, - MessageBulkPushResponse, MessagePullParams, MessagePullResponse, - MessagePushParams, - MessagePushResponse, + MessagePullResponsesSinglePage, Messages, } from './messages'; import * as PurgeAPI from './purge'; import { Purge, PurgeStartParams, PurgeStatusParams, PurgeStatusResponse } from './purge'; import * as SubscriptionsAPI from './subscriptions'; -import { - SubscriptionCreateParams, - SubscriptionCreateResponse, - SubscriptionDeleteParams, - SubscriptionDeleteResponse, - SubscriptionListParams, - SubscriptionListResponse, - SubscriptionListResponsesV4PagePaginationArray, - SubscriptionUpdateParams, - SubscriptionUpdateResponse, - Subscriptions, -} from './subscriptions'; +import { Subscriptions } from './subscriptions'; import { SinglePage } from '../../pagination'; export class Queues extends APIResource { @@ -343,11 +328,11 @@ export interface QueueGetParams { Queues.QueuesSinglePage = QueuesSinglePage; Queues.Messages = Messages; +Queues.MessagePullResponsesSinglePage = MessagePullResponsesSinglePage; Queues.Purge = Purge; Queues.Consumers = Consumers; Queues.ConsumersSinglePage = ConsumersSinglePage; Queues.Subscriptions = Subscriptions; -Queues.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; export declare namespace Queues { export { @@ -365,13 +350,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 { @@ -390,19 +372,7 @@ export declare namespace Queues { type ConsumerUpdateParams as ConsumerUpdateParams, type ConsumerListParams as ConsumerListParams, type ConsumerDeleteParams as ConsumerDeleteParams, - type ConsumerGetParams as ConsumerGetParams, }; - export { - Subscriptions as Subscriptions, - type SubscriptionCreateResponse as SubscriptionCreateResponse, - type SubscriptionUpdateResponse as SubscriptionUpdateResponse, - type SubscriptionListResponse as SubscriptionListResponse, - type SubscriptionDeleteResponse as SubscriptionDeleteResponse, - SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, - type SubscriptionCreateParams as SubscriptionCreateParams, - type SubscriptionUpdateParams as SubscriptionUpdateParams, - type SubscriptionListParams as SubscriptionListParams, - type SubscriptionDeleteParams as SubscriptionDeleteParams, - }; + export { Subscriptions as Subscriptions }; } diff --git a/src/resources/queues/subscriptions.ts b/src/resources/queues/subscriptions.ts index 3bb405e3fc..42d6ea9ea6 100644 --- a/src/resources/queues/subscriptions.ts +++ b/src/resources/queues/subscriptions.ts @@ -1,874 +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 Subscriptions extends APIResource { - /** - * Create a new event subscription for a queue - * - * @example - * ```ts - * const subscription = - * await client.queues.subscriptions.create({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - create( - params: SubscriptionCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/event_subscriptions/subscriptions`, { - body, - ...options, - }) as Core.APIPromise<{ result: SubscriptionCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Update an existing event subscription - * - * @example - * ```ts - * const subscription = - * await client.queues.subscriptions.update( - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - update( - subscriptionId: string, - params: SubscriptionUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.patch(`/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: SubscriptionUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Get a paginated list of event subscriptions with optional sorting and filtering - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const subscriptionListResponse of client.queues.subscriptions.list( - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` - */ - list( - params: SubscriptionListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id, ...query } = params; - return this._client.getAPIList( - `/accounts/${account_id}/event_subscriptions/subscriptions`, - SubscriptionListResponsesV4PagePaginationArray, - { query, ...options }, - ); - } - - /** - * Delete an existing event subscription - * - * @example - * ```ts - * const subscription = - * await client.queues.subscriptions.delete( - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - delete( - subscriptionId: string, - params: SubscriptionDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.delete( - `/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, - options, - ) as Core.APIPromise<{ result: SubscriptionDeleteResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export class SubscriptionListResponsesV4PagePaginationArray extends V4PagePaginationArray {} - -export interface SubscriptionCreateResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionCreateResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionCreateResponse.MqEventSourceImages - | SubscriptionCreateResponse.MqEventSourceKV - | SubscriptionCreateResponse.MqEventSourceR2 - | SubscriptionCreateResponse.MqEventSourceSuperSlurper - | SubscriptionCreateResponse.MqEventSourceVectorize - | SubscriptionCreateResponse.MqEventSourceWorkersAIModel - | SubscriptionCreateResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionCreateResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionCreateResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionUpdateResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionUpdateResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionUpdateResponse.MqEventSourceImages - | SubscriptionUpdateResponse.MqEventSourceKV - | SubscriptionUpdateResponse.MqEventSourceR2 - | SubscriptionUpdateResponse.MqEventSourceSuperSlurper - | SubscriptionUpdateResponse.MqEventSourceVectorize - | SubscriptionUpdateResponse.MqEventSourceWorkersAIModel - | SubscriptionUpdateResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionUpdateResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionUpdateResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionListResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionListResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionListResponse.MqEventSourceImages - | SubscriptionListResponse.MqEventSourceKV - | SubscriptionListResponse.MqEventSourceR2 - | SubscriptionListResponse.MqEventSourceSuperSlurper - | SubscriptionListResponse.MqEventSourceVectorize - | SubscriptionListResponse.MqEventSourceWorkersAIModel - | SubscriptionListResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionListResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionListResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionDeleteResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionDeleteResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionDeleteResponse.MqEventSourceImages - | SubscriptionDeleteResponse.MqEventSourceKV - | SubscriptionDeleteResponse.MqEventSourceR2 - | SubscriptionDeleteResponse.MqEventSourceSuperSlurper - | SubscriptionDeleteResponse.MqEventSourceVectorize - | SubscriptionDeleteResponse.MqEventSourceWorkersAIModel - | SubscriptionDeleteResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionDeleteResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionDeleteResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionCreateParams { - /** - * Path param: A Resource identifier. - */ - account_id: string; - - /** - * Body param: Destination configuration for the subscription - */ - destination?: SubscriptionCreateParams.Destination; - - /** - * Body param: Whether the subscription is active - */ - enabled?: boolean; - - /** - * Body param: List of event types this subscription handles - */ - events?: Array; - - /** - * Body param: Name of the subscription - */ - name?: string; - - /** - * Body param: Source configuration for the subscription - */ - source?: - | SubscriptionCreateParams.MqEventSourceImages - | SubscriptionCreateParams.MqEventSourceKV - | SubscriptionCreateParams.MqEventSourceR2 - | SubscriptionCreateParams.MqEventSourceSuperSlurper - | SubscriptionCreateParams.MqEventSourceVectorize - | SubscriptionCreateParams.MqEventSourceWorkersAIModel - | SubscriptionCreateParams.MqEventSourceWorkersBuildsWorker - | SubscriptionCreateParams.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionCreateParams { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionUpdateParams { - /** - * Path param: A Resource identifier. - */ - account_id: string; - - /** - * Body param: Destination configuration for the subscription - */ - destination?: SubscriptionUpdateParams.Destination; - - /** - * Body param: Whether the subscription is active - */ - enabled?: boolean; - - /** - * Body param: List of event types this subscription handles - */ - events?: Array; - - /** - * Body param: Name of the subscription - */ - name?: string; -} - -export namespace SubscriptionUpdateParams { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } -} - -export interface SubscriptionListParams extends V4PagePaginationArrayParams { - /** - * Path param: A Resource identifier. - */ - account_id: string; - - /** - * Query param: Sort direction - */ - direction?: 'asc' | 'desc'; - - /** - * Query param: Field to sort by - */ - order?: 'created_at' | 'name' | 'enabled' | 'source'; -} - -export interface SubscriptionDeleteParams { - /** - * A Resource identifier. - */ - account_id: string; -} - -Subscriptions.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; - -export declare namespace Subscriptions { - export { - type SubscriptionCreateResponse as SubscriptionCreateResponse, - type SubscriptionUpdateResponse as SubscriptionUpdateResponse, - type SubscriptionListResponse as SubscriptionListResponse, - type SubscriptionDeleteResponse as SubscriptionDeleteResponse, - SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, - type SubscriptionCreateParams as SubscriptionCreateParams, - type SubscriptionUpdateParams as SubscriptionUpdateParams, - type SubscriptionListParams as SubscriptionListParams, - type SubscriptionDeleteParams as SubscriptionDeleteParams, - }; -} +export class Subscriptions extends APIResource {} 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 2740494438..8ab49d5567 100644 --- a/src/resources/workflows/instances/instances.ts +++ b/src/resources/workflows/instances/instances.ts @@ -1,429 +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: `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. - */ - date_end?: string; - - /** - * Query param: Accepts ISO 8601 with no timezone offsets and in UTC. - */ - date_start?: string; - - /** - * Query param: should only be used when `cursor` is used, defines a new direction - * for the cursor - */ - direction?: 'asc' | 'desc'; - - /** - * 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/devices/dex-tests.ts b/src/resources/zero-trust/devices/dex-tests.ts index 4446969263..024ac99cae 100644 --- a/src/resources/zero-trust/devices/dex-tests.ts +++ b/src/resources/zero-trust/devices/dex-tests.ts @@ -13,7 +13,10 @@ export class DEXTests extends APIResource { * const dexTest = * await client.zeroTrust.devices.dexTests.create({ * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: {}, + * data: { + * host: 'https://dash.cloudflare.com', + * kind: 'http', + * }, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -40,7 +43,10 @@ export class DEXTests extends APIResource { * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: {}, + * data: { + * host: 'https://dash.cloudflare.com', + * kind: 'http', + * }, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -271,24 +277,24 @@ export namespace DEXTestCreateResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -351,24 +357,24 @@ export namespace DEXTestUpdateResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -431,24 +437,24 @@ export namespace DEXTestListResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -516,24 +522,24 @@ export namespace DEXTestDeleteResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -597,24 +603,24 @@ export namespace DEXTestGetResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -680,24 +686,24 @@ export namespace DEXTestCreateParams { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -763,24 +769,24 @@ export namespace DEXTestUpdateParams { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default 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/zero-trust/dex/dex.ts b/src/resources/zero-trust/dex/dex.ts index f12a3ad01f..a500404035 100644 --- a/src/resources/zero-trust/dex/dex.ts +++ b/src/resources/zero-trust/dex/dex.ts @@ -29,6 +29,7 @@ import { FleetStatusLiveParams, FleetStatusLiveResponse, FleetStatusOverTimeParams, + FleetStatusOverTimeResponse, LiveStat, } from './fleet-status/fleet-status'; import * as HTTPTestsAPI from './http-tests/http-tests'; @@ -53,6 +54,9 @@ export class DEX extends APIResource { } export interface DigitalExperienceMonitor { + /** + * API Resource UUID tag. + */ id: string; /** @@ -208,6 +212,7 @@ export declare namespace DEX { FleetStatus as FleetStatus, type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, + type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts index a64c26da75..43f7978b75 100644 --- a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts +++ b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts @@ -44,20 +44,25 @@ export class FleetStatus extends APIResource { * * @example * ```ts - * await client.zeroTrust.dex.fleetStatus.overTime({ - * account_id: '01a7362d577a6c3019a474fd6f485823', - * from: '2023-10-11T00:00:00Z', - * to: '2023-10-11T00:00:00Z', - * }); + * const response = + * await client.zeroTrust.dex.fleetStatus.overTime({ + * account_id: '01a7362d577a6c3019a474fd6f485823', + * from: '2023-10-11T00:00:00Z', + * to: '2023-10-11T00:00:00Z', + * }); * ``` */ - overTime(params: FleetStatusOverTimeParams, options?: Core.RequestOptions): Core.APIPromise { + overTime( + params: FleetStatusOverTimeParams, + options?: Core.RequestOptions, + ): Core.APIPromise { const { account_id, ...query } = params; - return this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { - query, - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + return ( + this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { + query, + ...options, + }) as Core.APIPromise<{ result: FleetStatusOverTimeResponse }> + )._thenUnwrap((obj) => obj.result); } } @@ -93,6 +98,53 @@ export namespace FleetStatusLiveResponse { } } +export interface FleetStatusOverTimeResponse { + deviceStats?: FleetStatusOverTimeResponse.DeviceStats; +} + +export namespace FleetStatusOverTimeResponse { + export interface DeviceStats { + byMode?: Array; + + byStatus?: Array; + + /** + * Number of unique devices + */ + uniqueDevicesTotal?: number; + } + + export namespace DeviceStats { + export interface ByMode { + /** + * Timestamp in ISO format + */ + timestamp?: string; + + /** + * Number of unique devices + */ + uniqueDevicesTotal?: number; + + value?: string; + } + + export interface ByStatus { + /** + * Timestamp in ISO format + */ + timestamp?: string; + + /** + * Number of unique devices + */ + uniqueDevicesTotal?: number; + + value?: string; + } + } +} + export interface FleetStatusLiveParams { /** * Path param: Unique identifier for account @@ -139,6 +191,7 @@ export declare namespace FleetStatus { export { type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, + type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/index.ts b/src/resources/zero-trust/dex/fleet-status/index.ts index 31cdb34bb8..8bf3ee7730 100644 --- a/src/resources/zero-trust/dex/fleet-status/index.ts +++ b/src/resources/zero-trust/dex/fleet-status/index.ts @@ -10,6 +10,7 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, + type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status'; diff --git a/src/resources/zero-trust/dex/index.ts b/src/resources/zero-trust/dex/index.ts index f97aa02d43..d0f4eae54c 100644 --- a/src/resources/zero-trust/dex/index.ts +++ b/src/resources/zero-trust/dex/index.ts @@ -20,6 +20,7 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, + type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status/index'; diff --git a/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts b/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts deleted file mode 100644 index 9bd29bee68..0000000000 --- a/tests/api-resources/cloudforce-one/threat-events/indicator-types.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 indicatorTypes', () => { - // TODO: HTTP 401 from prism - test.skip('list: only required params', async () => { - const responsePromise = client.cloudforceOne.threatEvents.indicatorTypes.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); - }); - - // TODO: HTTP 401 from prism - test.skip('list: required and optional params', async () => { - const response = await client.cloudforceOne.threatEvents.indicatorTypes.list({ - account_id: 'account_id', - }); - }); -}); 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 a543062bc0..d69492f799 100644 --- a/tests/api-resources/kv/namespaces/namespaces.test.ts +++ b/tests/api-resources/kv/namespaces/namespaces.test.ts @@ -69,7 +69,7 @@ describe('resource namespaces', () => { direction: 'asc', order: 'id', page: 1, - per_page: 1, + per_page: 5, }); }); @@ -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 03fbaa4b52..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: {}, }); }); diff --git a/tests/api-resources/leaked-credential-checks/detections.test.ts b/tests/api-resources/leaked-credential-checks/detections.test.ts deleted file mode 100644 index f9a1af0b8e..0000000000 --- a/tests/api-resources/leaked-credential-checks/detections.test.ts +++ /dev/null @@ -1,98 +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 detections', () => { - test('create: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.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.leakedCredentialChecks.detections.create({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - password: 'lookup_json_string(http.request.body.raw, "secret")', - username: 'lookup_json_string(http.request.body.raw, "user")', - }); - }); - - test('update: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.update( - '18a14bafaa8eb1df04ce683ec18c765e', - { 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('update: required and optional params', async () => { - const response = await client.leakedCredentialChecks.detections.update( - '18a14bafaa8eb1df04ce683ec18c765e', - { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - password: 'lookup_json_string(http.request.body.raw, "secret")', - username: 'lookup_json_string(http.request.body.raw, "user")', - }, - ); - }); - - test('list: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.list({ - 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('list: required and optional params', async () => { - const response = await client.leakedCredentialChecks.detections.list({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - }); - - test('delete: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.delete( - '18a14bafaa8eb1df04ce683ec18c765e', - { 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('delete: required and optional params', async () => { - const response = await client.leakedCredentialChecks.detections.delete( - '18a14bafaa8eb1df04ce683ec18c765e', - { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); - }); -}); diff --git a/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts b/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts deleted file mode 100644 index c7c208f9ed..0000000000 --- a/tests/api-resources/leaked-credential-checks/leaked-credential-checks.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 leakedCredentialChecks', () => { - test('create: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.create({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - enabled: true, - }); - }); - - test('get: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); - }); -}); 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/pages/projects/deployments/deployments.test.ts b/tests/api-resources/pages/projects/deployments/deployments.test.ts index 41d5114e2a..67899467e8 100644 --- a/tests/api-resources/pages/projects/deployments/deployments.test.ts +++ b/tests/api-resources/pages/projects/deployments/deployments.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({ @@ -28,7 +28,19 @@ describe('resource deployments', () => { test.skip('create: required and optional params', async () => { const response = await client.pages.projects.deployments.create('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + _headers: await toFile(Buffer.from('# my file contents'), 'README.md'), + _redirects: await toFile(Buffer.from('# my file contents'), 'README.md'), + '_routes.json': await toFile(Buffer.from('# my file contents'), 'README.md'), + '_worker.bundle': await toFile(Buffer.from('# my file contents'), 'README.md'), + '_worker.js': await toFile(Buffer.from('# my file contents'), 'README.md'), branch: 'staging', + commit_dirty: 'false', + commit_hash: 'a1b2c3d4e5f6', + commit_message: 'Update homepage', + 'functions-filepath-routing-config.json': await toFile(Buffer.from('# my file contents'), 'README.md'), + manifest: '{"index.html": "abc123", "style.css": "def456"}', + pages_build_output_dir: 'dist', + wrangler_config_hash: 'wrangler_config_hash', }); }); diff --git a/tests/api-resources/pages/projects/projects.test.ts b/tests/api-resources/pages/projects/projects.test.ts index 41a92b2403..4f2c4122e8 100644 --- a/tests/api-resources/pages/projects/projects.test.ts +++ b/tests/api-resources/pages/projects/projects.test.ts @@ -11,7 +11,11 @@ const client = new Cloudflare({ describe('resource projects', () => { test('create: only required params', async () => { - const responsePromise = client.pages.projects.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = client.pages.projects.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'my-pages-app', + production_branch: 'main', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -24,6 +28,8 @@ describe('resource projects', () => { test('create: required and optional params', async () => { const response = await client.pages.projects.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'my-pages-app', + production_branch: 'main', build_config: { build_caching: true, build_command: 'npm run build', @@ -35,15 +41,19 @@ describe('resource projects', () => { deployment_configs: { preview: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, + always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - compatibility_date: '2022-01-01', + build_image_major_version: 3, + compatibility_date: '2025-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, + fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, + limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -55,19 +65,25 @@ describe('resource projects', () => { service: 'example-worker', }, }, + usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, + wrangler_config_hash: 'abc123def456', }, production: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, + always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - compatibility_date: '2022-01-01', + build_image_major_version: 3, + compatibility_date: '2025-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, + fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, + limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -79,26 +95,26 @@ describe('resource projects', () => { service: 'example-worker', }, }, + usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, + wrangler_config_hash: 'abc123def456', }, }, - name: 'NextJS Blog', - production_branch: 'main', source: { config: { deployments_enabled: true, - owner: 'owner', + owner: 'my-org', path_excludes: ['string'], path_includes: ['string'], pr_comments_enabled: true, preview_branch_excludes: ['string'], preview_branch_includes: ['string'], preview_deployment_setting: 'all', - production_branch: 'production_branch', + production_branch: 'main', production_deployments_enabled: true, - repo_name: 'repo_name', + repo_name: 'my-repo', }, - type: 'type', + type: 'github', }, }); }); @@ -144,6 +160,8 @@ describe('resource projects', () => { test('edit: only required params', async () => { const responsePromise = client.pages.projects.edit('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'my-pages-app', + production_branch: 'main', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -157,6 +175,8 @@ describe('resource projects', () => { test('edit: required and optional params', async () => { const response = await client.pages.projects.edit('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'my-pages-app', + production_branch: 'main', build_config: { build_caching: true, build_command: 'npm run build', @@ -168,15 +188,19 @@ describe('resource projects', () => { deployment_configs: { preview: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, + always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - compatibility_date: '2022-01-01', + build_image_major_version: 3, + compatibility_date: '2025-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, + fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, + limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -188,19 +212,25 @@ describe('resource projects', () => { service: 'example-worker', }, }, + usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, + wrangler_config_hash: 'abc123def456', }, production: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, + always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - compatibility_date: '2022-01-01', + build_image_major_version: 3, + compatibility_date: '2025-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, + fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, + limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -212,26 +242,26 @@ describe('resource projects', () => { service: 'example-worker', }, }, + usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, + wrangler_config_hash: 'abc123def456', }, }, - name: 'NextJS Blog', - production_branch: 'main', source: { config: { deployments_enabled: true, - owner: 'owner', + owner: 'my-org', path_excludes: ['string'], path_includes: ['string'], pr_comments_enabled: true, preview_branch_excludes: ['string'], preview_branch_includes: ['string'], preview_deployment_setting: 'all', - production_branch: 'production_branch', + production_branch: 'main', production_deployments_enabled: true, - repo_name: 'repo_name', + repo_name: 'my-repo', }, - type: 'type', + type: 'github', }, }); }); diff --git a/tests/api-resources/pipelines.test.ts b/tests/api-resources/pipelines.test.ts index 40730e8ec8..390a133372 100644 --- a/tests/api-resources/pipelines.test.ts +++ b/tests/api-resources/pipelines.test.ts @@ -12,7 +12,7 @@ const client = new Cloudflare({ describe('resource pipelines', () => { test('create: only required params', async () => { const responsePromise = client.pipelines.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', destination: { batch: {}, compression: {}, @@ -39,7 +39,7 @@ describe('resource pipelines', () => { test('create: required and optional params', async () => { const response = await client.pipelines.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', destination: { batch: { max_bytes: 1000, max_duration_s: 0.25, max_rows: 100 }, compression: { type: 'gzip' }, @@ -64,7 +64,7 @@ describe('resource pipelines', () => { test('update: only required params', async () => { const responsePromise = client.pipelines.update('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', destination: { batch: {}, compression: {}, format: 'json', path: { bucket: 'bucket' }, type: 'r2' }, name: 'sample_pipeline', source: [{ format: 'json', type: 'type' }], @@ -80,7 +80,7 @@ describe('resource pipelines', () => { test('update: required and optional params', async () => { const response = await client.pipelines.update('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', destination: { batch: { max_bytes: 1000, max_duration_s: 0.25, max_rows: 100 }, compression: { type: 'gzip' }, @@ -104,7 +104,7 @@ describe('resource pipelines', () => { }); test('list: only required params', async () => { - const responsePromise = client.pipelines.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = client.pipelines.list({ account_id: '0123105f4ecef8ad9ca31a8372d0c353' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -116,7 +116,7 @@ describe('resource pipelines', () => { test('list: required and optional params', async () => { const response = await client.pipelines.list({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', page: 'page', per_page: 'per_page', search: 'search', @@ -125,7 +125,7 @@ describe('resource pipelines', () => { test('delete: only required params', async () => { const responsePromise = client.pipelines.delete('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -138,13 +138,13 @@ describe('resource pipelines', () => { test('delete: required and optional params', async () => { const response = await client.pipelines.delete('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', }); }); test('get: only required params', async () => { const responsePromise = client.pipelines.get('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -157,7 +157,7 @@ describe('resource pipelines', () => { test('get: required and optional params', async () => { const response = await client.pipelines.get('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', }); }); }); diff --git a/tests/api-resources/queues/consumers.test.ts b/tests/api-resources/queues/consumers.test.ts index e4275cc8e0..9cff12967c 100644 --- a/tests/api-resources/queues/consumers.test.ts +++ b/tests/api-resources/queues/consumers.test.ts @@ -115,27 +115,4 @@ describe('resource consumers', () => { { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); }); - - test('get: only required params', async () => { - const responsePromise = client.queues.consumers.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '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('get: required and optional params', async () => { - const response = await client.queues.consumers.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); - }); }); 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/queues/subscriptions.test.ts b/tests/api-resources/queues/subscriptions.test.ts deleted file mode 100644 index fed29a3ae9..0000000000 --- a/tests/api-resources/queues/subscriptions.test.ts +++ /dev/null @@ -1,101 +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 subscriptions', () => { - test('create: only required params', async () => { - const responsePromise = client.queues.subscriptions.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.queues.subscriptions.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - destination: { queue_id: 'queue_id', type: 'queues.queue' }, - enabled: true, - events: ['string'], - name: 'name', - source: { type: 'images' }, - }); - }); - - test('update: only required params', async () => { - const responsePromise = client.queues.subscriptions.update('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('update: required and optional params', async () => { - const response = await client.queues.subscriptions.update('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - destination: { queue_id: 'queue_id', type: 'queues.queue' }, - enabled: true, - events: ['string'], - name: 'name', - }); - }); - - test('list: only required params', async () => { - const responsePromise = client.queues.subscriptions.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.queues.subscriptions.list({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - direction: 'asc', - order: 'created_at', - page: 1, - per_page: 1, - }); - }); - - test('delete: only required params', async () => { - const responsePromise = client.queues.subscriptions.delete('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('delete: required and optional params', async () => { - const response = await client.queues.subscriptions.delete('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - }); -}); 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 cdad8d0e4b..0000000000 --- a/tests/api-resources/workflows/instances/instances.test.ts +++ /dev/null @@ -1,89 +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', - cursor: 'cursor', - date_end: '2019-12-27T18:11:19.117Z', - date_start: '2019-12-27T18:11:19.117Z', - direction: 'asc', - 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' }); - }); -}); diff --git a/tests/api-resources/zero-trust/devices/dex-tests.test.ts b/tests/api-resources/zero-trust/devices/dex-tests.test.ts index 246e9b7961..0669d5569c 100644 --- a/tests/api-resources/zero-trust/devices/dex-tests.test.ts +++ b/tests/api-resources/zero-trust/devices/dex-tests.test.ts @@ -13,7 +13,7 @@ describe('resource dexTests', () => { test('create: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.create({ account_id: '01a7362d577a6c3019a474fd6f485823', - data: {}, + data: { host: 'https://dash.cloudflare.com', kind: 'http' }, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -35,7 +35,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'id', default: true, name: 'name' }], + target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], targeted: true, }); }); @@ -43,7 +43,7 @@ describe('resource dexTests', () => { test('update: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', - data: {}, + data: { host: 'https://dash.cloudflare.com', kind: 'http' }, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -65,7 +65,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'id', default: true, name: 'name' }], + target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], targeted: true, }); }); From 640d0511015df97f648db04080c4429f7384a995 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 23:08:00 +0000 Subject: [PATCH 070/451] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 174 +- scripts/detect-breaking-changes | 19 + .../cloudforce-one/threat-events/index.ts | 6 +- .../threat-events/indicator-types.ts | 48 +- .../threat-events/threat-events.ts | 8 +- src/resources/custom-pages.ts | 48 +- .../email-security/investigate/investigate.ts | 46 - 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 | 139 +- src/resources/kv/namespaces/metadata.ts | 4 +- src/resources/kv/namespaces/namespaces.ts | 164 +- src/resources/kv/namespaces/values.ts | 33 +- .../leaked-credential-checks/detections.ts | 240 ++- .../leaked-credential-checks/index.ts | 13 +- .../leaked-credential-checks.ts | 121 +- 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 +- .../pages/projects/deployments/deployments.ts | 66 - src/resources/pages/projects/projects.ts | 547 +----- src/resources/pipelines.ts | 138 +- src/resources/queues/consumers.ts | 35 + src/resources/queues/index.ts | 19 +- src/resources/queues/messages.ts | 217 ++- src/resources/queues/queues.ts | 40 +- src/resources/queues/subscriptions.ts | 871 +++++++++- 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 | 416 ++++- src/resources/workflows/instances/status.ts | 54 +- src/resources/workflows/versions.ts | 87 +- src/resources/workflows/workflows.ts | 274 ++- src/resources/zero-trust/devices/dex-tests.ts | 80 +- src/resources/zero-trust/dex/colos.ts | 17 +- src/resources/zero-trust/dex/dex.ts | 5 - .../dex/fleet-status/fleet-status.ts | 75 +- .../zero-trust/dex/fleet-status/index.ts | 1 - src/resources/zero-trust/dex/index.ts | 1 - .../threat-events/indicator-types.test.ts | 33 + .../api-resources/kv/namespaces/keys.test.ts | 31 +- .../kv/namespaces/namespaces.test.ts | 33 +- .../kv/namespaces/values.test.ts | 3 +- .../detections.test.ts | 98 ++ .../leaked-credential-checks.test.ts | 49 + .../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 + .../projects/deployments/deployments.test.ts | 14 +- .../pages/projects/projects.test.ts | 64 +- tests/api-resources/pipelines.test.ts | 20 +- tests/api-resources/queues/consumers.test.ts | 23 + tests/api-resources/queues/messages.test.ts | 43 + .../queues/subscriptions.test.ts | 101 ++ .../workers/observability/telemetry.test.ts | 110 ++ .../workflows/instances/events.test.ts | 32 + .../workflows/instances/instances.test.ts | 89 + .../workflows/instances/status.test.ts | 33 + .../api-resources/workflows/versions.test.ts | 50 + .../api-resources/workflows/workflows.test.ts | 85 + .../zero-trust/devices/dex-tests.test.ts | 8 +- 78 files changed, 6202 insertions(+), 1099 deletions(-) create mode 100644 tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts create mode 100644 tests/api-resources/leaked-credential-checks/detections.test.ts create mode 100644 tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts 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/queues/subscriptions.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 76df3072dc..0a983f097f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1784 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dc74d0ad57a48a9c661dba02d85a87e2a3d49a5e28dfadfe220d121dc8f923a3.yml -openapi_spec_hash: 74feca1304da3345536352544a3d4def +configured_endpoints: 1822 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7492bc33f84221ee63fe654c22680333788bfd2dfe8985c58f9d3db555ffca2b.yml +openapi_spec_hash: b454db8aa8af2160a780a5b69445f3a4 config_hash: 107e0f1f8a98b007260b319226b88b3c diff --git a/api.md b/api.md index 4df6e7455e..866462c86c 100644 --- a/api.md +++ b/api.md @@ -1715,16 +1715,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: @@ -2214,6 +2259,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 @@ -2221,18 +2278,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 @@ -2242,12 +2300,14 @@ Types: - Key - KeyBulkDeleteResponse +- KeyBulkGetResponse - KeyBulkUpdateResponse Methods: - 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 ### Metadata @@ -2316,12 +2376,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 @@ -2347,9 +2411,24 @@ Methods: - 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 ## Subscriptions +Types: + +- SubscriptionCreateResponse +- SubscriptionUpdateResponse +- SubscriptionListResponse +- SubscriptionDeleteResponse + +Methods: + +- client.queues.subscriptions.create({ ...params }) -> SubscriptionCreateResponse +- client.queues.subscriptions.update(subscriptionId, { ...params }) -> SubscriptionUpdateResponse +- client.queues.subscriptions.list({ ...params }) -> SubscriptionListResponsesV4PagePaginationArray +- client.queues.subscriptions.delete(subscriptionId, { ...params }) -> SubscriptionDeleteResponse + # APIGateway ## Configurations @@ -5403,12 +5482,11 @@ Types: - LiveStat - FleetStatusLiveResponse -- FleetStatusOverTimeResponse Methods: - client.zeroTrust.dex.fleetStatus.live({ ...params }) -> FleetStatusLiveResponse -- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> FleetStatusOverTimeResponse +- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> void #### Devices @@ -8005,6 +8083,14 @@ Methods: ### IndicatorTypes +Types: + +- IndicatorTypeListResponse + +Methods: + +- client.cloudforceOne.threatEvents.indicatorTypes.list({ ...params }) -> IndicatorTypeListResponse + ### Raw Types: @@ -8277,14 +8363,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: @@ -8339,8 +8479,32 @@ Methods: # LeakedCredentialChecks +Types: + +- LeakedCredentialCheckCreateResponse +- LeakedCredentialCheckGetResponse + +Methods: + +- client.leakedCredentialChecks.create({ ...params }) -> LeakedCredentialCheckCreateResponse +- client.leakedCredentialChecks.get({ ...params }) -> LeakedCredentialCheckGetResponse + ## Detections +Types: + +- DetectionCreateResponse +- DetectionUpdateResponse +- DetectionListResponse +- DetectionDeleteResponse + +Methods: + +- client.leakedCredentialChecks.detections.create({ ...params }) -> DetectionCreateResponse +- client.leakedCredentialChecks.detections.update(detectionId, { ...params }) -> DetectionUpdateResponse +- client.leakedCredentialChecks.detections.list({ ...params }) -> DetectionListResponsesSinglePage +- client.leakedCredentialChecks.detections.delete(detectionId, { ...params }) -> DetectionDeleteResponse + # ContentScanning Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 8c8c3ce4bf..4580a22d2d 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -143,6 +143,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 @@ -183,6 +191,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 @@ -195,6 +205,7 @@ TEST_PATHS=( tests/api-resources/queues/messages.test.ts tests/api-resources/queues/purge.test.ts tests/api-resources/queues/consumers.test.ts + tests/api-resources/queues/subscriptions.test.ts tests/api-resources/api-gateway/api-gateway.test.ts tests/api-resources/api-gateway/configurations.test.ts tests/api-resources/api-gateway/discovery/discovery.test.ts @@ -673,6 +684,7 @@ TEST_PATHS=( tests/api-resources/cloudforce-one/threat-events/categories.test.ts tests/api-resources/cloudforce-one/threat-events/countries.test.ts tests/api-resources/cloudforce-one/threat-events/datasets/datasets.test.ts + tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts tests/api-resources/cloudforce-one/threat-events/raw.test.ts tests/api-resources/cloudforce-one/threat-events/relate.test.ts tests/api-resources/cloudforce-one/threat-events/tags.test.ts @@ -696,9 +708,16 @@ 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 + tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts + tests/api-resources/leaked-credential-checks/detections.test.ts tests/api-resources/content-scanning/content-scanning.test.ts tests/api-resources/content-scanning/payloads.test.ts tests/api-resources/content-scanning/settings.test.ts diff --git a/src/resources/cloudforce-one/threat-events/index.ts b/src/resources/cloudforce-one/threat-events/index.ts index d797682ddd..02c8bab160 100644 --- a/src/resources/cloudforce-one/threat-events/index.ts +++ b/src/resources/cloudforce-one/threat-events/index.ts @@ -36,7 +36,11 @@ export { type EventTagCreateParams, type EventTagDeleteParams, } from './event-tags'; -export { IndicatorTypes } from './indicator-types'; +export { + IndicatorTypes, + type IndicatorTypeListResponse, + type IndicatorTypeListParams, +} from './indicator-types'; export { Insights } from './insights'; export { Raw, type RawEditResponse, type RawGetResponse, type RawEditParams, type RawGetParams } from './raw'; export { Relate, type RelateDeleteResponse, type RelateDeleteParams } from './relate'; diff --git a/src/resources/cloudforce-one/threat-events/indicator-types.ts b/src/resources/cloudforce-one/threat-events/indicator-types.ts index 99e5ccc453..7fa1b77a16 100644 --- a/src/resources/cloudforce-one/threat-events/indicator-types.ts +++ b/src/resources/cloudforce-one/threat-events/indicator-types.ts @@ -1,5 +1,51 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; -export class IndicatorTypes extends APIResource {} +export class IndicatorTypes extends APIResource { + /** + * Lists all indicator types + * + * @example + * ```ts + * const indicatorTypes = + * await client.cloudforceOne.threatEvents.indicatorTypes.list( + * { account_id: 'account_id' }, + * ); + * ``` + */ + list( + params: IndicatorTypeListParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.get(`/accounts/${account_id}/cloudforce-one/events/indicatorTypes`, options); + } +} + +export interface IndicatorTypeListResponse { + items: IndicatorTypeListResponse.Items; + + type: string; +} + +export namespace IndicatorTypeListResponse { + export interface Items { + type: string; + } +} + +export interface IndicatorTypeListParams { + /** + * Account ID. + */ + account_id: string; +} + +export declare namespace IndicatorTypes { + export { + type IndicatorTypeListResponse as IndicatorTypeListResponse, + type IndicatorTypeListParams as IndicatorTypeListParams, + }; +} diff --git a/src/resources/cloudforce-one/threat-events/threat-events.ts b/src/resources/cloudforce-one/threat-events/threat-events.ts index d23c37b5db..119f0b95d8 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -31,7 +31,7 @@ import { EventTags, } from './event-tags'; import * as IndicatorTypesAPI from './indicator-types'; -import { IndicatorTypes } from './indicator-types'; +import { IndicatorTypeListParams, IndicatorTypeListResponse, IndicatorTypes } from './indicator-types'; import * as InsightsAPI from './insights'; import { Insights } from './insights'; import * as RawAPI from './raw'; @@ -821,7 +821,11 @@ export declare namespace ThreatEvents { type DatasetRawParams as DatasetRawParams, }; - export { IndicatorTypes as IndicatorTypes }; + export { + IndicatorTypes as IndicatorTypes, + type IndicatorTypeListResponse as IndicatorTypeListResponse, + type IndicatorTypeListParams as IndicatorTypeListParams, + }; export { RawAPIRaw as Raw, diff --git a/src/resources/custom-pages.ts b/src/resources/custom-pages.ts index 4c861b1e41..6bd1b13cf7 100644 --- a/src/resources/custom-pages.ts +++ b/src/resources/custom-pages.ts @@ -24,15 +24,13 @@ export class CustomPages extends APIResource { */ update( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', params: CustomPageUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { @@ -125,42 +123,36 @@ export class CustomPages extends APIResource { */ get( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', params?: CustomPageGetParams, options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', params: CustomPageGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { diff --git a/src/resources/email-security/investigate/investigate.ts b/src/resources/email-security/investigate/investigate.ts index 7093627a0f..a15d9630ba 100644 --- a/src/resources/email-security/investigate/investigate.ts +++ b/src/resources/email-security/investigate/investigate.ts @@ -199,33 +199,10 @@ export namespace InvestigateListResponse { } export interface Finding { - attachment?: string | null; - detail?: string | null; - detection?: - | 'MALICIOUS' - | 'MALICIOUS-BEC' - | 'SUSPICIOUS' - | 'SPOOF' - | 'SPAM' - | 'BULK' - | 'ENCRYPTED' - | 'EXTERNAL' - | 'UNKNOWN' - | 'NONE' - | null; - - field?: string | null; - name?: string | null; - portion?: string | null; - - reason?: string | null; - - score?: number | null; - value?: string | null; } @@ -344,33 +321,10 @@ export namespace InvestigateGetResponse { } export interface Finding { - attachment?: string | null; - detail?: string | null; - detection?: - | 'MALICIOUS' - | 'MALICIOUS-BEC' - | 'SUSPICIOUS' - | 'SPOOF' - | 'SPAM' - | 'BULK' - | 'ENCRYPTED' - | 'EXTERNAL' - | 'UNKNOWN' - | 'NONE' - | null; - - field?: string | null; - name?: string | null; - portion?: string | null; - - reason?: string | null; - - score?: number | null; - value?: string | null; } 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 f8b3034d84..c581632a76 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 a4db89243d..138942ad57 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. @@ -99,12 +120,12 @@ export interface Key { /** * 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 +135,49 @@ 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 { + /** + * The metadata associated with the key. + */ + metadata: unknown; + + /** + * The value associated with the key. + */ + 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,26 +189,27 @@ export interface KeyBulkUpdateResponse { export interface KeyListParams extends CursorPaginationAfterParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; /** - * Query param: The number of keys to return. The cursor attribute may be used to - * iterate over the next batch of keys if there are more than the limit. + * 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: 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; @@ -157,9 +219,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; @@ -172,39 +256,38 @@ 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. + * Arbitrary JSON that is associated with a key. */ - value?: string; + metadata?: unknown; } } @@ -214,10 +297,12 @@ export declare namespace Keys { export { type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, + type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorPaginationAfter as KeysCursorPaginationAfter, 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..927ba8a17d 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -37,11 +37,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 3ec43aa7c5..df179e53bb 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' }], * }, * ); * ``` @@ -240,13 +272,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 +286,49 @@ 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 { + /** + * The metadata associated with the key. + */ + metadata: unknown; + + /** + * The value associated with the key. + */ + 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 +340,7 @@ export interface NamespaceBulkUpdateResponse { export interface NamespaceCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -282,7 +352,7 @@ export interface NamespaceCreateParams { export interface NamespaceUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -294,7 +364,7 @@ export interface NamespaceUpdateParams { export interface NamespaceListParams extends V4PagePaginationArrayParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -311,14 +381,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 +398,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 +435,44 @@ 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. + * Arbitrary JSON that is associated with a key. */ - value?: string; + metadata?: unknown; } } export interface NamespaceGetParams { /** - * Identifier + * Identifier. */ account_id: string; } @@ -390,14 +481,14 @@ Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; Namespaces.Keys = Keys; Namespaces.KeysCursorPaginationAfter = KeysCursorPaginationAfter; 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 +496,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 +505,12 @@ export declare namespace Namespaces { Keys as Keys, type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, + type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorPaginationAfter as KeysCursorPaginationAfter, type KeyListParams as KeyListParams, type KeyBulkDeleteParams as KeyBulkDeleteParams, + type KeyBulkGetParams as KeyBulkGetParams, type KeyBulkUpdateParams as KeyBulkUpdateParams, }; @@ -427,7 +521,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 1fa5ff39ed..49566f425a 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,13 +37,8 @@ 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, - __multipartSyntax: 'json', - ...options, - headers: { 'Content-Type': '*/*', ...options?.headers }, - }), + Core.multipartFormRequestOptions({ query: { expiration, expiration_ttl }, body, + __multipartSyntax: 'json', ...options }), ) as Core.APIPromise<{ result: ValueUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } @@ -120,43 +114,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: Associates arbitrary JSON data with a key/value pair. + */ + metadata?: unknown; } export interface ValueDeleteParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface ValueGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/leaked-credential-checks/detections.ts b/src/resources/leaked-credential-checks/detections.ts index 2a6de390ad..ca2e008bd9 100644 --- a/src/resources/leaked-credential-checks/detections.ts +++ b/src/resources/leaked-credential-checks/detections.ts @@ -1,5 +1,243 @@ // 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 Detections extends APIResource {} +export class Detections extends APIResource { + /** + * Create user-defined detection pattern for Leaked Credential Checks. + * + * @example + * ```ts + * const detection = + * await client.leakedCredentialChecks.detections.create({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create( + params: DetectionCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/leaked-credential-checks/detections`, { + body, + ...options, + }) as Core.APIPromise<{ result: DetectionCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update user-defined detection pattern for Leaked Credential Checks. + * + * @example + * ```ts + * const detection = + * await client.leakedCredentialChecks.detections.update( + * '18a14bafaa8eb1df04ce683ec18c765e', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + update( + detectionId: string, + params: DetectionUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.put(`/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: DetectionUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List user-defined detection patterns for Leaked Credential Checks. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const detectionListResponse of client.leakedCredentialChecks.detections.list( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: DetectionListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { zone_id } = params; + return this._client.getAPIList( + `/zones/${zone_id}/leaked-credential-checks/detections`, + DetectionListResponsesSinglePage, + options, + ); + } + + /** + * Remove user-defined detection pattern for Leaked Credential Checks. + * + * @example + * ```ts + * const detection = + * await client.leakedCredentialChecks.detections.delete( + * '18a14bafaa8eb1df04ce683ec18c765e', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + detectionId: string, + params: DetectionDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.delete( + `/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, + options, + ) as Core.APIPromise<{ result: DetectionDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class DetectionListResponsesSinglePage extends SinglePage {} + +/** + * Defines a custom set of username/password expressions to match Leaked Credential + * Checks on. + */ +export interface DetectionCreateResponse { + /** + * Defines the unique ID for this custom detection. + */ + id?: string; + + /** + * Defines ehe ruleset expression to use in matching the password in a request. + */ + password?: string; + + /** + * Defines the ruleset expression to use in matching the username in a request. + */ + username?: string; +} + +/** + * Defines a custom set of username/password expressions to match Leaked Credential + * Checks on. + */ +export interface DetectionUpdateResponse { + /** + * Defines the unique ID for this custom detection. + */ + id?: string; + + /** + * Defines ehe ruleset expression to use in matching the password in a request. + */ + password?: string; + + /** + * Defines the ruleset expression to use in matching the username in a request. + */ + username?: string; +} + +/** + * Defines a custom set of username/password expressions to match Leaked Credential + * Checks on. + */ +export interface DetectionListResponse { + /** + * Defines the unique ID for this custom detection. + */ + id?: string; + + /** + * Defines ehe ruleset expression to use in matching the password in a request. + */ + password?: string; + + /** + * Defines the ruleset expression to use in matching the username in a request. + */ + username?: string; +} + +export type DetectionDeleteResponse = unknown; + +export interface DetectionCreateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: Defines ehe ruleset expression to use in matching the password in a + * request. + */ + password?: string; + + /** + * Body param: Defines the ruleset expression to use in matching the username in a + * request. + */ + username?: string; +} + +export interface DetectionUpdateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: Defines ehe ruleset expression to use in matching the password in a + * request. + */ + password?: string; + + /** + * Body param: Defines the ruleset expression to use in matching the username in a + * request. + */ + username?: string; +} + +export interface DetectionListParams { + /** + * Defines an identifier. + */ + zone_id: string; +} + +export interface DetectionDeleteParams { + /** + * Defines an identifier. + */ + zone_id: string; +} + +Detections.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; + +export declare namespace Detections { + export { + type DetectionCreateResponse as DetectionCreateResponse, + type DetectionUpdateResponse as DetectionUpdateResponse, + type DetectionListResponse as DetectionListResponse, + type DetectionDeleteResponse as DetectionDeleteResponse, + DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, + type DetectionCreateParams as DetectionCreateParams, + type DetectionUpdateParams as DetectionUpdateParams, + type DetectionListParams as DetectionListParams, + type DetectionDeleteParams as DetectionDeleteParams, + }; +} diff --git a/src/resources/leaked-credential-checks/index.ts b/src/resources/leaked-credential-checks/index.ts index 7e3e1a0dd7..1844848bf2 100644 --- a/src/resources/leaked-credential-checks/index.ts +++ b/src/resources/leaked-credential-checks/index.ts @@ -1,4 +1,15 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Detections } from './detections'; +export { + DetectionListResponsesSinglePage, + Detections, + type DetectionCreateResponse, + type DetectionUpdateResponse, + type DetectionListResponse, + type DetectionDeleteResponse, + type DetectionCreateParams, + type DetectionUpdateParams, + type DetectionListParams, + type DetectionDeleteParams, +} from './detections'; export { LeakedCredentialChecks } from './leaked-credential-checks'; diff --git a/src/resources/leaked-credential-checks/leaked-credential-checks.ts b/src/resources/leaked-credential-checks/leaked-credential-checks.ts index c89821160c..d8d8de90c1 100644 --- a/src/resources/leaked-credential-checks/leaked-credential-checks.ts +++ b/src/resources/leaked-credential-checks/leaked-credential-checks.ts @@ -1,15 +1,132 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; +import * as Core from '../../core'; import * as DetectionsAPI from './detections'; -import { Detections } from './detections'; +import { + DetectionCreateParams, + DetectionCreateResponse, + DetectionDeleteParams, + DetectionDeleteResponse, + DetectionListParams, + DetectionListResponse, + DetectionListResponsesSinglePage, + DetectionUpdateParams, + DetectionUpdateResponse, + Detections, +} from './detections'; export class LeakedCredentialChecks extends APIResource { detections: DetectionsAPI.Detections = new DetectionsAPI.Detections(this._client); + + /** + * Updates the current status of Leaked Credential Checks. + * + * @example + * ```ts + * const leakedCredentialCheck = + * await client.leakedCredentialChecks.create({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create( + params: LeakedCredentialCheckCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/leaked-credential-checks`, { + body, + ...options, + }) as Core.APIPromise<{ result: LeakedCredentialCheckCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the current status of Leaked Credential Checks. + * + * @example + * ```ts + * const leakedCredentialCheck = + * await client.leakedCredentialChecks.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + get( + params: LeakedCredentialCheckGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.get(`/zones/${zone_id}/leaked-credential-checks`, options) as Core.APIPromise<{ + result: LeakedCredentialCheckGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +/** + * Defines the overall status for Leaked Credential Checks. + */ +export interface LeakedCredentialCheckCreateResponse { + /** + * Determines whether or not Leaked Credential Checks are enabled. + */ + enabled?: boolean; +} + +/** + * Defines the overall status for Leaked Credential Checks. + */ +export interface LeakedCredentialCheckGetResponse { + /** + * Determines whether or not Leaked Credential Checks are enabled. + */ + enabled?: boolean; +} + +export interface LeakedCredentialCheckCreateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: Determines whether or not Leaked Credential Checks are enabled. + */ + enabled?: boolean; +} + +export interface LeakedCredentialCheckGetParams { + /** + * Defines an identifier. + */ + zone_id: string; } LeakedCredentialChecks.Detections = Detections; +LeakedCredentialChecks.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; export declare namespace LeakedCredentialChecks { - export { Detections as Detections }; + export { + type LeakedCredentialCheckCreateResponse as LeakedCredentialCheckCreateResponse, + type LeakedCredentialCheckGetResponse as LeakedCredentialCheckGetResponse, + type LeakedCredentialCheckCreateParams as LeakedCredentialCheckCreateParams, + type LeakedCredentialCheckGetParams as LeakedCredentialCheckGetParams, + }; + + export { + Detections as Detections, + type DetectionCreateResponse as DetectionCreateResponse, + type DetectionUpdateResponse as DetectionUpdateResponse, + type DetectionListResponse as DetectionListResponse, + type DetectionDeleteResponse as DetectionDeleteResponse, + DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, + type DetectionCreateParams as DetectionCreateParams, + type DetectionUpdateParams as DetectionUpdateParams, + type DetectionListParams as DetectionListParams, + type DetectionDeleteParams as DetectionDeleteParams, + }; } 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..6e40d6cfa9 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..5e289166d6 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..6f0ab3dbaa 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/pages/projects/deployments/deployments.ts b/src/resources/pages/projects/deployments/deployments.ts index e1a307e7bf..97b2b41db9 100644 --- a/src/resources/pages/projects/deployments/deployments.ts +++ b/src/resources/pages/projects/deployments/deployments.ts @@ -192,77 +192,11 @@ export interface DeploymentCreateParams { */ account_id: string; - /** - * Body param: Headers configuration file for the deployment. - */ - _headers?: Core.Uploadable; - - /** - * Body param: Redirects configuration file for the deployment. - */ - _redirects?: Core.Uploadable; - - /** - * Body param: Routes configuration file defining routing rules. - */ - '_routes.json'?: Core.Uploadable; - - /** - * Body param: Worker bundle file in multipart/form-data format. Mutually exclusive - * with `_worker.js`. Cannot specify both `_worker.js` and `_worker.bundle` in the - * same request. Maximum size: 25 MiB. - */ - '_worker.bundle'?: Core.Uploadable; - - /** - * Body param: Worker JavaScript file. Mutually exclusive with `_worker.bundle`. - * Cannot specify both `_worker.js` and `_worker.bundle` in the same request. - */ - '_worker.js'?: Core.Uploadable; - /** * Body param: The branch to build the new deployment from. The `HEAD` of the * branch will be used. If omitted, the production branch will be used by default. */ branch?: string; - - /** - * Body param: Boolean string indicating if the working directory has uncommitted - * changes. - */ - commit_dirty?: 'true' | 'false'; - - /** - * Body param: Git commit SHA associated with this deployment. - */ - commit_hash?: string; - - /** - * Body param: Git commit message associated with this deployment. - */ - commit_message?: string; - - /** - * Body param: Functions routing configuration file. - */ - 'functions-filepath-routing-config.json'?: Core.Uploadable; - - /** - * Body param: JSON string containing a manifest of files to deploy. Maps file - * paths to their content hashes. Required for direct upload deployments. Maximum - * 20,000 entries. - */ - manifest?: string; - - /** - * Body param: The build output directory path. - */ - pages_build_output_dir?: string; - - /** - * Body param: Hash of the Wrangler configuration file used for this deployment. - */ - wrangler_config_hash?: string; } export interface DeploymentListParams { diff --git a/src/resources/pages/projects/projects.ts b/src/resources/pages/projects/projects.ts index f14c2e99bf..efac2c7d22 100644 --- a/src/resources/pages/projects/projects.ts +++ b/src/resources/pages/projects/projects.ts @@ -41,8 +41,6 @@ export class Projects extends APIResource { * ```ts * const project = await client.pages.projects.create({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * name: 'my-pages-app', - * production_branch: 'main', * }); * ``` */ @@ -113,11 +111,7 @@ export class Projects extends APIResource { * ```ts * const project = await client.pages.projects.edit( * 'this-is-my-project-01', - * { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * name: 'my-pages-app', - * production_branch: 'main', - * }, + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ @@ -221,7 +215,7 @@ export interface Deployment { */ env_vars?: { [key: string]: Deployment.PagesPlainTextEnvVar | null | Deployment.PagesSecretTextEnvVar | null; - } | null; + }; /** * Type of deploy. @@ -371,74 +365,31 @@ export namespace Deployment { export interface Source { config?: Source.Config; - /** - * The source control management provider. - */ - type?: 'github' | 'gitlab'; + type?: string; } export namespace Source { export interface Config { - /** - * @deprecated Use `production_deployments_enabled` and - * `preview_deployment_setting` for more granular control. - */ deployments_enabled?: boolean; - /** - * The owner of the repository. - */ owner?: string; - /** - * A list of paths that should be excluded from triggering a preview deployment. - * Wildcard syntax (`*`) is supported. - */ path_excludes?: Array; - /** - * A list of paths that should be watched to trigger a preview deployment. Wildcard - * syntax (`*`) is supported. - */ path_includes?: Array; - /** - * Whether to enable PR comments. - */ pr_comments_enabled?: boolean; - /** - * A list of branches that should not trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_excludes?: Array; - /** - * A list of branches that should trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_includes?: Array; - /** - * Controls whether commits to preview branches trigger a preview deployment. - */ preview_deployment_setting?: 'all' | 'none' | 'custom'; - /** - * The production branch of the repository. - */ production_branch?: string; - /** - * Whether to trigger a production deployment on commits to the production branch. - */ production_deployments_enabled?: boolean; - /** - * The name of the repository. - */ repo_name?: string; } } @@ -446,27 +397,17 @@ export namespace Deployment { export interface Project { /** - * ID of the project. - */ - id: string; - - /** - * Name of the project. - */ - name: string; - - /** - * Production branch of the project. Used to identify production deployments. + * Id of the project. */ - production_branch: string; + id?: string; /** * Configs for the project build process. */ - build_config?: Project.BuildConfig | null; + build_config?: Project.BuildConfig; /** - * Most recent production deployment of the project. + * Most recent deployment to the repo. */ canonical_deployment?: Deployment | null; @@ -478,7 +419,7 @@ export interface Project { /** * Configs for deployments in a project. */ - deployment_configs?: Project.DeploymentConfigs | null; + deployment_configs?: Project.DeploymentConfigs; /** * A list of associated custom domains for the project. @@ -486,29 +427,19 @@ export interface Project { domains?: Array; /** - * Framework the project is using. - */ - framework?: string; - - /** - * Version of the framework the project is using. - */ - framework_version?: string; - - /** - * Most recent deployment of the project. + * Most recent deployment to the repo. */ latest_deployment?: Deployment | null; /** - * Name of the preview script. + * Name of the project. */ - preview_script_name?: string; + name?: string; /** - * Name of the production script. + * Production branch of the project. Used to identify production deployments. */ - production_script_name?: string; + production_branch?: string; source?: Project.Source; @@ -516,11 +447,6 @@ export interface Project { * The Cloudflare subdomain associated with the project. */ subdomain?: string; - - /** - * Whether the project uses functions. - */ - uses_functions?: boolean; } export namespace Project { @@ -566,12 +492,12 @@ export namespace Project { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview | null; + preview?: DeploymentConfigs.Preview; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production | null; + production?: DeploymentConfigs.Production; } export namespace DeploymentConfigs { @@ -584,11 +510,6 @@ export namespace Project { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; - /** - * Whether to always use the latest compatibility date for Pages Functions. - */ - always_use_latest_compatibility_date?: boolean; - /** * Analytics Engine bindings used for Pages Functions. */ @@ -599,11 +520,6 @@ export namespace Project { */ browsers?: { [key: string]: Preview.Browsers | null } | null; - /** - * The major version of the build image to use for Pages Functions. - */ - build_image_major_version?: number; - /** * Compatibility date used for Pages Functions. */ @@ -612,7 +528,7 @@ export namespace Project { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array | null; + compatibility_flags?: Array; /** * D1 databases used for Pages Functions. @@ -629,12 +545,7 @@ export namespace Project { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - } | null; - - /** - * Whether to fail open when the deployment config cannot be applied. - */ - fail_open?: boolean; + }; /** * Hyperdrive bindings used for Pages Functions. @@ -646,11 +557,6 @@ export namespace Project { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; - /** - * Limits for Pages Functions. - */ - limits?: Preview.Limits | null; - /** * mTLS bindings used for Pages Functions. */ @@ -676,20 +582,10 @@ export namespace Project { */ services?: { [key: string]: Preview.Services | null } | null; - /** - * @deprecated All new projects now use the Standard usage model. - */ - usage_model?: 'standard' | 'bundled' | 'unbound'; - /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; - - /** - * Hash of the Wrangler configuration used for the deployment. - */ - wrangler_config_hash?: string; } export namespace Preview { @@ -776,16 +672,6 @@ export namespace Project { namespace_id?: string; } - /** - * Limits for Pages Functions. - */ - export interface Limits { - /** - * CPU time limit in milliseconds. - */ - cpu_ms?: number; - } - /** * mTLS binding. */ @@ -865,11 +751,6 @@ export namespace Project { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; - /** - * Whether to always use the latest compatibility date for Pages Functions. - */ - always_use_latest_compatibility_date?: boolean; - /** * Analytics Engine bindings used for Pages Functions. */ @@ -880,11 +761,6 @@ export namespace Project { */ browsers?: { [key: string]: Production.Browsers | null } | null; - /** - * The major version of the build image to use for Pages Functions. - */ - build_image_major_version?: number; - /** * Compatibility date used for Pages Functions. */ @@ -893,7 +769,7 @@ export namespace Project { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array | null; + compatibility_flags?: Array; /** * D1 databases used for Pages Functions. @@ -910,12 +786,7 @@ export namespace Project { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - } | null; - - /** - * Whether to fail open when the deployment config cannot be applied. - */ - fail_open?: boolean; + }; /** * Hyperdrive bindings used for Pages Functions. @@ -927,11 +798,6 @@ export namespace Project { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; - /** - * Limits for Pages Functions. - */ - limits?: Production.Limits | null; - /** * mTLS bindings used for Pages Functions. */ @@ -957,20 +823,10 @@ export namespace Project { */ services?: { [key: string]: Production.Services | null } | null; - /** - * @deprecated All new projects now use the Standard usage model. - */ - usage_model?: 'standard' | 'bundled' | 'unbound'; - /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; - - /** - * Hash of the Wrangler configuration used for the deployment. - */ - wrangler_config_hash?: string; } export namespace Production { @@ -1057,16 +913,6 @@ export namespace Project { namespace_id?: string; } - /** - * Limits for Pages Functions. - */ - export interface Limits { - /** - * CPU time limit in milliseconds. - */ - cpu_ms?: number; - } - /** * mTLS binding. */ @@ -1141,74 +987,31 @@ export namespace Project { export interface Source { config?: Source.Config; - /** - * The source control management provider. - */ - type?: 'github' | 'gitlab'; + type?: string; } export namespace Source { export interface Config { - /** - * @deprecated Use `production_deployments_enabled` and - * `preview_deployment_setting` for more granular control. - */ deployments_enabled?: boolean; - /** - * The owner of the repository. - */ owner?: string; - /** - * A list of paths that should be excluded from triggering a preview deployment. - * Wildcard syntax (`*`) is supported. - */ path_excludes?: Array; - /** - * A list of paths that should be watched to trigger a preview deployment. Wildcard - * syntax (`*`) is supported. - */ path_includes?: Array; - /** - * Whether to enable PR comments. - */ pr_comments_enabled?: boolean; - /** - * A list of branches that should not trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_excludes?: Array; - /** - * A list of branches that should trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_includes?: Array; - /** - * Controls whether commits to preview branches trigger a preview deployment. - */ preview_deployment_setting?: 'all' | 'none' | 'custom'; - /** - * The production branch of the repository. - */ production_branch?: string; - /** - * Whether to trigger a production deployment on commits to the production branch. - */ production_deployments_enabled?: boolean; - /** - * The name of the repository. - */ repo_name?: string; } } @@ -1250,25 +1053,25 @@ export interface ProjectCreateParams { account_id: string; /** - * Body param: Name of the project. + * Body param: Configs for the project build process. */ - name: string; + build_config?: ProjectCreateParams.BuildConfig; /** - * Body param: Production branch of the project. Used to identify production - * deployments. + * Body param: Configs for deployments in a project. */ - production_branch: string; + deployment_configs?: ProjectCreateParams.DeploymentConfigs; /** - * Body param: Configs for the project build process. + * Body param: Name of the project. */ - build_config?: ProjectCreateParams.BuildConfig | null; + name?: string; /** - * Body param: Configs for deployments in a project. + * Body param: Production branch of the project. Used to identify production + * deployments. */ - deployment_configs?: ProjectCreateParams.DeploymentConfigs | null; + production_branch?: string; /** * Body param: @@ -1319,12 +1122,12 @@ export namespace ProjectCreateParams { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview | null; + preview?: DeploymentConfigs.Preview; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production | null; + production?: DeploymentConfigs.Production; } export namespace DeploymentConfigs { @@ -1337,11 +1140,6 @@ export namespace ProjectCreateParams { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; - /** - * Whether to always use the latest compatibility date for Pages Functions. - */ - always_use_latest_compatibility_date?: boolean; - /** * Analytics Engine bindings used for Pages Functions. */ @@ -1352,11 +1150,6 @@ export namespace ProjectCreateParams { */ browsers?: { [key: string]: Preview.Browsers | null } | null; - /** - * The major version of the build image to use for Pages Functions. - */ - build_image_major_version?: number; - /** * Compatibility date used for Pages Functions. */ @@ -1365,7 +1158,7 @@ export namespace ProjectCreateParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array | null; + compatibility_flags?: Array; /** * D1 databases used for Pages Functions. @@ -1382,12 +1175,7 @@ export namespace ProjectCreateParams { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - } | null; - - /** - * Whether to fail open when the deployment config cannot be applied. - */ - fail_open?: boolean; + }; /** * Hyperdrive bindings used for Pages Functions. @@ -1399,11 +1187,6 @@ export namespace ProjectCreateParams { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; - /** - * Limits for Pages Functions. - */ - limits?: Preview.Limits | null; - /** * mTLS bindings used for Pages Functions. */ @@ -1429,20 +1212,10 @@ export namespace ProjectCreateParams { */ services?: { [key: string]: Preview.Services | null } | null; - /** - * @deprecated All new projects now use the Standard usage model. - */ - usage_model?: 'standard' | 'bundled' | 'unbound'; - /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; - - /** - * Hash of the Wrangler configuration used for the deployment. - */ - wrangler_config_hash?: string; } export namespace Preview { @@ -1529,16 +1302,6 @@ export namespace ProjectCreateParams { namespace_id?: string; } - /** - * Limits for Pages Functions. - */ - export interface Limits { - /** - * CPU time limit in milliseconds. - */ - cpu_ms?: number; - } - /** * mTLS binding. */ @@ -1618,11 +1381,6 @@ export namespace ProjectCreateParams { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; - /** - * Whether to always use the latest compatibility date for Pages Functions. - */ - always_use_latest_compatibility_date?: boolean; - /** * Analytics Engine bindings used for Pages Functions. */ @@ -1633,11 +1391,6 @@ export namespace ProjectCreateParams { */ browsers?: { [key: string]: Production.Browsers | null } | null; - /** - * The major version of the build image to use for Pages Functions. - */ - build_image_major_version?: number; - /** * Compatibility date used for Pages Functions. */ @@ -1646,7 +1399,7 @@ export namespace ProjectCreateParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array | null; + compatibility_flags?: Array; /** * D1 databases used for Pages Functions. @@ -1663,12 +1416,7 @@ export namespace ProjectCreateParams { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - } | null; - - /** - * Whether to fail open when the deployment config cannot be applied. - */ - fail_open?: boolean; + }; /** * Hyperdrive bindings used for Pages Functions. @@ -1680,11 +1428,6 @@ export namespace ProjectCreateParams { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; - /** - * Limits for Pages Functions. - */ - limits?: Production.Limits | null; - /** * mTLS bindings used for Pages Functions. */ @@ -1710,20 +1453,10 @@ export namespace ProjectCreateParams { */ services?: { [key: string]: Production.Services | null } | null; - /** - * @deprecated All new projects now use the Standard usage model. - */ - usage_model?: 'standard' | 'bundled' | 'unbound'; - /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; - - /** - * Hash of the Wrangler configuration used for the deployment. - */ - wrangler_config_hash?: string; } export namespace Production { @@ -1810,16 +1543,6 @@ export namespace ProjectCreateParams { namespace_id?: string; } - /** - * Limits for Pages Functions. - */ - export interface Limits { - /** - * CPU time limit in milliseconds. - */ - cpu_ms?: number; - } - /** * mTLS binding. */ @@ -1894,74 +1617,31 @@ export namespace ProjectCreateParams { export interface Source { config?: Source.Config; - /** - * The source control management provider. - */ - type?: 'github' | 'gitlab'; + type?: string; } export namespace Source { export interface Config { - /** - * @deprecated Use `production_deployments_enabled` and - * `preview_deployment_setting` for more granular control. - */ deployments_enabled?: boolean; - /** - * The owner of the repository. - */ owner?: string; - /** - * A list of paths that should be excluded from triggering a preview deployment. - * Wildcard syntax (`*`) is supported. - */ path_excludes?: Array; - /** - * A list of paths that should be watched to trigger a preview deployment. Wildcard - * syntax (`*`) is supported. - */ path_includes?: Array; - /** - * Whether to enable PR comments. - */ pr_comments_enabled?: boolean; - /** - * A list of branches that should not trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_excludes?: Array; - /** - * A list of branches that should trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_includes?: Array; - /** - * Controls whether commits to preview branches trigger a preview deployment. - */ preview_deployment_setting?: 'all' | 'none' | 'custom'; - /** - * The production branch of the repository. - */ production_branch?: string; - /** - * Whether to trigger a production deployment on commits to the production branch. - */ production_deployments_enabled?: boolean; - /** - * The name of the repository. - */ repo_name?: string; } } @@ -1988,25 +1668,25 @@ export interface ProjectEditParams { account_id: string; /** - * Body param: Name of the project. + * Body param: Configs for the project build process. */ - name: string; + build_config?: ProjectEditParams.BuildConfig; /** - * Body param: Production branch of the project. Used to identify production - * deployments. + * Body param: Configs for deployments in a project. */ - production_branch: string; + deployment_configs?: ProjectEditParams.DeploymentConfigs; /** - * Body param: Configs for the project build process. + * Body param: Name of the project. */ - build_config?: ProjectEditParams.BuildConfig | null; + name?: string; /** - * Body param: Configs for deployments in a project. + * Body param: Production branch of the project. Used to identify production + * deployments. */ - deployment_configs?: ProjectEditParams.DeploymentConfigs | null; + production_branch?: string; /** * Body param: @@ -2057,12 +1737,12 @@ export namespace ProjectEditParams { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview | null; + preview?: DeploymentConfigs.Preview; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production | null; + production?: DeploymentConfigs.Production; } export namespace DeploymentConfigs { @@ -2075,11 +1755,6 @@ export namespace ProjectEditParams { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; - /** - * Whether to always use the latest compatibility date for Pages Functions. - */ - always_use_latest_compatibility_date?: boolean; - /** * Analytics Engine bindings used for Pages Functions. */ @@ -2090,11 +1765,6 @@ export namespace ProjectEditParams { */ browsers?: { [key: string]: Preview.Browsers | null } | null; - /** - * The major version of the build image to use for Pages Functions. - */ - build_image_major_version?: number; - /** * Compatibility date used for Pages Functions. */ @@ -2103,7 +1773,7 @@ export namespace ProjectEditParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array | null; + compatibility_flags?: Array; /** * D1 databases used for Pages Functions. @@ -2120,12 +1790,7 @@ export namespace ProjectEditParams { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - } | null; - - /** - * Whether to fail open when the deployment config cannot be applied. - */ - fail_open?: boolean; + }; /** * Hyperdrive bindings used for Pages Functions. @@ -2137,11 +1802,6 @@ export namespace ProjectEditParams { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; - /** - * Limits for Pages Functions. - */ - limits?: Preview.Limits | null; - /** * mTLS bindings used for Pages Functions. */ @@ -2167,20 +1827,10 @@ export namespace ProjectEditParams { */ services?: { [key: string]: Preview.Services | null } | null; - /** - * @deprecated All new projects now use the Standard usage model. - */ - usage_model?: 'standard' | 'bundled' | 'unbound'; - /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; - - /** - * Hash of the Wrangler configuration used for the deployment. - */ - wrangler_config_hash?: string; } export namespace Preview { @@ -2267,16 +1917,6 @@ export namespace ProjectEditParams { namespace_id?: string; } - /** - * Limits for Pages Functions. - */ - export interface Limits { - /** - * CPU time limit in milliseconds. - */ - cpu_ms?: number; - } - /** * mTLS binding. */ @@ -2356,11 +1996,6 @@ export namespace ProjectEditParams { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; - /** - * Whether to always use the latest compatibility date for Pages Functions. - */ - always_use_latest_compatibility_date?: boolean; - /** * Analytics Engine bindings used for Pages Functions. */ @@ -2371,11 +2006,6 @@ export namespace ProjectEditParams { */ browsers?: { [key: string]: Production.Browsers | null } | null; - /** - * The major version of the build image to use for Pages Functions. - */ - build_image_major_version?: number; - /** * Compatibility date used for Pages Functions. */ @@ -2384,7 +2014,7 @@ export namespace ProjectEditParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array | null; + compatibility_flags?: Array; /** * D1 databases used for Pages Functions. @@ -2401,12 +2031,7 @@ export namespace ProjectEditParams { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - } | null; - - /** - * Whether to fail open when the deployment config cannot be applied. - */ - fail_open?: boolean; + }; /** * Hyperdrive bindings used for Pages Functions. @@ -2418,11 +2043,6 @@ export namespace ProjectEditParams { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; - /** - * Limits for Pages Functions. - */ - limits?: Production.Limits | null; - /** * mTLS bindings used for Pages Functions. */ @@ -2448,20 +2068,10 @@ export namespace ProjectEditParams { */ services?: { [key: string]: Production.Services | null } | null; - /** - * @deprecated All new projects now use the Standard usage model. - */ - usage_model?: 'standard' | 'bundled' | 'unbound'; - /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; - - /** - * Hash of the Wrangler configuration used for the deployment. - */ - wrangler_config_hash?: string; } export namespace Production { @@ -2548,16 +2158,6 @@ export namespace ProjectEditParams { namespace_id?: string; } - /** - * Limits for Pages Functions. - */ - export interface Limits { - /** - * CPU time limit in milliseconds. - */ - cpu_ms?: number; - } - /** * mTLS binding. */ @@ -2632,74 +2232,31 @@ export namespace ProjectEditParams { export interface Source { config?: Source.Config; - /** - * The source control management provider. - */ - type?: 'github' | 'gitlab'; + type?: string; } export namespace Source { export interface Config { - /** - * @deprecated Use `production_deployments_enabled` and - * `preview_deployment_setting` for more granular control. - */ deployments_enabled?: boolean; - /** - * The owner of the repository. - */ owner?: string; - /** - * A list of paths that should be excluded from triggering a preview deployment. - * Wildcard syntax (`*`) is supported. - */ path_excludes?: Array; - /** - * A list of paths that should be watched to trigger a preview deployment. Wildcard - * syntax (`*`) is supported. - */ path_includes?: Array; - /** - * Whether to enable PR comments. - */ pr_comments_enabled?: boolean; - /** - * A list of branches that should not trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_excludes?: Array; - /** - * A list of branches that should trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_includes?: Array; - /** - * Controls whether commits to preview branches trigger a preview deployment. - */ preview_deployment_setting?: 'all' | 'none' | 'custom'; - /** - * The production branch of the repository. - */ production_branch?: string; - /** - * Whether to trigger a production deployment on commits to the production branch. - */ production_deployments_enabled?: boolean; - /** - * The name of the repository. - */ repo_name?: string; } } diff --git a/src/resources/pipelines.ts b/src/resources/pipelines.ts index cfc4b0add9..02e40368e4 100644 --- a/src/resources/pipelines.ts +++ b/src/resources/pipelines.ts @@ -5,10 +5,29 @@ import * as Core from '../core'; export class Pipelines extends APIResource { /** - * [DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint - * instead. + * Create a new pipeline. * - * @deprecated + * @example + * ```ts + * const pipeline = await client.pipelines.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * destination: { + * batch: {}, + * compression: {}, + * credentials: { + * access_key_id: '', + * endpoint: + * 'https://123f8a8258064ed892a347f173372359.r2.cloudflarestorage.com', + * secret_access_key: '', + * }, + * format: 'json', + * path: { bucket: 'bucket' }, + * type: 'r2', + * }, + * name: 'sample_pipeline', + * source: [{ format: 'json', type: 'type' }], + * }); + * ``` */ create( params: PipelineCreateParams, @@ -23,10 +42,26 @@ export class Pipelines extends APIResource { } /** - * [DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines - * endpoint instead. + * Update an existing pipeline. * - * @deprecated + * @example + * ```ts + * const pipeline = await client.pipelines.update( + * 'sample_pipeline', + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * destination: { + * batch: {}, + * compression: {}, + * format: 'json', + * path: { bucket: 'bucket' }, + * type: 'r2', + * }, + * name: 'sample_pipeline', + * source: [{ format: 'json', type: 'type' }], + * }, + * ); + * ``` */ update( pipelineName: string, @@ -43,10 +78,14 @@ export class Pipelines extends APIResource { } /** - * [DEPRECATED] List, filter, and paginate pipelines in an account. Use the new - * /pipelines/v1/pipelines endpoint instead. + * List, filter, and paginate pipelines in an account. * - * @deprecated + * @example + * ```ts + * const pipelines = await client.pipelines.list({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ list(params: PipelineListParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...query } = params; @@ -54,10 +93,14 @@ export class Pipelines extends APIResource { } /** - * [DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint - * instead. + * Delete a pipeline. * - * @deprecated + * @example + * ```ts + * await client.pipelines.delete('sample_pipeline', { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ delete( pipelineName: string, @@ -72,10 +115,15 @@ export class Pipelines extends APIResource { } /** - * [DEPRECATED] Get configuration of a pipeline. Use the new - * /pipelines/v1/pipelines endpoint instead. + * Get configuration of a pipeline. * - * @deprecated + * @example + * ```ts + * const pipeline = await client.pipelines.get( + * 'sample_pipeline', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ get( pipelineName: string, @@ -92,8 +140,7 @@ export class Pipelines extends APIResource { } /** - * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new - * streams/sinks/pipelines API instead. + * Describes the configuration of a pipeline. */ export interface PipelineCreateResponse { /** @@ -191,10 +238,6 @@ export namespace PipelineCreateResponse { } } - /** - * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API - * instead. - */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -220,10 +263,6 @@ export namespace PipelineCreateResponse { } } - /** - * @deprecated [DEPRECATED] Worker binding source configuration. Use the new - * streams API instead. - */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -235,8 +274,7 @@ export namespace PipelineCreateResponse { } /** - * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new - * streams/sinks/pipelines API instead. + * Describes the configuration of a pipeline. */ export interface PipelineUpdateResponse { /** @@ -334,10 +372,6 @@ export namespace PipelineUpdateResponse { } } - /** - * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API - * instead. - */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -363,10 +397,6 @@ export namespace PipelineUpdateResponse { } } - /** - * @deprecated [DEPRECATED] Worker binding source configuration. Use the new - * streams API instead. - */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -412,8 +442,7 @@ export namespace PipelineListResponse { } /** - * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new - * streams/sinks/pipelines API instead. + * Describes the configuration of a pipeline. */ export interface Result { /** @@ -511,10 +540,6 @@ export namespace PipelineListResponse { } } - /** - * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API - * instead. - */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -540,10 +565,6 @@ export namespace PipelineListResponse { } } - /** - * @deprecated [DEPRECATED] Worker binding source configuration. Use the new - * streams API instead. - */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -556,8 +577,7 @@ export namespace PipelineListResponse { } /** - * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new - * streams/sinks/pipelines API instead. + * Describes the configuration of a pipeline. */ export interface PipelineGetResponse { /** @@ -655,10 +675,6 @@ export namespace PipelineGetResponse { } } - /** - * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API - * instead. - */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -684,10 +700,6 @@ export namespace PipelineGetResponse { } } - /** - * @deprecated [DEPRECATED] Worker binding source configuration. Use the new - * streams API instead. - */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -809,10 +821,6 @@ export namespace PipelineCreateParams { } } - /** - * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API - * instead. - */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -838,10 +846,6 @@ export namespace PipelineCreateParams { } } - /** - * @deprecated [DEPRECATED] Worker binding source configuration. Use the new - * streams API instead. - */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -963,10 +967,6 @@ export namespace PipelineUpdateParams { } } - /** - * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API - * instead. - */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -992,10 +992,6 @@ export namespace PipelineUpdateParams { } } - /** - * @deprecated [DEPRECATED] Worker binding source configuration. Use the new - * streams API instead. - */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. diff --git a/src/resources/queues/consumers.ts b/src/resources/queues/consumers.ts index 93596e00ee..43eae71410 100644 --- a/src/resources/queues/consumers.ts +++ b/src/resources/queues/consumers.ts @@ -106,6 +106,33 @@ export class Consumers extends APIResource { const { account_id } = params; return this._client.delete(`/accounts/${account_id}/queues/${queueId}/consumers/${consumerId}`, options); } + + /** + * Fetches the consumer for a queue by consumer id + * + * @example + * ```ts + * const consumer = await client.queues.consumers.get( + * '023e105f4ecef8ad9ca31a8372d0c353', + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + queueId: string, + consumerId: string, + params: ConsumerGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + 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); + } } export class ConsumersSinglePage extends SinglePage {} @@ -464,6 +491,13 @@ export interface ConsumerDeleteParams { account_id: string; } +export interface ConsumerGetParams { + /** + * A Resource identifier. + */ + account_id: string; +} + Consumers.ConsumersSinglePage = ConsumersSinglePage; export declare namespace Consumers { @@ -475,5 +509,6 @@ export declare namespace Consumers { 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 32568cd469..ebf2923861 100644 --- a/src/resources/queues/index.ts +++ b/src/resources/queues/index.ts @@ -9,15 +9,30 @@ export { type ConsumerUpdateParams, type ConsumerListParams, type ConsumerDeleteParams, + 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'; -export { Subscriptions } from './subscriptions'; +export { + SubscriptionListResponsesV4PagePaginationArray, + Subscriptions, + type SubscriptionCreateResponse, + type SubscriptionUpdateResponse, + type SubscriptionListResponse, + type SubscriptionDeleteResponse, + type SubscriptionCreateParams, + type SubscriptionUpdateParams, + type SubscriptionListParams, + type SubscriptionDeleteParams, +} from './subscriptions'; 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 15d1651711..667ab7a44a 100644 --- a/src/resources/queues/queues.ts +++ b/src/resources/queues/queues.ts @@ -9,6 +9,7 @@ import { ConsumerCreateParams, ConsumerDeleteParams, ConsumerDeleteResponse, + ConsumerGetParams, ConsumerListParams, ConsumerUpdateParams, Consumers, @@ -18,15 +19,29 @@ import * as MessagesAPI from './messages'; import { MessageAckParams, MessageAckResponse, + MessageBulkPushParams, + MessageBulkPushResponse, MessagePullParams, MessagePullResponse, - MessagePullResponsesSinglePage, + MessagePushParams, + MessagePushResponse, Messages, } from './messages'; import * as PurgeAPI from './purge'; import { Purge, PurgeStartParams, PurgeStatusParams, PurgeStatusResponse } from './purge'; import * as SubscriptionsAPI from './subscriptions'; -import { Subscriptions } from './subscriptions'; +import { + SubscriptionCreateParams, + SubscriptionCreateResponse, + SubscriptionDeleteParams, + SubscriptionDeleteResponse, + SubscriptionListParams, + SubscriptionListResponse, + SubscriptionListResponsesV4PagePaginationArray, + SubscriptionUpdateParams, + SubscriptionUpdateResponse, + Subscriptions, +} from './subscriptions'; import { SinglePage } from '../../pagination'; export class Queues extends APIResource { @@ -328,11 +343,11 @@ export interface QueueGetParams { Queues.QueuesSinglePage = QueuesSinglePage; Queues.Messages = Messages; -Queues.MessagePullResponsesSinglePage = MessagePullResponsesSinglePage; Queues.Purge = Purge; Queues.Consumers = Consumers; Queues.ConsumersSinglePage = ConsumersSinglePage; Queues.Subscriptions = Subscriptions; +Queues.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; export declare namespace Queues { export { @@ -350,10 +365,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 { @@ -372,7 +390,19 @@ export declare namespace Queues { type ConsumerUpdateParams as ConsumerUpdateParams, type ConsumerListParams as ConsumerListParams, type ConsumerDeleteParams as ConsumerDeleteParams, + type ConsumerGetParams as ConsumerGetParams, }; - export { Subscriptions as Subscriptions }; + export { + Subscriptions as Subscriptions, + type SubscriptionCreateResponse as SubscriptionCreateResponse, + type SubscriptionUpdateResponse as SubscriptionUpdateResponse, + type SubscriptionListResponse as SubscriptionListResponse, + type SubscriptionDeleteResponse as SubscriptionDeleteResponse, + SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, + type SubscriptionCreateParams as SubscriptionCreateParams, + type SubscriptionUpdateParams as SubscriptionUpdateParams, + type SubscriptionListParams as SubscriptionListParams, + type SubscriptionDeleteParams as SubscriptionDeleteParams, + }; } diff --git a/src/resources/queues/subscriptions.ts b/src/resources/queues/subscriptions.ts index 42d6ea9ea6..3bb405e3fc 100644 --- a/src/resources/queues/subscriptions.ts +++ b/src/resources/queues/subscriptions.ts @@ -1,5 +1,874 @@ // 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 Subscriptions extends APIResource {} +export class Subscriptions extends APIResource { + /** + * Create a new event subscription for a queue + * + * @example + * ```ts + * const subscription = + * await client.queues.subscriptions.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create( + params: SubscriptionCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/event_subscriptions/subscriptions`, { + body, + ...options, + }) as Core.APIPromise<{ result: SubscriptionCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update an existing event subscription + * + * @example + * ```ts + * const subscription = + * await client.queues.subscriptions.update( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + update( + subscriptionId: string, + params: SubscriptionUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.patch(`/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: SubscriptionUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a paginated list of event subscriptions with optional sorting and filtering + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const subscriptionListResponse of client.queues.subscriptions.list( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: SubscriptionListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/event_subscriptions/subscriptions`, + SubscriptionListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Delete an existing event subscription + * + * @example + * ```ts + * const subscription = + * await client.queues.subscriptions.delete( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + subscriptionId: string, + params: SubscriptionDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete( + `/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, + options, + ) as Core.APIPromise<{ result: SubscriptionDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class SubscriptionListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface SubscriptionCreateResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionCreateResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionCreateResponse.MqEventSourceImages + | SubscriptionCreateResponse.MqEventSourceKV + | SubscriptionCreateResponse.MqEventSourceR2 + | SubscriptionCreateResponse.MqEventSourceSuperSlurper + | SubscriptionCreateResponse.MqEventSourceVectorize + | SubscriptionCreateResponse.MqEventSourceWorkersAIModel + | SubscriptionCreateResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionCreateResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionCreateResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionUpdateResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionUpdateResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionUpdateResponse.MqEventSourceImages + | SubscriptionUpdateResponse.MqEventSourceKV + | SubscriptionUpdateResponse.MqEventSourceR2 + | SubscriptionUpdateResponse.MqEventSourceSuperSlurper + | SubscriptionUpdateResponse.MqEventSourceVectorize + | SubscriptionUpdateResponse.MqEventSourceWorkersAIModel + | SubscriptionUpdateResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionUpdateResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionUpdateResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionListResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionListResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionListResponse.MqEventSourceImages + | SubscriptionListResponse.MqEventSourceKV + | SubscriptionListResponse.MqEventSourceR2 + | SubscriptionListResponse.MqEventSourceSuperSlurper + | SubscriptionListResponse.MqEventSourceVectorize + | SubscriptionListResponse.MqEventSourceWorkersAIModel + | SubscriptionListResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionListResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionListResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionDeleteResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionDeleteResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionDeleteResponse.MqEventSourceImages + | SubscriptionDeleteResponse.MqEventSourceKV + | SubscriptionDeleteResponse.MqEventSourceR2 + | SubscriptionDeleteResponse.MqEventSourceSuperSlurper + | SubscriptionDeleteResponse.MqEventSourceVectorize + | SubscriptionDeleteResponse.MqEventSourceWorkersAIModel + | SubscriptionDeleteResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionDeleteResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionDeleteResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionCreateParams { + /** + * Path param: A Resource identifier. + */ + account_id: string; + + /** + * Body param: Destination configuration for the subscription + */ + destination?: SubscriptionCreateParams.Destination; + + /** + * Body param: Whether the subscription is active + */ + enabled?: boolean; + + /** + * Body param: List of event types this subscription handles + */ + events?: Array; + + /** + * Body param: Name of the subscription + */ + name?: string; + + /** + * Body param: Source configuration for the subscription + */ + source?: + | SubscriptionCreateParams.MqEventSourceImages + | SubscriptionCreateParams.MqEventSourceKV + | SubscriptionCreateParams.MqEventSourceR2 + | SubscriptionCreateParams.MqEventSourceSuperSlurper + | SubscriptionCreateParams.MqEventSourceVectorize + | SubscriptionCreateParams.MqEventSourceWorkersAIModel + | SubscriptionCreateParams.MqEventSourceWorkersBuildsWorker + | SubscriptionCreateParams.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionCreateParams { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionUpdateParams { + /** + * Path param: A Resource identifier. + */ + account_id: string; + + /** + * Body param: Destination configuration for the subscription + */ + destination?: SubscriptionUpdateParams.Destination; + + /** + * Body param: Whether the subscription is active + */ + enabled?: boolean; + + /** + * Body param: List of event types this subscription handles + */ + events?: Array; + + /** + * Body param: Name of the subscription + */ + name?: string; +} + +export namespace SubscriptionUpdateParams { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } +} + +export interface SubscriptionListParams extends V4PagePaginationArrayParams { + /** + * Path param: A Resource identifier. + */ + account_id: string; + + /** + * Query param: Sort direction + */ + direction?: 'asc' | 'desc'; + + /** + * Query param: Field to sort by + */ + order?: 'created_at' | 'name' | 'enabled' | 'source'; +} + +export interface SubscriptionDeleteParams { + /** + * A Resource identifier. + */ + account_id: string; +} + +Subscriptions.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; + +export declare namespace Subscriptions { + export { + type SubscriptionCreateResponse as SubscriptionCreateResponse, + type SubscriptionUpdateResponse as SubscriptionUpdateResponse, + type SubscriptionListResponse as SubscriptionListResponse, + type SubscriptionDeleteResponse as SubscriptionDeleteResponse, + SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, + type SubscriptionCreateParams as SubscriptionCreateParams, + type SubscriptionUpdateParams as SubscriptionUpdateParams, + type SubscriptionListParams as SubscriptionListParams, + type SubscriptionDeleteParams as SubscriptionDeleteParams, + }; +} 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..2740494438 100644 --- a/src/resources/workflows/instances/instances.ts +++ b/src/resources/workflows/instances/instances.ts @@ -1,21 +1,429 @@ // 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: `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. + */ + date_end?: string; + + /** + * Query param: Accepts ISO 8601 with no timezone offsets and in UTC. + */ + date_start?: string; + + /** + * Query param: should only be used when `cursor` is used, defines a new direction + * for the cursor + */ + direction?: 'asc' | 'desc'; + + /** + * 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/devices/dex-tests.ts b/src/resources/zero-trust/devices/dex-tests.ts index 024ac99cae..4446969263 100644 --- a/src/resources/zero-trust/devices/dex-tests.ts +++ b/src/resources/zero-trust/devices/dex-tests.ts @@ -13,10 +13,7 @@ export class DEXTests extends APIResource { * const dexTest = * await client.zeroTrust.devices.dexTests.create({ * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: { - * host: 'https://dash.cloudflare.com', - * kind: 'http', - * }, + * data: {}, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -43,10 +40,7 @@ export class DEXTests extends APIResource { * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: { - * host: 'https://dash.cloudflare.com', - * kind: 'http', - * }, + * data: {}, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -277,24 +271,24 @@ export namespace DEXTestCreateResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -357,24 +351,24 @@ export namespace DEXTestUpdateResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -437,24 +431,24 @@ export namespace DEXTestListResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -522,24 +516,24 @@ export namespace DEXTestDeleteResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -603,24 +597,24 @@ export namespace DEXTestGetResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -686,24 +680,24 @@ export namespace DEXTestCreateParams { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -769,24 +763,24 @@ export namespace DEXTestUpdateParams { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default 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/zero-trust/dex/dex.ts b/src/resources/zero-trust/dex/dex.ts index a500404035..f12a3ad01f 100644 --- a/src/resources/zero-trust/dex/dex.ts +++ b/src/resources/zero-trust/dex/dex.ts @@ -29,7 +29,6 @@ import { FleetStatusLiveParams, FleetStatusLiveResponse, FleetStatusOverTimeParams, - FleetStatusOverTimeResponse, LiveStat, } from './fleet-status/fleet-status'; import * as HTTPTestsAPI from './http-tests/http-tests'; @@ -54,9 +53,6 @@ export class DEX extends APIResource { } export interface DigitalExperienceMonitor { - /** - * API Resource UUID tag. - */ id: string; /** @@ -212,7 +208,6 @@ export declare namespace DEX { FleetStatus as FleetStatus, type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, - type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts index 43f7978b75..a64c26da75 100644 --- a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts +++ b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts @@ -44,25 +44,20 @@ export class FleetStatus extends APIResource { * * @example * ```ts - * const response = - * await client.zeroTrust.dex.fleetStatus.overTime({ - * account_id: '01a7362d577a6c3019a474fd6f485823', - * from: '2023-10-11T00:00:00Z', - * to: '2023-10-11T00:00:00Z', - * }); + * await client.zeroTrust.dex.fleetStatus.overTime({ + * account_id: '01a7362d577a6c3019a474fd6f485823', + * from: '2023-10-11T00:00:00Z', + * to: '2023-10-11T00:00:00Z', + * }); * ``` */ - overTime( - params: FleetStatusOverTimeParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + overTime(params: FleetStatusOverTimeParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...query } = params; - return ( - this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { - query, - ...options, - }) as Core.APIPromise<{ result: FleetStatusOverTimeResponse }> - )._thenUnwrap((obj) => obj.result); + return this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { + query, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); } } @@ -98,53 +93,6 @@ export namespace FleetStatusLiveResponse { } } -export interface FleetStatusOverTimeResponse { - deviceStats?: FleetStatusOverTimeResponse.DeviceStats; -} - -export namespace FleetStatusOverTimeResponse { - export interface DeviceStats { - byMode?: Array; - - byStatus?: Array; - - /** - * Number of unique devices - */ - uniqueDevicesTotal?: number; - } - - export namespace DeviceStats { - export interface ByMode { - /** - * Timestamp in ISO format - */ - timestamp?: string; - - /** - * Number of unique devices - */ - uniqueDevicesTotal?: number; - - value?: string; - } - - export interface ByStatus { - /** - * Timestamp in ISO format - */ - timestamp?: string; - - /** - * Number of unique devices - */ - uniqueDevicesTotal?: number; - - value?: string; - } - } -} - export interface FleetStatusLiveParams { /** * Path param: Unique identifier for account @@ -191,7 +139,6 @@ export declare namespace FleetStatus { export { type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, - type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/index.ts b/src/resources/zero-trust/dex/fleet-status/index.ts index 8bf3ee7730..31cdb34bb8 100644 --- a/src/resources/zero-trust/dex/fleet-status/index.ts +++ b/src/resources/zero-trust/dex/fleet-status/index.ts @@ -10,7 +10,6 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, - type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status'; diff --git a/src/resources/zero-trust/dex/index.ts b/src/resources/zero-trust/dex/index.ts index d0f4eae54c..f97aa02d43 100644 --- a/src/resources/zero-trust/dex/index.ts +++ b/src/resources/zero-trust/dex/index.ts @@ -20,7 +20,6 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, - type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status/index'; diff --git a/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts b/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts new file mode 100644 index 0000000000..9bd29bee68 --- /dev/null +++ b/tests/api-resources/cloudforce-one/threat-events/indicator-types.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 indicatorTypes', () => { + // TODO: HTTP 401 from prism + test.skip('list: only required params', async () => { + const responsePromise = client.cloudforceOne.threatEvents.indicatorTypes.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); + }); + + // TODO: HTTP 401 from prism + test.skip('list: required and optional params', async () => { + const response = await client.cloudforceOne.threatEvents.indicatorTypes.list({ + account_id: 'account_id', + }); + }); +}); 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..a543062bc0 100644 --- a/tests/api-resources/kv/namespaces/namespaces.test.ts +++ b/tests/api-resources/kv/namespaces/namespaces.test.ts @@ -69,7 +69,7 @@ describe('resource namespaces', () => { direction: 'asc', order: 'id', page: 1, - per_page: 5, + per_page: 1, }); }); @@ -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..03fbaa4b52 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: {}, }); }); diff --git a/tests/api-resources/leaked-credential-checks/detections.test.ts b/tests/api-resources/leaked-credential-checks/detections.test.ts new file mode 100644 index 0000000000..f9a1af0b8e --- /dev/null +++ b/tests/api-resources/leaked-credential-checks/detections.test.ts @@ -0,0 +1,98 @@ +// 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 detections', () => { + test('create: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.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.leakedCredentialChecks.detections.create({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + password: 'lookup_json_string(http.request.body.raw, "secret")', + username: 'lookup_json_string(http.request.body.raw, "user")', + }); + }); + + test('update: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.update( + '18a14bafaa8eb1df04ce683ec18c765e', + { 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('update: required and optional params', async () => { + const response = await client.leakedCredentialChecks.detections.update( + '18a14bafaa8eb1df04ce683ec18c765e', + { + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + password: 'lookup_json_string(http.request.body.raw, "secret")', + username: 'lookup_json_string(http.request.body.raw, "user")', + }, + ); + }); + + test('list: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.list({ + 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('list: required and optional params', async () => { + const response = await client.leakedCredentialChecks.detections.list({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); + + test('delete: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.delete( + '18a14bafaa8eb1df04ce683ec18c765e', + { 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('delete: required and optional params', async () => { + const response = await client.leakedCredentialChecks.detections.delete( + '18a14bafaa8eb1df04ce683ec18c765e', + { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + }); +}); diff --git a/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts b/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts new file mode 100644 index 0000000000..c7c208f9ed --- /dev/null +++ b/tests/api-resources/leaked-credential-checks/leaked-credential-checks.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 leakedCredentialChecks', () => { + test('create: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.create({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + enabled: true, + }); + }); + + test('get: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + }); +}); 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/pages/projects/deployments/deployments.test.ts b/tests/api-resources/pages/projects/deployments/deployments.test.ts index 67899467e8..41d5114e2a 100644 --- a/tests/api-resources/pages/projects/deployments/deployments.test.ts +++ b/tests/api-resources/pages/projects/deployments/deployments.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Cloudflare, { toFile } from 'cloudflare'; +import Cloudflare from 'cloudflare'; import { Response } from 'node-fetch'; const client = new Cloudflare({ @@ -28,19 +28,7 @@ describe('resource deployments', () => { test.skip('create: required and optional params', async () => { const response = await client.pages.projects.deployments.create('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - _headers: await toFile(Buffer.from('# my file contents'), 'README.md'), - _redirects: await toFile(Buffer.from('# my file contents'), 'README.md'), - '_routes.json': await toFile(Buffer.from('# my file contents'), 'README.md'), - '_worker.bundle': await toFile(Buffer.from('# my file contents'), 'README.md'), - '_worker.js': await toFile(Buffer.from('# my file contents'), 'README.md'), branch: 'staging', - commit_dirty: 'false', - commit_hash: 'a1b2c3d4e5f6', - commit_message: 'Update homepage', - 'functions-filepath-routing-config.json': await toFile(Buffer.from('# my file contents'), 'README.md'), - manifest: '{"index.html": "abc123", "style.css": "def456"}', - pages_build_output_dir: 'dist', - wrangler_config_hash: 'wrangler_config_hash', }); }); diff --git a/tests/api-resources/pages/projects/projects.test.ts b/tests/api-resources/pages/projects/projects.test.ts index 4f2c4122e8..41a92b2403 100644 --- a/tests/api-resources/pages/projects/projects.test.ts +++ b/tests/api-resources/pages/projects/projects.test.ts @@ -11,11 +11,7 @@ const client = new Cloudflare({ describe('resource projects', () => { test('create: only required params', async () => { - const responsePromise = client.pages.projects.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'my-pages-app', - production_branch: 'main', - }); + const responsePromise = client.pages.projects.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -28,8 +24,6 @@ describe('resource projects', () => { test('create: required and optional params', async () => { const response = await client.pages.projects.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'my-pages-app', - production_branch: 'main', build_config: { build_caching: true, build_command: 'npm run build', @@ -41,19 +35,15 @@ describe('resource projects', () => { deployment_configs: { preview: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, - always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - build_image_major_version: 3, - compatibility_date: '2025-01-01', + compatibility_date: '2022-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, - fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, - limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -65,25 +55,19 @@ describe('resource projects', () => { service: 'example-worker', }, }, - usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, - wrangler_config_hash: 'abc123def456', }, production: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, - always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - build_image_major_version: 3, - compatibility_date: '2025-01-01', + compatibility_date: '2022-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, - fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, - limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -95,26 +79,26 @@ describe('resource projects', () => { service: 'example-worker', }, }, - usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, - wrangler_config_hash: 'abc123def456', }, }, + name: 'NextJS Blog', + production_branch: 'main', source: { config: { deployments_enabled: true, - owner: 'my-org', + owner: 'owner', path_excludes: ['string'], path_includes: ['string'], pr_comments_enabled: true, preview_branch_excludes: ['string'], preview_branch_includes: ['string'], preview_deployment_setting: 'all', - production_branch: 'main', + production_branch: 'production_branch', production_deployments_enabled: true, - repo_name: 'my-repo', + repo_name: 'repo_name', }, - type: 'github', + type: 'type', }, }); }); @@ -160,8 +144,6 @@ describe('resource projects', () => { test('edit: only required params', async () => { const responsePromise = client.pages.projects.edit('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'my-pages-app', - production_branch: 'main', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -175,8 +157,6 @@ describe('resource projects', () => { test('edit: required and optional params', async () => { const response = await client.pages.projects.edit('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'my-pages-app', - production_branch: 'main', build_config: { build_caching: true, build_command: 'npm run build', @@ -188,19 +168,15 @@ describe('resource projects', () => { deployment_configs: { preview: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, - always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - build_image_major_version: 3, - compatibility_date: '2025-01-01', + compatibility_date: '2022-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, - fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, - limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -212,25 +188,19 @@ describe('resource projects', () => { service: 'example-worker', }, }, - usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, - wrangler_config_hash: 'abc123def456', }, production: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, - always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - build_image_major_version: 3, - compatibility_date: '2025-01-01', + compatibility_date: '2022-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, - fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, - limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -242,26 +212,26 @@ describe('resource projects', () => { service: 'example-worker', }, }, - usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, - wrangler_config_hash: 'abc123def456', }, }, + name: 'NextJS Blog', + production_branch: 'main', source: { config: { deployments_enabled: true, - owner: 'my-org', + owner: 'owner', path_excludes: ['string'], path_includes: ['string'], pr_comments_enabled: true, preview_branch_excludes: ['string'], preview_branch_includes: ['string'], preview_deployment_setting: 'all', - production_branch: 'main', + production_branch: 'production_branch', production_deployments_enabled: true, - repo_name: 'my-repo', + repo_name: 'repo_name', }, - type: 'github', + type: 'type', }, }); }); diff --git a/tests/api-resources/pipelines.test.ts b/tests/api-resources/pipelines.test.ts index 390a133372..40730e8ec8 100644 --- a/tests/api-resources/pipelines.test.ts +++ b/tests/api-resources/pipelines.test.ts @@ -12,7 +12,7 @@ const client = new Cloudflare({ describe('resource pipelines', () => { test('create: only required params', async () => { const responsePromise = client.pipelines.create({ - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination: { batch: {}, compression: {}, @@ -39,7 +39,7 @@ describe('resource pipelines', () => { test('create: required and optional params', async () => { const response = await client.pipelines.create({ - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination: { batch: { max_bytes: 1000, max_duration_s: 0.25, max_rows: 100 }, compression: { type: 'gzip' }, @@ -64,7 +64,7 @@ describe('resource pipelines', () => { test('update: only required params', async () => { const responsePromise = client.pipelines.update('sample_pipeline', { - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination: { batch: {}, compression: {}, format: 'json', path: { bucket: 'bucket' }, type: 'r2' }, name: 'sample_pipeline', source: [{ format: 'json', type: 'type' }], @@ -80,7 +80,7 @@ describe('resource pipelines', () => { test('update: required and optional params', async () => { const response = await client.pipelines.update('sample_pipeline', { - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination: { batch: { max_bytes: 1000, max_duration_s: 0.25, max_rows: 100 }, compression: { type: 'gzip' }, @@ -104,7 +104,7 @@ describe('resource pipelines', () => { }); test('list: only required params', async () => { - const responsePromise = client.pipelines.list({ account_id: '0123105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = client.pipelines.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -116,7 +116,7 @@ describe('resource pipelines', () => { test('list: required and optional params', async () => { const response = await client.pipelines.list({ - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', page: 'page', per_page: 'per_page', search: 'search', @@ -125,7 +125,7 @@ describe('resource pipelines', () => { test('delete: only required params', async () => { const responsePromise = client.pipelines.delete('sample_pipeline', { - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -138,13 +138,13 @@ describe('resource pipelines', () => { test('delete: required and optional params', async () => { const response = await client.pipelines.delete('sample_pipeline', { - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); test('get: only required params', async () => { const responsePromise = client.pipelines.get('sample_pipeline', { - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -157,7 +157,7 @@ describe('resource pipelines', () => { test('get: required and optional params', async () => { const response = await client.pipelines.get('sample_pipeline', { - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); }); diff --git a/tests/api-resources/queues/consumers.test.ts b/tests/api-resources/queues/consumers.test.ts index 9cff12967c..e4275cc8e0 100644 --- a/tests/api-resources/queues/consumers.test.ts +++ b/tests/api-resources/queues/consumers.test.ts @@ -115,4 +115,27 @@ describe('resource consumers', () => { { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); }); + + test('get: only required params', async () => { + const responsePromise = client.queues.consumers.get( + '023e105f4ecef8ad9ca31a8372d0c353', + '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('get: required and optional params', async () => { + const response = await client.queues.consumers.get( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + }); }); 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/queues/subscriptions.test.ts b/tests/api-resources/queues/subscriptions.test.ts new file mode 100644 index 0000000000..fed29a3ae9 --- /dev/null +++ b/tests/api-resources/queues/subscriptions.test.ts @@ -0,0 +1,101 @@ +// 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 subscriptions', () => { + test('create: only required params', async () => { + const responsePromise = client.queues.subscriptions.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.queues.subscriptions.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + destination: { queue_id: 'queue_id', type: 'queues.queue' }, + enabled: true, + events: ['string'], + name: 'name', + source: { type: 'images' }, + }); + }); + + test('update: only required params', async () => { + const responsePromise = client.queues.subscriptions.update('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('update: required and optional params', async () => { + const response = await client.queues.subscriptions.update('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + destination: { queue_id: 'queue_id', type: 'queues.queue' }, + enabled: true, + events: ['string'], + name: 'name', + }); + }); + + test('list: only required params', async () => { + const responsePromise = client.queues.subscriptions.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.queues.subscriptions.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + direction: 'asc', + order: 'created_at', + page: 1, + per_page: 1, + }); + }); + + test('delete: only required params', async () => { + const responsePromise = client.queues.subscriptions.delete('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('delete: required and optional params', async () => { + const response = await client.queues.subscriptions.delete('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); +}); 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..cdad8d0e4b --- /dev/null +++ b/tests/api-resources/workflows/instances/instances.test.ts @@ -0,0 +1,89 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource 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', + cursor: 'cursor', + date_end: '2019-12-27T18:11:19.117Z', + date_start: '2019-12-27T18:11:19.117Z', + direction: 'asc', + 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' }); + }); +}); diff --git a/tests/api-resources/zero-trust/devices/dex-tests.test.ts b/tests/api-resources/zero-trust/devices/dex-tests.test.ts index 0669d5569c..246e9b7961 100644 --- a/tests/api-resources/zero-trust/devices/dex-tests.test.ts +++ b/tests/api-resources/zero-trust/devices/dex-tests.test.ts @@ -13,7 +13,7 @@ describe('resource dexTests', () => { test('create: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.create({ account_id: '01a7362d577a6c3019a474fd6f485823', - data: { host: 'https://dash.cloudflare.com', kind: 'http' }, + data: {}, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -35,7 +35,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], + target_policies: [{ id: 'id', default: true, name: 'name' }], targeted: true, }); }); @@ -43,7 +43,7 @@ describe('resource dexTests', () => { test('update: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', - data: { host: 'https://dash.cloudflare.com', kind: 'http' }, + data: {}, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -65,7 +65,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], + target_policies: [{ id: 'id', default: true, name: 'name' }], targeted: true, }); }); From b7a239c11d66f56ecdba16ec93575f9593a195e8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 07:43:41 +0000 Subject: [PATCH 071/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0a983f097f..e85558a5ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7492bc33f84221ee63fe654c22680333788bfd2dfe8985c58f9d3db555ffca2b.yml -openapi_spec_hash: b454db8aa8af2160a780a5b69445f3a4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-64a0a0c78734f870d795ec5bc318b859c93d7b2386856a83c90fcc8253c8ad9e.yml +openapi_spec_hash: e790c85f21ceac040c01c34eafcf9e81 config_hash: 107e0f1f8a98b007260b319226b88b3c From aed9bfcf271c229c294e21cf13533b101c47e95d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 08:21:08 +0000 Subject: [PATCH 072/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e85558a5ef..187b4bb0aa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-64a0a0c78734f870d795ec5bc318b859c93d7b2386856a83c90fcc8253c8ad9e.yml -openapi_spec_hash: e790c85f21ceac040c01c34eafcf9e81 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-061dca97d9f21d12a17fb835cf525251ce3fef4696bafc030eeb38c1d1b29d98.yml +openapi_spec_hash: eb1e607bf082bbd6554c010859c538cc config_hash: 107e0f1f8a98b007260b319226b88b3c From 3520e34f37818a5b4bda2893cb11ca83a35ce10f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 08:26:16 +0000 Subject: [PATCH 073/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 187b4bb0aa..2b95ac2fe1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-061dca97d9f21d12a17fb835cf525251ce3fef4696bafc030eeb38c1d1b29d98.yml -openapi_spec_hash: eb1e607bf082bbd6554c010859c538cc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f3bdad647c2632923da769367c580bb650ef4f18a8f1f6d4a911e95018a3e015.yml +openapi_spec_hash: ce8cc9d02a08c4ab56d5ec624334b32f config_hash: 107e0f1f8a98b007260b319226b88b3c From f1cf9d650f90ace5d073477ddf561b9933097429 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 08:28:09 +0000 Subject: [PATCH 074/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2b95ac2fe1..c8c7459ad5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f3bdad647c2632923da769367c580bb650ef4f18a8f1f6d4a911e95018a3e015.yml -openapi_spec_hash: ce8cc9d02a08c4ab56d5ec624334b32f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c07b0fcf287cfb1058c325f9e90cf4c0cfd317daea3a695f1a6c99b586318bde.yml +openapi_spec_hash: 030e0f20374ccdf6f2ba3ace9579678c config_hash: 107e0f1f8a98b007260b319226b88b3c From 6b049f58fe725bed4923426fdedf32698e5b906f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 09:08:56 +0000 Subject: [PATCH 075/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index c8c7459ad5..187b4bb0aa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c07b0fcf287cfb1058c325f9e90cf4c0cfd317daea3a695f1a6c99b586318bde.yml -openapi_spec_hash: 030e0f20374ccdf6f2ba3ace9579678c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-061dca97d9f21d12a17fb835cf525251ce3fef4696bafc030eeb38c1d1b29d98.yml +openapi_spec_hash: eb1e607bf082bbd6554c010859c538cc config_hash: 107e0f1f8a98b007260b319226b88b3c From 9640c5c48117c51cfe9e0cf4488b76af8b79860c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 13:05:37 +0000 Subject: [PATCH 076/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 187b4bb0aa..044e0ee3f4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-061dca97d9f21d12a17fb835cf525251ce3fef4696bafc030eeb38c1d1b29d98.yml -openapi_spec_hash: eb1e607bf082bbd6554c010859c538cc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-34fac9517dafa7a70a3de8f59b8fbff204199eb3c136ad1d375f5ef158f87d90.yml +openapi_spec_hash: 6a915873baf7fcdca625c90909492e28 config_hash: 107e0f1f8a98b007260b319226b88b3c From 0f5f8ba2f1bdbdee8f973f2f1805abcb70bf4b4b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 13:07:33 +0000 Subject: [PATCH 077/451] chore(api): update composite API spec --- .stats.yml | 4 ++-- src/resources/alerting/policies.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 044e0ee3f4..a59efef33d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-34fac9517dafa7a70a3de8f59b8fbff204199eb3c136ad1d375f5ef158f87d90.yml -openapi_spec_hash: 6a915873baf7fcdca625c90909492e28 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7016e83aabf7646a81ac5ee22178d062ad96ad78cba4d0051dbe5962154b3df8.yml +openapi_spec_hash: cfaf36e9bd5a4d71172862f4c24a9474 config_hash: 107e0f1f8a98b007260b319226b88b3c diff --git a/src/resources/alerting/policies.ts b/src/resources/alerting/policies.ts index 5991ca0862..37e36bd09d 100644 --- a/src/resources/alerting/policies.ts +++ b/src/resources/alerting/policies.ts @@ -211,6 +211,7 @@ export interface Policy { * possible values. */ alert_type?: + | 'abuse_report_alert' | 'access_custom_certificate_expiration_type' | 'advanced_ddos_attack_l4_alert' | 'advanced_ddos_attack_l7_alert' @@ -825,6 +826,7 @@ export interface PolicyCreateParams { * possible values. */ alert_type: + | 'abuse_report_alert' | 'access_custom_certificate_expiration_type' | 'advanced_ddos_attack_l4_alert' | 'advanced_ddos_attack_l7_alert' @@ -946,6 +948,7 @@ export interface PolicyUpdateParams { * possible values. */ alert_type?: + | 'abuse_report_alert' | 'access_custom_certificate_expiration_type' | 'advanced_ddos_attack_l4_alert' | 'advanced_ddos_attack_l7_alert' From 89882ad8879e8a98220aa99f57d3f443200e2293 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 14:28:08 +0000 Subject: [PATCH 078/451] chore(api): update composite API spec --- .stats.yml | 4 ++-- src/resources/alerting/policies.ts | 10 ++++++++++ tests/api-resources/alerting/policies.test.ts | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a59efef33d..cd9d81c17a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7016e83aabf7646a81ac5ee22178d062ad96ad78cba4d0051dbe5962154b3df8.yml -openapi_spec_hash: cfaf36e9bd5a4d71172862f4c24a9474 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b617f9718d3ccc35e9466e0b4c12e206c9d4340dbdb9a7cbb713251a98515298.yml +openapi_spec_hash: d787bb73f0ed8c3ac73aa92921564b52 config_hash: 107e0f1f8a98b007260b319226b88b3c diff --git a/src/resources/alerting/policies.ts b/src/resources/alerting/policies.ts index 37e36bd09d..7e22a6cc36 100644 --- a/src/resources/alerting/policies.ts +++ b/src/resources/alerting/policies.ts @@ -521,6 +521,11 @@ export interface PolicyFilter { */ tunnel_name?: Array; + /** + * Usage depends on specific alert type + */ + type?: Array; + /** * Usage depends on specific alert type */ @@ -740,6 +745,11 @@ export interface PolicyFilterParam { */ tunnel_name?: Array; + /** + * Usage depends on specific alert type + */ + type?: Array; + /** * Usage depends on specific alert type */ diff --git a/tests/api-resources/alerting/policies.test.ts b/tests/api-resources/alerting/policies.test.ts index 3de56f13b7..c3b23203ae 100644 --- a/tests/api-resources/alerting/policies.test.ts +++ b/tests/api-resources/alerting/policies.test.ts @@ -83,6 +83,7 @@ describe('resource policies', () => { traffic_exclusions: ['security_events'], tunnel_id: ['string'], tunnel_name: ['string'], + type: ['string'], where: ['string'], zones: ['string'], }, @@ -152,6 +153,7 @@ describe('resource policies', () => { traffic_exclusions: ['security_events'], tunnel_id: ['string'], tunnel_name: ['string'], + type: ['string'], where: ['string'], zones: ['string'], }, From e5f04eca681079ca7a648f7cecb778a2b21ad7cb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 14:30:05 +0000 Subject: [PATCH 079/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index cd9d81c17a..ef7976545b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b617f9718d3ccc35e9466e0b4c12e206c9d4340dbdb9a7cbb713251a98515298.yml -openapi_spec_hash: d787bb73f0ed8c3ac73aa92921564b52 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aaee1d5b51dac4aa7a1c074c83af954dcec808c01f281280d9e79848fc969289.yml +openapi_spec_hash: 961de01fadaf3be07982f960ee5cd5ea config_hash: 107e0f1f8a98b007260b319226b88b3c From b58e72609a0e64f3dc2bd35a153acfc30254edab Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:10:26 +0000 Subject: [PATCH 080/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ef7976545b..309bad929e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aaee1d5b51dac4aa7a1c074c83af954dcec808c01f281280d9e79848fc969289.yml -openapi_spec_hash: 961de01fadaf3be07982f960ee5cd5ea +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b1986b8c38d24848187e7cc222a4e2ef42eec9e968a58ec04ccffbea8a608e59.yml +openapi_spec_hash: 1304175dd0a596b7fcbeac9717752d90 config_hash: 107e0f1f8a98b007260b319226b88b3c From 9dc14454dc1018f2b9240fb0f0c7d9cc17fa0081 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:25:52 +0000 Subject: [PATCH 081/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 309bad929e..7cfaa8faca 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b1986b8c38d24848187e7cc222a4e2ef42eec9e968a58ec04ccffbea8a608e59.yml -openapi_spec_hash: 1304175dd0a596b7fcbeac9717752d90 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-deefdb9c2892d421b7393442a5cf71f174c57f7658c35d007f05f2d155596d76.yml +openapi_spec_hash: 812343cb7c70c93898bd80cc043c8981 config_hash: 107e0f1f8a98b007260b319226b88b3c From 0466220f98aa5c8786782ec84a213d9a21a9c538 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:27:34 +0000 Subject: [PATCH 082/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7cfaa8faca..ef7976545b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-deefdb9c2892d421b7393442a5cf71f174c57f7658c35d007f05f2d155596d76.yml -openapi_spec_hash: 812343cb7c70c93898bd80cc043c8981 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aaee1d5b51dac4aa7a1c074c83af954dcec808c01f281280d9e79848fc969289.yml +openapi_spec_hash: 961de01fadaf3be07982f960ee5cd5ea config_hash: 107e0f1f8a98b007260b319226b88b3c From e4bdac3068961feea9d68620a34d26eac74652a4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:48:26 +0000 Subject: [PATCH 083/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ef7976545b..5762773fe7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aaee1d5b51dac4aa7a1c074c83af954dcec808c01f281280d9e79848fc969289.yml -openapi_spec_hash: 961de01fadaf3be07982f960ee5cd5ea +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f2298b15a4fa09928c85a0fc811f4cb003ce280c646021c3cb352d63824637fc.yml +openapi_spec_hash: 274a74e8f4a8c52e46bf7aea0216c576 config_hash: 107e0f1f8a98b007260b319226b88b3c From ccbd4590d5ad80ea63677a6804d5d39b5f6c1c75 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:57:55 +0000 Subject: [PATCH 084/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5762773fe7..8a6571e950 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f2298b15a4fa09928c85a0fc811f4cb003ce280c646021c3cb352d63824637fc.yml -openapi_spec_hash: 274a74e8f4a8c52e46bf7aea0216c576 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4dddcb5c3bb1473a7da1238371bb6e55573fb566c3139e8836c6ae00fdc85268.yml +openapi_spec_hash: 2a23f9b76b4569603886573348384d37 config_hash: 107e0f1f8a98b007260b319226b88b3c From 38f45fe75ad1510e3bab765495c53358a0ea4452 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:59:46 +0000 Subject: [PATCH 085/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8a6571e950..61a782507d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4dddcb5c3bb1473a7da1238371bb6e55573fb566c3139e8836c6ae00fdc85268.yml -openapi_spec_hash: 2a23f9b76b4569603886573348384d37 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cd42822d8c4b8cd225bd3fcca8d4e66bac3a281c61c9e55585b1f83305008a3e.yml +openapi_spec_hash: a1632cdab2c8b169d327c3b95ffb4412 config_hash: 107e0f1f8a98b007260b319226b88b3c From e7af982d60168603ad0658c9e0495e1dbd0a90d2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 16:01:46 +0000 Subject: [PATCH 086/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 61a782507d..f00c283b4d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cd42822d8c4b8cd225bd3fcca8d4e66bac3a281c61c9e55585b1f83305008a3e.yml -openapi_spec_hash: a1632cdab2c8b169d327c3b95ffb4412 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-08cb2774b4da40ee1c80957dd5c7d7ab2fecd8652adbfd101af54b1b32fa4494.yml +openapi_spec_hash: 53274fa330f70a5df4364f397444851f config_hash: 107e0f1f8a98b007260b319226b88b3c From ac17b6d9f50e0bb1f6d325fc098fcbd80b7ea822 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 17:37:04 +0000 Subject: [PATCH 087/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f00c283b4d..34ade57df3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-08cb2774b4da40ee1c80957dd5c7d7ab2fecd8652adbfd101af54b1b32fa4494.yml -openapi_spec_hash: 53274fa330f70a5df4364f397444851f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-364e82d04f2db71562ccbe52f3b385f555401812d30e64fd5186838a3c13c916.yml +openapi_spec_hash: 4ca50c87c74fcd72837af2715a73332f config_hash: 107e0f1f8a98b007260b319226b88b3c From c31cafa64d176c86e058b75d15d0acb7f92e3b40 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 17:47:32 +0000 Subject: [PATCH 088/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 34ade57df3..1a151bca80 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-364e82d04f2db71562ccbe52f3b385f555401812d30e64fd5186838a3c13c916.yml -openapi_spec_hash: 4ca50c87c74fcd72837af2715a73332f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c9472ef3c00e81494197d6f2c75d017dfcd5e05157d58f58dd6627771296e92e.yml +openapi_spec_hash: ac68da9645adad028beae1f96328f5bd config_hash: 107e0f1f8a98b007260b319226b88b3c From 4b07bae10e9580f7cf3b29e763409dd699dd6303 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 17:59:06 +0000 Subject: [PATCH 089/451] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 174 +- scripts/detect-breaking-changes | 19 - .../cloudforce-one/threat-events/index.ts | 6 +- .../threat-events/indicator-types.ts | 48 +- .../threat-events/threat-events.ts | 8 +- src/resources/custom-pages.ts | 48 +- .../email-security/investigate/investigate.ts | 46 + 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 | 139 +- src/resources/kv/namespaces/metadata.ts | 4 +- src/resources/kv/namespaces/namespaces.ts | 164 +- src/resources/kv/namespaces/values.ts | 33 +- .../leaked-credential-checks/detections.ts | 240 +-- .../leaked-credential-checks/index.ts | 13 +- .../leaked-credential-checks.ts | 121 +- 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 +- .../pages/projects/deployments/deployments.ts | 66 + src/resources/pages/projects/projects.ts | 547 +++++- src/resources/pipelines.ts | 138 +- src/resources/queues/consumers.ts | 35 - src/resources/queues/index.ts | 19 +- src/resources/queues/messages.ts | 217 +-- src/resources/queues/queues.ts | 40 +- src/resources/queues/subscriptions.ts | 871 +--------- 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 | 416 +---- src/resources/workflows/instances/status.ts | 54 +- src/resources/workflows/versions.ts | 87 +- src/resources/workflows/workflows.ts | 274 +-- src/resources/zero-trust/devices/dex-tests.ts | 80 +- src/resources/zero-trust/dex/colos.ts | 17 +- src/resources/zero-trust/dex/dex.ts | 5 + .../dex/fleet-status/fleet-status.ts | 75 +- .../zero-trust/dex/fleet-status/index.ts | 1 + src/resources/zero-trust/dex/index.ts | 1 + .../threat-events/indicator-types.test.ts | 33 - .../api-resources/kv/namespaces/keys.test.ts | 31 +- .../kv/namespaces/namespaces.test.ts | 33 +- .../kv/namespaces/values.test.ts | 3 +- .../detections.test.ts | 98 -- .../leaked-credential-checks.test.ts | 49 - .../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 - .../projects/deployments/deployments.test.ts | 14 +- .../pages/projects/projects.test.ts | 64 +- tests/api-resources/pipelines.test.ts | 20 +- tests/api-resources/queues/consumers.test.ts | 23 - tests/api-resources/queues/messages.test.ts | 43 - .../queues/subscriptions.test.ts | 101 -- .../workers/observability/telemetry.test.ts | 110 -- .../workflows/instances/events.test.ts | 32 - .../workflows/instances/instances.test.ts | 89 - .../workflows/instances/status.test.ts | 33 - .../api-resources/workflows/versions.test.ts | 50 - .../api-resources/workflows/workflows.test.ts | 85 - .../zero-trust/devices/dex-tests.test.ts | 8 +- 78 files changed, 1099 insertions(+), 6202 deletions(-) delete mode 100644 tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts delete mode 100644 tests/api-resources/leaked-credential-checks/detections.test.ts delete mode 100644 tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts 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/queues/subscriptions.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 1a151bca80..42f665eaa2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c9472ef3c00e81494197d6f2c75d017dfcd5e05157d58f58dd6627771296e92e.yml -openapi_spec_hash: ac68da9645adad028beae1f96328f5bd +configured_endpoints: 1784 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cceecd20dfd89884f795e75b433848994bed610b79802c65104f0c70d3ada54e.yml +openapi_spec_hash: c33c0e26e48c004c1781a36748d0144c config_hash: 107e0f1f8a98b007260b319226b88b3c diff --git a/api.md b/api.md index 866462c86c..4df6e7455e 100644 --- a/api.md +++ b/api.md @@ -1715,61 +1715,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: @@ -2259,18 +2214,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 @@ -2278,19 +2221,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 @@ -2300,14 +2242,12 @@ Types: - Key - KeyBulkDeleteResponse -- KeyBulkGetResponse - KeyBulkUpdateResponse Methods: - 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 ### Metadata @@ -2376,16 +2316,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 @@ -2411,24 +2347,9 @@ Methods: - 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 ## Subscriptions -Types: - -- SubscriptionCreateResponse -- SubscriptionUpdateResponse -- SubscriptionListResponse -- SubscriptionDeleteResponse - -Methods: - -- client.queues.subscriptions.create({ ...params }) -> SubscriptionCreateResponse -- client.queues.subscriptions.update(subscriptionId, { ...params }) -> SubscriptionUpdateResponse -- client.queues.subscriptions.list({ ...params }) -> SubscriptionListResponsesV4PagePaginationArray -- client.queues.subscriptions.delete(subscriptionId, { ...params }) -> SubscriptionDeleteResponse - # APIGateway ## Configurations @@ -5482,11 +5403,12 @@ Types: - LiveStat - FleetStatusLiveResponse +- FleetStatusOverTimeResponse Methods: - client.zeroTrust.dex.fleetStatus.live({ ...params }) -> FleetStatusLiveResponse -- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> void +- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> FleetStatusOverTimeResponse #### Devices @@ -8083,14 +8005,6 @@ Methods: ### IndicatorTypes -Types: - -- IndicatorTypeListResponse - -Methods: - -- client.cloudforceOne.threatEvents.indicatorTypes.list({ ...params }) -> IndicatorTypeListResponse - ### Raw Types: @@ -8363,68 +8277,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: @@ -8479,32 +8339,8 @@ Methods: # LeakedCredentialChecks -Types: - -- LeakedCredentialCheckCreateResponse -- LeakedCredentialCheckGetResponse - -Methods: - -- client.leakedCredentialChecks.create({ ...params }) -> LeakedCredentialCheckCreateResponse -- client.leakedCredentialChecks.get({ ...params }) -> LeakedCredentialCheckGetResponse - ## Detections -Types: - -- DetectionCreateResponse -- DetectionUpdateResponse -- DetectionListResponse -- DetectionDeleteResponse - -Methods: - -- client.leakedCredentialChecks.detections.create({ ...params }) -> DetectionCreateResponse -- client.leakedCredentialChecks.detections.update(detectionId, { ...params }) -> DetectionUpdateResponse -- client.leakedCredentialChecks.detections.list({ ...params }) -> DetectionListResponsesSinglePage -- client.leakedCredentialChecks.detections.delete(detectionId, { ...params }) -> DetectionDeleteResponse - # ContentScanning Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 4580a22d2d..8c8c3ce4bf 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -143,14 +143,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 @@ -191,8 +183,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 @@ -205,7 +195,6 @@ TEST_PATHS=( tests/api-resources/queues/messages.test.ts tests/api-resources/queues/purge.test.ts tests/api-resources/queues/consumers.test.ts - tests/api-resources/queues/subscriptions.test.ts tests/api-resources/api-gateway/api-gateway.test.ts tests/api-resources/api-gateway/configurations.test.ts tests/api-resources/api-gateway/discovery/discovery.test.ts @@ -684,7 +673,6 @@ TEST_PATHS=( tests/api-resources/cloudforce-one/threat-events/categories.test.ts tests/api-resources/cloudforce-one/threat-events/countries.test.ts tests/api-resources/cloudforce-one/threat-events/datasets/datasets.test.ts - tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts tests/api-resources/cloudforce-one/threat-events/raw.test.ts tests/api-resources/cloudforce-one/threat-events/relate.test.ts tests/api-resources/cloudforce-one/threat-events/tags.test.ts @@ -708,16 +696,9 @@ 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 - tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts - tests/api-resources/leaked-credential-checks/detections.test.ts tests/api-resources/content-scanning/content-scanning.test.ts tests/api-resources/content-scanning/payloads.test.ts tests/api-resources/content-scanning/settings.test.ts diff --git a/src/resources/cloudforce-one/threat-events/index.ts b/src/resources/cloudforce-one/threat-events/index.ts index 02c8bab160..d797682ddd 100644 --- a/src/resources/cloudforce-one/threat-events/index.ts +++ b/src/resources/cloudforce-one/threat-events/index.ts @@ -36,11 +36,7 @@ export { type EventTagCreateParams, type EventTagDeleteParams, } from './event-tags'; -export { - IndicatorTypes, - type IndicatorTypeListResponse, - type IndicatorTypeListParams, -} from './indicator-types'; +export { IndicatorTypes } from './indicator-types'; export { Insights } from './insights'; export { Raw, type RawEditResponse, type RawGetResponse, type RawEditParams, type RawGetParams } from './raw'; export { Relate, type RelateDeleteResponse, type RelateDeleteParams } from './relate'; diff --git a/src/resources/cloudforce-one/threat-events/indicator-types.ts b/src/resources/cloudforce-one/threat-events/indicator-types.ts index 7fa1b77a16..99e5ccc453 100644 --- a/src/resources/cloudforce-one/threat-events/indicator-types.ts +++ b/src/resources/cloudforce-one/threat-events/indicator-types.ts @@ -1,51 +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 IndicatorTypes extends APIResource { - /** - * Lists all indicator types - * - * @example - * ```ts - * const indicatorTypes = - * await client.cloudforceOne.threatEvents.indicatorTypes.list( - * { account_id: 'account_id' }, - * ); - * ``` - */ - list( - params: IndicatorTypeListParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return this._client.get(`/accounts/${account_id}/cloudforce-one/events/indicatorTypes`, options); - } -} - -export interface IndicatorTypeListResponse { - items: IndicatorTypeListResponse.Items; - - type: string; -} - -export namespace IndicatorTypeListResponse { - export interface Items { - type: string; - } -} - -export interface IndicatorTypeListParams { - /** - * Account ID. - */ - account_id: string; -} - -export declare namespace IndicatorTypes { - export { - type IndicatorTypeListResponse as IndicatorTypeListResponse, - type IndicatorTypeListParams as IndicatorTypeListParams, - }; -} +export class IndicatorTypes 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 119f0b95d8..d23c37b5db 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -31,7 +31,7 @@ import { EventTags, } from './event-tags'; import * as IndicatorTypesAPI from './indicator-types'; -import { IndicatorTypeListParams, IndicatorTypeListResponse, IndicatorTypes } from './indicator-types'; +import { IndicatorTypes } from './indicator-types'; import * as InsightsAPI from './insights'; import { Insights } from './insights'; import * as RawAPI from './raw'; @@ -821,11 +821,7 @@ export declare namespace ThreatEvents { type DatasetRawParams as DatasetRawParams, }; - export { - IndicatorTypes as IndicatorTypes, - type IndicatorTypeListResponse as IndicatorTypeListResponse, - type IndicatorTypeListParams as IndicatorTypeListParams, - }; + export { IndicatorTypes as IndicatorTypes }; export { RawAPIRaw as Raw, diff --git a/src/resources/custom-pages.ts b/src/resources/custom-pages.ts index 6bd1b13cf7..4c861b1e41 100644 --- a/src/resources/custom-pages.ts +++ b/src/resources/custom-pages.ts @@ -24,13 +24,15 @@ export class CustomPages extends APIResource { */ update( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params: CustomPageUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { @@ -123,36 +125,42 @@ export class CustomPages extends APIResource { */ get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params?: CustomPageGetParams, options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params: CustomPageGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { diff --git a/src/resources/email-security/investigate/investigate.ts b/src/resources/email-security/investigate/investigate.ts index a15d9630ba..7093627a0f 100644 --- a/src/resources/email-security/investigate/investigate.ts +++ b/src/resources/email-security/investigate/investigate.ts @@ -199,10 +199,33 @@ export namespace InvestigateListResponse { } export interface Finding { + attachment?: string | null; + detail?: string | null; + detection?: + | 'MALICIOUS' + | 'MALICIOUS-BEC' + | 'SUSPICIOUS' + | 'SPOOF' + | 'SPAM' + | 'BULK' + | 'ENCRYPTED' + | 'EXTERNAL' + | 'UNKNOWN' + | 'NONE' + | null; + + field?: string | null; + name?: string | null; + portion?: string | null; + + reason?: string | null; + + score?: number | null; + value?: string | null; } @@ -321,10 +344,33 @@ export namespace InvestigateGetResponse { } export interface Finding { + attachment?: string | null; + detail?: string | null; + detection?: + | 'MALICIOUS' + | 'MALICIOUS-BEC' + | 'SUSPICIOUS' + | 'SPOOF' + | 'SPAM' + | 'BULK' + | 'ENCRYPTED' + | 'EXTERNAL' + | 'UNKNOWN' + | 'NONE' + | null; + + field?: string | null; + name?: string | null; + portion?: string | null; + + reason?: string | null; + + score?: number | null; + value?: string | null; } 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 c581632a76..f8b3034d84 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 138942ad57..a4db89243d 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. @@ -120,12 +99,12 @@ export interface Key { /** * Arbitrary JSON that is associated with a key. */ - metadata?: unknown; + metadata?: { [key: string]: unknown }; } export interface KeyBulkDeleteResponse { /** - * Number of keys successfully updated. + * Number of keys successfully updated */ successful_key_count?: number; @@ -135,49 +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 { - /** - * The metadata associated with the key. - */ - metadata: unknown; - - /** - * The value associated with the key. - */ - 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; @@ -189,27 +128,26 @@ export interface KeyBulkUpdateResponse { export interface KeyListParams extends CursorPaginationAfterParams { /** - * Path param: Identifier. + * 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. + * Query param: The number of keys to return. 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. + * 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; @@ -219,31 +157,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; @@ -256,38 +172,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 }; /** - * Arbitrary JSON that is associated with a key. + * A UTF-8 encoded string to be stored, up to 25 MiB in length. */ - metadata?: unknown; + value?: string; } } @@ -297,12 +214,10 @@ export declare namespace Keys { export { type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, - type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorPaginationAfter as KeysCursorPaginationAfter, 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 927ba8a17d..5e16f872e9 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -37,11 +37,11 @@ export class Metadata extends APIResource { /** * Arbitrary JSON that is associated with a key. */ -export type MetadataGetResponse = unknown; +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 df179e53bb..3ec43aa7c5 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: [{}], * }, * ); * ``` @@ -272,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; @@ -286,49 +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 { - /** - * The metadata associated with the key. - */ - metadata: unknown; - - /** - * The value associated with the key. - */ - 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; @@ -340,7 +270,7 @@ export interface NamespaceBulkUpdateResponse { export interface NamespaceCreateParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -352,7 +282,7 @@ export interface NamespaceCreateParams { export interface NamespaceUpdateParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -364,7 +294,7 @@ export interface NamespaceUpdateParams { export interface NamespaceListParams extends V4PagePaginationArrayParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -381,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; @@ -398,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; @@ -435,44 +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 }; /** - * Arbitrary JSON that is associated with a key. + * A UTF-8 encoded string to be stored, up to 25 MiB in length. */ - metadata?: unknown; + value?: string; } } export interface NamespaceGetParams { /** - * Identifier. + * Identifier */ account_id: string; } @@ -481,14 +390,14 @@ Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; Namespaces.Keys = Keys; Namespaces.KeysCursorPaginationAfter = KeysCursorPaginationAfter; 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, @@ -496,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, }; @@ -505,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, KeysCursorPaginationAfter as KeysCursorPaginationAfter, type KeyListParams as KeyListParams, type KeyBulkDeleteParams as KeyBulkDeleteParams, - type KeyBulkGetParams as KeyBulkGetParams, type KeyBulkUpdateParams as KeyBulkUpdateParams, }; @@ -521,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 49566f425a..1fa5ff39ed 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,8 +38,13 @@ 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, - __multipartSyntax: 'json', ...options }), + Core.maybeMultipartFormRequestOptions({ + query: { expiration, expiration_ttl }, + body, + __multipartSyntax: 'json', + ...options, + headers: { 'Content-Type': '*/*', ...options?.headers }, + }), ) as Core.APIPromise<{ result: ValueUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } @@ -114,42 +120,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: Associates arbitrary JSON data with a key/value pair. - */ - metadata?: unknown; } export interface ValueDeleteParams { /** - * Identifier. + * Identifier */ account_id: string; } export interface ValueGetParams { /** - * Identifier. + * Identifier */ account_id: string; } diff --git a/src/resources/leaked-credential-checks/detections.ts b/src/resources/leaked-credential-checks/detections.ts index ca2e008bd9..2a6de390ad 100644 --- a/src/resources/leaked-credential-checks/detections.ts +++ b/src/resources/leaked-credential-checks/detections.ts @@ -1,243 +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 Detections extends APIResource { - /** - * Create user-defined detection pattern for Leaked Credential Checks. - * - * @example - * ```ts - * const detection = - * await client.leakedCredentialChecks.detections.create({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - create( - params: DetectionCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.post(`/zones/${zone_id}/leaked-credential-checks/detections`, { - body, - ...options, - }) as Core.APIPromise<{ result: DetectionCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Update user-defined detection pattern for Leaked Credential Checks. - * - * @example - * ```ts - * const detection = - * await client.leakedCredentialChecks.detections.update( - * '18a14bafaa8eb1df04ce683ec18c765e', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - update( - detectionId: string, - params: DetectionUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.put(`/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: DetectionUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * List user-defined detection patterns for Leaked Credential Checks. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const detectionListResponse of client.leakedCredentialChecks.detections.list( - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` - */ - list( - params: DetectionListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { zone_id } = params; - return this._client.getAPIList( - `/zones/${zone_id}/leaked-credential-checks/detections`, - DetectionListResponsesSinglePage, - options, - ); - } - - /** - * Remove user-defined detection pattern for Leaked Credential Checks. - * - * @example - * ```ts - * const detection = - * await client.leakedCredentialChecks.detections.delete( - * '18a14bafaa8eb1df04ce683ec18c765e', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - delete( - detectionId: string, - params: DetectionDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id } = params; - return ( - this._client.delete( - `/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, - options, - ) as Core.APIPromise<{ result: DetectionDeleteResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export class DetectionListResponsesSinglePage extends SinglePage {} - -/** - * Defines a custom set of username/password expressions to match Leaked Credential - * Checks on. - */ -export interface DetectionCreateResponse { - /** - * Defines the unique ID for this custom detection. - */ - id?: string; - - /** - * Defines ehe ruleset expression to use in matching the password in a request. - */ - password?: string; - - /** - * Defines the ruleset expression to use in matching the username in a request. - */ - username?: string; -} - -/** - * Defines a custom set of username/password expressions to match Leaked Credential - * Checks on. - */ -export interface DetectionUpdateResponse { - /** - * Defines the unique ID for this custom detection. - */ - id?: string; - - /** - * Defines ehe ruleset expression to use in matching the password in a request. - */ - password?: string; - - /** - * Defines the ruleset expression to use in matching the username in a request. - */ - username?: string; -} - -/** - * Defines a custom set of username/password expressions to match Leaked Credential - * Checks on. - */ -export interface DetectionListResponse { - /** - * Defines the unique ID for this custom detection. - */ - id?: string; - - /** - * Defines ehe ruleset expression to use in matching the password in a request. - */ - password?: string; - - /** - * Defines the ruleset expression to use in matching the username in a request. - */ - username?: string; -} - -export type DetectionDeleteResponse = unknown; - -export interface DetectionCreateParams { - /** - * Path param: Defines an identifier. - */ - zone_id: string; - - /** - * Body param: Defines ehe ruleset expression to use in matching the password in a - * request. - */ - password?: string; - - /** - * Body param: Defines the ruleset expression to use in matching the username in a - * request. - */ - username?: string; -} - -export interface DetectionUpdateParams { - /** - * Path param: Defines an identifier. - */ - zone_id: string; - - /** - * Body param: Defines ehe ruleset expression to use in matching the password in a - * request. - */ - password?: string; - - /** - * Body param: Defines the ruleset expression to use in matching the username in a - * request. - */ - username?: string; -} - -export interface DetectionListParams { - /** - * Defines an identifier. - */ - zone_id: string; -} - -export interface DetectionDeleteParams { - /** - * Defines an identifier. - */ - zone_id: string; -} - -Detections.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; - -export declare namespace Detections { - export { - type DetectionCreateResponse as DetectionCreateResponse, - type DetectionUpdateResponse as DetectionUpdateResponse, - type DetectionListResponse as DetectionListResponse, - type DetectionDeleteResponse as DetectionDeleteResponse, - DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, - type DetectionCreateParams as DetectionCreateParams, - type DetectionUpdateParams as DetectionUpdateParams, - type DetectionListParams as DetectionListParams, - type DetectionDeleteParams as DetectionDeleteParams, - }; -} +export class Detections extends APIResource {} diff --git a/src/resources/leaked-credential-checks/index.ts b/src/resources/leaked-credential-checks/index.ts index 1844848bf2..7e3e1a0dd7 100644 --- a/src/resources/leaked-credential-checks/index.ts +++ b/src/resources/leaked-credential-checks/index.ts @@ -1,15 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { - DetectionListResponsesSinglePage, - Detections, - type DetectionCreateResponse, - type DetectionUpdateResponse, - type DetectionListResponse, - type DetectionDeleteResponse, - type DetectionCreateParams, - type DetectionUpdateParams, - type DetectionListParams, - type DetectionDeleteParams, -} from './detections'; +export { Detections } from './detections'; export { LeakedCredentialChecks } from './leaked-credential-checks'; diff --git a/src/resources/leaked-credential-checks/leaked-credential-checks.ts b/src/resources/leaked-credential-checks/leaked-credential-checks.ts index d8d8de90c1..c89821160c 100644 --- a/src/resources/leaked-credential-checks/leaked-credential-checks.ts +++ b/src/resources/leaked-credential-checks/leaked-credential-checks.ts @@ -1,132 +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 DetectionsAPI from './detections'; -import { - DetectionCreateParams, - DetectionCreateResponse, - DetectionDeleteParams, - DetectionDeleteResponse, - DetectionListParams, - DetectionListResponse, - DetectionListResponsesSinglePage, - DetectionUpdateParams, - DetectionUpdateResponse, - Detections, -} from './detections'; +import { Detections } from './detections'; export class LeakedCredentialChecks extends APIResource { detections: DetectionsAPI.Detections = new DetectionsAPI.Detections(this._client); - - /** - * Updates the current status of Leaked Credential Checks. - * - * @example - * ```ts - * const leakedCredentialCheck = - * await client.leakedCredentialChecks.create({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - create( - params: LeakedCredentialCheckCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.post(`/zones/${zone_id}/leaked-credential-checks`, { - body, - ...options, - }) as Core.APIPromise<{ result: LeakedCredentialCheckCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the current status of Leaked Credential Checks. - * - * @example - * ```ts - * const leakedCredentialCheck = - * await client.leakedCredentialChecks.get({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - get( - params: LeakedCredentialCheckGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id } = params; - return ( - this._client.get(`/zones/${zone_id}/leaked-credential-checks`, options) as Core.APIPromise<{ - result: LeakedCredentialCheckGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -/** - * Defines the overall status for Leaked Credential Checks. - */ -export interface LeakedCredentialCheckCreateResponse { - /** - * Determines whether or not Leaked Credential Checks are enabled. - */ - enabled?: boolean; -} - -/** - * Defines the overall status for Leaked Credential Checks. - */ -export interface LeakedCredentialCheckGetResponse { - /** - * Determines whether or not Leaked Credential Checks are enabled. - */ - enabled?: boolean; -} - -export interface LeakedCredentialCheckCreateParams { - /** - * Path param: Defines an identifier. - */ - zone_id: string; - - /** - * Body param: Determines whether or not Leaked Credential Checks are enabled. - */ - enabled?: boolean; -} - -export interface LeakedCredentialCheckGetParams { - /** - * Defines an identifier. - */ - zone_id: string; } LeakedCredentialChecks.Detections = Detections; -LeakedCredentialChecks.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; export declare namespace LeakedCredentialChecks { - export { - type LeakedCredentialCheckCreateResponse as LeakedCredentialCheckCreateResponse, - type LeakedCredentialCheckGetResponse as LeakedCredentialCheckGetResponse, - type LeakedCredentialCheckCreateParams as LeakedCredentialCheckCreateParams, - type LeakedCredentialCheckGetParams as LeakedCredentialCheckGetParams, - }; - - export { - Detections as Detections, - type DetectionCreateResponse as DetectionCreateResponse, - type DetectionUpdateResponse as DetectionUpdateResponse, - type DetectionListResponse as DetectionListResponse, - type DetectionDeleteResponse as DetectionDeleteResponse, - DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, - type DetectionCreateParams as DetectionCreateParams, - type DetectionUpdateParams as DetectionUpdateParams, - type DetectionListParams as DetectionListParams, - type DetectionDeleteParams as DetectionDeleteParams, - }; + export { Detections as Detections }; } 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 6e40d6cfa9..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 5e289166d6..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 6f0ab3dbaa..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/pages/projects/deployments/deployments.ts b/src/resources/pages/projects/deployments/deployments.ts index 97b2b41db9..e1a307e7bf 100644 --- a/src/resources/pages/projects/deployments/deployments.ts +++ b/src/resources/pages/projects/deployments/deployments.ts @@ -192,11 +192,77 @@ export interface DeploymentCreateParams { */ account_id: string; + /** + * Body param: Headers configuration file for the deployment. + */ + _headers?: Core.Uploadable; + + /** + * Body param: Redirects configuration file for the deployment. + */ + _redirects?: Core.Uploadable; + + /** + * Body param: Routes configuration file defining routing rules. + */ + '_routes.json'?: Core.Uploadable; + + /** + * Body param: Worker bundle file in multipart/form-data format. Mutually exclusive + * with `_worker.js`. Cannot specify both `_worker.js` and `_worker.bundle` in the + * same request. Maximum size: 25 MiB. + */ + '_worker.bundle'?: Core.Uploadable; + + /** + * Body param: Worker JavaScript file. Mutually exclusive with `_worker.bundle`. + * Cannot specify both `_worker.js` and `_worker.bundle` in the same request. + */ + '_worker.js'?: Core.Uploadable; + /** * Body param: The branch to build the new deployment from. The `HEAD` of the * branch will be used. If omitted, the production branch will be used by default. */ branch?: string; + + /** + * Body param: Boolean string indicating if the working directory has uncommitted + * changes. + */ + commit_dirty?: 'true' | 'false'; + + /** + * Body param: Git commit SHA associated with this deployment. + */ + commit_hash?: string; + + /** + * Body param: Git commit message associated with this deployment. + */ + commit_message?: string; + + /** + * Body param: Functions routing configuration file. + */ + 'functions-filepath-routing-config.json'?: Core.Uploadable; + + /** + * Body param: JSON string containing a manifest of files to deploy. Maps file + * paths to their content hashes. Required for direct upload deployments. Maximum + * 20,000 entries. + */ + manifest?: string; + + /** + * Body param: The build output directory path. + */ + pages_build_output_dir?: string; + + /** + * Body param: Hash of the Wrangler configuration file used for this deployment. + */ + wrangler_config_hash?: string; } export interface DeploymentListParams { diff --git a/src/resources/pages/projects/projects.ts b/src/resources/pages/projects/projects.ts index efac2c7d22..f14c2e99bf 100644 --- a/src/resources/pages/projects/projects.ts +++ b/src/resources/pages/projects/projects.ts @@ -41,6 +41,8 @@ export class Projects extends APIResource { * ```ts * const project = await client.pages.projects.create({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * name: 'my-pages-app', + * production_branch: 'main', * }); * ``` */ @@ -111,7 +113,11 @@ export class Projects extends APIResource { * ```ts * const project = await client.pages.projects.edit( * 'this-is-my-project-01', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * name: 'my-pages-app', + * production_branch: 'main', + * }, * ); * ``` */ @@ -215,7 +221,7 @@ export interface Deployment { */ env_vars?: { [key: string]: Deployment.PagesPlainTextEnvVar | null | Deployment.PagesSecretTextEnvVar | null; - }; + } | null; /** * Type of deploy. @@ -365,31 +371,74 @@ export namespace Deployment { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } @@ -397,17 +446,27 @@ export namespace Deployment { export interface Project { /** - * Id of the project. + * ID of the project. */ - id?: string; + id: string; + + /** + * Name of the project. + */ + name: string; + + /** + * Production branch of the project. Used to identify production deployments. + */ + production_branch: string; /** * Configs for the project build process. */ - build_config?: Project.BuildConfig; + build_config?: Project.BuildConfig | null; /** - * Most recent deployment to the repo. + * Most recent production deployment of the project. */ canonical_deployment?: Deployment | null; @@ -419,7 +478,7 @@ export interface Project { /** * Configs for deployments in a project. */ - deployment_configs?: Project.DeploymentConfigs; + deployment_configs?: Project.DeploymentConfigs | null; /** * A list of associated custom domains for the project. @@ -427,19 +486,29 @@ export interface Project { domains?: Array; /** - * Most recent deployment to the repo. + * Framework the project is using. + */ + framework?: string; + + /** + * Version of the framework the project is using. + */ + framework_version?: string; + + /** + * Most recent deployment of the project. */ latest_deployment?: Deployment | null; /** - * Name of the project. + * Name of the preview script. */ - name?: string; + preview_script_name?: string; /** - * Production branch of the project. Used to identify production deployments. + * Name of the production script. */ - production_branch?: string; + production_script_name?: string; source?: Project.Source; @@ -447,6 +516,11 @@ export interface Project { * The Cloudflare subdomain associated with the project. */ subdomain?: string; + + /** + * Whether the project uses functions. + */ + uses_functions?: boolean; } export namespace Project { @@ -492,12 +566,12 @@ export namespace Project { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview; + preview?: DeploymentConfigs.Preview | null; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production; + production?: DeploymentConfigs.Production | null; } export namespace DeploymentConfigs { @@ -510,6 +584,11 @@ export namespace Project { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -520,6 +599,11 @@ export namespace Project { */ browsers?: { [key: string]: Preview.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -528,7 +612,7 @@ export namespace Project { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -545,7 +629,12 @@ export namespace Project { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -557,6 +646,11 @@ export namespace Project { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Preview.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -582,10 +676,20 @@ export namespace Project { */ services?: { [key: string]: Preview.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Preview { @@ -672,6 +776,16 @@ export namespace Project { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -751,6 +865,11 @@ export namespace Project { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -761,6 +880,11 @@ export namespace Project { */ browsers?: { [key: string]: Production.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -769,7 +893,7 @@ export namespace Project { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -786,7 +910,12 @@ export namespace Project { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -798,6 +927,11 @@ export namespace Project { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Production.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -823,10 +957,20 @@ export namespace Project { */ services?: { [key: string]: Production.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Production { @@ -913,6 +1057,16 @@ export namespace Project { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -987,31 +1141,74 @@ export namespace Project { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } @@ -1053,25 +1250,25 @@ export interface ProjectCreateParams { account_id: string; /** - * Body param: Configs for the project build process. + * Body param: Name of the project. */ - build_config?: ProjectCreateParams.BuildConfig; + name: string; /** - * Body param: Configs for deployments in a project. + * Body param: Production branch of the project. Used to identify production + * deployments. */ - deployment_configs?: ProjectCreateParams.DeploymentConfigs; + production_branch: string; /** - * Body param: Name of the project. + * Body param: Configs for the project build process. */ - name?: string; + build_config?: ProjectCreateParams.BuildConfig | null; /** - * Body param: Production branch of the project. Used to identify production - * deployments. + * Body param: Configs for deployments in a project. */ - production_branch?: string; + deployment_configs?: ProjectCreateParams.DeploymentConfigs | null; /** * Body param: @@ -1122,12 +1319,12 @@ export namespace ProjectCreateParams { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview; + preview?: DeploymentConfigs.Preview | null; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production; + production?: DeploymentConfigs.Production | null; } export namespace DeploymentConfigs { @@ -1140,6 +1337,11 @@ export namespace ProjectCreateParams { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -1150,6 +1352,11 @@ export namespace ProjectCreateParams { */ browsers?: { [key: string]: Preview.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -1158,7 +1365,7 @@ export namespace ProjectCreateParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -1175,7 +1382,12 @@ export namespace ProjectCreateParams { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -1187,6 +1399,11 @@ export namespace ProjectCreateParams { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Preview.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -1212,10 +1429,20 @@ export namespace ProjectCreateParams { */ services?: { [key: string]: Preview.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Preview { @@ -1302,6 +1529,16 @@ export namespace ProjectCreateParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -1381,6 +1618,11 @@ export namespace ProjectCreateParams { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -1391,6 +1633,11 @@ export namespace ProjectCreateParams { */ browsers?: { [key: string]: Production.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -1399,7 +1646,7 @@ export namespace ProjectCreateParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -1416,7 +1663,12 @@ export namespace ProjectCreateParams { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -1428,6 +1680,11 @@ export namespace ProjectCreateParams { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Production.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -1453,10 +1710,20 @@ export namespace ProjectCreateParams { */ services?: { [key: string]: Production.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Production { @@ -1543,6 +1810,16 @@ export namespace ProjectCreateParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -1617,31 +1894,74 @@ export namespace ProjectCreateParams { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } @@ -1668,25 +1988,25 @@ export interface ProjectEditParams { account_id: string; /** - * Body param: Configs for the project build process. + * Body param: Name of the project. */ - build_config?: ProjectEditParams.BuildConfig; + name: string; /** - * Body param: Configs for deployments in a project. + * Body param: Production branch of the project. Used to identify production + * deployments. */ - deployment_configs?: ProjectEditParams.DeploymentConfigs; + production_branch: string; /** - * Body param: Name of the project. + * Body param: Configs for the project build process. */ - name?: string; + build_config?: ProjectEditParams.BuildConfig | null; /** - * Body param: Production branch of the project. Used to identify production - * deployments. + * Body param: Configs for deployments in a project. */ - production_branch?: string; + deployment_configs?: ProjectEditParams.DeploymentConfigs | null; /** * Body param: @@ -1737,12 +2057,12 @@ export namespace ProjectEditParams { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview; + preview?: DeploymentConfigs.Preview | null; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production; + production?: DeploymentConfigs.Production | null; } export namespace DeploymentConfigs { @@ -1755,6 +2075,11 @@ export namespace ProjectEditParams { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -1765,6 +2090,11 @@ export namespace ProjectEditParams { */ browsers?: { [key: string]: Preview.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -1773,7 +2103,7 @@ export namespace ProjectEditParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -1790,7 +2120,12 @@ export namespace ProjectEditParams { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -1802,6 +2137,11 @@ export namespace ProjectEditParams { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Preview.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -1827,10 +2167,20 @@ export namespace ProjectEditParams { */ services?: { [key: string]: Preview.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Preview { @@ -1917,6 +2267,16 @@ export namespace ProjectEditParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -1996,6 +2356,11 @@ export namespace ProjectEditParams { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -2006,6 +2371,11 @@ export namespace ProjectEditParams { */ browsers?: { [key: string]: Production.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -2014,7 +2384,7 @@ export namespace ProjectEditParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -2031,7 +2401,12 @@ export namespace ProjectEditParams { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -2043,6 +2418,11 @@ export namespace ProjectEditParams { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Production.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -2068,10 +2448,20 @@ export namespace ProjectEditParams { */ services?: { [key: string]: Production.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Production { @@ -2158,6 +2548,16 @@ export namespace ProjectEditParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -2232,31 +2632,74 @@ export namespace ProjectEditParams { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } diff --git a/src/resources/pipelines.ts b/src/resources/pipelines.ts index 02e40368e4..cfc4b0add9 100644 --- a/src/resources/pipelines.ts +++ b/src/resources/pipelines.ts @@ -5,29 +5,10 @@ import * as Core from '../core'; export class Pipelines extends APIResource { /** - * Create a new pipeline. + * [DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint + * instead. * - * @example - * ```ts - * const pipeline = await client.pipelines.create({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * destination: { - * batch: {}, - * compression: {}, - * credentials: { - * access_key_id: '', - * endpoint: - * 'https://123f8a8258064ed892a347f173372359.r2.cloudflarestorage.com', - * secret_access_key: '', - * }, - * format: 'json', - * path: { bucket: 'bucket' }, - * type: 'r2', - * }, - * name: 'sample_pipeline', - * source: [{ format: 'json', type: 'type' }], - * }); - * ``` + * @deprecated */ create( params: PipelineCreateParams, @@ -42,26 +23,10 @@ export class Pipelines extends APIResource { } /** - * Update an existing pipeline. + * [DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines + * endpoint instead. * - * @example - * ```ts - * const pipeline = await client.pipelines.update( - * 'sample_pipeline', - * { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * destination: { - * batch: {}, - * compression: {}, - * format: 'json', - * path: { bucket: 'bucket' }, - * type: 'r2', - * }, - * name: 'sample_pipeline', - * source: [{ format: 'json', type: 'type' }], - * }, - * ); - * ``` + * @deprecated */ update( pipelineName: string, @@ -78,14 +43,10 @@ export class Pipelines extends APIResource { } /** - * List, filter, and paginate pipelines in an account. + * [DEPRECATED] List, filter, and paginate pipelines in an account. Use the new + * /pipelines/v1/pipelines endpoint instead. * - * @example - * ```ts - * const pipelines = await client.pipelines.list({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` + * @deprecated */ list(params: PipelineListParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...query } = params; @@ -93,14 +54,10 @@ export class Pipelines extends APIResource { } /** - * Delete a pipeline. + * [DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint + * instead. * - * @example - * ```ts - * await client.pipelines.delete('sample_pipeline', { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` + * @deprecated */ delete( pipelineName: string, @@ -115,15 +72,10 @@ export class Pipelines extends APIResource { } /** - * Get configuration of a pipeline. + * [DEPRECATED] Get configuration of a pipeline. Use the new + * /pipelines/v1/pipelines endpoint instead. * - * @example - * ```ts - * const pipeline = await client.pipelines.get( - * 'sample_pipeline', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` + * @deprecated */ get( pipelineName: string, @@ -140,7 +92,8 @@ export class Pipelines extends APIResource { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface PipelineCreateResponse { /** @@ -238,6 +191,10 @@ export namespace PipelineCreateResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -263,6 +220,10 @@ export namespace PipelineCreateResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -274,7 +235,8 @@ export namespace PipelineCreateResponse { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface PipelineUpdateResponse { /** @@ -372,6 +334,10 @@ export namespace PipelineUpdateResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -397,6 +363,10 @@ export namespace PipelineUpdateResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -442,7 +412,8 @@ export namespace PipelineListResponse { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface Result { /** @@ -540,6 +511,10 @@ export namespace PipelineListResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -565,6 +540,10 @@ export namespace PipelineListResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -577,7 +556,8 @@ export namespace PipelineListResponse { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface PipelineGetResponse { /** @@ -675,6 +655,10 @@ export namespace PipelineGetResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -700,6 +684,10 @@ export namespace PipelineGetResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -821,6 +809,10 @@ export namespace PipelineCreateParams { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -846,6 +838,10 @@ export namespace PipelineCreateParams { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -967,6 +963,10 @@ export namespace PipelineUpdateParams { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -992,6 +992,10 @@ export namespace PipelineUpdateParams { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. diff --git a/src/resources/queues/consumers.ts b/src/resources/queues/consumers.ts index 43eae71410..93596e00ee 100644 --- a/src/resources/queues/consumers.ts +++ b/src/resources/queues/consumers.ts @@ -106,33 +106,6 @@ export class Consumers extends APIResource { const { account_id } = params; return this._client.delete(`/accounts/${account_id}/queues/${queueId}/consumers/${consumerId}`, options); } - - /** - * Fetches the consumer for a queue by consumer id - * - * @example - * ```ts - * const consumer = await client.queues.consumers.get( - * '023e105f4ecef8ad9ca31a8372d0c353', - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - get( - queueId: string, - consumerId: string, - params: ConsumerGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - 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); - } } export class ConsumersSinglePage extends SinglePage {} @@ -491,13 +464,6 @@ export interface ConsumerDeleteParams { account_id: string; } -export interface ConsumerGetParams { - /** - * A Resource identifier. - */ - account_id: string; -} - Consumers.ConsumersSinglePage = ConsumersSinglePage; export declare namespace Consumers { @@ -509,6 +475,5 @@ export declare namespace Consumers { 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 ebf2923861..32568cd469 100644 --- a/src/resources/queues/index.ts +++ b/src/resources/queues/index.ts @@ -9,30 +9,15 @@ export { type ConsumerUpdateParams, type ConsumerListParams, type ConsumerDeleteParams, - 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'; -export { - SubscriptionListResponsesV4PagePaginationArray, - Subscriptions, - type SubscriptionCreateResponse, - type SubscriptionUpdateResponse, - type SubscriptionListResponse, - type SubscriptionDeleteResponse, - type SubscriptionCreateParams, - type SubscriptionUpdateParams, - type SubscriptionListParams, - type SubscriptionDeleteParams, -} from './subscriptions'; +export { Subscriptions } from './subscriptions'; 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 667ab7a44a..15d1651711 100644 --- a/src/resources/queues/queues.ts +++ b/src/resources/queues/queues.ts @@ -9,7 +9,6 @@ import { ConsumerCreateParams, ConsumerDeleteParams, ConsumerDeleteResponse, - ConsumerGetParams, ConsumerListParams, ConsumerUpdateParams, Consumers, @@ -19,29 +18,15 @@ import * as MessagesAPI from './messages'; import { MessageAckParams, MessageAckResponse, - MessageBulkPushParams, - MessageBulkPushResponse, MessagePullParams, MessagePullResponse, - MessagePushParams, - MessagePushResponse, + MessagePullResponsesSinglePage, Messages, } from './messages'; import * as PurgeAPI from './purge'; import { Purge, PurgeStartParams, PurgeStatusParams, PurgeStatusResponse } from './purge'; import * as SubscriptionsAPI from './subscriptions'; -import { - SubscriptionCreateParams, - SubscriptionCreateResponse, - SubscriptionDeleteParams, - SubscriptionDeleteResponse, - SubscriptionListParams, - SubscriptionListResponse, - SubscriptionListResponsesV4PagePaginationArray, - SubscriptionUpdateParams, - SubscriptionUpdateResponse, - Subscriptions, -} from './subscriptions'; +import { Subscriptions } from './subscriptions'; import { SinglePage } from '../../pagination'; export class Queues extends APIResource { @@ -343,11 +328,11 @@ export interface QueueGetParams { Queues.QueuesSinglePage = QueuesSinglePage; Queues.Messages = Messages; +Queues.MessagePullResponsesSinglePage = MessagePullResponsesSinglePage; Queues.Purge = Purge; Queues.Consumers = Consumers; Queues.ConsumersSinglePage = ConsumersSinglePage; Queues.Subscriptions = Subscriptions; -Queues.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; export declare namespace Queues { export { @@ -365,13 +350,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 { @@ -390,19 +372,7 @@ export declare namespace Queues { type ConsumerUpdateParams as ConsumerUpdateParams, type ConsumerListParams as ConsumerListParams, type ConsumerDeleteParams as ConsumerDeleteParams, - type ConsumerGetParams as ConsumerGetParams, }; - export { - Subscriptions as Subscriptions, - type SubscriptionCreateResponse as SubscriptionCreateResponse, - type SubscriptionUpdateResponse as SubscriptionUpdateResponse, - type SubscriptionListResponse as SubscriptionListResponse, - type SubscriptionDeleteResponse as SubscriptionDeleteResponse, - SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, - type SubscriptionCreateParams as SubscriptionCreateParams, - type SubscriptionUpdateParams as SubscriptionUpdateParams, - type SubscriptionListParams as SubscriptionListParams, - type SubscriptionDeleteParams as SubscriptionDeleteParams, - }; + export { Subscriptions as Subscriptions }; } diff --git a/src/resources/queues/subscriptions.ts b/src/resources/queues/subscriptions.ts index 3bb405e3fc..42d6ea9ea6 100644 --- a/src/resources/queues/subscriptions.ts +++ b/src/resources/queues/subscriptions.ts @@ -1,874 +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 Subscriptions extends APIResource { - /** - * Create a new event subscription for a queue - * - * @example - * ```ts - * const subscription = - * await client.queues.subscriptions.create({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - create( - params: SubscriptionCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/event_subscriptions/subscriptions`, { - body, - ...options, - }) as Core.APIPromise<{ result: SubscriptionCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Update an existing event subscription - * - * @example - * ```ts - * const subscription = - * await client.queues.subscriptions.update( - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - update( - subscriptionId: string, - params: SubscriptionUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.patch(`/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: SubscriptionUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Get a paginated list of event subscriptions with optional sorting and filtering - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const subscriptionListResponse of client.queues.subscriptions.list( - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` - */ - list( - params: SubscriptionListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id, ...query } = params; - return this._client.getAPIList( - `/accounts/${account_id}/event_subscriptions/subscriptions`, - SubscriptionListResponsesV4PagePaginationArray, - { query, ...options }, - ); - } - - /** - * Delete an existing event subscription - * - * @example - * ```ts - * const subscription = - * await client.queues.subscriptions.delete( - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - delete( - subscriptionId: string, - params: SubscriptionDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.delete( - `/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, - options, - ) as Core.APIPromise<{ result: SubscriptionDeleteResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export class SubscriptionListResponsesV4PagePaginationArray extends V4PagePaginationArray {} - -export interface SubscriptionCreateResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionCreateResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionCreateResponse.MqEventSourceImages - | SubscriptionCreateResponse.MqEventSourceKV - | SubscriptionCreateResponse.MqEventSourceR2 - | SubscriptionCreateResponse.MqEventSourceSuperSlurper - | SubscriptionCreateResponse.MqEventSourceVectorize - | SubscriptionCreateResponse.MqEventSourceWorkersAIModel - | SubscriptionCreateResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionCreateResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionCreateResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionUpdateResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionUpdateResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionUpdateResponse.MqEventSourceImages - | SubscriptionUpdateResponse.MqEventSourceKV - | SubscriptionUpdateResponse.MqEventSourceR2 - | SubscriptionUpdateResponse.MqEventSourceSuperSlurper - | SubscriptionUpdateResponse.MqEventSourceVectorize - | SubscriptionUpdateResponse.MqEventSourceWorkersAIModel - | SubscriptionUpdateResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionUpdateResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionUpdateResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionListResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionListResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionListResponse.MqEventSourceImages - | SubscriptionListResponse.MqEventSourceKV - | SubscriptionListResponse.MqEventSourceR2 - | SubscriptionListResponse.MqEventSourceSuperSlurper - | SubscriptionListResponse.MqEventSourceVectorize - | SubscriptionListResponse.MqEventSourceWorkersAIModel - | SubscriptionListResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionListResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionListResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionDeleteResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionDeleteResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionDeleteResponse.MqEventSourceImages - | SubscriptionDeleteResponse.MqEventSourceKV - | SubscriptionDeleteResponse.MqEventSourceR2 - | SubscriptionDeleteResponse.MqEventSourceSuperSlurper - | SubscriptionDeleteResponse.MqEventSourceVectorize - | SubscriptionDeleteResponse.MqEventSourceWorkersAIModel - | SubscriptionDeleteResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionDeleteResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionDeleteResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionCreateParams { - /** - * Path param: A Resource identifier. - */ - account_id: string; - - /** - * Body param: Destination configuration for the subscription - */ - destination?: SubscriptionCreateParams.Destination; - - /** - * Body param: Whether the subscription is active - */ - enabled?: boolean; - - /** - * Body param: List of event types this subscription handles - */ - events?: Array; - - /** - * Body param: Name of the subscription - */ - name?: string; - - /** - * Body param: Source configuration for the subscription - */ - source?: - | SubscriptionCreateParams.MqEventSourceImages - | SubscriptionCreateParams.MqEventSourceKV - | SubscriptionCreateParams.MqEventSourceR2 - | SubscriptionCreateParams.MqEventSourceSuperSlurper - | SubscriptionCreateParams.MqEventSourceVectorize - | SubscriptionCreateParams.MqEventSourceWorkersAIModel - | SubscriptionCreateParams.MqEventSourceWorkersBuildsWorker - | SubscriptionCreateParams.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionCreateParams { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionUpdateParams { - /** - * Path param: A Resource identifier. - */ - account_id: string; - - /** - * Body param: Destination configuration for the subscription - */ - destination?: SubscriptionUpdateParams.Destination; - - /** - * Body param: Whether the subscription is active - */ - enabled?: boolean; - - /** - * Body param: List of event types this subscription handles - */ - events?: Array; - - /** - * Body param: Name of the subscription - */ - name?: string; -} - -export namespace SubscriptionUpdateParams { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } -} - -export interface SubscriptionListParams extends V4PagePaginationArrayParams { - /** - * Path param: A Resource identifier. - */ - account_id: string; - - /** - * Query param: Sort direction - */ - direction?: 'asc' | 'desc'; - - /** - * Query param: Field to sort by - */ - order?: 'created_at' | 'name' | 'enabled' | 'source'; -} - -export interface SubscriptionDeleteParams { - /** - * A Resource identifier. - */ - account_id: string; -} - -Subscriptions.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; - -export declare namespace Subscriptions { - export { - type SubscriptionCreateResponse as SubscriptionCreateResponse, - type SubscriptionUpdateResponse as SubscriptionUpdateResponse, - type SubscriptionListResponse as SubscriptionListResponse, - type SubscriptionDeleteResponse as SubscriptionDeleteResponse, - SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, - type SubscriptionCreateParams as SubscriptionCreateParams, - type SubscriptionUpdateParams as SubscriptionUpdateParams, - type SubscriptionListParams as SubscriptionListParams, - type SubscriptionDeleteParams as SubscriptionDeleteParams, - }; -} +export class Subscriptions extends APIResource {} 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 2740494438..8ab49d5567 100644 --- a/src/resources/workflows/instances/instances.ts +++ b/src/resources/workflows/instances/instances.ts @@ -1,429 +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: `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. - */ - date_end?: string; - - /** - * Query param: Accepts ISO 8601 with no timezone offsets and in UTC. - */ - date_start?: string; - - /** - * Query param: should only be used when `cursor` is used, defines a new direction - * for the cursor - */ - direction?: 'asc' | 'desc'; - - /** - * 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/devices/dex-tests.ts b/src/resources/zero-trust/devices/dex-tests.ts index 4446969263..024ac99cae 100644 --- a/src/resources/zero-trust/devices/dex-tests.ts +++ b/src/resources/zero-trust/devices/dex-tests.ts @@ -13,7 +13,10 @@ export class DEXTests extends APIResource { * const dexTest = * await client.zeroTrust.devices.dexTests.create({ * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: {}, + * data: { + * host: 'https://dash.cloudflare.com', + * kind: 'http', + * }, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -40,7 +43,10 @@ export class DEXTests extends APIResource { * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: {}, + * data: { + * host: 'https://dash.cloudflare.com', + * kind: 'http', + * }, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -271,24 +277,24 @@ export namespace DEXTestCreateResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -351,24 +357,24 @@ export namespace DEXTestUpdateResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -431,24 +437,24 @@ export namespace DEXTestListResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -516,24 +522,24 @@ export namespace DEXTestDeleteResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -597,24 +603,24 @@ export namespace DEXTestGetResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -680,24 +686,24 @@ export namespace DEXTestCreateParams { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -763,24 +769,24 @@ export namespace DEXTestUpdateParams { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default 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/zero-trust/dex/dex.ts b/src/resources/zero-trust/dex/dex.ts index f12a3ad01f..a500404035 100644 --- a/src/resources/zero-trust/dex/dex.ts +++ b/src/resources/zero-trust/dex/dex.ts @@ -29,6 +29,7 @@ import { FleetStatusLiveParams, FleetStatusLiveResponse, FleetStatusOverTimeParams, + FleetStatusOverTimeResponse, LiveStat, } from './fleet-status/fleet-status'; import * as HTTPTestsAPI from './http-tests/http-tests'; @@ -53,6 +54,9 @@ export class DEX extends APIResource { } export interface DigitalExperienceMonitor { + /** + * API Resource UUID tag. + */ id: string; /** @@ -208,6 +212,7 @@ export declare namespace DEX { FleetStatus as FleetStatus, type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, + type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts index a64c26da75..43f7978b75 100644 --- a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts +++ b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts @@ -44,20 +44,25 @@ export class FleetStatus extends APIResource { * * @example * ```ts - * await client.zeroTrust.dex.fleetStatus.overTime({ - * account_id: '01a7362d577a6c3019a474fd6f485823', - * from: '2023-10-11T00:00:00Z', - * to: '2023-10-11T00:00:00Z', - * }); + * const response = + * await client.zeroTrust.dex.fleetStatus.overTime({ + * account_id: '01a7362d577a6c3019a474fd6f485823', + * from: '2023-10-11T00:00:00Z', + * to: '2023-10-11T00:00:00Z', + * }); * ``` */ - overTime(params: FleetStatusOverTimeParams, options?: Core.RequestOptions): Core.APIPromise { + overTime( + params: FleetStatusOverTimeParams, + options?: Core.RequestOptions, + ): Core.APIPromise { const { account_id, ...query } = params; - return this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { - query, - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + return ( + this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { + query, + ...options, + }) as Core.APIPromise<{ result: FleetStatusOverTimeResponse }> + )._thenUnwrap((obj) => obj.result); } } @@ -93,6 +98,53 @@ export namespace FleetStatusLiveResponse { } } +export interface FleetStatusOverTimeResponse { + deviceStats?: FleetStatusOverTimeResponse.DeviceStats; +} + +export namespace FleetStatusOverTimeResponse { + export interface DeviceStats { + byMode?: Array; + + byStatus?: Array; + + /** + * Number of unique devices + */ + uniqueDevicesTotal?: number; + } + + export namespace DeviceStats { + export interface ByMode { + /** + * Timestamp in ISO format + */ + timestamp?: string; + + /** + * Number of unique devices + */ + uniqueDevicesTotal?: number; + + value?: string; + } + + export interface ByStatus { + /** + * Timestamp in ISO format + */ + timestamp?: string; + + /** + * Number of unique devices + */ + uniqueDevicesTotal?: number; + + value?: string; + } + } +} + export interface FleetStatusLiveParams { /** * Path param: Unique identifier for account @@ -139,6 +191,7 @@ export declare namespace FleetStatus { export { type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, + type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/index.ts b/src/resources/zero-trust/dex/fleet-status/index.ts index 31cdb34bb8..8bf3ee7730 100644 --- a/src/resources/zero-trust/dex/fleet-status/index.ts +++ b/src/resources/zero-trust/dex/fleet-status/index.ts @@ -10,6 +10,7 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, + type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status'; diff --git a/src/resources/zero-trust/dex/index.ts b/src/resources/zero-trust/dex/index.ts index f97aa02d43..d0f4eae54c 100644 --- a/src/resources/zero-trust/dex/index.ts +++ b/src/resources/zero-trust/dex/index.ts @@ -20,6 +20,7 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, + type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status/index'; diff --git a/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts b/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts deleted file mode 100644 index 9bd29bee68..0000000000 --- a/tests/api-resources/cloudforce-one/threat-events/indicator-types.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 indicatorTypes', () => { - // TODO: HTTP 401 from prism - test.skip('list: only required params', async () => { - const responsePromise = client.cloudforceOne.threatEvents.indicatorTypes.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); - }); - - // TODO: HTTP 401 from prism - test.skip('list: required and optional params', async () => { - const response = await client.cloudforceOne.threatEvents.indicatorTypes.list({ - account_id: 'account_id', - }); - }); -}); 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 a543062bc0..d69492f799 100644 --- a/tests/api-resources/kv/namespaces/namespaces.test.ts +++ b/tests/api-resources/kv/namespaces/namespaces.test.ts @@ -69,7 +69,7 @@ describe('resource namespaces', () => { direction: 'asc', order: 'id', page: 1, - per_page: 1, + per_page: 5, }); }); @@ -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 03fbaa4b52..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: {}, }); }); diff --git a/tests/api-resources/leaked-credential-checks/detections.test.ts b/tests/api-resources/leaked-credential-checks/detections.test.ts deleted file mode 100644 index f9a1af0b8e..0000000000 --- a/tests/api-resources/leaked-credential-checks/detections.test.ts +++ /dev/null @@ -1,98 +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 detections', () => { - test('create: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.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.leakedCredentialChecks.detections.create({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - password: 'lookup_json_string(http.request.body.raw, "secret")', - username: 'lookup_json_string(http.request.body.raw, "user")', - }); - }); - - test('update: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.update( - '18a14bafaa8eb1df04ce683ec18c765e', - { 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('update: required and optional params', async () => { - const response = await client.leakedCredentialChecks.detections.update( - '18a14bafaa8eb1df04ce683ec18c765e', - { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - password: 'lookup_json_string(http.request.body.raw, "secret")', - username: 'lookup_json_string(http.request.body.raw, "user")', - }, - ); - }); - - test('list: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.list({ - 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('list: required and optional params', async () => { - const response = await client.leakedCredentialChecks.detections.list({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - }); - - test('delete: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.delete( - '18a14bafaa8eb1df04ce683ec18c765e', - { 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('delete: required and optional params', async () => { - const response = await client.leakedCredentialChecks.detections.delete( - '18a14bafaa8eb1df04ce683ec18c765e', - { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); - }); -}); diff --git a/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts b/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts deleted file mode 100644 index c7c208f9ed..0000000000 --- a/tests/api-resources/leaked-credential-checks/leaked-credential-checks.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 leakedCredentialChecks', () => { - test('create: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.create({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - enabled: true, - }); - }); - - test('get: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); - }); -}); 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/pages/projects/deployments/deployments.test.ts b/tests/api-resources/pages/projects/deployments/deployments.test.ts index 41d5114e2a..67899467e8 100644 --- a/tests/api-resources/pages/projects/deployments/deployments.test.ts +++ b/tests/api-resources/pages/projects/deployments/deployments.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({ @@ -28,7 +28,19 @@ describe('resource deployments', () => { test.skip('create: required and optional params', async () => { const response = await client.pages.projects.deployments.create('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + _headers: await toFile(Buffer.from('# my file contents'), 'README.md'), + _redirects: await toFile(Buffer.from('# my file contents'), 'README.md'), + '_routes.json': await toFile(Buffer.from('# my file contents'), 'README.md'), + '_worker.bundle': await toFile(Buffer.from('# my file contents'), 'README.md'), + '_worker.js': await toFile(Buffer.from('# my file contents'), 'README.md'), branch: 'staging', + commit_dirty: 'false', + commit_hash: 'a1b2c3d4e5f6', + commit_message: 'Update homepage', + 'functions-filepath-routing-config.json': await toFile(Buffer.from('# my file contents'), 'README.md'), + manifest: '{"index.html": "abc123", "style.css": "def456"}', + pages_build_output_dir: 'dist', + wrangler_config_hash: 'wrangler_config_hash', }); }); diff --git a/tests/api-resources/pages/projects/projects.test.ts b/tests/api-resources/pages/projects/projects.test.ts index 41a92b2403..4f2c4122e8 100644 --- a/tests/api-resources/pages/projects/projects.test.ts +++ b/tests/api-resources/pages/projects/projects.test.ts @@ -11,7 +11,11 @@ const client = new Cloudflare({ describe('resource projects', () => { test('create: only required params', async () => { - const responsePromise = client.pages.projects.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = client.pages.projects.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'my-pages-app', + production_branch: 'main', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -24,6 +28,8 @@ describe('resource projects', () => { test('create: required and optional params', async () => { const response = await client.pages.projects.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'my-pages-app', + production_branch: 'main', build_config: { build_caching: true, build_command: 'npm run build', @@ -35,15 +41,19 @@ describe('resource projects', () => { deployment_configs: { preview: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, + always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - compatibility_date: '2022-01-01', + build_image_major_version: 3, + compatibility_date: '2025-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, + fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, + limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -55,19 +65,25 @@ describe('resource projects', () => { service: 'example-worker', }, }, + usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, + wrangler_config_hash: 'abc123def456', }, production: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, + always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - compatibility_date: '2022-01-01', + build_image_major_version: 3, + compatibility_date: '2025-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, + fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, + limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -79,26 +95,26 @@ describe('resource projects', () => { service: 'example-worker', }, }, + usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, + wrangler_config_hash: 'abc123def456', }, }, - name: 'NextJS Blog', - production_branch: 'main', source: { config: { deployments_enabled: true, - owner: 'owner', + owner: 'my-org', path_excludes: ['string'], path_includes: ['string'], pr_comments_enabled: true, preview_branch_excludes: ['string'], preview_branch_includes: ['string'], preview_deployment_setting: 'all', - production_branch: 'production_branch', + production_branch: 'main', production_deployments_enabled: true, - repo_name: 'repo_name', + repo_name: 'my-repo', }, - type: 'type', + type: 'github', }, }); }); @@ -144,6 +160,8 @@ describe('resource projects', () => { test('edit: only required params', async () => { const responsePromise = client.pages.projects.edit('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'my-pages-app', + production_branch: 'main', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -157,6 +175,8 @@ describe('resource projects', () => { test('edit: required and optional params', async () => { const response = await client.pages.projects.edit('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'my-pages-app', + production_branch: 'main', build_config: { build_caching: true, build_command: 'npm run build', @@ -168,15 +188,19 @@ describe('resource projects', () => { deployment_configs: { preview: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, + always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - compatibility_date: '2022-01-01', + build_image_major_version: 3, + compatibility_date: '2025-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, + fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, + limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -188,19 +212,25 @@ describe('resource projects', () => { service: 'example-worker', }, }, + usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, + wrangler_config_hash: 'abc123def456', }, production: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, + always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - compatibility_date: '2022-01-01', + build_image_major_version: 3, + compatibility_date: '2025-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, + fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, + limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -212,26 +242,26 @@ describe('resource projects', () => { service: 'example-worker', }, }, + usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, + wrangler_config_hash: 'abc123def456', }, }, - name: 'NextJS Blog', - production_branch: 'main', source: { config: { deployments_enabled: true, - owner: 'owner', + owner: 'my-org', path_excludes: ['string'], path_includes: ['string'], pr_comments_enabled: true, preview_branch_excludes: ['string'], preview_branch_includes: ['string'], preview_deployment_setting: 'all', - production_branch: 'production_branch', + production_branch: 'main', production_deployments_enabled: true, - repo_name: 'repo_name', + repo_name: 'my-repo', }, - type: 'type', + type: 'github', }, }); }); diff --git a/tests/api-resources/pipelines.test.ts b/tests/api-resources/pipelines.test.ts index 40730e8ec8..390a133372 100644 --- a/tests/api-resources/pipelines.test.ts +++ b/tests/api-resources/pipelines.test.ts @@ -12,7 +12,7 @@ const client = new Cloudflare({ describe('resource pipelines', () => { test('create: only required params', async () => { const responsePromise = client.pipelines.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', destination: { batch: {}, compression: {}, @@ -39,7 +39,7 @@ describe('resource pipelines', () => { test('create: required and optional params', async () => { const response = await client.pipelines.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', destination: { batch: { max_bytes: 1000, max_duration_s: 0.25, max_rows: 100 }, compression: { type: 'gzip' }, @@ -64,7 +64,7 @@ describe('resource pipelines', () => { test('update: only required params', async () => { const responsePromise = client.pipelines.update('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', destination: { batch: {}, compression: {}, format: 'json', path: { bucket: 'bucket' }, type: 'r2' }, name: 'sample_pipeline', source: [{ format: 'json', type: 'type' }], @@ -80,7 +80,7 @@ describe('resource pipelines', () => { test('update: required and optional params', async () => { const response = await client.pipelines.update('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', destination: { batch: { max_bytes: 1000, max_duration_s: 0.25, max_rows: 100 }, compression: { type: 'gzip' }, @@ -104,7 +104,7 @@ describe('resource pipelines', () => { }); test('list: only required params', async () => { - const responsePromise = client.pipelines.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = client.pipelines.list({ account_id: '0123105f4ecef8ad9ca31a8372d0c353' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -116,7 +116,7 @@ describe('resource pipelines', () => { test('list: required and optional params', async () => { const response = await client.pipelines.list({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', page: 'page', per_page: 'per_page', search: 'search', @@ -125,7 +125,7 @@ describe('resource pipelines', () => { test('delete: only required params', async () => { const responsePromise = client.pipelines.delete('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -138,13 +138,13 @@ describe('resource pipelines', () => { test('delete: required and optional params', async () => { const response = await client.pipelines.delete('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', }); }); test('get: only required params', async () => { const responsePromise = client.pipelines.get('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -157,7 +157,7 @@ describe('resource pipelines', () => { test('get: required and optional params', async () => { const response = await client.pipelines.get('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', }); }); }); diff --git a/tests/api-resources/queues/consumers.test.ts b/tests/api-resources/queues/consumers.test.ts index e4275cc8e0..9cff12967c 100644 --- a/tests/api-resources/queues/consumers.test.ts +++ b/tests/api-resources/queues/consumers.test.ts @@ -115,27 +115,4 @@ describe('resource consumers', () => { { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); }); - - test('get: only required params', async () => { - const responsePromise = client.queues.consumers.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '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('get: required and optional params', async () => { - const response = await client.queues.consumers.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); - }); }); 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/queues/subscriptions.test.ts b/tests/api-resources/queues/subscriptions.test.ts deleted file mode 100644 index fed29a3ae9..0000000000 --- a/tests/api-resources/queues/subscriptions.test.ts +++ /dev/null @@ -1,101 +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 subscriptions', () => { - test('create: only required params', async () => { - const responsePromise = client.queues.subscriptions.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.queues.subscriptions.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - destination: { queue_id: 'queue_id', type: 'queues.queue' }, - enabled: true, - events: ['string'], - name: 'name', - source: { type: 'images' }, - }); - }); - - test('update: only required params', async () => { - const responsePromise = client.queues.subscriptions.update('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('update: required and optional params', async () => { - const response = await client.queues.subscriptions.update('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - destination: { queue_id: 'queue_id', type: 'queues.queue' }, - enabled: true, - events: ['string'], - name: 'name', - }); - }); - - test('list: only required params', async () => { - const responsePromise = client.queues.subscriptions.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.queues.subscriptions.list({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - direction: 'asc', - order: 'created_at', - page: 1, - per_page: 1, - }); - }); - - test('delete: only required params', async () => { - const responsePromise = client.queues.subscriptions.delete('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('delete: required and optional params', async () => { - const response = await client.queues.subscriptions.delete('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - }); -}); 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 cdad8d0e4b..0000000000 --- a/tests/api-resources/workflows/instances/instances.test.ts +++ /dev/null @@ -1,89 +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', - cursor: 'cursor', - date_end: '2019-12-27T18:11:19.117Z', - date_start: '2019-12-27T18:11:19.117Z', - direction: 'asc', - 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' }); - }); -}); diff --git a/tests/api-resources/zero-trust/devices/dex-tests.test.ts b/tests/api-resources/zero-trust/devices/dex-tests.test.ts index 246e9b7961..0669d5569c 100644 --- a/tests/api-resources/zero-trust/devices/dex-tests.test.ts +++ b/tests/api-resources/zero-trust/devices/dex-tests.test.ts @@ -13,7 +13,7 @@ describe('resource dexTests', () => { test('create: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.create({ account_id: '01a7362d577a6c3019a474fd6f485823', - data: {}, + data: { host: 'https://dash.cloudflare.com', kind: 'http' }, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -35,7 +35,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'id', default: true, name: 'name' }], + target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], targeted: true, }); }); @@ -43,7 +43,7 @@ describe('resource dexTests', () => { test('update: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', - data: {}, + data: { host: 'https://dash.cloudflare.com', kind: 'http' }, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -65,7 +65,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'id', default: true, name: 'name' }], + target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], targeted: true, }); }); From d8122ccad8fb4d2a6533ef38ec8aa18a60150085 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 18:01:08 +0000 Subject: [PATCH 090/451] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 176 +- scripts/detect-breaking-changes | 19 + .../alerting/destinations/webhooks.ts | 6 +- src/resources/alerting/policies.ts | 19 +- .../cloudforce-one/threat-events/index.ts | 6 +- .../threat-events/indicator-types.ts | 48 +- .../threat-events/threat-events.ts | 8 +- src/resources/custom-pages.ts | 48 +- .../email-security/investigate/investigate.ts | 46 - 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 | 139 +- src/resources/kv/namespaces/metadata.ts | 4 +- src/resources/kv/namespaces/namespaces.ts | 164 +- src/resources/kv/namespaces/values.ts | 33 +- .../leaked-credential-checks/detections.ts | 240 ++- .../leaked-credential-checks/index.ts | 13 +- .../leaked-credential-checks.ts | 121 +- 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/pages/index.ts | 1 - src/resources/pages/pages.ts | 6 +- .../pages/projects/deployments/deployments.ts | 66 - src/resources/pages/projects/index.ts | 1 - src/resources/pages/projects/projects.ts | 569 +----- src/resources/pipelines.ts | 138 +- src/resources/queues/consumers.ts | 35 + src/resources/queues/index.ts | 19 +- src/resources/queues/messages.ts | 217 ++- src/resources/queues/queues.ts | 40 +- src/resources/queues/subscriptions.ts | 871 +++++++++- .../r2/super-slurper/connectivity-precheck.ts | 76 +- src/resources/r2/super-slurper/jobs/jobs.ts | 52 +- src/resources/radar/as112/summary.ts | 34 +- .../radar/as112/timeseries-groups.ts | 36 +- src/resources/radar/attacks/layer3/summary.ts | 42 +- .../radar/attacks/layer3/timeseries-groups.ts | 42 +- src/resources/radar/attacks/layer7/summary.ts | 42 +- .../radar/attacks/layer7/timeseries-groups.ts | 42 +- src/resources/radar/dns/summary.ts | 54 +- src/resources/radar/dns/timeseries-groups.ts | 60 +- src/resources/radar/email/routing/summary.ts | 36 +- .../radar/email/routing/timeseries-groups.ts | 36 +- src/resources/radar/email/security/summary.ts | 54 +- .../radar/email/security/timeseries-groups.ts | 54 +- src/resources/radar/entities/asns.ts | 12 +- src/resources/radar/netflows/netflows.ts | 2 +- src/resources/stream/downloads.ts | 5 +- .../dispatch/namespaces/scripts/bindings.ts | 2 +- .../dispatch/namespaces/scripts/scripts.ts | 2 +- .../dispatch/namespaces/scripts/settings.ts | 6 +- .../workers/beta/workers/versions.ts | 4 +- src/resources/workers/beta/workers/workers.ts | 138 -- src/resources/workers/observability/index.ts | 12 +- .../workers/observability/observability.ts | 26 +- .../workers/observability/telemetry.ts | 1538 ++++++++++++++++- .../scripts/script-and-version-settings.ts | 6 +- src/resources/workers/scripts/scripts.ts | 2 +- src/resources/workers/scripts/versions.ts | 11 +- src/resources/workflows/index.ts | 23 +- src/resources/workflows/instances/events.ts | 40 +- src/resources/workflows/instances/index.ts | 18 +- .../workflows/instances/instances.ts | 416 ++++- src/resources/workflows/instances/status.ts | 54 +- src/resources/workflows/versions.ts | 87 +- src/resources/workflows/workflows.ts | 274 ++- src/resources/zero-trust/devices/dex-tests.ts | 80 +- src/resources/zero-trust/dex/colos.ts | 17 +- src/resources/zero-trust/dex/dex.ts | 5 - .../dex/fleet-status/fleet-status.ts | 75 +- .../zero-trust/dex/fleet-status/index.ts | 1 - src/resources/zero-trust/dex/index.ts | 1 - src/resources/zones/settings.ts | 38 +- .../alerting/destinations/webhooks.test.ts | 51 +- tests/api-resources/alerting/policies.test.ts | 26 +- .../threat-events/indicator-types.test.ts | 33 + .../api-resources/kv/namespaces/keys.test.ts | 31 +- .../kv/namespaces/namespaces.test.ts | 33 +- .../kv/namespaces/values.test.ts | 3 +- .../detections.test.ts | 98 ++ .../leaked-credential-checks.test.ts | 49 + .../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 + .../projects/deployments/deployments.test.ts | 14 +- .../pages/projects/projects.test.ts | 70 +- tests/api-resources/pipelines.test.ts | 20 +- tests/api-resources/queues/consumers.test.ts | 23 + tests/api-resources/queues/messages.test.ts | 43 + .../queues/subscriptions.test.ts | 101 ++ .../connectivity-precheck.test.ts | 20 +- .../r2/super-slurper/jobs/jobs.test.ts | 6 +- .../workers/observability/telemetry.test.ts | 110 ++ .../workers/scripts/versions.test.ts | 6 +- .../workflows/instances/events.test.ts | 32 + .../workflows/instances/instances.test.ts | 89 + .../workflows/instances/status.test.ts | 33 + .../api-resources/workflows/versions.test.ts | 50 + .../api-resources/workflows/workflows.test.ts | 85 + .../zero-trust/devices/dex-tests.test.ts | 8 +- 114 files changed, 6796 insertions(+), 1565 deletions(-) create mode 100644 tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts create mode 100644 tests/api-resources/leaked-credential-checks/detections.test.ts create mode 100644 tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts 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/queues/subscriptions.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 42f665eaa2..5637fc3e0e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1784 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cceecd20dfd89884f795e75b433848994bed610b79802c65104f0c70d3ada54e.yml -openapi_spec_hash: c33c0e26e48c004c1781a36748d0144c +configured_endpoints: 1822 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ca8fbfa82d19dca400ec61b8c93392de1acd157860e435419f9a5e9ec8c586e0.yml +openapi_spec_hash: 77d55c70bc3824ac61bd056e2319ee18 config_hash: 107e0f1f8a98b007260b319226b88b3c diff --git a/api.md b/api.md index 4df6e7455e..7ffb0aa433 100644 --- a/api.md +++ b/api.md @@ -1715,16 +1715,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: @@ -2214,6 +2259,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 @@ -2221,18 +2278,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 @@ -2242,12 +2300,14 @@ Types: - Key - KeyBulkDeleteResponse +- KeyBulkGetResponse - KeyBulkUpdateResponse Methods: - 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 ### Metadata @@ -2316,12 +2376,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 @@ -2347,9 +2411,24 @@ Methods: - 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 ## Subscriptions +Types: + +- SubscriptionCreateResponse +- SubscriptionUpdateResponse +- SubscriptionListResponse +- SubscriptionDeleteResponse + +Methods: + +- client.queues.subscriptions.create({ ...params }) -> SubscriptionCreateResponse +- client.queues.subscriptions.update(subscriptionId, { ...params }) -> SubscriptionUpdateResponse +- client.queues.subscriptions.list({ ...params }) -> SubscriptionListResponsesV4PagePaginationArray +- client.queues.subscriptions.delete(subscriptionId, { ...params }) -> SubscriptionDeleteResponse + # APIGateway ## Configurations @@ -3846,7 +3925,7 @@ Types: Methods: - client.pages.projects.create({ ...params }) -> Project -- client.pages.projects.list({ ...params }) -> DeploymentsV4PagePaginationArray +- client.pages.projects.list({ ...params }) -> DeploymentsSinglePage - client.pages.projects.delete(projectName, { ...params }) -> ProjectDeleteResponse | null - client.pages.projects.edit(projectName, { ...params }) -> Project - client.pages.projects.get(projectName, { ...params }) -> Project @@ -5403,12 +5482,11 @@ Types: - LiveStat - FleetStatusLiveResponse -- FleetStatusOverTimeResponse Methods: - client.zeroTrust.dex.fleetStatus.live({ ...params }) -> FleetStatusLiveResponse -- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> FleetStatusOverTimeResponse +- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> void #### Devices @@ -8005,6 +8083,14 @@ Methods: ### IndicatorTypes +Types: + +- IndicatorTypeListResponse + +Methods: + +- client.cloudforceOne.threatEvents.indicatorTypes.list({ ...params }) -> IndicatorTypeListResponse + ### Raw Types: @@ -8277,14 +8363,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: @@ -8339,8 +8479,32 @@ Methods: # LeakedCredentialChecks +Types: + +- LeakedCredentialCheckCreateResponse +- LeakedCredentialCheckGetResponse + +Methods: + +- client.leakedCredentialChecks.create({ ...params }) -> LeakedCredentialCheckCreateResponse +- client.leakedCredentialChecks.get({ ...params }) -> LeakedCredentialCheckGetResponse + ## Detections +Types: + +- DetectionCreateResponse +- DetectionUpdateResponse +- DetectionListResponse +- DetectionDeleteResponse + +Methods: + +- client.leakedCredentialChecks.detections.create({ ...params }) -> DetectionCreateResponse +- client.leakedCredentialChecks.detections.update(detectionId, { ...params }) -> DetectionUpdateResponse +- client.leakedCredentialChecks.detections.list({ ...params }) -> DetectionListResponsesSinglePage +- client.leakedCredentialChecks.detections.delete(detectionId, { ...params }) -> DetectionDeleteResponse + # ContentScanning Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 8c8c3ce4bf..4580a22d2d 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -143,6 +143,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 @@ -183,6 +191,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 @@ -195,6 +205,7 @@ TEST_PATHS=( tests/api-resources/queues/messages.test.ts tests/api-resources/queues/purge.test.ts tests/api-resources/queues/consumers.test.ts + tests/api-resources/queues/subscriptions.test.ts tests/api-resources/api-gateway/api-gateway.test.ts tests/api-resources/api-gateway/configurations.test.ts tests/api-resources/api-gateway/discovery/discovery.test.ts @@ -673,6 +684,7 @@ TEST_PATHS=( tests/api-resources/cloudforce-one/threat-events/categories.test.ts tests/api-resources/cloudforce-one/threat-events/countries.test.ts tests/api-resources/cloudforce-one/threat-events/datasets/datasets.test.ts + tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts tests/api-resources/cloudforce-one/threat-events/raw.test.ts tests/api-resources/cloudforce-one/threat-events/relate.test.ts tests/api-resources/cloudforce-one/threat-events/tags.test.ts @@ -696,9 +708,16 @@ 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 + tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts + tests/api-resources/leaked-credential-checks/detections.test.ts tests/api-resources/content-scanning/content-scanning.test.ts tests/api-resources/content-scanning/payloads.test.ts tests/api-resources/content-scanning/settings.test.ts diff --git a/src/resources/alerting/destinations/webhooks.ts b/src/resources/alerting/destinations/webhooks.ts index 605e015ae3..279c67d0bf 100644 --- a/src/resources/alerting/destinations/webhooks.ts +++ b/src/resources/alerting/destinations/webhooks.ts @@ -35,7 +35,7 @@ export class Webhooks extends APIResource { * ```ts * const webhook = * await client.alerting.destinations.webhooks.update( - * 'b115d5ec15c641ee8b7692c449b5227b', + * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * name: 'Slack Webhook', @@ -90,7 +90,7 @@ export class Webhooks extends APIResource { * ```ts * const webhook = * await client.alerting.destinations.webhooks.delete( - * 'b115d5ec15c641ee8b7692c449b5227b', + * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -114,7 +114,7 @@ export class Webhooks extends APIResource { * ```ts * const webhooks = * await client.alerting.destinations.webhooks.get( - * 'b115d5ec15c641ee8b7692c449b5227b', + * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` diff --git a/src/resources/alerting/policies.ts b/src/resources/alerting/policies.ts index 7e22a6cc36..c2caed4005 100644 --- a/src/resources/alerting/policies.ts +++ b/src/resources/alerting/policies.ts @@ -35,7 +35,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.update( - * '0da2b59ef118439d8097bdfb215203c9', + * '0da2b59e-f118-439d-8097-bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -85,7 +85,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.delete( - * '0da2b59ef118439d8097bdfb215203c9', + * '0da2b59e-f118-439d-8097-bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -105,7 +105,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.get( - * '0da2b59ef118439d8097bdfb215203c9', + * '0da2b59e-f118-439d-8097-bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -211,7 +211,6 @@ export interface Policy { * possible values. */ alert_type?: - | 'abuse_report_alert' | 'access_custom_certificate_expiration_type' | 'advanced_ddos_attack_l4_alert' | 'advanced_ddos_attack_l7_alert' @@ -521,11 +520,6 @@ export interface PolicyFilter { */ tunnel_name?: Array; - /** - * Usage depends on specific alert type - */ - type?: Array; - /** * Usage depends on specific alert type */ @@ -745,11 +739,6 @@ export interface PolicyFilterParam { */ tunnel_name?: Array; - /** - * Usage depends on specific alert type - */ - type?: Array; - /** * Usage depends on specific alert type */ @@ -836,7 +825,6 @@ export interface PolicyCreateParams { * possible values. */ alert_type: - | 'abuse_report_alert' | 'access_custom_certificate_expiration_type' | 'advanced_ddos_attack_l4_alert' | 'advanced_ddos_attack_l7_alert' @@ -958,7 +946,6 @@ export interface PolicyUpdateParams { * possible values. */ alert_type?: - | 'abuse_report_alert' | 'access_custom_certificate_expiration_type' | 'advanced_ddos_attack_l4_alert' | 'advanced_ddos_attack_l7_alert' diff --git a/src/resources/cloudforce-one/threat-events/index.ts b/src/resources/cloudforce-one/threat-events/index.ts index d797682ddd..02c8bab160 100644 --- a/src/resources/cloudforce-one/threat-events/index.ts +++ b/src/resources/cloudforce-one/threat-events/index.ts @@ -36,7 +36,11 @@ export { type EventTagCreateParams, type EventTagDeleteParams, } from './event-tags'; -export { IndicatorTypes } from './indicator-types'; +export { + IndicatorTypes, + type IndicatorTypeListResponse, + type IndicatorTypeListParams, +} from './indicator-types'; export { Insights } from './insights'; export { Raw, type RawEditResponse, type RawGetResponse, type RawEditParams, type RawGetParams } from './raw'; export { Relate, type RelateDeleteResponse, type RelateDeleteParams } from './relate'; diff --git a/src/resources/cloudforce-one/threat-events/indicator-types.ts b/src/resources/cloudforce-one/threat-events/indicator-types.ts index 99e5ccc453..7fa1b77a16 100644 --- a/src/resources/cloudforce-one/threat-events/indicator-types.ts +++ b/src/resources/cloudforce-one/threat-events/indicator-types.ts @@ -1,5 +1,51 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; -export class IndicatorTypes extends APIResource {} +export class IndicatorTypes extends APIResource { + /** + * Lists all indicator types + * + * @example + * ```ts + * const indicatorTypes = + * await client.cloudforceOne.threatEvents.indicatorTypes.list( + * { account_id: 'account_id' }, + * ); + * ``` + */ + list( + params: IndicatorTypeListParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.get(`/accounts/${account_id}/cloudforce-one/events/indicatorTypes`, options); + } +} + +export interface IndicatorTypeListResponse { + items: IndicatorTypeListResponse.Items; + + type: string; +} + +export namespace IndicatorTypeListResponse { + export interface Items { + type: string; + } +} + +export interface IndicatorTypeListParams { + /** + * Account ID. + */ + account_id: string; +} + +export declare namespace IndicatorTypes { + export { + type IndicatorTypeListResponse as IndicatorTypeListResponse, + type IndicatorTypeListParams as IndicatorTypeListParams, + }; +} diff --git a/src/resources/cloudforce-one/threat-events/threat-events.ts b/src/resources/cloudforce-one/threat-events/threat-events.ts index d23c37b5db..119f0b95d8 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -31,7 +31,7 @@ import { EventTags, } from './event-tags'; import * as IndicatorTypesAPI from './indicator-types'; -import { IndicatorTypes } from './indicator-types'; +import { IndicatorTypeListParams, IndicatorTypeListResponse, IndicatorTypes } from './indicator-types'; import * as InsightsAPI from './insights'; import { Insights } from './insights'; import * as RawAPI from './raw'; @@ -821,7 +821,11 @@ export declare namespace ThreatEvents { type DatasetRawParams as DatasetRawParams, }; - export { IndicatorTypes as IndicatorTypes }; + export { + IndicatorTypes as IndicatorTypes, + type IndicatorTypeListResponse as IndicatorTypeListResponse, + type IndicatorTypeListParams as IndicatorTypeListParams, + }; export { RawAPIRaw as Raw, diff --git a/src/resources/custom-pages.ts b/src/resources/custom-pages.ts index 4c861b1e41..6bd1b13cf7 100644 --- a/src/resources/custom-pages.ts +++ b/src/resources/custom-pages.ts @@ -24,15 +24,13 @@ export class CustomPages extends APIResource { */ update( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', params: CustomPageUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { @@ -125,42 +123,36 @@ export class CustomPages extends APIResource { */ get( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', params?: CustomPageGetParams, options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', params: CustomPageGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { diff --git a/src/resources/email-security/investigate/investigate.ts b/src/resources/email-security/investigate/investigate.ts index 7093627a0f..a15d9630ba 100644 --- a/src/resources/email-security/investigate/investigate.ts +++ b/src/resources/email-security/investigate/investigate.ts @@ -199,33 +199,10 @@ export namespace InvestigateListResponse { } export interface Finding { - attachment?: string | null; - detail?: string | null; - detection?: - | 'MALICIOUS' - | 'MALICIOUS-BEC' - | 'SUSPICIOUS' - | 'SPOOF' - | 'SPAM' - | 'BULK' - | 'ENCRYPTED' - | 'EXTERNAL' - | 'UNKNOWN' - | 'NONE' - | null; - - field?: string | null; - name?: string | null; - portion?: string | null; - - reason?: string | null; - - score?: number | null; - value?: string | null; } @@ -344,33 +321,10 @@ export namespace InvestigateGetResponse { } export interface Finding { - attachment?: string | null; - detail?: string | null; - detection?: - | 'MALICIOUS' - | 'MALICIOUS-BEC' - | 'SUSPICIOUS' - | 'SPOOF' - | 'SPAM' - | 'BULK' - | 'ENCRYPTED' - | 'EXTERNAL' - | 'UNKNOWN' - | 'NONE' - | null; - - field?: string | null; - name?: string | null; - portion?: string | null; - - reason?: string | null; - - score?: number | null; - value?: string | null; } 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 f8b3034d84..c581632a76 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 a4db89243d..138942ad57 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. @@ -99,12 +120,12 @@ export interface Key { /** * 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 +135,49 @@ 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 { + /** + * The metadata associated with the key. + */ + metadata: unknown; + + /** + * The value associated with the key. + */ + 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,26 +189,27 @@ export interface KeyBulkUpdateResponse { export interface KeyListParams extends CursorPaginationAfterParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; /** - * Query param: The number of keys to return. The cursor attribute may be used to - * iterate over the next batch of keys if there are more than the limit. + * 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: 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; @@ -157,9 +219,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; @@ -172,39 +256,38 @@ 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. + * Arbitrary JSON that is associated with a key. */ - value?: string; + metadata?: unknown; } } @@ -214,10 +297,12 @@ export declare namespace Keys { export { type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, + type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorPaginationAfter as KeysCursorPaginationAfter, 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..927ba8a17d 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -37,11 +37,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 3ec43aa7c5..df179e53bb 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' }], * }, * ); * ``` @@ -240,13 +272,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 +286,49 @@ 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 { + /** + * The metadata associated with the key. + */ + metadata: unknown; + + /** + * The value associated with the key. + */ + 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 +340,7 @@ export interface NamespaceBulkUpdateResponse { export interface NamespaceCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -282,7 +352,7 @@ export interface NamespaceCreateParams { export interface NamespaceUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -294,7 +364,7 @@ export interface NamespaceUpdateParams { export interface NamespaceListParams extends V4PagePaginationArrayParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -311,14 +381,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 +398,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 +435,44 @@ 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. + * Arbitrary JSON that is associated with a key. */ - value?: string; + metadata?: unknown; } } export interface NamespaceGetParams { /** - * Identifier + * Identifier. */ account_id: string; } @@ -390,14 +481,14 @@ Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; Namespaces.Keys = Keys; Namespaces.KeysCursorPaginationAfter = KeysCursorPaginationAfter; 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 +496,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 +505,12 @@ export declare namespace Namespaces { Keys as Keys, type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, + type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorPaginationAfter as KeysCursorPaginationAfter, type KeyListParams as KeyListParams, type KeyBulkDeleteParams as KeyBulkDeleteParams, + type KeyBulkGetParams as KeyBulkGetParams, type KeyBulkUpdateParams as KeyBulkUpdateParams, }; @@ -427,7 +521,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 1fa5ff39ed..49566f425a 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,13 +37,8 @@ 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, - __multipartSyntax: 'json', - ...options, - headers: { 'Content-Type': '*/*', ...options?.headers }, - }), + Core.multipartFormRequestOptions({ query: { expiration, expiration_ttl }, body, + __multipartSyntax: 'json', ...options }), ) as Core.APIPromise<{ result: ValueUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } @@ -120,43 +114,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: Associates arbitrary JSON data with a key/value pair. + */ + metadata?: unknown; } export interface ValueDeleteParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface ValueGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/leaked-credential-checks/detections.ts b/src/resources/leaked-credential-checks/detections.ts index 2a6de390ad..ca2e008bd9 100644 --- a/src/resources/leaked-credential-checks/detections.ts +++ b/src/resources/leaked-credential-checks/detections.ts @@ -1,5 +1,243 @@ // 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 Detections extends APIResource {} +export class Detections extends APIResource { + /** + * Create user-defined detection pattern for Leaked Credential Checks. + * + * @example + * ```ts + * const detection = + * await client.leakedCredentialChecks.detections.create({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create( + params: DetectionCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/leaked-credential-checks/detections`, { + body, + ...options, + }) as Core.APIPromise<{ result: DetectionCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update user-defined detection pattern for Leaked Credential Checks. + * + * @example + * ```ts + * const detection = + * await client.leakedCredentialChecks.detections.update( + * '18a14bafaa8eb1df04ce683ec18c765e', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + update( + detectionId: string, + params: DetectionUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.put(`/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: DetectionUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List user-defined detection patterns for Leaked Credential Checks. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const detectionListResponse of client.leakedCredentialChecks.detections.list( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: DetectionListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { zone_id } = params; + return this._client.getAPIList( + `/zones/${zone_id}/leaked-credential-checks/detections`, + DetectionListResponsesSinglePage, + options, + ); + } + + /** + * Remove user-defined detection pattern for Leaked Credential Checks. + * + * @example + * ```ts + * const detection = + * await client.leakedCredentialChecks.detections.delete( + * '18a14bafaa8eb1df04ce683ec18c765e', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + detectionId: string, + params: DetectionDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.delete( + `/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, + options, + ) as Core.APIPromise<{ result: DetectionDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class DetectionListResponsesSinglePage extends SinglePage {} + +/** + * Defines a custom set of username/password expressions to match Leaked Credential + * Checks on. + */ +export interface DetectionCreateResponse { + /** + * Defines the unique ID for this custom detection. + */ + id?: string; + + /** + * Defines ehe ruleset expression to use in matching the password in a request. + */ + password?: string; + + /** + * Defines the ruleset expression to use in matching the username in a request. + */ + username?: string; +} + +/** + * Defines a custom set of username/password expressions to match Leaked Credential + * Checks on. + */ +export interface DetectionUpdateResponse { + /** + * Defines the unique ID for this custom detection. + */ + id?: string; + + /** + * Defines ehe ruleset expression to use in matching the password in a request. + */ + password?: string; + + /** + * Defines the ruleset expression to use in matching the username in a request. + */ + username?: string; +} + +/** + * Defines a custom set of username/password expressions to match Leaked Credential + * Checks on. + */ +export interface DetectionListResponse { + /** + * Defines the unique ID for this custom detection. + */ + id?: string; + + /** + * Defines ehe ruleset expression to use in matching the password in a request. + */ + password?: string; + + /** + * Defines the ruleset expression to use in matching the username in a request. + */ + username?: string; +} + +export type DetectionDeleteResponse = unknown; + +export interface DetectionCreateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: Defines ehe ruleset expression to use in matching the password in a + * request. + */ + password?: string; + + /** + * Body param: Defines the ruleset expression to use in matching the username in a + * request. + */ + username?: string; +} + +export interface DetectionUpdateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: Defines ehe ruleset expression to use in matching the password in a + * request. + */ + password?: string; + + /** + * Body param: Defines the ruleset expression to use in matching the username in a + * request. + */ + username?: string; +} + +export interface DetectionListParams { + /** + * Defines an identifier. + */ + zone_id: string; +} + +export interface DetectionDeleteParams { + /** + * Defines an identifier. + */ + zone_id: string; +} + +Detections.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; + +export declare namespace Detections { + export { + type DetectionCreateResponse as DetectionCreateResponse, + type DetectionUpdateResponse as DetectionUpdateResponse, + type DetectionListResponse as DetectionListResponse, + type DetectionDeleteResponse as DetectionDeleteResponse, + DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, + type DetectionCreateParams as DetectionCreateParams, + type DetectionUpdateParams as DetectionUpdateParams, + type DetectionListParams as DetectionListParams, + type DetectionDeleteParams as DetectionDeleteParams, + }; +} diff --git a/src/resources/leaked-credential-checks/index.ts b/src/resources/leaked-credential-checks/index.ts index 7e3e1a0dd7..1844848bf2 100644 --- a/src/resources/leaked-credential-checks/index.ts +++ b/src/resources/leaked-credential-checks/index.ts @@ -1,4 +1,15 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Detections } from './detections'; +export { + DetectionListResponsesSinglePage, + Detections, + type DetectionCreateResponse, + type DetectionUpdateResponse, + type DetectionListResponse, + type DetectionDeleteResponse, + type DetectionCreateParams, + type DetectionUpdateParams, + type DetectionListParams, + type DetectionDeleteParams, +} from './detections'; export { LeakedCredentialChecks } from './leaked-credential-checks'; diff --git a/src/resources/leaked-credential-checks/leaked-credential-checks.ts b/src/resources/leaked-credential-checks/leaked-credential-checks.ts index c89821160c..d8d8de90c1 100644 --- a/src/resources/leaked-credential-checks/leaked-credential-checks.ts +++ b/src/resources/leaked-credential-checks/leaked-credential-checks.ts @@ -1,15 +1,132 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; +import * as Core from '../../core'; import * as DetectionsAPI from './detections'; -import { Detections } from './detections'; +import { + DetectionCreateParams, + DetectionCreateResponse, + DetectionDeleteParams, + DetectionDeleteResponse, + DetectionListParams, + DetectionListResponse, + DetectionListResponsesSinglePage, + DetectionUpdateParams, + DetectionUpdateResponse, + Detections, +} from './detections'; export class LeakedCredentialChecks extends APIResource { detections: DetectionsAPI.Detections = new DetectionsAPI.Detections(this._client); + + /** + * Updates the current status of Leaked Credential Checks. + * + * @example + * ```ts + * const leakedCredentialCheck = + * await client.leakedCredentialChecks.create({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create( + params: LeakedCredentialCheckCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/leaked-credential-checks`, { + body, + ...options, + }) as Core.APIPromise<{ result: LeakedCredentialCheckCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the current status of Leaked Credential Checks. + * + * @example + * ```ts + * const leakedCredentialCheck = + * await client.leakedCredentialChecks.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + get( + params: LeakedCredentialCheckGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.get(`/zones/${zone_id}/leaked-credential-checks`, options) as Core.APIPromise<{ + result: LeakedCredentialCheckGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +/** + * Defines the overall status for Leaked Credential Checks. + */ +export interface LeakedCredentialCheckCreateResponse { + /** + * Determines whether or not Leaked Credential Checks are enabled. + */ + enabled?: boolean; +} + +/** + * Defines the overall status for Leaked Credential Checks. + */ +export interface LeakedCredentialCheckGetResponse { + /** + * Determines whether or not Leaked Credential Checks are enabled. + */ + enabled?: boolean; +} + +export interface LeakedCredentialCheckCreateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: Determines whether or not Leaked Credential Checks are enabled. + */ + enabled?: boolean; +} + +export interface LeakedCredentialCheckGetParams { + /** + * Defines an identifier. + */ + zone_id: string; } LeakedCredentialChecks.Detections = Detections; +LeakedCredentialChecks.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; export declare namespace LeakedCredentialChecks { - export { Detections as Detections }; + export { + type LeakedCredentialCheckCreateResponse as LeakedCredentialCheckCreateResponse, + type LeakedCredentialCheckGetResponse as LeakedCredentialCheckGetResponse, + type LeakedCredentialCheckCreateParams as LeakedCredentialCheckCreateParams, + type LeakedCredentialCheckGetParams as LeakedCredentialCheckGetParams, + }; + + export { + Detections as Detections, + type DetectionCreateResponse as DetectionCreateResponse, + type DetectionUpdateResponse as DetectionUpdateResponse, + type DetectionListResponse as DetectionListResponse, + type DetectionDeleteResponse as DetectionDeleteResponse, + DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, + type DetectionCreateParams as DetectionCreateParams, + type DetectionUpdateParams as DetectionUpdateParams, + type DetectionListParams as DetectionListParams, + type DetectionDeleteParams as DetectionDeleteParams, + }; } 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..6e40d6cfa9 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..5e289166d6 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..6f0ab3dbaa 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/pages/index.ts b/src/resources/pages/index.ts index ede14daf73..2b2862b5c1 100644 --- a/src/resources/pages/index.ts +++ b/src/resources/pages/index.ts @@ -2,7 +2,6 @@ export { DeploymentsSinglePage, - DeploymentsV4PagePaginationArray, Projects, type Deployment, type Project, diff --git a/src/resources/pages/pages.ts b/src/resources/pages/pages.ts index e0331f786f..e92779690f 100644 --- a/src/resources/pages/pages.ts +++ b/src/resources/pages/pages.ts @@ -4,7 +4,7 @@ import { APIResource } from '../../resource'; import * as ProjectsAPI from './projects/projects'; import { Deployment, - DeploymentsV4PagePaginationArray, + DeploymentsSinglePage, Project, ProjectCreateParams, ProjectDeleteParams, @@ -23,7 +23,7 @@ export class Pages extends APIResource { } Pages.Projects = Projects; -Pages.DeploymentsV4PagePaginationArray = DeploymentsV4PagePaginationArray; +Pages.DeploymentsSinglePage = DeploymentsSinglePage; export declare namespace Pages { export { @@ -33,7 +33,7 @@ export declare namespace Pages { type Stage as Stage, type ProjectDeleteResponse as ProjectDeleteResponse, type ProjectPurgeBuildCacheResponse as ProjectPurgeBuildCacheResponse, - DeploymentsV4PagePaginationArray as DeploymentsV4PagePaginationArray, + DeploymentsSinglePage as DeploymentsSinglePage, type ProjectCreateParams as ProjectCreateParams, type ProjectListParams as ProjectListParams, type ProjectDeleteParams as ProjectDeleteParams, diff --git a/src/resources/pages/projects/deployments/deployments.ts b/src/resources/pages/projects/deployments/deployments.ts index e1a307e7bf..97b2b41db9 100644 --- a/src/resources/pages/projects/deployments/deployments.ts +++ b/src/resources/pages/projects/deployments/deployments.ts @@ -192,77 +192,11 @@ export interface DeploymentCreateParams { */ account_id: string; - /** - * Body param: Headers configuration file for the deployment. - */ - _headers?: Core.Uploadable; - - /** - * Body param: Redirects configuration file for the deployment. - */ - _redirects?: Core.Uploadable; - - /** - * Body param: Routes configuration file defining routing rules. - */ - '_routes.json'?: Core.Uploadable; - - /** - * Body param: Worker bundle file in multipart/form-data format. Mutually exclusive - * with `_worker.js`. Cannot specify both `_worker.js` and `_worker.bundle` in the - * same request. Maximum size: 25 MiB. - */ - '_worker.bundle'?: Core.Uploadable; - - /** - * Body param: Worker JavaScript file. Mutually exclusive with `_worker.bundle`. - * Cannot specify both `_worker.js` and `_worker.bundle` in the same request. - */ - '_worker.js'?: Core.Uploadable; - /** * Body param: The branch to build the new deployment from. The `HEAD` of the * branch will be used. If omitted, the production branch will be used by default. */ branch?: string; - - /** - * Body param: Boolean string indicating if the working directory has uncommitted - * changes. - */ - commit_dirty?: 'true' | 'false'; - - /** - * Body param: Git commit SHA associated with this deployment. - */ - commit_hash?: string; - - /** - * Body param: Git commit message associated with this deployment. - */ - commit_message?: string; - - /** - * Body param: Functions routing configuration file. - */ - 'functions-filepath-routing-config.json'?: Core.Uploadable; - - /** - * Body param: JSON string containing a manifest of files to deploy. Maps file - * paths to their content hashes. Required for direct upload deployments. Maximum - * 20,000 entries. - */ - manifest?: string; - - /** - * Body param: The build output directory path. - */ - pages_build_output_dir?: string; - - /** - * Body param: Hash of the Wrangler configuration file used for this deployment. - */ - wrangler_config_hash?: string; } export interface DeploymentListParams { diff --git a/src/resources/pages/projects/index.ts b/src/resources/pages/projects/index.ts index 867a3f7b6b..a40f121ec5 100644 --- a/src/resources/pages/projects/index.ts +++ b/src/resources/pages/projects/index.ts @@ -12,7 +12,6 @@ export { } from './deployments/index'; export { DeploymentsSinglePage, - DeploymentsV4PagePaginationArray, Projects, type Deployment, type Project, diff --git a/src/resources/pages/projects/projects.ts b/src/resources/pages/projects/projects.ts index f14c2e99bf..01225591dc 100644 --- a/src/resources/pages/projects/projects.ts +++ b/src/resources/pages/projects/projects.ts @@ -28,7 +28,7 @@ import { DeploymentRollbackParams, Deployments, } from './deployments/deployments'; -import { SinglePage, V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; +import { SinglePage } from '../../../pagination'; export class Projects extends APIResource { deployments: DeploymentsAPI.Deployments = new DeploymentsAPI.Deployments(this._client); @@ -41,8 +41,6 @@ export class Projects extends APIResource { * ```ts * const project = await client.pages.projects.create({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * name: 'my-pages-app', - * production_branch: 'main', * }); * ``` */ @@ -71,13 +69,9 @@ export class Projects extends APIResource { list( params: ProjectListParams, options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id, ...query } = params; - return this._client.getAPIList( - `/accounts/${account_id}/pages/projects`, - DeploymentsV4PagePaginationArray, - { query, ...options }, - ); + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList(`/accounts/${account_id}/pages/projects`, DeploymentsSinglePage, options); } /** @@ -113,11 +107,7 @@ export class Projects extends APIResource { * ```ts * const project = await client.pages.projects.edit( * 'this-is-my-project-01', - * { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * name: 'my-pages-app', - * production_branch: 'main', - * }, + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ @@ -186,8 +176,6 @@ export class Projects extends APIResource { } } -export class DeploymentsV4PagePaginationArray extends V4PagePaginationArray {} - export class DeploymentsSinglePage extends SinglePage {} export interface Deployment { @@ -221,7 +209,7 @@ export interface Deployment { */ env_vars?: { [key: string]: Deployment.PagesPlainTextEnvVar | null | Deployment.PagesSecretTextEnvVar | null; - } | null; + }; /** * Type of deploy. @@ -371,74 +359,31 @@ export namespace Deployment { export interface Source { config?: Source.Config; - /** - * The source control management provider. - */ - type?: 'github' | 'gitlab'; + type?: string; } export namespace Source { export interface Config { - /** - * @deprecated Use `production_deployments_enabled` and - * `preview_deployment_setting` for more granular control. - */ deployments_enabled?: boolean; - /** - * The owner of the repository. - */ owner?: string; - /** - * A list of paths that should be excluded from triggering a preview deployment. - * Wildcard syntax (`*`) is supported. - */ path_excludes?: Array; - /** - * A list of paths that should be watched to trigger a preview deployment. Wildcard - * syntax (`*`) is supported. - */ path_includes?: Array; - /** - * Whether to enable PR comments. - */ pr_comments_enabled?: boolean; - /** - * A list of branches that should not trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_excludes?: Array; - /** - * A list of branches that should trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_includes?: Array; - /** - * Controls whether commits to preview branches trigger a preview deployment. - */ preview_deployment_setting?: 'all' | 'none' | 'custom'; - /** - * The production branch of the repository. - */ production_branch?: string; - /** - * Whether to trigger a production deployment on commits to the production branch. - */ production_deployments_enabled?: boolean; - /** - * The name of the repository. - */ repo_name?: string; } } @@ -446,27 +391,17 @@ export namespace Deployment { export interface Project { /** - * ID of the project. - */ - id: string; - - /** - * Name of the project. - */ - name: string; - - /** - * Production branch of the project. Used to identify production deployments. + * Id of the project. */ - production_branch: string; + id?: string; /** * Configs for the project build process. */ - build_config?: Project.BuildConfig | null; + build_config?: Project.BuildConfig; /** - * Most recent production deployment of the project. + * Most recent deployment to the repo. */ canonical_deployment?: Deployment | null; @@ -478,7 +413,7 @@ export interface Project { /** * Configs for deployments in a project. */ - deployment_configs?: Project.DeploymentConfigs | null; + deployment_configs?: Project.DeploymentConfigs; /** * A list of associated custom domains for the project. @@ -486,29 +421,19 @@ export interface Project { domains?: Array; /** - * Framework the project is using. - */ - framework?: string; - - /** - * Version of the framework the project is using. - */ - framework_version?: string; - - /** - * Most recent deployment of the project. + * Most recent deployment to the repo. */ latest_deployment?: Deployment | null; /** - * Name of the preview script. + * Name of the project. */ - preview_script_name?: string; + name?: string; /** - * Name of the production script. + * Production branch of the project. Used to identify production deployments. */ - production_script_name?: string; + production_branch?: string; source?: Project.Source; @@ -516,11 +441,6 @@ export interface Project { * The Cloudflare subdomain associated with the project. */ subdomain?: string; - - /** - * Whether the project uses functions. - */ - uses_functions?: boolean; } export namespace Project { @@ -566,12 +486,12 @@ export namespace Project { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview | null; + preview?: DeploymentConfigs.Preview; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production | null; + production?: DeploymentConfigs.Production; } export namespace DeploymentConfigs { @@ -584,11 +504,6 @@ export namespace Project { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; - /** - * Whether to always use the latest compatibility date for Pages Functions. - */ - always_use_latest_compatibility_date?: boolean; - /** * Analytics Engine bindings used for Pages Functions. */ @@ -599,11 +514,6 @@ export namespace Project { */ browsers?: { [key: string]: Preview.Browsers | null } | null; - /** - * The major version of the build image to use for Pages Functions. - */ - build_image_major_version?: number; - /** * Compatibility date used for Pages Functions. */ @@ -612,7 +522,7 @@ export namespace Project { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array | null; + compatibility_flags?: Array; /** * D1 databases used for Pages Functions. @@ -629,12 +539,7 @@ export namespace Project { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - } | null; - - /** - * Whether to fail open when the deployment config cannot be applied. - */ - fail_open?: boolean; + }; /** * Hyperdrive bindings used for Pages Functions. @@ -646,11 +551,6 @@ export namespace Project { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; - /** - * Limits for Pages Functions. - */ - limits?: Preview.Limits | null; - /** * mTLS bindings used for Pages Functions. */ @@ -676,20 +576,10 @@ export namespace Project { */ services?: { [key: string]: Preview.Services | null } | null; - /** - * @deprecated All new projects now use the Standard usage model. - */ - usage_model?: 'standard' | 'bundled' | 'unbound'; - /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; - - /** - * Hash of the Wrangler configuration used for the deployment. - */ - wrangler_config_hash?: string; } export namespace Preview { @@ -776,16 +666,6 @@ export namespace Project { namespace_id?: string; } - /** - * Limits for Pages Functions. - */ - export interface Limits { - /** - * CPU time limit in milliseconds. - */ - cpu_ms?: number; - } - /** * mTLS binding. */ @@ -865,11 +745,6 @@ export namespace Project { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; - /** - * Whether to always use the latest compatibility date for Pages Functions. - */ - always_use_latest_compatibility_date?: boolean; - /** * Analytics Engine bindings used for Pages Functions. */ @@ -880,11 +755,6 @@ export namespace Project { */ browsers?: { [key: string]: Production.Browsers | null } | null; - /** - * The major version of the build image to use for Pages Functions. - */ - build_image_major_version?: number; - /** * Compatibility date used for Pages Functions. */ @@ -893,7 +763,7 @@ export namespace Project { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array | null; + compatibility_flags?: Array; /** * D1 databases used for Pages Functions. @@ -910,12 +780,7 @@ export namespace Project { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - } | null; - - /** - * Whether to fail open when the deployment config cannot be applied. - */ - fail_open?: boolean; + }; /** * Hyperdrive bindings used for Pages Functions. @@ -927,11 +792,6 @@ export namespace Project { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; - /** - * Limits for Pages Functions. - */ - limits?: Production.Limits | null; - /** * mTLS bindings used for Pages Functions. */ @@ -957,20 +817,10 @@ export namespace Project { */ services?: { [key: string]: Production.Services | null } | null; - /** - * @deprecated All new projects now use the Standard usage model. - */ - usage_model?: 'standard' | 'bundled' | 'unbound'; - /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; - - /** - * Hash of the Wrangler configuration used for the deployment. - */ - wrangler_config_hash?: string; } export namespace Production { @@ -1057,16 +907,6 @@ export namespace Project { namespace_id?: string; } - /** - * Limits for Pages Functions. - */ - export interface Limits { - /** - * CPU time limit in milliseconds. - */ - cpu_ms?: number; - } - /** * mTLS binding. */ @@ -1141,74 +981,31 @@ export namespace Project { export interface Source { config?: Source.Config; - /** - * The source control management provider. - */ - type?: 'github' | 'gitlab'; + type?: string; } export namespace Source { export interface Config { - /** - * @deprecated Use `production_deployments_enabled` and - * `preview_deployment_setting` for more granular control. - */ deployments_enabled?: boolean; - /** - * The owner of the repository. - */ owner?: string; - /** - * A list of paths that should be excluded from triggering a preview deployment. - * Wildcard syntax (`*`) is supported. - */ path_excludes?: Array; - /** - * A list of paths that should be watched to trigger a preview deployment. Wildcard - * syntax (`*`) is supported. - */ path_includes?: Array; - /** - * Whether to enable PR comments. - */ pr_comments_enabled?: boolean; - /** - * A list of branches that should not trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_excludes?: Array; - /** - * A list of branches that should trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_includes?: Array; - /** - * Controls whether commits to preview branches trigger a preview deployment. - */ preview_deployment_setting?: 'all' | 'none' | 'custom'; - /** - * The production branch of the repository. - */ production_branch?: string; - /** - * Whether to trigger a production deployment on commits to the production branch. - */ production_deployments_enabled?: boolean; - /** - * The name of the repository. - */ repo_name?: string; } } @@ -1250,25 +1047,25 @@ export interface ProjectCreateParams { account_id: string; /** - * Body param: Name of the project. + * Body param: Configs for the project build process. */ - name: string; + build_config?: ProjectCreateParams.BuildConfig; /** - * Body param: Production branch of the project. Used to identify production - * deployments. + * Body param: Configs for deployments in a project. */ - production_branch: string; + deployment_configs?: ProjectCreateParams.DeploymentConfigs; /** - * Body param: Configs for the project build process. + * Body param: Name of the project. */ - build_config?: ProjectCreateParams.BuildConfig | null; + name?: string; /** - * Body param: Configs for deployments in a project. + * Body param: Production branch of the project. Used to identify production + * deployments. */ - deployment_configs?: ProjectCreateParams.DeploymentConfigs | null; + production_branch?: string; /** * Body param: @@ -1319,12 +1116,12 @@ export namespace ProjectCreateParams { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview | null; + preview?: DeploymentConfigs.Preview; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production | null; + production?: DeploymentConfigs.Production; } export namespace DeploymentConfigs { @@ -1337,11 +1134,6 @@ export namespace ProjectCreateParams { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; - /** - * Whether to always use the latest compatibility date for Pages Functions. - */ - always_use_latest_compatibility_date?: boolean; - /** * Analytics Engine bindings used for Pages Functions. */ @@ -1352,11 +1144,6 @@ export namespace ProjectCreateParams { */ browsers?: { [key: string]: Preview.Browsers | null } | null; - /** - * The major version of the build image to use for Pages Functions. - */ - build_image_major_version?: number; - /** * Compatibility date used for Pages Functions. */ @@ -1365,7 +1152,7 @@ export namespace ProjectCreateParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array | null; + compatibility_flags?: Array; /** * D1 databases used for Pages Functions. @@ -1382,12 +1169,7 @@ export namespace ProjectCreateParams { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - } | null; - - /** - * Whether to fail open when the deployment config cannot be applied. - */ - fail_open?: boolean; + }; /** * Hyperdrive bindings used for Pages Functions. @@ -1399,11 +1181,6 @@ export namespace ProjectCreateParams { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; - /** - * Limits for Pages Functions. - */ - limits?: Preview.Limits | null; - /** * mTLS bindings used for Pages Functions. */ @@ -1429,20 +1206,10 @@ export namespace ProjectCreateParams { */ services?: { [key: string]: Preview.Services | null } | null; - /** - * @deprecated All new projects now use the Standard usage model. - */ - usage_model?: 'standard' | 'bundled' | 'unbound'; - /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; - - /** - * Hash of the Wrangler configuration used for the deployment. - */ - wrangler_config_hash?: string; } export namespace Preview { @@ -1529,16 +1296,6 @@ export namespace ProjectCreateParams { namespace_id?: string; } - /** - * Limits for Pages Functions. - */ - export interface Limits { - /** - * CPU time limit in milliseconds. - */ - cpu_ms?: number; - } - /** * mTLS binding. */ @@ -1618,11 +1375,6 @@ export namespace ProjectCreateParams { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; - /** - * Whether to always use the latest compatibility date for Pages Functions. - */ - always_use_latest_compatibility_date?: boolean; - /** * Analytics Engine bindings used for Pages Functions. */ @@ -1633,11 +1385,6 @@ export namespace ProjectCreateParams { */ browsers?: { [key: string]: Production.Browsers | null } | null; - /** - * The major version of the build image to use for Pages Functions. - */ - build_image_major_version?: number; - /** * Compatibility date used for Pages Functions. */ @@ -1646,7 +1393,7 @@ export namespace ProjectCreateParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array | null; + compatibility_flags?: Array; /** * D1 databases used for Pages Functions. @@ -1663,12 +1410,7 @@ export namespace ProjectCreateParams { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - } | null; - - /** - * Whether to fail open when the deployment config cannot be applied. - */ - fail_open?: boolean; + }; /** * Hyperdrive bindings used for Pages Functions. @@ -1680,11 +1422,6 @@ export namespace ProjectCreateParams { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; - /** - * Limits for Pages Functions. - */ - limits?: Production.Limits | null; - /** * mTLS bindings used for Pages Functions. */ @@ -1710,20 +1447,10 @@ export namespace ProjectCreateParams { */ services?: { [key: string]: Production.Services | null } | null; - /** - * @deprecated All new projects now use the Standard usage model. - */ - usage_model?: 'standard' | 'bundled' | 'unbound'; - /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; - - /** - * Hash of the Wrangler configuration used for the deployment. - */ - wrangler_config_hash?: string; } export namespace Production { @@ -1810,16 +1537,6 @@ export namespace ProjectCreateParams { namespace_id?: string; } - /** - * Limits for Pages Functions. - */ - export interface Limits { - /** - * CPU time limit in milliseconds. - */ - cpu_ms?: number; - } - /** * mTLS binding. */ @@ -1894,82 +1611,39 @@ export namespace ProjectCreateParams { export interface Source { config?: Source.Config; - /** - * The source control management provider. - */ - type?: 'github' | 'gitlab'; + type?: string; } export namespace Source { export interface Config { - /** - * @deprecated Use `production_deployments_enabled` and - * `preview_deployment_setting` for more granular control. - */ deployments_enabled?: boolean; - /** - * The owner of the repository. - */ owner?: string; - /** - * A list of paths that should be excluded from triggering a preview deployment. - * Wildcard syntax (`*`) is supported. - */ path_excludes?: Array; - /** - * A list of paths that should be watched to trigger a preview deployment. Wildcard - * syntax (`*`) is supported. - */ path_includes?: Array; - /** - * Whether to enable PR comments. - */ pr_comments_enabled?: boolean; - /** - * A list of branches that should not trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_excludes?: Array; - /** - * A list of branches that should trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_includes?: Array; - /** - * Controls whether commits to preview branches trigger a preview deployment. - */ preview_deployment_setting?: 'all' | 'none' | 'custom'; - /** - * The production branch of the repository. - */ production_branch?: string; - /** - * Whether to trigger a production deployment on commits to the production branch. - */ production_deployments_enabled?: boolean; - /** - * The name of the repository. - */ repo_name?: string; } } } -export interface ProjectListParams extends V4PagePaginationArrayParams { +export interface ProjectListParams { /** - * Path param: Identifier + * Identifier */ account_id: string; } @@ -1988,25 +1662,25 @@ export interface ProjectEditParams { account_id: string; /** - * Body param: Name of the project. + * Body param: Configs for the project build process. */ - name: string; + build_config?: ProjectEditParams.BuildConfig; /** - * Body param: Production branch of the project. Used to identify production - * deployments. + * Body param: Configs for deployments in a project. */ - production_branch: string; + deployment_configs?: ProjectEditParams.DeploymentConfigs; /** - * Body param: Configs for the project build process. + * Body param: Name of the project. */ - build_config?: ProjectEditParams.BuildConfig | null; + name?: string; /** - * Body param: Configs for deployments in a project. + * Body param: Production branch of the project. Used to identify production + * deployments. */ - deployment_configs?: ProjectEditParams.DeploymentConfigs | null; + production_branch?: string; /** * Body param: @@ -2057,12 +1731,12 @@ export namespace ProjectEditParams { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview | null; + preview?: DeploymentConfigs.Preview; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production | null; + production?: DeploymentConfigs.Production; } export namespace DeploymentConfigs { @@ -2075,11 +1749,6 @@ export namespace ProjectEditParams { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; - /** - * Whether to always use the latest compatibility date for Pages Functions. - */ - always_use_latest_compatibility_date?: boolean; - /** * Analytics Engine bindings used for Pages Functions. */ @@ -2090,11 +1759,6 @@ export namespace ProjectEditParams { */ browsers?: { [key: string]: Preview.Browsers | null } | null; - /** - * The major version of the build image to use for Pages Functions. - */ - build_image_major_version?: number; - /** * Compatibility date used for Pages Functions. */ @@ -2103,7 +1767,7 @@ export namespace ProjectEditParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array | null; + compatibility_flags?: Array; /** * D1 databases used for Pages Functions. @@ -2120,12 +1784,7 @@ export namespace ProjectEditParams { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - } | null; - - /** - * Whether to fail open when the deployment config cannot be applied. - */ - fail_open?: boolean; + }; /** * Hyperdrive bindings used for Pages Functions. @@ -2137,11 +1796,6 @@ export namespace ProjectEditParams { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; - /** - * Limits for Pages Functions. - */ - limits?: Preview.Limits | null; - /** * mTLS bindings used for Pages Functions. */ @@ -2167,20 +1821,10 @@ export namespace ProjectEditParams { */ services?: { [key: string]: Preview.Services | null } | null; - /** - * @deprecated All new projects now use the Standard usage model. - */ - usage_model?: 'standard' | 'bundled' | 'unbound'; - /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; - - /** - * Hash of the Wrangler configuration used for the deployment. - */ - wrangler_config_hash?: string; } export namespace Preview { @@ -2267,16 +1911,6 @@ export namespace ProjectEditParams { namespace_id?: string; } - /** - * Limits for Pages Functions. - */ - export interface Limits { - /** - * CPU time limit in milliseconds. - */ - cpu_ms?: number; - } - /** * mTLS binding. */ @@ -2356,11 +1990,6 @@ export namespace ProjectEditParams { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; - /** - * Whether to always use the latest compatibility date for Pages Functions. - */ - always_use_latest_compatibility_date?: boolean; - /** * Analytics Engine bindings used for Pages Functions. */ @@ -2371,11 +2000,6 @@ export namespace ProjectEditParams { */ browsers?: { [key: string]: Production.Browsers | null } | null; - /** - * The major version of the build image to use for Pages Functions. - */ - build_image_major_version?: number; - /** * Compatibility date used for Pages Functions. */ @@ -2384,7 +2008,7 @@ export namespace ProjectEditParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array | null; + compatibility_flags?: Array; /** * D1 databases used for Pages Functions. @@ -2401,12 +2025,7 @@ export namespace ProjectEditParams { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - } | null; - - /** - * Whether to fail open when the deployment config cannot be applied. - */ - fail_open?: boolean; + }; /** * Hyperdrive bindings used for Pages Functions. @@ -2418,11 +2037,6 @@ export namespace ProjectEditParams { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; - /** - * Limits for Pages Functions. - */ - limits?: Production.Limits | null; - /** * mTLS bindings used for Pages Functions. */ @@ -2448,20 +2062,10 @@ export namespace ProjectEditParams { */ services?: { [key: string]: Production.Services | null } | null; - /** - * @deprecated All new projects now use the Standard usage model. - */ - usage_model?: 'standard' | 'bundled' | 'unbound'; - /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; - - /** - * Hash of the Wrangler configuration used for the deployment. - */ - wrangler_config_hash?: string; } export namespace Production { @@ -2548,16 +2152,6 @@ export namespace ProjectEditParams { namespace_id?: string; } - /** - * Limits for Pages Functions. - */ - export interface Limits { - /** - * CPU time limit in milliseconds. - */ - cpu_ms?: number; - } - /** * mTLS binding. */ @@ -2632,74 +2226,31 @@ export namespace ProjectEditParams { export interface Source { config?: Source.Config; - /** - * The source control management provider. - */ - type?: 'github' | 'gitlab'; + type?: string; } export namespace Source { export interface Config { - /** - * @deprecated Use `production_deployments_enabled` and - * `preview_deployment_setting` for more granular control. - */ deployments_enabled?: boolean; - /** - * The owner of the repository. - */ owner?: string; - /** - * A list of paths that should be excluded from triggering a preview deployment. - * Wildcard syntax (`*`) is supported. - */ path_excludes?: Array; - /** - * A list of paths that should be watched to trigger a preview deployment. Wildcard - * syntax (`*`) is supported. - */ path_includes?: Array; - /** - * Whether to enable PR comments. - */ pr_comments_enabled?: boolean; - /** - * A list of branches that should not trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_excludes?: Array; - /** - * A list of branches that should trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_includes?: Array; - /** - * Controls whether commits to preview branches trigger a preview deployment. - */ preview_deployment_setting?: 'all' | 'none' | 'custom'; - /** - * The production branch of the repository. - */ production_branch?: string; - /** - * Whether to trigger a production deployment on commits to the production branch. - */ production_deployments_enabled?: boolean; - /** - * The name of the repository. - */ repo_name?: string; } } @@ -2719,7 +2270,7 @@ export interface ProjectPurgeBuildCacheParams { account_id: string; } -Projects.DeploymentsV4PagePaginationArray = DeploymentsV4PagePaginationArray; +Projects.DeploymentsSinglePage = DeploymentsSinglePage; Projects.Deployments = Deployments; Projects.Domains = Domains; Projects.DomainListResponsesSinglePage = DomainListResponsesSinglePage; @@ -2731,7 +2282,7 @@ export declare namespace Projects { type Stage as Stage, type ProjectDeleteResponse as ProjectDeleteResponse, type ProjectPurgeBuildCacheResponse as ProjectPurgeBuildCacheResponse, - DeploymentsV4PagePaginationArray as DeploymentsV4PagePaginationArray, + DeploymentsSinglePage as DeploymentsSinglePage, type ProjectCreateParams as ProjectCreateParams, type ProjectListParams as ProjectListParams, type ProjectDeleteParams as ProjectDeleteParams, diff --git a/src/resources/pipelines.ts b/src/resources/pipelines.ts index cfc4b0add9..02e40368e4 100644 --- a/src/resources/pipelines.ts +++ b/src/resources/pipelines.ts @@ -5,10 +5,29 @@ import * as Core from '../core'; export class Pipelines extends APIResource { /** - * [DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint - * instead. + * Create a new pipeline. * - * @deprecated + * @example + * ```ts + * const pipeline = await client.pipelines.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * destination: { + * batch: {}, + * compression: {}, + * credentials: { + * access_key_id: '', + * endpoint: + * 'https://123f8a8258064ed892a347f173372359.r2.cloudflarestorage.com', + * secret_access_key: '', + * }, + * format: 'json', + * path: { bucket: 'bucket' }, + * type: 'r2', + * }, + * name: 'sample_pipeline', + * source: [{ format: 'json', type: 'type' }], + * }); + * ``` */ create( params: PipelineCreateParams, @@ -23,10 +42,26 @@ export class Pipelines extends APIResource { } /** - * [DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines - * endpoint instead. + * Update an existing pipeline. * - * @deprecated + * @example + * ```ts + * const pipeline = await client.pipelines.update( + * 'sample_pipeline', + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * destination: { + * batch: {}, + * compression: {}, + * format: 'json', + * path: { bucket: 'bucket' }, + * type: 'r2', + * }, + * name: 'sample_pipeline', + * source: [{ format: 'json', type: 'type' }], + * }, + * ); + * ``` */ update( pipelineName: string, @@ -43,10 +78,14 @@ export class Pipelines extends APIResource { } /** - * [DEPRECATED] List, filter, and paginate pipelines in an account. Use the new - * /pipelines/v1/pipelines endpoint instead. + * List, filter, and paginate pipelines in an account. * - * @deprecated + * @example + * ```ts + * const pipelines = await client.pipelines.list({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ list(params: PipelineListParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...query } = params; @@ -54,10 +93,14 @@ export class Pipelines extends APIResource { } /** - * [DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint - * instead. + * Delete a pipeline. * - * @deprecated + * @example + * ```ts + * await client.pipelines.delete('sample_pipeline', { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ delete( pipelineName: string, @@ -72,10 +115,15 @@ export class Pipelines extends APIResource { } /** - * [DEPRECATED] Get configuration of a pipeline. Use the new - * /pipelines/v1/pipelines endpoint instead. + * Get configuration of a pipeline. * - * @deprecated + * @example + * ```ts + * const pipeline = await client.pipelines.get( + * 'sample_pipeline', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ get( pipelineName: string, @@ -92,8 +140,7 @@ export class Pipelines extends APIResource { } /** - * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new - * streams/sinks/pipelines API instead. + * Describes the configuration of a pipeline. */ export interface PipelineCreateResponse { /** @@ -191,10 +238,6 @@ export namespace PipelineCreateResponse { } } - /** - * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API - * instead. - */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -220,10 +263,6 @@ export namespace PipelineCreateResponse { } } - /** - * @deprecated [DEPRECATED] Worker binding source configuration. Use the new - * streams API instead. - */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -235,8 +274,7 @@ export namespace PipelineCreateResponse { } /** - * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new - * streams/sinks/pipelines API instead. + * Describes the configuration of a pipeline. */ export interface PipelineUpdateResponse { /** @@ -334,10 +372,6 @@ export namespace PipelineUpdateResponse { } } - /** - * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API - * instead. - */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -363,10 +397,6 @@ export namespace PipelineUpdateResponse { } } - /** - * @deprecated [DEPRECATED] Worker binding source configuration. Use the new - * streams API instead. - */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -412,8 +442,7 @@ export namespace PipelineListResponse { } /** - * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new - * streams/sinks/pipelines API instead. + * Describes the configuration of a pipeline. */ export interface Result { /** @@ -511,10 +540,6 @@ export namespace PipelineListResponse { } } - /** - * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API - * instead. - */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -540,10 +565,6 @@ export namespace PipelineListResponse { } } - /** - * @deprecated [DEPRECATED] Worker binding source configuration. Use the new - * streams API instead. - */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -556,8 +577,7 @@ export namespace PipelineListResponse { } /** - * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new - * streams/sinks/pipelines API instead. + * Describes the configuration of a pipeline. */ export interface PipelineGetResponse { /** @@ -655,10 +675,6 @@ export namespace PipelineGetResponse { } } - /** - * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API - * instead. - */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -684,10 +700,6 @@ export namespace PipelineGetResponse { } } - /** - * @deprecated [DEPRECATED] Worker binding source configuration. Use the new - * streams API instead. - */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -809,10 +821,6 @@ export namespace PipelineCreateParams { } } - /** - * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API - * instead. - */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -838,10 +846,6 @@ export namespace PipelineCreateParams { } } - /** - * @deprecated [DEPRECATED] Worker binding source configuration. Use the new - * streams API instead. - */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -963,10 +967,6 @@ export namespace PipelineUpdateParams { } } - /** - * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API - * instead. - */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -992,10 +992,6 @@ export namespace PipelineUpdateParams { } } - /** - * @deprecated [DEPRECATED] Worker binding source configuration. Use the new - * streams API instead. - */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. diff --git a/src/resources/queues/consumers.ts b/src/resources/queues/consumers.ts index 93596e00ee..43eae71410 100644 --- a/src/resources/queues/consumers.ts +++ b/src/resources/queues/consumers.ts @@ -106,6 +106,33 @@ export class Consumers extends APIResource { const { account_id } = params; return this._client.delete(`/accounts/${account_id}/queues/${queueId}/consumers/${consumerId}`, options); } + + /** + * Fetches the consumer for a queue by consumer id + * + * @example + * ```ts + * const consumer = await client.queues.consumers.get( + * '023e105f4ecef8ad9ca31a8372d0c353', + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + queueId: string, + consumerId: string, + params: ConsumerGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + 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); + } } export class ConsumersSinglePage extends SinglePage {} @@ -464,6 +491,13 @@ export interface ConsumerDeleteParams { account_id: string; } +export interface ConsumerGetParams { + /** + * A Resource identifier. + */ + account_id: string; +} + Consumers.ConsumersSinglePage = ConsumersSinglePage; export declare namespace Consumers { @@ -475,5 +509,6 @@ export declare namespace Consumers { 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 32568cd469..ebf2923861 100644 --- a/src/resources/queues/index.ts +++ b/src/resources/queues/index.ts @@ -9,15 +9,30 @@ export { type ConsumerUpdateParams, type ConsumerListParams, type ConsumerDeleteParams, + 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'; -export { Subscriptions } from './subscriptions'; +export { + SubscriptionListResponsesV4PagePaginationArray, + Subscriptions, + type SubscriptionCreateResponse, + type SubscriptionUpdateResponse, + type SubscriptionListResponse, + type SubscriptionDeleteResponse, + type SubscriptionCreateParams, + type SubscriptionUpdateParams, + type SubscriptionListParams, + type SubscriptionDeleteParams, +} from './subscriptions'; 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 15d1651711..667ab7a44a 100644 --- a/src/resources/queues/queues.ts +++ b/src/resources/queues/queues.ts @@ -9,6 +9,7 @@ import { ConsumerCreateParams, ConsumerDeleteParams, ConsumerDeleteResponse, + ConsumerGetParams, ConsumerListParams, ConsumerUpdateParams, Consumers, @@ -18,15 +19,29 @@ import * as MessagesAPI from './messages'; import { MessageAckParams, MessageAckResponse, + MessageBulkPushParams, + MessageBulkPushResponse, MessagePullParams, MessagePullResponse, - MessagePullResponsesSinglePage, + MessagePushParams, + MessagePushResponse, Messages, } from './messages'; import * as PurgeAPI from './purge'; import { Purge, PurgeStartParams, PurgeStatusParams, PurgeStatusResponse } from './purge'; import * as SubscriptionsAPI from './subscriptions'; -import { Subscriptions } from './subscriptions'; +import { + SubscriptionCreateParams, + SubscriptionCreateResponse, + SubscriptionDeleteParams, + SubscriptionDeleteResponse, + SubscriptionListParams, + SubscriptionListResponse, + SubscriptionListResponsesV4PagePaginationArray, + SubscriptionUpdateParams, + SubscriptionUpdateResponse, + Subscriptions, +} from './subscriptions'; import { SinglePage } from '../../pagination'; export class Queues extends APIResource { @@ -328,11 +343,11 @@ export interface QueueGetParams { Queues.QueuesSinglePage = QueuesSinglePage; Queues.Messages = Messages; -Queues.MessagePullResponsesSinglePage = MessagePullResponsesSinglePage; Queues.Purge = Purge; Queues.Consumers = Consumers; Queues.ConsumersSinglePage = ConsumersSinglePage; Queues.Subscriptions = Subscriptions; +Queues.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; export declare namespace Queues { export { @@ -350,10 +365,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 { @@ -372,7 +390,19 @@ export declare namespace Queues { type ConsumerUpdateParams as ConsumerUpdateParams, type ConsumerListParams as ConsumerListParams, type ConsumerDeleteParams as ConsumerDeleteParams, + type ConsumerGetParams as ConsumerGetParams, }; - export { Subscriptions as Subscriptions }; + export { + Subscriptions as Subscriptions, + type SubscriptionCreateResponse as SubscriptionCreateResponse, + type SubscriptionUpdateResponse as SubscriptionUpdateResponse, + type SubscriptionListResponse as SubscriptionListResponse, + type SubscriptionDeleteResponse as SubscriptionDeleteResponse, + SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, + type SubscriptionCreateParams as SubscriptionCreateParams, + type SubscriptionUpdateParams as SubscriptionUpdateParams, + type SubscriptionListParams as SubscriptionListParams, + type SubscriptionDeleteParams as SubscriptionDeleteParams, + }; } diff --git a/src/resources/queues/subscriptions.ts b/src/resources/queues/subscriptions.ts index 42d6ea9ea6..3bb405e3fc 100644 --- a/src/resources/queues/subscriptions.ts +++ b/src/resources/queues/subscriptions.ts @@ -1,5 +1,874 @@ // 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 Subscriptions extends APIResource {} +export class Subscriptions extends APIResource { + /** + * Create a new event subscription for a queue + * + * @example + * ```ts + * const subscription = + * await client.queues.subscriptions.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create( + params: SubscriptionCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/event_subscriptions/subscriptions`, { + body, + ...options, + }) as Core.APIPromise<{ result: SubscriptionCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update an existing event subscription + * + * @example + * ```ts + * const subscription = + * await client.queues.subscriptions.update( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + update( + subscriptionId: string, + params: SubscriptionUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.patch(`/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: SubscriptionUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a paginated list of event subscriptions with optional sorting and filtering + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const subscriptionListResponse of client.queues.subscriptions.list( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: SubscriptionListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/event_subscriptions/subscriptions`, + SubscriptionListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Delete an existing event subscription + * + * @example + * ```ts + * const subscription = + * await client.queues.subscriptions.delete( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + subscriptionId: string, + params: SubscriptionDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete( + `/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, + options, + ) as Core.APIPromise<{ result: SubscriptionDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class SubscriptionListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface SubscriptionCreateResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionCreateResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionCreateResponse.MqEventSourceImages + | SubscriptionCreateResponse.MqEventSourceKV + | SubscriptionCreateResponse.MqEventSourceR2 + | SubscriptionCreateResponse.MqEventSourceSuperSlurper + | SubscriptionCreateResponse.MqEventSourceVectorize + | SubscriptionCreateResponse.MqEventSourceWorkersAIModel + | SubscriptionCreateResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionCreateResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionCreateResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionUpdateResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionUpdateResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionUpdateResponse.MqEventSourceImages + | SubscriptionUpdateResponse.MqEventSourceKV + | SubscriptionUpdateResponse.MqEventSourceR2 + | SubscriptionUpdateResponse.MqEventSourceSuperSlurper + | SubscriptionUpdateResponse.MqEventSourceVectorize + | SubscriptionUpdateResponse.MqEventSourceWorkersAIModel + | SubscriptionUpdateResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionUpdateResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionUpdateResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionListResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionListResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionListResponse.MqEventSourceImages + | SubscriptionListResponse.MqEventSourceKV + | SubscriptionListResponse.MqEventSourceR2 + | SubscriptionListResponse.MqEventSourceSuperSlurper + | SubscriptionListResponse.MqEventSourceVectorize + | SubscriptionListResponse.MqEventSourceWorkersAIModel + | SubscriptionListResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionListResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionListResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionDeleteResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionDeleteResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionDeleteResponse.MqEventSourceImages + | SubscriptionDeleteResponse.MqEventSourceKV + | SubscriptionDeleteResponse.MqEventSourceR2 + | SubscriptionDeleteResponse.MqEventSourceSuperSlurper + | SubscriptionDeleteResponse.MqEventSourceVectorize + | SubscriptionDeleteResponse.MqEventSourceWorkersAIModel + | SubscriptionDeleteResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionDeleteResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionDeleteResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionCreateParams { + /** + * Path param: A Resource identifier. + */ + account_id: string; + + /** + * Body param: Destination configuration for the subscription + */ + destination?: SubscriptionCreateParams.Destination; + + /** + * Body param: Whether the subscription is active + */ + enabled?: boolean; + + /** + * Body param: List of event types this subscription handles + */ + events?: Array; + + /** + * Body param: Name of the subscription + */ + name?: string; + + /** + * Body param: Source configuration for the subscription + */ + source?: + | SubscriptionCreateParams.MqEventSourceImages + | SubscriptionCreateParams.MqEventSourceKV + | SubscriptionCreateParams.MqEventSourceR2 + | SubscriptionCreateParams.MqEventSourceSuperSlurper + | SubscriptionCreateParams.MqEventSourceVectorize + | SubscriptionCreateParams.MqEventSourceWorkersAIModel + | SubscriptionCreateParams.MqEventSourceWorkersBuildsWorker + | SubscriptionCreateParams.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionCreateParams { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionUpdateParams { + /** + * Path param: A Resource identifier. + */ + account_id: string; + + /** + * Body param: Destination configuration for the subscription + */ + destination?: SubscriptionUpdateParams.Destination; + + /** + * Body param: Whether the subscription is active + */ + enabled?: boolean; + + /** + * Body param: List of event types this subscription handles + */ + events?: Array; + + /** + * Body param: Name of the subscription + */ + name?: string; +} + +export namespace SubscriptionUpdateParams { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } +} + +export interface SubscriptionListParams extends V4PagePaginationArrayParams { + /** + * Path param: A Resource identifier. + */ + account_id: string; + + /** + * Query param: Sort direction + */ + direction?: 'asc' | 'desc'; + + /** + * Query param: Field to sort by + */ + order?: 'created_at' | 'name' | 'enabled' | 'source'; +} + +export interface SubscriptionDeleteParams { + /** + * A Resource identifier. + */ + account_id: string; +} + +Subscriptions.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; + +export declare namespace Subscriptions { + export { + type SubscriptionCreateResponse as SubscriptionCreateResponse, + type SubscriptionUpdateResponse as SubscriptionUpdateResponse, + type SubscriptionListResponse as SubscriptionListResponse, + type SubscriptionDeleteResponse as SubscriptionDeleteResponse, + SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, + type SubscriptionCreateParams as SubscriptionCreateParams, + type SubscriptionUpdateParams as SubscriptionUpdateParams, + type SubscriptionListParams as SubscriptionListParams, + type SubscriptionDeleteParams as SubscriptionDeleteParams, + }; +} diff --git a/src/resources/r2/super-slurper/connectivity-precheck.ts b/src/resources/r2/super-slurper/connectivity-precheck.ts index 2283824388..654a8193d5 100644 --- a/src/resources/r2/super-slurper/connectivity-precheck.ts +++ b/src/resources/r2/super-slurper/connectivity-precheck.ts @@ -13,12 +13,6 @@ export class ConnectivityPrecheck extends APIResource { * const response = * await client.r2.superSlurper.connectivityPrecheck.source({ * account_id: 'account_id', - * bucket: 'bucket', - * secret: { - * accessKeyId: 'accessKeyId', - * secretAccessKey: 'secretAccessKey', - * }, - * vendor: 's3', * }); * ``` */ @@ -43,12 +37,6 @@ export class ConnectivityPrecheck extends APIResource { * const response = * await client.r2.superSlurper.connectivityPrecheck.target({ * account_id: 'account_id', - * bucket: 'bucket', - * secret: { - * accessKeyId: 'accessKeyId', - * secretAccessKey: 'secretAccessKey', - * }, - * vendor: 'r2', * }); * ``` */ @@ -89,17 +77,7 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket: string; - - /** - * Body param: - */ - secret: R2SlurperS3SourceSchema.Secret; - - /** - * Body param: - */ - vendor: 's3'; + bucket?: string; /** * Body param: @@ -109,19 +87,19 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - pathPrefix?: string | null; + secret?: R2SlurperS3SourceSchema.Secret; /** * Body param: */ - region?: string | null; + vendor?: 's3'; } export namespace R2SlurperS3SourceSchema { export interface Secret { - accessKeyId: string; + accessKeyId?: string; - secretAccessKey: string; + secretAccessKey?: string; } } @@ -134,29 +112,24 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket: string; - - /** - * Body param: - */ - secret: R2SlurperGcsSourceSchema.Secret; + bucket?: string; /** * Body param: */ - vendor: 'gcs'; + secret?: R2SlurperGcsSourceSchema.Secret; /** * Body param: */ - pathPrefix?: string | null; + vendor?: 'gcs'; } export namespace R2SlurperGcsSourceSchema { export interface Secret { - clientEmail: string; + clientEmail?: string; - privateKey: string; + privateKey?: string; } } @@ -169,34 +142,29 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket: string; - - /** - * Body param: - */ - secret: R2SlurperR2SourceSchema.Secret; + bucket?: string; /** * Body param: */ - vendor: SippyAPI.ProviderParam; + jurisdiction?: 'default' | 'eu' | 'fedramp'; /** * Body param: */ - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret?: R2SlurperR2SourceSchema.Secret; /** * Body param: */ - pathPrefix?: string | null; + vendor?: SippyAPI.ProviderParam; } export namespace R2SlurperR2SourceSchema { export interface Secret { - accessKeyId: string; + accessKeyId?: string; - secretAccessKey: string; + secretAccessKey?: string; } } } @@ -210,29 +178,29 @@ export interface ConnectivityPrecheckTargetParams { /** * Body param: */ - bucket: string; + bucket?: string; /** * Body param: */ - secret: ConnectivityPrecheckTargetParams.Secret; + jurisdiction?: 'default' | 'eu' | 'fedramp'; /** * Body param: */ - vendor: SippyAPI.ProviderParam; + secret?: ConnectivityPrecheckTargetParams.Secret; /** * Body param: */ - jurisdiction?: 'default' | 'eu' | 'fedramp'; + vendor?: SippyAPI.ProviderParam; } export namespace ConnectivityPrecheckTargetParams { export interface Secret { - accessKeyId: string; + accessKeyId?: string; - secretAccessKey: string; + secretAccessKey?: string; } } diff --git a/src/resources/r2/super-slurper/jobs/jobs.ts b/src/resources/r2/super-slurper/jobs/jobs.ts index 7732e944b1..0e70bb10e5 100644 --- a/src/resources/r2/super-slurper/jobs/jobs.ts +++ b/src/resources/r2/super-slurper/jobs/jobs.ts @@ -360,80 +360,72 @@ export interface JobCreateParams { export namespace JobCreateParams { export interface R2SlurperS3SourceSchema { - bucket: string; - - secret: R2SlurperS3SourceSchema.Secret; - - vendor: 's3'; + bucket?: string; endpoint?: string | null; - pathPrefix?: string | null; + secret?: R2SlurperS3SourceSchema.Secret; - region?: string | null; + vendor?: 's3'; } export namespace R2SlurperS3SourceSchema { export interface Secret { - accessKeyId: string; + accessKeyId?: string; - secretAccessKey: string; + secretAccessKey?: string; } } export interface R2SlurperGcsSourceSchema { - bucket: string; - - secret: R2SlurperGcsSourceSchema.Secret; + bucket?: string; - vendor: 'gcs'; + secret?: R2SlurperGcsSourceSchema.Secret; - pathPrefix?: string | null; + vendor?: 'gcs'; } export namespace R2SlurperGcsSourceSchema { export interface Secret { - clientEmail: string; + clientEmail?: string; - privateKey: string; + privateKey?: string; } } export interface R2SlurperR2SourceSchema { - bucket: string; - - secret: R2SlurperR2SourceSchema.Secret; - - vendor: SippyAPI.ProviderParam; + bucket?: string; jurisdiction?: 'default' | 'eu' | 'fedramp'; - pathPrefix?: string | null; + secret?: R2SlurperR2SourceSchema.Secret; + + vendor?: SippyAPI.ProviderParam; } export namespace R2SlurperR2SourceSchema { export interface Secret { - accessKeyId: string; + accessKeyId?: string; - secretAccessKey: string; + secretAccessKey?: string; } } export interface Target { - bucket: string; + bucket?: string; - secret: Target.Secret; + jurisdiction?: 'default' | 'eu' | 'fedramp'; - vendor: SippyAPI.ProviderParam; + secret?: Target.Secret; - jurisdiction?: 'default' | 'eu' | 'fedramp'; + vendor?: SippyAPI.ProviderParam; } export namespace Target { export interface Secret { - accessKeyId: string; + accessKeyId?: string; - secretAccessKey: string; + secretAccessKey?: string; } } } diff --git a/src/resources/radar/as112/summary.ts b/src/resources/radar/as112/summary.ts index d6034b19c4..c59fdaeb5a 100644 --- a/src/resources/radar/as112/summary.ts +++ b/src/resources/radar/as112/summary.ts @@ -9,7 +9,10 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by DNSSEC (DNS Security * Extensions) support. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.as112.summary.dnssec(); + * ``` */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -31,7 +34,10 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by EDNS (Extension Mechanisms * for DNS) support. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.as112.summary.edns(); + * ``` */ edns(query?: SummaryEdnsParams, options?: Core.RequestOptions): Core.APIPromise; edns(options?: Core.RequestOptions): Core.APIPromise; @@ -52,7 +58,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by IP version. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.summary.ipVersion(); + * ``` */ ipVersion( query?: SummaryIPVersionParams, @@ -76,7 +86,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by protocol. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.summary.protocol(); + * ``` */ protocol( query?: SummaryProtocolParams, @@ -100,7 +114,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by type. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.summary.queryType(); + * ``` */ queryType( query?: SummaryQueryTypeParams, @@ -124,7 +142,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of AS112 DNS requests classified by response code. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.summary.responseCodes(); + * ``` */ responseCodes( query?: SummaryResponseCodesParams, diff --git a/src/resources/radar/as112/timeseries-groups.ts b/src/resources/radar/as112/timeseries-groups.ts index e5593df35c..a9e2aa049c 100644 --- a/src/resources/radar/as112/timeseries-groups.ts +++ b/src/resources/radar/as112/timeseries-groups.ts @@ -9,7 +9,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by DNSSEC (DNS Security * Extensions) support over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroups.dnssec(); + * ``` */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -34,7 +38,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by EDNS (Extension Mechanisms * for DNS) support over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroups.edns(); + * ``` */ edns( query?: TimeseriesGroupEdnsParams, @@ -58,7 +66,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by IP version over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroups.ipVersion(); + * ``` */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -84,7 +96,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by protocol over * time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroups.protocol(); + * ``` */ protocol( query?: TimeseriesGroupProtocolParams, @@ -108,7 +124,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by type over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroups.queryType(); + * ``` */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -134,7 +154,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by response code * over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroups.responseCodes(); + * ``` */ responseCodes( query?: TimeseriesGroupResponseCodesParams, diff --git a/src/resources/radar/attacks/layer3/summary.ts b/src/resources/radar/attacks/layer3/summary.ts index bc4ccc4c81..73ed7d7c70 100644 --- a/src/resources/radar/attacks/layer3/summary.ts +++ b/src/resources/radar/attacks/layer3/summary.ts @@ -8,7 +8,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.bitrate(); + * ``` */ bitrate( query?: SummaryBitrateParams, @@ -32,7 +36,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.duration(); + * ``` */ duration( query?: SummaryDurationParams, @@ -56,7 +64,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.industry(); + * ``` */ industry( query?: SummaryIndustryParams, @@ -80,7 +92,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.ipVersion(); + * ``` */ ipVersion( query?: SummaryIPVersionParams, @@ -104,7 +120,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.protocol(); + * ``` */ protocol( query?: SummaryProtocolParams, @@ -128,7 +148,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.vector(); + * ``` */ vector(query?: SummaryVectorParams, options?: Core.RequestOptions): Core.APIPromise; vector(options?: Core.RequestOptions): Core.APIPromise; @@ -149,7 +173,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.vertical(); + * ``` */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer3/timeseries-groups.ts b/src/resources/radar/attacks/layer3/timeseries-groups.ts index 9f8d171a40..740bb97cae 100644 --- a/src/resources/radar/attacks/layer3/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer3/timeseries-groups.ts @@ -8,7 +8,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.bitrate(); + * ``` */ bitrate( query?: TimeseriesGroupBitrateParams, @@ -33,7 +37,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.duration(); + * ``` */ duration( query?: TimeseriesGroupDurationParams, @@ -58,7 +66,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.industry(); + * ``` */ industry( query?: TimeseriesGroupIndustryParams, @@ -83,7 +95,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.ipVersion(); + * ``` */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -108,7 +124,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.protocol(); + * ``` */ protocol( query?: TimeseriesGroupProtocolParams, @@ -133,7 +153,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.vector(); + * ``` */ vector( query?: TimeseriesGroupVectorParams, @@ -158,7 +182,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.vertical(); + * ``` */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer7/summary.ts b/src/resources/radar/attacks/layer7/summary.ts index 160eb24dd8..4afa3d68d0 100644 --- a/src/resources/radar/attacks/layer7/summary.ts +++ b/src/resources/radar/attacks/layer7/summary.ts @@ -8,7 +8,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.httpMethod(); + * ``` */ httpMethod( query?: SummaryHTTPMethodParams, @@ -33,7 +37,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.httpVersion(); + * ``` */ httpVersion( query?: SummaryHTTPVersionParams, @@ -58,7 +66,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.industry(); + * ``` */ industry( query?: SummaryIndustryParams, @@ -82,7 +94,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.ipVersion(); + * ``` */ ipVersion( query?: SummaryIPVersionParams, @@ -106,7 +122,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.managedRules(); + * ``` */ managedRules( query?: SummaryManagedRulesParams, @@ -131,7 +151,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.mitigationProduct(); + * ``` */ mitigationProduct( query?: SummaryMitigationProductParams, @@ -156,7 +180,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.vertical(); + * ``` */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer7/timeseries-groups.ts b/src/resources/radar/attacks/layer7/timeseries-groups.ts index ce7c62ce1e..ab7e962788 100644 --- a/src/resources/radar/attacks/layer7/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer7/timeseries-groups.ts @@ -8,7 +8,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.httpMethod(); + * ``` */ httpMethod( query?: TimeseriesGroupHTTPMethodParams, @@ -33,7 +37,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.httpVersion(); + * ``` */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -58,7 +66,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.industry(); + * ``` */ industry( query?: TimeseriesGroupIndustryParams, @@ -83,7 +95,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version used over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.ipVersion(); + * ``` */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -108,7 +124,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.managedRules(); + * ``` */ managedRules( query?: TimeseriesGroupManagedRulesParams, @@ -133,7 +153,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.mitigationProduct(); + * ``` */ mitigationProduct( query?: TimeseriesGroupMitigationProductParams, @@ -158,7 +182,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.vertical(); + * ``` */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/dns/summary.ts b/src/resources/radar/dns/summary.ts index 575afc929b..9bc87aa1f9 100644 --- a/src/resources/radar/dns/summary.ts +++ b/src/resources/radar/dns/summary.ts @@ -8,7 +8,10 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by cache status. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.dns.summary.cacheHit(); + * ``` */ cacheHit( query?: SummaryCacheHitParams, @@ -33,7 +36,10 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.dns.summary.dnssec(); + * ``` */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -55,7 +61,11 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.summary.dnssecAware(); + * ``` */ dnssecAware( query?: SummaryDNSSECAwareParams, @@ -80,7 +90,10 @@ export class Summary extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.dns.summary.dnssecE2E(); + * ``` */ dnssecE2E( query?: SummaryDNSSECE2EParams, @@ -104,7 +117,10 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by IP version. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.dns.summary.ipVersion(); + * ``` */ ipVersion( query?: SummaryIPVersionParams, @@ -128,7 +144,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.summary.matchingAnswer(); + * ``` */ matchingAnswer( query?: SummaryMatchingAnswerParams, @@ -152,7 +172,10 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.dns.summary.protocol(); + * ``` */ protocol( query?: SummaryProtocolParams, @@ -176,7 +199,10 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by type. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.dns.summary.queryType(); + * ``` */ queryType( query?: SummaryQueryTypeParams, @@ -200,7 +226,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by response code. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.summary.responseCode(); + * ``` */ responseCode( query?: SummaryResponseCodeParams, @@ -224,7 +254,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by minimum response TTL. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.summary.responseTTL(); + * ``` */ responseTTL( query?: SummaryResponseTTLParams, diff --git a/src/resources/radar/dns/timeseries-groups.ts b/src/resources/radar/dns/timeseries-groups.ts index 5e1ea8a4e1..9a242a93fb 100644 --- a/src/resources/radar/dns/timeseries-groups.ts +++ b/src/resources/radar/dns/timeseries-groups.ts @@ -8,7 +8,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by cache status over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.cacheHit(); + * ``` */ cacheHit( query?: TimeseriesGroupCacheHitParams, @@ -33,7 +37,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.dnssec(); + * ``` */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -58,7 +66,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.dnssecAware(); + * ``` */ dnssecAware( query?: TimeseriesGroupDNSSECAwareParams, @@ -84,7 +96,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.dnssecE2E(); + * ``` */ dnssecE2E( query?: TimeseriesGroupDNSSECE2EParams, @@ -108,7 +124,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by IP version over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.ipVersion(); + * ``` */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -132,7 +152,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.matchingAnswer(); + * ``` */ matchingAnswer( query?: TimeseriesGroupMatchingAnswerParams, @@ -157,7 +181,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.protocol(); + * ``` */ protocol( query?: TimeseriesGroupProtocolParams, @@ -181,7 +209,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by type over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.queryType(); + * ``` */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -205,7 +237,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by response code over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.responseCode(); + * ``` */ responseCode( query?: TimeseriesGroupResponseCodeParams, @@ -230,7 +266,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by minimum answer TTL over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.responseTTL(); + * ``` */ responseTTL( query?: TimeseriesGroupResponseTTLParams, diff --git a/src/resources/radar/email/routing/summary.ts b/src/resources/radar/email/routing/summary.ts index 00defd2b84..4085dc05e9 100644 --- a/src/resources/radar/email/routing/summary.ts +++ b/src/resources/radar/email/routing/summary.ts @@ -10,7 +10,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.summary.arc(); + * ``` */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -32,7 +36,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.summary.dkim(); + * ``` */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -54,7 +62,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.summary.dmarc(); + * ``` */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -76,7 +88,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted). * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.summary.encrypted(); + * ``` */ encrypted( query?: SummaryEncryptedParams, @@ -100,7 +116,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by IP version. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.summary.ipVersion(); + * ``` */ ipVersion( query?: SummaryIPVersionParams, @@ -125,7 +145,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.summary.spf(); + * ``` */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/email/routing/timeseries-groups.ts b/src/resources/radar/email/routing/timeseries-groups.ts index 3a9801b143..c398945534 100644 --- a/src/resources/radar/email/routing/timeseries-groups.ts +++ b/src/resources/radar/email/routing/timeseries-groups.ts @@ -10,7 +10,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroups.arc(); + * ``` */ arc( query?: TimeseriesGroupARCParams, @@ -36,7 +40,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroups.dkim(); + * ``` */ dkim( query?: TimeseriesGroupDKIMParams, @@ -62,7 +70,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroups.dmarc(); + * ``` */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -88,7 +100,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted) over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroups.encrypted(); + * ``` */ encrypted( query?: TimeseriesGroupEncryptedParams, @@ -113,7 +129,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by IP version over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroups.ipVersion(); + * ``` */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -139,7 +159,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroups.spf(); + * ``` */ spf( query?: TimeseriesGroupSPFParams, diff --git a/src/resources/radar/email/security/summary.ts b/src/resources/radar/email/security/summary.ts index 5136a742ff..3a984c2f4f 100644 --- a/src/resources/radar/email/security/summary.ts +++ b/src/resources/radar/email/security/summary.ts @@ -10,7 +10,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.arc(); + * ``` */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -32,7 +36,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.dkim(); + * ``` */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -54,7 +62,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.dmarc(); + * ``` */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -75,7 +87,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by malicious classification. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.malicious(); + * ``` */ malicious( query?: SummaryMaliciousParams, @@ -99,7 +115,11 @@ export class Summary extends APIResource { /** * Retrieves the proportion of emails by spam classification (spam vs. non-spam). * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.spam(); + * ``` */ spam(query?: SummarySpamParams, options?: Core.RequestOptions): Core.APIPromise; spam(options?: Core.RequestOptions): Core.APIPromise; @@ -121,7 +141,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.spf(); + * ``` */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; @@ -143,7 +167,11 @@ export class Summary extends APIResource { * Retrieves the proportion of emails by spoof classification (spoof vs. * non-spoof). * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.spoof(); + * ``` */ spoof(query?: SummarySpoofParams, options?: Core.RequestOptions): Core.APIPromise; spoof(options?: Core.RequestOptions): Core.APIPromise; @@ -164,7 +192,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by threat categories. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.threatCategory(); + * ``` */ threatCategory( query?: SummaryThreatCategoryParams, @@ -189,7 +221,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by TLS version. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.tlsVersion(); + * ``` */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/email/security/timeseries-groups.ts b/src/resources/radar/email/security/timeseries-groups.ts index aa620088a0..2fb9bbef99 100644 --- a/src/resources/radar/email/security/timeseries-groups.ts +++ b/src/resources/radar/email/security/timeseries-groups.ts @@ -10,7 +10,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.arc(); + * ``` */ arc( query?: TimeseriesGroupARCParams, @@ -36,7 +40,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.dkim(); + * ``` */ dkim( query?: TimeseriesGroupDKIMParams, @@ -62,7 +70,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.dmarc(); + * ``` */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -87,7 +99,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by malicious classification over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.malicious(); + * ``` */ malicious( query?: TimeseriesGroupMaliciousParams, @@ -113,7 +129,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spam classification (spam vs. non-spam) * over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.spam(); + * ``` */ spam( query?: TimeseriesGroupSpamParams, @@ -139,7 +159,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.spf(); + * ``` */ spf( query?: TimeseriesGroupSPFParams, @@ -165,7 +189,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spoof classification (spoof vs. * non-spoof) over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.spoof(); + * ``` */ spoof( query?: TimeseriesGroupSpoofParams, @@ -190,7 +218,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by threat category over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.threatCategory(); + * ``` */ threatCategory( query?: TimeseriesGroupThreatCategoryParams, @@ -215,7 +247,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by TLS version over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.tlsVersion(); + * ``` */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/entities/asns.ts b/src/resources/radar/entities/asns.ts index 7697e9dd84..66ecf4a6e9 100644 --- a/src/resources/radar/entities/asns.ts +++ b/src/resources/radar/entities/asns.ts @@ -194,20 +194,10 @@ export namespace ASNAsSetResponse { */ name: string; - /** - * The AS number following hierarchical AS-SET name - */ - hierarchical_asn?: number; - /** * The inferred AS number of the AS-SET */ - inferred_asn?: number; - - /** - * The AS number matching PeeringDB record - */ - peeringdb_asn?: number; + asn?: number; } } diff --git a/src/resources/radar/netflows/netflows.ts b/src/resources/radar/netflows/netflows.ts index 55c05d441b..c484510bb6 100644 --- a/src/resources/radar/netflows/netflows.ts +++ b/src/resources/radar/netflows/netflows.ts @@ -13,7 +13,7 @@ export class Netflows extends APIResource { * Retrieves the distribution of network traffic (NetFlows) by HTTP vs other * protocols. * - * @deprecated Use [Get Network Traffic Distribution By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/netflows/methods/summary_v2/) instead. + * @deprecated */ summary( query?: NetflowSummaryParams, diff --git a/src/resources/stream/downloads.ts b/src/resources/stream/downloads.ts index 1fd7a50c02..a9d2589f13 100644 --- a/src/resources/stream/downloads.ts +++ b/src/resources/stream/downloads.ts @@ -6,8 +6,7 @@ import * as Core from '../../core'; export class Downloads extends APIResource { /** * Creates a download for a video when a video is ready to view. Use - * `/downloads/{download_type}` instead for type-specific downloads. Available - * types are `default` and `audio`. + * `/downloads/{download_type}` instead for type-specific downloads. * * @example * ```ts @@ -36,7 +35,7 @@ export class Downloads extends APIResource { /** * Delete the downloads for a video. Use `/downloads/{download_type}` instead for - * type-specific downloads. Available types are `default` and `audio`. + * type-specific downloads. * * @example * ```ts diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts index 4af2451c88..8b15a53e2d 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts @@ -168,7 +168,7 @@ export namespace BindingGetResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; 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 78e5e95423..9170366dbd 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -616,7 +616,7 @@ export namespace ScriptUpdateParams { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; 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 216456a041..fea3a53ffc 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -247,7 +247,7 @@ export namespace SettingEditResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -999,7 +999,7 @@ export namespace SettingGetResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -1769,7 +1769,7 @@ export namespace SettingEditParams { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; diff --git a/src/resources/workers/beta/workers/versions.ts b/src/resources/workers/beta/workers/versions.ts index 185cea7033..300510fc56 100644 --- a/src/resources/workers/beta/workers/versions.ts +++ b/src/resources/workers/beta/workers/versions.ts @@ -409,7 +409,7 @@ export namespace Version { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -1263,7 +1263,7 @@ export namespace VersionCreateParams { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; diff --git a/src/resources/workers/beta/workers/workers.ts b/src/resources/workers/beta/workers/workers.ts index d4e49b0055..ba7791704e 100644 --- a/src/resources/workers/beta/workers/workers.ts +++ b/src/resources/workers/beta/workers/workers.ts @@ -193,11 +193,6 @@ export interface Worker { */ observability: Worker.Observability; - /** - * Other resources that reference the Worker and depend on it existing. - */ - references: Worker.References; - /** * Subdomain settings for the Worker. */ @@ -264,139 +259,6 @@ export namespace Worker { } } - /** - * Other resources that reference the Worker and depend on it existing. - */ - export interface References { - /** - * Other Workers that reference the Worker as an outbound for a dispatch namespace. - */ - dispatch_namespace_outbounds: Array; - - /** - * Custom domains connected to the Worker. - */ - domains: Array; - - /** - * Other Workers that reference Durable Object classes implemented by the Worker. - */ - durable_objects: Array; - - /** - * Queues that send messages to the Worker. - */ - queues: Array; - - /** - * Other Workers that reference the Worker using - * [service bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/). - */ - workers: Array; - } - - export namespace References { - export interface DispatchNamespaceOutbound { - /** - * ID of the dispatch namespace. - */ - namespace_id: string; - - /** - * Name of the dispatch namespace. - */ - namespace_name: string; - - /** - * ID of the Worker using the dispatch namespace. - */ - worker_id: string; - - /** - * Name of the Worker using the dispatch namespace. - */ - worker_name: string; - } - - export interface Domain { - /** - * ID of the custom domain. - */ - id: string; - - /** - * ID of the TLS certificate issued for the custom domain. - */ - certificate_id: string; - - /** - * Full hostname of the custom domain, including the zone name. - */ - hostname: string; - - /** - * ID of the zone. - */ - zone_id: string; - - /** - * Name of the zone. - */ - zone_name: string; - } - - export interface DurableObject { - /** - * ID of the Durable Object namespace being used. - */ - namespace_id: string; - - /** - * Name of the Durable Object namespace being used. - */ - namespace_name: string; - - /** - * ID of the Worker using the Durable Object implementation. - */ - worker_id: string; - - /** - * Name of the Worker using the Durable Object implementation. - */ - worker_name: string; - } - - export interface Queue { - /** - * ID of the queue consumer configuration. - */ - queue_consumer_id: string; - - /** - * ID of the queue. - */ - queue_id: string; - - /** - * Name of the queue. - */ - queue_name: string; - } - - export interface Worker { - /** - * ID of the referencing Worker. - */ - id: string; - - /** - * Name of the referencing Worker. - */ - name: string; - } - } - /** * Subdomain settings for the Worker. */ 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/workers/scripts/script-and-version-settings.ts b/src/resources/workers/scripts/script-and-version-settings.ts index d6ef7552ca..05bc7152a0 100644 --- a/src/resources/workers/scripts/script-and-version-settings.ts +++ b/src/resources/workers/scripts/script-and-version-settings.ts @@ -243,7 +243,7 @@ export namespace ScriptAndVersionSettingEditResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -995,7 +995,7 @@ export namespace ScriptAndVersionSettingGetResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -1765,7 +1765,7 @@ export namespace ScriptAndVersionSettingEditParams { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index 70546d5580..d96bb354dc 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -925,7 +925,7 @@ export namespace ScriptUpdateParams { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; diff --git a/src/resources/workers/scripts/versions.ts b/src/resources/workers/scripts/versions.ts index c9027b6f0c..d4334609ad 100644 --- a/src/resources/workers/scripts/versions.ts +++ b/src/resources/workers/scripts/versions.ts @@ -245,7 +245,7 @@ export namespace VersionCreateResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -981,7 +981,7 @@ export namespace VersionGetResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -1634,11 +1634,6 @@ export namespace VersionCreateParams { export namespace Metadata { export interface Annotations { - /** - * Associated alias for a version. - */ - 'workers/alias'?: string; - /** * Human-readable message about the version. Truncated to 100 bytes. */ @@ -1745,7 +1740,7 @@ export namespace VersionCreateParams { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; 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..2740494438 100644 --- a/src/resources/workflows/instances/instances.ts +++ b/src/resources/workflows/instances/instances.ts @@ -1,21 +1,429 @@ // 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: `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. + */ + date_end?: string; + + /** + * Query param: Accepts ISO 8601 with no timezone offsets and in UTC. + */ + date_start?: string; + + /** + * Query param: should only be used when `cursor` is used, defines a new direction + * for the cursor + */ + direction?: 'asc' | 'desc'; + + /** + * 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/devices/dex-tests.ts b/src/resources/zero-trust/devices/dex-tests.ts index 024ac99cae..4446969263 100644 --- a/src/resources/zero-trust/devices/dex-tests.ts +++ b/src/resources/zero-trust/devices/dex-tests.ts @@ -13,10 +13,7 @@ export class DEXTests extends APIResource { * const dexTest = * await client.zeroTrust.devices.dexTests.create({ * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: { - * host: 'https://dash.cloudflare.com', - * kind: 'http', - * }, + * data: {}, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -43,10 +40,7 @@ export class DEXTests extends APIResource { * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: { - * host: 'https://dash.cloudflare.com', - * kind: 'http', - * }, + * data: {}, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -277,24 +271,24 @@ export namespace DEXTestCreateResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -357,24 +351,24 @@ export namespace DEXTestUpdateResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -437,24 +431,24 @@ export namespace DEXTestListResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -522,24 +516,24 @@ export namespace DEXTestDeleteResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -603,24 +597,24 @@ export namespace DEXTestGetResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -686,24 +680,24 @@ export namespace DEXTestCreateParams { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -769,24 +763,24 @@ export namespace DEXTestUpdateParams { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default 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/zero-trust/dex/dex.ts b/src/resources/zero-trust/dex/dex.ts index a500404035..f12a3ad01f 100644 --- a/src/resources/zero-trust/dex/dex.ts +++ b/src/resources/zero-trust/dex/dex.ts @@ -29,7 +29,6 @@ import { FleetStatusLiveParams, FleetStatusLiveResponse, FleetStatusOverTimeParams, - FleetStatusOverTimeResponse, LiveStat, } from './fleet-status/fleet-status'; import * as HTTPTestsAPI from './http-tests/http-tests'; @@ -54,9 +53,6 @@ export class DEX extends APIResource { } export interface DigitalExperienceMonitor { - /** - * API Resource UUID tag. - */ id: string; /** @@ -212,7 +208,6 @@ export declare namespace DEX { FleetStatus as FleetStatus, type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, - type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts index 43f7978b75..a64c26da75 100644 --- a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts +++ b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts @@ -44,25 +44,20 @@ export class FleetStatus extends APIResource { * * @example * ```ts - * const response = - * await client.zeroTrust.dex.fleetStatus.overTime({ - * account_id: '01a7362d577a6c3019a474fd6f485823', - * from: '2023-10-11T00:00:00Z', - * to: '2023-10-11T00:00:00Z', - * }); + * await client.zeroTrust.dex.fleetStatus.overTime({ + * account_id: '01a7362d577a6c3019a474fd6f485823', + * from: '2023-10-11T00:00:00Z', + * to: '2023-10-11T00:00:00Z', + * }); * ``` */ - overTime( - params: FleetStatusOverTimeParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + overTime(params: FleetStatusOverTimeParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...query } = params; - return ( - this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { - query, - ...options, - }) as Core.APIPromise<{ result: FleetStatusOverTimeResponse }> - )._thenUnwrap((obj) => obj.result); + return this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { + query, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); } } @@ -98,53 +93,6 @@ export namespace FleetStatusLiveResponse { } } -export interface FleetStatusOverTimeResponse { - deviceStats?: FleetStatusOverTimeResponse.DeviceStats; -} - -export namespace FleetStatusOverTimeResponse { - export interface DeviceStats { - byMode?: Array; - - byStatus?: Array; - - /** - * Number of unique devices - */ - uniqueDevicesTotal?: number; - } - - export namespace DeviceStats { - export interface ByMode { - /** - * Timestamp in ISO format - */ - timestamp?: string; - - /** - * Number of unique devices - */ - uniqueDevicesTotal?: number; - - value?: string; - } - - export interface ByStatus { - /** - * Timestamp in ISO format - */ - timestamp?: string; - - /** - * Number of unique devices - */ - uniqueDevicesTotal?: number; - - value?: string; - } - } -} - export interface FleetStatusLiveParams { /** * Path param: Unique identifier for account @@ -191,7 +139,6 @@ export declare namespace FleetStatus { export { type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, - type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/index.ts b/src/resources/zero-trust/dex/fleet-status/index.ts index 8bf3ee7730..31cdb34bb8 100644 --- a/src/resources/zero-trust/dex/fleet-status/index.ts +++ b/src/resources/zero-trust/dex/fleet-status/index.ts @@ -10,7 +10,6 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, - type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status'; diff --git a/src/resources/zero-trust/dex/index.ts b/src/resources/zero-trust/dex/index.ts index d0f4eae54c..f97aa02d43 100644 --- a/src/resources/zero-trust/dex/index.ts +++ b/src/resources/zero-trust/dex/index.ts @@ -20,7 +20,6 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, - type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status/index'; diff --git a/src/resources/zones/settings.ts b/src/resources/zones/settings.ts index 4a3ad6c613..0838680bb9 100644 --- a/src/resources/zones/settings.ts +++ b/src/resources/zones/settings.ts @@ -301,8 +301,13 @@ export interface BrowserCacheTTL { id?: 'browser_cache_ttl'; /** - * The number of seconds to cache resources for. Setting this to 0 enables "Respect - * Existing Headers". + * The number of seconds to cache resources for. Minimum values by plan: + * + * - Free: 7200 seconds (2 hours) + * - Pro: 3600 seconds (1 hour) + * - Business: 1 second + * - Enterprise: 1 second Setting this to 0 enables "Respect Existing Headers" and + * is allowed for all plans. */ value?: number; } @@ -314,8 +319,13 @@ export interface BrowserCacheTTLParam { id?: 'browser_cache_ttl'; /** - * The number of seconds to cache resources for. Setting this to 0 enables "Respect - * Existing Headers". + * The number of seconds to cache resources for. Minimum values by plan: + * + * - Free: 7200 seconds (2 hours) + * - Pro: 3600 seconds (1 hour) + * - Business: 1 second + * - Enterprise: 1 second Setting this to 0 enables "Respect Existing Headers" and + * is allowed for all plans. */ value?: number; } @@ -1092,10 +1102,6 @@ export interface PseudoIPV4 { modified_on?: string | null; } -/** - * @deprecated This page rule is deprecated. This functionality is no longer - * supported. - */ export interface ResponseBuffering { /** * Turn on or off whether Cloudflare should wait for an entire file from the origin @@ -1110,10 +1116,6 @@ export interface ResponseBuffering { value?: 'on' | 'off'; } -/** - * @deprecated This page rule is deprecated. This functionality is no longer - * supported. - */ export interface ResponseBufferingParam { /** * Turn on or off whether Cloudflare should wait for an entire file from the origin @@ -2213,8 +2215,10 @@ export namespace SettingEditResponse { } /** - * @deprecated This zone setting is deprecated. This functionality is no longer - * supported. + * Enables or disables buffering of responses from the proxied server. Cloudflare + * may buffer the whole payload to deliver it at once to the client versus allowing + * it to be delivered in chunks. By default, the proxied server streams directly + * and is not buffered by Cloudflare. This is limited to Enterprise Zones. */ export interface ZonesSchemasResponseBuffering { /** @@ -3254,8 +3258,10 @@ export namespace SettingGetResponse { } /** - * @deprecated This zone setting is deprecated. This functionality is no longer - * supported. + * Enables or disables buffering of responses from the proxied server. Cloudflare + * may buffer the whole payload to deliver it at once to the client versus allowing + * it to be delivered in chunks. By default, the proxied server streams directly + * and is not buffered by Cloudflare. This is limited to Enterprise Zones. */ export interface ZonesSchemasResponseBuffering { /** diff --git a/tests/api-resources/alerting/destinations/webhooks.test.ts b/tests/api-resources/alerting/destinations/webhooks.test.ts index f7e64ac407..400214bb31 100644 --- a/tests/api-resources/alerting/destinations/webhooks.test.ts +++ b/tests/api-resources/alerting/destinations/webhooks.test.ts @@ -38,11 +38,14 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('update: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.update('b115d5ec15c641ee8b7692c449b5227b', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'Slack Webhook', - url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', - }); + const responsePromise = client.alerting.destinations.webhooks.update( + 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'Slack Webhook', + url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -54,12 +57,15 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('update: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.update('b115d5ec15c641ee8b7692c449b5227b', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'Slack Webhook', - url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', - secret: 'secret', - }); + const response = await client.alerting.destinations.webhooks.update( + 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'Slack Webhook', + url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + secret: 'secret', + }, + ); }); test('list: only required params', async () => { @@ -82,9 +88,10 @@ describe('resource webhooks', () => { }); test('delete: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.delete('b115d5ec15c641ee8b7692c449b5227b', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.alerting.destinations.webhooks.delete( + 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -95,16 +102,18 @@ describe('resource webhooks', () => { }); test('delete: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.delete('b115d5ec15c641ee8b7692c449b5227b', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const response = await client.alerting.destinations.webhooks.delete( + 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); }); // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('get: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.get('b115d5ec15c641ee8b7692c449b5227b', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.alerting.destinations.webhooks.get( + 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -116,7 +125,7 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('get: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.get('b115d5ec15c641ee8b7692c449b5227b', { + const response = await client.alerting.destinations.webhooks.get('b115d5ec-15c6-41ee-8b76-92c449b5227b', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/alerting/policies.test.ts b/tests/api-resources/alerting/policies.test.ts index c3b23203ae..aed5640624 100644 --- a/tests/api-resources/alerting/policies.test.ts +++ b/tests/api-resources/alerting/policies.test.ts @@ -35,9 +35,9 @@ describe('resource policies', () => { alert_type: 'universal_ssl_event_type', enabled: true, mechanisms: { - email: [{ id: 'id' }], - pagerduty: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], - webhooks: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], + email: [{ id: 'test@example.com' }], + pagerduty: [{ id: 'e8133a15-00a4-4d69-aec1-32f70c51f6e5' }], + webhooks: [{ id: '14cc1190-5d2b-4b98-a696-c424cb2ad05f' }], }, name: 'SSL Notification Event Policy', alert_interval: '30m', @@ -83,7 +83,6 @@ describe('resource policies', () => { traffic_exclusions: ['security_events'], tunnel_id: ['string'], tunnel_name: ['string'], - type: ['string'], where: ['string'], zones: ['string'], }, @@ -92,7 +91,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('update: only required params', async () => { - const responsePromise = client.alerting.policies.update('0da2b59ef118439d8097bdfb215203c9', { + const responsePromise = client.alerting.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -106,7 +105,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('update: required and optional params', async () => { - const response = await client.alerting.policies.update('0da2b59ef118439d8097bdfb215203c9', { + const response = await client.alerting.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', alert_interval: '30m', alert_type: 'universal_ssl_event_type', @@ -153,14 +152,13 @@ describe('resource policies', () => { traffic_exclusions: ['security_events'], tunnel_id: ['string'], tunnel_name: ['string'], - type: ['string'], where: ['string'], zones: ['string'], }, mechanisms: { - email: [{ id: 'id' }], - pagerduty: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], - webhooks: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], + email: [{ id: 'test@example.com' }], + pagerduty: [{ id: 'e8133a15-00a4-4d69-aec1-32f70c51f6e5' }], + webhooks: [{ id: '14cc1190-5d2b-4b98-a696-c424cb2ad05f' }], }, name: 'SSL Notification Event Policy', }); @@ -182,7 +180,7 @@ describe('resource policies', () => { }); test('delete: only required params', async () => { - const responsePromise = client.alerting.policies.delete('0da2b59ef118439d8097bdfb215203c9', { + const responsePromise = client.alerting.policies.delete('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -195,14 +193,14 @@ describe('resource policies', () => { }); test('delete: required and optional params', async () => { - const response = await client.alerting.policies.delete('0da2b59ef118439d8097bdfb215203c9', { + const response = await client.alerting.policies.delete('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('get: only required params', async () => { - const responsePromise = client.alerting.policies.get('0da2b59ef118439d8097bdfb215203c9', { + const responsePromise = client.alerting.policies.get('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -216,7 +214,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('get: required and optional params', async () => { - const response = await client.alerting.policies.get('0da2b59ef118439d8097bdfb215203c9', { + const response = await client.alerting.policies.get('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts b/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts new file mode 100644 index 0000000000..9bd29bee68 --- /dev/null +++ b/tests/api-resources/cloudforce-one/threat-events/indicator-types.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 indicatorTypes', () => { + // TODO: HTTP 401 from prism + test.skip('list: only required params', async () => { + const responsePromise = client.cloudforceOne.threatEvents.indicatorTypes.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); + }); + + // TODO: HTTP 401 from prism + test.skip('list: required and optional params', async () => { + const response = await client.cloudforceOne.threatEvents.indicatorTypes.list({ + account_id: 'account_id', + }); + }); +}); 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..a543062bc0 100644 --- a/tests/api-resources/kv/namespaces/namespaces.test.ts +++ b/tests/api-resources/kv/namespaces/namespaces.test.ts @@ -69,7 +69,7 @@ describe('resource namespaces', () => { direction: 'asc', order: 'id', page: 1, - per_page: 5, + per_page: 1, }); }); @@ -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..03fbaa4b52 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: {}, }); }); diff --git a/tests/api-resources/leaked-credential-checks/detections.test.ts b/tests/api-resources/leaked-credential-checks/detections.test.ts new file mode 100644 index 0000000000..f9a1af0b8e --- /dev/null +++ b/tests/api-resources/leaked-credential-checks/detections.test.ts @@ -0,0 +1,98 @@ +// 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 detections', () => { + test('create: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.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.leakedCredentialChecks.detections.create({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + password: 'lookup_json_string(http.request.body.raw, "secret")', + username: 'lookup_json_string(http.request.body.raw, "user")', + }); + }); + + test('update: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.update( + '18a14bafaa8eb1df04ce683ec18c765e', + { 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('update: required and optional params', async () => { + const response = await client.leakedCredentialChecks.detections.update( + '18a14bafaa8eb1df04ce683ec18c765e', + { + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + password: 'lookup_json_string(http.request.body.raw, "secret")', + username: 'lookup_json_string(http.request.body.raw, "user")', + }, + ); + }); + + test('list: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.list({ + 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('list: required and optional params', async () => { + const response = await client.leakedCredentialChecks.detections.list({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); + + test('delete: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.delete( + '18a14bafaa8eb1df04ce683ec18c765e', + { 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('delete: required and optional params', async () => { + const response = await client.leakedCredentialChecks.detections.delete( + '18a14bafaa8eb1df04ce683ec18c765e', + { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + }); +}); diff --git a/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts b/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts new file mode 100644 index 0000000000..c7c208f9ed --- /dev/null +++ b/tests/api-resources/leaked-credential-checks/leaked-credential-checks.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 leakedCredentialChecks', () => { + test('create: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.create({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + enabled: true, + }); + }); + + test('get: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + }); +}); 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/pages/projects/deployments/deployments.test.ts b/tests/api-resources/pages/projects/deployments/deployments.test.ts index 67899467e8..41d5114e2a 100644 --- a/tests/api-resources/pages/projects/deployments/deployments.test.ts +++ b/tests/api-resources/pages/projects/deployments/deployments.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Cloudflare, { toFile } from 'cloudflare'; +import Cloudflare from 'cloudflare'; import { Response } from 'node-fetch'; const client = new Cloudflare({ @@ -28,19 +28,7 @@ describe('resource deployments', () => { test.skip('create: required and optional params', async () => { const response = await client.pages.projects.deployments.create('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - _headers: await toFile(Buffer.from('# my file contents'), 'README.md'), - _redirects: await toFile(Buffer.from('# my file contents'), 'README.md'), - '_routes.json': await toFile(Buffer.from('# my file contents'), 'README.md'), - '_worker.bundle': await toFile(Buffer.from('# my file contents'), 'README.md'), - '_worker.js': await toFile(Buffer.from('# my file contents'), 'README.md'), branch: 'staging', - commit_dirty: 'false', - commit_hash: 'a1b2c3d4e5f6', - commit_message: 'Update homepage', - 'functions-filepath-routing-config.json': await toFile(Buffer.from('# my file contents'), 'README.md'), - manifest: '{"index.html": "abc123", "style.css": "def456"}', - pages_build_output_dir: 'dist', - wrangler_config_hash: 'wrangler_config_hash', }); }); diff --git a/tests/api-resources/pages/projects/projects.test.ts b/tests/api-resources/pages/projects/projects.test.ts index 4f2c4122e8..2057a0124d 100644 --- a/tests/api-resources/pages/projects/projects.test.ts +++ b/tests/api-resources/pages/projects/projects.test.ts @@ -11,11 +11,7 @@ const client = new Cloudflare({ describe('resource projects', () => { test('create: only required params', async () => { - const responsePromise = client.pages.projects.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'my-pages-app', - production_branch: 'main', - }); + const responsePromise = client.pages.projects.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -28,8 +24,6 @@ describe('resource projects', () => { test('create: required and optional params', async () => { const response = await client.pages.projects.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'my-pages-app', - production_branch: 'main', build_config: { build_caching: true, build_command: 'npm run build', @@ -41,19 +35,15 @@ describe('resource projects', () => { deployment_configs: { preview: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, - always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - build_image_major_version: 3, - compatibility_date: '2025-01-01', + compatibility_date: '2022-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, - fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, - limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -65,25 +55,19 @@ describe('resource projects', () => { service: 'example-worker', }, }, - usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, - wrangler_config_hash: 'abc123def456', }, production: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, - always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - build_image_major_version: 3, - compatibility_date: '2025-01-01', + compatibility_date: '2022-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, - fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, - limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -95,26 +79,26 @@ describe('resource projects', () => { service: 'example-worker', }, }, - usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, - wrangler_config_hash: 'abc123def456', }, }, + name: 'NextJS Blog', + production_branch: 'main', source: { config: { deployments_enabled: true, - owner: 'my-org', + owner: 'owner', path_excludes: ['string'], path_includes: ['string'], pr_comments_enabled: true, preview_branch_excludes: ['string'], preview_branch_includes: ['string'], preview_deployment_setting: 'all', - production_branch: 'main', + production_branch: 'production_branch', production_deployments_enabled: true, - repo_name: 'my-repo', + repo_name: 'repo_name', }, - type: 'github', + type: 'type', }, }); }); @@ -131,11 +115,7 @@ describe('resource projects', () => { }); test('list: required and optional params', async () => { - const response = await client.pages.projects.list({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - page: 1, - per_page: 10, - }); + const response = await client.pages.projects.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); }); test('delete: only required params', async () => { @@ -160,8 +140,6 @@ describe('resource projects', () => { test('edit: only required params', async () => { const responsePromise = client.pages.projects.edit('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'my-pages-app', - production_branch: 'main', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -175,8 +153,6 @@ describe('resource projects', () => { test('edit: required and optional params', async () => { const response = await client.pages.projects.edit('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'my-pages-app', - production_branch: 'main', build_config: { build_caching: true, build_command: 'npm run build', @@ -188,19 +164,15 @@ describe('resource projects', () => { deployment_configs: { preview: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, - always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - build_image_major_version: 3, - compatibility_date: '2025-01-01', + compatibility_date: '2022-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, - fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, - limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -212,25 +184,19 @@ describe('resource projects', () => { service: 'example-worker', }, }, - usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, - wrangler_config_hash: 'abc123def456', }, production: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, - always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - build_image_major_version: 3, - compatibility_date: '2025-01-01', + compatibility_date: '2022-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, - fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, - limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -242,26 +208,26 @@ describe('resource projects', () => { service: 'example-worker', }, }, - usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, - wrangler_config_hash: 'abc123def456', }, }, + name: 'NextJS Blog', + production_branch: 'main', source: { config: { deployments_enabled: true, - owner: 'my-org', + owner: 'owner', path_excludes: ['string'], path_includes: ['string'], pr_comments_enabled: true, preview_branch_excludes: ['string'], preview_branch_includes: ['string'], preview_deployment_setting: 'all', - production_branch: 'main', + production_branch: 'production_branch', production_deployments_enabled: true, - repo_name: 'my-repo', + repo_name: 'repo_name', }, - type: 'github', + type: 'type', }, }); }); diff --git a/tests/api-resources/pipelines.test.ts b/tests/api-resources/pipelines.test.ts index 390a133372..40730e8ec8 100644 --- a/tests/api-resources/pipelines.test.ts +++ b/tests/api-resources/pipelines.test.ts @@ -12,7 +12,7 @@ const client = new Cloudflare({ describe('resource pipelines', () => { test('create: only required params', async () => { const responsePromise = client.pipelines.create({ - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination: { batch: {}, compression: {}, @@ -39,7 +39,7 @@ describe('resource pipelines', () => { test('create: required and optional params', async () => { const response = await client.pipelines.create({ - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination: { batch: { max_bytes: 1000, max_duration_s: 0.25, max_rows: 100 }, compression: { type: 'gzip' }, @@ -64,7 +64,7 @@ describe('resource pipelines', () => { test('update: only required params', async () => { const responsePromise = client.pipelines.update('sample_pipeline', { - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination: { batch: {}, compression: {}, format: 'json', path: { bucket: 'bucket' }, type: 'r2' }, name: 'sample_pipeline', source: [{ format: 'json', type: 'type' }], @@ -80,7 +80,7 @@ describe('resource pipelines', () => { test('update: required and optional params', async () => { const response = await client.pipelines.update('sample_pipeline', { - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination: { batch: { max_bytes: 1000, max_duration_s: 0.25, max_rows: 100 }, compression: { type: 'gzip' }, @@ -104,7 +104,7 @@ describe('resource pipelines', () => { }); test('list: only required params', async () => { - const responsePromise = client.pipelines.list({ account_id: '0123105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = client.pipelines.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -116,7 +116,7 @@ describe('resource pipelines', () => { test('list: required and optional params', async () => { const response = await client.pipelines.list({ - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', page: 'page', per_page: 'per_page', search: 'search', @@ -125,7 +125,7 @@ describe('resource pipelines', () => { test('delete: only required params', async () => { const responsePromise = client.pipelines.delete('sample_pipeline', { - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -138,13 +138,13 @@ describe('resource pipelines', () => { test('delete: required and optional params', async () => { const response = await client.pipelines.delete('sample_pipeline', { - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); test('get: only required params', async () => { const responsePromise = client.pipelines.get('sample_pipeline', { - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -157,7 +157,7 @@ describe('resource pipelines', () => { test('get: required and optional params', async () => { const response = await client.pipelines.get('sample_pipeline', { - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); }); diff --git a/tests/api-resources/queues/consumers.test.ts b/tests/api-resources/queues/consumers.test.ts index 9cff12967c..e4275cc8e0 100644 --- a/tests/api-resources/queues/consumers.test.ts +++ b/tests/api-resources/queues/consumers.test.ts @@ -115,4 +115,27 @@ describe('resource consumers', () => { { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); }); + + test('get: only required params', async () => { + const responsePromise = client.queues.consumers.get( + '023e105f4ecef8ad9ca31a8372d0c353', + '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('get: required and optional params', async () => { + const response = await client.queues.consumers.get( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + }); }); 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/queues/subscriptions.test.ts b/tests/api-resources/queues/subscriptions.test.ts new file mode 100644 index 0000000000..fed29a3ae9 --- /dev/null +++ b/tests/api-resources/queues/subscriptions.test.ts @@ -0,0 +1,101 @@ +// 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 subscriptions', () => { + test('create: only required params', async () => { + const responsePromise = client.queues.subscriptions.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.queues.subscriptions.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + destination: { queue_id: 'queue_id', type: 'queues.queue' }, + enabled: true, + events: ['string'], + name: 'name', + source: { type: 'images' }, + }); + }); + + test('update: only required params', async () => { + const responsePromise = client.queues.subscriptions.update('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('update: required and optional params', async () => { + const response = await client.queues.subscriptions.update('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + destination: { queue_id: 'queue_id', type: 'queues.queue' }, + enabled: true, + events: ['string'], + name: 'name', + }); + }); + + test('list: only required params', async () => { + const responsePromise = client.queues.subscriptions.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.queues.subscriptions.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + direction: 'asc', + order: 'created_at', + page: 1, + per_page: 1, + }); + }); + + test('delete: only required params', async () => { + const responsePromise = client.queues.subscriptions.delete('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('delete: required and optional params', async () => { + const response = await client.queues.subscriptions.delete('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); +}); diff --git a/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts b/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts index 597bcca970..c3238ed19b 100644 --- a/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts +++ b/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts @@ -11,12 +11,7 @@ const client = new Cloudflare({ describe('resource connectivityPrecheck', () => { test('source: only required params', async () => { - const responsePromise = client.r2.superSlurper.connectivityPrecheck.source({ - account_id: 'account_id', - bucket: 'bucket', - secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, - vendor: 's3', - }); + const responsePromise = client.r2.superSlurper.connectivityPrecheck.source({ account_id: 'account_id' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -30,21 +25,14 @@ describe('resource connectivityPrecheck', () => { const response = await client.r2.superSlurper.connectivityPrecheck.source({ account_id: 'account_id', bucket: 'bucket', + endpoint: 'endpoint', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 's3', - endpoint: 'endpoint', - pathPrefix: 'pathPrefix', - region: 'region', }); }); test('target: only required params', async () => { - const responsePromise = client.r2.superSlurper.connectivityPrecheck.target({ - account_id: 'account_id', - bucket: 'bucket', - secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, - vendor: 'r2', - }); + const responsePromise = client.r2.superSlurper.connectivityPrecheck.target({ account_id: 'account_id' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -58,9 +46,9 @@ describe('resource connectivityPrecheck', () => { const response = await client.r2.superSlurper.connectivityPrecheck.target({ account_id: 'account_id', bucket: 'bucket', + jurisdiction: 'default', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 'r2', - jurisdiction: 'default', }); }); }); diff --git a/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts b/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts index e2806bfb82..8376af108a 100644 --- a/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts +++ b/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts @@ -27,17 +27,15 @@ describe('resource jobs', () => { overwrite: true, source: { bucket: 'bucket', + endpoint: 'endpoint', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 's3', - endpoint: 'endpoint', - pathPrefix: 'pathPrefix', - region: 'region', }, target: { bucket: 'bucket', + jurisdiction: 'default', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 'r2', - jurisdiction: 'default', }, }); }); 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/workers/scripts/versions.test.ts b/tests/api-resources/workers/scripts/versions.test.ts index 437f382fd7..82c89f8328 100644 --- a/tests/api-resources/workers/scripts/versions.test.ts +++ b/tests/api-resources/workers/scripts/versions.test.ts @@ -31,11 +31,7 @@ describe('resource versions', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', metadata: { main_module: 'worker.js', - annotations: { - 'workers/alias': 'staging', - 'workers/message': 'Fixed worker code.', - 'workers/tag': 'workers/tag', - }, + annotations: { 'workers/message': 'Fixed worker code.', 'workers/tag': 'workers/tag' }, bindings: [{ name: 'MY_ENV_VAR', text: 'my_data', type: 'plain_text' }], compatibility_date: '2021-01-01', compatibility_flags: ['nodejs_compat'], 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..cdad8d0e4b --- /dev/null +++ b/tests/api-resources/workflows/instances/instances.test.ts @@ -0,0 +1,89 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource 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', + cursor: 'cursor', + date_end: '2019-12-27T18:11:19.117Z', + date_start: '2019-12-27T18:11:19.117Z', + direction: 'asc', + 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' }); + }); +}); diff --git a/tests/api-resources/zero-trust/devices/dex-tests.test.ts b/tests/api-resources/zero-trust/devices/dex-tests.test.ts index 0669d5569c..246e9b7961 100644 --- a/tests/api-resources/zero-trust/devices/dex-tests.test.ts +++ b/tests/api-resources/zero-trust/devices/dex-tests.test.ts @@ -13,7 +13,7 @@ describe('resource dexTests', () => { test('create: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.create({ account_id: '01a7362d577a6c3019a474fd6f485823', - data: { host: 'https://dash.cloudflare.com', kind: 'http' }, + data: {}, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -35,7 +35,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], + target_policies: [{ id: 'id', default: true, name: 'name' }], targeted: true, }); }); @@ -43,7 +43,7 @@ describe('resource dexTests', () => { test('update: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', - data: { host: 'https://dash.cloudflare.com', kind: 'http' }, + data: {}, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -65,7 +65,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], + target_policies: [{ id: 'id', default: true, name: 'name' }], targeted: true, }); }); From 18a17a07a5b38281a0dcebf2b5cbd327b07da3a9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 18:45:10 +0000 Subject: [PATCH 091/451] chore(api): update composite API spec --- .stats.yml | 4 +- api.md | 2 +- .../alerting/destinations/webhooks.ts | 6 +- src/resources/alerting/policies.ts | 19 ++- src/resources/pages/index.ts | 1 + src/resources/pages/pages.ts | 6 +- src/resources/pages/projects/index.ts | 1 + src/resources/pages/projects/projects.ts | 22 ++- .../r2/super-slurper/connectivity-precheck.ts | 76 +++++++--- src/resources/r2/super-slurper/jobs/jobs.ts | 52 ++++--- src/resources/radar/as112/summary.ts | 34 +---- .../radar/as112/timeseries-groups.ts | 36 +---- src/resources/radar/attacks/layer3/summary.ts | 42 +----- .../radar/attacks/layer3/timeseries-groups.ts | 42 +----- src/resources/radar/attacks/layer7/summary.ts | 42 +----- .../radar/attacks/layer7/timeseries-groups.ts | 42 +----- src/resources/radar/dns/summary.ts | 54 ++----- src/resources/radar/dns/timeseries-groups.ts | 60 ++------ src/resources/radar/email/routing/summary.ts | 36 +---- .../radar/email/routing/timeseries-groups.ts | 36 +---- src/resources/radar/email/security/summary.ts | 54 ++----- .../radar/email/security/timeseries-groups.ts | 54 ++----- src/resources/radar/entities/asns.ts | 12 +- src/resources/radar/netflows/netflows.ts | 2 +- src/resources/stream/downloads.ts | 5 +- .../dispatch/namespaces/scripts/bindings.ts | 2 +- .../dispatch/namespaces/scripts/scripts.ts | 2 +- .../dispatch/namespaces/scripts/settings.ts | 6 +- .../workers/beta/workers/versions.ts | 4 +- src/resources/workers/beta/workers/workers.ts | 138 ++++++++++++++++++ .../scripts/script-and-version-settings.ts | 6 +- src/resources/workers/scripts/scripts.ts | 2 +- src/resources/workers/scripts/versions.ts | 11 +- src/resources/zones/settings.ts | 38 ++--- .../alerting/destinations/webhooks.test.ts | 51 +++---- tests/api-resources/alerting/policies.test.ts | 26 ++-- .../pages/projects/projects.test.ts | 6 +- .../connectivity-precheck.test.ts | 20 ++- .../r2/super-slurper/jobs/jobs.test.ts | 6 +- .../workers/scripts/versions.test.ts | 6 +- 40 files changed, 468 insertions(+), 596 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5637fc3e0e..1a151bca80 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ca8fbfa82d19dca400ec61b8c93392de1acd157860e435419f9a5e9ec8c586e0.yml -openapi_spec_hash: 77d55c70bc3824ac61bd056e2319ee18 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c9472ef3c00e81494197d6f2c75d017dfcd5e05157d58f58dd6627771296e92e.yml +openapi_spec_hash: ac68da9645adad028beae1f96328f5bd config_hash: 107e0f1f8a98b007260b319226b88b3c diff --git a/api.md b/api.md index 7ffb0aa433..866462c86c 100644 --- a/api.md +++ b/api.md @@ -3925,7 +3925,7 @@ Types: Methods: - client.pages.projects.create({ ...params }) -> Project -- client.pages.projects.list({ ...params }) -> DeploymentsSinglePage +- client.pages.projects.list({ ...params }) -> DeploymentsV4PagePaginationArray - client.pages.projects.delete(projectName, { ...params }) -> ProjectDeleteResponse | null - client.pages.projects.edit(projectName, { ...params }) -> Project - client.pages.projects.get(projectName, { ...params }) -> Project diff --git a/src/resources/alerting/destinations/webhooks.ts b/src/resources/alerting/destinations/webhooks.ts index 279c67d0bf..605e015ae3 100644 --- a/src/resources/alerting/destinations/webhooks.ts +++ b/src/resources/alerting/destinations/webhooks.ts @@ -35,7 +35,7 @@ export class Webhooks extends APIResource { * ```ts * const webhook = * await client.alerting.destinations.webhooks.update( - * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + * 'b115d5ec15c641ee8b7692c449b5227b', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * name: 'Slack Webhook', @@ -90,7 +90,7 @@ export class Webhooks extends APIResource { * ```ts * const webhook = * await client.alerting.destinations.webhooks.delete( - * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + * 'b115d5ec15c641ee8b7692c449b5227b', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -114,7 +114,7 @@ export class Webhooks extends APIResource { * ```ts * const webhooks = * await client.alerting.destinations.webhooks.get( - * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + * 'b115d5ec15c641ee8b7692c449b5227b', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` diff --git a/src/resources/alerting/policies.ts b/src/resources/alerting/policies.ts index c2caed4005..7e22a6cc36 100644 --- a/src/resources/alerting/policies.ts +++ b/src/resources/alerting/policies.ts @@ -35,7 +35,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.update( - * '0da2b59e-f118-439d-8097-bdfb215203c9', + * '0da2b59ef118439d8097bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -85,7 +85,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.delete( - * '0da2b59e-f118-439d-8097-bdfb215203c9', + * '0da2b59ef118439d8097bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -105,7 +105,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.get( - * '0da2b59e-f118-439d-8097-bdfb215203c9', + * '0da2b59ef118439d8097bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -211,6 +211,7 @@ export interface Policy { * possible values. */ alert_type?: + | 'abuse_report_alert' | 'access_custom_certificate_expiration_type' | 'advanced_ddos_attack_l4_alert' | 'advanced_ddos_attack_l7_alert' @@ -520,6 +521,11 @@ export interface PolicyFilter { */ tunnel_name?: Array; + /** + * Usage depends on specific alert type + */ + type?: Array; + /** * Usage depends on specific alert type */ @@ -739,6 +745,11 @@ export interface PolicyFilterParam { */ tunnel_name?: Array; + /** + * Usage depends on specific alert type + */ + type?: Array; + /** * Usage depends on specific alert type */ @@ -825,6 +836,7 @@ export interface PolicyCreateParams { * possible values. */ alert_type: + | 'abuse_report_alert' | 'access_custom_certificate_expiration_type' | 'advanced_ddos_attack_l4_alert' | 'advanced_ddos_attack_l7_alert' @@ -946,6 +958,7 @@ export interface PolicyUpdateParams { * possible values. */ alert_type?: + | 'abuse_report_alert' | 'access_custom_certificate_expiration_type' | 'advanced_ddos_attack_l4_alert' | 'advanced_ddos_attack_l7_alert' diff --git a/src/resources/pages/index.ts b/src/resources/pages/index.ts index 2b2862b5c1..ede14daf73 100644 --- a/src/resources/pages/index.ts +++ b/src/resources/pages/index.ts @@ -2,6 +2,7 @@ export { DeploymentsSinglePage, + DeploymentsV4PagePaginationArray, Projects, type Deployment, type Project, diff --git a/src/resources/pages/pages.ts b/src/resources/pages/pages.ts index e92779690f..e0331f786f 100644 --- a/src/resources/pages/pages.ts +++ b/src/resources/pages/pages.ts @@ -4,7 +4,7 @@ import { APIResource } from '../../resource'; import * as ProjectsAPI from './projects/projects'; import { Deployment, - DeploymentsSinglePage, + DeploymentsV4PagePaginationArray, Project, ProjectCreateParams, ProjectDeleteParams, @@ -23,7 +23,7 @@ export class Pages extends APIResource { } Pages.Projects = Projects; -Pages.DeploymentsSinglePage = DeploymentsSinglePage; +Pages.DeploymentsV4PagePaginationArray = DeploymentsV4PagePaginationArray; export declare namespace Pages { export { @@ -33,7 +33,7 @@ export declare namespace Pages { type Stage as Stage, type ProjectDeleteResponse as ProjectDeleteResponse, type ProjectPurgeBuildCacheResponse as ProjectPurgeBuildCacheResponse, - DeploymentsSinglePage as DeploymentsSinglePage, + DeploymentsV4PagePaginationArray as DeploymentsV4PagePaginationArray, type ProjectCreateParams as ProjectCreateParams, type ProjectListParams as ProjectListParams, type ProjectDeleteParams as ProjectDeleteParams, diff --git a/src/resources/pages/projects/index.ts b/src/resources/pages/projects/index.ts index a40f121ec5..867a3f7b6b 100644 --- a/src/resources/pages/projects/index.ts +++ b/src/resources/pages/projects/index.ts @@ -12,6 +12,7 @@ export { } from './deployments/index'; export { DeploymentsSinglePage, + DeploymentsV4PagePaginationArray, Projects, type Deployment, type Project, diff --git a/src/resources/pages/projects/projects.ts b/src/resources/pages/projects/projects.ts index 01225591dc..efac2c7d22 100644 --- a/src/resources/pages/projects/projects.ts +++ b/src/resources/pages/projects/projects.ts @@ -28,7 +28,7 @@ import { DeploymentRollbackParams, Deployments, } from './deployments/deployments'; -import { SinglePage } from '../../../pagination'; +import { SinglePage, V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; export class Projects extends APIResource { deployments: DeploymentsAPI.Deployments = new DeploymentsAPI.Deployments(this._client); @@ -69,9 +69,13 @@ export class Projects extends APIResource { list( params: ProjectListParams, options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id } = params; - return this._client.getAPIList(`/accounts/${account_id}/pages/projects`, DeploymentsSinglePage, options); + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/pages/projects`, + DeploymentsV4PagePaginationArray, + { query, ...options }, + ); } /** @@ -176,6 +180,8 @@ export class Projects extends APIResource { } } +export class DeploymentsV4PagePaginationArray extends V4PagePaginationArray {} + export class DeploymentsSinglePage extends SinglePage {} export interface Deployment { @@ -1641,9 +1647,9 @@ export namespace ProjectCreateParams { } } -export interface ProjectListParams { +export interface ProjectListParams extends V4PagePaginationArrayParams { /** - * Identifier + * Path param: Identifier */ account_id: string; } @@ -2270,7 +2276,7 @@ export interface ProjectPurgeBuildCacheParams { account_id: string; } -Projects.DeploymentsSinglePage = DeploymentsSinglePage; +Projects.DeploymentsV4PagePaginationArray = DeploymentsV4PagePaginationArray; Projects.Deployments = Deployments; Projects.Domains = Domains; Projects.DomainListResponsesSinglePage = DomainListResponsesSinglePage; @@ -2282,7 +2288,7 @@ export declare namespace Projects { type Stage as Stage, type ProjectDeleteResponse as ProjectDeleteResponse, type ProjectPurgeBuildCacheResponse as ProjectPurgeBuildCacheResponse, - DeploymentsSinglePage as DeploymentsSinglePage, + DeploymentsV4PagePaginationArray as DeploymentsV4PagePaginationArray, type ProjectCreateParams as ProjectCreateParams, type ProjectListParams as ProjectListParams, type ProjectDeleteParams as ProjectDeleteParams, diff --git a/src/resources/r2/super-slurper/connectivity-precheck.ts b/src/resources/r2/super-slurper/connectivity-precheck.ts index 654a8193d5..2283824388 100644 --- a/src/resources/r2/super-slurper/connectivity-precheck.ts +++ b/src/resources/r2/super-slurper/connectivity-precheck.ts @@ -13,6 +13,12 @@ export class ConnectivityPrecheck extends APIResource { * const response = * await client.r2.superSlurper.connectivityPrecheck.source({ * account_id: 'account_id', + * bucket: 'bucket', + * secret: { + * accessKeyId: 'accessKeyId', + * secretAccessKey: 'secretAccessKey', + * }, + * vendor: 's3', * }); * ``` */ @@ -37,6 +43,12 @@ export class ConnectivityPrecheck extends APIResource { * const response = * await client.r2.superSlurper.connectivityPrecheck.target({ * account_id: 'account_id', + * bucket: 'bucket', + * secret: { + * accessKeyId: 'accessKeyId', + * secretAccessKey: 'secretAccessKey', + * }, + * vendor: 'r2', * }); * ``` */ @@ -77,7 +89,17 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket?: string; + bucket: string; + + /** + * Body param: + */ + secret: R2SlurperS3SourceSchema.Secret; + + /** + * Body param: + */ + vendor: 's3'; /** * Body param: @@ -87,19 +109,19 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - secret?: R2SlurperS3SourceSchema.Secret; + pathPrefix?: string | null; /** * Body param: */ - vendor?: 's3'; + region?: string | null; } export namespace R2SlurperS3SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } @@ -112,24 +134,29 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket?: string; + bucket: string; + + /** + * Body param: + */ + secret: R2SlurperGcsSourceSchema.Secret; /** * Body param: */ - secret?: R2SlurperGcsSourceSchema.Secret; + vendor: 'gcs'; /** * Body param: */ - vendor?: 'gcs'; + pathPrefix?: string | null; } export namespace R2SlurperGcsSourceSchema { export interface Secret { - clientEmail?: string; + clientEmail: string; - privateKey?: string; + privateKey: string; } } @@ -142,29 +169,34 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket?: string; + bucket: string; /** * Body param: */ - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: R2SlurperR2SourceSchema.Secret; + + /** + * Body param: + */ + vendor: SippyAPI.ProviderParam; /** * Body param: */ - secret?: R2SlurperR2SourceSchema.Secret; + jurisdiction?: 'default' | 'eu' | 'fedramp'; /** * Body param: */ - vendor?: SippyAPI.ProviderParam; + pathPrefix?: string | null; } export namespace R2SlurperR2SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } } @@ -178,29 +210,29 @@ export interface ConnectivityPrecheckTargetParams { /** * Body param: */ - bucket?: string; + bucket: string; /** * Body param: */ - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: ConnectivityPrecheckTargetParams.Secret; /** * Body param: */ - secret?: ConnectivityPrecheckTargetParams.Secret; + vendor: SippyAPI.ProviderParam; /** * Body param: */ - vendor?: SippyAPI.ProviderParam; + jurisdiction?: 'default' | 'eu' | 'fedramp'; } export namespace ConnectivityPrecheckTargetParams { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } diff --git a/src/resources/r2/super-slurper/jobs/jobs.ts b/src/resources/r2/super-slurper/jobs/jobs.ts index 0e70bb10e5..7732e944b1 100644 --- a/src/resources/r2/super-slurper/jobs/jobs.ts +++ b/src/resources/r2/super-slurper/jobs/jobs.ts @@ -360,72 +360,80 @@ export interface JobCreateParams { export namespace JobCreateParams { export interface R2SlurperS3SourceSchema { - bucket?: string; + bucket: string; + + secret: R2SlurperS3SourceSchema.Secret; + + vendor: 's3'; endpoint?: string | null; - secret?: R2SlurperS3SourceSchema.Secret; + pathPrefix?: string | null; - vendor?: 's3'; + region?: string | null; } export namespace R2SlurperS3SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } export interface R2SlurperGcsSourceSchema { - bucket?: string; + bucket: string; - secret?: R2SlurperGcsSourceSchema.Secret; + secret: R2SlurperGcsSourceSchema.Secret; - vendor?: 'gcs'; + vendor: 'gcs'; + + pathPrefix?: string | null; } export namespace R2SlurperGcsSourceSchema { export interface Secret { - clientEmail?: string; + clientEmail: string; - privateKey?: string; + privateKey: string; } } export interface R2SlurperR2SourceSchema { - bucket?: string; + bucket: string; - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: R2SlurperR2SourceSchema.Secret; - secret?: R2SlurperR2SourceSchema.Secret; + vendor: SippyAPI.ProviderParam; + + jurisdiction?: 'default' | 'eu' | 'fedramp'; - vendor?: SippyAPI.ProviderParam; + pathPrefix?: string | null; } export namespace R2SlurperR2SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } export interface Target { - bucket?: string; + bucket: string; - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: Target.Secret; - secret?: Target.Secret; + vendor: SippyAPI.ProviderParam; - vendor?: SippyAPI.ProviderParam; + jurisdiction?: 'default' | 'eu' | 'fedramp'; } export namespace Target { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } } diff --git a/src/resources/radar/as112/summary.ts b/src/resources/radar/as112/summary.ts index c59fdaeb5a..d6034b19c4 100644 --- a/src/resources/radar/as112/summary.ts +++ b/src/resources/radar/as112/summary.ts @@ -9,10 +9,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by DNSSEC (DNS Security * Extensions) support. * - * @example - * ```ts - * const response = await client.radar.as112.summary.dnssec(); - * ``` + * @deprecated */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -34,10 +31,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by EDNS (Extension Mechanisms * for DNS) support. * - * @example - * ```ts - * const response = await client.radar.as112.summary.edns(); - * ``` + * @deprecated */ edns(query?: SummaryEdnsParams, options?: Core.RequestOptions): Core.APIPromise; edns(options?: Core.RequestOptions): Core.APIPromise; @@ -58,11 +52,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by IP version. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -86,11 +76,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by protocol. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.protocol(); - * ``` + * @deprecated */ protocol( query?: SummaryProtocolParams, @@ -114,11 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by type. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.queryType(); - * ``` + * @deprecated */ queryType( query?: SummaryQueryTypeParams, @@ -142,11 +124,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of AS112 DNS requests classified by response code. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.responseCodes(); - * ``` + * @deprecated */ responseCodes( query?: SummaryResponseCodesParams, diff --git a/src/resources/radar/as112/timeseries-groups.ts b/src/resources/radar/as112/timeseries-groups.ts index a9e2aa049c..e5593df35c 100644 --- a/src/resources/radar/as112/timeseries-groups.ts +++ b/src/resources/radar/as112/timeseries-groups.ts @@ -9,11 +9,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by DNSSEC (DNS Security * Extensions) support over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.dnssec(); - * ``` + * @deprecated */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -38,11 +34,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by EDNS (Extension Mechanisms * for DNS) support over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.edns(); - * ``` + * @deprecated */ edns( query?: TimeseriesGroupEdnsParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -96,11 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by protocol over * time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.protocol(); - * ``` + * @deprecated */ protocol( query?: TimeseriesGroupProtocolParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by type over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.queryType(); - * ``` + * @deprecated */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -154,11 +134,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by response code * over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.responseCodes(); - * ``` + * @deprecated */ responseCodes( query?: TimeseriesGroupResponseCodesParams, diff --git a/src/resources/radar/attacks/layer3/summary.ts b/src/resources/radar/attacks/layer3/summary.ts index 73ed7d7c70..bc4ccc4c81 100644 --- a/src/resources/radar/attacks/layer3/summary.ts +++ b/src/resources/radar/attacks/layer3/summary.ts @@ -8,11 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.bitrate(); - * ``` + * @deprecated */ bitrate( query?: SummaryBitrateParams, @@ -36,11 +32,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.duration(); - * ``` + * @deprecated */ duration( query?: SummaryDurationParams, @@ -64,11 +56,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.industry(); - * ``` + * @deprecated */ industry( query?: SummaryIndustryParams, @@ -92,11 +80,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -120,11 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.protocol(); - * ``` + * @deprecated */ protocol( query?: SummaryProtocolParams, @@ -148,11 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.vector(); - * ``` + * @deprecated */ vector(query?: SummaryVectorParams, options?: Core.RequestOptions): Core.APIPromise; vector(options?: Core.RequestOptions): Core.APIPromise; @@ -173,11 +149,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.vertical(); - * ``` + * @deprecated */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer3/timeseries-groups.ts b/src/resources/radar/attacks/layer3/timeseries-groups.ts index 740bb97cae..9f8d171a40 100644 --- a/src/resources/radar/attacks/layer3/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer3/timeseries-groups.ts @@ -8,11 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.bitrate(); - * ``` + * @deprecated */ bitrate( query?: TimeseriesGroupBitrateParams, @@ -37,11 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.duration(); - * ``` + * @deprecated */ duration( query?: TimeseriesGroupDurationParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.industry(); - * ``` + * @deprecated */ industry( query?: TimeseriesGroupIndustryParams, @@ -95,11 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.protocol(); - * ``` + * @deprecated */ protocol( query?: TimeseriesGroupProtocolParams, @@ -153,11 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.vector(); - * ``` + * @deprecated */ vector( query?: TimeseriesGroupVectorParams, @@ -182,11 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.vertical(); - * ``` + * @deprecated */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer7/summary.ts b/src/resources/radar/attacks/layer7/summary.ts index 4afa3d68d0..160eb24dd8 100644 --- a/src/resources/radar/attacks/layer7/summary.ts +++ b/src/resources/radar/attacks/layer7/summary.ts @@ -8,11 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.httpMethod(); - * ``` + * @deprecated */ httpMethod( query?: SummaryHTTPMethodParams, @@ -37,11 +33,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.httpVersion(); - * ``` + * @deprecated */ httpVersion( query?: SummaryHTTPVersionParams, @@ -66,11 +58,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.industry(); - * ``` + * @deprecated */ industry( query?: SummaryIndustryParams, @@ -94,11 +82,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -122,11 +106,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.managedRules(); - * ``` + * @deprecated */ managedRules( query?: SummaryManagedRulesParams, @@ -151,11 +131,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.mitigationProduct(); - * ``` + * @deprecated */ mitigationProduct( query?: SummaryMitigationProductParams, @@ -180,11 +156,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.vertical(); - * ``` + * @deprecated */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer7/timeseries-groups.ts b/src/resources/radar/attacks/layer7/timeseries-groups.ts index ab7e962788..ce7c62ce1e 100644 --- a/src/resources/radar/attacks/layer7/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer7/timeseries-groups.ts @@ -8,11 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.httpMethod(); - * ``` + * @deprecated */ httpMethod( query?: TimeseriesGroupHTTPMethodParams, @@ -37,11 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.httpVersion(); - * ``` + * @deprecated */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.industry(); - * ``` + * @deprecated */ industry( query?: TimeseriesGroupIndustryParams, @@ -95,11 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version used over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.managedRules(); - * ``` + * @deprecated */ managedRules( query?: TimeseriesGroupManagedRulesParams, @@ -153,11 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.mitigationProduct(); - * ``` + * @deprecated */ mitigationProduct( query?: TimeseriesGroupMitigationProductParams, @@ -182,11 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.vertical(); - * ``` + * @deprecated */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/dns/summary.ts b/src/resources/radar/dns/summary.ts index 9bc87aa1f9..575afc929b 100644 --- a/src/resources/radar/dns/summary.ts +++ b/src/resources/radar/dns/summary.ts @@ -8,10 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by cache status. * - * @example - * ```ts - * const response = await client.radar.dns.summary.cacheHit(); - * ``` + * @deprecated */ cacheHit( query?: SummaryCacheHitParams, @@ -36,10 +33,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support. * - * @example - * ```ts - * const response = await client.radar.dns.summary.dnssec(); - * ``` + * @deprecated */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -61,11 +55,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.dnssecAware(); - * ``` + * @deprecated */ dnssecAware( query?: SummaryDNSSECAwareParams, @@ -90,10 +80,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status. * - * @example - * ```ts - * const response = await client.radar.dns.summary.dnssecE2E(); - * ``` + * @deprecated */ dnssecE2E( query?: SummaryDNSSECE2EParams, @@ -117,10 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by IP version. * - * @example - * ```ts - * const response = await client.radar.dns.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -144,11 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.matchingAnswer(); - * ``` + * @deprecated */ matchingAnswer( query?: SummaryMatchingAnswerParams, @@ -172,10 +152,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol. * - * @example - * ```ts - * const response = await client.radar.dns.summary.protocol(); - * ``` + * @deprecated */ protocol( query?: SummaryProtocolParams, @@ -199,10 +176,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by type. * - * @example - * ```ts - * const response = await client.radar.dns.summary.queryType(); - * ``` + * @deprecated */ queryType( query?: SummaryQueryTypeParams, @@ -226,11 +200,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by response code. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.responseCode(); - * ``` + * @deprecated */ responseCode( query?: SummaryResponseCodeParams, @@ -254,11 +224,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by minimum response TTL. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.responseTTL(); - * ``` + * @deprecated */ responseTTL( query?: SummaryResponseTTLParams, diff --git a/src/resources/radar/dns/timeseries-groups.ts b/src/resources/radar/dns/timeseries-groups.ts index 9a242a93fb..5e1ea8a4e1 100644 --- a/src/resources/radar/dns/timeseries-groups.ts +++ b/src/resources/radar/dns/timeseries-groups.ts @@ -8,11 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by cache status over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.cacheHit(); - * ``` + * @deprecated */ cacheHit( query?: TimeseriesGroupCacheHitParams, @@ -37,11 +33,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.dnssec(); - * ``` + * @deprecated */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.dnssecAware(); - * ``` + * @deprecated */ dnssecAware( query?: TimeseriesGroupDNSSECAwareParams, @@ -96,11 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.dnssecE2E(); - * ``` + * @deprecated */ dnssecE2E( query?: TimeseriesGroupDNSSECE2EParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -152,11 +132,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.matchingAnswer(); - * ``` + * @deprecated */ matchingAnswer( query?: TimeseriesGroupMatchingAnswerParams, @@ -181,11 +157,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.protocol(); - * ``` + * @deprecated */ protocol( query?: TimeseriesGroupProtocolParams, @@ -209,11 +181,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by type over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.queryType(); - * ``` + * @deprecated */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -237,11 +205,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by response code over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.responseCode(); - * ``` + * @deprecated */ responseCode( query?: TimeseriesGroupResponseCodeParams, @@ -266,11 +230,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by minimum answer TTL over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.responseTTL(); - * ``` + * @deprecated */ responseTTL( query?: TimeseriesGroupResponseTTLParams, diff --git a/src/resources/radar/email/routing/summary.ts b/src/resources/radar/email/routing/summary.ts index 4085dc05e9..00defd2b84 100644 --- a/src/resources/radar/email/routing/summary.ts +++ b/src/resources/radar/email/routing/summary.ts @@ -10,11 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.arc(); - * ``` + * @deprecated */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -36,11 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.dkim(); - * ``` + * @deprecated */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -62,11 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.dmarc(); - * ``` + * @deprecated */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -88,11 +76,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted). * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.encrypted(); - * ``` + * @deprecated */ encrypted( query?: SummaryEncryptedParams, @@ -116,11 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by IP version. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -145,11 +125,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.spf(); - * ``` + * @deprecated */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/email/routing/timeseries-groups.ts b/src/resources/radar/email/routing/timeseries-groups.ts index c398945534..3a9801b143 100644 --- a/src/resources/radar/email/routing/timeseries-groups.ts +++ b/src/resources/radar/email/routing/timeseries-groups.ts @@ -10,11 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.arc(); - * ``` + * @deprecated */ arc( query?: TimeseriesGroupARCParams, @@ -40,11 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.dkim(); - * ``` + * @deprecated */ dkim( query?: TimeseriesGroupDKIMParams, @@ -70,11 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.dmarc(); - * ``` + * @deprecated */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -100,11 +88,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted) over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.encrypted(); - * ``` + * @deprecated */ encrypted( query?: TimeseriesGroupEncryptedParams, @@ -129,11 +113,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -159,11 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.spf(); - * ``` + * @deprecated */ spf( query?: TimeseriesGroupSPFParams, diff --git a/src/resources/radar/email/security/summary.ts b/src/resources/radar/email/security/summary.ts index 3a984c2f4f..5136a742ff 100644 --- a/src/resources/radar/email/security/summary.ts +++ b/src/resources/radar/email/security/summary.ts @@ -10,11 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.arc(); - * ``` + * @deprecated */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -36,11 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.dkim(); - * ``` + * @deprecated */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -62,11 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.dmarc(); - * ``` + * @deprecated */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -87,11 +75,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by malicious classification. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.malicious(); - * ``` + * @deprecated */ malicious( query?: SummaryMaliciousParams, @@ -115,11 +99,7 @@ export class Summary extends APIResource { /** * Retrieves the proportion of emails by spam classification (spam vs. non-spam). * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.spam(); - * ``` + * @deprecated */ spam(query?: SummarySpamParams, options?: Core.RequestOptions): Core.APIPromise; spam(options?: Core.RequestOptions): Core.APIPromise; @@ -141,11 +121,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.spf(); - * ``` + * @deprecated */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; @@ -167,11 +143,7 @@ export class Summary extends APIResource { * Retrieves the proportion of emails by spoof classification (spoof vs. * non-spoof). * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.spoof(); - * ``` + * @deprecated */ spoof(query?: SummarySpoofParams, options?: Core.RequestOptions): Core.APIPromise; spoof(options?: Core.RequestOptions): Core.APIPromise; @@ -192,11 +164,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by threat categories. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.threatCategory(); - * ``` + * @deprecated */ threatCategory( query?: SummaryThreatCategoryParams, @@ -221,11 +189,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by TLS version. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.tlsVersion(); - * ``` + * @deprecated */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/email/security/timeseries-groups.ts b/src/resources/radar/email/security/timeseries-groups.ts index 2fb9bbef99..aa620088a0 100644 --- a/src/resources/radar/email/security/timeseries-groups.ts +++ b/src/resources/radar/email/security/timeseries-groups.ts @@ -10,11 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.arc(); - * ``` + * @deprecated */ arc( query?: TimeseriesGroupARCParams, @@ -40,11 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.dkim(); - * ``` + * @deprecated */ dkim( query?: TimeseriesGroupDKIMParams, @@ -70,11 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.dmarc(); - * ``` + * @deprecated */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -99,11 +87,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by malicious classification over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.malicious(); - * ``` + * @deprecated */ malicious( query?: TimeseriesGroupMaliciousParams, @@ -129,11 +113,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spam classification (spam vs. non-spam) * over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.spam(); - * ``` + * @deprecated */ spam( query?: TimeseriesGroupSpamParams, @@ -159,11 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.spf(); - * ``` + * @deprecated */ spf( query?: TimeseriesGroupSPFParams, @@ -189,11 +165,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spoof classification (spoof vs. * non-spoof) over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.spoof(); - * ``` + * @deprecated */ spoof( query?: TimeseriesGroupSpoofParams, @@ -218,11 +190,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by threat category over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.threatCategory(); - * ``` + * @deprecated */ threatCategory( query?: TimeseriesGroupThreatCategoryParams, @@ -247,11 +215,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by TLS version over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.tlsVersion(); - * ``` + * @deprecated */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/entities/asns.ts b/src/resources/radar/entities/asns.ts index 66ecf4a6e9..7697e9dd84 100644 --- a/src/resources/radar/entities/asns.ts +++ b/src/resources/radar/entities/asns.ts @@ -194,10 +194,20 @@ export namespace ASNAsSetResponse { */ name: string; + /** + * The AS number following hierarchical AS-SET name + */ + hierarchical_asn?: number; + /** * The inferred AS number of the AS-SET */ - asn?: number; + inferred_asn?: number; + + /** + * The AS number matching PeeringDB record + */ + peeringdb_asn?: number; } } diff --git a/src/resources/radar/netflows/netflows.ts b/src/resources/radar/netflows/netflows.ts index c484510bb6..55c05d441b 100644 --- a/src/resources/radar/netflows/netflows.ts +++ b/src/resources/radar/netflows/netflows.ts @@ -13,7 +13,7 @@ export class Netflows extends APIResource { * Retrieves the distribution of network traffic (NetFlows) by HTTP vs other * protocols. * - * @deprecated + * @deprecated Use [Get Network Traffic Distribution By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/netflows/methods/summary_v2/) instead. */ summary( query?: NetflowSummaryParams, diff --git a/src/resources/stream/downloads.ts b/src/resources/stream/downloads.ts index a9d2589f13..1fd7a50c02 100644 --- a/src/resources/stream/downloads.ts +++ b/src/resources/stream/downloads.ts @@ -6,7 +6,8 @@ import * as Core from '../../core'; export class Downloads extends APIResource { /** * Creates a download for a video when a video is ready to view. Use - * `/downloads/{download_type}` instead for type-specific downloads. + * `/downloads/{download_type}` instead for type-specific downloads. Available + * types are `default` and `audio`. * * @example * ```ts @@ -35,7 +36,7 @@ export class Downloads extends APIResource { /** * Delete the downloads for a video. Use `/downloads/{download_type}` instead for - * type-specific downloads. + * type-specific downloads. Available types are `default` and `audio`. * * @example * ```ts diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts index 8b15a53e2d..4af2451c88 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts @@ -168,7 +168,7 @@ export namespace BindingGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; 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 9170366dbd..78e5e95423 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -616,7 +616,7 @@ export namespace ScriptUpdateParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; 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 fea3a53ffc..216456a041 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -247,7 +247,7 @@ export namespace SettingEditResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -999,7 +999,7 @@ export namespace SettingGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1769,7 +1769,7 @@ export namespace SettingEditParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; diff --git a/src/resources/workers/beta/workers/versions.ts b/src/resources/workers/beta/workers/versions.ts index 300510fc56..185cea7033 100644 --- a/src/resources/workers/beta/workers/versions.ts +++ b/src/resources/workers/beta/workers/versions.ts @@ -409,7 +409,7 @@ export namespace Version { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1263,7 +1263,7 @@ export namespace VersionCreateParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; diff --git a/src/resources/workers/beta/workers/workers.ts b/src/resources/workers/beta/workers/workers.ts index ba7791704e..d4e49b0055 100644 --- a/src/resources/workers/beta/workers/workers.ts +++ b/src/resources/workers/beta/workers/workers.ts @@ -193,6 +193,11 @@ export interface Worker { */ observability: Worker.Observability; + /** + * Other resources that reference the Worker and depend on it existing. + */ + references: Worker.References; + /** * Subdomain settings for the Worker. */ @@ -259,6 +264,139 @@ export namespace Worker { } } + /** + * Other resources that reference the Worker and depend on it existing. + */ + export interface References { + /** + * Other Workers that reference the Worker as an outbound for a dispatch namespace. + */ + dispatch_namespace_outbounds: Array; + + /** + * Custom domains connected to the Worker. + */ + domains: Array; + + /** + * Other Workers that reference Durable Object classes implemented by the Worker. + */ + durable_objects: Array; + + /** + * Queues that send messages to the Worker. + */ + queues: Array; + + /** + * Other Workers that reference the Worker using + * [service bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/). + */ + workers: Array; + } + + export namespace References { + export interface DispatchNamespaceOutbound { + /** + * ID of the dispatch namespace. + */ + namespace_id: string; + + /** + * Name of the dispatch namespace. + */ + namespace_name: string; + + /** + * ID of the Worker using the dispatch namespace. + */ + worker_id: string; + + /** + * Name of the Worker using the dispatch namespace. + */ + worker_name: string; + } + + export interface Domain { + /** + * ID of the custom domain. + */ + id: string; + + /** + * ID of the TLS certificate issued for the custom domain. + */ + certificate_id: string; + + /** + * Full hostname of the custom domain, including the zone name. + */ + hostname: string; + + /** + * ID of the zone. + */ + zone_id: string; + + /** + * Name of the zone. + */ + zone_name: string; + } + + export interface DurableObject { + /** + * ID of the Durable Object namespace being used. + */ + namespace_id: string; + + /** + * Name of the Durable Object namespace being used. + */ + namespace_name: string; + + /** + * ID of the Worker using the Durable Object implementation. + */ + worker_id: string; + + /** + * Name of the Worker using the Durable Object implementation. + */ + worker_name: string; + } + + export interface Queue { + /** + * ID of the queue consumer configuration. + */ + queue_consumer_id: string; + + /** + * ID of the queue. + */ + queue_id: string; + + /** + * Name of the queue. + */ + queue_name: string; + } + + export interface Worker { + /** + * ID of the referencing Worker. + */ + id: string; + + /** + * Name of the referencing Worker. + */ + name: string; + } + } + /** * Subdomain settings for the Worker. */ diff --git a/src/resources/workers/scripts/script-and-version-settings.ts b/src/resources/workers/scripts/script-and-version-settings.ts index 05bc7152a0..d6ef7552ca 100644 --- a/src/resources/workers/scripts/script-and-version-settings.ts +++ b/src/resources/workers/scripts/script-and-version-settings.ts @@ -243,7 +243,7 @@ export namespace ScriptAndVersionSettingEditResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -995,7 +995,7 @@ export namespace ScriptAndVersionSettingGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1765,7 +1765,7 @@ export namespace ScriptAndVersionSettingEditParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index d96bb354dc..70546d5580 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -925,7 +925,7 @@ export namespace ScriptUpdateParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; diff --git a/src/resources/workers/scripts/versions.ts b/src/resources/workers/scripts/versions.ts index d4334609ad..c9027b6f0c 100644 --- a/src/resources/workers/scripts/versions.ts +++ b/src/resources/workers/scripts/versions.ts @@ -245,7 +245,7 @@ export namespace VersionCreateResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -981,7 +981,7 @@ export namespace VersionGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1634,6 +1634,11 @@ export namespace VersionCreateParams { export namespace Metadata { export interface Annotations { + /** + * Associated alias for a version. + */ + 'workers/alias'?: string; + /** * Human-readable message about the version. Truncated to 100 bytes. */ @@ -1740,7 +1745,7 @@ export namespace VersionCreateParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; diff --git a/src/resources/zones/settings.ts b/src/resources/zones/settings.ts index 0838680bb9..4a3ad6c613 100644 --- a/src/resources/zones/settings.ts +++ b/src/resources/zones/settings.ts @@ -301,13 +301,8 @@ export interface BrowserCacheTTL { id?: 'browser_cache_ttl'; /** - * The number of seconds to cache resources for. Minimum values by plan: - * - * - Free: 7200 seconds (2 hours) - * - Pro: 3600 seconds (1 hour) - * - Business: 1 second - * - Enterprise: 1 second Setting this to 0 enables "Respect Existing Headers" and - * is allowed for all plans. + * The number of seconds to cache resources for. Setting this to 0 enables "Respect + * Existing Headers". */ value?: number; } @@ -319,13 +314,8 @@ export interface BrowserCacheTTLParam { id?: 'browser_cache_ttl'; /** - * The number of seconds to cache resources for. Minimum values by plan: - * - * - Free: 7200 seconds (2 hours) - * - Pro: 3600 seconds (1 hour) - * - Business: 1 second - * - Enterprise: 1 second Setting this to 0 enables "Respect Existing Headers" and - * is allowed for all plans. + * The number of seconds to cache resources for. Setting this to 0 enables "Respect + * Existing Headers". */ value?: number; } @@ -1102,6 +1092,10 @@ export interface PseudoIPV4 { modified_on?: string | null; } +/** + * @deprecated This page rule is deprecated. This functionality is no longer + * supported. + */ export interface ResponseBuffering { /** * Turn on or off whether Cloudflare should wait for an entire file from the origin @@ -1116,6 +1110,10 @@ export interface ResponseBuffering { value?: 'on' | 'off'; } +/** + * @deprecated This page rule is deprecated. This functionality is no longer + * supported. + */ export interface ResponseBufferingParam { /** * Turn on or off whether Cloudflare should wait for an entire file from the origin @@ -2215,10 +2213,8 @@ export namespace SettingEditResponse { } /** - * Enables or disables buffering of responses from the proxied server. Cloudflare - * may buffer the whole payload to deliver it at once to the client versus allowing - * it to be delivered in chunks. By default, the proxied server streams directly - * and is not buffered by Cloudflare. This is limited to Enterprise Zones. + * @deprecated This zone setting is deprecated. This functionality is no longer + * supported. */ export interface ZonesSchemasResponseBuffering { /** @@ -3258,10 +3254,8 @@ export namespace SettingGetResponse { } /** - * Enables or disables buffering of responses from the proxied server. Cloudflare - * may buffer the whole payload to deliver it at once to the client versus allowing - * it to be delivered in chunks. By default, the proxied server streams directly - * and is not buffered by Cloudflare. This is limited to Enterprise Zones. + * @deprecated This zone setting is deprecated. This functionality is no longer + * supported. */ export interface ZonesSchemasResponseBuffering { /** diff --git a/tests/api-resources/alerting/destinations/webhooks.test.ts b/tests/api-resources/alerting/destinations/webhooks.test.ts index 400214bb31..f7e64ac407 100644 --- a/tests/api-resources/alerting/destinations/webhooks.test.ts +++ b/tests/api-resources/alerting/destinations/webhooks.test.ts @@ -38,14 +38,11 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('update: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.update( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'Slack Webhook', - url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', - }, - ); + const responsePromise = client.alerting.destinations.webhooks.update('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'Slack Webhook', + url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -57,15 +54,12 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('update: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.update( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'Slack Webhook', - url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', - secret: 'secret', - }, - ); + const response = await client.alerting.destinations.webhooks.update('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'Slack Webhook', + url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + secret: 'secret', + }); }); test('list: only required params', async () => { @@ -88,10 +82,9 @@ describe('resource webhooks', () => { }); test('delete: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.delete( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); + const responsePromise = client.alerting.destinations.webhooks.delete('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -102,18 +95,16 @@ describe('resource webhooks', () => { }); test('delete: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.delete( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); + const response = await client.alerting.destinations.webhooks.delete('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('get: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.get( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); + const responsePromise = client.alerting.destinations.webhooks.get('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -125,7 +116,7 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('get: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.get('b115d5ec-15c6-41ee-8b76-92c449b5227b', { + const response = await client.alerting.destinations.webhooks.get('b115d5ec15c641ee8b7692c449b5227b', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/alerting/policies.test.ts b/tests/api-resources/alerting/policies.test.ts index aed5640624..c3b23203ae 100644 --- a/tests/api-resources/alerting/policies.test.ts +++ b/tests/api-resources/alerting/policies.test.ts @@ -35,9 +35,9 @@ describe('resource policies', () => { alert_type: 'universal_ssl_event_type', enabled: true, mechanisms: { - email: [{ id: 'test@example.com' }], - pagerduty: [{ id: 'e8133a15-00a4-4d69-aec1-32f70c51f6e5' }], - webhooks: [{ id: '14cc1190-5d2b-4b98-a696-c424cb2ad05f' }], + email: [{ id: 'id' }], + pagerduty: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], + webhooks: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], }, name: 'SSL Notification Event Policy', alert_interval: '30m', @@ -83,6 +83,7 @@ describe('resource policies', () => { traffic_exclusions: ['security_events'], tunnel_id: ['string'], tunnel_name: ['string'], + type: ['string'], where: ['string'], zones: ['string'], }, @@ -91,7 +92,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('update: only required params', async () => { - const responsePromise = client.alerting.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', { + const responsePromise = client.alerting.policies.update('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -105,7 +106,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('update: required and optional params', async () => { - const response = await client.alerting.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', { + const response = await client.alerting.policies.update('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', alert_interval: '30m', alert_type: 'universal_ssl_event_type', @@ -152,13 +153,14 @@ describe('resource policies', () => { traffic_exclusions: ['security_events'], tunnel_id: ['string'], tunnel_name: ['string'], + type: ['string'], where: ['string'], zones: ['string'], }, mechanisms: { - email: [{ id: 'test@example.com' }], - pagerduty: [{ id: 'e8133a15-00a4-4d69-aec1-32f70c51f6e5' }], - webhooks: [{ id: '14cc1190-5d2b-4b98-a696-c424cb2ad05f' }], + email: [{ id: 'id' }], + pagerduty: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], + webhooks: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], }, name: 'SSL Notification Event Policy', }); @@ -180,7 +182,7 @@ describe('resource policies', () => { }); test('delete: only required params', async () => { - const responsePromise = client.alerting.policies.delete('0da2b59e-f118-439d-8097-bdfb215203c9', { + const responsePromise = client.alerting.policies.delete('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -193,14 +195,14 @@ describe('resource policies', () => { }); test('delete: required and optional params', async () => { - const response = await client.alerting.policies.delete('0da2b59e-f118-439d-8097-bdfb215203c9', { + const response = await client.alerting.policies.delete('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('get: only required params', async () => { - const responsePromise = client.alerting.policies.get('0da2b59e-f118-439d-8097-bdfb215203c9', { + const responsePromise = client.alerting.policies.get('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -214,7 +216,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('get: required and optional params', async () => { - const response = await client.alerting.policies.get('0da2b59e-f118-439d-8097-bdfb215203c9', { + const response = await client.alerting.policies.get('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/pages/projects/projects.test.ts b/tests/api-resources/pages/projects/projects.test.ts index 2057a0124d..41a92b2403 100644 --- a/tests/api-resources/pages/projects/projects.test.ts +++ b/tests/api-resources/pages/projects/projects.test.ts @@ -115,7 +115,11 @@ describe('resource projects', () => { }); test('list: required and optional params', async () => { - const response = await client.pages.projects.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const response = await client.pages.projects.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + page: 1, + per_page: 10, + }); }); test('delete: only required params', async () => { diff --git a/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts b/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts index c3238ed19b..597bcca970 100644 --- a/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts +++ b/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts @@ -11,7 +11,12 @@ const client = new Cloudflare({ describe('resource connectivityPrecheck', () => { test('source: only required params', async () => { - const responsePromise = client.r2.superSlurper.connectivityPrecheck.source({ account_id: 'account_id' }); + const responsePromise = client.r2.superSlurper.connectivityPrecheck.source({ + account_id: 'account_id', + bucket: 'bucket', + secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, + vendor: 's3', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,14 +30,21 @@ describe('resource connectivityPrecheck', () => { const response = await client.r2.superSlurper.connectivityPrecheck.source({ account_id: 'account_id', bucket: 'bucket', - endpoint: 'endpoint', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 's3', + endpoint: 'endpoint', + pathPrefix: 'pathPrefix', + region: 'region', }); }); test('target: only required params', async () => { - const responsePromise = client.r2.superSlurper.connectivityPrecheck.target({ account_id: 'account_id' }); + const responsePromise = client.r2.superSlurper.connectivityPrecheck.target({ + account_id: 'account_id', + bucket: 'bucket', + secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, + vendor: 'r2', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -46,9 +58,9 @@ describe('resource connectivityPrecheck', () => { const response = await client.r2.superSlurper.connectivityPrecheck.target({ account_id: 'account_id', bucket: 'bucket', - jurisdiction: 'default', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 'r2', + jurisdiction: 'default', }); }); }); diff --git a/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts b/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts index 8376af108a..e2806bfb82 100644 --- a/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts +++ b/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts @@ -27,15 +27,17 @@ describe('resource jobs', () => { overwrite: true, source: { bucket: 'bucket', - endpoint: 'endpoint', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 's3', + endpoint: 'endpoint', + pathPrefix: 'pathPrefix', + region: 'region', }, target: { bucket: 'bucket', - jurisdiction: 'default', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 'r2', + jurisdiction: 'default', }, }); }); diff --git a/tests/api-resources/workers/scripts/versions.test.ts b/tests/api-resources/workers/scripts/versions.test.ts index 82c89f8328..437f382fd7 100644 --- a/tests/api-resources/workers/scripts/versions.test.ts +++ b/tests/api-resources/workers/scripts/versions.test.ts @@ -31,7 +31,11 @@ describe('resource versions', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', metadata: { main_module: 'worker.js', - annotations: { 'workers/message': 'Fixed worker code.', 'workers/tag': 'workers/tag' }, + annotations: { + 'workers/alias': 'staging', + 'workers/message': 'Fixed worker code.', + 'workers/tag': 'workers/tag', + }, bindings: [{ name: 'MY_ENV_VAR', text: 'my_data', type: 'plain_text' }], compatibility_date: '2021-01-01', compatibility_flags: ['nodejs_compat'], From 60181ea5121f7c7ccc7b15020211b2fbe39dc5aa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 18:46:59 +0000 Subject: [PATCH 092/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1a151bca80..f353f84d0d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c9472ef3c00e81494197d6f2c75d017dfcd5e05157d58f58dd6627771296e92e.yml -openapi_spec_hash: ac68da9645adad028beae1f96328f5bd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-734aca312850ea03d41e86d8fc20481486119bc45c8b2dbaec3f53b0aca519f0.yml +openapi_spec_hash: b2aebe6228a7ad74b7354d95b912ba95 config_hash: 107e0f1f8a98b007260b319226b88b3c From 476d855c04534fafc6a2d083ee8f9eafae93551e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 19:29:16 +0000 Subject: [PATCH 093/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f353f84d0d..7f75cb114d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-734aca312850ea03d41e86d8fc20481486119bc45c8b2dbaec3f53b0aca519f0.yml -openapi_spec_hash: b2aebe6228a7ad74b7354d95b912ba95 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b714e99837f8900f50d26e4ac07460d67c9c3097b05822664ad91429602bb84a.yml +openapi_spec_hash: 0f7543d2fd80297d1b44671053c2daf3 config_hash: 107e0f1f8a98b007260b319226b88b3c From 284c679d503540a9dcde3227b016073a5f0380d6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 19:31:15 +0000 Subject: [PATCH 094/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7f75cb114d..f353f84d0d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b714e99837f8900f50d26e4ac07460d67c9c3097b05822664ad91429602bb84a.yml -openapi_spec_hash: 0f7543d2fd80297d1b44671053c2daf3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-734aca312850ea03d41e86d8fc20481486119bc45c8b2dbaec3f53b0aca519f0.yml +openapi_spec_hash: b2aebe6228a7ad74b7354d95b912ba95 config_hash: 107e0f1f8a98b007260b319226b88b3c From 57a04a1d8b9bc0531be220c063099b620ee14ae5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 19:33:57 +0000 Subject: [PATCH 095/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f353f84d0d..27dc38499f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-734aca312850ea03d41e86d8fc20481486119bc45c8b2dbaec3f53b0aca519f0.yml -openapi_spec_hash: b2aebe6228a7ad74b7354d95b912ba95 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-766b454718ed05d1b847639c67c3d49be0a7d27d9ad67fdb0e219eda0b88f437.yml +openapi_spec_hash: 154b9d8f13224be6bb7d580d69e65565 config_hash: 107e0f1f8a98b007260b319226b88b3c From 0eb595e885d901f611d10baaa4d6805e897ba559 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 19:49:57 +0000 Subject: [PATCH 096/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 27dc38499f..f25dd27907 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-766b454718ed05d1b847639c67c3d49be0a7d27d9ad67fdb0e219eda0b88f437.yml -openapi_spec_hash: 154b9d8f13224be6bb7d580d69e65565 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fd50e4c0e2d432ef76b5a047e091d09e53adc5d10a2dded216dc1701533ec3ef.yml +openapi_spec_hash: 7d73a782b01f27bf46dce0ae9d848cc3 config_hash: 107e0f1f8a98b007260b319226b88b3c From 3eb7cc50765200a2637191ea60536d69b86398fb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 19:54:00 +0000 Subject: [PATCH 097/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f25dd27907..f00c283b4d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fd50e4c0e2d432ef76b5a047e091d09e53adc5d10a2dded216dc1701533ec3ef.yml -openapi_spec_hash: 7d73a782b01f27bf46dce0ae9d848cc3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-08cb2774b4da40ee1c80957dd5c7d7ab2fecd8652adbfd101af54b1b32fa4494.yml +openapi_spec_hash: 53274fa330f70a5df4364f397444851f config_hash: 107e0f1f8a98b007260b319226b88b3c From 581bfae8e899fef26af8b008737f2a39bce94ae4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 20:09:46 +0000 Subject: [PATCH 098/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f00c283b4d..8a6571e950 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-08cb2774b4da40ee1c80957dd5c7d7ab2fecd8652adbfd101af54b1b32fa4494.yml -openapi_spec_hash: 53274fa330f70a5df4364f397444851f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4dddcb5c3bb1473a7da1238371bb6e55573fb566c3139e8836c6ae00fdc85268.yml +openapi_spec_hash: 2a23f9b76b4569603886573348384d37 config_hash: 107e0f1f8a98b007260b319226b88b3c From 91dbf7b03c97ca90b28ee28c0aa5735e21f51262 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 20:11:43 +0000 Subject: [PATCH 099/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8a6571e950..f00c283b4d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4dddcb5c3bb1473a7da1238371bb6e55573fb566c3139e8836c6ae00fdc85268.yml -openapi_spec_hash: 2a23f9b76b4569603886573348384d37 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-08cb2774b4da40ee1c80957dd5c7d7ab2fecd8652adbfd101af54b1b32fa4494.yml +openapi_spec_hash: 53274fa330f70a5df4364f397444851f config_hash: 107e0f1f8a98b007260b319226b88b3c From 0610503b19953640695dc7648ce4ceec01256e49 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 4 Oct 2025 12:34:32 +0000 Subject: [PATCH 100/451] chore(api): update composite API spec --- .stats.yml | 4 +- src/resources/pipelines.ts | 138 +++++++++++++------------- tests/api-resources/pipelines.test.ts | 20 ++-- 3 files changed, 83 insertions(+), 79 deletions(-) diff --git a/.stats.yml b/.stats.yml index f00c283b4d..3ae1e4fa43 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-08cb2774b4da40ee1c80957dd5c7d7ab2fecd8652adbfd101af54b1b32fa4494.yml -openapi_spec_hash: 53274fa330f70a5df4364f397444851f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4a0018e4541274eab118dd64e7218a503e405e80c9a90a2d17acb31b8624fcba.yml +openapi_spec_hash: df9aef9c268b8476afcdecbae7f92de0 config_hash: 107e0f1f8a98b007260b319226b88b3c diff --git a/src/resources/pipelines.ts b/src/resources/pipelines.ts index 02e40368e4..cfc4b0add9 100644 --- a/src/resources/pipelines.ts +++ b/src/resources/pipelines.ts @@ -5,29 +5,10 @@ import * as Core from '../core'; export class Pipelines extends APIResource { /** - * Create a new pipeline. + * [DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint + * instead. * - * @example - * ```ts - * const pipeline = await client.pipelines.create({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * destination: { - * batch: {}, - * compression: {}, - * credentials: { - * access_key_id: '', - * endpoint: - * 'https://123f8a8258064ed892a347f173372359.r2.cloudflarestorage.com', - * secret_access_key: '', - * }, - * format: 'json', - * path: { bucket: 'bucket' }, - * type: 'r2', - * }, - * name: 'sample_pipeline', - * source: [{ format: 'json', type: 'type' }], - * }); - * ``` + * @deprecated */ create( params: PipelineCreateParams, @@ -42,26 +23,10 @@ export class Pipelines extends APIResource { } /** - * Update an existing pipeline. + * [DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines + * endpoint instead. * - * @example - * ```ts - * const pipeline = await client.pipelines.update( - * 'sample_pipeline', - * { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * destination: { - * batch: {}, - * compression: {}, - * format: 'json', - * path: { bucket: 'bucket' }, - * type: 'r2', - * }, - * name: 'sample_pipeline', - * source: [{ format: 'json', type: 'type' }], - * }, - * ); - * ``` + * @deprecated */ update( pipelineName: string, @@ -78,14 +43,10 @@ export class Pipelines extends APIResource { } /** - * List, filter, and paginate pipelines in an account. + * [DEPRECATED] List, filter, and paginate pipelines in an account. Use the new + * /pipelines/v1/pipelines endpoint instead. * - * @example - * ```ts - * const pipelines = await client.pipelines.list({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` + * @deprecated */ list(params: PipelineListParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...query } = params; @@ -93,14 +54,10 @@ export class Pipelines extends APIResource { } /** - * Delete a pipeline. + * [DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint + * instead. * - * @example - * ```ts - * await client.pipelines.delete('sample_pipeline', { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` + * @deprecated */ delete( pipelineName: string, @@ -115,15 +72,10 @@ export class Pipelines extends APIResource { } /** - * Get configuration of a pipeline. + * [DEPRECATED] Get configuration of a pipeline. Use the new + * /pipelines/v1/pipelines endpoint instead. * - * @example - * ```ts - * const pipeline = await client.pipelines.get( - * 'sample_pipeline', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` + * @deprecated */ get( pipelineName: string, @@ -140,7 +92,8 @@ export class Pipelines extends APIResource { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface PipelineCreateResponse { /** @@ -238,6 +191,10 @@ export namespace PipelineCreateResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -263,6 +220,10 @@ export namespace PipelineCreateResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -274,7 +235,8 @@ export namespace PipelineCreateResponse { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface PipelineUpdateResponse { /** @@ -372,6 +334,10 @@ export namespace PipelineUpdateResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -397,6 +363,10 @@ export namespace PipelineUpdateResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -442,7 +412,8 @@ export namespace PipelineListResponse { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface Result { /** @@ -540,6 +511,10 @@ export namespace PipelineListResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -565,6 +540,10 @@ export namespace PipelineListResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -577,7 +556,8 @@ export namespace PipelineListResponse { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface PipelineGetResponse { /** @@ -675,6 +655,10 @@ export namespace PipelineGetResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -700,6 +684,10 @@ export namespace PipelineGetResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -821,6 +809,10 @@ export namespace PipelineCreateParams { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -846,6 +838,10 @@ export namespace PipelineCreateParams { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -967,6 +963,10 @@ export namespace PipelineUpdateParams { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -992,6 +992,10 @@ export namespace PipelineUpdateParams { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. diff --git a/tests/api-resources/pipelines.test.ts b/tests/api-resources/pipelines.test.ts index 40730e8ec8..390a133372 100644 --- a/tests/api-resources/pipelines.test.ts +++ b/tests/api-resources/pipelines.test.ts @@ -12,7 +12,7 @@ const client = new Cloudflare({ describe('resource pipelines', () => { test('create: only required params', async () => { const responsePromise = client.pipelines.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', destination: { batch: {}, compression: {}, @@ -39,7 +39,7 @@ describe('resource pipelines', () => { test('create: required and optional params', async () => { const response = await client.pipelines.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', destination: { batch: { max_bytes: 1000, max_duration_s: 0.25, max_rows: 100 }, compression: { type: 'gzip' }, @@ -64,7 +64,7 @@ describe('resource pipelines', () => { test('update: only required params', async () => { const responsePromise = client.pipelines.update('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', destination: { batch: {}, compression: {}, format: 'json', path: { bucket: 'bucket' }, type: 'r2' }, name: 'sample_pipeline', source: [{ format: 'json', type: 'type' }], @@ -80,7 +80,7 @@ describe('resource pipelines', () => { test('update: required and optional params', async () => { const response = await client.pipelines.update('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', destination: { batch: { max_bytes: 1000, max_duration_s: 0.25, max_rows: 100 }, compression: { type: 'gzip' }, @@ -104,7 +104,7 @@ describe('resource pipelines', () => { }); test('list: only required params', async () => { - const responsePromise = client.pipelines.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = client.pipelines.list({ account_id: '0123105f4ecef8ad9ca31a8372d0c353' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -116,7 +116,7 @@ describe('resource pipelines', () => { test('list: required and optional params', async () => { const response = await client.pipelines.list({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', page: 'page', per_page: 'per_page', search: 'search', @@ -125,7 +125,7 @@ describe('resource pipelines', () => { test('delete: only required params', async () => { const responsePromise = client.pipelines.delete('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -138,13 +138,13 @@ describe('resource pipelines', () => { test('delete: required and optional params', async () => { const response = await client.pipelines.delete('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', }); }); test('get: only required params', async () => { const responsePromise = client.pipelines.get('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -157,7 +157,7 @@ describe('resource pipelines', () => { test('get: required and optional params', async () => { const response = await client.pipelines.get('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', }); }); }); From 4f6bf5d3dc93e58e7230b725d2d3350d08e97be0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 4 Oct 2025 18:48:45 +0000 Subject: [PATCH 101/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3ae1e4fa43..f7b5811878 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4a0018e4541274eab118dd64e7218a503e405e80c9a90a2d17acb31b8624fcba.yml -openapi_spec_hash: df9aef9c268b8476afcdecbae7f92de0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0d41be3b20b7ec2cc378e90f26f9f16321be8e76c98104fae9e5e38ed6d444a8.yml +openapi_spec_hash: 61c3b2c31190cc24d253d3ae5adfddde config_hash: 107e0f1f8a98b007260b319226b88b3c From 9efa075b115eebb1f09445e82dcc451944694548 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 4 Oct 2025 18:50:32 +0000 Subject: [PATCH 102/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f7b5811878..2757293c21 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0d41be3b20b7ec2cc378e90f26f9f16321be8e76c98104fae9e5e38ed6d444a8.yml -openapi_spec_hash: 61c3b2c31190cc24d253d3ae5adfddde +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bd7930fbd02f4a290ac809088097e4bd1c84668b71ac5dde97d68fed328d2254.yml +openapi_spec_hash: 926a1583c4959c2e6bf0113abde4c628 config_hash: 107e0f1f8a98b007260b319226b88b3c From 4a7d2a9981ae097d313a502ae6d2b2f1259911a8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 08:29:57 +0000 Subject: [PATCH 103/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2757293c21..107eaaed4d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bd7930fbd02f4a290ac809088097e4bd1c84668b71ac5dde97d68fed328d2254.yml -openapi_spec_hash: 926a1583c4959c2e6bf0113abde4c628 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04fbf0655835c0f97dafef04256755109305e76408afccaa6e35694b8f23b272.yml +openapi_spec_hash: 53fd42387062a426ba0bd9222944651f config_hash: 107e0f1f8a98b007260b319226b88b3c From d70b6aedb5b1c59fa7001ef47d569bd8af114726 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 08:34:30 +0000 Subject: [PATCH 104/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 107eaaed4d..8ceaf44f80 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04fbf0655835c0f97dafef04256755109305e76408afccaa6e35694b8f23b272.yml -openapi_spec_hash: 53fd42387062a426ba0bd9222944651f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c530f680ebc139f6bbfa1ea2b6f19f8fae4dd35299cc0b3ee2ac51130f710b36.yml +openapi_spec_hash: b612285edbbb9cd03e30d6ba51f3069d config_hash: 107e0f1f8a98b007260b319226b88b3c From 8d11ffee75e61248f468eeba450d76b5d32047ee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 11:42:58 +0000 Subject: [PATCH 105/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8ceaf44f80..3ae1e4fa43 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c530f680ebc139f6bbfa1ea2b6f19f8fae4dd35299cc0b3ee2ac51130f710b36.yml -openapi_spec_hash: b612285edbbb9cd03e30d6ba51f3069d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4a0018e4541274eab118dd64e7218a503e405e80c9a90a2d17acb31b8624fcba.yml +openapi_spec_hash: df9aef9c268b8476afcdecbae7f92de0 config_hash: 107e0f1f8a98b007260b319226b88b3c From 3e151e72479b7bf52a0d1f0c639edc9af89e7f09 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 11:44:45 +0000 Subject: [PATCH 106/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3ae1e4fa43..8ceaf44f80 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4a0018e4541274eab118dd64e7218a503e405e80c9a90a2d17acb31b8624fcba.yml -openapi_spec_hash: df9aef9c268b8476afcdecbae7f92de0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c530f680ebc139f6bbfa1ea2b6f19f8fae4dd35299cc0b3ee2ac51130f710b36.yml +openapi_spec_hash: b612285edbbb9cd03e30d6ba51f3069d config_hash: 107e0f1f8a98b007260b319226b88b3c From 8d40ebdedb95ad2bcce9c035c18b14c8d8ec2189 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 12:27:54 +0000 Subject: [PATCH 107/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8ceaf44f80..263d9a1040 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c530f680ebc139f6bbfa1ea2b6f19f8fae4dd35299cc0b3ee2ac51130f710b36.yml -openapi_spec_hash: b612285edbbb9cd03e30d6ba51f3069d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c4821f8972c469e08ff70fc51d949879abc0ea4a596f8268d58ef9ef1979b0e7.yml +openapi_spec_hash: 5f49bf2048f8ce6bf4dc0439666bf2d7 config_hash: 107e0f1f8a98b007260b319226b88b3c From 0257d25ca4846467508e8019dcd4b200d85f8c5e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 12:29:47 +0000 Subject: [PATCH 108/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 263d9a1040..3ae1e4fa43 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c4821f8972c469e08ff70fc51d949879abc0ea4a596f8268d58ef9ef1979b0e7.yml -openapi_spec_hash: 5f49bf2048f8ce6bf4dc0439666bf2d7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4a0018e4541274eab118dd64e7218a503e405e80c9a90a2d17acb31b8624fcba.yml +openapi_spec_hash: df9aef9c268b8476afcdecbae7f92de0 config_hash: 107e0f1f8a98b007260b319226b88b3c From 631a25fdfebe43d236c68b858e54ec62ba38acce Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 12:34:54 +0000 Subject: [PATCH 109/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3ae1e4fa43..f7b5811878 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4a0018e4541274eab118dd64e7218a503e405e80c9a90a2d17acb31b8624fcba.yml -openapi_spec_hash: df9aef9c268b8476afcdecbae7f92de0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0d41be3b20b7ec2cc378e90f26f9f16321be8e76c98104fae9e5e38ed6d444a8.yml +openapi_spec_hash: 61c3b2c31190cc24d253d3ae5adfddde config_hash: 107e0f1f8a98b007260b319226b88b3c From 0af29f8d535312eb7bce1c8531f37c7a1d6cee47 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 13:29:03 +0000 Subject: [PATCH 110/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f7b5811878..e5238ac599 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0d41be3b20b7ec2cc378e90f26f9f16321be8e76c98104fae9e5e38ed6d444a8.yml -openapi_spec_hash: 61c3b2c31190cc24d253d3ae5adfddde +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-878533519fd9db620a1304c3c8c1a9c6ae0152ecdd9db10e132c422ecfe8f6dc.yml +openapi_spec_hash: edc942ea9859ed6d4199fd7e4aad7df1 config_hash: 107e0f1f8a98b007260b319226b88b3c From 30338511de5bcb894e65745f26bde9735dde1912 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:13:15 +0000 Subject: [PATCH 111/451] chore(api): update composite API spec --- .stats.yml | 6 +-- api.md | 8 ---- scripts/detect-breaking-changes | 1 - .../cloudforce-one/threat-events/index.ts | 6 +-- .../threat-events/indicator-types.ts | 48 +------------------ .../threat-events/threat-events.ts | 8 +--- .../threat-events/indicator-types.test.ts | 33 ------------- 7 files changed, 7 insertions(+), 103 deletions(-) delete mode 100644 tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts diff --git a/.stats.yml b/.stats.yml index e5238ac599..0dfc39f253 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-878533519fd9db620a1304c3c8c1a9c6ae0152ecdd9db10e132c422ecfe8f6dc.yml -openapi_spec_hash: edc942ea9859ed6d4199fd7e4aad7df1 +configured_endpoints: 1821 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-302e5506f03012aeccab2222e586119f27ffe78311a559e8b635bb9ef166864e.yml +openapi_spec_hash: c0c9e1e0211f019d4ed1acb57b44fa19 config_hash: 107e0f1f8a98b007260b319226b88b3c diff --git a/api.md b/api.md index 866462c86c..9375955f2e 100644 --- a/api.md +++ b/api.md @@ -8083,14 +8083,6 @@ Methods: ### IndicatorTypes -Types: - -- IndicatorTypeListResponse - -Methods: - -- client.cloudforceOne.threatEvents.indicatorTypes.list({ ...params }) -> IndicatorTypeListResponse - ### Raw Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 4580a22d2d..afe4516980 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -684,7 +684,6 @@ TEST_PATHS=( tests/api-resources/cloudforce-one/threat-events/categories.test.ts tests/api-resources/cloudforce-one/threat-events/countries.test.ts tests/api-resources/cloudforce-one/threat-events/datasets/datasets.test.ts - tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts tests/api-resources/cloudforce-one/threat-events/raw.test.ts tests/api-resources/cloudforce-one/threat-events/relate.test.ts tests/api-resources/cloudforce-one/threat-events/tags.test.ts diff --git a/src/resources/cloudforce-one/threat-events/index.ts b/src/resources/cloudforce-one/threat-events/index.ts index 02c8bab160..d797682ddd 100644 --- a/src/resources/cloudforce-one/threat-events/index.ts +++ b/src/resources/cloudforce-one/threat-events/index.ts @@ -36,11 +36,7 @@ export { type EventTagCreateParams, type EventTagDeleteParams, } from './event-tags'; -export { - IndicatorTypes, - type IndicatorTypeListResponse, - type IndicatorTypeListParams, -} from './indicator-types'; +export { IndicatorTypes } from './indicator-types'; export { Insights } from './insights'; export { Raw, type RawEditResponse, type RawGetResponse, type RawEditParams, type RawGetParams } from './raw'; export { Relate, type RelateDeleteResponse, type RelateDeleteParams } from './relate'; diff --git a/src/resources/cloudforce-one/threat-events/indicator-types.ts b/src/resources/cloudforce-one/threat-events/indicator-types.ts index 7fa1b77a16..99e5ccc453 100644 --- a/src/resources/cloudforce-one/threat-events/indicator-types.ts +++ b/src/resources/cloudforce-one/threat-events/indicator-types.ts @@ -1,51 +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 IndicatorTypes extends APIResource { - /** - * Lists all indicator types - * - * @example - * ```ts - * const indicatorTypes = - * await client.cloudforceOne.threatEvents.indicatorTypes.list( - * { account_id: 'account_id' }, - * ); - * ``` - */ - list( - params: IndicatorTypeListParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return this._client.get(`/accounts/${account_id}/cloudforce-one/events/indicatorTypes`, options); - } -} - -export interface IndicatorTypeListResponse { - items: IndicatorTypeListResponse.Items; - - type: string; -} - -export namespace IndicatorTypeListResponse { - export interface Items { - type: string; - } -} - -export interface IndicatorTypeListParams { - /** - * Account ID. - */ - account_id: string; -} - -export declare namespace IndicatorTypes { - export { - type IndicatorTypeListResponse as IndicatorTypeListResponse, - type IndicatorTypeListParams as IndicatorTypeListParams, - }; -} +export class IndicatorTypes 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 119f0b95d8..d23c37b5db 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -31,7 +31,7 @@ import { EventTags, } from './event-tags'; import * as IndicatorTypesAPI from './indicator-types'; -import { IndicatorTypeListParams, IndicatorTypeListResponse, IndicatorTypes } from './indicator-types'; +import { IndicatorTypes } from './indicator-types'; import * as InsightsAPI from './insights'; import { Insights } from './insights'; import * as RawAPI from './raw'; @@ -821,11 +821,7 @@ export declare namespace ThreatEvents { type DatasetRawParams as DatasetRawParams, }; - export { - IndicatorTypes as IndicatorTypes, - type IndicatorTypeListResponse as IndicatorTypeListResponse, - type IndicatorTypeListParams as IndicatorTypeListParams, - }; + export { IndicatorTypes as IndicatorTypes }; export { RawAPIRaw as Raw, diff --git a/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts b/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts deleted file mode 100644 index 9bd29bee68..0000000000 --- a/tests/api-resources/cloudforce-one/threat-events/indicator-types.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 indicatorTypes', () => { - // TODO: HTTP 401 from prism - test.skip('list: only required params', async () => { - const responsePromise = client.cloudforceOne.threatEvents.indicatorTypes.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); - }); - - // TODO: HTTP 401 from prism - test.skip('list: required and optional params', async () => { - const response = await client.cloudforceOne.threatEvents.indicatorTypes.list({ - account_id: 'account_id', - }); - }); -}); From 78ea083e677e5b6a0fdfc5439b106f01497fc4cc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:18:02 +0000 Subject: [PATCH 112/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0dfc39f253..ff05f1b7a8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-302e5506f03012aeccab2222e586119f27ffe78311a559e8b635bb9ef166864e.yml -openapi_spec_hash: c0c9e1e0211f019d4ed1acb57b44fa19 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-317861b37f96c79c2cb9349f7d6acc3cfb4627147191f4f97e7663d1ae7a26ef.yml +openapi_spec_hash: 98dc289145f8a9d00e412028f8873f70 config_hash: 107e0f1f8a98b007260b319226b88b3c From 25fa054296e39f507e45c9a79a66be7df2fce136 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:21:47 +0000 Subject: [PATCH 113/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ff05f1b7a8..0dfc39f253 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-317861b37f96c79c2cb9349f7d6acc3cfb4627147191f4f97e7663d1ae7a26ef.yml -openapi_spec_hash: 98dc289145f8a9d00e412028f8873f70 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-302e5506f03012aeccab2222e586119f27ffe78311a559e8b635bb9ef166864e.yml +openapi_spec_hash: c0c9e1e0211f019d4ed1acb57b44fa19 config_hash: 107e0f1f8a98b007260b319226b88b3c From 295d2d60ba9aaee969bb5a35e901aacd5c682a02 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:24:36 +0000 Subject: [PATCH 114/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0dfc39f253..ec757ba414 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-302e5506f03012aeccab2222e586119f27ffe78311a559e8b635bb9ef166864e.yml -openapi_spec_hash: c0c9e1e0211f019d4ed1acb57b44fa19 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2e69c11ff6cb2fdd77756112ab8f50924c637aa28aef8b114ad8869a6db3b06f.yml +openapi_spec_hash: 2578dd60e275ebc56de985e405a741ec config_hash: 107e0f1f8a98b007260b319226b88b3c From f48e5a72ed7e331ab77888896ad0716a47738bfa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:26:24 +0000 Subject: [PATCH 115/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ec757ba414..93926ab2ce 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2e69c11ff6cb2fdd77756112ab8f50924c637aa28aef8b114ad8869a6db3b06f.yml -openapi_spec_hash: 2578dd60e275ebc56de985e405a741ec +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4dccad9ef6f5edec520f8a93ae54827059d7b779893b2888a455564b0203d03c.yml +openapi_spec_hash: 7573a54478f378a1ee2d3b1c747eead0 config_hash: 107e0f1f8a98b007260b319226b88b3c From 86704858383a63dbe0e3ac420d81023141cc96d9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:28:15 +0000 Subject: [PATCH 116/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 93926ab2ce..cf38d82f1c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4dccad9ef6f5edec520f8a93ae54827059d7b779893b2888a455564b0203d03c.yml -openapi_spec_hash: 7573a54478f378a1ee2d3b1c747eead0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e9fd8d3a7ac4f8a271f383a549956e5f8ad5f7884e15119404d8df413937aab8.yml +openapi_spec_hash: 00e9616e83943a63fb2120e0ee5d7353 config_hash: 107e0f1f8a98b007260b319226b88b3c From 7137b422bd8fdab3cff03a8fe1320deaa8cd2082 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:39:08 +0000 Subject: [PATCH 117/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index cf38d82f1c..93926ab2ce 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e9fd8d3a7ac4f8a271f383a549956e5f8ad5f7884e15119404d8df413937aab8.yml -openapi_spec_hash: 00e9616e83943a63fb2120e0ee5d7353 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4dccad9ef6f5edec520f8a93ae54827059d7b779893b2888a455564b0203d03c.yml +openapi_spec_hash: 7573a54478f378a1ee2d3b1c747eead0 config_hash: 107e0f1f8a98b007260b319226b88b3c From b22a684af5a294508254cfeb5351c4b10fbd5562 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:40:44 +0000 Subject: [PATCH 118/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 93926ab2ce..b8b2d9f1bb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4dccad9ef6f5edec520f8a93ae54827059d7b779893b2888a455564b0203d03c.yml -openapi_spec_hash: 7573a54478f378a1ee2d3b1c747eead0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fab1b13a6685734f46c9f6824d811280d29aa7e878dfeeb8eb327319e4426c5e.yml +openapi_spec_hash: 4b8224693eb2e701bb2a31316990ddb8 config_hash: 107e0f1f8a98b007260b319226b88b3c From 6dcf602957e08806f8da06c79172ad6282873d28 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:42:34 +0000 Subject: [PATCH 119/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b8b2d9f1bb..42100058b9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fab1b13a6685734f46c9f6824d811280d29aa7e878dfeeb8eb327319e4426c5e.yml -openapi_spec_hash: 4b8224693eb2e701bb2a31316990ddb8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc9f32d982c7cf904f94e4a1663f83e4812b9de1299753d5b0acca500cef173e.yml +openapi_spec_hash: c42ca98eb15567b81d2c0e4e35a6891b config_hash: 107e0f1f8a98b007260b319226b88b3c From 7c883aeed4c17db8db54b5e7b6224797921b26a6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:44:17 +0000 Subject: [PATCH 120/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 42100058b9..c45e77309e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc9f32d982c7cf904f94e4a1663f83e4812b9de1299753d5b0acca500cef173e.yml -openapi_spec_hash: c42ca98eb15567b81d2c0e4e35a6891b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-936b07eb800a7916c5a0f4005d75fb955fc44cbb1ad9b15e4fb7c6f916ce1abd.yml +openapi_spec_hash: 9e491f6cfa12fb960ed81115e9d5bba4 config_hash: 107e0f1f8a98b007260b319226b88b3c From 4b8c7e73bea5de4eb9a268f9a87d823e1c25698a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:58:21 +0000 Subject: [PATCH 121/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index c45e77309e..617f949595 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-936b07eb800a7916c5a0f4005d75fb955fc44cbb1ad9b15e4fb7c6f916ce1abd.yml -openapi_spec_hash: 9e491f6cfa12fb960ed81115e9d5bba4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fb0835d93daaf02d433dc7ac7385dcf84a5ea4d1ec6aef866780ff20eb4ab462.yml +openapi_spec_hash: 03575c4e96b41e8b64cb008ec5d8248b config_hash: 107e0f1f8a98b007260b319226b88b3c From aeeb50a2e35850a4dc9d81bda40ed01291fc3c96 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:00:26 +0000 Subject: [PATCH 122/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 617f949595..5cd7db0a20 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fb0835d93daaf02d433dc7ac7385dcf84a5ea4d1ec6aef866780ff20eb4ab462.yml -openapi_spec_hash: 03575c4e96b41e8b64cb008ec5d8248b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-01f9149db5a0dd995d1310e5eca07552fbe0ecf0cfb30a39938fd7c0284139fb.yml +openapi_spec_hash: f4b7e2cb8774e92cc6cd2c1a6038a707 config_hash: 107e0f1f8a98b007260b319226b88b3c From 1dd7d52fbe45fec12b7cfb615d4bbb77f8c3491d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:08:40 +0000 Subject: [PATCH 123/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5cd7db0a20..93926ab2ce 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-01f9149db5a0dd995d1310e5eca07552fbe0ecf0cfb30a39938fd7c0284139fb.yml -openapi_spec_hash: f4b7e2cb8774e92cc6cd2c1a6038a707 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4dccad9ef6f5edec520f8a93ae54827059d7b779893b2888a455564b0203d03c.yml +openapi_spec_hash: 7573a54478f378a1ee2d3b1c747eead0 config_hash: 107e0f1f8a98b007260b319226b88b3c From 46f1c755798963ef804a3b2131d25ee2eee43755 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:11:44 +0000 Subject: [PATCH 124/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 93926ab2ce..3b129fa933 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4dccad9ef6f5edec520f8a93ae54827059d7b779893b2888a455564b0203d03c.yml -openapi_spec_hash: 7573a54478f378a1ee2d3b1c747eead0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e0af63c9fb8363cf5cb0177ae3d7e6b620b3a145a8221e856e12f0c5f2f17f4c.yml +openapi_spec_hash: bde8d5c2bfe3244eda628b3de29d7fe4 config_hash: 107e0f1f8a98b007260b319226b88b3c From 9ea2d249c0fa05eb92c41ae5cc445fef70b1ef53 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:13:25 +0000 Subject: [PATCH 125/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3b129fa933..93926ab2ce 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e0af63c9fb8363cf5cb0177ae3d7e6b620b3a145a8221e856e12f0c5f2f17f4c.yml -openapi_spec_hash: bde8d5c2bfe3244eda628b3de29d7fe4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4dccad9ef6f5edec520f8a93ae54827059d7b779893b2888a455564b0203d03c.yml +openapi_spec_hash: 7573a54478f378a1ee2d3b1c747eead0 config_hash: 107e0f1f8a98b007260b319226b88b3c From ae66ffe2e5e91fb012fcd01734536887f86a71c1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:25:22 +0000 Subject: [PATCH 126/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 93926ab2ce..a174f123e5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4dccad9ef6f5edec520f8a93ae54827059d7b779893b2888a455564b0203d03c.yml -openapi_spec_hash: 7573a54478f378a1ee2d3b1c747eead0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1544d3ce240854918fbe9b00b19fbb0674ea2407efdc76d3e9da856b83de1ca9.yml +openapi_spec_hash: a9cccbe23c91f680f2f2a60cb05bf6e7 config_hash: 107e0f1f8a98b007260b319226b88b3c From 4a63323bf4c219feaa00e355bff24d7c679daf99 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:27:21 +0000 Subject: [PATCH 127/451] chore(api): update composite API spec --- .stats.yml | 4 ++-- src/resources/zero-trust/dlp/entries/custom.ts | 3 +-- src/resources/zero-trust/dlp/entries/entries.ts | 3 +-- tests/api-resources/zero-trust/dlp/entries/custom.test.ts | 1 - tests/api-resources/zero-trust/dlp/entries/entries.test.ts | 1 - 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index a174f123e5..472fe47b73 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1544d3ce240854918fbe9b00b19fbb0674ea2407efdc76d3e9da856b83de1ca9.yml -openapi_spec_hash: a9cccbe23c91f680f2f2a60cb05bf6e7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ba49f660dd96ef4b12f92d84c930d1ede9f18231fd368bb055663b088cc0ba08.yml +openapi_spec_hash: 012280d2210535547f7b350a2e7bd01d config_hash: 107e0f1f8a98b007260b319226b88b3c diff --git a/src/resources/zero-trust/dlp/entries/custom.ts b/src/resources/zero-trust/dlp/entries/custom.ts index dcd4d0928f..15d6ea9d8c 100644 --- a/src/resources/zero-trust/dlp/entries/custom.ts +++ b/src/resources/zero-trust/dlp/entries/custom.ts @@ -17,7 +17,6 @@ export class Custom extends APIResource { * enabled: true, * name: 'name', * pattern: { regex: 'regex' }, - * profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * }); * ``` */ @@ -471,7 +470,7 @@ export interface CustomCreateParams { /** * Body param: */ - profile_id: string; + profile_id?: string; } export interface CustomUpdateParams { diff --git a/src/resources/zero-trust/dlp/entries/entries.ts b/src/resources/zero-trust/dlp/entries/entries.ts index 31eb68b9ee..de1cb6ba36 100644 --- a/src/resources/zero-trust/dlp/entries/entries.ts +++ b/src/resources/zero-trust/dlp/entries/entries.ts @@ -65,7 +65,6 @@ export class Entries extends APIResource { * enabled: true, * name: 'name', * pattern: { regex: 'regex' }, - * profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * }); * ``` */ @@ -637,7 +636,7 @@ export interface EntryCreateParams { /** * Body param: */ - profile_id: string; + profile_id?: string; } export type EntryUpdateParams = diff --git a/tests/api-resources/zero-trust/dlp/entries/custom.test.ts b/tests/api-resources/zero-trust/dlp/entries/custom.test.ts index fa0b9659df..a07726b8c7 100644 --- a/tests/api-resources/zero-trust/dlp/entries/custom.test.ts +++ b/tests/api-resources/zero-trust/dlp/entries/custom.test.ts @@ -16,7 +16,6 @@ describe('resource custom', () => { enabled: true, name: 'name', pattern: { regex: 'regex' }, - profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); diff --git a/tests/api-resources/zero-trust/dlp/entries/entries.test.ts b/tests/api-resources/zero-trust/dlp/entries/entries.test.ts index 0758392e54..aaeb9ac8db 100644 --- a/tests/api-resources/zero-trust/dlp/entries/entries.test.ts +++ b/tests/api-resources/zero-trust/dlp/entries/entries.test.ts @@ -16,7 +16,6 @@ describe('resource entries', () => { enabled: true, name: 'name', pattern: { regex: 'regex' }, - profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); From 9db0cd2d20b975adf6a66d7e808fc2fa328ae881 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 17:01:30 +0000 Subject: [PATCH 128/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 472fe47b73..2f2574106c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ba49f660dd96ef4b12f92d84c930d1ede9f18231fd368bb055663b088cc0ba08.yml -openapi_spec_hash: 012280d2210535547f7b350a2e7bd01d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-009825268332086c335dfb91b3728d10e06a6bf50c0aeafa19a8d8f016580b90.yml +openapi_spec_hash: 4db8a4a34f4985a0d660c8dddc326dfa config_hash: 107e0f1f8a98b007260b319226b88b3c From 9e275e551855666fa0d122242bcfbd5f610474ac Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 17:09:26 +0000 Subject: [PATCH 129/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2f2574106c..b3bf938834 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-009825268332086c335dfb91b3728d10e06a6bf50c0aeafa19a8d8f016580b90.yml -openapi_spec_hash: 4db8a4a34f4985a0d660c8dddc326dfa +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-87e87a69e36caad72ff56e0a6ed9e77e7ef2faed01daaa3c1f303763bd9fa1b0.yml +openapi_spec_hash: 127afe5c055898b679518eab9eebd4ad config_hash: 107e0f1f8a98b007260b319226b88b3c From 82da793e4e83294b4098825f2bbf0519c292fd53 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 17:11:24 +0000 Subject: [PATCH 130/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b3bf938834..472fe47b73 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-87e87a69e36caad72ff56e0a6ed9e77e7ef2faed01daaa3c1f303763bd9fa1b0.yml -openapi_spec_hash: 127afe5c055898b679518eab9eebd4ad +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ba49f660dd96ef4b12f92d84c930d1ede9f18231fd368bb055663b088cc0ba08.yml +openapi_spec_hash: 012280d2210535547f7b350a2e7bd01d config_hash: 107e0f1f8a98b007260b319226b88b3c From cc5c442ead58fbbcc5bb93bd2865ae4785cc1e44 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 17:13:24 +0000 Subject: [PATCH 131/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 472fe47b73..8bbc0e0b44 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ba49f660dd96ef4b12f92d84c930d1ede9f18231fd368bb055663b088cc0ba08.yml -openapi_spec_hash: 012280d2210535547f7b350a2e7bd01d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56062b3711bdcfa023752d52202934914fbdb6069c4389a3fa6cab91000add36.yml +openapi_spec_hash: 66be6bbbde53de36041b1ee71312da68 config_hash: 107e0f1f8a98b007260b319226b88b3c From 0cd9e60d02deb53076c613a01167d6c3eefa17f7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 17:59:41 +0000 Subject: [PATCH 132/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8bbc0e0b44..5ee970eb1e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56062b3711bdcfa023752d52202934914fbdb6069c4389a3fa6cab91000add36.yml -openapi_spec_hash: 66be6bbbde53de36041b1ee71312da68 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9667278c4af77af1d85479842c5a92ad97d3736e99553a5e5da5ad18813080bb.yml +openapi_spec_hash: 2556d32938912a065cb84ee973388c79 config_hash: 107e0f1f8a98b007260b319226b88b3c From 7f40c0960b59951aff8b7619069f7a009e9774ef Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 18:01:35 +0000 Subject: [PATCH 133/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5ee970eb1e..b247faff4d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9667278c4af77af1d85479842c5a92ad97d3736e99553a5e5da5ad18813080bb.yml -openapi_spec_hash: 2556d32938912a065cb84ee973388c79 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4d622f8408fd469b2202089a38265c9f63b083ecd051f06b68309e23e3438dcd.yml +openapi_spec_hash: bc764554b61d63c51e01507a6ce9d98f config_hash: 107e0f1f8a98b007260b319226b88b3c From 6223cf15a4d566dd6a0feea235d6e072ca95e111 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 18:13:46 +0000 Subject: [PATCH 134/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b247faff4d..2f2574106c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4d622f8408fd469b2202089a38265c9f63b083ecd051f06b68309e23e3438dcd.yml -openapi_spec_hash: bc764554b61d63c51e01507a6ce9d98f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-009825268332086c335dfb91b3728d10e06a6bf50c0aeafa19a8d8f016580b90.yml +openapi_spec_hash: 4db8a4a34f4985a0d660c8dddc326dfa config_hash: 107e0f1f8a98b007260b319226b88b3c From e21d04ef097071c10bc2c079eea6934a8e94ddbe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 18:15:31 +0000 Subject: [PATCH 135/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2f2574106c..c92c0b5e8b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-009825268332086c335dfb91b3728d10e06a6bf50c0aeafa19a8d8f016580b90.yml -openapi_spec_hash: 4db8a4a34f4985a0d660c8dddc326dfa +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5dede706b9d70c4afe3f01a74a20c6ab4c444438aefcc66f9112470b80cabb57.yml +openapi_spec_hash: 1f8c22620ad1336c3ba6d796382f47c4 config_hash: 107e0f1f8a98b007260b319226b88b3c From 4ccbd4c0eca9466295289e0fc3825a815764efab Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 18:55:31 +0000 Subject: [PATCH 136/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index c92c0b5e8b..3269943db5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5dede706b9d70c4afe3f01a74a20c6ab4c444438aefcc66f9112470b80cabb57.yml -openapi_spec_hash: 1f8c22620ad1336c3ba6d796382f47c4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-187c129bbea7ee404651c651a8e93cbcfb84131e29c3dd76299cf6edb8e0ea19.yml +openapi_spec_hash: 9ad0908113456a44b56fbd93481a687a config_hash: 107e0f1f8a98b007260b319226b88b3c From 7fbb3f66d091d040e017e778462ba76a717b78a0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 18:57:30 +0000 Subject: [PATCH 137/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3269943db5..2f2574106c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-187c129bbea7ee404651c651a8e93cbcfb84131e29c3dd76299cf6edb8e0ea19.yml -openapi_spec_hash: 9ad0908113456a44b56fbd93481a687a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-009825268332086c335dfb91b3728d10e06a6bf50c0aeafa19a8d8f016580b90.yml +openapi_spec_hash: 4db8a4a34f4985a0d660c8dddc326dfa config_hash: 107e0f1f8a98b007260b319226b88b3c From 6543416b85c4164f846b078e1af2458d8f198873 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 18:59:42 +0000 Subject: [PATCH 138/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2f2574106c..472fe47b73 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-009825268332086c335dfb91b3728d10e06a6bf50c0aeafa19a8d8f016580b90.yml -openapi_spec_hash: 4db8a4a34f4985a0d660c8dddc326dfa +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ba49f660dd96ef4b12f92d84c930d1ede9f18231fd368bb055663b088cc0ba08.yml +openapi_spec_hash: 012280d2210535547f7b350a2e7bd01d config_hash: 107e0f1f8a98b007260b319226b88b3c From 012cd4215d35080ee45718179523828f60a0811f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 19:11:12 +0000 Subject: [PATCH 139/451] feat: fix(content_scanning): content scanning terraform resource * feat(content_scanning): Add content scanning terraform resource --- .stats.yml | 4 +- api.md | 6 + .../content-scanning/content-scanning.ts | 170 ++++++++++++++++++ src/resources/content-scanning/payloads.ts | 39 ++++ src/resources/content-scanning/settings.ts | 7 + .../content-scanning/content-scanning.test.ts | 57 ++++++ 6 files changed, 281 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 472fe47b73..85404b357e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1821 +configured_endpoints: 1822 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ba49f660dd96ef4b12f92d84c930d1ede9f18231fd368bb055663b088cc0ba08.yml openapi_spec_hash: 012280d2210535547f7b350a2e7bd01d -config_hash: 107e0f1f8a98b007260b319226b88b3c +config_hash: 0ce5789fc4b59ae352e68d00847570c2 diff --git a/api.md b/api.md index 9375955f2e..c160bbe534 100644 --- a/api.md +++ b/api.md @@ -8501,13 +8501,19 @@ Methods: Types: +- ContentScanningCreateResponse +- ContentScanningUpdateResponse - ContentScanningDisableResponse - ContentScanningEnableResponse +- ContentScanningGetResponse Methods: +- client.contentScanning.create({ ...params }) -> ContentScanningCreateResponse +- client.contentScanning.update({ ...params }) -> ContentScanningUpdateResponse - client.contentScanning.disable({ ...params }) -> ContentScanningDisableResponse - client.contentScanning.enable({ ...params }) -> ContentScanningEnableResponse +- client.contentScanning.get({ ...params }) -> ContentScanningGetResponse ## Payloads diff --git a/src/resources/content-scanning/content-scanning.ts b/src/resources/content-scanning/content-scanning.ts index 18f79cbd0a..49130883ac 100644 --- a/src/resources/content-scanning/content-scanning.ts +++ b/src/resources/content-scanning/content-scanning.ts @@ -22,8 +22,67 @@ export class ContentScanning extends APIResource { payloads: PayloadsAPI.Payloads = new PayloadsAPI.Payloads(this._client); settings: SettingsAPI.Settings = new SettingsAPI.Settings(this._client); + /** + * Update the Content Scanning status. + * + * @example + * ```ts + * const contentScanning = await client.contentScanning.create( + * { + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * value: 'enabled', + * }, + * ); + * ``` + */ + create( + params: ContentScanningCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.put(`/zones/${zone_id}/content-upload-scan/settings`, { + body, + ...options, + }) as Core.APIPromise<{ result: ContentScanningCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update the Content Scanning status. + * + * @example + * ```ts + * const contentScanning = await client.contentScanning.update( + * { + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * value: 'enabled', + * }, + * ); + * ``` + */ + update( + params: ContentScanningUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.put(`/zones/${zone_id}/content-upload-scan/settings`, { + body, + ...options, + }) as Core.APIPromise<{ result: ContentScanningUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Disable Content Scanning. + * + * @example + * ```ts + * const response = await client.contentScanning.disable({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ disable( params: ContentScanningDisableParams, @@ -39,6 +98,13 @@ export class ContentScanning extends APIResource { /** * Enable Content Scanning. + * + * @example + * ```ts + * const response = await client.contentScanning.enable({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ enable( params: ContentScanningEnableParams, @@ -51,12 +117,103 @@ export class ContentScanning extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieve the current status of Content Scanning. + * + * @example + * ```ts + * const contentScanning = await client.contentScanning.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + get( + params: ContentScanningGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.get(`/zones/${zone_id}/content-upload-scan/settings`, options) as Core.APIPromise<{ + result: ContentScanningGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +/** + * Defines the status for Content Scanning. + */ +export interface ContentScanningCreateResponse { + /** + * Defines the last modification date (ISO 8601) of the Content Scanning status. + */ + modified?: string; + + /** + * Defines the status of Content Scanning. + */ + value?: string; +} + +/** + * Defines the status for Content Scanning. + */ +export interface ContentScanningUpdateResponse { + /** + * Defines the last modification date (ISO 8601) of the Content Scanning status. + */ + modified?: string; + + /** + * Defines the status of Content Scanning. + */ + value?: string; } export type ContentScanningDisableResponse = unknown; export type ContentScanningEnableResponse = unknown; +/** + * Defines the status for Content Scanning. + */ +export interface ContentScanningGetResponse { + /** + * Defines the last modification date (ISO 8601) of the Content Scanning status. + */ + modified?: string; + + /** + * Defines the status of Content Scanning. + */ + value?: string; +} + +export interface ContentScanningCreateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: The status value for Content Scanning. + */ + value: 'enabled' | 'disabled'; +} + +export interface ContentScanningUpdateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: The status value for Content Scanning. + */ + value: 'enabled' | 'disabled'; +} + export interface ContentScanningDisableParams { /** * Defines an identifier. @@ -71,6 +228,13 @@ export interface ContentScanningEnableParams { zone_id: string; } +export interface ContentScanningGetParams { + /** + * Defines an identifier. + */ + zone_id: string; +} + ContentScanning.Payloads = Payloads; ContentScanning.PayloadCreateResponsesSinglePage = PayloadCreateResponsesSinglePage; ContentScanning.PayloadListResponsesSinglePage = PayloadListResponsesSinglePage; @@ -79,10 +243,16 @@ ContentScanning.Settings = Settings; export declare namespace ContentScanning { export { + type ContentScanningCreateResponse as ContentScanningCreateResponse, + type ContentScanningUpdateResponse as ContentScanningUpdateResponse, type ContentScanningDisableResponse as ContentScanningDisableResponse, type ContentScanningEnableResponse as ContentScanningEnableResponse, + type ContentScanningGetResponse as ContentScanningGetResponse, + type ContentScanningCreateParams as ContentScanningCreateParams, + type ContentScanningUpdateParams as ContentScanningUpdateParams, type ContentScanningDisableParams as ContentScanningDisableParams, type ContentScanningEnableParams as ContentScanningEnableParams, + type ContentScanningGetParams as ContentScanningGetParams, }; export { diff --git a/src/resources/content-scanning/payloads.ts b/src/resources/content-scanning/payloads.ts index d3fad16a42..12c7fa4b8e 100644 --- a/src/resources/content-scanning/payloads.ts +++ b/src/resources/content-scanning/payloads.ts @@ -7,6 +7,24 @@ import { SinglePage } from '../../pagination'; export class Payloads extends APIResource { /** * Add custom scan expressions for Content Scanning. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const payloadCreateResponse of client.contentScanning.payloads.create( + * { + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * body: [ + * { + * payload: + * 'lookup_json_string(http.request.body.raw, "file")', + * }, + * ], + * }, + * )) { + * // ... + * } + * ``` */ create( params: PayloadCreateParams, @@ -22,6 +40,16 @@ export class Payloads extends APIResource { /** * Get a list of existing custom scan expressions for Content Scanning. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const payloadListResponse of client.contentScanning.payloads.list( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` */ list( params: PayloadListParams, @@ -37,6 +65,17 @@ export class Payloads extends APIResource { /** * Delete a Content Scan Custom Expression. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const payloadDeleteResponse of client.contentScanning.payloads.delete( + * 'a350a054caa840c9becd89c3b4f0195b', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` */ delete( expressionId: string, diff --git a/src/resources/content-scanning/settings.ts b/src/resources/content-scanning/settings.ts index 8d5958e68a..4f1eaef4f5 100644 --- a/src/resources/content-scanning/settings.ts +++ b/src/resources/content-scanning/settings.ts @@ -6,6 +6,13 @@ import * as Core from '../../core'; export class Settings extends APIResource { /** * Retrieve the current status of Content Scanning. + * + * @example + * ```ts + * const setting = await client.contentScanning.settings.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ get(params: SettingGetParams, options?: Core.RequestOptions): Core.APIPromise { const { zone_id } = params; diff --git a/tests/api-resources/content-scanning/content-scanning.test.ts b/tests/api-resources/content-scanning/content-scanning.test.ts index 6df0f4d23d..9b2d5e6d4a 100644 --- a/tests/api-resources/content-scanning/content-scanning.test.ts +++ b/tests/api-resources/content-scanning/content-scanning.test.ts @@ -10,6 +10,48 @@ const client = new Cloudflare({ }); describe('resource contentScanning', () => { + test('create: only required params', async () => { + const responsePromise = client.contentScanning.create({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + value: 'enabled', + }); + 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.contentScanning.create({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + value: 'enabled', + }); + }); + + test('update: only required params', async () => { + const responsePromise = client.contentScanning.update({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + value: 'enabled', + }); + 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.contentScanning.update({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + value: 'enabled', + }); + }); + test('disable: only required params', async () => { const responsePromise = client.contentScanning.disable({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); const rawResponse = await responsePromise.asResponse(); @@ -39,4 +81,19 @@ describe('resource contentScanning', () => { test('enable: required and optional params', async () => { const response = await client.contentScanning.enable({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); }); + + test('get: only required params', async () => { + const responsePromise = client.contentScanning.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.contentScanning.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + }); }); From 296beb0e638d900248cf28f49999d95c4b4900aa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 19:19:41 +0000 Subject: [PATCH 140/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 85404b357e..0c56880d14 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ba49f660dd96ef4b12f92d84c930d1ede9f18231fd368bb055663b088cc0ba08.yml -openapi_spec_hash: 012280d2210535547f7b350a2e7bd01d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9b369dc1d0b1f058056cb0db0850ca16da2badca7d9604d1fd84fa88a2d35c14.yml +openapi_spec_hash: d3d23fbe4d6c4ac612fb8c979cff52b9 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 3a8e76b9d91959f981f03a3b79b30a64705ef220 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 20:31:06 +0000 Subject: [PATCH 141/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0c56880d14..1af635d38e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9b369dc1d0b1f058056cb0db0850ca16da2badca7d9604d1fd84fa88a2d35c14.yml -openapi_spec_hash: d3d23fbe4d6c4ac612fb8c979cff52b9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dd9b225fa2ceb443a800a17ba69bc0dc70ff2aa303e5cf2e3f7a641a1a6e6250.yml +openapi_spec_hash: 83ba77e3055e6f73b9e47dfc4a222ba6 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 39c79587da5a3220df3c16273f711e3145331170 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 20:43:27 +0000 Subject: [PATCH 142/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1af635d38e..2efcec9c46 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dd9b225fa2ceb443a800a17ba69bc0dc70ff2aa303e5cf2e3f7a641a1a6e6250.yml -openapi_spec_hash: 83ba77e3055e6f73b9e47dfc4a222ba6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bb49326953c3734a75db76d0d00acdca4af4263307818278166ccf00997cb8a0.yml +openapi_spec_hash: 527820ab5579c3f7f114402bc3e75bab config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 0d32174a62d5d7c6525060799593fbde8b02aafd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 20:45:15 +0000 Subject: [PATCH 143/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2efcec9c46..1af635d38e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bb49326953c3734a75db76d0d00acdca4af4263307818278166ccf00997cb8a0.yml -openapi_spec_hash: 527820ab5579c3f7f114402bc3e75bab +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dd9b225fa2ceb443a800a17ba69bc0dc70ff2aa303e5cf2e3f7a641a1a6e6250.yml +openapi_spec_hash: 83ba77e3055e6f73b9e47dfc4a222ba6 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From ecc35c88e94eed39446582dcb6f420cf501f3b4d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 20:53:52 +0000 Subject: [PATCH 144/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1af635d38e..2efcec9c46 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dd9b225fa2ceb443a800a17ba69bc0dc70ff2aa303e5cf2e3f7a641a1a6e6250.yml -openapi_spec_hash: 83ba77e3055e6f73b9e47dfc4a222ba6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bb49326953c3734a75db76d0d00acdca4af4263307818278166ccf00997cb8a0.yml +openapi_spec_hash: 527820ab5579c3f7f114402bc3e75bab config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 7e1d5150cfbd56965d074185cefb12ea21fbef1b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 20:55:48 +0000 Subject: [PATCH 145/451] chore(api): update composite API spec --- .stats.yml | 4 +-- src/resources/accounts/accounts.ts | 30 +++++++++++++++++++ tests/api-resources/accounts/accounts.test.ts | 1 + 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2efcec9c46..eef10d9c1b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bb49326953c3734a75db76d0d00acdca4af4263307818278166ccf00997cb8a0.yml -openapi_spec_hash: 527820ab5579c3f7f114402bc3e75bab +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b45a7c9b5011d74006b51009d3b7c3ae5ad3277f49ad983196498db1d5ea2f19.yml +openapi_spec_hash: 84f0fca0313c9c7e5567689bb8e6866a config_hash: 0ce5789fc4b59ae352e68d00847570c2 diff --git a/src/resources/accounts/accounts.ts b/src/resources/accounts/accounts.ts index 1f17f46efb..332d3d488d 100644 --- a/src/resources/accounts/accounts.ts +++ b/src/resources/accounts/accounts.ts @@ -175,6 +175,11 @@ export interface Account { */ created_on?: string; + /** + * Parent container details + */ + managed_by?: Account.ManagedBy; + /** * Account settings */ @@ -182,6 +187,21 @@ export interface Account { } export namespace Account { + /** + * Parent container details + */ + export interface ManagedBy { + /** + * ID of the parent Organization, if one exists + */ + parent_org_id?: string; + + /** + * Name of the parent Organization, if one exists + */ + parent_org_name?: string; + } + /** * Account settings */ @@ -257,6 +277,11 @@ export interface AccountUpdateParams { */ type: 'standard' | 'enterprise'; + /** + * Body param: Parent container details + */ + managed_by?: AccountUpdateParams.ManagedBy; + /** * Body param: Account settings */ @@ -264,6 +289,11 @@ export interface AccountUpdateParams { } export namespace AccountUpdateParams { + /** + * Parent container details + */ + export interface ManagedBy {} + /** * Account settings */ diff --git a/tests/api-resources/accounts/accounts.test.ts b/tests/api-resources/accounts/accounts.test.ts index 562c65986b..c3e50bb520 100644 --- a/tests/api-resources/accounts/accounts.test.ts +++ b/tests/api-resources/accounts/accounts.test.ts @@ -51,6 +51,7 @@ describe('resource accounts', () => { id: '023e105f4ecef8ad9ca31a8372d0c353', name: 'Demo Account', type: 'standard', + managed_by: {}, settings: { abuse_contact_email: 'abuse_contact_email', enforce_twofactor: true }, }); }); From 44c693f57db12c1f9650e92060d0e8dcb90adb5f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 21:36:25 +0000 Subject: [PATCH 146/451] chore(internal): use npm pack for build uploads --- scripts/utils/upload-artifact.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index 37da0aeda5..b228a8dec5 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -12,9 +12,11 @@ if [[ "$SIGNED_URL" == "null" ]]; then exit 1 fi -UPLOAD_RESPONSE=$(tar "${BASE_PATH:+-C$BASE_PATH}" -cz "${ARTIFACT_PATH:-dist}" | curl -v -X PUT \ +TARBALL=$(cd dist && npm pack --silent) + +UPLOAD_RESPONSE=$(curl -v -X PUT \ -H "Content-Type: application/gzip" \ - --data-binary @- "$SIGNED_URL" 2>&1) + --data-binary "@dist/$TARBALL" "$SIGNED_URL" 2>&1) if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then echo -e "\033[32mUploaded build to Stainless storage.\033[0m" From bf82f87cd10429cd6e1043e6d9345975d2c799cc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 22:54:55 +0000 Subject: [PATCH 147/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index eef10d9c1b..e07b784637 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b45a7c9b5011d74006b51009d3b7c3ae5ad3277f49ad983196498db1d5ea2f19.yml -openapi_spec_hash: 84f0fca0313c9c7e5567689bb8e6866a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e792c2eab080669a0daf446d8b6ce8881081900fc1d1f9dcb8ddf4d59abf30ce.yml +openapi_spec_hash: bae3a8d628c9082adeb24436bb554cb7 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 05567405452101c97b46c7707cebb5fc9470162e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 22:56:50 +0000 Subject: [PATCH 148/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e07b784637..c19dd5019a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e792c2eab080669a0daf446d8b6ce8881081900fc1d1f9dcb8ddf4d59abf30ce.yml -openapi_spec_hash: bae3a8d628c9082adeb24436bb554cb7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8e9aed908b48ddf6f3a92cc1f1048e49283f7e26ca8dd3ce3a846e4ede11a5a9.yml +openapi_spec_hash: 8e1e449cb24d99ebbca8ce80b91bde4d config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 4ac309b26a73c37c50560b0e9ca20144d0ff97fd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 00:56:16 +0000 Subject: [PATCH 149/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index c19dd5019a..e07b784637 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8e9aed908b48ddf6f3a92cc1f1048e49283f7e26ca8dd3ce3a846e4ede11a5a9.yml -openapi_spec_hash: 8e1e449cb24d99ebbca8ce80b91bde4d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e792c2eab080669a0daf446d8b6ce8881081900fc1d1f9dcb8ddf4d59abf30ce.yml +openapi_spec_hash: bae3a8d628c9082adeb24436bb554cb7 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 634be4563031b41bd259a1fd91deb9c39ac817dd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 00:58:21 +0000 Subject: [PATCH 150/451] chore(api): update composite API spec --- .stats.yml | 4 +- .../dispatch/namespaces/scripts/bindings.ts | 18 ------- .../dispatch/namespaces/scripts/scripts.ts | 18 ------- .../dispatch/namespaces/scripts/settings.ts | 54 ------------------- .../workers/beta/workers/versions.ts | 36 ------------- .../scripts/script-and-version-settings.ts | 54 ------------------- src/resources/workers/scripts/scripts.ts | 18 ------- src/resources/workers/scripts/versions.ts | 54 ------------------- 8 files changed, 2 insertions(+), 254 deletions(-) diff --git a/.stats.yml b/.stats.yml index e07b784637..4bf48ded87 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e792c2eab080669a0daf446d8b6ce8881081900fc1d1f9dcb8ddf4d59abf30ce.yml -openapi_spec_hash: bae3a8d628c9082adeb24436bb554cb7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d5f53e5508d8f941df5f84e4b33254b7f8fef984207245ecb0f88c77b5d08de7.yml +openapi_spec_hash: 5bdb96ad1634898d364257edfb2062d2 config_hash: 0ce5789fc4b59ae352e68d00847570c2 diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts index 4af2451c88..d2cb382d90 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts @@ -63,7 +63,6 @@ export type BindingGetResponse = | BindingGetResponse.WorkersBindingKindSecretText | BindingGetResponse.WorkersBindingKindSendEmail | BindingGetResponse.WorkersBindingKindService - | BindingGetResponse.WorkersBindingKindTailConsumer | BindingGetResponse.WorkersBindingKindTextBlob | BindingGetResponse.WorkersBindingKindVectorize | BindingGetResponse.WorkersBindingKindVersionMetadata @@ -493,23 +492,6 @@ export namespace BindingGetResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. 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 78e5e95423..554313f4d3 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -372,7 +372,6 @@ export namespace ScriptUpdateParams { | Metadata.WorkersBindingKindSecretText | Metadata.WorkersBindingKindSendEmail | Metadata.WorkersBindingKindService - | Metadata.WorkersBindingKindTailConsumer | Metadata.WorkersBindingKindTextBlob | Metadata.WorkersBindingKindVectorize | Metadata.WorkersBindingKindVersionMetadata @@ -946,23 +945,6 @@ export namespace ScriptUpdateParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. 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 216456a041..fb897aea3f 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -91,7 +91,6 @@ export interface SettingEditResponse { | SettingEditResponse.WorkersBindingKindSecretText | SettingEditResponse.WorkersBindingKindSendEmail | SettingEditResponse.WorkersBindingKindService - | SettingEditResponse.WorkersBindingKindTailConsumer | SettingEditResponse.WorkersBindingKindTextBlob | SettingEditResponse.WorkersBindingKindVectorize | SettingEditResponse.WorkersBindingKindVersionMetadata @@ -572,23 +571,6 @@ export namespace SettingEditResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -843,7 +825,6 @@ export interface SettingGetResponse { | SettingGetResponse.WorkersBindingKindSecretText | SettingGetResponse.WorkersBindingKindSendEmail | SettingGetResponse.WorkersBindingKindService - | SettingGetResponse.WorkersBindingKindTailConsumer | SettingGetResponse.WorkersBindingKindTextBlob | SettingGetResponse.WorkersBindingKindVectorize | SettingGetResponse.WorkersBindingKindVersionMetadata @@ -1324,23 +1305,6 @@ export namespace SettingGetResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1608,7 +1572,6 @@ export namespace SettingEditParams { | Settings.WorkersBindingKindSecretText | Settings.WorkersBindingKindSendEmail | Settings.WorkersBindingKindService - | Settings.WorkersBindingKindTailConsumer | Settings.WorkersBindingKindTextBlob | Settings.WorkersBindingKindVectorize | Settings.WorkersBindingKindVersionMetadata @@ -2099,23 +2062,6 @@ export namespace SettingEditParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers/beta/workers/versions.ts b/src/resources/workers/beta/workers/versions.ts index 185cea7033..66bebbd506 100644 --- a/src/resources/workers/beta/workers/versions.ts +++ b/src/resources/workers/beta/workers/versions.ts @@ -176,7 +176,6 @@ export interface Version { | Version.WorkersBindingKindSecretText | Version.WorkersBindingKindSendEmail | Version.WorkersBindingKindService - | Version.WorkersBindingKindTailConsumer | Version.WorkersBindingKindTextBlob | Version.WorkersBindingKindVectorize | Version.WorkersBindingKindVersionMetadata @@ -734,23 +733,6 @@ export namespace Version { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1039,7 +1021,6 @@ export interface VersionCreateParams { | VersionCreateParams.WorkersBindingKindSecretText | VersionCreateParams.WorkersBindingKindSendEmail | VersionCreateParams.WorkersBindingKindService - | VersionCreateParams.WorkersBindingKindTailConsumer | VersionCreateParams.WorkersBindingKindTextBlob | VersionCreateParams.WorkersBindingKindVectorize | VersionCreateParams.WorkersBindingKindVersionMetadata @@ -1593,23 +1574,6 @@ export namespace VersionCreateParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers/scripts/script-and-version-settings.ts b/src/resources/workers/scripts/script-and-version-settings.ts index d6ef7552ca..54237b4091 100644 --- a/src/resources/workers/scripts/script-and-version-settings.ts +++ b/src/resources/workers/scripts/script-and-version-settings.ts @@ -87,7 +87,6 @@ export interface ScriptAndVersionSettingEditResponse { | ScriptAndVersionSettingEditResponse.WorkersBindingKindSecretText | ScriptAndVersionSettingEditResponse.WorkersBindingKindSendEmail | ScriptAndVersionSettingEditResponse.WorkersBindingKindService - | ScriptAndVersionSettingEditResponse.WorkersBindingKindTailConsumer | ScriptAndVersionSettingEditResponse.WorkersBindingKindTextBlob | ScriptAndVersionSettingEditResponse.WorkersBindingKindVectorize | ScriptAndVersionSettingEditResponse.WorkersBindingKindVersionMetadata @@ -568,23 +567,6 @@ export namespace ScriptAndVersionSettingEditResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -839,7 +821,6 @@ export interface ScriptAndVersionSettingGetResponse { | ScriptAndVersionSettingGetResponse.WorkersBindingKindSecretText | ScriptAndVersionSettingGetResponse.WorkersBindingKindSendEmail | ScriptAndVersionSettingGetResponse.WorkersBindingKindService - | ScriptAndVersionSettingGetResponse.WorkersBindingKindTailConsumer | ScriptAndVersionSettingGetResponse.WorkersBindingKindTextBlob | ScriptAndVersionSettingGetResponse.WorkersBindingKindVectorize | ScriptAndVersionSettingGetResponse.WorkersBindingKindVersionMetadata @@ -1320,23 +1301,6 @@ export namespace ScriptAndVersionSettingGetResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1604,7 +1568,6 @@ export namespace ScriptAndVersionSettingEditParams { | Settings.WorkersBindingKindSecretText | Settings.WorkersBindingKindSendEmail | Settings.WorkersBindingKindService - | Settings.WorkersBindingKindTailConsumer | Settings.WorkersBindingKindTextBlob | Settings.WorkersBindingKindVectorize | Settings.WorkersBindingKindVersionMetadata @@ -2095,23 +2058,6 @@ export namespace ScriptAndVersionSettingEditParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index 70546d5580..a52d8a4ad2 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -681,7 +681,6 @@ export namespace ScriptUpdateParams { | Metadata.WorkersBindingKindSecretText | Metadata.WorkersBindingKindSendEmail | Metadata.WorkersBindingKindService - | Metadata.WorkersBindingKindTailConsumer | Metadata.WorkersBindingKindTextBlob | Metadata.WorkersBindingKindVectorize | Metadata.WorkersBindingKindVersionMetadata @@ -1255,23 +1254,6 @@ export namespace ScriptUpdateParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers/scripts/versions.ts b/src/resources/workers/scripts/versions.ts index c9027b6f0c..67d82e7c99 100644 --- a/src/resources/workers/scripts/versions.ts +++ b/src/resources/workers/scripts/versions.ts @@ -134,7 +134,6 @@ export namespace VersionCreateResponse { | Resources.WorkersBindingKindSecretText | Resources.WorkersBindingKindSendEmail | Resources.WorkersBindingKindService - | Resources.WorkersBindingKindTailConsumer | Resources.WorkersBindingKindTextBlob | Resources.WorkersBindingKindVectorize | Resources.WorkersBindingKindVersionMetadata @@ -570,23 +569,6 @@ export namespace VersionCreateResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -870,7 +852,6 @@ export namespace VersionGetResponse { | Resources.WorkersBindingKindSecretText | Resources.WorkersBindingKindSendEmail | Resources.WorkersBindingKindService - | Resources.WorkersBindingKindTailConsumer | Resources.WorkersBindingKindTextBlob | Resources.WorkersBindingKindVectorize | Resources.WorkersBindingKindVersionMetadata @@ -1306,23 +1287,6 @@ export namespace VersionGetResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1598,7 +1562,6 @@ export namespace VersionCreateParams { | Metadata.WorkersBindingKindSecretText | Metadata.WorkersBindingKindSendEmail | Metadata.WorkersBindingKindService - | Metadata.WorkersBindingKindTailConsumer | Metadata.WorkersBindingKindTextBlob | Metadata.WorkersBindingKindVectorize | Metadata.WorkersBindingKindVersionMetadata @@ -2075,23 +2038,6 @@ export namespace VersionCreateParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. From 2f7ef73d1e668d62fcba27e5797ec8e7886261fe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 01:00:21 +0000 Subject: [PATCH 151/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4bf48ded87..e1fdfbcb68 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d5f53e5508d8f941df5f84e4b33254b7f8fef984207245ecb0f88c77b5d08de7.yml -openapi_spec_hash: 5bdb96ad1634898d364257edfb2062d2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0428132f234af88c2286f4359b0c36b1408dd21f75d94a309723e1fe0806d09c.yml +openapi_spec_hash: f78e137b26d6d7b67089616d1c979e18 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 85f2418b0587eada3e4b3fce9967df59552e7d63 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 05:03:43 +0000 Subject: [PATCH 152/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e1fdfbcb68..383265bf8c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0428132f234af88c2286f4359b0c36b1408dd21f75d94a309723e1fe0806d09c.yml -openapi_spec_hash: f78e137b26d6d7b67089616d1c979e18 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7708bb380c6ef0c2e41cb6f6e4511e611b192891b5e3d1fd4ea63abf7aba35b3.yml +openapi_spec_hash: 1daf5fab522f4f12764d87699dab6f6b config_hash: 0ce5789fc4b59ae352e68d00847570c2 From fa6ac8cc00b1584820cde85e2f23f740e4558459 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 06:56:49 +0000 Subject: [PATCH 153/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 383265bf8c..580e9e07ec 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7708bb380c6ef0c2e41cb6f6e4511e611b192891b5e3d1fd4ea63abf7aba35b3.yml -openapi_spec_hash: 1daf5fab522f4f12764d87699dab6f6b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5943533d36cbe3dad46044a119e49804350807e462b24c11eace1f600cd2c329.yml +openapi_spec_hash: 93a559258a944d0e4c2ddfb6b3644d7a config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 5c4ee8cd3214415838ff25bf94368e9fa3889153 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 08:15:29 +0000 Subject: [PATCH 154/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 580e9e07ec..383265bf8c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5943533d36cbe3dad46044a119e49804350807e462b24c11eace1f600cd2c329.yml -openapi_spec_hash: 93a559258a944d0e4c2ddfb6b3644d7a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7708bb380c6ef0c2e41cb6f6e4511e611b192891b5e3d1fd4ea63abf7aba35b3.yml +openapi_spec_hash: 1daf5fab522f4f12764d87699dab6f6b config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 993c0304ee8430dd63b02a7cb09f5563779180ab Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 09:57:50 +0000 Subject: [PATCH 155/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 383265bf8c..6d83379f58 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7708bb380c6ef0c2e41cb6f6e4511e611b192891b5e3d1fd4ea63abf7aba35b3.yml -openapi_spec_hash: 1daf5fab522f4f12764d87699dab6f6b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fff4c653ba0989c654a7fe10b0e419e7b6d05eb721187e21df87424ff8feba12.yml +openapi_spec_hash: c663b9085c57f203680b6f041324a7ab config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 68f7884dca7535dfbf03a39f3e76b18f783ef13e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 10:24:35 +0000 Subject: [PATCH 156/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6d83379f58..2a3f2f22b3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fff4c653ba0989c654a7fe10b0e419e7b6d05eb721187e21df87424ff8feba12.yml -openapi_spec_hash: c663b9085c57f203680b6f041324a7ab +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f1060172439fa3fd153714e86de288fd576b6d6295deaefa3f5c18df3f915d16.yml +openapi_spec_hash: 8e2ada5e7ff5e903c1ae9c34e5dcd77e config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 5d1b460d9b17c155a7ebad903c7d2966f4768b79 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 10:49:54 +0000 Subject: [PATCH 157/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2a3f2f22b3..67f3c6c71a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f1060172439fa3fd153714e86de288fd576b6d6295deaefa3f5c18df3f915d16.yml -openapi_spec_hash: 8e2ada5e7ff5e903c1ae9c34e5dcd77e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d4808a3132ffc6007146c5145a2c69fed3e1e415d7093a14109b1bc306d85e90.yml +openapi_spec_hash: f2932737d7f2b90fb6cd5249781426a7 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 25b38bd9825bf3963255181cd3598a189111933b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 10:58:02 +0000 Subject: [PATCH 158/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 67f3c6c71a..ff6bc86c73 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d4808a3132ffc6007146c5145a2c69fed3e1e415d7093a14109b1bc306d85e90.yml -openapi_spec_hash: f2932737d7f2b90fb6cd5249781426a7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f803c3cedfebad22e71b52e12fa48817e888c882b03a948ad580f320099e83a2.yml +openapi_spec_hash: c5573818881a1a41910bfe6503b4da56 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From f18fa3316cb90f2a66333745fbfb1f7376a36347 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 11:19:06 +0000 Subject: [PATCH 159/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ff6bc86c73..4be1d192eb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f803c3cedfebad22e71b52e12fa48817e888c882b03a948ad580f320099e83a2.yml -openapi_spec_hash: c5573818881a1a41910bfe6503b4da56 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8e89015457f7726d904739b4f28b4504003200f2600360d689b471c2f63d04e0.yml +openapi_spec_hash: 5318f582530e7a4f906ba1fb48362c5f config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 7169ce0b01ad01cdd60fdd1d2b9a085cf1ca3ca0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 11:20:38 +0000 Subject: [PATCH 160/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4be1d192eb..07182dd973 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8e89015457f7726d904739b4f28b4504003200f2600360d689b471c2f63d04e0.yml -openapi_spec_hash: 5318f582530e7a4f906ba1fb48362c5f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3b21cdf7e5d8d27b7498ecb70d687905a85d4b21c79353edc5a833419105d0c1.yml +openapi_spec_hash: 024ecb1d788f0933b30c34ec9766fd24 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 3284b7098f21f27f044393a416b23a9a628533a9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 11:32:03 +0000 Subject: [PATCH 161/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 07182dd973..aadac98844 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3b21cdf7e5d8d27b7498ecb70d687905a85d4b21c79353edc5a833419105d0c1.yml -openapi_spec_hash: 024ecb1d788f0933b30c34ec9766fd24 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6637633ff45c2e4445a39faf94b2773b15aee9c88f988607249ca8acd9ad7bbe.yml +openapi_spec_hash: 59998b3a1c34d80268ba0786f42cf51d config_hash: 0ce5789fc4b59ae352e68d00847570c2 From c8445e7b000fc40023e6271fb03684d3bf526b65 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 11:53:10 +0000 Subject: [PATCH 162/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index aadac98844..59a28f34af 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6637633ff45c2e4445a39faf94b2773b15aee9c88f988607249ca8acd9ad7bbe.yml -openapi_spec_hash: 59998b3a1c34d80268ba0786f42cf51d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-de5f50b0de7b8f6c8efbc93aeb1dd558979055fa38e0eec345ba7ccb613e3ef4.yml +openapi_spec_hash: 98d57cfd737ebcdc2f6a9aff8fa26f24 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 58fb96e9306a3a94218dd53dcc67ecc69411396b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 12:07:00 +0000 Subject: [PATCH 163/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 59a28f34af..cf6480625a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-de5f50b0de7b8f6c8efbc93aeb1dd558979055fa38e0eec345ba7ccb613e3ef4.yml -openapi_spec_hash: 98d57cfd737ebcdc2f6a9aff8fa26f24 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-741197275b0dc75ad5a30d3b7247c465c6a4eb186018a0bf9d2c8993e764fe87.yml +openapi_spec_hash: 2dc28a3cdda384bf82e16e55543c6c3e config_hash: 0ce5789fc4b59ae352e68d00847570c2 From aab7565c8594872668c6bbee0fd4e99c08646078 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 13:59:48 +0000 Subject: [PATCH 164/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index cf6480625a..6d83379f58 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-741197275b0dc75ad5a30d3b7247c465c6a4eb186018a0bf9d2c8993e764fe87.yml -openapi_spec_hash: 2dc28a3cdda384bf82e16e55543c6c3e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fff4c653ba0989c654a7fe10b0e419e7b6d05eb721187e21df87424ff8feba12.yml +openapi_spec_hash: c663b9085c57f203680b6f041324a7ab config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 70d707285238a999f0b3709d06ee8ad323bd850e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 14:18:57 +0000 Subject: [PATCH 165/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6d83379f58..59a28f34af 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fff4c653ba0989c654a7fe10b0e419e7b6d05eb721187e21df87424ff8feba12.yml -openapi_spec_hash: c663b9085c57f203680b6f041324a7ab +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-de5f50b0de7b8f6c8efbc93aeb1dd558979055fa38e0eec345ba7ccb613e3ef4.yml +openapi_spec_hash: 98d57cfd737ebcdc2f6a9aff8fa26f24 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From e697ac83d9e3888b3a84ac36458dad3b2cb71036 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 14:20:42 +0000 Subject: [PATCH 166/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 59a28f34af..9f810d7a42 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-de5f50b0de7b8f6c8efbc93aeb1dd558979055fa38e0eec345ba7ccb613e3ef4.yml -openapi_spec_hash: 98d57cfd737ebcdc2f6a9aff8fa26f24 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-283aab3c8d8f3133d5ee70d3f3391c5518b8dd0d9a93ef44f5ea796ce9069db4.yml +openapi_spec_hash: d44a34bb546d380add7527849580a867 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From d925a654899b6904b54643c578f0fa436cf0d6c1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 14:34:00 +0000 Subject: [PATCH 167/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9f810d7a42..aadac98844 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-283aab3c8d8f3133d5ee70d3f3391c5518b8dd0d9a93ef44f5ea796ce9069db4.yml -openapi_spec_hash: d44a34bb546d380add7527849580a867 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6637633ff45c2e4445a39faf94b2773b15aee9c88f988607249ca8acd9ad7bbe.yml +openapi_spec_hash: 59998b3a1c34d80268ba0786f42cf51d config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 41d42dc26052d782616ed61414becafe403f3aa3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 15:09:02 +0000 Subject: [PATCH 168/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index aadac98844..a2c42fb8ac 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6637633ff45c2e4445a39faf94b2773b15aee9c88f988607249ca8acd9ad7bbe.yml -openapi_spec_hash: 59998b3a1c34d80268ba0786f42cf51d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6aef14ba51ad625decf7a53006cb523ded57bc3a57242b248c8b41698e67f9b2.yml +openapi_spec_hash: b3038545ebdea3a2021b810b6eb7d0a4 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From ed34b7f906efb94a56ed6c673428e10a5d38e696 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 15:19:00 +0000 Subject: [PATCH 169/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a2c42fb8ac..7a681f55ff 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6aef14ba51ad625decf7a53006cb523ded57bc3a57242b248c8b41698e67f9b2.yml -openapi_spec_hash: b3038545ebdea3a2021b810b6eb7d0a4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ae028e955242a8a2a52c83c89e455c132ed0bd4a7e1f42d50827d6847d8399e2.yml +openapi_spec_hash: c7e1d87121efd8b50a44bb63b8f5a6e4 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 7e8c7599a8316efce8ed3bff773c810c3f4fe613 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 15:20:50 +0000 Subject: [PATCH 170/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7a681f55ff..968fdf1782 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ae028e955242a8a2a52c83c89e455c132ed0bd4a7e1f42d50827d6847d8399e2.yml -openapi_spec_hash: c7e1d87121efd8b50a44bb63b8f5a6e4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c79cbbe65b6f8877239fbe0f507fceb5979ed6bb24be9d3c107c8c24c8e020e6.yml +openapi_spec_hash: 3d6627524be80fc2e3628f1943837166 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 30444ea1de8faaebae1552994d19d91e9fe9a1b3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 15:33:20 +0000 Subject: [PATCH 171/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 968fdf1782..6fce02e141 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c79cbbe65b6f8877239fbe0f507fceb5979ed6bb24be9d3c107c8c24c8e020e6.yml -openapi_spec_hash: 3d6627524be80fc2e3628f1943837166 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-41daa2bdbe0aa7ee88b7e4d52f348e26091bf723dc75ff521df397103b1fdc3b.yml +openapi_spec_hash: f7142ed8820dd0ded7709a6242ee8eb8 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 85bb8bbd6a3589c6c61f8654d17583212da2cff7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 15:35:21 +0000 Subject: [PATCH 172/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6fce02e141..0325b5be92 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-41daa2bdbe0aa7ee88b7e4d52f348e26091bf723dc75ff521df397103b1fdc3b.yml -openapi_spec_hash: f7142ed8820dd0ded7709a6242ee8eb8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-93d845bb7e5deaa42a048153b1f8a71e420a993ec527353c7a501d2f20eb0b3e.yml +openapi_spec_hash: c1370a60c7ff071152254c8fc5060efc config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 06226715a206cf2919249c747722167fe5a9c435 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 15:52:29 +0000 Subject: [PATCH 173/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0325b5be92..765a2f0209 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-93d845bb7e5deaa42a048153b1f8a71e420a993ec527353c7a501d2f20eb0b3e.yml -openapi_spec_hash: c1370a60c7ff071152254c8fc5060efc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-554bc2f797f081af78d2027ad68f110fe3c52ec1d57f6ab6c550f9ef6ceb9e69.yml +openapi_spec_hash: bc9a8f32051a2a5646bd84bfb015adfc config_hash: 0ce5789fc4b59ae352e68d00847570c2 From f7d53fc508f944469944ab86d7084066808b7fa6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 15:54:29 +0000 Subject: [PATCH 174/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 765a2f0209..0146f28551 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-554bc2f797f081af78d2027ad68f110fe3c52ec1d57f6ab6c550f9ef6ceb9e69.yml -openapi_spec_hash: bc9a8f32051a2a5646bd84bfb015adfc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0f693b20035427d25362b94a85207c23dcc80a7c92ce665cf212e2994b8ab684.yml +openapi_spec_hash: 29be9b8ab99ae4ea27967252235ac574 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 1ff4d82b85a49f280d1ac325d332e3535a699ebc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 15:56:22 +0000 Subject: [PATCH 175/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0146f28551..2066eddc7f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0f693b20035427d25362b94a85207c23dcc80a7c92ce665cf212e2994b8ab684.yml -openapi_spec_hash: 29be9b8ab99ae4ea27967252235ac574 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4c953d01ba0d29acde0a9aad85619356c3b6287c8144c17929504f7125bda785.yml +openapi_spec_hash: fcd36105bdcfc881e47185b5ea04bd68 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 61ca22ac466f1a9c1bd35d85dfa9a17b4a5726c1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 16:14:16 +0000 Subject: [PATCH 176/451] chore(api): update composite API spec --- .stats.yml | 4 +- api.md | 3 +- src/resources/api-gateway/api-gateway.ts | 2 - src/resources/api-gateway/configurations.ts | 43 ++++++------------- src/resources/api-gateway/index.ts | 1 - .../api-gateway/configurations.test.ts | 1 - 6 files changed, 16 insertions(+), 38 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2066eddc7f..c03a31f9a2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4c953d01ba0d29acde0a9aad85619356c3b6287c8144c17929504f7125bda785.yml -openapi_spec_hash: fcd36105bdcfc881e47185b5ea04bd68 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-01cf0b8416cacc095e16fcc4f6924d525fbad59cb74cc073e9e04221310f2713.yml +openapi_spec_hash: a010543a98c2cb9cca203fe0c5c4ed13 config_hash: 0ce5789fc4b59ae352e68d00847570c2 diff --git a/api.md b/api.md index c160bbe534..910b8a47af 100644 --- a/api.md +++ b/api.md @@ -2436,11 +2436,10 @@ Methods: Types: - Configuration -- ConfigurationUpdateResponse Methods: -- client.apiGateway.configurations.update({ ...params }) -> ConfigurationUpdateResponse +- client.apiGateway.configurations.update({ ...params }) -> Configuration - client.apiGateway.configurations.get({ ...params }) -> Configuration ## Discovery diff --git a/src/resources/api-gateway/api-gateway.ts b/src/resources/api-gateway/api-gateway.ts index 1f9fb727e9..701ac67835 100644 --- a/src/resources/api-gateway/api-gateway.ts +++ b/src/resources/api-gateway/api-gateway.ts @@ -6,7 +6,6 @@ import { Configuration, ConfigurationGetParams, ConfigurationUpdateParams, - ConfigurationUpdateResponse, Configurations, } from './configurations'; import * as SchemasAPI from './schemas'; @@ -82,7 +81,6 @@ export declare namespace APIGateway { export { Configurations as Configurations, type Configuration as Configuration, - type ConfigurationUpdateResponse as ConfigurationUpdateResponse, type ConfigurationUpdateParams as ConfigurationUpdateParams, type ConfigurationGetParams as ConfigurationGetParams, }; diff --git a/src/resources/api-gateway/configurations.ts b/src/resources/api-gateway/configurations.ts index 5659e51452..5082ea818a 100644 --- a/src/resources/api-gateway/configurations.ts +++ b/src/resources/api-gateway/configurations.ts @@ -2,11 +2,10 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as UserSchemasAPI from './user-schemas/user-schemas'; export class Configurations extends APIResource { /** - * Set configuration properties + * Update configuration properties * * @example * ```ts @@ -19,12 +18,14 @@ export class Configurations extends APIResource { * }); * ``` */ - update( - params: ConfigurationUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + update(params: ConfigurationUpdateParams, options?: Core.RequestOptions): Core.APIPromise { const { zone_id, ...body } = params; - return this._client.put(`/zones/${zone_id}/api_gateway/configuration`, { body, ...options }); + return ( + this._client.put(`/zones/${zone_id}/api_gateway/configuration`, { + body, + ...options, + }) as Core.APIPromise<{ result: Configuration }> + )._thenUnwrap((obj) => obj.result); } /** @@ -39,12 +40,11 @@ export class Configurations extends APIResource { * ``` */ get(params: ConfigurationGetParams, options?: Core.RequestOptions): Core.APIPromise { - const { zone_id, ...query } = params; + const { zone_id } = params; return ( - this._client.get(`/zones/${zone_id}/api_gateway/configuration`, { - query, - ...options, - }) as Core.APIPromise<{ result: Configuration }> + this._client.get(`/zones/${zone_id}/api_gateway/configuration`, options) as Core.APIPromise<{ + result: Configuration; + }> )._thenUnwrap((obj) => obj.result); } } @@ -93,17 +93,6 @@ export namespace Configuration { } } -export interface ConfigurationUpdateResponse { - errors: UserSchemasAPI.Message; - - messages: UserSchemasAPI.Message; - - /** - * Whether the API call was successful. - */ - success: true; -} - export interface ConfigurationUpdateParams { /** * Path param: Identifier. @@ -159,20 +148,14 @@ export namespace ConfigurationUpdateParams { export interface ConfigurationGetParams { /** - * Path param: Identifier. + * Identifier. */ zone_id: string; - - /** - * Query param: Requests information about certain properties. - */ - properties?: Array<'auth_id_characteristics'>; } export declare namespace Configurations { export { type Configuration as Configuration, - type ConfigurationUpdateResponse as ConfigurationUpdateResponse, type ConfigurationUpdateParams as ConfigurationUpdateParams, type ConfigurationGetParams as ConfigurationGetParams, }; diff --git a/src/resources/api-gateway/index.ts b/src/resources/api-gateway/index.ts index 5941af87f3..485f8290f8 100644 --- a/src/resources/api-gateway/index.ts +++ b/src/resources/api-gateway/index.ts @@ -4,7 +4,6 @@ export { APIGateway } from './api-gateway'; export { Configurations, type Configuration, - type ConfigurationUpdateResponse, type ConfigurationUpdateParams, type ConfigurationGetParams, } from './configurations'; diff --git a/tests/api-resources/api-gateway/configurations.test.ts b/tests/api-resources/api-gateway/configurations.test.ts index 307fcd648e..40818b7ce6 100644 --- a/tests/api-resources/api-gateway/configurations.test.ts +++ b/tests/api-resources/api-gateway/configurations.test.ts @@ -47,7 +47,6 @@ describe('resource configurations', () => { test('get: required and optional params', async () => { const response = await client.apiGateway.configurations.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - properties: ['auth_id_characteristics'], }); }); }); From 4553f93996e18dcbcc9a5a0acd0082cd8fb3c2e8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 16:16:05 +0000 Subject: [PATCH 177/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index c03a31f9a2..d1850da203 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-01cf0b8416cacc095e16fcc4f6924d525fbad59cb74cc073e9e04221310f2713.yml -openapi_spec_hash: a010543a98c2cb9cca203fe0c5c4ed13 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f073365a229132701b0ddec546437ab3ccf9ae2118ecacc3fa3de12b3f4bd6f4.yml +openapi_spec_hash: 86399e7cc4d0c4184e1e11b7753ef827 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From ab7b003ce6071df2075c7a559a4e07d8247be2a3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 16:46:24 +0000 Subject: [PATCH 178/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d1850da203..763b1ce656 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f073365a229132701b0ddec546437ab3ccf9ae2118ecacc3fa3de12b3f4bd6f4.yml -openapi_spec_hash: 86399e7cc4d0c4184e1e11b7753ef827 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1a31de27e845b7df21b8faf753c994f0c54db53604ab2447647a62d01856d335.yml +openapi_spec_hash: a9c1d4dd271d9e65536873a2c7cfa4ab config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 06d83a8f6d4eaef2da60e737ec611eaea0947d79 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 17:32:20 +0000 Subject: [PATCH 179/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 763b1ce656..d9b6f263dc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1a31de27e845b7df21b8faf753c994f0c54db53604ab2447647a62d01856d335.yml -openapi_spec_hash: a9c1d4dd271d9e65536873a2c7cfa4ab +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b67033e133b08074e27ca3d1f69440312aaeb256e7b41e4b28cea2f8a6c4ea32.yml +openapi_spec_hash: e75d9046b0522bb8bfb5d3fb80bb2310 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From debccff0f34b4dfc2b97d965b891cb71b11277ff Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 17:34:42 +0000 Subject: [PATCH 180/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d9b6f263dc..26513d7dc5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b67033e133b08074e27ca3d1f69440312aaeb256e7b41e4b28cea2f8a6c4ea32.yml -openapi_spec_hash: e75d9046b0522bb8bfb5d3fb80bb2310 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-33f81ef43fdb3d7e64901932c0baea4b49e4637acdfbec2af1ba45b392002798.yml +openapi_spec_hash: 8b410ee9118ef2fc7031f5d994711cdf config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 68b099f4a641df6e88c92f63450f570a9057ccc7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 18:02:28 +0000 Subject: [PATCH 181/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 26513d7dc5..763b1ce656 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-33f81ef43fdb3d7e64901932c0baea4b49e4637acdfbec2af1ba45b392002798.yml -openapi_spec_hash: 8b410ee9118ef2fc7031f5d994711cdf +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1a31de27e845b7df21b8faf753c994f0c54db53604ab2447647a62d01856d335.yml +openapi_spec_hash: a9c1d4dd271d9e65536873a2c7cfa4ab config_hash: 0ce5789fc4b59ae352e68d00847570c2 From af5a36e2f730ca1b4ec7ed295950e1d31429b56c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 18:11:40 +0000 Subject: [PATCH 182/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 763b1ce656..b4f88c5b4a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1a31de27e845b7df21b8faf753c994f0c54db53604ab2447647a62d01856d335.yml -openapi_spec_hash: a9c1d4dd271d9e65536873a2c7cfa4ab +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-12d5b27907cf89dcf5d47d1ef67da67774db59e5517dbe33ea270fc42faecd8d.yml +openapi_spec_hash: 09179e719752ece44675618bb8a050ed config_hash: 0ce5789fc4b59ae352e68d00847570c2 From ea1af29863f0aee1990f5f62fbbe97dca5dbc67f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 19:20:31 +0000 Subject: [PATCH 183/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b4f88c5b4a..7b049c2350 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-12d5b27907cf89dcf5d47d1ef67da67774db59e5517dbe33ea270fc42faecd8d.yml -openapi_spec_hash: 09179e719752ece44675618bb8a050ed +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-af19d9eebc302fdfef7b64459eb82b44a2d2947d7a2600b5dd10ee3d0808252c.yml +openapi_spec_hash: 6eae3163844c4f3f68e19cf0124b40c8 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From ce741dda941fd7cb1ae3c86722e190ac9e6bcb4b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 19:23:08 +0000 Subject: [PATCH 184/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7b049c2350..efb1a9fb8c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-af19d9eebc302fdfef7b64459eb82b44a2d2947d7a2600b5dd10ee3d0808252c.yml -openapi_spec_hash: 6eae3163844c4f3f68e19cf0124b40c8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-acb3d67b46573670a196caaec7039dd205bb704506229d83aeaf062064421467.yml +openapi_spec_hash: 8861879e153914854d7394bac1676914 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 62309dc17928c8f0560f4bc1c7b6a80bfac2aec7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 21:06:27 +0000 Subject: [PATCH 185/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index efb1a9fb8c..86905c805e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-acb3d67b46573670a196caaec7039dd205bb704506229d83aeaf062064421467.yml -openapi_spec_hash: 8861879e153914854d7394bac1676914 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7965e785b92317898dbfcc444cc7540771b8d0b8973d7713eda1c6d999da8764.yml +openapi_spec_hash: cfd0298423c2d87137ad6aa6ceb19c60 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 956a33f91701697e4370085a0ab6e000dfdafb1b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 21:08:31 +0000 Subject: [PATCH 186/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 86905c805e..6f4e94a694 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7965e785b92317898dbfcc444cc7540771b8d0b8973d7713eda1c6d999da8764.yml -openapi_spec_hash: cfd0298423c2d87137ad6aa6ceb19c60 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d3e4f5f8128fe8db7e6387d0c5631ac6e927aa00bafc36169ae34540c77b82f6.yml +openapi_spec_hash: 710b77785492bc74aa19f42ba79a3ab4 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From a4e3d3770f26422cd2fdee4ae4168192448c4638 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 07:56:14 +0000 Subject: [PATCH 187/451] chore(api): update composite API spec --- .stats.yml | 4 +- scripts/utils/upload-artifact.sh | 6 +-- .../email-security/investigate/investigate.ts | 46 +++++++++++++++++++ 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6f4e94a694..04c51c786a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d3e4f5f8128fe8db7e6387d0c5631ac6e927aa00bafc36169ae34540c77b82f6.yml -openapi_spec_hash: 710b77785492bc74aa19f42ba79a3ab4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7abaaa5be1c8e1b64fc49fbbfa6309d42f0bdea4be7bba5cd06403a61c003a56.yml +openapi_spec_hash: 4b3c18f14a730d239d5779bffcc9fd4d config_hash: 0ce5789fc4b59ae352e68d00847570c2 diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index b228a8dec5..37da0aeda5 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -12,11 +12,9 @@ if [[ "$SIGNED_URL" == "null" ]]; then exit 1 fi -TARBALL=$(cd dist && npm pack --silent) - -UPLOAD_RESPONSE=$(curl -v -X PUT \ +UPLOAD_RESPONSE=$(tar "${BASE_PATH:+-C$BASE_PATH}" -cz "${ARTIFACT_PATH:-dist}" | curl -v -X PUT \ -H "Content-Type: application/gzip" \ - --data-binary "@dist/$TARBALL" "$SIGNED_URL" 2>&1) + --data-binary @- "$SIGNED_URL" 2>&1) if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then echo -e "\033[32mUploaded build to Stainless storage.\033[0m" diff --git a/src/resources/email-security/investigate/investigate.ts b/src/resources/email-security/investigate/investigate.ts index a15d9630ba..7093627a0f 100644 --- a/src/resources/email-security/investigate/investigate.ts +++ b/src/resources/email-security/investigate/investigate.ts @@ -199,10 +199,33 @@ export namespace InvestigateListResponse { } export interface Finding { + attachment?: string | null; + detail?: string | null; + detection?: + | 'MALICIOUS' + | 'MALICIOUS-BEC' + | 'SUSPICIOUS' + | 'SPOOF' + | 'SPAM' + | 'BULK' + | 'ENCRYPTED' + | 'EXTERNAL' + | 'UNKNOWN' + | 'NONE' + | null; + + field?: string | null; + name?: string | null; + portion?: string | null; + + reason?: string | null; + + score?: number | null; + value?: string | null; } @@ -321,10 +344,33 @@ export namespace InvestigateGetResponse { } export interface Finding { + attachment?: string | null; + detail?: string | null; + detection?: + | 'MALICIOUS' + | 'MALICIOUS-BEC' + | 'SUSPICIOUS' + | 'SPOOF' + | 'SPAM' + | 'BULK' + | 'ENCRYPTED' + | 'EXTERNAL' + | 'UNKNOWN' + | 'NONE' + | null; + + field?: string | null; + name?: string | null; + portion?: string | null; + + reason?: string | null; + + score?: number | null; + value?: string | null; } From fa3426b93a45ac1e43bbfcc7f6bc0636a7747623 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 09:07:44 +0000 Subject: [PATCH 188/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 04c51c786a..524bdec50a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7abaaa5be1c8e1b64fc49fbbfa6309d42f0bdea4be7bba5cd06403a61c003a56.yml -openapi_spec_hash: 4b3c18f14a730d239d5779bffcc9fd4d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee7f1ac444b8ae200a8d8818f18bd733481bdd74b82f1dfae96ab2fe650e0c7e.yml +openapi_spec_hash: ac432f74819cb8b97c5f7355427ae311 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 9cc98aa4840c8956851bc84257e21f2951c8555a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 09:14:05 +0000 Subject: [PATCH 189/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 524bdec50a..3db8f1b6dd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee7f1ac444b8ae200a8d8818f18bd733481bdd74b82f1dfae96ab2fe650e0c7e.yml -openapi_spec_hash: ac432f74819cb8b97c5f7355427ae311 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2db143a0268ce7ff2ad1ffb7edb0425652ef9e5585784b2edae50a4d387544bc.yml +openapi_spec_hash: 8d3b189f5e82b96fa926ba0def824009 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 8170fd46c8475b55f5fae38c727f096778abc1f1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 09:15:48 +0000 Subject: [PATCH 190/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3db8f1b6dd..6120381ece 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2db143a0268ce7ff2ad1ffb7edb0425652ef9e5585784b2edae50a4d387544bc.yml -openapi_spec_hash: 8d3b189f5e82b96fa926ba0def824009 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aebc7cfd0086d380e0399d34324e21db41221b36755fb69084d2961834e2c0a3.yml +openapi_spec_hash: 2ff18ed9346c2964f28c63055b8b464a config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 1579debd49f9334039ada58c6dad55f161076330 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 13:24:46 +0000 Subject: [PATCH 191/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6120381ece..102748b94f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aebc7cfd0086d380e0399d34324e21db41221b36755fb69084d2961834e2c0a3.yml -openapi_spec_hash: 2ff18ed9346c2964f28c63055b8b464a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ff080b6f70fc6f7bbd4fa0d76cdd19dea47e161ded411898bbcc27f854c813af.yml +openapi_spec_hash: b12d7400284ebc54c6603be99a381a54 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From c56024aa1c72500f27e7fde0a8f4f309314bee2b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 14:12:43 +0000 Subject: [PATCH 192/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 102748b94f..b3ce287ba5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ff080b6f70fc6f7bbd4fa0d76cdd19dea47e161ded411898bbcc27f854c813af.yml -openapi_spec_hash: b12d7400284ebc54c6603be99a381a54 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-45c44d22e935164476c0cd5dab642bb2f9a23741769452b4e6ec204d2c802be3.yml +openapi_spec_hash: 68c73a30b04c597c4b73aa22d2675c05 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From fc14c308225a50441568932167327d58fb511d7b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 14:14:39 +0000 Subject: [PATCH 193/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b3ce287ba5..71ced21919 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-45c44d22e935164476c0cd5dab642bb2f9a23741769452b4e6ec204d2c802be3.yml -openapi_spec_hash: 68c73a30b04c597c4b73aa22d2675c05 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2d761c3f752d42cfa9b01b92c613fae34353c8e1a22e711aab421ff1d789badd.yml +openapi_spec_hash: bc5a9b4c84ad28126a89f1953c862911 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 5a4917cccc36095ad9407f8902421833b9772e98 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 14:16:54 +0000 Subject: [PATCH 194/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 71ced21919..d4cdbb35a1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2d761c3f752d42cfa9b01b92c613fae34353c8e1a22e711aab421ff1d789badd.yml -openapi_spec_hash: bc5a9b4c84ad28126a89f1953c862911 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2f605371629eeacd8c8a1061a303bc50daf0ff070f738584492dbda23cc51659.yml +openapi_spec_hash: 1abd644670feb5070eef7ac03bb170bb config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 4ec26a542cf60fa9f3f0c4dec9dd1a91c26c2ddb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 15:01:07 +0000 Subject: [PATCH 195/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d4cdbb35a1..100ea32f02 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2f605371629eeacd8c8a1061a303bc50daf0ff070f738584492dbda23cc51659.yml -openapi_spec_hash: 1abd644670feb5070eef7ac03bb170bb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9e3eb111f69a31d4a5d07d4561922cdf457063a1c21eef33692eeb671c9d3f8a.yml +openapi_spec_hash: 29d91b0215c11215270ba438ab7f2eb0 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 624648b2293f6e608f1afa2f322290ed2337dc7d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 15:05:55 +0000 Subject: [PATCH 196/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 100ea32f02..b3ce287ba5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9e3eb111f69a31d4a5d07d4561922cdf457063a1c21eef33692eeb671c9d3f8a.yml -openapi_spec_hash: 29d91b0215c11215270ba438ab7f2eb0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-45c44d22e935164476c0cd5dab642bb2f9a23741769452b4e6ec204d2c802be3.yml +openapi_spec_hash: 68c73a30b04c597c4b73aa22d2675c05 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 871fe3412284fe4451245ca77de1d5b60d47afb1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 15:08:15 +0000 Subject: [PATCH 197/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b3ce287ba5..0cc13059b6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-45c44d22e935164476c0cd5dab642bb2f9a23741769452b4e6ec204d2c802be3.yml -openapi_spec_hash: 68c73a30b04c597c4b73aa22d2675c05 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-940090100489a312cc85477a17489154cd1d5ed41705b0064d9201e415f5eed3.yml +openapi_spec_hash: eeea31b0f77b4fa0baafe391a8d78069 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From af056114b67bd1879f2a03500f3114a2d91f6427 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 15:10:48 +0000 Subject: [PATCH 198/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0cc13059b6..102748b94f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-940090100489a312cc85477a17489154cd1d5ed41705b0064d9201e415f5eed3.yml -openapi_spec_hash: eeea31b0f77b4fa0baafe391a8d78069 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ff080b6f70fc6f7bbd4fa0d76cdd19dea47e161ded411898bbcc27f854c813af.yml +openapi_spec_hash: b12d7400284ebc54c6603be99a381a54 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 599d75f03a3da06005d6d4d13dcdf03e88664b53 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 15:45:22 +0000 Subject: [PATCH 199/451] chore(api): update composite API spec --- .stats.yml | 4 +- .../access/applications/applications.ts | 632 ++++++++++++++---- .../zero-trust/access/logs/access-requests.ts | 19 + .../access/applications/applications.test.ts | 2 + .../access/logs/access-requests.test.ts | 3 + 5 files changed, 518 insertions(+), 142 deletions(-) diff --git a/.stats.yml b/.stats.yml index 102748b94f..7f312d6bda 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ff080b6f70fc6f7bbd4fa0d76cdd19dea47e161ded411898bbcc27f854c813af.yml -openapi_spec_hash: b12d7400284ebc54c6603be99a381a54 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d72a19155f2c1f294f22151b0f7a2ee70eb1ec5fb321713a9652119aa8b07950.yml +openapi_spec_hash: 78d273bf0b459cddeb8fceef3cfdde66 config_hash: 0ce5789fc4b59ae352e68d00847570c2 diff --git a/src/resources/zero-trust/access/applications/applications.ts b/src/resources/zero-trust/access/applications/applications.ts index 1c6afd035f..00a1c63b2a 100644 --- a/src/resources/zero-trust/access/applications/applications.ts +++ b/src/resources/zero-trust/access/applications/applications.ts @@ -1667,7 +1667,9 @@ export type ApplicationType = | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * The application type. @@ -1683,7 +1685,9 @@ export type ApplicationTypeParam = | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; export interface CORSHeaders { /** @@ -2670,7 +2674,11 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | SelfHostedApplication.PublicDestination + | SelfHostedApplication.PrivateDestination + | SelfHostedApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -2779,10 +2787,6 @@ export namespace ApplicationCreateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -2814,6 +2818,19 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -3263,7 +3280,9 @@ export namespace ApplicationCreateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -3335,7 +3354,11 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserSSHApplication.PublicDestination + | BrowserSSHApplication.PrivateDestination + | BrowserSSHApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -3444,10 +3467,6 @@ export namespace ApplicationCreateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -3479,6 +3498,19 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -3681,7 +3713,9 @@ export namespace ApplicationCreateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -3753,7 +3787,11 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserVNCApplication.PublicDestination + | BrowserVNCApplication.PrivateDestination + | BrowserVNCApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -3862,10 +3900,6 @@ export namespace ApplicationCreateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -3897,6 +3931,19 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -4093,7 +4140,9 @@ export namespace ApplicationCreateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -4859,7 +4908,11 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserRdpApplication.PublicDestination + | BrowserRdpApplication.PrivateDestination + | BrowserRdpApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -4986,10 +5039,6 @@ export namespace ApplicationCreateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -5021,6 +5070,19 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -5298,7 +5360,11 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | SelfHostedApplication.PublicDestination + | SelfHostedApplication.PrivateDestination + | SelfHostedApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -5407,10 +5473,6 @@ export namespace ApplicationUpdateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -5442,6 +5504,19 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -5891,7 +5966,9 @@ export namespace ApplicationUpdateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -5963,7 +6040,11 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserSSHApplication.PublicDestination + | BrowserSSHApplication.PrivateDestination + | BrowserSSHApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -6072,10 +6153,6 @@ export namespace ApplicationUpdateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -6107,6 +6184,19 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -6309,7 +6399,9 @@ export namespace ApplicationUpdateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -6381,7 +6473,11 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserVNCApplication.PublicDestination + | BrowserVNCApplication.PrivateDestination + | BrowserVNCApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -6490,10 +6586,6 @@ export namespace ApplicationUpdateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -6525,6 +6617,19 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -6721,7 +6826,9 @@ export namespace ApplicationUpdateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -7487,7 +7594,11 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserRdpApplication.PublicDestination + | BrowserRdpApplication.PrivateDestination + | BrowserRdpApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -7614,10 +7725,6 @@ export namespace ApplicationUpdateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -7649,6 +7756,19 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -7926,7 +8046,11 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | SelfHostedApplication.PublicDestination + | SelfHostedApplication.PrivateDestination + | SelfHostedApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -8035,10 +8159,6 @@ export namespace ApplicationListResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -8070,6 +8190,19 @@ export namespace ApplicationListResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -8519,7 +8652,9 @@ export namespace ApplicationListResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -8591,7 +8726,11 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserSSHApplication.PublicDestination + | BrowserSSHApplication.PrivateDestination + | BrowserSSHApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -8700,10 +8839,6 @@ export namespace ApplicationListResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -8735,6 +8870,19 @@ export namespace ApplicationListResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -8937,7 +9085,9 @@ export namespace ApplicationListResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -9009,7 +9159,11 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserVNCApplication.PublicDestination + | BrowserVNCApplication.PrivateDestination + | BrowserVNCApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -9118,10 +9272,6 @@ export namespace ApplicationListResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -9153,6 +9303,19 @@ export namespace ApplicationListResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -9349,7 +9512,9 @@ export namespace ApplicationListResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -10115,7 +10280,11 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserRdpApplication.PublicDestination + | BrowserRdpApplication.PrivateDestination + | BrowserRdpApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -10242,10 +10411,6 @@ export namespace ApplicationListResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -10277,6 +10442,19 @@ export namespace ApplicationListResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -10561,7 +10739,11 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | SelfHostedApplication.PublicDestination + | SelfHostedApplication.PrivateDestination + | SelfHostedApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -10670,10 +10852,6 @@ export namespace ApplicationGetResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -10705,6 +10883,19 @@ export namespace ApplicationGetResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -11154,7 +11345,9 @@ export namespace ApplicationGetResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -11226,7 +11419,11 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserSSHApplication.PublicDestination + | BrowserSSHApplication.PrivateDestination + | BrowserSSHApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -11335,10 +11532,6 @@ export namespace ApplicationGetResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -11370,6 +11563,19 @@ export namespace ApplicationGetResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -11572,7 +11778,9 @@ export namespace ApplicationGetResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -11644,7 +11852,11 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserVNCApplication.PublicDestination + | BrowserVNCApplication.PrivateDestination + | BrowserVNCApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -11753,10 +11965,6 @@ export namespace ApplicationGetResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -11788,6 +11996,19 @@ export namespace ApplicationGetResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -11984,7 +12205,9 @@ export namespace ApplicationGetResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -12750,7 +12973,11 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserRdpApplication.PublicDestination + | BrowserRdpApplication.PrivateDestination + | BrowserRdpApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -12877,10 +13104,6 @@ export namespace ApplicationGetResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -12912,6 +13135,19 @@ export namespace ApplicationGetResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -13198,7 +13434,11 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | SelfHostedApplication.PublicDestination + | SelfHostedApplication.PrivateDestination + | SelfHostedApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -13313,10 +13553,6 @@ export declare namespace ApplicationCreateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -13348,6 +13584,19 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -13774,7 +14023,9 @@ export declare namespace ApplicationCreateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -13853,7 +14104,11 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserSSHApplication.PublicDestination + | BrowserSSHApplication.PrivateDestination + | BrowserSSHApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -13968,10 +14223,6 @@ export declare namespace ApplicationCreateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -14003,6 +14254,19 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -14188,7 +14452,9 @@ export declare namespace ApplicationCreateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -14267,7 +14533,11 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserVNCApplication.PublicDestination + | BrowserVNCApplication.PrivateDestination + | BrowserVNCApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -14382,10 +14652,6 @@ export declare namespace ApplicationCreateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -14417,6 +14683,19 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -14596,7 +14875,9 @@ export declare namespace ApplicationCreateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -15324,7 +15605,11 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserRdpApplication.PublicDestination + | BrowserRdpApplication.PrivateDestination + | BrowserRdpApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -15457,10 +15742,6 @@ export declare namespace ApplicationCreateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -15492,6 +15773,19 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -15759,7 +16053,11 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | SelfHostedApplication.PublicDestination + | SelfHostedApplication.PrivateDestination + | SelfHostedApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -15874,10 +16172,6 @@ export declare namespace ApplicationUpdateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -15909,6 +16203,19 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -16335,7 +16642,9 @@ export declare namespace ApplicationUpdateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -16414,7 +16723,11 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserSSHApplication.PublicDestination + | BrowserSSHApplication.PrivateDestination + | BrowserSSHApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -16529,10 +16842,6 @@ export declare namespace ApplicationUpdateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -16564,6 +16873,19 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -16749,7 +17071,9 @@ export declare namespace ApplicationUpdateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -16828,7 +17152,11 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserVNCApplication.PublicDestination + | BrowserVNCApplication.PrivateDestination + | BrowserVNCApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -16943,10 +17271,6 @@ export declare namespace ApplicationUpdateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -16978,6 +17302,19 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -17157,7 +17494,9 @@ export declare namespace ApplicationUpdateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -17885,7 +18224,11 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserRdpApplication.PublicDestination + | BrowserRdpApplication.PrivateDestination + | BrowserRdpApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -18018,10 +18361,6 @@ export declare namespace ApplicationUpdateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -18053,6 +18392,19 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ diff --git a/src/resources/zero-trust/access/logs/access-requests.ts b/src/resources/zero-trust/access/logs/access-requests.ts index eb75000b09..4905779655 100644 --- a/src/resources/zero-trust/access/logs/access-requests.ts +++ b/src/resources/zero-trust/access/logs/access-requests.ts @@ -43,6 +43,20 @@ export interface AccessRequestListParams { */ direction?: 'desc' | 'asc'; + /** + * Query param: Filter by user email. Defaults to substring matching. To force + * exact matching, set `email_exact=true`. Example (default): `email=@example.com` + * returns all events with that domain. Example (exact): + * `email=user@example.com&email_exact=true` returns only that user. + */ + email?: string; + + /** + * Query param: When true, `email` is matched exactly instead of substring + * matching. + */ + email_exact?: boolean; + /** * Query param: The maximum number of log entries to retrieve. */ @@ -67,6 +81,11 @@ export interface AccessRequestListParams { * Query param: The latest event timestamp to query. */ until?: string; + + /** + * Query param: Filter by user UUID. + */ + user_id?: string; } export declare namespace AccessRequests { diff --git a/tests/api-resources/zero-trust/access/applications/applications.test.ts b/tests/api-resources/zero-trust/access/applications/applications.test.ts index 225d81744d..e4607eeda4 100644 --- a/tests/api-resources/zero-trust/access/applications/applications.test.ts +++ b/tests/api-resources/zero-trust/access/applications/applications.test.ts @@ -78,6 +78,7 @@ describe('resource applications', () => { type: 'private', vnet_id: 'vnet_id', }, + { mcp_server_id: 'mcp-server-1', type: 'via_mcp_server_portal' }, ], enable_binding_cookie: true, http_only_cookie_attribute: true, @@ -182,6 +183,7 @@ describe('resource applications', () => { type: 'private', vnet_id: 'vnet_id', }, + { mcp_server_id: 'mcp-server-1', type: 'via_mcp_server_portal' }, ], enable_binding_cookie: true, http_only_cookie_attribute: true, 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 e939ee60e6..50ec6a1d24 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 @@ -27,11 +27,14 @@ describe('resource accessRequests', () => { const response = await client.zeroTrust.access.logs.accessRequests.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', direction: 'desc', + email: 'user@example.com', + email_exact: true, limit: 0, page: 0, per_page: 0, since: '2020-07-01T05:20:00Z', until: '2020-10-01T05:20:00Z', + user_id: 'f757c5c3-c1b2-50f7-9126-150a099b6f7e', }); }); }); From 20039c7a4103a32e44b771390875f68e4cbf3bb9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 15:50:48 +0000 Subject: [PATCH 200/451] chore(api): update composite API spec --- .stats.yml | 4 +- .../pages/projects/deployments/deployments.ts | 66 +++ src/resources/pages/projects/projects.ts | 547 ++++++++++++++++-- .../projects/deployments/deployments.test.ts | 14 +- .../pages/projects/projects.test.ts | 64 +- 5 files changed, 623 insertions(+), 72 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7f312d6bda..db0af31ab3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d72a19155f2c1f294f22151b0f7a2ee70eb1ec5fb321713a9652119aa8b07950.yml -openapi_spec_hash: 78d273bf0b459cddeb8fceef3cfdde66 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c4fc50564f8bab541dbfcd11d4e44ee2da8b356b4b213042d40bb1ed24d5b3e6.yml +openapi_spec_hash: 41fb0c2df7aefe9dd5365b4ad820072c config_hash: 0ce5789fc4b59ae352e68d00847570c2 diff --git a/src/resources/pages/projects/deployments/deployments.ts b/src/resources/pages/projects/deployments/deployments.ts index 97b2b41db9..e1a307e7bf 100644 --- a/src/resources/pages/projects/deployments/deployments.ts +++ b/src/resources/pages/projects/deployments/deployments.ts @@ -192,11 +192,77 @@ export interface DeploymentCreateParams { */ account_id: string; + /** + * Body param: Headers configuration file for the deployment. + */ + _headers?: Core.Uploadable; + + /** + * Body param: Redirects configuration file for the deployment. + */ + _redirects?: Core.Uploadable; + + /** + * Body param: Routes configuration file defining routing rules. + */ + '_routes.json'?: Core.Uploadable; + + /** + * Body param: Worker bundle file in multipart/form-data format. Mutually exclusive + * with `_worker.js`. Cannot specify both `_worker.js` and `_worker.bundle` in the + * same request. Maximum size: 25 MiB. + */ + '_worker.bundle'?: Core.Uploadable; + + /** + * Body param: Worker JavaScript file. Mutually exclusive with `_worker.bundle`. + * Cannot specify both `_worker.js` and `_worker.bundle` in the same request. + */ + '_worker.js'?: Core.Uploadable; + /** * Body param: The branch to build the new deployment from. The `HEAD` of the * branch will be used. If omitted, the production branch will be used by default. */ branch?: string; + + /** + * Body param: Boolean string indicating if the working directory has uncommitted + * changes. + */ + commit_dirty?: 'true' | 'false'; + + /** + * Body param: Git commit SHA associated with this deployment. + */ + commit_hash?: string; + + /** + * Body param: Git commit message associated with this deployment. + */ + commit_message?: string; + + /** + * Body param: Functions routing configuration file. + */ + 'functions-filepath-routing-config.json'?: Core.Uploadable; + + /** + * Body param: JSON string containing a manifest of files to deploy. Maps file + * paths to their content hashes. Required for direct upload deployments. Maximum + * 20,000 entries. + */ + manifest?: string; + + /** + * Body param: The build output directory path. + */ + pages_build_output_dir?: string; + + /** + * Body param: Hash of the Wrangler configuration file used for this deployment. + */ + wrangler_config_hash?: string; } export interface DeploymentListParams { diff --git a/src/resources/pages/projects/projects.ts b/src/resources/pages/projects/projects.ts index efac2c7d22..f14c2e99bf 100644 --- a/src/resources/pages/projects/projects.ts +++ b/src/resources/pages/projects/projects.ts @@ -41,6 +41,8 @@ export class Projects extends APIResource { * ```ts * const project = await client.pages.projects.create({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * name: 'my-pages-app', + * production_branch: 'main', * }); * ``` */ @@ -111,7 +113,11 @@ export class Projects extends APIResource { * ```ts * const project = await client.pages.projects.edit( * 'this-is-my-project-01', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * name: 'my-pages-app', + * production_branch: 'main', + * }, * ); * ``` */ @@ -215,7 +221,7 @@ export interface Deployment { */ env_vars?: { [key: string]: Deployment.PagesPlainTextEnvVar | null | Deployment.PagesSecretTextEnvVar | null; - }; + } | null; /** * Type of deploy. @@ -365,31 +371,74 @@ export namespace Deployment { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } @@ -397,17 +446,27 @@ export namespace Deployment { export interface Project { /** - * Id of the project. + * ID of the project. */ - id?: string; + id: string; + + /** + * Name of the project. + */ + name: string; + + /** + * Production branch of the project. Used to identify production deployments. + */ + production_branch: string; /** * Configs for the project build process. */ - build_config?: Project.BuildConfig; + build_config?: Project.BuildConfig | null; /** - * Most recent deployment to the repo. + * Most recent production deployment of the project. */ canonical_deployment?: Deployment | null; @@ -419,7 +478,7 @@ export interface Project { /** * Configs for deployments in a project. */ - deployment_configs?: Project.DeploymentConfigs; + deployment_configs?: Project.DeploymentConfigs | null; /** * A list of associated custom domains for the project. @@ -427,19 +486,29 @@ export interface Project { domains?: Array; /** - * Most recent deployment to the repo. + * Framework the project is using. + */ + framework?: string; + + /** + * Version of the framework the project is using. + */ + framework_version?: string; + + /** + * Most recent deployment of the project. */ latest_deployment?: Deployment | null; /** - * Name of the project. + * Name of the preview script. */ - name?: string; + preview_script_name?: string; /** - * Production branch of the project. Used to identify production deployments. + * Name of the production script. */ - production_branch?: string; + production_script_name?: string; source?: Project.Source; @@ -447,6 +516,11 @@ export interface Project { * The Cloudflare subdomain associated with the project. */ subdomain?: string; + + /** + * Whether the project uses functions. + */ + uses_functions?: boolean; } export namespace Project { @@ -492,12 +566,12 @@ export namespace Project { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview; + preview?: DeploymentConfigs.Preview | null; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production; + production?: DeploymentConfigs.Production | null; } export namespace DeploymentConfigs { @@ -510,6 +584,11 @@ export namespace Project { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -520,6 +599,11 @@ export namespace Project { */ browsers?: { [key: string]: Preview.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -528,7 +612,7 @@ export namespace Project { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -545,7 +629,12 @@ export namespace Project { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -557,6 +646,11 @@ export namespace Project { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Preview.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -582,10 +676,20 @@ export namespace Project { */ services?: { [key: string]: Preview.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Preview { @@ -672,6 +776,16 @@ export namespace Project { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -751,6 +865,11 @@ export namespace Project { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -761,6 +880,11 @@ export namespace Project { */ browsers?: { [key: string]: Production.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -769,7 +893,7 @@ export namespace Project { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -786,7 +910,12 @@ export namespace Project { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -798,6 +927,11 @@ export namespace Project { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Production.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -823,10 +957,20 @@ export namespace Project { */ services?: { [key: string]: Production.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Production { @@ -913,6 +1057,16 @@ export namespace Project { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -987,31 +1141,74 @@ export namespace Project { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } @@ -1053,25 +1250,25 @@ export interface ProjectCreateParams { account_id: string; /** - * Body param: Configs for the project build process. + * Body param: Name of the project. */ - build_config?: ProjectCreateParams.BuildConfig; + name: string; /** - * Body param: Configs for deployments in a project. + * Body param: Production branch of the project. Used to identify production + * deployments. */ - deployment_configs?: ProjectCreateParams.DeploymentConfigs; + production_branch: string; /** - * Body param: Name of the project. + * Body param: Configs for the project build process. */ - name?: string; + build_config?: ProjectCreateParams.BuildConfig | null; /** - * Body param: Production branch of the project. Used to identify production - * deployments. + * Body param: Configs for deployments in a project. */ - production_branch?: string; + deployment_configs?: ProjectCreateParams.DeploymentConfigs | null; /** * Body param: @@ -1122,12 +1319,12 @@ export namespace ProjectCreateParams { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview; + preview?: DeploymentConfigs.Preview | null; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production; + production?: DeploymentConfigs.Production | null; } export namespace DeploymentConfigs { @@ -1140,6 +1337,11 @@ export namespace ProjectCreateParams { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -1150,6 +1352,11 @@ export namespace ProjectCreateParams { */ browsers?: { [key: string]: Preview.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -1158,7 +1365,7 @@ export namespace ProjectCreateParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -1175,7 +1382,12 @@ export namespace ProjectCreateParams { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -1187,6 +1399,11 @@ export namespace ProjectCreateParams { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Preview.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -1212,10 +1429,20 @@ export namespace ProjectCreateParams { */ services?: { [key: string]: Preview.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Preview { @@ -1302,6 +1529,16 @@ export namespace ProjectCreateParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -1381,6 +1618,11 @@ export namespace ProjectCreateParams { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -1391,6 +1633,11 @@ export namespace ProjectCreateParams { */ browsers?: { [key: string]: Production.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -1399,7 +1646,7 @@ export namespace ProjectCreateParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -1416,7 +1663,12 @@ export namespace ProjectCreateParams { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -1428,6 +1680,11 @@ export namespace ProjectCreateParams { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Production.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -1453,10 +1710,20 @@ export namespace ProjectCreateParams { */ services?: { [key: string]: Production.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Production { @@ -1543,6 +1810,16 @@ export namespace ProjectCreateParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -1617,31 +1894,74 @@ export namespace ProjectCreateParams { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } @@ -1668,25 +1988,25 @@ export interface ProjectEditParams { account_id: string; /** - * Body param: Configs for the project build process. + * Body param: Name of the project. */ - build_config?: ProjectEditParams.BuildConfig; + name: string; /** - * Body param: Configs for deployments in a project. + * Body param: Production branch of the project. Used to identify production + * deployments. */ - deployment_configs?: ProjectEditParams.DeploymentConfigs; + production_branch: string; /** - * Body param: Name of the project. + * Body param: Configs for the project build process. */ - name?: string; + build_config?: ProjectEditParams.BuildConfig | null; /** - * Body param: Production branch of the project. Used to identify production - * deployments. + * Body param: Configs for deployments in a project. */ - production_branch?: string; + deployment_configs?: ProjectEditParams.DeploymentConfigs | null; /** * Body param: @@ -1737,12 +2057,12 @@ export namespace ProjectEditParams { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview; + preview?: DeploymentConfigs.Preview | null; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production; + production?: DeploymentConfigs.Production | null; } export namespace DeploymentConfigs { @@ -1755,6 +2075,11 @@ export namespace ProjectEditParams { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -1765,6 +2090,11 @@ export namespace ProjectEditParams { */ browsers?: { [key: string]: Preview.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -1773,7 +2103,7 @@ export namespace ProjectEditParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -1790,7 +2120,12 @@ export namespace ProjectEditParams { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -1802,6 +2137,11 @@ export namespace ProjectEditParams { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Preview.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -1827,10 +2167,20 @@ export namespace ProjectEditParams { */ services?: { [key: string]: Preview.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Preview { @@ -1917,6 +2267,16 @@ export namespace ProjectEditParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -1996,6 +2356,11 @@ export namespace ProjectEditParams { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -2006,6 +2371,11 @@ export namespace ProjectEditParams { */ browsers?: { [key: string]: Production.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -2014,7 +2384,7 @@ export namespace ProjectEditParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -2031,7 +2401,12 @@ export namespace ProjectEditParams { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -2043,6 +2418,11 @@ export namespace ProjectEditParams { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Production.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -2068,10 +2448,20 @@ export namespace ProjectEditParams { */ services?: { [key: string]: Production.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Production { @@ -2158,6 +2548,16 @@ export namespace ProjectEditParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -2232,31 +2632,74 @@ export namespace ProjectEditParams { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } diff --git a/tests/api-resources/pages/projects/deployments/deployments.test.ts b/tests/api-resources/pages/projects/deployments/deployments.test.ts index 41d5114e2a..67899467e8 100644 --- a/tests/api-resources/pages/projects/deployments/deployments.test.ts +++ b/tests/api-resources/pages/projects/deployments/deployments.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({ @@ -28,7 +28,19 @@ describe('resource deployments', () => { test.skip('create: required and optional params', async () => { const response = await client.pages.projects.deployments.create('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + _headers: await toFile(Buffer.from('# my file contents'), 'README.md'), + _redirects: await toFile(Buffer.from('# my file contents'), 'README.md'), + '_routes.json': await toFile(Buffer.from('# my file contents'), 'README.md'), + '_worker.bundle': await toFile(Buffer.from('# my file contents'), 'README.md'), + '_worker.js': await toFile(Buffer.from('# my file contents'), 'README.md'), branch: 'staging', + commit_dirty: 'false', + commit_hash: 'a1b2c3d4e5f6', + commit_message: 'Update homepage', + 'functions-filepath-routing-config.json': await toFile(Buffer.from('# my file contents'), 'README.md'), + manifest: '{"index.html": "abc123", "style.css": "def456"}', + pages_build_output_dir: 'dist', + wrangler_config_hash: 'wrangler_config_hash', }); }); diff --git a/tests/api-resources/pages/projects/projects.test.ts b/tests/api-resources/pages/projects/projects.test.ts index 41a92b2403..4f2c4122e8 100644 --- a/tests/api-resources/pages/projects/projects.test.ts +++ b/tests/api-resources/pages/projects/projects.test.ts @@ -11,7 +11,11 @@ const client = new Cloudflare({ describe('resource projects', () => { test('create: only required params', async () => { - const responsePromise = client.pages.projects.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = client.pages.projects.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'my-pages-app', + production_branch: 'main', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -24,6 +28,8 @@ describe('resource projects', () => { test('create: required and optional params', async () => { const response = await client.pages.projects.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'my-pages-app', + production_branch: 'main', build_config: { build_caching: true, build_command: 'npm run build', @@ -35,15 +41,19 @@ describe('resource projects', () => { deployment_configs: { preview: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, + always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - compatibility_date: '2022-01-01', + build_image_major_version: 3, + compatibility_date: '2025-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, + fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, + limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -55,19 +65,25 @@ describe('resource projects', () => { service: 'example-worker', }, }, + usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, + wrangler_config_hash: 'abc123def456', }, production: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, + always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - compatibility_date: '2022-01-01', + build_image_major_version: 3, + compatibility_date: '2025-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, + fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, + limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -79,26 +95,26 @@ describe('resource projects', () => { service: 'example-worker', }, }, + usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, + wrangler_config_hash: 'abc123def456', }, }, - name: 'NextJS Blog', - production_branch: 'main', source: { config: { deployments_enabled: true, - owner: 'owner', + owner: 'my-org', path_excludes: ['string'], path_includes: ['string'], pr_comments_enabled: true, preview_branch_excludes: ['string'], preview_branch_includes: ['string'], preview_deployment_setting: 'all', - production_branch: 'production_branch', + production_branch: 'main', production_deployments_enabled: true, - repo_name: 'repo_name', + repo_name: 'my-repo', }, - type: 'type', + type: 'github', }, }); }); @@ -144,6 +160,8 @@ describe('resource projects', () => { test('edit: only required params', async () => { const responsePromise = client.pages.projects.edit('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'my-pages-app', + production_branch: 'main', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -157,6 +175,8 @@ describe('resource projects', () => { test('edit: required and optional params', async () => { const response = await client.pages.projects.edit('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'my-pages-app', + production_branch: 'main', build_config: { build_caching: true, build_command: 'npm run build', @@ -168,15 +188,19 @@ describe('resource projects', () => { deployment_configs: { preview: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, + always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - compatibility_date: '2022-01-01', + build_image_major_version: 3, + compatibility_date: '2025-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, + fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, + limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -188,19 +212,25 @@ describe('resource projects', () => { service: 'example-worker', }, }, + usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, + wrangler_config_hash: 'abc123def456', }, production: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, + always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - compatibility_date: '2022-01-01', + build_image_major_version: 3, + compatibility_date: '2025-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, + fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, + limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -212,26 +242,26 @@ describe('resource projects', () => { service: 'example-worker', }, }, + usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, + wrangler_config_hash: 'abc123def456', }, }, - name: 'NextJS Blog', - production_branch: 'main', source: { config: { deployments_enabled: true, - owner: 'owner', + owner: 'my-org', path_excludes: ['string'], path_includes: ['string'], pr_comments_enabled: true, preview_branch_excludes: ['string'], preview_branch_includes: ['string'], preview_deployment_setting: 'all', - production_branch: 'production_branch', + production_branch: 'main', production_deployments_enabled: true, - repo_name: 'repo_name', + repo_name: 'my-repo', }, - type: 'type', + type: 'github', }, }); }); From 7983ce2d7f96a00c6c9ca5f6f1516b78d8ced3cc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 15:52:45 +0000 Subject: [PATCH 201/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index db0af31ab3..7d917e14e8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c4fc50564f8bab541dbfcd11d4e44ee2da8b356b4b213042d40bb1ed24d5b3e6.yml -openapi_spec_hash: 41fb0c2df7aefe9dd5365b4ad820072c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5812330bdca6ea330ca17ad155adee5e9fe9b171be00d5dad6e3494b7f114216.yml +openapi_spec_hash: 68b2d454ddfd4555a77641ccdf6b9f3c config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 3bad75dafcbe71aa72f99dd0a7ab46736c08901e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 16:14:44 +0000 Subject: [PATCH 202/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7d917e14e8..21eae882fd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5812330bdca6ea330ca17ad155adee5e9fe9b171be00d5dad6e3494b7f114216.yml -openapi_spec_hash: 68b2d454ddfd4555a77641ccdf6b9f3c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-590cdf05e79e64fefe5556d1a6f88fa486d72dd0d4f6c2fdbb2485c3b5ddd37c.yml +openapi_spec_hash: 95ec065a767191daff317616f88d27ad config_hash: 0ce5789fc4b59ae352e68d00847570c2 From baabe00a03d0115a68ca735d9f596edd8c179b8a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 16:28:22 +0000 Subject: [PATCH 203/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 21eae882fd..eb2930be88 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-590cdf05e79e64fefe5556d1a6f88fa486d72dd0d4f6c2fdbb2485c3b5ddd37c.yml -openapi_spec_hash: 95ec065a767191daff317616f88d27ad +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-61cd3679b8ba826c1cad824187669331d2b46243621b09df0b340b2f3642a548.yml +openapi_spec_hash: 8503f433c7f5df490bbc0844d0dff1c1 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 712399c843de06b97a2a2c49e0ed943d3a7042f8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 18:22:27 +0000 Subject: [PATCH 204/451] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 2 - .../cloudforce-one/cloudforce-one.ts | 4 - src/resources/cloudforce-one/index.ts | 2 - .../cloudforce-one/threat-events/index.ts | 2 - .../threat-events/threat-events.ts | 79 ------------------- .../threat-events/threat-events.test.ts | 17 ---- 7 files changed, 3 insertions(+), 109 deletions(-) diff --git a/.stats.yml b/.stats.yml index eb2930be88..242b72339c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-61cd3679b8ba826c1cad824187669331d2b46243621b09df0b340b2f3642a548.yml -openapi_spec_hash: 8503f433c7f5df490bbc0844d0dff1c1 +configured_endpoints: 1821 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3fb0eea5e310caf8b039633b2f2b863b390040808ebaa7d3c31b91bda68f0edd.yml +openapi_spec_hash: 89e80a6f9cbebf986352a288fa3b5569 config_hash: 0ce5789fc4b59ae352e68d00847570c2 diff --git a/api.md b/api.md index 910b8a47af..7fbb538edd 100644 --- a/api.md +++ b/api.md @@ -8009,7 +8009,6 @@ Types: - ThreatEventDeleteResponse - ThreatEventBulkCreateResponse - ThreatEventEditResponse -- ThreatEventGetResponse Methods: @@ -8018,7 +8017,6 @@ Methods: - client.cloudforceOne.threatEvents.delete(eventId, { ...params }) -> ThreatEventDeleteResponse - client.cloudforceOne.threatEvents.bulkCreate({ ...params }) -> ThreatEventBulkCreateResponse - client.cloudforceOne.threatEvents.edit(eventId, { ...params }) -> ThreatEventEditResponse -- client.cloudforceOne.threatEvents.get(eventId, { ...params }) -> ThreatEventGetResponse ### Attackers diff --git a/src/resources/cloudforce-one/cloudforce-one.ts b/src/resources/cloudforce-one/cloudforce-one.ts index aeabfa782e..8c4fe620ba 100644 --- a/src/resources/cloudforce-one/cloudforce-one.ts +++ b/src/resources/cloudforce-one/cloudforce-one.ts @@ -41,8 +41,6 @@ import { ThreatEventDeleteResponse, ThreatEventEditParams, ThreatEventEditResponse, - ThreatEventGetParams, - ThreatEventGetResponse, ThreatEventListParams, ThreatEventListResponse, ThreatEvents, @@ -100,12 +98,10 @@ export declare namespace CloudforceOne { type ThreatEventDeleteResponse as ThreatEventDeleteResponse, type ThreatEventBulkCreateResponse as ThreatEventBulkCreateResponse, type ThreatEventEditResponse as ThreatEventEditResponse, - type ThreatEventGetResponse as ThreatEventGetResponse, type ThreatEventCreateParams as ThreatEventCreateParams, type ThreatEventListParams as ThreatEventListParams, type ThreatEventDeleteParams as ThreatEventDeleteParams, type ThreatEventBulkCreateParams as ThreatEventBulkCreateParams, type ThreatEventEditParams as ThreatEventEditParams, - type ThreatEventGetParams as ThreatEventGetParams, }; } diff --git a/src/resources/cloudforce-one/index.ts b/src/resources/cloudforce-one/index.ts index f69388911d..77ba414bca 100644 --- a/src/resources/cloudforce-one/index.ts +++ b/src/resources/cloudforce-one/index.ts @@ -35,11 +35,9 @@ export { type ThreatEventDeleteResponse, type ThreatEventBulkCreateResponse, type ThreatEventEditResponse, - type ThreatEventGetResponse, type ThreatEventCreateParams, type ThreatEventListParams, type ThreatEventDeleteParams, type ThreatEventBulkCreateParams, type ThreatEventEditParams, - type ThreatEventGetParams, } from './threat-events/index'; diff --git a/src/resources/cloudforce-one/threat-events/index.ts b/src/resources/cloudforce-one/threat-events/index.ts index d797682ddd..d687bf1e82 100644 --- a/src/resources/cloudforce-one/threat-events/index.ts +++ b/src/resources/cloudforce-one/threat-events/index.ts @@ -53,11 +53,9 @@ export { type ThreatEventDeleteResponse, type ThreatEventBulkCreateResponse, type ThreatEventEditResponse, - type ThreatEventGetResponse, type ThreatEventCreateParams, type ThreatEventListParams, type ThreatEventDeleteParams, type ThreatEventBulkCreateParams, type ThreatEventEditParams, - type ThreatEventGetParams, } from './threat-events'; diff --git a/src/resources/cloudforce-one/threat-events/threat-events.ts b/src/resources/cloudforce-one/threat-events/threat-events.ts index d23c37b5db..87dd60711b 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -207,26 +207,6 @@ export class ThreatEvents extends APIResource { ...options, }); } - - /** - * Reads an event - * - * @example - * ```ts - * const threatEvent = - * await client.cloudforceOne.threatEvents.get('event_id', { - * account_id: 'account_id', - * }); - * ``` - */ - get( - eventId: string, - params: ThreatEventGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return this._client.get(`/accounts/${account_id}/cloudforce-one/events/${eventId}`, options); - } } export interface ThreatEventCreateResponse { @@ -392,56 +372,6 @@ export interface ThreatEventEditResponse { releasabilityId?: string; } -export interface ThreatEventGetResponse { - attacker: string; - - attackerCountry: string; - - category: string; - - date: string; - - event: string; - - indicator: string; - - indicatorType: string; - - indicatorTypeId: number; - - killChain: number; - - mitreAttack: Array; - - numReferenced: number; - - numReferences: number; - - rawId: string; - - referenced: Array; - - referencedIds: Array; - - references: Array; - - referencesIds: Array; - - tags: Array; - - targetCountry: string; - - targetIndustry: string; - - tlp: string; - - uuid: string; - - insight?: string; - - releasabilityId?: string; -} - export interface ThreatEventCreateParams { /** * Path param: Account ID. @@ -743,13 +673,6 @@ export namespace ThreatEventEditParams { } } -export interface ThreatEventGetParams { - /** - * Account ID. - */ - account_id: string; -} - ThreatEvents.Attackers = Attackers; ThreatEvents.Categories = Categories; ThreatEvents.Countries = Countries; @@ -770,13 +693,11 @@ export declare namespace ThreatEvents { type ThreatEventDeleteResponse as ThreatEventDeleteResponse, type ThreatEventBulkCreateResponse as ThreatEventBulkCreateResponse, type ThreatEventEditResponse as ThreatEventEditResponse, - type ThreatEventGetResponse as ThreatEventGetResponse, type ThreatEventCreateParams as ThreatEventCreateParams, type ThreatEventListParams as ThreatEventListParams, type ThreatEventDeleteParams as ThreatEventDeleteParams, type ThreatEventBulkCreateParams as ThreatEventBulkCreateParams, type ThreatEventEditParams as ThreatEventEditParams, - type ThreatEventGetParams as ThreatEventGetParams, }; export { 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 694b31d176..68105203c4 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 @@ -179,21 +179,4 @@ describe('resource threatEvents', () => { tlp: 'amber', }); }); - - // TODO: HTTP 401 from prism - test.skip('get: only required params', async () => { - const responsePromise = client.cloudforceOne.threatEvents.get('event_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.get('event_id', { account_id: 'account_id' }); - }); }); From c53aa5af0cc49eb31a9ee2f6f14df536f99caca4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 18:24:22 +0000 Subject: [PATCH 205/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 242b72339c..df1af70481 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3fb0eea5e310caf8b039633b2f2b863b390040808ebaa7d3c31b91bda68f0edd.yml -openapi_spec_hash: 89e80a6f9cbebf986352a288fa3b5569 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c1d50349d1accea481e6cc8ed6718bb809d10bab2e3c6bc9bbf3a0298041e842.yml +openapi_spec_hash: 26361e089925e359cd734d2c49d1872e config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 354aebe97d8966a80e70207dd52b45975d4fc933 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 19:05:02 +0000 Subject: [PATCH 206/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index df1af70481..c1dda66dab 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c1d50349d1accea481e6cc8ed6718bb809d10bab2e3c6bc9bbf3a0298041e842.yml -openapi_spec_hash: 26361e089925e359cd734d2c49d1872e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0cf0a414cb7469dcd58768364936581ee45221ece0e66bc32832e91aa8c176ef.yml +openapi_spec_hash: 5c67dfbfa8d0ef98cf284f16c1dacdc6 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From d5f7d398e1e4c753b90d408abb499630cff3e4cc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 19:06:51 +0000 Subject: [PATCH 207/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index c1dda66dab..51a09a3c57 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0cf0a414cb7469dcd58768364936581ee45221ece0e66bc32832e91aa8c176ef.yml -openapi_spec_hash: 5c67dfbfa8d0ef98cf284f16c1dacdc6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1938cc0b51139d714e4def7300332cd7b6f684a8cb79316f75fecb0ed63a518c.yml +openapi_spec_hash: 372f7b6992a08d849bcd448ce9031522 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From e295d753ba47b7313e5a3c24afa7b00f7d8d295e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 19:10:25 +0000 Subject: [PATCH 208/451] chore(api): update composite API spec --- .stats.yml | 4 ++-- .../connectors/snapshots/latest.ts | 22 +++++++++++++++++++ .../connectors/snapshots/snapshots.ts | 22 +++++++++++++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 51a09a3c57..cf2bf32fbc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1938cc0b51139d714e4def7300332cd7b6f684a8cb79316f75fecb0ed63a518c.yml -openapi_spec_hash: 372f7b6992a08d849bcd448ce9031522 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d8e7ff1453f8ed1da8441c816ddeeb62fea2b80612e1e2b4f62257853a6dc7eb.yml +openapi_spec_hash: a40e8a9f5429ad266d3dcd9fbbaf4a4d config_hash: 0ce5789fc4b59ae352e68d00847570c2 diff --git a/src/resources/magic-transit/connectors/snapshots/latest.ts b/src/resources/magic-transit/connectors/snapshots/latest.ts index 16d9eaff01..c51d9f1abe 100644 --- a/src/resources/magic-transit/connectors/snapshots/latest.ts +++ b/src/resources/magic-transit/connectors/snapshots/latest.ts @@ -72,6 +72,8 @@ export namespace LatestListResponse { */ v: string; + bonds?: Array; + /** * Count of processors/cores */ @@ -876,6 +878,21 @@ export namespace LatestListResponse { } export namespace Item { + /** + * Snapshot Bond + */ + export interface Bond { + /** + * Name of the network interface + */ + name: string; + + /** + * Current status of the network interface + */ + status: string; + } + /** * Snapshot DHCP lease */ @@ -1279,6 +1296,11 @@ export namespace LatestListResponse { * Connector identifier */ connector_id?: string; + + /** + * MTU as measured between the two ends of the tunnel + */ + probed_mtu?: number; } } } diff --git a/src/resources/magic-transit/connectors/snapshots/snapshots.ts b/src/resources/magic-transit/connectors/snapshots/snapshots.ts index 69b5c098e5..a7d1e0d815 100644 --- a/src/resources/magic-transit/connectors/snapshots/snapshots.ts +++ b/src/resources/magic-transit/connectors/snapshots/snapshots.ts @@ -123,6 +123,8 @@ export interface SnapshotGetResponse { */ v: string; + bonds?: Array; + /** * Count of processors/cores */ @@ -927,6 +929,21 @@ export interface SnapshotGetResponse { } export namespace SnapshotGetResponse { + /** + * Snapshot Bond + */ + export interface Bond { + /** + * Name of the network interface + */ + name: string; + + /** + * Current status of the network interface + */ + status: string; + } + /** * Snapshot DHCP lease */ @@ -1330,6 +1347,11 @@ export namespace SnapshotGetResponse { * Connector identifier */ connector_id?: string; + + /** + * MTU as measured between the two ends of the tunnel + */ + probed_mtu?: number; } } From 8f1016d64c972e5043f6792e85417b0c8acab170 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 19:38:18 +0000 Subject: [PATCH 209/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index cf2bf32fbc..aff8bc7f63 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d8e7ff1453f8ed1da8441c816ddeeb62fea2b80612e1e2b4f62257853a6dc7eb.yml -openapi_spec_hash: a40e8a9f5429ad266d3dcd9fbbaf4a4d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9be902c9fc6b99355fb2d21248dcca89a7dc51abf9083a445de93fce6046ea8f.yml +openapi_spec_hash: 6c7c420ecc13b7d6dc8ab045b157c3c4 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 5a240b5af7a477c1c70d45c5b0c2e5d8f811bdd5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 19:42:24 +0000 Subject: [PATCH 210/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index aff8bc7f63..6ac86d5a9a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9be902c9fc6b99355fb2d21248dcca89a7dc51abf9083a445de93fce6046ea8f.yml -openapi_spec_hash: 6c7c420ecc13b7d6dc8ab045b157c3c4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-da31b298126a906e7eef13d64df61dc1ebb7e1b85d57d04f5ef9dad7d76c214c.yml +openapi_spec_hash: d4b874cfa9113c51a37302373e668443 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 81019e120178daf043f23dc081f33dbdf9b1fbe9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 22:51:00 +0000 Subject: [PATCH 211/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6ac86d5a9a..9ad4346b83 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-da31b298126a906e7eef13d64df61dc1ebb7e1b85d57d04f5ef9dad7d76c214c.yml -openapi_spec_hash: d4b874cfa9113c51a37302373e668443 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e8587bd1c165745ef1b1d8edb957f01a1cb3e4790d5fcb3dd1584bde777929c1.yml +openapi_spec_hash: e37e860500c910b24c0d7080c76d131a config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 83d051d06f7af58ccb09259769b0f4474ad09aaa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 23:02:23 +0000 Subject: [PATCH 212/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9ad4346b83..eed3eb76eb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e8587bd1c165745ef1b1d8edb957f01a1cb3e4790d5fcb3dd1584bde777929c1.yml -openapi_spec_hash: e37e860500c910b24c0d7080c76d131a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bd400602ec86a0531a55ed9bdb1f38026d0896957579acff145e98028ca364d4.yml +openapi_spec_hash: a7c505da9d64268e4f2b45df56b6d804 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From cf99249750a1bb749bca04fc0b1d3fbd9db619bd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 09:14:18 +0000 Subject: [PATCH 213/451] chore(api): update composite API spec --- .stats.yml | 4 ++-- src/resources/radar/ct/logs.ts | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index eed3eb76eb..0f353ee29f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bd400602ec86a0531a55ed9bdb1f38026d0896957579acff145e98028ca364d4.yml -openapi_spec_hash: a7c505da9d64268e4f2b45df56b6d804 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56259b52241f39439e7f03b5b3ab73bf5ac46665a631e0a4add775482cfe481e.yml +openapi_spec_hash: b1ea6fe371ca9455f65ecae055be880c config_hash: 0ce5789fc4b59ae352e68d00847570c2 diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts index 4ba71c4acf..829a017a4b 100644 --- a/src/resources/radar/ct/logs.ts +++ b/src/resources/radar/ct/logs.ts @@ -121,6 +121,12 @@ export namespace LogGetResponse { */ api: 'RFC6962' | 'STATIC'; + /** + * The average throughput of the CT log, measured in certificates per hour + * (certs/hour). + */ + avgThroughput: number; + /** * A brief description of the certificate log. */ @@ -131,6 +137,11 @@ export namespace LogGetResponse { */ endExclusive: string; + /** + * Timestamp of the most recent update to the CT log. + */ + lastUpdate: string; + /** * The organization responsible for operating the certificate log. */ @@ -168,6 +179,18 @@ export namespace LogGetResponse { */ stateTimestamp: string; + /** + * Number of certificates that are eligible for inclusion to this log but have not + * been included yet. Based on certificates signed by trusted root CAs within the + * log's accepted date range. + */ + submittableCertCount: string | null; + + /** + * Number of certificates already included in this CT log. + */ + submittedCertCount: string | null; + /** * The URL for the certificate log. */ From bc51ad03ceb01e6ff6e3508605c41b76449cc731 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 09:29:54 +0000 Subject: [PATCH 214/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0f353ee29f..228f2efe63 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56259b52241f39439e7f03b5b3ab73bf5ac46665a631e0a4add775482cfe481e.yml -openapi_spec_hash: b1ea6fe371ca9455f65ecae055be880c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ce15adc44a72b63a61a359e00a6edfcbd5a96e1932a0d656c30e5fc21c60e7e7.yml +openapi_spec_hash: 0dba768db4ad817906848044a62e43d6 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 90ee1a11842a1089c961c570f75ec6dffde41f81 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 09:45:50 +0000 Subject: [PATCH 215/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 228f2efe63..d986f537b5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ce15adc44a72b63a61a359e00a6edfcbd5a96e1932a0d656c30e5fc21c60e7e7.yml -openapi_spec_hash: 0dba768db4ad817906848044a62e43d6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5c1a43d47c3af59269a744e7f29d81cc1f38a53a1391a4c360c186e1ecaddd88.yml +openapi_spec_hash: 52697863e61e7cf3b7c8631c537938cd config_hash: 0ce5789fc4b59ae352e68d00847570c2 From e8dcb4249d460103a0a663ddc111d39215c7c143 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 12:27:09 +0000 Subject: [PATCH 216/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d986f537b5..0fb65fcbf0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5c1a43d47c3af59269a744e7f29d81cc1f38a53a1391a4c360c186e1ecaddd88.yml -openapi_spec_hash: 52697863e61e7cf3b7c8631c537938cd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9a2b2a64c57fe50af7089f97b9a8024facf7be0298808b43f0ec014ea18a6d12.yml +openapi_spec_hash: 05a489633c610dcac9b01fc990710728 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From ddc20080940113fa35abd2bea94cce0e40a1e7df Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 12:33:07 +0000 Subject: [PATCH 217/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0fb65fcbf0..58a61ba064 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9a2b2a64c57fe50af7089f97b9a8024facf7be0298808b43f0ec014ea18a6d12.yml -openapi_spec_hash: 05a489633c610dcac9b01fc990710728 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b1aadbe1d9bc95747c1d9add9eff3bec2e0c861227be8d3a607f961a30576034.yml +openapi_spec_hash: fce51857fda57d622a79ff80a40699bb config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 5f80c48597cb66f75a70abde0024864258cf356e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 13:46:17 +0000 Subject: [PATCH 218/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 58a61ba064..48d02e91cc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b1aadbe1d9bc95747c1d9add9eff3bec2e0c861227be8d3a607f961a30576034.yml -openapi_spec_hash: fce51857fda57d622a79ff80a40699bb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c285fd6c135b0e1a0092ceb7e99646af48bb2d41c41a2685866ffe89f0e48f98.yml +openapi_spec_hash: 93a8827a184faa559ae281be275b733c config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 3f69072afde9dad1aa89c9952fba20d01877af60 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 14:32:22 +0000 Subject: [PATCH 219/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 48d02e91cc..d22d47bbf3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c285fd6c135b0e1a0092ceb7e99646af48bb2d41c41a2685866ffe89f0e48f98.yml -openapi_spec_hash: 93a8827a184faa559ae281be275b733c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cb0068b50034aff702b6c6c2e49a908d9da8595a1851faec13a35b8de712830f.yml +openapi_spec_hash: 7b148179072d77eebbbae4fcf0778566 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 2f803d549624e401d931e4658c0107cbb9c9eb9c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 14:35:38 +0000 Subject: [PATCH 220/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d22d47bbf3..dfe35452ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cb0068b50034aff702b6c6c2e49a908d9da8595a1851faec13a35b8de712830f.yml -openapi_spec_hash: 7b148179072d77eebbbae4fcf0778566 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e5d6e70a3d14c40f4cd0e2781623d93d098a9248561708c3fc1c1921647f0d26.yml +openapi_spec_hash: 3447200f54d371c93e863f6a12ede1c4 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From fa5b49bb495d8bacb88efb2f33ac5d881018a5b1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 14:48:14 +0000 Subject: [PATCH 221/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index dfe35452ef..53c15b9340 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e5d6e70a3d14c40f4cd0e2781623d93d098a9248561708c3fc1c1921647f0d26.yml -openapi_spec_hash: 3447200f54d371c93e863f6a12ede1c4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-48188e012cabf956df501f155ad5963098e9ad16b7248054683988d680c3479a.yml +openapi_spec_hash: 413e3ede41a4af302c7b82684850e300 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 6f5b6bdc848eaf6be43df33864a89dab98de41d5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 15:50:27 +0000 Subject: [PATCH 222/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 53c15b9340..9d7ae3b478 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-48188e012cabf956df501f155ad5963098e9ad16b7248054683988d680c3479a.yml -openapi_spec_hash: 413e3ede41a4af302c7b82684850e300 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0341ece927132cdff311426e4f2089d4f04cffccceb0564a969088d32638c4f6.yml +openapi_spec_hash: 32838b1b299c4ffa5d05202d7a920de0 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From da105c74dd5d2e5a8b310d14abcaa7af2ae44300 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 15:52:31 +0000 Subject: [PATCH 223/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9d7ae3b478..837c222d80 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0341ece927132cdff311426e4f2089d4f04cffccceb0564a969088d32638c4f6.yml -openapi_spec_hash: 32838b1b299c4ffa5d05202d7a920de0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-df1380110de4bd213f2d58dc4df48e37a9d8c31f1060370d540ef0996c929925.yml +openapi_spec_hash: d8aafb10be079e6124b75dd5f1884dcb config_hash: 0ce5789fc4b59ae352e68d00847570c2 From ea4b26d15f872f5e64d4036f90394a6f8169c0ce Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 16:13:45 +0000 Subject: [PATCH 224/451] chore(api): update composite API spec --- .stats.yml | 4 ++-- src/resources/zero-trust/gateway/rules.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 837c222d80..e83c179b1b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-df1380110de4bd213f2d58dc4df48e37a9d8c31f1060370d540ef0996c929925.yml -openapi_spec_hash: d8aafb10be079e6124b75dd5f1884dcb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e758fbd537ee6a6679a4b8930316dea8c62b76c2e1d50786767ae560edb9b8f7.yml +openapi_spec_hash: 61a3fefb76f66f3392f46a9012434966 config_hash: 0ce5789fc4b59ae352e68d00847570c2 diff --git a/src/resources/zero-trust/gateway/rules.ts b/src/resources/zero-trust/gateway/rules.ts index 0431f40330..328aafe540 100644 --- a/src/resources/zero-trust/gateway/rules.ts +++ b/src/resources/zero-trust/gateway/rules.ts @@ -295,7 +295,7 @@ export interface GatewayRule { /** * Specify the protocol or layer to evaluate the traffic, identity, and device - * posture expressions. + * posture expressions. Can only contain a single value. */ filters: Array; @@ -1558,7 +1558,7 @@ export interface RuleCreateParams { /** * Body param: Specify the protocol or layer to evaluate the traffic, identity, and - * device posture expressions. + * device posture expressions. Can only contain a single value. */ filters?: Array; @@ -1689,7 +1689,7 @@ export interface RuleUpdateParams { /** * Body param: Specify the protocol or layer to evaluate the traffic, identity, and - * device posture expressions. + * device posture expressions. Can only contain a single value. */ filters?: Array; From 55b86ff7d75db01078d397ebee71f33045bbb15f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 16:31:54 +0000 Subject: [PATCH 225/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e83c179b1b..cfde1aa14b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e758fbd537ee6a6679a4b8930316dea8c62b76c2e1d50786767ae560edb9b8f7.yml -openapi_spec_hash: 61a3fefb76f66f3392f46a9012434966 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b7f4892f2c45cb5ea6d0fb4da382947fbf76dca6e53f2a8a74bab520b334cb29.yml +openapi_spec_hash: 5dcd4ae749374c0334e88509cfb70ce7 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 62608fd38f534d6197bc604ddb3c9d0f5d1258d5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 16:49:08 +0000 Subject: [PATCH 226/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index cfde1aa14b..01231bf09a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b7f4892f2c45cb5ea6d0fb4da382947fbf76dca6e53f2a8a74bab520b334cb29.yml -openapi_spec_hash: 5dcd4ae749374c0334e88509cfb70ce7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-88100bdea62ad01c452b324172f5a960887e3f615a2c73ee544827269d4f550a.yml +openapi_spec_hash: 48773723d7f2428aa2247a42483ae64b config_hash: 0ce5789fc4b59ae352e68d00847570c2 From 510fdb53c98b713112c489ae89ed4aa0f93a84a5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 16:51:16 +0000 Subject: [PATCH 227/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 01231bf09a..766c531d48 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1821 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-88100bdea62ad01c452b324172f5a960887e3f615a2c73ee544827269d4f550a.yml -openapi_spec_hash: 48773723d7f2428aa2247a42483ae64b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e0528896acf7f742ac96a77d02bbd10cfc289d2a0f78694d7ac7097aba0bab95.yml +openapi_spec_hash: 46a40560a5a816a6c745141d127b01c3 config_hash: 0ce5789fc4b59ae352e68d00847570c2 From f7c13739fbbba7b9d9ff9c259b37bea92ac6688a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 17:09:07 +0000 Subject: [PATCH 228/451] feat: feat: SDKs for Organizations and OrganizationsProfile * chore: Add back in skips for Org accounts * chore: Maintain skips in Organization-Members resource * chore: remove codegen skips from Orgs related resources --- .stats.yml | 4 +- api.md | 26 ++ scripts/detect-breaking-changes | 2 + src/index.ts | 5 + src/resources/index.ts | 1 + src/resources/organizations.ts | 3 + src/resources/organizations/index.ts | 8 + .../organizations/organization-profile.ts | 63 ++++ src/resources/organizations/organizations.ts | 310 ++++++++++++++++++ .../organization-profile.test.ts | 65 ++++ .../organizations/organizations.test.ts | 133 ++++++++ 11 files changed, 618 insertions(+), 2 deletions(-) create mode 100644 src/resources/organizations.ts create mode 100644 src/resources/organizations/index.ts create mode 100644 src/resources/organizations/organization-profile.ts create mode 100644 src/resources/organizations/organizations.ts create mode 100644 tests/api-resources/organizations/organization-profile.test.ts create mode 100644 tests/api-resources/organizations/organizations.test.ts diff --git a/.stats.yml b/.stats.yml index 766c531d48..a75e35fe64 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1821 +configured_endpoints: 1828 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e0528896acf7f742ac96a77d02bbd10cfc289d2a0f78694d7ac7097aba0bab95.yml openapi_spec_hash: 46a40560a5a816a6c745141d127b01c3 -config_hash: 0ce5789fc4b59ae352e68d00847570c2 +config_hash: 6b1c4254f3918c63e1abef683bb728c3 diff --git a/api.md b/api.md index 7fbb538edd..feff21d7bb 100644 --- a/api.md +++ b/api.md @@ -124,6 +124,32 @@ Methods: - client.accounts.logs.audit.list({ ...params }) -> AuditListResponsesCursorPaginationAfter +# Organizations + +Types: + +- Organization +- OrganizationDeleteResponse + +Methods: + +- client.organizations.create({ ...params }) -> Organization +- client.organizations.update(organizationId, { ...params }) -> Organization +- client.organizations.list({ ...params }) -> OrganizationsSinglePage +- client.organizations.delete(organizationId) -> OrganizationDeleteResponse +- client.organizations.get(organizationId) -> Organization + +## OrganizationProfile + +Types: + +- OrganizationProfile + +Methods: + +- client.organizations.organizationProfile.update(organizationId, { ...params }) -> void +- client.organizations.organizationProfile.get(organizationId) -> unnamed_schema_0.Result + # OriginCACertificates Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index afe4516980..fa371be652 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -16,6 +16,8 @@ TEST_PATHS=( tests/api-resources/accounts/tokens/value.test.ts tests/api-resources/accounts/logs/logs.test.ts tests/api-resources/accounts/logs/audit.test.ts + tests/api-resources/organizations/organizations.test.ts + tests/api-resources/organizations/organization-profile.test.ts tests/api-resources/origin-ca-certificates.test.ts tests/api-resources/ips.test.ts tests/api-resources/memberships.test.ts diff --git a/src/index.ts b/src/index.ts index e95a62b7e6..8babe6c2ee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -83,6 +83,7 @@ import { MagicNetworkMonitoring } from './resources/magic-network-monitoring/mag import { MagicTransit } from './resources/magic-transit/magic-transit'; import { MTLSCertificates } from './resources/mtls-certificates/mtls-certificates'; import { NetworkInterconnects } from './resources/network-interconnects/network-interconnects'; +import { Organizations } from './resources/organizations/organizations'; import { OriginTLSClientAuth } from './resources/origin-tls-client-auth/origin-tls-client-auth'; import { PageShield } from './resources/page-shield/page-shield'; import { Pages } from './resources/pages/pages'; @@ -266,6 +267,7 @@ export class Cloudflare extends Core.APIClient { } accounts: API.Accounts = new API.Accounts(this); + organizations: API.Organizations = new API.Organizations(this); originCACertificates: API.OriginCACertificates = new API.OriginCACertificates(this); ips: API.IPs = new API.IPs(this); memberships: API.Memberships = new API.Memberships(this); @@ -503,6 +505,7 @@ export class Cloudflare extends Core.APIClient { } Cloudflare.Accounts = Accounts; +Cloudflare.Organizations = Organizations; Cloudflare.OriginCACertificates = OriginCACertificates; Cloudflare.IPs = IPs; Cloudflare.Memberships = Memberships; @@ -636,6 +639,8 @@ export declare namespace Cloudflare { export { Accounts as Accounts }; + export { Organizations as Organizations }; + export { OriginCACertificates as OriginCACertificates }; export { IPs as IPs }; diff --git a/src/resources/index.ts b/src/resources/index.ts index ac499e1b7f..d8eb5cf899 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -57,6 +57,7 @@ export { MagicTransit } from './magic-transit/magic-transit'; export { ManagedTransforms } from './managed-transforms'; export { Memberships } from './memberships'; export { NetworkInterconnects } from './network-interconnects/network-interconnects'; +export { Organizations } from './organizations/organizations'; export { OriginCACertificates } from './origin-ca-certificates'; export { OriginPostQuantumEncryption } from './origin-post-quantum-encryption'; export { OriginTLSClientAuth } from './origin-tls-client-auth/origin-tls-client-auth'; diff --git a/src/resources/organizations.ts b/src/resources/organizations.ts new file mode 100644 index 0000000000..61ddaf165e --- /dev/null +++ b/src/resources/organizations.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './organizations/index'; diff --git a/src/resources/organizations/index.ts b/src/resources/organizations/index.ts new file mode 100644 index 0000000000..74e4c1078f --- /dev/null +++ b/src/resources/organizations/index.ts @@ -0,0 +1,8 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + OrganizationProfileResource, + type OrganizationProfile, + type OrganizationProfileUpdateParams, +} from './organization-profile'; +export { Organizations } from './organizations'; diff --git a/src/resources/organizations/organization-profile.ts b/src/resources/organizations/organization-profile.ts new file mode 100644 index 0000000000..70c53b83e1 --- /dev/null +++ b/src/resources/organizations/organization-profile.ts @@ -0,0 +1,63 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; + +export class OrganizationProfileResource extends APIResource { + /** + * Modify organization profile + */ + update( + organizationId: string, + body: OrganizationProfileUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.put(`/organizations/${organizationId}/profile`, { + body, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); + } + + /** + * Get an organizations profile if it exists. + */ + get(organizationId: string, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.get(`/organizations/${organizationId}/profile`, options) as Core.APIPromise<{ + result: unnamed_schema_0.Result; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface OrganizationProfile { + business_address: string; + + business_email: string; + + business_name: string; + + business_phone: string; + + external_metadata: string; +} + +export interface OrganizationProfileUpdateParams { + business_address: string; + + business_email: string; + + business_name: string; + + business_phone: string; + + external_metadata: string; +} + +export declare namespace OrganizationProfileResource { + export { + type OrganizationProfile as OrganizationProfile, + type OrganizationProfileUpdateParams as OrganizationProfileUpdateParams, + }; +} diff --git a/src/resources/organizations/organizations.ts b/src/resources/organizations/organizations.ts new file mode 100644 index 0000000000..aa9aafb4b4 --- /dev/null +++ b/src/resources/organizations/organizations.ts @@ -0,0 +1,310 @@ +// 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 OrganizationProfileAPI from './organization-profile'; +import { + OrganizationProfile, + OrganizationProfileResource, + OrganizationProfileUpdateParams, +} from './organization-profile'; +import { SinglePage } from '../../pagination'; + +export class Organizations extends APIResource { + organizationProfile: OrganizationProfileAPI.OrganizationProfileResource = + new OrganizationProfileAPI.OrganizationProfileResource(this._client); + + /** + * Create a new organization for a user. + */ + create(body: OrganizationCreateParams, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.post('/organizations', { body, ...options }) as Core.APIPromise<{ result: Organization }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Modify organization + */ + update( + organizationId: string, + body: OrganizationUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/organizations/${organizationId}`, { body, ...options }) as Core.APIPromise<{ + result: Organization; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieve a list of organizations a particular user has access to. + */ + list( + query?: OrganizationListParams, + options?: Core.RequestOptions, + ): Core.PagePromise; + list(options?: Core.RequestOptions): Core.PagePromise; + list( + query: OrganizationListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.PagePromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return this._client.getAPIList('/organizations', OrganizationsSinglePage, { query, ...options }); + } + + /** + * Delete an organization. The organization MUST be empty before deleting. It must + * not contain any sub-organizations, accounts, members or users. + */ + delete(organizationId: string, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.delete(`/organizations/${organizationId}`, options) as Core.APIPromise<{ + result: OrganizationDeleteResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieve the details of a certain organization. + */ + get(organizationId: string, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.get(`/organizations/${organizationId}`, options) as Core.APIPromise<{ + result: Organization; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class OrganizationsSinglePage extends SinglePage {} + +/** + * References an Organization in the Cloudflare data model. + */ +export interface Organization { + id: string; + + create_time: string; + + meta: Organization.Meta; + + name: string; + + parent?: Organization.Parent; + + profile?: Organization.Profile; +} + +export namespace Organization { + export interface Meta { + /** + * Enable features for Organizations. + */ + flags?: Meta.Flags; + + managed_by?: string; + + [k: string]: unknown; + } + + export namespace Meta { + /** + * Enable features for Organizations. + */ + export interface Flags { + account_creation: string; + + account_deletion: string; + + account_migration: string; + + account_mobility: string; + + sub_org_creation: string; + } + } + + export interface Parent { + id: string; + + name: string; + } + + export interface Profile { + business_address: string; + + business_email: string; + + business_name: string; + + business_phone: string; + + external_metadata: string; + } +} + +export interface OrganizationDeleteResponse { + id: string; +} + +export interface OrganizationCreateParams { + name: string; + + parent?: OrganizationCreateParams.Parent; + + profile?: OrganizationCreateParams.Profile; +} + +export namespace OrganizationCreateParams { + export interface Parent { + id: string; + } + + export interface Profile { + business_address: string; + + business_email: string; + + business_name: string; + + business_phone: string; + + external_metadata: string; + } +} + +export interface OrganizationUpdateParams { + name: string; + + parent?: OrganizationUpdateParams.Parent; + + profile?: OrganizationUpdateParams.Profile; +} + +export namespace OrganizationUpdateParams { + export interface Parent { + id: string; + } + + export interface Profile { + business_address: string; + + business_email: string; + + business_name: string; + + business_phone: string; + + external_metadata: string; + } +} + +export interface OrganizationListParams { + /** + * Only return organizations with the specified IDs (ex. id=foo&id=bar). Send + * multiple elements by repeating the query value. + */ + id?: Array; + + containing?: OrganizationListParams.Containing; + + name?: OrganizationListParams.Name; + + /** + * The amount of items to return. Defaults to 10. + */ + page_size?: number; + + /** + * An opaque token returned from the last list response that when provided will + * retrieve the next page. + * + * Parameters used to filter the retrieved list must remain in subsequent requests + * with a page token. + */ + page_token?: string; + + parent?: OrganizationListParams.Parent; +} + +export namespace OrganizationListParams { + export interface Containing { + /** + * Filter the list of organizations to the ones that contain this particular + * account. + */ + account?: string; + + /** + * Filter the list of organizations to the ones that contain this particular + * organization. + */ + organization?: string; + + /** + * Filter the list of organizations to the ones that contain this particular user. + * + * IMPORTANT: Just because an organization "contains" a user is not a + * representation of any authorization or privilege to manage any resources + * therein. An organization "containing" a user simply means the user is managed by + * that organization. + */ + user?: string; + } + + export interface Name { + /** + * (case-insensitive) Filter the list of organizations to where the name contains a + * particular string. + */ + contains?: string; + + /** + * (case-insensitive) Filter the list of organizations to where the name ends with + * a particular string. + */ + endsWith?: string; + + /** + * (case-insensitive) Filter the list of organizations to where the name starts + * with a particular string. + */ + startsWith?: string; + } + + export interface Parent { + /** + * Filter the list of organizations to the ones that are a sub-organization of the + * specified organization. + * + * "null" is a valid value to provide for this parameter. It means "where an + * organization has no parent (i.e. it is a 'root' organization)." + */ + id?: (string & {}) | 'null'; + } +} + +Organizations.OrganizationsSinglePage = OrganizationsSinglePage; +Organizations.OrganizationProfileResource = OrganizationProfileResource; + +export declare namespace Organizations { + export { + type Organization as Organization, + type OrganizationDeleteResponse as OrganizationDeleteResponse, + OrganizationsSinglePage as OrganizationsSinglePage, + type OrganizationCreateParams as OrganizationCreateParams, + type OrganizationUpdateParams as OrganizationUpdateParams, + type OrganizationListParams as OrganizationListParams, + }; + + export { + OrganizationProfileResource as OrganizationProfileResource, + type OrganizationProfile as OrganizationProfile, + type OrganizationProfileUpdateParams as OrganizationProfileUpdateParams, + }; +} diff --git a/tests/api-resources/organizations/organization-profile.test.ts b/tests/api-resources/organizations/organization-profile.test.ts new file mode 100644 index 0000000000..84e064f2c7 --- /dev/null +++ b/tests/api-resources/organizations/organization-profile.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 organizationProfile', () => { + test('update: only required params', async () => { + const responsePromise = client.organizations.organizationProfile.update( + 'a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', + { + business_address: 'business_address', + business_email: 'business_email', + business_name: 'business_name', + business_phone: 'business_phone', + external_metadata: 'external_metadata', + }, + ); + 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.organizations.organizationProfile.update( + 'a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', + { + business_address: 'business_address', + business_email: 'business_email', + business_name: 'business_name', + business_phone: 'business_phone', + external_metadata: 'external_metadata', + }, + ); + }); + + test('get', async () => { + const responsePromise = client.organizations.organizationProfile.get('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8'); + 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.organizations.organizationProfile.get('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/organizations/organizations.test.ts b/tests/api-resources/organizations/organizations.test.ts new file mode 100644 index 0000000000..8f918319cb --- /dev/null +++ b/tests/api-resources/organizations/organizations.test.ts @@ -0,0 +1,133 @@ +// 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 organizations', () => { + test('create: only required params', async () => { + const responsePromise = client.organizations.create({ name: 'name' }); + 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.organizations.create({ + name: 'name', + parent: { id: 'a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8' }, + profile: { + business_address: 'business_address', + business_email: 'business_email', + business_name: 'business_name', + business_phone: 'business_phone', + external_metadata: 'external_metadata', + }, + }); + }); + + test('update: only required params', async () => { + const responsePromise = client.organizations.update('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', { name: 'name' }); + 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.organizations.update('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', { + name: 'name', + parent: { id: 'a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8' }, + profile: { + business_address: 'business_address', + business_email: 'business_email', + business_name: 'business_name', + business_phone: 'business_phone', + external_metadata: 'external_metadata', + }, + }); + }); + + test('list', async () => { + const responsePromise = client.organizations.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.organizations.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.organizations.list( + { + id: ['a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8'], + containing: { account: 'account', organization: 'organization', user: 'user' }, + name: { contains: 'contains', endsWith: 'endsWith', startsWith: 'startsWith' }, + page_size: 0, + page_token: 'page_token', + parent: { id: 'a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8' }, + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('delete', async () => { + const responsePromise = client.organizations.delete('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8'); + 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: 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.organizations.delete('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.organizations.get('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8'); + 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.organizations.get('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); From 9d93744f8e5e20bb7023c1ee2cda759f4d18308c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 17:14:46 +0000 Subject: [PATCH 229/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a75e35fe64..0f0895fb6c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1828 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e0528896acf7f742ac96a77d02bbd10cfc289d2a0f78694d7ac7097aba0bab95.yml -openapi_spec_hash: 46a40560a5a816a6c745141d127b01c3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-39ce736606e17bd453466be4ac91732a4592edaf374947bd2171fd0097db3470.yml +openapi_spec_hash: d85c9fe71d75cdb835d974c7dc80f4a8 config_hash: 6b1c4254f3918c63e1abef683bb728c3 From 697cc5003b92b9eae63541deb1795b404c25037f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 17:42:46 +0000 Subject: [PATCH 230/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0f0895fb6c..3836af8ed6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1828 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-39ce736606e17bd453466be4ac91732a4592edaf374947bd2171fd0097db3470.yml -openapi_spec_hash: d85c9fe71d75cdb835d974c7dc80f4a8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fd1b5b1a42274af846460dcc60b1497816f4f963dd21608211ad087bde24c259.yml +openapi_spec_hash: eb26436d71a7927b7225161b5a9733f5 config_hash: 6b1c4254f3918c63e1abef683bb728c3 From 7383fde0b2412f14abddacffe50c5788460c51d4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 17:54:58 +0000 Subject: [PATCH 231/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3836af8ed6..2535d5325d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1828 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fd1b5b1a42274af846460dcc60b1497816f4f963dd21608211ad087bde24c259.yml -openapi_spec_hash: eb26436d71a7927b7225161b5a9733f5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7a82c42f729d63b7f6ac232f6c30b71a959346d1aa52daf9e50eb1f43d70d1ac.yml +openapi_spec_hash: b93acd5c37e6f6119efc0f466c724f5a config_hash: 6b1c4254f3918c63e1abef683bb728c3 From a3fefa51baca0b376a59545f220da32cc8c8c397 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 17:58:45 +0000 Subject: [PATCH 232/451] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2535d5325d..a32d955220 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1828 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7a82c42f729d63b7f6ac232f6c30b71a959346d1aa52daf9e50eb1f43d70d1ac.yml openapi_spec_hash: b93acd5c37e6f6119efc0f466c724f5a -config_hash: 6b1c4254f3918c63e1abef683bb728c3 +config_hash: 293d685513e3b1277b3451ba4b08f40b From 5c3d38cd8be1fce01449fccc9ebf0c3cd3cb81b6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 19:26:28 +0000 Subject: [PATCH 233/451] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 8 - scripts/detect-breaking-changes | 1 - src/resources/abuse-reports.ts | 886 +--------------------- tests/api-resources/abuse-reports.test.ts | 69 -- 5 files changed, 4 insertions(+), 966 deletions(-) delete mode 100644 tests/api-resources/abuse-reports.test.ts diff --git a/.stats.yml b/.stats.yml index a32d955220..895151b5b3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1828 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7a82c42f729d63b7f6ac232f6c30b71a959346d1aa52daf9e50eb1f43d70d1ac.yml -openapi_spec_hash: b93acd5c37e6f6119efc0f466c724f5a +configured_endpoints: 1827 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bcf05cc2684715bb6e8caf4a1807cdc5778b8df0155a672d51b29669a312b134.yml +openapi_spec_hash: 035b50ae08f7cae174a7be8be49e72cb config_hash: 293d685513e3b1277b3451ba4b08f40b diff --git a/api.md b/api.md index feff21d7bb..3f016137e7 100644 --- a/api.md +++ b/api.md @@ -8564,14 +8564,6 @@ Methods: # AbuseReports -Types: - -- AbuseReportCreateResponse - -Methods: - -- client.abuseReports.create(reportType, { ...params }) -> AbuseReportCreateResponse - # AI Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index fa371be652..ff1cfdb2d4 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -722,7 +722,6 @@ TEST_PATHS=( tests/api-resources/content-scanning/content-scanning.test.ts tests/api-resources/content-scanning/payloads.test.ts tests/api-resources/content-scanning/settings.test.ts - tests/api-resources/abuse-reports.test.ts tests/api-resources/ai/ai.test.ts tests/api-resources/ai/finetunes/finetunes.test.ts tests/api-resources/ai/finetunes/assets.test.ts diff --git a/src/resources/abuse-reports.ts b/src/resources/abuse-reports.ts index 451e42c504..2a55a7e639 100644 --- a/src/resources/abuse-reports.ts +++ b/src/resources/abuse-reports.ts @@ -1,889 +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 AbuseReports extends APIResource { - /** - * Submit the Abuse Report of a particular type - */ - create( - reportType: string, - params: AbuseReportCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/abuse-reports/${reportType}`, { - body, - ...options, - }) as Core.APIPromise<{ result: AbuseReportCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -/** - * The result should be 'success' for successful response - */ -export type AbuseReportCreateResponse = string; - -export type AbuseReportCreateParams = - | AbuseReportCreateParams.AbuseReportsDmcaReport - | AbuseReportCreateParams.AbuseReportsTrademarkReport - | AbuseReportCreateParams.AbuseReportsGeneralReport - | AbuseReportCreateParams.AbuseReportsPhishingReport - | AbuseReportCreateParams.AbuseReportsCsamReport - | AbuseReportCreateParams.AbuseReportsThreatReport - | AbuseReportCreateParams.AbuseReportsRegistrarWhoisReport - | AbuseReportCreateParams.AbuseReportsNcseiReport; - -export declare namespace AbuseReportCreateParams { - export interface AbuseReportsDmcaReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: string; - - /** - * Body param: The abuse report type. - */ - act: 'abuse_dmca'; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - address1: string; - - /** - * Body param: The name of the copyright holder. Text not exceeding 60 characters. - * This field may be released by Cloudflare to third parties such as the Lumen - * Database (https://lumendatabase.org/). - */ - agent_name: string; - - /** - * Body param: Can be `0` for false or `1` for true. Must be value: 1 for DMCA - * reports - */ - agree: 1; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - city: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - country: string; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send'; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - original_work: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send'; - - /** - * Body param: Required for DMCA reports, should be same as Name. An affirmation - * that all information in the report is true and accurate while agreeing to the - * policies of Cloudflare's abuse reports - */ - signature: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - state: string; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsTrademarkReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: string; - - /** - * Body param: The abuse report type. - */ - act: 'abuse_trademark'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send'; - - /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters. - */ - justification: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send'; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_number: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_office: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_symbol: string; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsGeneralReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: string; - - /** - * Body param: The abuse report type. - */ - act: 'abuse_general'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon'; - - /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters. - */ - justification: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon' | 'none'; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: A list of IP addresses separated by ‘\n’ (new line character). The - * list of destination IPs should not exceed 30 IP addresses. Each one of the IP - * addresses ought to be unique. - */ - destination_ips?: string; - - /** - * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. - * The total size of the field should not exceed 2000 characters. Each individual - * port/protocol should not exceed 100 characters. The list should not have more - * than 30 unique ports and protocols. - */ - ports_protocols?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: A list of IP addresses separated by ‘\n’ (new line character). The - * list of source IPs should not exceed 30 IP addresses. Each one of the IP - * addresses ought to be unique. - */ - source_ips?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsPhishingReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: string; - - /** - * Body param: The abuse report type. - */ - act: 'abuse_phishing'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon'; - - /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters. - */ - justification: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon'; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - original_work?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsCsamReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: string; - - /** - * Body param: The abuse report type. - */ - act: 'abuse_children'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon'; - - /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters. - */ - justification: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - ncmec_notification: 'send' | 'send-anon'; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon' | 'none'; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - country?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsThreatReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: string; - - /** - * Body param: The abuse report type. - */ - act: 'abuse_threat'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon'; - - /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters. - */ - justification: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon'; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsRegistrarWhoisReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: string; - - /** - * Body param: The abuse report type. - */ - act: 'abuse_registrar_whois'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon' | 'none'; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsNcseiReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: string; - - /** - * Body param: The abuse report type. - */ - act: 'abuse_ncsei'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon'; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: If the submitter is the target of NCSEI in the URLs of the abuse - * report. - */ - ncsei_subject_representation: boolean; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon' | 'none'; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - country?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } -} - -export declare namespace AbuseReports { - export { - type AbuseReportCreateResponse as AbuseReportCreateResponse, - type AbuseReportCreateParams as AbuseReportCreateParams, - }; -} +export class AbuseReports extends APIResource {} diff --git a/tests/api-resources/abuse-reports.test.ts b/tests/api-resources/abuse-reports.test.ts deleted file mode 100644 index 77af5bcdfb..0000000000 --- a/tests/api-resources/abuse-reports.test.ts +++ /dev/null @@ -1,69 +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 abuseReports', () => { - // TODO: investigate unauthorized HTTP response - test.skip('create: only required params', async () => { - const responsePromise = client.abuseReports.create('report_type', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - 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(); - 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 unauthorized HTTP response - test.skip('create: required and optional params', async () => { - const response = await client.abuseReports.create('report_type', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - 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', - comments: 'x', - company: 'x', - reported_country: 'xx', - reported_user_agent: 'x', - tele: 'x', - title: 'x', - }); - }); -}); From 433c2388a2ac164b5baca920eed1d85dcdd75fa5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 20:15:37 +0000 Subject: [PATCH 234/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 895151b5b3..4ce8021964 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bcf05cc2684715bb6e8caf4a1807cdc5778b8df0155a672d51b29669a312b134.yml -openapi_spec_hash: 035b50ae08f7cae174a7be8be49e72cb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e20fcccb2c7124928aaf60f4688305b7d91fca68599cfbb226633179e8dcc865.yml +openapi_spec_hash: a0bc16359f563e9f98cd201213c848f9 config_hash: 293d685513e3b1277b3451ba4b08f40b From 87f35e48345e18168c1be564d19ca080929054ab Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 20:54:17 +0000 Subject: [PATCH 235/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4ce8021964..9d9c8647b7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e20fcccb2c7124928aaf60f4688305b7d91fca68599cfbb226633179e8dcc865.yml -openapi_spec_hash: a0bc16359f563e9f98cd201213c848f9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-41ab4c4cdb2b55c6fd326c40e3ed09ccec42bcefb17dd1ae30d126db551f7bec.yml +openapi_spec_hash: e67f9b890e30d8fbea7eef60f1017480 config_hash: 293d685513e3b1277b3451ba4b08f40b From ee2d2534eac939d3a1123f841c414f548fe5ce42 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 21:19:18 +0000 Subject: [PATCH 236/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9d9c8647b7..fc002d243d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-41ab4c4cdb2b55c6fd326c40e3ed09ccec42bcefb17dd1ae30d126db551f7bec.yml -openapi_spec_hash: e67f9b890e30d8fbea7eef60f1017480 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4f48db14026791c7c841159c05239ba083f7811e6112adc8a8b2f907320d053c.yml +openapi_spec_hash: ca9267354206f2b395aa7975403b152e config_hash: 293d685513e3b1277b3451ba4b08f40b From 6b3bdc93250d5eebb6580922ce84a99246141e7c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 22:38:48 +0000 Subject: [PATCH 237/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index fc002d243d..baf23c2c6a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4f48db14026791c7c841159c05239ba083f7811e6112adc8a8b2f907320d053c.yml -openapi_spec_hash: ca9267354206f2b395aa7975403b152e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0baec9a1578d1c100675ccb77206e79daa76a9e967566547e2d91fb83e5708c2.yml +openapi_spec_hash: 4b7e9f5c6a96719b2d4bcec8aa69d2a2 config_hash: 293d685513e3b1277b3451ba4b08f40b From 2b8ca1a085180a34c0c2116c497006fbff34111f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 23:16:22 +0000 Subject: [PATCH 238/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index baf23c2c6a..56bc1d01c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0baec9a1578d1c100675ccb77206e79daa76a9e967566547e2d91fb83e5708c2.yml -openapi_spec_hash: 4b7e9f5c6a96719b2d4bcec8aa69d2a2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-96b4c7ac7391a23db962163f21057358c6efc0ef031e16f4e60861dca8442375.yml +openapi_spec_hash: e9207739a6bf6758a01c72188ad62186 config_hash: 293d685513e3b1277b3451ba4b08f40b From fa45443b86be5af8d3cc06072d13e4aeb10e2ce4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 23:18:10 +0000 Subject: [PATCH 239/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 56bc1d01c4..44d1c8b504 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-96b4c7ac7391a23db962163f21057358c6efc0ef031e16f4e60861dca8442375.yml -openapi_spec_hash: e9207739a6bf6758a01c72188ad62186 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d7fcf13b2d8135bd5444b73216cb742b2639c086264d2fd666087bdfaa5c2b72.yml +openapi_spec_hash: f7c27372401e1fa44051f34d8a7a42fd config_hash: 293d685513e3b1277b3451ba4b08f40b From f03c4f71159da735a6b6c88164b1a4a1ca7578b5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 00:12:54 +0000 Subject: [PATCH 240/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 44d1c8b504..e04cbc3f5e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d7fcf13b2d8135bd5444b73216cb742b2639c086264d2fd666087bdfaa5c2b72.yml -openapi_spec_hash: f7c27372401e1fa44051f34d8a7a42fd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-75a894b4570a1aecaed91876df1f1b10393a1ea1f53a8bd5138d879bff8aedbe.yml +openapi_spec_hash: 93a16909757152f788fb230e3b581698 config_hash: 293d685513e3b1277b3451ba4b08f40b From cbc1767f2147f903df70f96f12082cb30a5dfd14 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 07:53:26 +0000 Subject: [PATCH 241/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e04cbc3f5e..2b0cacc12b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-75a894b4570a1aecaed91876df1f1b10393a1ea1f53a8bd5138d879bff8aedbe.yml -openapi_spec_hash: 93a16909757152f788fb230e3b581698 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-027533779e652f830792c6fd2e7472c6853ce7626ac71bd04943baf7ec2641b6.yml +openapi_spec_hash: ba25f256a3d62139816ee859eaf1109a config_hash: 293d685513e3b1277b3451ba4b08f40b From 7213ce73c347a3525bd4b1bb394afcdc65a80b61 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 10:06:23 +0000 Subject: [PATCH 242/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2b0cacc12b..744ef80faa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-027533779e652f830792c6fd2e7472c6853ce7626ac71bd04943baf7ec2641b6.yml -openapi_spec_hash: ba25f256a3d62139816ee859eaf1109a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-941bea4c6c90dacad0c8a029456777d483809864e30022429858d579621f0d4c.yml +openapi_spec_hash: 47ef17ecce7a91fa5ac34212dd0237ea config_hash: 293d685513e3b1277b3451ba4b08f40b From 0eec32023fbeedc0f4fd36d00fa6a192f3034297 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 10:07:55 +0000 Subject: [PATCH 243/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 744ef80faa..2b0cacc12b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-941bea4c6c90dacad0c8a029456777d483809864e30022429858d579621f0d4c.yml -openapi_spec_hash: 47ef17ecce7a91fa5ac34212dd0237ea +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-027533779e652f830792c6fd2e7472c6853ce7626ac71bd04943baf7ec2641b6.yml +openapi_spec_hash: ba25f256a3d62139816ee859eaf1109a config_hash: 293d685513e3b1277b3451ba4b08f40b From e90be44467ff68f1bb397495bc4cc9c51531dbb6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 10:52:55 +0000 Subject: [PATCH 244/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2b0cacc12b..72eb986318 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-027533779e652f830792c6fd2e7472c6853ce7626ac71bd04943baf7ec2641b6.yml -openapi_spec_hash: ba25f256a3d62139816ee859eaf1109a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cafc8addffe217c965e9d46ade304107864e31ab6b12aff0c3cef18590a04adc.yml +openapi_spec_hash: 652c156fe314c2c24477983e403b6235 config_hash: 293d685513e3b1277b3451ba4b08f40b From 821be0bb1baeaaf168feb48477755a3e017dc341 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 11:10:03 +0000 Subject: [PATCH 245/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 72eb986318..b9b1230848 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cafc8addffe217c965e9d46ade304107864e31ab6b12aff0c3cef18590a04adc.yml -openapi_spec_hash: 652c156fe314c2c24477983e403b6235 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d09ec6a5f73439ef12c41d04216b9addadb2bc6cbf54af04bef930210aafc61a.yml +openapi_spec_hash: 2b20e7e8d51ca5b9625dbdc4d3d6f465 config_hash: 293d685513e3b1277b3451ba4b08f40b From 6c4ab69a3b55a43e8e9ff71e69fc23eee10e475a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 13:10:52 +0000 Subject: [PATCH 246/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b9b1230848..1aa1c21f39 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d09ec6a5f73439ef12c41d04216b9addadb2bc6cbf54af04bef930210aafc61a.yml -openapi_spec_hash: 2b20e7e8d51ca5b9625dbdc4d3d6f465 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9037c373a1127108f3a24d44c7291e56ad5c1bd4046b211a3309292713ae4c32.yml +openapi_spec_hash: e8975fcc08bfe6c1bbfbd826d69ef0f6 config_hash: 293d685513e3b1277b3451ba4b08f40b From c37e1794eb6d2ac0a3343055418104c3cd3d4a4c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 14:02:49 +0000 Subject: [PATCH 247/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1aa1c21f39..d75b9f7615 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9037c373a1127108f3a24d44c7291e56ad5c1bd4046b211a3309292713ae4c32.yml -openapi_spec_hash: e8975fcc08bfe6c1bbfbd826d69ef0f6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dc7fc72f3b36e87d578697421b0df3f19d5dd9cb151b7a0195e9d15b0bb25366.yml +openapi_spec_hash: 9956414676aabbfff47392ad28ea67de config_hash: 293d685513e3b1277b3451ba4b08f40b From b18be036d5d5f7274b7ddbccd1b7931f3ea34cfb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 14:04:45 +0000 Subject: [PATCH 248/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d75b9f7615..1aa1c21f39 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dc7fc72f3b36e87d578697421b0df3f19d5dd9cb151b7a0195e9d15b0bb25366.yml -openapi_spec_hash: 9956414676aabbfff47392ad28ea67de +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9037c373a1127108f3a24d44c7291e56ad5c1bd4046b211a3309292713ae4c32.yml +openapi_spec_hash: e8975fcc08bfe6c1bbfbd826d69ef0f6 config_hash: 293d685513e3b1277b3451ba4b08f40b From 4e3515dc9f87f17a5ff47817a7458e31bb6793cb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 14:13:48 +0000 Subject: [PATCH 249/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1aa1c21f39..d75b9f7615 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9037c373a1127108f3a24d44c7291e56ad5c1bd4046b211a3309292713ae4c32.yml -openapi_spec_hash: e8975fcc08bfe6c1bbfbd826d69ef0f6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dc7fc72f3b36e87d578697421b0df3f19d5dd9cb151b7a0195e9d15b0bb25366.yml +openapi_spec_hash: 9956414676aabbfff47392ad28ea67de config_hash: 293d685513e3b1277b3451ba4b08f40b From 8848fdf124d913423e4b9534b711fa5b55ecb134 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 14:15:44 +0000 Subject: [PATCH 250/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d75b9f7615..2612c6e0ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dc7fc72f3b36e87d578697421b0df3f19d5dd9cb151b7a0195e9d15b0bb25366.yml -openapi_spec_hash: 9956414676aabbfff47392ad28ea67de +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-20d52b69c06cacb644f829f0761271509b9bdb4080326c33e861751f0b109e05.yml +openapi_spec_hash: ee1c8673654184f2cd4b3903cb840c71 config_hash: 293d685513e3b1277b3451ba4b08f40b From db7f586ec013134abc1aa10ac3dc1bc0832368ee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 15:42:14 +0000 Subject: [PATCH 251/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2612c6e0ef..b737bf4fd3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-20d52b69c06cacb644f829f0761271509b9bdb4080326c33e861751f0b109e05.yml -openapi_spec_hash: ee1c8673654184f2cd4b3903cb840c71 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6d628d0eb2a7645d5b27041adaabd8511a016a0bf5d46b23cf0659c0847a1ec6.yml +openapi_spec_hash: 145754261ed44b20f190ea07328a11fa config_hash: 293d685513e3b1277b3451ba4b08f40b From 9bee6ad5863a37a6516606db00029fc83d5a8023 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 15:52:27 +0000 Subject: [PATCH 252/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b737bf4fd3..2a8fca92c2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6d628d0eb2a7645d5b27041adaabd8511a016a0bf5d46b23cf0659c0847a1ec6.yml -openapi_spec_hash: 145754261ed44b20f190ea07328a11fa +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e45bbbba0387aa0a1ecca9e505f2732480d64fc3018a288b2d0a08c99168be54.yml +openapi_spec_hash: 4bfc64ea1baa4af0abae5ff5e9155828 config_hash: 293d685513e3b1277b3451ba4b08f40b From af77bafb9ed83802f3f969296371a478ce5cff4d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 16:03:50 +0000 Subject: [PATCH 253/451] chore(api): update composite API spec --- .stats.yml | 4 ++-- src/resources/secrets-store/stores/secrets.ts | 4 ++-- .../secrets-store/stores/secrets.test.ts | 18 ++++++++++++------ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2a8fca92c2..9049526844 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e45bbbba0387aa0a1ecca9e505f2732480d64fc3018a288b2d0a08c99168be54.yml -openapi_spec_hash: 4bfc64ea1baa4af0abae5ff5e9155828 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0bd49b087c0a9a5f60ab5ae5a919979dc96b2b2936fd611f727a71586554d9bd.yml +openapi_spec_hash: 751a4f438f001801b1f13f8f24fcb05d config_hash: 293d685513e3b1277b3451ba4b08f40b diff --git a/src/resources/secrets-store/stores/secrets.ts b/src/resources/secrets-store/stores/secrets.ts index 1ab72e50dc..ec0ca694ed 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', 'ai_gateway'], + * scopes: ['workers', 'ai_gateway', 'dex', 'access'], * value: 'api-token-secret-123', * }, * ], @@ -135,7 +135,7 @@ export class Secrets extends APIResource { * { * account_id: '985e105f4ecef8ad9ca31a8372d0c353', * name: 'MY_API_KEY', - * scopes: ['workers', 'ai_gateway'], + * scopes: ['workers', 'ai_gateway', 'dex', 'access'], * }, * ); * ``` diff --git a/tests/api-resources/secrets-store/stores/secrets.test.ts b/tests/api-resources/secrets-store/stores/secrets.test.ts index afb8337e61..51d39096f9 100644 --- a/tests/api-resources/secrets-store/stores/secrets.test.ts +++ b/tests/api-resources/secrets-store/stores/secrets.test.ts @@ -13,7 +13,13 @@ 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', 'ai_gateway'], value: 'api-token-secret-123' }], + body: [ + { + name: 'MY_API_KEY', + scopes: ['workers', 'ai_gateway', 'dex', 'access'], + value: 'api-token-secret-123', + }, + ], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -30,7 +36,7 @@ describe('resource secrets', () => { body: [ { name: 'MY_API_KEY', - scopes: ['workers', 'ai_gateway'], + scopes: ['workers', 'ai_gateway', 'dex', 'access'], value: 'api-token-secret-123', comment: 'info about my secret', }, @@ -60,7 +66,7 @@ describe('resource secrets', () => { order: 'name', page: 2, per_page: 20, - scopes: [['workers', 'ai_gateway']], + scopes: [['workers', 'ai_gateway', 'dex', 'access']], search: 'search', }); }); @@ -116,7 +122,7 @@ describe('resource secrets', () => { { account_id: '985e105f4ecef8ad9ca31a8372d0c353', name: 'MY_API_KEY', - scopes: ['workers', 'ai_gateway'], + scopes: ['workers', 'ai_gateway', 'dex', 'access'], }, ); const rawResponse = await responsePromise.asResponse(); @@ -136,7 +142,7 @@ describe('resource secrets', () => { { account_id: '985e105f4ecef8ad9ca31a8372d0c353', name: 'MY_API_KEY', - scopes: ['workers', 'ai_gateway'], + scopes: ['workers', 'ai_gateway', 'dex', 'access'], comment: 'info about my secret', }, ); @@ -166,7 +172,7 @@ describe('resource secrets', () => { { account_id: '985e105f4ecef8ad9ca31a8372d0c353', comment: 'info about my secret', - scopes: ['workers', 'ai_gateway'], + scopes: ['workers', 'ai_gateway', 'dex', 'access'], }, ); }); From 3206f83d2a3bb43bb796b6d5073e4511e1a95e51 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 16:21:28 +0000 Subject: [PATCH 254/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9049526844..f2a7d547d3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0bd49b087c0a9a5f60ab5ae5a919979dc96b2b2936fd611f727a71586554d9bd.yml -openapi_spec_hash: 751a4f438f001801b1f13f8f24fcb05d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b6b7764b00007be8fb435448eabadbd4363a3a450326a030da67766e5311f635.yml +openapi_spec_hash: 156621a1c8373ef6f849d82d56eb53f1 config_hash: 293d685513e3b1277b3451ba4b08f40b From 1254e1d94fe6f63282886571b45ba1b52a581371 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 16:26:00 +0000 Subject: [PATCH 255/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f2a7d547d3..37f92a0f3c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b6b7764b00007be8fb435448eabadbd4363a3a450326a030da67766e5311f635.yml -openapi_spec_hash: 156621a1c8373ef6f849d82d56eb53f1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a21c3ed5d4e84221afb9012c2f5b21bddf0cc06a8b36ad5d7fc5ba057504dffc.yml +openapi_spec_hash: 17cd440830319fce217f83d59d58ab5a config_hash: 293d685513e3b1277b3451ba4b08f40b From 9ec56096cae377302f8ef1c150d05d7f249e6de5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 16:35:01 +0000 Subject: [PATCH 256/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 37f92a0f3c..8ac0e867b4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a21c3ed5d4e84221afb9012c2f5b21bddf0cc06a8b36ad5d7fc5ba057504dffc.yml -openapi_spec_hash: 17cd440830319fce217f83d59d58ab5a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-37c6809dc4517cb678ed968ebd6e8eceb6d4d640156c8b8432c88b555ff842f8.yml +openapi_spec_hash: 055ea3c326d22bbd9199e61ad980ce9c config_hash: 293d685513e3b1277b3451ba4b08f40b From 334e1f420a979b15c39cf7aac4b6fde914d9c6a2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 16:37:01 +0000 Subject: [PATCH 257/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8ac0e867b4..c8ab97fc58 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-37c6809dc4517cb678ed968ebd6e8eceb6d4d640156c8b8432c88b555ff842f8.yml -openapi_spec_hash: 055ea3c326d22bbd9199e61ad980ce9c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3ee25516d9299955221a0c7a5bef9b189c7b5a1559672f216eaa3133589f3275.yml +openapi_spec_hash: ee032299d5a7c7f2ceb241dbcb664df9 config_hash: 293d685513e3b1277b3451ba4b08f40b From 22f868b162bd733b40adfbcd6acf91b7d2289c13 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 17:11:48 +0000 Subject: [PATCH 258/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index c8ab97fc58..651bac4ae6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3ee25516d9299955221a0c7a5bef9b189c7b5a1559672f216eaa3133589f3275.yml -openapi_spec_hash: ee032299d5a7c7f2ceb241dbcb664df9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-919ccfa08989a9092249a6664e9a550802a50827344c0ced84fc34f2b9928921.yml +openapi_spec_hash: 1c2d7becb34970dc219b49e184bd38e1 config_hash: 293d685513e3b1277b3451ba4b08f40b From 6938ad1f96acfe4a615b3df908987a35bd8a3b87 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 17:31:10 +0000 Subject: [PATCH 259/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 651bac4ae6..918663e2c7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-919ccfa08989a9092249a6664e9a550802a50827344c0ced84fc34f2b9928921.yml -openapi_spec_hash: 1c2d7becb34970dc219b49e184bd38e1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3b32f3988e7d95828d60a327a673cf877b07455ce821293c86f77ab3f88cb12d.yml +openapi_spec_hash: 9b96571d9a058dca4b3150181e9db01f config_hash: 293d685513e3b1277b3451ba4b08f40b From ff4c011ed7b550d96ab4f47997a761ed4cffb119 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 17:40:58 +0000 Subject: [PATCH 260/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 918663e2c7..9893781aa6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3b32f3988e7d95828d60a327a673cf877b07455ce821293c86f77ab3f88cb12d.yml -openapi_spec_hash: 9b96571d9a058dca4b3150181e9db01f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fa078e98d33794f32c77256479dceb7d6b9e0ad95da89fa01474b2c1731cad3d.yml +openapi_spec_hash: eb25624c59f39858b740347f8f092a1d config_hash: 293d685513e3b1277b3451ba4b08f40b From 350b6b07e0922d194ca618deed8c2e987eec2401 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:07:54 +0000 Subject: [PATCH 261/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9893781aa6..2a966e82bf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fa078e98d33794f32c77256479dceb7d6b9e0ad95da89fa01474b2c1731cad3d.yml -openapi_spec_hash: eb25624c59f39858b740347f8f092a1d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4b7eec058037c55a6fe62e3f6b2261a779500f299223066e5c8bb37d392f9793.yml +openapi_spec_hash: 52dc45d64010662a8c788efeabc943c4 config_hash: 293d685513e3b1277b3451ba4b08f40b From 0a8cdc6a0d552eac7f92dfae58421c97971eabcc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:09:49 +0000 Subject: [PATCH 262/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2a966e82bf..4ba6c8a22a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4b7eec058037c55a6fe62e3f6b2261a779500f299223066e5c8bb37d392f9793.yml -openapi_spec_hash: 52dc45d64010662a8c788efeabc943c4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d01aafe2d4acc5cbd61a43d3af66cec9ee127bd803a1b54177a40c2535925866.yml +openapi_spec_hash: 876ff3f2cd2dfa0d4b511a517f969887 config_hash: 293d685513e3b1277b3451ba4b08f40b From 6a3c2fca3b2c501fc9790f16fb4739219b2ee89c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:11:46 +0000 Subject: [PATCH 263/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4ba6c8a22a..9c52f79cc6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d01aafe2d4acc5cbd61a43d3af66cec9ee127bd803a1b54177a40c2535925866.yml -openapi_spec_hash: 876ff3f2cd2dfa0d4b511a517f969887 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-33acd1b2a379ab69a0b618e91e3f73d70bdfa6fb7cbcd397df07acf5986aa15b.yml +openapi_spec_hash: 9dfd113d7a4f3d0d3cce31f8d65baeae config_hash: 293d685513e3b1277b3451ba4b08f40b From 33e64dbca47f6b2c53777a30a48e84c4e898c346 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:13:39 +0000 Subject: [PATCH 264/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9c52f79cc6..6bf012c5ee 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-33acd1b2a379ab69a0b618e91e3f73d70bdfa6fb7cbcd397df07acf5986aa15b.yml -openapi_spec_hash: 9dfd113d7a4f3d0d3cce31f8d65baeae +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3b3c68867553c28f2a6ea3aff7d4710765fe6bed7322cd59872eb7de4eb4da9e.yml +openapi_spec_hash: 94318447507cb9aaf2970c98d1470b1a config_hash: 293d685513e3b1277b3451ba4b08f40b From 532e5c00a06b382c1c7d685eb616d415930470fc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:42:53 +0000 Subject: [PATCH 265/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6bf012c5ee..f281ef4e2d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3b3c68867553c28f2a6ea3aff7d4710765fe6bed7322cd59872eb7de4eb4da9e.yml -openapi_spec_hash: 94318447507cb9aaf2970c98d1470b1a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9052fa652f238143ad16a557556749458c5e5447e85fc4b32ff8f96828f80207.yml +openapi_spec_hash: 7f2d96a3a1a201c89d256c4ccce163d6 config_hash: 293d685513e3b1277b3451ba4b08f40b From 3e0cfa1c32cd9ad1a7351c88e1bc6553e7dea493 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:44:45 +0000 Subject: [PATCH 266/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f281ef4e2d..568f98d906 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9052fa652f238143ad16a557556749458c5e5447e85fc4b32ff8f96828f80207.yml -openapi_spec_hash: 7f2d96a3a1a201c89d256c4ccce163d6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bcbfca578e28454a7cbd7de094fab65c71b1982e34918ae8ed800b7ffe8d2093.yml +openapi_spec_hash: 7325cef481f7cf51794c748b2aef7cde config_hash: 293d685513e3b1277b3451ba4b08f40b From 72efce04c7ceae3a2844bb78ad43ab15c0687120 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 19:01:49 +0000 Subject: [PATCH 267/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 568f98d906..64bc036e2f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bcbfca578e28454a7cbd7de094fab65c71b1982e34918ae8ed800b7ffe8d2093.yml -openapi_spec_hash: 7325cef481f7cf51794c748b2aef7cde +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cff97c8e62487cb083f5b359a29a8a6bd8cf680941e11bf08f639795d590fa54.yml +openapi_spec_hash: 51acec175538133da54f722c4f2a835f config_hash: 293d685513e3b1277b3451ba4b08f40b From fe193451e9becd12cdb934c3a5f97f07c52a493c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 19:15:52 +0000 Subject: [PATCH 268/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 64bc036e2f..9893781aa6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cff97c8e62487cb083f5b359a29a8a6bd8cf680941e11bf08f639795d590fa54.yml -openapi_spec_hash: 51acec175538133da54f722c4f2a835f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fa078e98d33794f32c77256479dceb7d6b9e0ad95da89fa01474b2c1731cad3d.yml +openapi_spec_hash: eb25624c59f39858b740347f8f092a1d config_hash: 293d685513e3b1277b3451ba4b08f40b From dd447c75a9ceca80f10ede613723b26aff88dedf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Oct 2025 14:14:17 +0000 Subject: [PATCH 269/451] feat: feat(api): add mcp portals endpoints --- .stats.yml | 2 +- api.md | 4 ++++ src/resources/zero-trust/access/access.ts | 6 ++++++ src/resources/zero-trust/access/ai-controls.ts | 3 +++ .../zero-trust/access/ai-controls/ai-controls.ts | 15 +++++++++++++++ .../zero-trust/access/ai-controls/index.ts | 4 ++++ .../zero-trust/access/ai-controls/mcp.ts | 5 +++++ src/resources/zero-trust/access/index.ts | 1 + 8 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/resources/zero-trust/access/ai-controls.ts create mode 100644 src/resources/zero-trust/access/ai-controls/ai-controls.ts create mode 100644 src/resources/zero-trust/access/ai-controls/index.ts create mode 100644 src/resources/zero-trust/access/ai-controls/mcp.ts diff --git a/.stats.yml b/.stats.yml index 9893781aa6..73b64d55b4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1827 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fa078e98d33794f32c77256479dceb7d6b9e0ad95da89fa01474b2c1731cad3d.yml openapi_spec_hash: eb25624c59f39858b740347f8f092a1d -config_hash: 293d685513e3b1277b3451ba4b08f40b +config_hash: 60a39444e2cbcf922682f07f51b97d08 diff --git a/api.md b/api.md index 3f016137e7..37dbbed73f 100644 --- a/api.md +++ b/api.md @@ -5046,6 +5046,10 @@ Methods: ## Access +### AIControls + +#### Mcp + ### GatewayCA Types: diff --git a/src/resources/zero-trust/access/access.ts b/src/resources/zero-trust/access/access.ts index fea6040f8d..08650da4b6 100644 --- a/src/resources/zero-trust/access/access.ts +++ b/src/resources/zero-trust/access/access.ts @@ -107,6 +107,8 @@ import { Tags, TagsV4PagePaginationArray, } from './tags'; +import * as AIControlsAPI from './ai-controls/ai-controls'; +import { AIControls } from './ai-controls/ai-controls'; import * as ApplicationsAPI from './applications/applications'; import { AllowedHeaders, @@ -170,6 +172,7 @@ import { } from './users/users'; export class Access extends APIResource { + aiControls: AIControlsAPI.AIControls = new AIControlsAPI.AIControls(this._client); gatewayCA: GatewayCAAPI.GatewayCA = new GatewayCAAPI.GatewayCA(this._client); infrastructure: InfrastructureAPI.Infrastructure = new InfrastructureAPI.Infrastructure(this._client); applications: ApplicationsAPI.Applications = new ApplicationsAPI.Applications(this._client); @@ -185,6 +188,7 @@ export class Access extends APIResource { policies: PoliciesAPI.Policies = new PoliciesAPI.Policies(this._client); } +Access.AIControls = AIControls; Access.GatewayCA = GatewayCA; Access.GatewayCAListResponsesSinglePage = GatewayCAListResponsesSinglePage; Access.Infrastructure = Infrastructure; @@ -210,6 +214,8 @@ Access.Policies = Policies; Access.PolicyListResponsesV4PagePaginationArray = PolicyListResponsesV4PagePaginationArray; export declare namespace Access { + export { AIControls as AIControls }; + export { GatewayCA as GatewayCA, type GatewayCACreateResponse as GatewayCACreateResponse, diff --git a/src/resources/zero-trust/access/ai-controls.ts b/src/resources/zero-trust/access/ai-controls.ts new file mode 100644 index 0000000000..6d006ad121 --- /dev/null +++ b/src/resources/zero-trust/access/ai-controls.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './ai-controls/index'; diff --git a/src/resources/zero-trust/access/ai-controls/ai-controls.ts b/src/resources/zero-trust/access/ai-controls/ai-controls.ts new file mode 100644 index 0000000000..dd9844fcbf --- /dev/null +++ b/src/resources/zero-trust/access/ai-controls/ai-controls.ts @@ -0,0 +1,15 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../../resource'; +import * as McpAPI from './mcp'; +import { Mcp } from './mcp'; + +export class AIControls extends APIResource { + mcp: McpAPI.Mcp = new McpAPI.Mcp(this._client); +} + +AIControls.Mcp = Mcp; + +export declare namespace AIControls { + export { Mcp as Mcp }; +} diff --git a/src/resources/zero-trust/access/ai-controls/index.ts b/src/resources/zero-trust/access/ai-controls/index.ts new file mode 100644 index 0000000000..5bad382638 --- /dev/null +++ b/src/resources/zero-trust/access/ai-controls/index.ts @@ -0,0 +1,4 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { AIControls } from './ai-controls'; +export { Mcp } from './mcp'; diff --git a/src/resources/zero-trust/access/ai-controls/mcp.ts b/src/resources/zero-trust/access/ai-controls/mcp.ts new file mode 100644 index 0000000000..a3bb939383 --- /dev/null +++ b/src/resources/zero-trust/access/ai-controls/mcp.ts @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../../resource'; + +export class Mcp extends APIResource {} diff --git a/src/resources/zero-trust/access/index.ts b/src/resources/zero-trust/access/index.ts index 52ccef53ba..4255d6af29 100644 --- a/src/resources/zero-trust/access/index.ts +++ b/src/resources/zero-trust/access/index.ts @@ -1,5 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +export { AIControls } from './ai-controls/index'; export { Access } from './access'; export { AccessUsersV4PagePaginationArray, From 59c3fa82a30a74e24e0c95515fca67ba06d5cd14 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Oct 2025 16:03:25 +0000 Subject: [PATCH 270/451] feat: feat(radar): add new group by dimension endpoints; deprecate to_markdown endpoint --- .stats.yml | 4 +- api.md | 88 +++ scripts/detect-breaking-changes | 1 + src/resources/radar/ai/ai.ts | 36 +- src/resources/radar/ai/bots/bots.ts | 672 ++++++++++++++++ src/resources/radar/ai/bots/index.ts | 10 +- src/resources/radar/ai/index.ts | 18 +- src/resources/radar/ai/inference/index.ts | 8 +- src/resources/radar/ai/inference/inference.ts | 417 ++++++++++ src/resources/radar/ai/timeseries-groups.ts | 22 +- src/resources/radar/ai/to-markdown.ts | 11 +- src/resources/radar/as112/as112.ts | 642 ++++++++++++++- src/resources/radar/as112/index.ts | 10 +- src/resources/radar/attacks/attacks.ts | 28 +- src/resources/radar/attacks/index.ts | 20 +- src/resources/radar/attacks/layer3/index.ts | 10 +- src/resources/radar/attacks/layer3/layer3.ts | 426 ++++++++++ src/resources/radar/attacks/layer7/index.ts | 10 +- src/resources/radar/attacks/layer7/layer7.ts | 604 ++++++++++++++ src/resources/radar/dns/dns.ts | 739 +++++++++++++++++- src/resources/radar/dns/index.ts | 10 +- src/resources/radar/email/email.ts | 32 +- src/resources/radar/email/index.ts | 16 +- src/resources/radar/email/routing/index.ts | 8 +- src/resources/radar/email/routing/routing.ts | 429 ++++++++++ src/resources/radar/email/security/index.ts | 8 +- .../radar/email/security/security.ts | 472 +++++++++++ src/resources/radar/geolocations.ts | 263 +++++++ src/resources/radar/http/http.ts | 561 +++++++++++++ src/resources/radar/http/index.ts | 10 +- src/resources/radar/index.ts | 49 +- .../radar/leaked-credentials/index.ts | 8 +- .../leaked-credentials/leaked-credentials.ts | 452 +++++++++++ src/resources/radar/netflows/index.ts | 4 + src/resources/radar/netflows/netflows.ts | 436 +++++++++++ src/resources/radar/radar.ts | 84 +- .../api-resources/radar/ai/bots/bots.test.ts | 141 ++++ .../radar/ai/inference/inference.test.ts | 92 +++ tests/api-resources/radar/as112/as112.test.ts | 83 ++ .../radar/attacks/layer3/layer3.test.ts | 84 ++ .../radar/attacks/layer7/layer7.test.ts | 88 +++ tests/api-resources/radar/dns/dns.test.ts | 89 +++ .../radar/email/routing/routing.test.ts | 97 +++ .../radar/email/security/security.test.ts | 95 +++ .../api-resources/radar/geolocations.test.ts | 65 ++ tests/api-resources/radar/http/http.test.ts | 96 +++ .../leaked-credentials.test.ts | 97 +++ .../radar/netflows/netflows.test.ts | 84 ++ 48 files changed, 7653 insertions(+), 76 deletions(-) create mode 100644 src/resources/radar/geolocations.ts create mode 100644 tests/api-resources/radar/ai/bots/bots.test.ts create mode 100644 tests/api-resources/radar/ai/inference/inference.test.ts create mode 100644 tests/api-resources/radar/email/routing/routing.test.ts create mode 100644 tests/api-resources/radar/email/security/security.test.ts create mode 100644 tests/api-resources/radar/geolocations.test.ts create mode 100644 tests/api-resources/radar/leaked-credentials/leaked-credentials.test.ts diff --git a/.stats.yml b/.stats.yml index 73b64d55b4..e570c08995 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1827 +configured_endpoints: 1849 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fa078e98d33794f32c77256479dceb7d6b9e0ad95da89fa01474b2c1731cad3d.yml openapi_spec_hash: eb25624c59f39858b740347f8f092a1d -config_hash: 60a39444e2cbcf922682f07f51b97d08 +config_hash: eab23d0b8fa818f1d1dc0e9e18de4266 diff --git a/api.md b/api.md index 37dbbed73f..509663d6f6 100644 --- a/api.md +++ b/api.md @@ -6456,6 +6456,16 @@ Methods: ### Inference +Types: + +- InferenceSummaryV2Response +- InferenceTimeseriesGroupsV2Response + +Methods: + +- client.radar.ai.inference.summaryV2(dimension, { ...params }) -> InferenceSummaryV2Response +- client.radar.ai.inference.timeseriesGroupsV2(dimension, { ...params }) -> InferenceTimeseriesGroupsV2Response + #### Summary Types: @@ -6484,6 +6494,18 @@ Methods: ### Bots +Types: + +- BotSummaryV2Response +- BotTimeseriesResponse +- BotTimeseriesGroupsResponse + +Methods: + +- client.radar.ai.bots.summaryV2(dimension, { ...params }) -> BotSummaryV2Response +- client.radar.ai.bots.timeseries({ ...params }) -> BotTimeseriesResponse +- client.radar.ai.bots.timeseriesGroups(dimension, { ...params }) -> BotTimeseriesGroupsResponse + #### Summary Types: @@ -6702,11 +6724,15 @@ Methods: Types: +- DNSSummaryV2Response - DNSTimeseriesResponse +- DNSTimeseriesGroupsV2Response Methods: +- client.radar.dns.summaryV2(dimension, { ...params }) -> DNSSummaryV2Response - client.radar.dns.timeseries({ ...params }) -> DNSTimeseriesResponse +- client.radar.dns.timeseriesGroupsV2(dimension, { ...params }) -> DNSTimeseriesGroupsV2Response ### Top @@ -6781,12 +6807,16 @@ Methods: Types: - NetflowSummaryResponse +- NetflowSummaryV2Response - NetflowTimeseriesResponse +- NetflowTimeseriesGroupsResponse Methods: - client.radar.netflows.summary({ ...params }) -> NetflowSummaryResponse +- client.radar.netflows.summaryV2(dimension, { ...params }) -> NetflowSummaryV2Response - client.radar.netflows.timeseries({ ...params }) -> NetflowTimeseriesResponse +- client.radar.netflows.timeseriesGroups(dimension, { ...params }) -> NetflowTimeseriesGroupsResponse ### Top @@ -6828,11 +6858,15 @@ Methods: Types: +- AS112SummaryV2Response - AS112TimeseriesResponse +- AS112TimeseriesGroupsV2Response Methods: +- client.radar.as112.summaryV2(dimension, { ...params }) -> AS112SummaryV2Response - client.radar.as112.timeseries({ ...params }) -> AS112TimeseriesResponse +- client.radar.as112.timeseriesGroupsV2(dimension, { ...params }) -> AS112TimeseriesGroupsV2Response ### Summary @@ -6899,6 +6933,16 @@ Types: ### Routing +Types: + +- RoutingSummaryV2Response +- RoutingTimeseriesGroupsV2Response + +Methods: + +- client.radar.email.routing.summaryV2(dimension, { ...params }) -> RoutingSummaryV2Response +- client.radar.email.routing.timeseriesGroupsV2(dimension, { ...params }) -> RoutingTimeseriesGroupsV2Response + #### Summary Types: @@ -6941,6 +6985,16 @@ Methods: ### Security +Types: + +- SecuritySummaryV2Response +- SecurityTimeseriesGroupsV2Response + +Methods: + +- client.radar.email.security.summaryV2(dimension, { ...params }) -> SecuritySummaryV2Response +- client.radar.email.security.timeseriesGroupsV2(dimension, { ...params }) -> SecurityTimeseriesGroupsV2Response + #### Top ##### Tlds @@ -7041,11 +7095,15 @@ Methods: Types: +- Layer3SummaryV2Response - Layer3TimeseriesResponse +- Layer3TimeseriesGroupsV2Response Methods: +- client.radar.attacks.layer3.summaryV2(dimension, { ...params }) -> Layer3SummaryV2Response - client.radar.attacks.layer3.timeseries({ ...params }) -> Layer3TimeseriesResponse +- client.radar.attacks.layer3.timeseriesGroupsV2(dimension, { ...params }) -> Layer3TimeseriesGroupsV2Response #### Summary @@ -7121,11 +7179,15 @@ Methods: Types: +- Layer7SummaryV2Response - Layer7TimeseriesResponse +- Layer7TimeseriesGroupsV2Response Methods: +- client.radar.attacks.layer7.summaryV2(dimension, { ...params }) -> Layer7SummaryV2Response - client.radar.attacks.layer7.timeseries({ ...params }) -> Layer7TimeseriesResponse +- client.radar.attacks.layer7.timeseriesGroupsV2(dimension, { ...params }) -> Layer7TimeseriesGroupsV2Response #### Summary @@ -7247,15 +7309,31 @@ Methods: - client.radar.entities.locations.list({ ...params }) -> LocationListResponse - client.radar.entities.locations.get(location, { ...params }) -> LocationGetResponse +## Geolocations + +Types: + +- GeolocationListResponse +- GeolocationGetResponse + +Methods: + +- client.radar.geolocations.list({ ...params }) -> GeolocationListResponse +- client.radar.geolocations.get(geoId, { ...params }) -> GeolocationGetResponse + ## HTTP Types: +- HTTPSummaryV2Response - HTTPTimeseriesResponse +- HTTPTimeseriesGroupsV2Response Methods: +- client.radar.http.summaryV2(dimension, { ...params }) -> HTTPSummaryV2Response - client.radar.http.timeseries({ ...params }) -> HTTPTimeseriesResponse +- client.radar.http.timeseriesGroupsV2(dimension, { ...params }) -> HTTPTimeseriesGroupsV2Response ### Locations @@ -7631,6 +7709,16 @@ Methods: ## LeakedCredentials +Types: + +- LeakedCredentialSummaryV2Response +- LeakedCredentialTimeseriesGroupsV2Response + +Methods: + +- client.radar.leakedCredentials.summaryV2(dimension, { ...params }) -> LeakedCredentialSummaryV2Response +- client.radar.leakedCredentials.timeseriesGroupsV2(dimension, { ...params }) -> LeakedCredentialTimeseriesGroupsV2Response + ### Summary Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index ff1cfdb2d4..c83d486858 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -609,6 +609,7 @@ TEST_PATHS=( tests/api-resources/radar/entities/entities.test.ts tests/api-resources/radar/entities/asns.test.ts tests/api-resources/radar/entities/locations.test.ts + tests/api-resources/radar/geolocations.test.ts tests/api-resources/radar/http/http.test.ts tests/api-resources/radar/http/locations/locations.test.ts tests/api-resources/radar/http/locations/bot-class.test.ts diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index c4830c1214..b9f3118f5f 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -21,9 +21,23 @@ import { ToMarkdownCreateResponsesSinglePage, } from './to-markdown'; import * as BotsAPI from './bots/bots'; -import { Bots } from './bots/bots'; +import { + BotSummaryV2Params, + BotSummaryV2Response, + BotTimeseriesGroupsParams, + BotTimeseriesGroupsResponse, + BotTimeseriesParams, + BotTimeseriesResponse, + Bots, +} from './bots/bots'; import * as InferenceAPI from './inference/inference'; -import { Inference } from './inference/inference'; +import { + Inference, + InferenceSummaryV2Params, + InferenceSummaryV2Response, + InferenceTimeseriesGroupsV2Params, + InferenceTimeseriesGroupsV2Response, +} from './inference/inference'; export class AI extends APIResource { toMarkdown: ToMarkdownAPI.ToMarkdown = new ToMarkdownAPI.ToMarkdown(this._client); @@ -48,9 +62,23 @@ export declare namespace AI { type ToMarkdownCreateParams as ToMarkdownCreateParams, }; - export { Inference as Inference }; + export { + Inference as Inference, + type InferenceSummaryV2Response as InferenceSummaryV2Response, + type InferenceTimeseriesGroupsV2Response as InferenceTimeseriesGroupsV2Response, + type InferenceSummaryV2Params as InferenceSummaryV2Params, + type InferenceTimeseriesGroupsV2Params as InferenceTimeseriesGroupsV2Params, + }; - export { Bots as Bots }; + export { + Bots as Bots, + type BotSummaryV2Response as BotSummaryV2Response, + type BotTimeseriesResponse as BotTimeseriesResponse, + type BotTimeseriesGroupsResponse as BotTimeseriesGroupsResponse, + type BotSummaryV2Params as BotSummaryV2Params, + type BotTimeseriesParams as BotTimeseriesParams, + type BotTimeseriesGroupsParams as BotTimeseriesGroupsParams, + }; export { TimeseriesGroups as TimeseriesGroups, diff --git a/src/resources/radar/ai/bots/bots.ts b/src/resources/radar/ai/bots/bots.ts index 865665cba6..6529350fe7 100644 --- a/src/resources/radar/ai/bots/bots.ts +++ b/src/resources/radar/ai/bots/bots.ts @@ -1,16 +1,688 @@ // 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 SummaryAPI from './summary'; import { Summary, SummaryUserAgentParams, SummaryUserAgentResponse } from './summary'; export class Bots extends APIResource { summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); + + /** + * Retrieves an aggregated summary of AI bots HTTP requests grouped by the + * specified dimension. + * + * @example + * ```ts + * const response = await client.radar.ai.bots.summaryV2( + * 'USER_AGENT', + * ); + * ``` + */ + summaryV2( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE' | 'INDUSTRY' | 'VERTICAL', + query?: BotSummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE' | 'INDUSTRY' | 'VERTICAL', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE' | 'INDUSTRY' | 'VERTICAL', + query: BotSummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: BotSummaryV2Response; + }> + )._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' | 'INDUSTRY' | 'VERTICAL', + query?: BotTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE' | 'INDUSTRY' | 'VERTICAL', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE' | 'INDUSTRY' | 'VERTICAL', + 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 BotSummaryV2Response { + /** + * Metadata for the results. + */ + meta: BotSummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace BotSummaryV2Response { + /** + * 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 BotSummaryV2Params { + /** + * 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'; + + /** + * Filters results by industry. + */ + industry?: 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 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 vertical. + */ + vertical?: 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'; + + /** + * Filters results by industry. + */ + industry?: 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 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; + + /** + * Filters results by vertical. + */ + vertical?: 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'; + + /** + * Filters results by industry. + */ + industry?: 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 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'; + + /** + * Filters results by vertical. + */ + vertical?: Array; } Bots.Summary = Summary; export declare namespace Bots { + export { + type BotSummaryV2Response as BotSummaryV2Response, + type BotTimeseriesResponse as BotTimeseriesResponse, + type BotTimeseriesGroupsResponse as BotTimeseriesGroupsResponse, + type BotSummaryV2Params as BotSummaryV2Params, + type BotTimeseriesParams as BotTimeseriesParams, + type BotTimeseriesGroupsParams as BotTimeseriesGroupsParams, + }; + export { Summary as Summary, type SummaryUserAgentResponse as SummaryUserAgentResponse, diff --git a/src/resources/radar/ai/bots/index.ts b/src/resources/radar/ai/bots/index.ts index c94177cbcd..8d3512cf95 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 { + Bots, + type BotSummaryV2Response, + type BotTimeseriesResponse, + type BotTimeseriesGroupsResponse, + type BotSummaryV2Params, + type BotTimeseriesParams, + type BotTimeseriesGroupsParams, +} from './bots'; export { Summary, type SummaryUserAgentResponse, type SummaryUserAgentParams } from './summary'; diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index d56384a99a..12a71ffebc 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -1,8 +1,22 @@ // 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 { + Bots, + type BotSummaryV2Response, + type BotTimeseriesResponse, + type BotTimeseriesGroupsResponse, + type BotSummaryV2Params, + type BotTimeseriesParams, + type BotTimeseriesGroupsParams, +} from './bots/index'; +export { + Inference, + type InferenceSummaryV2Response, + type InferenceTimeseriesGroupsV2Response, + type InferenceSummaryV2Params, + type InferenceTimeseriesGroupsV2Params, +} from './inference/index'; export { TimeseriesGroups, type TimeseriesGroupSummaryResponse, diff --git a/src/resources/radar/ai/inference/index.ts b/src/resources/radar/ai/inference/index.ts index a26b5943df..3e6766d9a6 100644 --- a/src/resources/radar/ai/inference/index.ts +++ b/src/resources/radar/ai/inference/index.ts @@ -1,6 +1,12 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Inference } from './inference'; +export { + Inference, + type InferenceSummaryV2Response, + type InferenceTimeseriesGroupsV2Response, + type InferenceSummaryV2Params, + type InferenceTimeseriesGroupsV2Params, +} from './inference'; export { Summary, type SummaryModelResponse, diff --git a/src/resources/radar/ai/inference/inference.ts b/src/resources/radar/ai/inference/inference.ts index 7f31aa0ffb..2f55d10668 100644 --- a/src/resources/radar/ai/inference/inference.ts +++ b/src/resources/radar/ai/inference/inference.ts @@ -1,6 +1,8 @@ // 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 SummaryAPI from './summary'; import { Summary, @@ -17,12 +19,427 @@ export class Inference extends APIResource { timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( this._client, ); + + /** + * Retrieves an aggregated summary of unique accounts using Workers AI inference + * grouped by the specified dimension. + * + * @example + * ```ts + * const response = await client.radar.ai.inference.summaryV2( + * 'MODEL', + * ); + * ``` + */ + summaryV2( + dimension: 'MODEL' | 'TASK', + query?: InferenceSummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'MODEL' | 'TASK', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'MODEL' | 'TASK', + query: InferenceSummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/inference/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: InferenceSummaryV2Response; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of unique accounts using Workers AI inference, + * grouped by the specified dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.inference.timeseriesGroupsV2( + * 'MODEL', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: 'MODEL' | 'TASK', + query?: InferenceTimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'MODEL' | 'TASK', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'MODEL' | 'TASK', + query: InferenceTimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/inference/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: InferenceTimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface InferenceSummaryV2Response { + /** + * Metadata for the results. + */ + meta: InferenceSummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace InferenceSummaryV2Response { + /** + * 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 InferenceTimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + meta: InferenceTimeseriesGroupsV2Response.Meta; + + serie_0: InferenceTimeseriesGroupsV2Response.Serie0; +} + +export namespace InferenceTimeseriesGroupsV2Response { + /** + * 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 InferenceSummaryV2Params { + /** + * 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 interface InferenceTimeseriesGroupsV2Params { + /** + * 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; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; } Inference.Summary = Summary; Inference.TimeseriesGroups = TimeseriesGroups; export declare namespace Inference { + export { + type InferenceSummaryV2Response as InferenceSummaryV2Response, + type InferenceTimeseriesGroupsV2Response as InferenceTimeseriesGroupsV2Response, + type InferenceSummaryV2Params as InferenceSummaryV2Params, + type InferenceTimeseriesGroupsV2Params as InferenceTimeseriesGroupsV2Params, + }; + export { Summary as Summary, type SummaryModelResponse as SummaryModelResponse, diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index 09ff1ff862..b5b307bf8b 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -9,13 +9,7 @@ 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', - * ); - * ``` + * @deprecated Use [Radar > AI > Bots > Summary](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/summary_v2/) instead. */ summary( dimension: 'USER_AGENT' | 'CRAWL_PURPOSE' | 'INDUSTRY' | 'VERTICAL', @@ -44,11 +38,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves AI bots HTTP request volume over time. * - * @example - * ```ts - * const response = - * await client.radar.ai.timeseriesGroups.timeseries(); - * ``` + * @deprecated Use [Radar > AI > Bots > Timeseries](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/timeseries/) instead. */ timeseries( query?: TimeseriesGroupTimeseriesParams, @@ -73,13 +63,7 @@ export class TimeseriesGroups extends APIResource { * 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', - * ); - * ``` + * @deprecated Use [Radar > AI > Bots > Timeseries Groups](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/timeseries_groups/) instead. */ timeseriesGroups( dimension: 'USER_AGENT' | 'CRAWL_PURPOSE' | 'INDUSTRY' | 'VERTICAL', diff --git a/src/resources/radar/ai/to-markdown.ts b/src/resources/radar/ai/to-markdown.ts index cc254c45c8..b3016565e9 100644 --- a/src/resources/radar/ai/to-markdown.ts +++ b/src/resources/radar/ai/to-markdown.ts @@ -9,16 +9,7 @@ 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'), - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` + * @deprecated Use [AI > To Markdown](https://developers.cloudflare.com/api/resources/ai/subresources/to_markdown/) instead. */ create( body: string | ArrayBufferView | ArrayBuffer | BlobLike, diff --git a/src/resources/radar/as112/as112.ts b/src/resources/radar/as112/as112.ts index 876d8d74aa..a617daa990 100644 --- a/src/resources/radar/as112/as112.ts +++ b/src/resources/radar/as112/as112.ts @@ -55,6 +55,40 @@ export class AS112 extends APIResource { ); top: TopAPI.Top = new TopAPI.Top(this._client); + /** + * Retrieves the distribution of AS112 queries by the specified dimension. + * + * @example + * ```ts + * const response = await client.radar.as112.summaryV2( + * 'DNSSEC', + * ); + * ``` + */ + summaryV2( + dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', + query?: AS112SummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', + query: AS112SummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/as112/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: AS112SummaryV2Response; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves the AS112 DNS queries over time. * @@ -81,6 +115,137 @@ export class AS112 extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieves the distribution of AS112 queries grouped by dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroupsV2('DNSSEC'); + * ``` + */ + timeseriesGroupsV2( + dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', + query?: AS112TimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', + query: AS112TimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/as112/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: AS112TimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface AS112SummaryV2Response { + /** + * Metadata for the results. + */ + meta: AS112SummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace AS112SummaryV2Response { + /** + * 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 AS112TimeseriesResponse { @@ -196,14 +361,117 @@ export namespace AS112TimeseriesResponse { } } -export interface AS112TimeseriesParams { +export interface AS112TimeseriesGroupsV2Response { /** - * 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/). + * Metadata for the results. */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; + meta: AS112TimeseriesGroupsV2Response.Meta; + + serie_0: AS112TimeseriesGroupsV2Response.Serie0; +} + +export namespace AS112TimeseriesGroupsV2Response { + /** + * 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 AS112SummaryV2Params { /** * Filters results by continent. Specify a comma-separated list of alpha-2 codes. * Prefix with `-` to exclude continents from results. For example, `-EU,NA` @@ -233,6 +501,366 @@ export interface AS112TimeseriesParams { */ 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 DNS transport protocol. + */ + protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + + /** + * Filters results by DNS query type. + */ + queryType?: + | 'A' + | 'AAAA' + | 'A6' + | 'AFSDB' + | 'ANY' + | 'APL' + | 'ATMA' + | 'AXFR' + | 'CAA' + | 'CDNSKEY' + | 'CDS' + | 'CERT' + | 'CNAME' + | 'CSYNC' + | 'DHCID' + | 'DLV' + | 'DNAME' + | 'DNSKEY' + | 'DOA' + | 'DS' + | 'EID' + | 'EUI48' + | 'EUI64' + | 'GPOS' + | 'GID' + | 'HINFO' + | 'HIP' + | 'HTTPS' + | 'IPSECKEY' + | 'ISDN' + | 'IXFR' + | 'KEY' + | 'KX' + | 'L32' + | 'L64' + | 'LOC' + | 'LP' + | 'MAILA' + | 'MAILB' + | 'MB' + | 'MD' + | 'MF' + | 'MG' + | 'MINFO' + | 'MR' + | 'MX' + | 'NAPTR' + | 'NB' + | 'NBSTAT' + | 'NID' + | 'NIMLOC' + | 'NINFO' + | 'NS' + | 'NSAP' + | 'NSEC' + | 'NSEC3' + | 'NSEC3PARAM' + | 'NULL' + | 'NXT' + | 'OPENPGPKEY' + | 'OPT' + | 'PTR' + | 'PX' + | 'RKEY' + | 'RP' + | 'RRSIG' + | 'RT' + | 'SIG' + | 'SINK' + | 'SMIMEA' + | 'SOA' + | 'SPF' + | 'SRV' + | 'SSHFP' + | 'SVCB' + | 'TA' + | 'TALINK' + | 'TKEY' + | 'TLSA' + | 'TSIG' + | 'TXT' + | 'UINFO' + | 'UID' + | 'UNSPEC' + | 'URI' + | 'WKS' + | 'X25' + | 'ZONEMD' + | null; + + /** + * Filters results by DNS response code. + */ + responseCode?: + | 'NOERROR' + | 'FORMERR' + | 'SERVFAIL' + | 'NXDOMAIN' + | 'NOTIMP' + | 'REFUSED' + | 'YXDOMAIN' + | 'YXRRSET' + | 'NXRRSET' + | 'NOTAUTH' + | 'NOTZONE' + | 'BADSIG' + | 'BADKEY' + | 'BADTIME' + | 'BADMODE' + | 'BADNAME' + | 'BADALG' + | 'BADTRUNC' + | 'BADCOOKIE'; +} + +export interface AS112TimeseriesParams { + /** + * 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 continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by DNS transport protocol. + */ + protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + + /** + * Filters results by DNS query type. + */ + queryType?: + | 'A' + | 'AAAA' + | 'A6' + | 'AFSDB' + | 'ANY' + | 'APL' + | 'ATMA' + | 'AXFR' + | 'CAA' + | 'CDNSKEY' + | 'CDS' + | 'CERT' + | 'CNAME' + | 'CSYNC' + | 'DHCID' + | 'DLV' + | 'DNAME' + | 'DNSKEY' + | 'DOA' + | 'DS' + | 'EID' + | 'EUI48' + | 'EUI64' + | 'GPOS' + | 'GID' + | 'HINFO' + | 'HIP' + | 'HTTPS' + | 'IPSECKEY' + | 'ISDN' + | 'IXFR' + | 'KEY' + | 'KX' + | 'L32' + | 'L64' + | 'LOC' + | 'LP' + | 'MAILA' + | 'MAILB' + | 'MB' + | 'MD' + | 'MF' + | 'MG' + | 'MINFO' + | 'MR' + | 'MX' + | 'NAPTR' + | 'NB' + | 'NBSTAT' + | 'NID' + | 'NIMLOC' + | 'NINFO' + | 'NS' + | 'NSAP' + | 'NSEC' + | 'NSEC3' + | 'NSEC3PARAM' + | 'NULL' + | 'NXT' + | 'OPENPGPKEY' + | 'OPT' + | 'PTR' + | 'PX' + | 'RKEY' + | 'RP' + | 'RRSIG' + | 'RT' + | 'SIG' + | 'SINK' + | 'SMIMEA' + | 'SOA' + | 'SPF' + | 'SRV' + | 'SSHFP' + | 'SVCB' + | 'TA' + | 'TALINK' + | 'TKEY' + | 'TLSA' + | 'TSIG' + | 'TXT' + | 'UINFO' + | 'UID' + | 'UNSPEC' + | 'URI' + | 'WKS' + | 'X25' + | 'ZONEMD' + | null; + + /** + * Filters results by DNS response code. + */ + responseCode?: + | 'NOERROR' + | 'FORMERR' + | 'SERVFAIL' + | 'NXDOMAIN' + | 'NOTIMP' + | 'REFUSED' + | 'YXDOMAIN' + | 'YXRRSET' + | 'NXRRSET' + | 'NOTAUTH' + | 'NOTZONE' + | 'BADSIG' + | 'BADKEY' + | 'BADTIME' + | 'BADMODE' + | 'BADNAME' + | 'BADALG' + | 'BADTRUNC' + | 'BADCOOKIE'; +} + +export interface AS112TimeseriesGroupsV2Params { + /** + * 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 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` @@ -375,8 +1003,12 @@ AS112.Top = Top; export declare namespace AS112 { export { + type AS112SummaryV2Response as AS112SummaryV2Response, type AS112TimeseriesResponse as AS112TimeseriesResponse, + type AS112TimeseriesGroupsV2Response as AS112TimeseriesGroupsV2Response, + type AS112SummaryV2Params as AS112SummaryV2Params, type AS112TimeseriesParams as AS112TimeseriesParams, + type AS112TimeseriesGroupsV2Params as AS112TimeseriesGroupsV2Params, }; export { diff --git a/src/resources/radar/as112/index.ts b/src/resources/radar/as112/index.ts index 7b5e4752cb..f3e1911eea 100644 --- a/src/resources/radar/as112/index.ts +++ b/src/resources/radar/as112/index.ts @@ -1,6 +1,14 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { AS112, type AS112TimeseriesResponse, type AS112TimeseriesParams } from './as112'; +export { + AS112, + type AS112SummaryV2Response, + type AS112TimeseriesResponse, + type AS112TimeseriesGroupsV2Response, + type AS112SummaryV2Params, + type AS112TimeseriesParams, + type AS112TimeseriesGroupsV2Params, +} from './as112'; export { Summary, type SummaryDNSSECResponse, diff --git a/src/resources/radar/attacks/attacks.ts b/src/resources/radar/attacks/attacks.ts index 9d3c9c4aef..4346cf6862 100644 --- a/src/resources/radar/attacks/attacks.ts +++ b/src/resources/radar/attacks/attacks.ts @@ -2,9 +2,25 @@ import { APIResource } from '../../../resource'; import * as Layer3API from './layer3/layer3'; -import { Layer3, Layer3TimeseriesParams, Layer3TimeseriesResponse } from './layer3/layer3'; +import { + Layer3, + Layer3SummaryV2Params, + Layer3SummaryV2Response, + Layer3TimeseriesGroupsV2Params, + Layer3TimeseriesGroupsV2Response, + Layer3TimeseriesParams, + Layer3TimeseriesResponse, +} from './layer3/layer3'; import * as Layer7API from './layer7/layer7'; -import { Layer7, Layer7TimeseriesParams, Layer7TimeseriesResponse } from './layer7/layer7'; +import { + Layer7, + Layer7SummaryV2Params, + Layer7SummaryV2Response, + Layer7TimeseriesGroupsV2Params, + Layer7TimeseriesGroupsV2Response, + Layer7TimeseriesParams, + Layer7TimeseriesResponse, +} from './layer7/layer7'; export class Attacks extends APIResource { layer3: Layer3API.Layer3 = new Layer3API.Layer3(this._client); @@ -17,13 +33,21 @@ Attacks.Layer7 = Layer7; export declare namespace Attacks { export { Layer3 as Layer3, + type Layer3SummaryV2Response as Layer3SummaryV2Response, type Layer3TimeseriesResponse as Layer3TimeseriesResponse, + type Layer3TimeseriesGroupsV2Response as Layer3TimeseriesGroupsV2Response, + type Layer3SummaryV2Params as Layer3SummaryV2Params, type Layer3TimeseriesParams as Layer3TimeseriesParams, + type Layer3TimeseriesGroupsV2Params as Layer3TimeseriesGroupsV2Params, }; export { Layer7 as Layer7, + type Layer7SummaryV2Response as Layer7SummaryV2Response, type Layer7TimeseriesResponse as Layer7TimeseriesResponse, + type Layer7TimeseriesGroupsV2Response as Layer7TimeseriesGroupsV2Response, + type Layer7SummaryV2Params as Layer7SummaryV2Params, type Layer7TimeseriesParams as Layer7TimeseriesParams, + type Layer7TimeseriesGroupsV2Params as Layer7TimeseriesGroupsV2Params, }; } diff --git a/src/resources/radar/attacks/index.ts b/src/resources/radar/attacks/index.ts index 28216f9bd4..5ff5753f57 100644 --- a/src/resources/radar/attacks/index.ts +++ b/src/resources/radar/attacks/index.ts @@ -1,5 +1,21 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Attacks } from './attacks'; -export { Layer3, type Layer3TimeseriesResponse, type Layer3TimeseriesParams } from './layer3/index'; -export { Layer7, type Layer7TimeseriesResponse, type Layer7TimeseriesParams } from './layer7/index'; +export { + Layer3, + type Layer3SummaryV2Response, + type Layer3TimeseriesResponse, + type Layer3TimeseriesGroupsV2Response, + type Layer3SummaryV2Params, + type Layer3TimeseriesParams, + type Layer3TimeseriesGroupsV2Params, +} from './layer3/index'; +export { + Layer7, + type Layer7SummaryV2Response, + type Layer7TimeseriesResponse, + type Layer7TimeseriesGroupsV2Response, + type Layer7SummaryV2Params, + type Layer7TimeseriesParams, + type Layer7TimeseriesGroupsV2Params, +} from './layer7/index'; diff --git a/src/resources/radar/attacks/layer3/index.ts b/src/resources/radar/attacks/layer3/index.ts index aea57a5a87..5cda25b111 100644 --- a/src/resources/radar/attacks/layer3/index.ts +++ b/src/resources/radar/attacks/layer3/index.ts @@ -1,6 +1,14 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Layer3, type Layer3TimeseriesResponse, type Layer3TimeseriesParams } from './layer3'; +export { + Layer3, + type Layer3SummaryV2Response, + type Layer3TimeseriesResponse, + type Layer3TimeseriesGroupsV2Response, + type Layer3SummaryV2Params, + type Layer3TimeseriesParams, + type Layer3TimeseriesGroupsV2Params, +} from './layer3'; export { Summary, type SummaryBitrateResponse, diff --git a/src/resources/radar/attacks/layer3/layer3.ts b/src/resources/radar/attacks/layer3/layer3.ts index 3fcf323b99..673db07fec 100644 --- a/src/resources/radar/attacks/layer3/layer3.ts +++ b/src/resources/radar/attacks/layer3/layer3.ts @@ -57,6 +57,40 @@ export class Layer3 extends APIResource { ); top: TopAPI.Top = new TopAPI.Top(this._client); + /** + * Retrieves the distribution of layer 3 attacks by the specified dimension. + * + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summaryV2('PROTOCOL'); + * ``` + */ + summaryV2( + dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', + query?: Layer3SummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', + query: Layer3SummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/attacks/layer3/summary/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: Layer3SummaryV2Response }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves layer 3 attacks over time. * @@ -84,6 +118,139 @@ export class Layer3 extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieves the distribution of layer 3 attacks grouped by dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroupsV2( + * 'PROTOCOL', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', + query?: Layer3TimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', + query: Layer3TimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/attacks/layer3/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: Layer3TimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface Layer3SummaryV2Response { + /** + * Metadata for the results. + */ + meta: Layer3SummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace Layer3SummaryV2Response { + /** + * 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 Layer3TimeseriesResponse { @@ -199,6 +366,182 @@ export namespace Layer3TimeseriesResponse { } } +export interface Layer3TimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + meta: Layer3TimeseriesGroupsV2Response.Meta; + + serie_0: Layer3TimeseriesGroupsV2Response.Serie0; +} + +export namespace Layer3TimeseriesGroupsV2Response { + /** + * 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 Layer3SummaryV2Params { + /** + * 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; + + /** + * Specifies whether the `location` filter applies to the source or target + * location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * 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 the results by layer 3/4 protocol. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + export interface Layer3TimeseriesParams { /** * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). @@ -284,14 +627,97 @@ export interface Layer3TimeseriesParams { protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; } +export interface Layer3TimeseriesGroupsV2Params { + /** + * 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 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; + + /** + * Specifies whether the `location` filter applies to the source or target + * location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * 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' | 'MIN0_MAX'; + + /** + * Filters the results by layer 3/4 protocol. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + Layer3.Summary = Summary; Layer3.TimeseriesGroups = TimeseriesGroups; Layer3.Top = Top; export declare namespace Layer3 { export { + type Layer3SummaryV2Response as Layer3SummaryV2Response, type Layer3TimeseriesResponse as Layer3TimeseriesResponse, + type Layer3TimeseriesGroupsV2Response as Layer3TimeseriesGroupsV2Response, + type Layer3SummaryV2Params as Layer3SummaryV2Params, type Layer3TimeseriesParams as Layer3TimeseriesParams, + type Layer3TimeseriesGroupsV2Params as Layer3TimeseriesGroupsV2Params, }; export { diff --git a/src/resources/radar/attacks/layer7/index.ts b/src/resources/radar/attacks/layer7/index.ts index ea12e3b31d..20456df07c 100644 --- a/src/resources/radar/attacks/layer7/index.ts +++ b/src/resources/radar/attacks/layer7/index.ts @@ -1,6 +1,14 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Layer7, type Layer7TimeseriesResponse, type Layer7TimeseriesParams } from './layer7'; +export { + Layer7, + type Layer7SummaryV2Response, + type Layer7TimeseriesResponse, + type Layer7TimeseriesGroupsV2Response, + type Layer7SummaryV2Params, + type Layer7TimeseriesParams, + type Layer7TimeseriesGroupsV2Params, +} from './layer7'; export { Summary, type SummaryHTTPMethodResponse, diff --git a/src/resources/radar/attacks/layer7/layer7.ts b/src/resources/radar/attacks/layer7/layer7.ts index 633b50c1a5..b997d1b7f5 100644 --- a/src/resources/radar/attacks/layer7/layer7.ts +++ b/src/resources/radar/attacks/layer7/layer7.ts @@ -57,6 +57,63 @@ export class Layer7 extends APIResource { ); top: TopAPI.Top = new TopAPI.Top(this._client); + /** + * Retrieves the distribution of layer 7 attacks by the specified dimension. + * + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summaryV2( + * 'HTTP_METHOD', + * ); + * ``` + */ + summaryV2( + dimension: + | 'HTTP_METHOD' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'MANAGED_RULES' + | 'MITIGATION_PRODUCT' + | 'VERTICAL' + | 'INDUSTRY', + query?: Layer7SummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'HTTP_METHOD' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'MANAGED_RULES' + | 'MITIGATION_PRODUCT' + | 'VERTICAL' + | 'INDUSTRY', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'HTTP_METHOD' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'MANAGED_RULES' + | 'MITIGATION_PRODUCT' + | 'VERTICAL' + | 'INDUSTRY', + query: Layer7SummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/attacks/layer7/summary/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: Layer7SummaryV2Response }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves layer 7 attacks over time. * @@ -84,6 +141,160 @@ export class Layer7 extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieves the distribution of layer 7 attacks grouped by dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroupsV2( + * 'HTTP_METHOD', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: + | 'HTTP_METHOD' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'MANAGED_RULES' + | 'MITIGATION_PRODUCT' + | 'VERTICAL' + | 'INDUSTRY', + query?: Layer7TimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'HTTP_METHOD' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'MANAGED_RULES' + | 'MITIGATION_PRODUCT' + | 'VERTICAL' + | 'INDUSTRY', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'HTTP_METHOD' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'MANAGED_RULES' + | 'MITIGATION_PRODUCT' + | 'VERTICAL' + | 'INDUSTRY', + query: Layer7TimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/attacks/layer7/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: Layer7TimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface Layer7SummaryV2Response { + /** + * Metadata for the results. + */ + meta: Layer7SummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace Layer7SummaryV2Response { + /** + * 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 Layer7TimeseriesResponse { @@ -196,6 +407,249 @@ export namespace Layer7TimeseriesResponse { } } +export interface Layer7TimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + meta: Layer7TimeseriesGroupsV2Response.Meta; + + serie_0: Layer7TimeseriesGroupsV2Response.Serie0; +} + +export namespace Layer7TimeseriesGroupsV2Response { + /** + * 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 Layer7SummaryV2Params { + /** + * 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'; + + /** + * Filters results by HTTP method. + */ + httpMethod?: Array< + | 'GET' + | 'POST' + | 'DELETE' + | 'PUT' + | 'HEAD' + | 'PURGE' + | 'OPTIONS' + | 'PROPFIND' + | 'MKCOL' + | 'PATCH' + | 'ACL' + | 'BCOPY' + | 'BDELETE' + | 'BMOVE' + | 'BPROPFIND' + | 'BPROPPATCH' + | 'CHECKIN' + | 'CHECKOUT' + | 'CONNECT' + | 'COPY' + | 'LABEL' + | 'LOCK' + | 'MERGE' + | 'MKACTIVITY' + | 'MKWORKSPACE' + | 'MOVE' + | 'NOTIFY' + | 'ORDERPATCH' + | 'POLL' + | 'PROPPATCH' + | 'REPORT' + | 'SEARCH' + | 'SUBSCRIBE' + | 'TRACE' + | 'UNCHECKOUT' + | 'UNLOCK' + | 'UNSUBSCRIBE' + | 'UPDATE' + | 'VERSIONCONTROL' + | 'BASELINECONTROL' + | 'XMSENUMATTS' + | 'RPC_OUT_DATA' + | 'RPC_IN_DATA' + | 'JSON' + | 'COOK' + | 'TRACK' + >; + + /** + * Filters results by HTTP version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * 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; + + /** + * Filters the results by layer 7 mitigation product. + */ + mitigationProduct?: Array< + | 'DDOS' + | 'WAF' + | 'BOT_MANAGEMENT' + | 'ACCESS_RULES' + | 'IP_REPUTATION' + | 'API_SHIELD' + | 'DATA_LOSS_PREVENTION' + >; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + export interface Layer7TimeseriesParams { /** * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). @@ -335,14 +789,164 @@ export interface Layer7TimeseriesParams { normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; } +export interface Layer7TimeseriesGroupsV2Params { + /** + * 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'; + + /** + * Filters results by HTTP method. + */ + httpMethod?: Array< + | 'GET' + | 'POST' + | 'DELETE' + | 'PUT' + | 'HEAD' + | 'PURGE' + | 'OPTIONS' + | 'PROPFIND' + | 'MKCOL' + | 'PATCH' + | 'ACL' + | 'BCOPY' + | 'BDELETE' + | 'BMOVE' + | 'BPROPFIND' + | 'BPROPPATCH' + | 'CHECKIN' + | 'CHECKOUT' + | 'CONNECT' + | 'COPY' + | 'LABEL' + | 'LOCK' + | 'MERGE' + | 'MKACTIVITY' + | 'MKWORKSPACE' + | 'MOVE' + | 'NOTIFY' + | 'ORDERPATCH' + | 'POLL' + | 'PROPPATCH' + | 'REPORT' + | 'SEARCH' + | 'SUBSCRIBE' + | 'TRACE' + | 'UNCHECKOUT' + | 'UNLOCK' + | 'UNSUBSCRIBE' + | 'UPDATE' + | 'VERSIONCONTROL' + | 'BASELINECONTROL' + | 'XMSENUMATTS' + | 'RPC_OUT_DATA' + | 'RPC_IN_DATA' + | 'JSON' + | 'COOK' + | 'TRACK' + >; + + /** + * Filters results by HTTP version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * 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; + + /** + * Filters the results by layer 7 mitigation product. + */ + mitigationProduct?: Array< + | 'DDOS' + | 'WAF' + | 'BOT_MANAGEMENT' + | 'ACCESS_RULES' + | 'IP_REPUTATION' + | 'API_SHIELD' + | 'DATA_LOSS_PREVENTION' + >; + + /** + * 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' | 'MIN0_MAX'; +} + Layer7.Summary = Summary; Layer7.TimeseriesGroups = TimeseriesGroups; Layer7.Top = Top; export declare namespace Layer7 { export { + type Layer7SummaryV2Response as Layer7SummaryV2Response, type Layer7TimeseriesResponse as Layer7TimeseriesResponse, + type Layer7TimeseriesGroupsV2Response as Layer7TimeseriesGroupsV2Response, + type Layer7SummaryV2Params as Layer7SummaryV2Params, type Layer7TimeseriesParams as Layer7TimeseriesParams, + type Layer7TimeseriesGroupsV2Params as Layer7TimeseriesGroupsV2Params, }; export { diff --git a/src/resources/radar/dns/dns.ts b/src/resources/radar/dns/dns.ts index 8220269674..f5210942fb 100644 --- a/src/resources/radar/dns/dns.ts +++ b/src/resources/radar/dns/dns.ts @@ -61,6 +61,70 @@ export class DNS extends APIResource { this._client, ); + /** + * Retrieves the distribution of DNS queries by the specified dimension. + * + * @example + * ```ts + * const response = await client.radar.dns.summaryV2( + * 'IP_VERSION', + * ); + * ``` + */ + summaryV2( + dimension: + | 'IP_VERSION' + | 'CACHE_HIT' + | 'DNSSEC' + | 'DNSSEC_AWARE' + | 'DNSSEC_E2E' + | 'MATCHING_ANSWER' + | 'PROTOCOL' + | 'QUERY_TYPE' + | 'RESPONSE_CODE' + | 'RESPONSE_TTL', + query?: DNSSummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'IP_VERSION' + | 'CACHE_HIT' + | 'DNSSEC' + | 'DNSSEC_AWARE' + | 'DNSSEC_E2E' + | 'MATCHING_ANSWER' + | 'PROTOCOL' + | 'QUERY_TYPE' + | 'RESPONSE_CODE' + | 'RESPONSE_TTL', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'IP_VERSION' + | 'CACHE_HIT' + | 'DNSSEC' + | 'DNSSEC_AWARE' + | 'DNSSEC_E2E' + | 'MATCHING_ANSWER' + | 'PROTOCOL' + | 'QUERY_TYPE' + | 'RESPONSE_CODE' + | 'RESPONSE_TTL', + query: DNSSummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/dns/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: DNSSummaryV2Response; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves normalized query volume to the 1.1.1.1 DNS resolver over time. * @@ -87,6 +151,168 @@ export class DNS extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieves the distribution of DNS queries grouped by dimension over time. + * + * @example + * ```ts + * const response = await client.radar.dns.timeseriesGroupsV2( + * 'IP_VERSION', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: + | 'IP_VERSION' + | 'CACHE_HIT' + | 'DNSSEC' + | 'DNSSEC_AWARE' + | 'DNSSEC_E2E' + | 'MATCHING_ANSWER' + | 'PROTOCOL' + | 'QUERY_TYPE' + | 'RESPONSE_CODE' + | 'RESPONSE_TTL', + query?: DNSTimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'IP_VERSION' + | 'CACHE_HIT' + | 'DNSSEC' + | 'DNSSEC_AWARE' + | 'DNSSEC_E2E' + | 'MATCHING_ANSWER' + | 'PROTOCOL' + | 'QUERY_TYPE' + | 'RESPONSE_CODE' + | 'RESPONSE_TTL', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'IP_VERSION' + | 'CACHE_HIT' + | 'DNSSEC' + | 'DNSSEC_AWARE' + | 'DNSSEC_E2E' + | 'MATCHING_ANSWER' + | 'PROTOCOL' + | 'QUERY_TYPE' + | 'RESPONSE_CODE' + | 'RESPONSE_TTL', + query: DNSTimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/dns/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: DNSTimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface DNSSummaryV2Response { + /** + * Metadata for the results. + */ + meta: DNSSummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace DNSSummaryV2Response { + /** + * 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 DNSTimeseriesResponse { @@ -202,14 +428,117 @@ export namespace DNSTimeseriesResponse { } } -export interface DNSTimeseriesParams { +export interface DNSTimeseriesGroupsV2Response { /** - * 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/). + * Metadata for the results. */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; + meta: DNSTimeseriesGroupsV2Response.Meta; + + serie_0: DNSTimeseriesGroupsV2Response.Serie0; +} + +export namespace DNSTimeseriesGroupsV2Response { + /** + * 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 DNSSummaryV2Params { /** * Filters results by Autonomous System. Specify one or more Autonomous System * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from @@ -247,6 +576,402 @@ export interface DNSTimeseriesParams { */ 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; + + /** + * Specifies whether the response includes empty DNS responses (NODATA). + */ + nodata?: boolean; + + /** + * Filters results by DNS transport protocol. + */ + protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + + /** + * Filters results by DNS query type. + */ + queryType?: + | 'A' + | 'AAAA' + | 'A6' + | 'AFSDB' + | 'ANY' + | 'APL' + | 'ATMA' + | 'AXFR' + | 'CAA' + | 'CDNSKEY' + | 'CDS' + | 'CERT' + | 'CNAME' + | 'CSYNC' + | 'DHCID' + | 'DLV' + | 'DNAME' + | 'DNSKEY' + | 'DOA' + | 'DS' + | 'EID' + | 'EUI48' + | 'EUI64' + | 'GPOS' + | 'GID' + | 'HINFO' + | 'HIP' + | 'HTTPS' + | 'IPSECKEY' + | 'ISDN' + | 'IXFR' + | 'KEY' + | 'KX' + | 'L32' + | 'L64' + | 'LOC' + | 'LP' + | 'MAILA' + | 'MAILB' + | 'MB' + | 'MD' + | 'MF' + | 'MG' + | 'MINFO' + | 'MR' + | 'MX' + | 'NAPTR' + | 'NB' + | 'NBSTAT' + | 'NID' + | 'NIMLOC' + | 'NINFO' + | 'NS' + | 'NSAP' + | 'NSEC' + | 'NSEC3' + | 'NSEC3PARAM' + | 'NULL' + | 'NXT' + | 'OPENPGPKEY' + | 'OPT' + | 'PTR' + | 'PX' + | 'RKEY' + | 'RP' + | 'RRSIG' + | 'RT' + | 'SIG' + | 'SINK' + | 'SMIMEA' + | 'SOA' + | 'SPF' + | 'SRV' + | 'SSHFP' + | 'SVCB' + | 'TA' + | 'TALINK' + | 'TKEY' + | 'TLSA' + | 'TSIG' + | 'TXT' + | 'UINFO' + | 'UID' + | 'UNSPEC' + | 'URI' + | 'WKS' + | 'X25' + | 'ZONEMD' + | null; + + /** + * Filters results by DNS response code. + */ + responseCode?: + | 'NOERROR' + | 'FORMERR' + | 'SERVFAIL' + | 'NXDOMAIN' + | 'NOTIMP' + | 'REFUSED' + | 'YXDOMAIN' + | 'YXRRSET' + | 'NXRRSET' + | 'NOTAUTH' + | 'NOTZONE' + | 'BADSIG' + | 'BADKEY' + | 'BADTIME' + | 'BADMODE' + | 'BADNAME' + | 'BADALG' + | 'BADTRUNC' + | 'BADCOOKIE'; + + /** + * Filters results by country code top-level domain (ccTLD). + */ + tld?: Array; +} + +export interface DNSTimeseriesParams { + /** + * 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'; + + /** + * 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; + + /** + * Specifies whether the response includes empty DNS responses (NODATA). + */ + nodata?: boolean; + + /** + * Filters results by DNS transport protocol. + */ + protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + + /** + * Filters results by DNS query type. + */ + queryType?: + | 'A' + | 'AAAA' + | 'A6' + | 'AFSDB' + | 'ANY' + | 'APL' + | 'ATMA' + | 'AXFR' + | 'CAA' + | 'CDNSKEY' + | 'CDS' + | 'CERT' + | 'CNAME' + | 'CSYNC' + | 'DHCID' + | 'DLV' + | 'DNAME' + | 'DNSKEY' + | 'DOA' + | 'DS' + | 'EID' + | 'EUI48' + | 'EUI64' + | 'GPOS' + | 'GID' + | 'HINFO' + | 'HIP' + | 'HTTPS' + | 'IPSECKEY' + | 'ISDN' + | 'IXFR' + | 'KEY' + | 'KX' + | 'L32' + | 'L64' + | 'LOC' + | 'LP' + | 'MAILA' + | 'MAILB' + | 'MB' + | 'MD' + | 'MF' + | 'MG' + | 'MINFO' + | 'MR' + | 'MX' + | 'NAPTR' + | 'NB' + | 'NBSTAT' + | 'NID' + | 'NIMLOC' + | 'NINFO' + | 'NS' + | 'NSAP' + | 'NSEC' + | 'NSEC3' + | 'NSEC3PARAM' + | 'NULL' + | 'NXT' + | 'OPENPGPKEY' + | 'OPT' + | 'PTR' + | 'PX' + | 'RKEY' + | 'RP' + | 'RRSIG' + | 'RT' + | 'SIG' + | 'SINK' + | 'SMIMEA' + | 'SOA' + | 'SPF' + | 'SRV' + | 'SSHFP' + | 'SVCB' + | 'TA' + | 'TALINK' + | 'TKEY' + | 'TLSA' + | 'TSIG' + | 'TXT' + | 'UINFO' + | 'UID' + | 'UNSPEC' + | 'URI' + | 'WKS' + | 'X25' + | 'ZONEMD' + | null; + + /** + * Filters results by DNS response code. + */ + responseCode?: + | 'NOERROR' + | 'FORMERR' + | 'SERVFAIL' + | 'NXDOMAIN' + | 'NOTIMP' + | 'REFUSED' + | 'YXDOMAIN' + | 'YXRRSET' + | 'NXRRSET' + | 'NOTAUTH' + | 'NOTZONE' + | 'BADSIG' + | 'BADKEY' + | 'BADTIME' + | 'BADMODE' + | 'BADNAME' + | 'BADALG' + | 'BADTRUNC' + | 'BADCOOKIE'; + + /** + * Filters results by country code top-level domain (ccTLD). + */ + tld?: Array; +} + +export interface DNSTimeseriesGroupsV2Params { + /** + * 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` @@ -399,8 +1124,12 @@ DNS.TimeseriesGroups = TimeseriesGroups; export declare namespace DNS { export { + type DNSSummaryV2Response as DNSSummaryV2Response, type DNSTimeseriesResponse as DNSTimeseriesResponse, + type DNSTimeseriesGroupsV2Response as DNSTimeseriesGroupsV2Response, + type DNSSummaryV2Params as DNSSummaryV2Params, type DNSTimeseriesParams as DNSTimeseriesParams, + type DNSTimeseriesGroupsV2Params as DNSTimeseriesGroupsV2Params, }; export { diff --git a/src/resources/radar/dns/index.ts b/src/resources/radar/dns/index.ts index 5254679872..d86325efb1 100644 --- a/src/resources/radar/dns/index.ts +++ b/src/resources/radar/dns/index.ts @@ -1,6 +1,14 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns'; +export { + DNS, + type DNSSummaryV2Response, + type DNSTimeseriesResponse, + type DNSTimeseriesGroupsV2Response, + type DNSSummaryV2Params, + type DNSTimeseriesParams, + type DNSTimeseriesGroupsV2Params, +} from './dns'; export { Summary, type SummaryCacheHitResponse, diff --git a/src/resources/radar/email/email.ts b/src/resources/radar/email/email.ts index 460238da53..e490d29630 100644 --- a/src/resources/radar/email/email.ts +++ b/src/resources/radar/email/email.ts @@ -2,9 +2,21 @@ import { APIResource } from '../../../resource'; import * as RoutingAPI from './routing/routing'; -import { Routing } from './routing/routing'; +import { + Routing, + RoutingSummaryV2Params, + RoutingSummaryV2Response, + RoutingTimeseriesGroupsV2Params, + RoutingTimeseriesGroupsV2Response, +} from './routing/routing'; import * as SecurityAPI from './security/security'; -import { Security } from './security/security'; +import { + Security, + SecuritySummaryV2Params, + SecuritySummaryV2Response, + SecurityTimeseriesGroupsV2Params, + SecurityTimeseriesGroupsV2Response, +} from './security/security'; export class Email extends APIResource { routing: RoutingAPI.Routing = new RoutingAPI.Routing(this._client); @@ -42,7 +54,19 @@ Email.Security = Security; export declare namespace Email { export { type RadarEmailSeries as RadarEmailSeries, type RadarEmailSummary as RadarEmailSummary }; - export { Routing as Routing }; + export { + Routing as Routing, + type RoutingSummaryV2Response as RoutingSummaryV2Response, + type RoutingTimeseriesGroupsV2Response as RoutingTimeseriesGroupsV2Response, + type RoutingSummaryV2Params as RoutingSummaryV2Params, + type RoutingTimeseriesGroupsV2Params as RoutingTimeseriesGroupsV2Params, + }; - export { Security as Security }; + export { + Security as Security, + type SecuritySummaryV2Response as SecuritySummaryV2Response, + type SecurityTimeseriesGroupsV2Response as SecurityTimeseriesGroupsV2Response, + type SecuritySummaryV2Params as SecuritySummaryV2Params, + type SecurityTimeseriesGroupsV2Params as SecurityTimeseriesGroupsV2Params, + }; } diff --git a/src/resources/radar/email/index.ts b/src/resources/radar/email/index.ts index 0e113c2250..47de1d26d8 100644 --- a/src/resources/radar/email/index.ts +++ b/src/resources/radar/email/index.ts @@ -1,5 +1,17 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Email, type RadarEmailSeries, type RadarEmailSummary } from './email'; -export { Routing } from './routing/index'; -export { Security } from './security/index'; +export { + Routing, + type RoutingSummaryV2Response, + type RoutingTimeseriesGroupsV2Response, + type RoutingSummaryV2Params, + type RoutingTimeseriesGroupsV2Params, +} from './routing/index'; +export { + Security, + type SecuritySummaryV2Response, + type SecurityTimeseriesGroupsV2Response, + type SecuritySummaryV2Params, + type SecurityTimeseriesGroupsV2Params, +} from './security/index'; diff --git a/src/resources/radar/email/routing/index.ts b/src/resources/radar/email/routing/index.ts index a7447f6d0f..4e2cf69ee7 100644 --- a/src/resources/radar/email/routing/index.ts +++ b/src/resources/radar/email/routing/index.ts @@ -1,6 +1,12 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Routing } from './routing'; +export { + Routing, + type RoutingSummaryV2Response, + type RoutingTimeseriesGroupsV2Response, + type RoutingSummaryV2Params, + type RoutingTimeseriesGroupsV2Params, +} from './routing'; export { Summary, type SummaryARCResponse, diff --git a/src/resources/radar/email/routing/routing.ts b/src/resources/radar/email/routing/routing.ts index f4c5d68359..49efcfd36c 100644 --- a/src/resources/radar/email/routing/routing.ts +++ b/src/resources/radar/email/routing/routing.ts @@ -1,6 +1,8 @@ // 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 SummaryAPI from './summary'; import { Summary, @@ -39,12 +41,439 @@ export class Routing extends APIResource { timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( this._client, ); + + /** + * Retrieves the distribution of email routing metrics by the specified dimension. + * + * @example + * ```ts + * const response = await client.radar.email.routing.summaryV2( + * 'IP_VERSION', + * ); + * ``` + */ + summaryV2( + dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', + query?: RoutingSummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', + query: RoutingSummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/email/routing/summary/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: RoutingSummaryV2Response }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of email routing metrics grouped by dimension over + * time. + * + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroupsV2( + * 'IP_VERSION', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', + query?: RoutingTimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', + query: RoutingTimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/email/routing/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: RoutingTimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface RoutingSummaryV2Response { + /** + * Metadata for the results. + */ + meta: RoutingSummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace RoutingSummaryV2Response { + /** + * 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 RoutingTimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + meta: RoutingTimeseriesGroupsV2Response.Meta; + + serie_0: RoutingTimeseriesGroupsV2Response.Serie0; +} + +export namespace RoutingTimeseriesGroupsV2Response { + /** + * 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 RoutingSummaryV2Params { + /** + * Filters results by ARC (Authenticated Received Chain) validation. + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * 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 DKIM (DomainKeys Identified Mail) validation status. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by DMARC (Domain-based Message Authentication, Reporting and + * Conformance) validation status. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by encryption status (encrypted vs. not-encrypted). + */ + encrypted?: Array<'ENCRYPTED' | 'NOT_ENCRYPTED'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by SPF (Sender Policy Framework) validation status. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export interface RoutingTimeseriesGroupsV2Params { + /** + * 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 ARC (Authenticated Received Chain) validation. + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * 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 DKIM (DomainKeys Identified Mail) validation status. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by DMARC (Domain-based Message Authentication, Reporting and + * Conformance) validation status. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by encryption status (encrypted vs. not-encrypted). + */ + encrypted?: Array<'ENCRYPTED' | 'NOT_ENCRYPTED'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by SPF (Sender Policy Framework) validation status. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; } Routing.Summary = Summary; Routing.TimeseriesGroups = TimeseriesGroups; export declare namespace Routing { + export { + type RoutingSummaryV2Response as RoutingSummaryV2Response, + type RoutingTimeseriesGroupsV2Response as RoutingTimeseriesGroupsV2Response, + type RoutingSummaryV2Params as RoutingSummaryV2Params, + type RoutingTimeseriesGroupsV2Params as RoutingTimeseriesGroupsV2Params, + }; + export { Summary as Summary, type SummaryARCResponse as SummaryARCResponse, diff --git a/src/resources/radar/email/security/index.ts b/src/resources/radar/email/security/index.ts index b48f43fb39..01cfb4dade 100644 --- a/src/resources/radar/email/security/index.ts +++ b/src/resources/radar/email/security/index.ts @@ -1,6 +1,12 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Security } from './security'; +export { + Security, + type SecuritySummaryV2Response, + type SecurityTimeseriesGroupsV2Response, + type SecuritySummaryV2Params, + type SecurityTimeseriesGroupsV2Params, +} from './security'; export { Summary, type SummaryARCResponse, diff --git a/src/resources/radar/email/security/security.ts b/src/resources/radar/email/security/security.ts index c1c1c5f337..a4b1700f96 100644 --- a/src/resources/radar/email/security/security.ts +++ b/src/resources/radar/email/security/security.ts @@ -1,6 +1,8 @@ // 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 SummaryAPI from './summary'; import { Summary, @@ -54,6 +56,469 @@ export class Security extends APIResource { timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( this._client, ); + + /** + * Retrieves the distribution of email security metrics by the specified dimension. + * + * @example + * ```ts + * const response = + * await client.radar.email.security.summaryV2('SPAM'); + * ``` + */ + summaryV2( + dimension: + | 'SPAM' + | 'MALICIOUS' + | 'SPOOF' + | 'THREAT_CATEGORY' + | 'ARC' + | 'DKIM' + | 'DMARC' + | 'SPF' + | 'TLS_VERSION', + query?: SecuritySummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'SPAM' + | 'MALICIOUS' + | 'SPOOF' + | 'THREAT_CATEGORY' + | 'ARC' + | 'DKIM' + | 'DMARC' + | 'SPF' + | 'TLS_VERSION', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'SPAM' + | 'MALICIOUS' + | 'SPOOF' + | 'THREAT_CATEGORY' + | 'ARC' + | 'DKIM' + | 'DMARC' + | 'SPF' + | 'TLS_VERSION', + query: SecuritySummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/email/security/summary/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: SecuritySummaryV2Response }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of email security metrics grouped by dimension over + * time. + * + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroupsV2( + * 'SPAM', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: + | 'SPAM' + | 'MALICIOUS' + | 'SPOOF' + | 'THREAT_CATEGORY' + | 'ARC' + | 'DKIM' + | 'DMARC' + | 'SPF' + | 'TLS_VERSION', + query?: SecurityTimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'SPAM' + | 'MALICIOUS' + | 'SPOOF' + | 'THREAT_CATEGORY' + | 'ARC' + | 'DKIM' + | 'DMARC' + | 'SPF' + | 'TLS_VERSION', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'SPAM' + | 'MALICIOUS' + | 'SPOOF' + | 'THREAT_CATEGORY' + | 'ARC' + | 'DKIM' + | 'DMARC' + | 'SPF' + | 'TLS_VERSION', + query: SecurityTimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/email/security/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: SecurityTimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SecuritySummaryV2Response { + /** + * Metadata for the results. + */ + meta: SecuritySummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace SecuritySummaryV2Response { + /** + * 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 SecurityTimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + meta: SecurityTimeseriesGroupsV2Response.Meta; + + serie_0: SecurityTimeseriesGroupsV2Response.Serie0; +} + +export namespace SecurityTimeseriesGroupsV2Response { + /** + * 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 SecuritySummaryV2Params { + /** + * Filters results by ARC (Authenticated Received Chain) validation. + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * 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 DKIM (DomainKeys Identified Mail) validation status. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by DMARC (Domain-based Message Authentication, Reporting and + * Conformance) validation status. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by SPF (Sender Policy Framework) validation status. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by TLS version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3'>; +} + +export interface SecurityTimeseriesGroupsV2Params { + /** + * 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 ARC (Authenticated Received Chain) validation. + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * 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 DKIM (DomainKeys Identified Mail) validation status. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by DMARC (Domain-based Message Authentication, Reporting and + * Conformance) validation status. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by SPF (Sender Policy Framework) validation status. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by TLS version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3'>; } Security.Top = Top; @@ -61,6 +526,13 @@ Security.Summary = Summary; Security.TimeseriesGroups = TimeseriesGroups; export declare namespace Security { + export { + type SecuritySummaryV2Response as SecuritySummaryV2Response, + type SecurityTimeseriesGroupsV2Response as SecurityTimeseriesGroupsV2Response, + type SecuritySummaryV2Params as SecuritySummaryV2Params, + type SecurityTimeseriesGroupsV2Params as SecurityTimeseriesGroupsV2Params, + }; + export { Top as Top }; export { diff --git a/src/resources/radar/geolocations.ts b/src/resources/radar/geolocations.ts new file mode 100644 index 0000000000..13ead450ff --- /dev/null +++ b/src/resources/radar/geolocations.ts @@ -0,0 +1,263 @@ +// 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 Geolocations extends APIResource { + /** + * Retrieves a list of geolocations. + * + * @example + * ```ts + * const geolocations = await client.radar.geolocations.list(); + * ``` + */ + list( + query?: GeolocationListParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: GeolocationListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/geolocations', { query, ...options }) as Core.APIPromise<{ + result: GeolocationListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the requested Geolocation information. + * + * @example + * ```ts + * const geolocation = await client.radar.geolocations.get( + * '3190509', + * ); + * ``` + */ + get( + geoId: string, + query?: GeolocationGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(geoId: string, options?: Core.RequestOptions): Core.APIPromise; + get( + geoId: string, + query: GeolocationGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(geoId, {}, query); + } + return ( + this._client.get(`/radar/geolocations/${geoId}`, { query, ...options }) as Core.APIPromise<{ + result: GeolocationGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface GeolocationListResponse { + geolocations: Array; +} + +export namespace GeolocationListResponse { + export interface Geolocation { + geoId: string; + + /** + * A numeric string. + */ + latitude: string; + + /** + * A numeric string. + */ + longitude: string; + + name: string; + + parent: Geolocation.Parent; + + /** + * The type of the geolocation. + */ + type: 'CONTINENT' | 'COUNTRY' | 'ADM1'; + } + + export namespace Geolocation { + export interface Parent { + geoId: string; + + /** + * A numeric string. + */ + latitude: string; + + /** + * A numeric string. + */ + longitude: string; + + name: string; + + parent: Parent.Parent; + + /** + * The type of the geolocation. + */ + type: 'CONTINENT' | 'COUNTRY' | 'ADM1'; + } + + export namespace Parent { + export interface Parent { + geoId: string; + + /** + * A numeric string. + */ + latitude: string; + + /** + * A numeric string. + */ + longitude: string; + + name: string; + + /** + * The type of the geolocation. + */ + type: 'CONTINENT' | 'COUNTRY' | 'ADM1'; + } + } + } +} + +export interface GeolocationGetResponse { + geolocation: GeolocationGetResponse.Geolocation; +} + +export namespace GeolocationGetResponse { + export interface Geolocation { + geoId: string; + + /** + * A numeric string. + */ + latitude: string; + + /** + * A numeric string. + */ + longitude: string; + + name: string; + + parent: Geolocation.Parent; + + /** + * The type of the geolocation. + */ + type: 'CONTINENT' | 'COUNTRY' | 'ADM1'; + } + + export namespace Geolocation { + export interface Parent { + geoId: string; + + /** + * A numeric string. + */ + latitude: string; + + /** + * A numeric string. + */ + longitude: string; + + name: string; + + parent: Parent.Parent; + + /** + * The type of the geolocation. + */ + type: 'CONTINENT' | 'COUNTRY' | 'ADM1'; + } + + export namespace Parent { + export interface Parent { + geoId: string; + + /** + * A numeric string. + */ + latitude: string; + + /** + * A numeric string. + */ + longitude: string; + + name: string; + + /** + * The type of the geolocation. + */ + type: 'CONTINENT' | 'COUNTRY' | 'ADM1'; + } + } + } +} + +export interface GeolocationListParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by geolocation. Specify a comma-separated list of GeoNames IDs. + */ + geoId?: string; + + /** + * Limits the number of objects returned in the response. + */ + limit?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 location + * codes. + */ + location?: string; + + /** + * Skips the specified number of objects before fetching the results. + */ + offset?: number; +} + +export interface GeolocationGetParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; +} + +export declare namespace Geolocations { + export { + type GeolocationListResponse as GeolocationListResponse, + type GeolocationGetResponse as GeolocationGetResponse, + type GeolocationListParams as GeolocationListParams, + type GeolocationGetParams as GeolocationGetParams, + }; +} diff --git a/src/resources/radar/http/http.ts b/src/resources/radar/http/http.ts index 7d3a80fcb6..7db445c93a 100644 --- a/src/resources/radar/http/http.ts +++ b/src/resources/radar/http/http.ts @@ -69,6 +69,71 @@ export class HTTP extends APIResource { ); top: TopAPI.Top = new TopAPI.Top(this._client); + /** + * Retrieves the distribution of HTTP requests by the specified dimension. + * + * @example + * ```ts + * const response = await client.radar.http.summaryV2('ADM1'); + * ``` + */ + summaryV2( + dimension: + | 'ADM1' + | 'BOT_CLASS' + | 'BROWSER' + | 'BROWSER_FAMILY' + | 'DEVICE_TYPE' + | 'HTTP_PROTOCOL' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'OS' + | 'POST_QUANTUM' + | 'TLS_VERSION', + query?: HTTPSummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'ADM1' + | 'BOT_CLASS' + | 'BROWSER' + | 'BROWSER_FAMILY' + | 'DEVICE_TYPE' + | 'HTTP_PROTOCOL' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'OS' + | 'POST_QUANTUM' + | 'TLS_VERSION', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'ADM1' + | 'BOT_CLASS' + | 'BROWSER' + | 'BROWSER_FAMILY' + | 'DEVICE_TYPE' + | 'HTTP_PROTOCOL' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'OS' + | 'POST_QUANTUM' + | 'TLS_VERSION', + query: HTTPSummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/http/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: HTTPSummaryV2Response; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves the HTTP requests over time. * @@ -95,6 +160,171 @@ export class HTTP extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieves the distribution of HTTP requests grouped by dimension. + * + * @example + * ```ts + * const response = await client.radar.http.timeseriesGroupsV2( + * 'ADM1', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: + | 'ADM1' + | 'BOT_CLASS' + | 'BROWSER' + | 'BROWSER_FAMILY' + | 'DEVICE_TYPE' + | 'HTTP_PROTOCOL' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'OS' + | 'POST_QUANTUM' + | 'TLS_VERSION', + query?: HTTPTimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'ADM1' + | 'BOT_CLASS' + | 'BROWSER' + | 'BROWSER_FAMILY' + | 'DEVICE_TYPE' + | 'HTTP_PROTOCOL' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'OS' + | 'POST_QUANTUM' + | 'TLS_VERSION', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'ADM1' + | 'BOT_CLASS' + | 'BROWSER' + | 'BROWSER_FAMILY' + | 'DEVICE_TYPE' + | 'HTTP_PROTOCOL' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'OS' + | 'POST_QUANTUM' + | 'TLS_VERSION', + query: HTTPTimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/http/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: HTTPTimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface HTTPSummaryV2Response { + /** + * Metadata for the results. + */ + meta: HTTPSummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace HTTPSummaryV2Response { + /** + * 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 HTTPTimeseriesResponse { @@ -210,6 +440,218 @@ export namespace HTTPTimeseriesResponse { } } +export interface HTTPTimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + meta: HTTPTimeseriesGroupsV2Response.Meta; + + serie_0: HTTPTimeseriesGroupsV2Response.Serie0; +} + +export namespace HTTPTimeseriesGroupsV2Response { + /** + * 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 HTTPSummaryV2Params { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * 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; + + /** + * Filters results by device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + + /** + * Filters results by HTTP protocol (HTTP vs. HTTPS). + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filters results by HTTP version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * 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 operating system. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filters results by TLS version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + export interface HTTPTimeseriesParams { /** * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). @@ -323,6 +765,121 @@ export interface HTTPTimeseriesParams { tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; } +export interface HTTPTimeseriesGroupsV2Params { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * 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; + + /** + * Filters results by device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + + /** + * Filters results by HTTP protocol (HTTP vs. HTTPS). + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filters results by HTTP version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * 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' | 'MIN0_MAX'; + + /** + * Filters results by operating system. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filters results by TLS version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + HTTP.Locations = Locations; HTTP.Ases = Ases; HTTP.Summary = Summary; @@ -331,8 +888,12 @@ HTTP.Top = Top; export declare namespace HTTP { export { + type HTTPSummaryV2Response as HTTPSummaryV2Response, type HTTPTimeseriesResponse as HTTPTimeseriesResponse, + type HTTPTimeseriesGroupsV2Response as HTTPTimeseriesGroupsV2Response, + type HTTPSummaryV2Params as HTTPSummaryV2Params, type HTTPTimeseriesParams as HTTPTimeseriesParams, + type HTTPTimeseriesGroupsV2Params as HTTPTimeseriesGroupsV2Params, }; export { diff --git a/src/resources/radar/http/index.ts b/src/resources/radar/http/index.ts index cd20232224..d4b520cd3c 100644 --- a/src/resources/radar/http/index.ts +++ b/src/resources/radar/http/index.ts @@ -1,7 +1,15 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Ases, type AseGetResponse, type AseGetParams } from './ases/index'; -export { HTTP, type HTTPTimeseriesResponse, type HTTPTimeseriesParams } from './http'; +export { + HTTP, + type HTTPSummaryV2Response, + type HTTPTimeseriesResponse, + type HTTPTimeseriesGroupsV2Response, + type HTTPSummaryV2Params, + type HTTPTimeseriesParams, + type HTTPTimeseriesGroupsV2Params, +} from './http'; export { Locations, type LocationGetResponse, type LocationGetParams } from './locations/index'; export { Summary, diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index 9b9bba8ee0..8bade1de40 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -1,7 +1,15 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { AI } from './ai/index'; -export { AS112, type AS112TimeseriesResponse, type AS112TimeseriesParams } from './as112/index'; +export { + AS112, + type AS112SummaryV2Response, + type AS112TimeseriesResponse, + type AS112TimeseriesGroupsV2Response, + type AS112SummaryV2Params, + type AS112TimeseriesParams, + type AS112TimeseriesGroupsV2Params, +} from './as112/index'; export { Annotations, type AnnotationListResponse, type AnnotationListParams } from './annotations/index'; export { Attacks } from './attacks/index'; export { BGP, type BGPTimeseriesResponse, type BGPTimeseriesParams } from './bgp/index'; @@ -27,7 +35,15 @@ export { type CtTimeseriesParams, type CtTimeseriesGroupsParams, } from './ct/index'; -export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns/index'; +export { + DNS, + type DNSSummaryV2Response, + type DNSTimeseriesResponse, + type DNSTimeseriesGroupsV2Response, + type DNSSummaryV2Params, + type DNSTimeseriesParams, + type DNSTimeseriesGroupsV2Params, +} from './dns/index'; export { Datasets, type DatasetListResponse, @@ -38,14 +54,39 @@ export { } from './datasets'; export { Email, type RadarEmailSeries, type RadarEmailSummary } from './email/index'; export { Entities, type EntityGetResponse, type EntityGetParams } from './entities/index'; -export { HTTP, type HTTPTimeseriesResponse, type HTTPTimeseriesParams } from './http/index'; -export { LeakedCredentials } from './leaked-credentials/index'; +export { + Geolocations, + type GeolocationListResponse, + type GeolocationGetResponse, + type GeolocationListParams, + type GeolocationGetParams, +} from './geolocations'; +export { + HTTP, + type HTTPSummaryV2Response, + type HTTPTimeseriesResponse, + type HTTPTimeseriesGroupsV2Response, + type HTTPSummaryV2Params, + type HTTPTimeseriesParams, + type HTTPTimeseriesGroupsV2Params, +} from './http/index'; +export { + LeakedCredentials, + type LeakedCredentialSummaryV2Response, + type LeakedCredentialTimeseriesGroupsV2Response, + type LeakedCredentialSummaryV2Params, + type LeakedCredentialTimeseriesGroupsV2Params, +} from './leaked-credentials/index'; export { Netflows, type NetflowSummaryResponse, + type NetflowSummaryV2Response, type NetflowTimeseriesResponse, + type NetflowTimeseriesGroupsResponse, type NetflowSummaryParams, + type NetflowSummaryV2Params, type NetflowTimeseriesParams, + type NetflowTimeseriesGroupsParams, } from './netflows/index'; export { Quality } from './quality/index'; export { Radar } from './radar'; diff --git a/src/resources/radar/leaked-credentials/index.ts b/src/resources/radar/leaked-credentials/index.ts index dd87ce4dc7..0e9f80aa96 100644 --- a/src/resources/radar/leaked-credentials/index.ts +++ b/src/resources/radar/leaked-credentials/index.ts @@ -1,6 +1,12 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { LeakedCredentials } from './leaked-credentials'; +export { + LeakedCredentials, + type LeakedCredentialSummaryV2Response, + type LeakedCredentialTimeseriesGroupsV2Response, + type LeakedCredentialSummaryV2Params, + type LeakedCredentialTimeseriesGroupsV2Params, +} from './leaked-credentials'; export { Summary, type SummaryBotClassResponse, diff --git a/src/resources/radar/leaked-credentials/leaked-credentials.ts b/src/resources/radar/leaked-credentials/leaked-credentials.ts index 0b08cd020b..717982687d 100644 --- a/src/resources/radar/leaked-credentials/leaked-credentials.ts +++ b/src/resources/radar/leaked-credentials/leaked-credentials.ts @@ -1,6 +1,8 @@ // 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 SummaryAPI from './summary'; import { Summary, @@ -23,12 +25,462 @@ export class LeakedCredentials extends APIResource { timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( this._client, ); + + /** + * Retrieves an aggregated summary of HTTP authentication requests grouped by the + * specified dimension. + * + * @example + * ```ts + * const response = + * await client.radar.leakedCredentials.summaryV2( + * 'COMPROMISED', + * ); + * ``` + */ + summaryV2( + dimension: 'COMPROMISED' | 'BOT_CLASS', + query?: LeakedCredentialSummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'COMPROMISED' | 'BOT_CLASS', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'COMPROMISED' | 'BOT_CLASS', + query: LeakedCredentialSummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/leaked_credential_checks/summary/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: LeakedCredentialSummaryV2Response }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of HTTP authentication requests, grouped by the + * specified dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.leakedCredentials.timeseriesGroupsV2( + * 'COMPROMISED', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: 'COMPROMISED' | 'BOT_CLASS', + query?: LeakedCredentialTimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'COMPROMISED' | 'BOT_CLASS', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'COMPROMISED' | 'BOT_CLASS', + query: LeakedCredentialTimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/leaked_credential_checks/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: LeakedCredentialTimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface LeakedCredentialSummaryV2Response { + /** + * Metadata for the results. + */ + meta: LeakedCredentialSummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace LeakedCredentialSummaryV2Response { + /** + * 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 LeakedCredentialTimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + meta: LeakedCredentialTimeseriesGroupsV2Response.Meta; + + serie_0: LeakedCredentialTimeseriesGroupsV2Response.Serie0; +} + +export namespace LeakedCredentialTimeseriesGroupsV2Response { + /** + * 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 LeakedCredentialSummaryV2Params { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * Filters results by compromised credential status (clean vs. compromised). + */ + compromised?: Array<'CLEAN' | 'COMPROMISED'>; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export interface LeakedCredentialTimeseriesGroupsV2Params { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * Filters results by leaked credential check result. + */ + checkResult?: Array< + | 'CLEAN' + | 'USERNAME_LEAKED' + | 'USERNAME_PASSWORD_SIMILAR' + | 'USERNAME_AND_PASSWORD_LEAKED' + | 'PASSWORD_LEAKED' + >; + + /** + * Filters results by compromised credential status (clean vs. compromised). + */ + compromised?: Array<'CLEAN' | 'COMPROMISED'>; + + /** + * 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; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; } LeakedCredentials.Summary = Summary; LeakedCredentials.TimeseriesGroups = TimeseriesGroups; export declare namespace LeakedCredentials { + export { + type LeakedCredentialSummaryV2Response as LeakedCredentialSummaryV2Response, + type LeakedCredentialTimeseriesGroupsV2Response as LeakedCredentialTimeseriesGroupsV2Response, + type LeakedCredentialSummaryV2Params as LeakedCredentialSummaryV2Params, + type LeakedCredentialTimeseriesGroupsV2Params as LeakedCredentialTimeseriesGroupsV2Params, + }; + export { Summary as Summary, type SummaryBotClassResponse as SummaryBotClassResponse, diff --git a/src/resources/radar/netflows/index.ts b/src/resources/radar/netflows/index.ts index cceee75f9d..8b6dfc637a 100644 --- a/src/resources/radar/netflows/index.ts +++ b/src/resources/radar/netflows/index.ts @@ -3,9 +3,13 @@ export { Netflows, type NetflowSummaryResponse, + type NetflowSummaryV2Response, type NetflowTimeseriesResponse, + type NetflowTimeseriesGroupsResponse, type NetflowSummaryParams, + type NetflowSummaryV2Params, type NetflowTimeseriesParams, + type NetflowTimeseriesGroupsParams, } from './netflows'; export { Top, diff --git a/src/resources/radar/netflows/netflows.ts b/src/resources/radar/netflows/netflows.ts index 55c05d441b..2b4c86b9ae 100644 --- a/src/resources/radar/netflows/netflows.ts +++ b/src/resources/radar/netflows/netflows.ts @@ -34,6 +34,41 @@ export class Netflows extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Retrieves the distribution of network traffic (NetFlows) by the specified + * dimension. + * + * @example + * ```ts + * const response = await client.radar.netflows.summaryV2( + * 'ADM1', + * ); + * ``` + */ + summaryV2( + dimension: 'ADM1' | 'PRODUCT', + query?: NetflowSummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'ADM1' | 'PRODUCT', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'ADM1' | 'PRODUCT', + query: NetflowSummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/netflows/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: NetflowSummaryV2Response; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves network traffic (NetFlows) over time. * @@ -60,6 +95,41 @@ export class Netflows extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieves the distribution of NetFlows traffic, grouped by chosen the specified + * dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.netflows.timeseriesGroups('ADM1'); + * ``` + */ + timeseriesGroups( + dimension: 'ADM1' | 'PRODUCT', + query?: NetflowTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'ADM1' | 'PRODUCT', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'ADM1' | 'PRODUCT', + query: NetflowTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/netflows/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: NetflowTimeseriesGroupsResponse }> + )._thenUnwrap((obj) => obj.result); + } } export interface NetflowSummaryResponse { @@ -171,6 +241,103 @@ export namespace NetflowSummaryResponse { } } +export interface NetflowSummaryV2Response { + /** + * Metadata for the results. + */ + meta: NetflowSummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace NetflowSummaryV2Response { + /** + * 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 NetflowTimeseriesResponse { /** * Metadata for the results. @@ -281,6 +448,116 @@ export namespace NetflowTimeseriesResponse { } } +export interface NetflowTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: NetflowTimeseriesGroupsResponse.Meta; + + serie_0: NetflowTimeseriesGroupsResponse.Serie0; +} + +export namespace NetflowTimeseriesGroupsResponse { + /** + * 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 NetflowSummaryParams { /** * Filters results by Autonomous System. Specify one or more Autonomous System @@ -340,6 +617,77 @@ export interface NetflowSummaryParams { name?: Array; } +export interface NetflowSummaryV2Params { + /** + * 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'; + + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + + /** + * Limits the number of objects 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 the results by network traffic product types. + */ + product?: Array<'HTTP' | 'ALL'>; +} + export interface NetflowTimeseriesParams { /** * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). @@ -417,14 +765,102 @@ export interface NetflowTimeseriesParams { product?: Array<'HTTP' | 'ALL'>; } +export interface NetflowTimeseriesGroupsParams { + /** + * 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'; + + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + + /** + * Limits the number of objects 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' | 'MIN0_MAX'; + + /** + * Filters the results by network traffic product types. + */ + product?: Array<'HTTP' | 'ALL'>; +} + Netflows.Top = Top; export declare namespace Netflows { export { type NetflowSummaryResponse as NetflowSummaryResponse, + type NetflowSummaryV2Response as NetflowSummaryV2Response, type NetflowTimeseriesResponse as NetflowTimeseriesResponse, + type NetflowTimeseriesGroupsResponse as NetflowTimeseriesGroupsResponse, type NetflowSummaryParams as NetflowSummaryParams, + type NetflowSummaryV2Params as NetflowSummaryV2Params, type NetflowTimeseriesParams as NetflowTimeseriesParams, + type NetflowTimeseriesGroupsParams as NetflowTimeseriesGroupsParams, }; export { diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 0ed666d88a..1349fb443f 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -10,6 +10,14 @@ import { DatasetListResponse, Datasets, } from './datasets'; +import * as GeolocationsAPI from './geolocations'; +import { + GeolocationGetParams, + GeolocationGetResponse, + GeolocationListParams, + GeolocationListResponse, + Geolocations, +} from './geolocations'; import * as SearchAPI from './search'; import { Search, SearchGlobalParams, SearchGlobalResponse } from './search'; import * as TCPResetsTimeoutsAPI from './tcp-resets-timeouts'; @@ -25,7 +33,15 @@ import { AI } from './ai/ai'; import * as AnnotationsAPI from './annotations/annotations'; import { AnnotationListParams, AnnotationListResponse, Annotations } from './annotations/annotations'; import * as AS112API from './as112/as112'; -import { AS112, AS112TimeseriesParams, AS112TimeseriesResponse } from './as112/as112'; +import { + AS112, + AS112SummaryV2Params, + AS112SummaryV2Response, + AS112TimeseriesGroupsV2Params, + AS112TimeseriesGroupsV2Response, + AS112TimeseriesParams, + AS112TimeseriesResponse, +} from './as112/as112'; import * as AttacksAPI from './attacks/attacks'; import { Attacks } from './attacks/attacks'; import * as BGPAPI from './bgp/bgp'; @@ -55,19 +71,45 @@ import { CtTimeseriesResponse, } from './ct/ct'; import * as DNSAPI from './dns/dns'; -import { DNS, DNSTimeseriesParams, DNSTimeseriesResponse } from './dns/dns'; +import { + DNS, + DNSSummaryV2Params, + DNSSummaryV2Response, + DNSTimeseriesGroupsV2Params, + DNSTimeseriesGroupsV2Response, + DNSTimeseriesParams, + DNSTimeseriesResponse, +} from './dns/dns'; import * as EmailAPI from './email/email'; import { Email, RadarEmailSeries, RadarEmailSummary } from './email/email'; import * as EntitiesAPI from './entities/entities'; import { Entities, EntityGetParams, EntityGetResponse } from './entities/entities'; import * as HTTPAPI from './http/http'; -import { HTTP, HTTPTimeseriesParams, HTTPTimeseriesResponse } from './http/http'; +import { + HTTP, + HTTPSummaryV2Params, + HTTPSummaryV2Response, + HTTPTimeseriesGroupsV2Params, + HTTPTimeseriesGroupsV2Response, + HTTPTimeseriesParams, + HTTPTimeseriesResponse, +} from './http/http'; import * as LeakedCredentialsAPI from './leaked-credentials/leaked-credentials'; -import { LeakedCredentials } from './leaked-credentials/leaked-credentials'; +import { + LeakedCredentialSummaryV2Params, + LeakedCredentialSummaryV2Response, + LeakedCredentialTimeseriesGroupsV2Params, + LeakedCredentialTimeseriesGroupsV2Response, + LeakedCredentials, +} from './leaked-credentials/leaked-credentials'; import * as NetflowsAPI from './netflows/netflows'; import { NetflowSummaryParams, NetflowSummaryResponse, + NetflowSummaryV2Params, + NetflowSummaryV2Response, + NetflowTimeseriesGroupsParams, + NetflowTimeseriesGroupsResponse, NetflowTimeseriesParams, NetflowTimeseriesResponse, Netflows, @@ -108,6 +150,7 @@ export class Radar extends APIResource { email: EmailAPI.Email = new EmailAPI.Email(this._client); attacks: AttacksAPI.Attacks = new AttacksAPI.Attacks(this._client); entities: EntitiesAPI.Entities = new EntitiesAPI.Entities(this._client); + geolocations: GeolocationsAPI.Geolocations = new GeolocationsAPI.Geolocations(this._client); http: HTTPAPI.HTTP = new HTTPAPI.HTTP(this._client); quality: QualityAPI.Quality = new QualityAPI.Quality(this._client); ranking: RankingAPI.Ranking = new RankingAPI.Ranking(this._client); @@ -137,6 +180,7 @@ Radar.AS112 = AS112; Radar.Email = Email; Radar.Attacks = Attacks; Radar.Entities = Entities; +Radar.Geolocations = Geolocations; Radar.HTTP = HTTP; Radar.Quality = Quality; Radar.Ranking = Ranking; @@ -195,16 +239,24 @@ export declare namespace Radar { export { DNS as DNS, + type DNSSummaryV2Response as DNSSummaryV2Response, type DNSTimeseriesResponse as DNSTimeseriesResponse, + type DNSTimeseriesGroupsV2Response as DNSTimeseriesGroupsV2Response, + type DNSSummaryV2Params as DNSSummaryV2Params, type DNSTimeseriesParams as DNSTimeseriesParams, + type DNSTimeseriesGroupsV2Params as DNSTimeseriesGroupsV2Params, }; export { Netflows as Netflows, type NetflowSummaryResponse as NetflowSummaryResponse, + type NetflowSummaryV2Response as NetflowSummaryV2Response, type NetflowTimeseriesResponse as NetflowTimeseriesResponse, + type NetflowTimeseriesGroupsResponse as NetflowTimeseriesGroupsResponse, type NetflowSummaryParams as NetflowSummaryParams, + type NetflowSummaryV2Params as NetflowSummaryV2Params, type NetflowTimeseriesParams as NetflowTimeseriesParams, + type NetflowTimeseriesGroupsParams as NetflowTimeseriesGroupsParams, }; export { @@ -217,8 +269,12 @@ export declare namespace Radar { export { AS112 as AS112, + type AS112SummaryV2Response as AS112SummaryV2Response, type AS112TimeseriesResponse as AS112TimeseriesResponse, + type AS112TimeseriesGroupsV2Response as AS112TimeseriesGroupsV2Response, + type AS112SummaryV2Params as AS112SummaryV2Params, type AS112TimeseriesParams as AS112TimeseriesParams, + type AS112TimeseriesGroupsV2Params as AS112TimeseriesGroupsV2Params, }; export { @@ -235,10 +291,22 @@ export declare namespace Radar { type EntityGetParams as EntityGetParams, }; + export { + Geolocations as Geolocations, + type GeolocationListResponse as GeolocationListResponse, + type GeolocationGetResponse as GeolocationGetResponse, + type GeolocationListParams as GeolocationListParams, + type GeolocationGetParams as GeolocationGetParams, + }; + export { HTTP as HTTP, + type HTTPSummaryV2Response as HTTPSummaryV2Response, type HTTPTimeseriesResponse as HTTPTimeseriesResponse, + type HTTPTimeseriesGroupsV2Response as HTTPTimeseriesGroupsV2Response, + type HTTPSummaryV2Params as HTTPSummaryV2Params, type HTTPTimeseriesParams as HTTPTimeseriesParams, + type HTTPTimeseriesGroupsV2Params as HTTPTimeseriesGroupsV2Params, }; export { Quality as Quality }; @@ -267,5 +335,11 @@ export declare namespace Radar { export { RobotsTXT as RobotsTXT }; - export { LeakedCredentials as LeakedCredentials }; + export { + LeakedCredentials as LeakedCredentials, + type LeakedCredentialSummaryV2Response as LeakedCredentialSummaryV2Response, + type LeakedCredentialTimeseriesGroupsV2Response as LeakedCredentialTimeseriesGroupsV2Response, + type LeakedCredentialSummaryV2Params as LeakedCredentialSummaryV2Params, + type LeakedCredentialTimeseriesGroupsV2Params as LeakedCredentialTimeseriesGroupsV2Params, + }; } diff --git a/tests/api-resources/radar/ai/bots/bots.test.ts b/tests/api-resources/radar/ai/bots/bots.test.ts new file mode 100644 index 0000000000..5df41c66c2 --- /dev/null +++ b/tests/api-resources/radar/ai/bots/bots.test.ts @@ -0,0 +1,141 @@ +// 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('summaryV2', async () => { + const responsePromise = client.radar.ai.bots.summaryV2('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('summaryV2: 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.summaryV2('USER_AGENT', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summaryV2: 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.summaryV2( + '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', + industry: ['string'], + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + vertical: ['string'], + }, + { 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', + industry: ['string'], + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + userAgent: ['string'], + vertical: ['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', + industry: ['string'], + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + normalization: 'MIN0_MAX', + vertical: ['string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ai/inference/inference.test.ts b/tests/api-resources/radar/ai/inference/inference.test.ts new file mode 100644 index 0000000000..3e3c9b991f --- /dev/null +++ b/tests/api-resources/radar/ai/inference/inference.test.ts @@ -0,0 +1,92 @@ +// 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 inference', () => { + test('summaryV2', async () => { + const responsePromise = client.radar.ai.inference.summaryV2('MODEL'); + 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('summaryV2: 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.inference.summaryV2('MODEL', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summaryV2: 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.inference.summaryV2( + 'MODEL', + { + 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); + }); + + test('timeseriesGroupsV2', async () => { + const responsePromise = client.radar.ai.inference.timeseriesGroupsV2('MODEL'); + 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('timeseriesGroupsV2: 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.inference.timeseriesGroupsV2('MODEL', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2: 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.inference.timeseriesGroupsV2( + 'MODEL', + { + 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'], + normalization: 'MIN0_MAX', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/as112/as112.test.ts b/tests/api-resources/radar/as112/as112.test.ts index c6ff5db158..3b30d3a5e2 100644 --- a/tests/api-resources/radar/as112/as112.test.ts +++ b/tests/api-resources/radar/as112/as112.test.ts @@ -10,6 +10,47 @@ const client = new Cloudflare({ }); describe('resource as112', () => { + test('summaryV2', async () => { + const responsePromise = client.radar.as112.summaryV2('DNSSEC'); + 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('summaryV2: 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.as112.summaryV2('DNSSEC', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summaryV2: 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.as112.summaryV2( + 'DNSSEC', + { + 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'], + protocol: 'UDP', + queryType: 'A', + responseCode: 'NOERROR', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + test('timeseries', async () => { const responsePromise = client.radar.as112.timeseries(); const rawResponse = await responsePromise.asResponse(); @@ -49,4 +90,46 @@ describe('resource as112', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); + + test('timeseriesGroupsV2', async () => { + const responsePromise = client.radar.as112.timeseriesGroupsV2('DNSSEC'); + 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('timeseriesGroupsV2: 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.as112.timeseriesGroupsV2('DNSSEC', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2: 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.as112.timeseriesGroupsV2( + 'DNSSEC', + { + aggInterval: '1h', + 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'], + protocol: 'UDP', + queryType: 'A', + responseCode: 'NOERROR', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/radar/attacks/layer3/layer3.test.ts b/tests/api-resources/radar/attacks/layer3/layer3.test.ts index b3d845624c..9f5162d959 100644 --- a/tests/api-resources/radar/attacks/layer3/layer3.test.ts +++ b/tests/api-resources/radar/attacks/layer3/layer3.test.ts @@ -10,6 +10,47 @@ const client = new Cloudflare({ }); describe('resource layer3', () => { + test('summaryV2', async () => { + const responsePromise = client.radar.attacks.layer3.summaryV2('PROTOCOL'); + 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('summaryV2: 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.attacks.layer3.summaryV2('PROTOCOL', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summaryV2: 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.attacks.layer3.summaryV2( + 'PROTOCOL', + { + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4'], + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + protocol: ['UDP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + test('timeseries', async () => { const responsePromise = client.radar.attacks.layer3.timeseries(); const rawResponse = await responsePromise.asResponse(); @@ -52,4 +93,47 @@ describe('resource layer3', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); + + test('timeseriesGroupsV2', async () => { + const responsePromise = client.radar.attacks.layer3.timeseriesGroupsV2('PROTOCOL'); + 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('timeseriesGroupsV2: 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.attacks.layer3.timeseriesGroupsV2('PROTOCOL', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2: 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.attacks.layer3.timeseriesGroupsV2( + 'PROTOCOL', + { + aggInterval: '1h', + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4'], + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + normalization: 'PERCENTAGE', + protocol: ['UDP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/radar/attacks/layer7/layer7.test.ts b/tests/api-resources/radar/attacks/layer7/layer7.test.ts index edab41b510..78d5defbed 100644 --- a/tests/api-resources/radar/attacks/layer7/layer7.test.ts +++ b/tests/api-resources/radar/attacks/layer7/layer7.test.ts @@ -10,6 +10,49 @@ const client = new Cloudflare({ }); describe('resource layer7', () => { + test('summaryV2', async () => { + const responsePromise = client.radar.attacks.layer7.summaryV2('HTTP_METHOD'); + 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('summaryV2: 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.attacks.layer7.summaryV2('HTTP_METHOD', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summaryV2: 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.attacks.layer7.summaryV2( + 'HTTP_METHOD', + { + asn: ['string'], + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + httpMethod: ['GET'], + httpVersion: ['HTTPv1'], + ipVersion: ['IPv4'], + limitPerGroup: 10, + location: ['string'], + mitigationProduct: ['DDOS'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + test('timeseries', async () => { const responsePromise = client.radar.attacks.layer7.timeseries(); const rawResponse = await responsePromise.asResponse(); @@ -52,4 +95,49 @@ describe('resource layer7', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); + + test('timeseriesGroupsV2', async () => { + const responsePromise = client.radar.attacks.layer7.timeseriesGroupsV2('HTTP_METHOD'); + 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('timeseriesGroupsV2: 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.attacks.layer7.timeseriesGroupsV2('HTTP_METHOD', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2: 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.attacks.layer7.timeseriesGroupsV2( + 'HTTP_METHOD', + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + httpMethod: ['GET'], + httpVersion: ['HTTPv1'], + ipVersion: ['IPv4'], + limitPerGroup: 10, + location: ['string'], + mitigationProduct: ['DDOS'], + name: ['main_series'], + normalization: 'PERCENTAGE', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/radar/dns/dns.test.ts b/tests/api-resources/radar/dns/dns.test.ts index bff5419da4..57b258f9f3 100644 --- a/tests/api-resources/radar/dns/dns.test.ts +++ b/tests/api-resources/radar/dns/dns.test.ts @@ -10,6 +10,50 @@ const client = new Cloudflare({ }); describe('resource dns', () => { + test('summaryV2', async () => { + const responsePromise = client.radar.dns.summaryV2('IP_VERSION'); + 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('summaryV2: 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.dns.summaryV2('IP_VERSION', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summaryV2: 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.dns.summaryV2( + 'IP_VERSION', + { + 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'], + nodata: true, + protocol: 'UDP', + queryType: 'A', + responseCode: 'NOERROR', + tld: ['string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + test('timeseries', async () => { const responsePromise = client.radar.dns.timeseries(); const rawResponse = await responsePromise.asResponse(); @@ -52,4 +96,49 @@ describe('resource dns', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); + + test('timeseriesGroupsV2', async () => { + const responsePromise = client.radar.dns.timeseriesGroupsV2('IP_VERSION'); + 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('timeseriesGroupsV2: 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.dns.timeseriesGroupsV2('IP_VERSION', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2: 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.dns.timeseriesGroupsV2( + 'IP_VERSION', + { + 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'], + nodata: true, + protocol: 'UDP', + queryType: 'A', + responseCode: 'NOERROR', + tld: ['string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/radar/email/routing/routing.test.ts b/tests/api-resources/radar/email/routing/routing.test.ts new file mode 100644 index 0000000000..c66901f98c --- /dev/null +++ b/tests/api-resources/radar/email/routing/routing.test.ts @@ -0,0 +1,97 @@ +// 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 routing', () => { + test('summaryV2', async () => { + const responsePromise = client.radar.email.routing.summaryV2('IP_VERSION'); + 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('summaryV2: 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.email.routing.summaryV2('IP_VERSION', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summaryV2: 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.email.routing.summaryV2( + 'IP_VERSION', + { + arc: ['PASS'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + dkim: ['PASS'], + dmarc: ['PASS'], + encrypted: ['ENCRYPTED'], + format: 'JSON', + ipVersion: ['IPv4'], + limitPerGroup: 10, + name: ['main_series'], + spf: ['PASS'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2', async () => { + const responsePromise = client.radar.email.routing.timeseriesGroupsV2('IP_VERSION'); + 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('timeseriesGroupsV2: 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.email.routing.timeseriesGroupsV2('IP_VERSION', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2: 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.email.routing.timeseriesGroupsV2( + 'IP_VERSION', + { + aggInterval: '1h', + arc: ['PASS'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + dkim: ['PASS'], + dmarc: ['PASS'], + encrypted: ['ENCRYPTED'], + format: 'JSON', + ipVersion: ['IPv4'], + limitPerGroup: 10, + name: ['main_series'], + spf: ['PASS'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/email/security/security.test.ts b/tests/api-resources/radar/email/security/security.test.ts new file mode 100644 index 0000000000..185796f987 --- /dev/null +++ b/tests/api-resources/radar/email/security/security.test.ts @@ -0,0 +1,95 @@ +// 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 security', () => { + test('summaryV2', async () => { + const responsePromise = client.radar.email.security.summaryV2('SPAM'); + 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('summaryV2: 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.email.security.summaryV2('SPAM', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summaryV2: 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.email.security.summaryV2( + 'SPAM', + { + arc: ['PASS'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + dkim: ['PASS'], + dmarc: ['PASS'], + format: 'JSON', + limitPerGroup: 10, + name: ['main_series'], + spf: ['PASS'], + tlsVersion: ['TLSv1_0'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2', async () => { + const responsePromise = client.radar.email.security.timeseriesGroupsV2('SPAM'); + 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('timeseriesGroupsV2: 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.email.security.timeseriesGroupsV2('SPAM', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2: 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.email.security.timeseriesGroupsV2( + 'SPAM', + { + aggInterval: '1h', + arc: ['PASS'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + dkim: ['PASS'], + dmarc: ['PASS'], + format: 'JSON', + limitPerGroup: 10, + name: ['main_series'], + spf: ['PASS'], + tlsVersion: ['TLSv1_0'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/geolocations.test.ts b/tests/api-resources/radar/geolocations.test.ts new file mode 100644 index 0000000000..73063b08e5 --- /dev/null +++ b/tests/api-resources/radar/geolocations.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 geolocations', () => { + test('list', async () => { + const responsePromise = client.radar.geolocations.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.geolocations.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.geolocations.list( + { format: 'JSON', geoId: '3190509,360689', limit: 5, location: 'US,CA', offset: 0 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.radar.geolocations.get('3190509'); + 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.geolocations.get('3190509', { 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.geolocations.get('3190509', { format: 'JSON' }, { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/http/http.test.ts b/tests/api-resources/radar/http/http.test.ts index ea737ab4bc..13d952c38f 100644 --- a/tests/api-resources/radar/http/http.test.ts +++ b/tests/api-resources/radar/http/http.test.ts @@ -10,6 +10,53 @@ const client = new Cloudflare({ }); describe('resource http', () => { + test('summaryV2', async () => { + const responsePromise = client.radar.http.summaryV2('ADM1'); + 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('summaryV2: 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.http.summaryV2('ADM1', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('summaryV2: 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.http.summaryV2( + 'ADM1', + { + asn: ['string'], + botClass: ['LIKELY_AUTOMATED'], + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP'], + format: 'JSON', + geoId: ['string'], + httpProtocol: ['HTTP'], + httpVersion: ['HTTPv1'], + ipVersion: ['IPv4'], + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + os: ['WINDOWS'], + tlsVersion: ['TLSv1_0'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + test('timeseries', async () => { const responsePromise = client.radar.http.timeseries(); const rawResponse = await responsePromise.asResponse(); @@ -57,4 +104,53 @@ describe('resource http', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); + + test('timeseriesGroupsV2', async () => { + const responsePromise = client.radar.http.timeseriesGroupsV2('ADM1'); + 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('timeseriesGroupsV2: 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.http.timeseriesGroupsV2('ADM1', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2: 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.http.timeseriesGroupsV2( + 'ADM1', + { + aggInterval: '1h', + asn: ['string'], + botClass: ['LIKELY_AUTOMATED'], + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP'], + format: 'JSON', + geoId: ['string'], + httpProtocol: ['HTTP'], + httpVersion: ['HTTPv1'], + ipVersion: ['IPv4'], + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + normalization: 'PERCENTAGE', + os: ['WINDOWS'], + tlsVersion: ['TLSv1_0'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/radar/leaked-credentials/leaked-credentials.test.ts b/tests/api-resources/radar/leaked-credentials/leaked-credentials.test.ts new file mode 100644 index 0000000000..0e81e2558b --- /dev/null +++ b/tests/api-resources/radar/leaked-credentials/leaked-credentials.test.ts @@ -0,0 +1,97 @@ +// 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 leakedCredentials', () => { + test('summaryV2', async () => { + const responsePromise = client.radar.leakedCredentials.summaryV2('COMPROMISED'); + 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('summaryV2: 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.leakedCredentials.summaryV2('COMPROMISED', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summaryV2: 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.leakedCredentials.summaryV2( + 'COMPROMISED', + { + asn: ['string'], + botClass: ['LIKELY_AUTOMATED'], + compromised: ['CLEAN'], + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2', async () => { + const responsePromise = client.radar.leakedCredentials.timeseriesGroupsV2('COMPROMISED'); + 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('timeseriesGroupsV2: 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.leakedCredentials.timeseriesGroupsV2('COMPROMISED', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2: 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.leakedCredentials.timeseriesGroupsV2( + 'COMPROMISED', + { + aggInterval: '1h', + asn: ['string'], + botClass: ['LIKELY_AUTOMATED'], + checkResult: ['CLEAN'], + compromised: ['CLEAN'], + 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'], + normalization: 'MIN0_MAX', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/netflows/netflows.test.ts b/tests/api-resources/radar/netflows/netflows.test.ts index 4219d820e5..70ba4e43da 100644 --- a/tests/api-resources/radar/netflows/netflows.test.ts +++ b/tests/api-resources/radar/netflows/netflows.test.ts @@ -48,6 +48,47 @@ describe('resource netflows', () => { ).rejects.toThrow(Cloudflare.NotFoundError); }); + test('summaryV2', async () => { + const responsePromise = client.radar.netflows.summaryV2('ADM1'); + 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('summaryV2: 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.netflows.summaryV2('ADM1', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summaryV2: 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.netflows.summaryV2( + 'ADM1', + { + asn: ['string'], + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + geoId: ['string'], + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + product: ['HTTP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + test('timeseries', async () => { const responsePromise = client.radar.netflows.timeseries(); const rawResponse = await responsePromise.asResponse(); @@ -88,4 +129,47 @@ describe('resource netflows', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); + + test('timeseriesGroups', async () => { + const responsePromise = client.radar.netflows.timeseriesGroups('ADM1'); + 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.netflows.timeseriesGroups('ADM1', { 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.netflows.timeseriesGroups( + 'ADM1', + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + geoId: ['string'], + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + normalization: 'PERCENTAGE', + product: ['HTTP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); From 0866bd5974efd4a70ff5dcacb681a53ba5189649 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Oct 2025 19:23:57 +0000 Subject: [PATCH 271/451] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 182 +- scripts/detect-breaking-changes | 19 +- src/resources/abuse-reports.ts | 886 +++++++++- src/resources/accounts/accounts.ts | 30 - src/resources/api-gateway/api-gateway.ts | 2 + src/resources/api-gateway/configurations.ts | 43 +- src/resources/api-gateway/index.ts | 1 + .../cloudforce-one/cloudforce-one.ts | 4 + src/resources/cloudforce-one/index.ts | 2 + .../cloudforce-one/threat-events/index.ts | 2 + .../threat-events/threat-events.ts | 79 + src/resources/custom-pages.ts | 48 +- 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 | 139 +- src/resources/kv/namespaces/metadata.ts | 4 +- src/resources/kv/namespaces/namespaces.ts | 164 +- src/resources/kv/namespaces/values.ts | 33 +- .../leaked-credential-checks/detections.ts | 240 +-- .../leaked-credential-checks/index.ts | 13 +- .../leaked-credential-checks.ts | 121 +- 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 +- .../connectors/snapshots/latest.ts | 22 - .../connectors/snapshots/snapshots.ts | 22 - src/resources/organizations/organizations.ts | 16 +- src/resources/queues/consumers.ts | 35 - src/resources/queues/index.ts | 19 +- src/resources/queues/messages.ts | 217 +-- src/resources/queues/queues.ts | 40 +- src/resources/queues/subscriptions.ts | 871 +--------- src/resources/radar/ct/logs.ts | 23 - src/resources/secrets-store/stores/secrets.ts | 4 +- .../dispatch/namespaces/scripts/bindings.ts | 18 + .../dispatch/namespaces/scripts/scripts.ts | 18 + .../dispatch/namespaces/scripts/settings.ts | 54 + .../workers/beta/workers/versions.ts | 36 + src/resources/workers/observability/index.ts | 12 +- .../workers/observability/observability.ts | 26 +- .../workers/observability/telemetry.ts | 1538 +---------------- .../scripts/script-and-version-settings.ts | 54 + src/resources/workers/scripts/scripts.ts | 18 + src/resources/workers/scripts/versions.ts | 54 + src/resources/workflows/index.ts | 23 +- src/resources/workflows/instances/events.ts | 40 +- src/resources/workflows/instances/index.ts | 18 +- .../workflows/instances/instances.ts | 416 +---- src/resources/workflows/instances/status.ts | 54 +- src/resources/workflows/versions.ts | 87 +- src/resources/workflows/workflows.ts | 274 +-- .../access/applications/applications.ts | 632 ++----- .../zero-trust/access/logs/access-requests.ts | 19 - src/resources/zero-trust/devices/dex-tests.ts | 80 +- src/resources/zero-trust/dex/colos.ts | 17 +- src/resources/zero-trust/dex/dex.ts | 5 + .../dex/fleet-status/fleet-status.ts | 75 +- .../zero-trust/dex/fleet-status/index.ts | 1 + src/resources/zero-trust/dex/index.ts | 1 + .../zero-trust/dlp/entries/custom.ts | 3 +- .../zero-trust/dlp/entries/entries.ts | 3 +- src/resources/zero-trust/gateway/rules.ts | 6 +- tests/api-resources/abuse-reports.test.ts | 69 + tests/api-resources/accounts/accounts.test.ts | 1 - .../api-gateway/configurations.test.ts | 1 + .../threat-events/threat-events.test.ts | 17 + .../api-resources/kv/namespaces/keys.test.ts | 31 +- .../kv/namespaces/namespaces.test.ts | 33 +- .../kv/namespaces/values.test.ts | 3 +- .../detections.test.ts | 98 -- .../leaked-credential-checks.test.ts | 49 - .../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/consumers.test.ts | 23 - tests/api-resources/queues/messages.test.ts | 43 - .../queues/subscriptions.test.ts | 101 -- .../secrets-store/stores/secrets.test.ts | 18 +- .../workers/observability/telemetry.test.ts | 110 -- .../workflows/instances/events.test.ts | 32 - .../workflows/instances/instances.test.ts | 89 - .../workflows/instances/status.test.ts | 33 - .../api-resources/workflows/versions.test.ts | 50 - .../api-resources/workflows/workflows.test.ts | 85 - .../access/applications/applications.test.ts | 2 - .../access/logs/access-requests.test.ts | 3 - .../zero-trust/devices/dex-tests.test.ts | 8 +- .../zero-trust/dlp/entries/custom.test.ts | 1 + .../zero-trust/dlp/entries/entries.test.ts | 1 + 102 files changed, 1867 insertions(+), 6616 deletions(-) create mode 100644 tests/api-resources/abuse-reports.test.ts delete mode 100644 tests/api-resources/leaked-credential-checks/detections.test.ts delete mode 100644 tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts 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/queues/subscriptions.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 e570c08995..3eda3dc310 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1849 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fa078e98d33794f32c77256479dceb7d6b9e0ad95da89fa01474b2c1731cad3d.yml -openapi_spec_hash: eb25624c59f39858b740347f8f092a1d +configured_endpoints: 1814 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cceecd20dfd89884f795e75b433848994bed610b79802c65104f0c70d3ada54e.yml +openapi_spec_hash: c33c0e26e48c004c1781a36748d0144c config_hash: eab23d0b8fa818f1d1dc0e9e18de4266 diff --git a/api.md b/api.md index 509663d6f6..19918fe7f0 100644 --- a/api.md +++ b/api.md @@ -129,14 +129,13 @@ Methods: Types: - Organization -- OrganizationDeleteResponse Methods: - client.organizations.create({ ...params }) -> Organization - client.organizations.update(organizationId, { ...params }) -> Organization - client.organizations.list({ ...params }) -> OrganizationsSinglePage -- client.organizations.delete(organizationId) -> OrganizationDeleteResponse +- client.organizations.delete(organizationId) -> void - client.organizations.get(organizationId) -> Organization ## OrganizationProfile @@ -1741,61 +1740,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: @@ -2285,18 +2239,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 @@ -2304,19 +2246,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 @@ -2326,14 +2267,12 @@ Types: - Key - KeyBulkDeleteResponse -- KeyBulkGetResponse - KeyBulkUpdateResponse Methods: - 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 ### Metadata @@ -2402,16 +2341,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 @@ -2437,24 +2372,9 @@ Methods: - 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 ## Subscriptions -Types: - -- SubscriptionCreateResponse -- SubscriptionUpdateResponse -- SubscriptionListResponse -- SubscriptionDeleteResponse - -Methods: - -- client.queues.subscriptions.create({ ...params }) -> SubscriptionCreateResponse -- client.queues.subscriptions.update(subscriptionId, { ...params }) -> SubscriptionUpdateResponse -- client.queues.subscriptions.list({ ...params }) -> SubscriptionListResponsesV4PagePaginationArray -- client.queues.subscriptions.delete(subscriptionId, { ...params }) -> SubscriptionDeleteResponse - # APIGateway ## Configurations @@ -2462,10 +2382,11 @@ Methods: Types: - Configuration +- ConfigurationUpdateResponse Methods: -- client.apiGateway.configurations.update({ ...params }) -> Configuration +- client.apiGateway.configurations.update({ ...params }) -> ConfigurationUpdateResponse - client.apiGateway.configurations.get({ ...params }) -> Configuration ## Discovery @@ -5511,11 +5432,12 @@ Types: - LiveStat - FleetStatusLiveResponse +- FleetStatusOverTimeResponse Methods: - client.zeroTrust.dex.fleetStatus.live({ ...params }) -> FleetStatusLiveResponse -- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> void +- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> FleetStatusOverTimeResponse #### Devices @@ -8127,6 +8049,7 @@ Types: - ThreatEventDeleteResponse - ThreatEventBulkCreateResponse - ThreatEventEditResponse +- ThreatEventGetResponse Methods: @@ -8135,6 +8058,7 @@ Methods: - client.cloudforceOne.threatEvents.delete(eventId, { ...params }) -> ThreatEventDeleteResponse - client.cloudforceOne.threatEvents.bulkCreate({ ...params }) -> ThreatEventBulkCreateResponse - client.cloudforceOne.threatEvents.edit(eventId, { ...params }) -> ThreatEventEditResponse +- client.cloudforceOne.threatEvents.get(eventId, { ...params }) -> ThreatEventGetResponse ### Attackers @@ -8470,68 +8394,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: @@ -8586,32 +8456,8 @@ Methods: # LeakedCredentialChecks -Types: - -- LeakedCredentialCheckCreateResponse -- LeakedCredentialCheckGetResponse - -Methods: - -- client.leakedCredentialChecks.create({ ...params }) -> LeakedCredentialCheckCreateResponse -- client.leakedCredentialChecks.get({ ...params }) -> LeakedCredentialCheckGetResponse - ## Detections -Types: - -- DetectionCreateResponse -- DetectionUpdateResponse -- DetectionListResponse -- DetectionDeleteResponse - -Methods: - -- client.leakedCredentialChecks.detections.create({ ...params }) -> DetectionCreateResponse -- client.leakedCredentialChecks.detections.update(detectionId, { ...params }) -> DetectionUpdateResponse -- client.leakedCredentialChecks.detections.list({ ...params }) -> DetectionListResponsesSinglePage -- client.leakedCredentialChecks.detections.delete(detectionId, { ...params }) -> DetectionDeleteResponse - # ContentScanning Types: @@ -8656,6 +8502,14 @@ Methods: # AbuseReports +Types: + +- AbuseReportCreateResponse + +Methods: + +- client.abuseReports.create(reportType, { ...params }) -> AbuseReportCreateResponse + # AI Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index c83d486858..e73689a349 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -145,14 +145,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 @@ -193,8 +185,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 @@ -207,7 +197,6 @@ TEST_PATHS=( tests/api-resources/queues/messages.test.ts tests/api-resources/queues/purge.test.ts tests/api-resources/queues/consumers.test.ts - tests/api-resources/queues/subscriptions.test.ts tests/api-resources/api-gateway/api-gateway.test.ts tests/api-resources/api-gateway/configurations.test.ts tests/api-resources/api-gateway/discovery/discovery.test.ts @@ -710,19 +699,13 @@ 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 - tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts - tests/api-resources/leaked-credential-checks/detections.test.ts tests/api-resources/content-scanning/content-scanning.test.ts tests/api-resources/content-scanning/payloads.test.ts tests/api-resources/content-scanning/settings.test.ts + tests/api-resources/abuse-reports.test.ts tests/api-resources/ai/ai.test.ts tests/api-resources/ai/finetunes/finetunes.test.ts tests/api-resources/ai/finetunes/assets.test.ts diff --git a/src/resources/abuse-reports.ts b/src/resources/abuse-reports.ts index 2a55a7e639..451e42c504 100644 --- a/src/resources/abuse-reports.ts +++ b/src/resources/abuse-reports.ts @@ -1,5 +1,889 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../resource'; +import * as Core from '../core'; -export class AbuseReports extends APIResource {} +export class AbuseReports extends APIResource { + /** + * Submit the Abuse Report of a particular type + */ + create( + reportType: string, + params: AbuseReportCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/abuse-reports/${reportType}`, { + body, + ...options, + }) as Core.APIPromise<{ result: AbuseReportCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +/** + * The result should be 'success' for successful response + */ +export type AbuseReportCreateResponse = string; + +export type AbuseReportCreateParams = + | AbuseReportCreateParams.AbuseReportsDmcaReport + | AbuseReportCreateParams.AbuseReportsTrademarkReport + | AbuseReportCreateParams.AbuseReportsGeneralReport + | AbuseReportCreateParams.AbuseReportsPhishingReport + | AbuseReportCreateParams.AbuseReportsCsamReport + | AbuseReportCreateParams.AbuseReportsThreatReport + | AbuseReportCreateParams.AbuseReportsRegistrarWhoisReport + | AbuseReportCreateParams.AbuseReportsNcseiReport; + +export declare namespace AbuseReportCreateParams { + export interface AbuseReportsDmcaReport { + /** + * Path param: The account ID of the submitter. + */ + account_id: string; + + /** + * Body param: The abuse report type. + */ + act: 'abuse_dmca'; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + address1: string; + + /** + * Body param: The name of the copyright holder. Text not exceeding 60 characters. + * This field may be released by Cloudflare to third parties such as the Lumen + * Database (https://lumendatabase.org/). + */ + agent_name: string; + + /** + * Body param: Can be `0` for false or `1` for true. Must be value: 1 for DMCA + * reports + */ + agree: 1; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + city: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + country: string; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send'; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + original_work: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send'; + + /** + * Body param: Required for DMCA reports, should be same as Name. An affirmation + * that all information in the report is true and accurate while agreeing to the + * policies of Cloudflare's abuse reports + */ + signature: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + state: string; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsTrademarkReport { + /** + * Path param: The account ID of the submitter. + */ + account_id: string; + + /** + * Body param: The abuse report type. + */ + act: 'abuse_trademark'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send'; + + /** + * Body param: Text not exceeding 1000 characters + */ + trademark_number: string; + + /** + * Body param: Text not exceeding 1000 characters + */ + trademark_office: string; + + /** + * Body param: Text not exceeding 1000 characters + */ + trademark_symbol: string; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsGeneralReport { + /** + * Path param: The account ID of the submitter. + */ + account_id: string; + + /** + * Body param: The abuse report type. + */ + act: 'abuse_general'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon' | 'none'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: A list of IP addresses separated by ‘\n’ (new line character). The + * list of destination IPs should not exceed 30 IP addresses. Each one of the IP + * addresses ought to be unique. + */ + destination_ips?: string; + + /** + * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. + * The total size of the field should not exceed 2000 characters. Each individual + * port/protocol should not exceed 100 characters. The list should not have more + * than 30 unique ports and protocols. + */ + ports_protocols?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: A list of IP addresses separated by ‘\n’ (new line character). The + * list of source IPs should not exceed 30 IP addresses. Each one of the IP + * addresses ought to be unique. + */ + source_ips?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsPhishingReport { + /** + * Path param: The account ID of the submitter. + */ + account_id: string; + + /** + * Body param: The abuse report type. + */ + act: 'abuse_phishing'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + original_work?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsCsamReport { + /** + * Path param: The account ID of the submitter. + */ + account_id: string; + + /** + * Body param: The abuse report type. + */ + act: 'abuse_children'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + ncmec_notification: 'send' | 'send-anon'; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon' | 'none'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + country?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsThreatReport { + /** + * Path param: The account ID of the submitter. + */ + account_id: string; + + /** + * Body param: The abuse report type. + */ + act: 'abuse_threat'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsRegistrarWhoisReport { + /** + * Path param: The account ID of the submitter. + */ + account_id: string; + + /** + * Body param: The abuse report type. + */ + act: 'abuse_registrar_whois'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon' | 'none'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsNcseiReport { + /** + * Path param: The account ID of the submitter. + */ + account_id: string; + + /** + * Body param: The abuse report type. + */ + act: 'abuse_ncsei'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: If the submitter is the target of NCSEI in the URLs of the abuse + * report. + */ + ncsei_subject_representation: boolean; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon' | 'none'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + country?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } +} + +export declare namespace AbuseReports { + export { + type AbuseReportCreateResponse as AbuseReportCreateResponse, + type AbuseReportCreateParams as AbuseReportCreateParams, + }; +} diff --git a/src/resources/accounts/accounts.ts b/src/resources/accounts/accounts.ts index 332d3d488d..1f17f46efb 100644 --- a/src/resources/accounts/accounts.ts +++ b/src/resources/accounts/accounts.ts @@ -175,11 +175,6 @@ export interface Account { */ created_on?: string; - /** - * Parent container details - */ - managed_by?: Account.ManagedBy; - /** * Account settings */ @@ -187,21 +182,6 @@ export interface Account { } export namespace Account { - /** - * Parent container details - */ - export interface ManagedBy { - /** - * ID of the parent Organization, if one exists - */ - parent_org_id?: string; - - /** - * Name of the parent Organization, if one exists - */ - parent_org_name?: string; - } - /** * Account settings */ @@ -277,11 +257,6 @@ export interface AccountUpdateParams { */ type: 'standard' | 'enterprise'; - /** - * Body param: Parent container details - */ - managed_by?: AccountUpdateParams.ManagedBy; - /** * Body param: Account settings */ @@ -289,11 +264,6 @@ export interface AccountUpdateParams { } export namespace AccountUpdateParams { - /** - * Parent container details - */ - export interface ManagedBy {} - /** * Account settings */ diff --git a/src/resources/api-gateway/api-gateway.ts b/src/resources/api-gateway/api-gateway.ts index 701ac67835..1f9fb727e9 100644 --- a/src/resources/api-gateway/api-gateway.ts +++ b/src/resources/api-gateway/api-gateway.ts @@ -6,6 +6,7 @@ import { Configuration, ConfigurationGetParams, ConfigurationUpdateParams, + ConfigurationUpdateResponse, Configurations, } from './configurations'; import * as SchemasAPI from './schemas'; @@ -81,6 +82,7 @@ export declare namespace APIGateway { export { Configurations as Configurations, type Configuration as Configuration, + type ConfigurationUpdateResponse as ConfigurationUpdateResponse, type ConfigurationUpdateParams as ConfigurationUpdateParams, type ConfigurationGetParams as ConfigurationGetParams, }; diff --git a/src/resources/api-gateway/configurations.ts b/src/resources/api-gateway/configurations.ts index 5082ea818a..5659e51452 100644 --- a/src/resources/api-gateway/configurations.ts +++ b/src/resources/api-gateway/configurations.ts @@ -2,10 +2,11 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; +import * as UserSchemasAPI from './user-schemas/user-schemas'; export class Configurations extends APIResource { /** - * Update configuration properties + * Set configuration properties * * @example * ```ts @@ -18,14 +19,12 @@ export class Configurations extends APIResource { * }); * ``` */ - update(params: ConfigurationUpdateParams, options?: Core.RequestOptions): Core.APIPromise { + update( + params: ConfigurationUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { const { zone_id, ...body } = params; - return ( - this._client.put(`/zones/${zone_id}/api_gateway/configuration`, { - body, - ...options, - }) as Core.APIPromise<{ result: Configuration }> - )._thenUnwrap((obj) => obj.result); + return this._client.put(`/zones/${zone_id}/api_gateway/configuration`, { body, ...options }); } /** @@ -40,11 +39,12 @@ export class Configurations extends APIResource { * ``` */ get(params: ConfigurationGetParams, options?: Core.RequestOptions): Core.APIPromise { - const { zone_id } = params; + const { zone_id, ...query } = params; return ( - this._client.get(`/zones/${zone_id}/api_gateway/configuration`, options) as Core.APIPromise<{ - result: Configuration; - }> + this._client.get(`/zones/${zone_id}/api_gateway/configuration`, { + query, + ...options, + }) as Core.APIPromise<{ result: Configuration }> )._thenUnwrap((obj) => obj.result); } } @@ -93,6 +93,17 @@ export namespace Configuration { } } +export interface ConfigurationUpdateResponse { + errors: UserSchemasAPI.Message; + + messages: UserSchemasAPI.Message; + + /** + * Whether the API call was successful. + */ + success: true; +} + export interface ConfigurationUpdateParams { /** * Path param: Identifier. @@ -148,14 +159,20 @@ export namespace ConfigurationUpdateParams { export interface ConfigurationGetParams { /** - * Identifier. + * Path param: Identifier. */ zone_id: string; + + /** + * Query param: Requests information about certain properties. + */ + properties?: Array<'auth_id_characteristics'>; } export declare namespace Configurations { export { type Configuration as Configuration, + type ConfigurationUpdateResponse as ConfigurationUpdateResponse, type ConfigurationUpdateParams as ConfigurationUpdateParams, type ConfigurationGetParams as ConfigurationGetParams, }; diff --git a/src/resources/api-gateway/index.ts b/src/resources/api-gateway/index.ts index 485f8290f8..5941af87f3 100644 --- a/src/resources/api-gateway/index.ts +++ b/src/resources/api-gateway/index.ts @@ -4,6 +4,7 @@ export { APIGateway } from './api-gateway'; export { Configurations, type Configuration, + type ConfigurationUpdateResponse, type ConfigurationUpdateParams, type ConfigurationGetParams, } from './configurations'; diff --git a/src/resources/cloudforce-one/cloudforce-one.ts b/src/resources/cloudforce-one/cloudforce-one.ts index 8c4fe620ba..aeabfa782e 100644 --- a/src/resources/cloudforce-one/cloudforce-one.ts +++ b/src/resources/cloudforce-one/cloudforce-one.ts @@ -41,6 +41,8 @@ import { ThreatEventDeleteResponse, ThreatEventEditParams, ThreatEventEditResponse, + ThreatEventGetParams, + ThreatEventGetResponse, ThreatEventListParams, ThreatEventListResponse, ThreatEvents, @@ -98,10 +100,12 @@ export declare namespace CloudforceOne { type ThreatEventDeleteResponse as ThreatEventDeleteResponse, type ThreatEventBulkCreateResponse as ThreatEventBulkCreateResponse, type ThreatEventEditResponse as ThreatEventEditResponse, + type ThreatEventGetResponse as ThreatEventGetResponse, type ThreatEventCreateParams as ThreatEventCreateParams, type ThreatEventListParams as ThreatEventListParams, type ThreatEventDeleteParams as ThreatEventDeleteParams, type ThreatEventBulkCreateParams as ThreatEventBulkCreateParams, type ThreatEventEditParams as ThreatEventEditParams, + type ThreatEventGetParams as ThreatEventGetParams, }; } diff --git a/src/resources/cloudforce-one/index.ts b/src/resources/cloudforce-one/index.ts index 77ba414bca..f69388911d 100644 --- a/src/resources/cloudforce-one/index.ts +++ b/src/resources/cloudforce-one/index.ts @@ -35,9 +35,11 @@ export { type ThreatEventDeleteResponse, type ThreatEventBulkCreateResponse, type ThreatEventEditResponse, + type ThreatEventGetResponse, type ThreatEventCreateParams, type ThreatEventListParams, type ThreatEventDeleteParams, type ThreatEventBulkCreateParams, type ThreatEventEditParams, + type ThreatEventGetParams, } from './threat-events/index'; diff --git a/src/resources/cloudforce-one/threat-events/index.ts b/src/resources/cloudforce-one/threat-events/index.ts index d687bf1e82..d797682ddd 100644 --- a/src/resources/cloudforce-one/threat-events/index.ts +++ b/src/resources/cloudforce-one/threat-events/index.ts @@ -53,9 +53,11 @@ export { type ThreatEventDeleteResponse, type ThreatEventBulkCreateResponse, type ThreatEventEditResponse, + type ThreatEventGetResponse, type ThreatEventCreateParams, type ThreatEventListParams, type ThreatEventDeleteParams, type ThreatEventBulkCreateParams, type ThreatEventEditParams, + type ThreatEventGetParams, } from './threat-events'; diff --git a/src/resources/cloudforce-one/threat-events/threat-events.ts b/src/resources/cloudforce-one/threat-events/threat-events.ts index 87dd60711b..d23c37b5db 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -207,6 +207,26 @@ export class ThreatEvents extends APIResource { ...options, }); } + + /** + * Reads an event + * + * @example + * ```ts + * const threatEvent = + * await client.cloudforceOne.threatEvents.get('event_id', { + * account_id: 'account_id', + * }); + * ``` + */ + get( + eventId: string, + params: ThreatEventGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.get(`/accounts/${account_id}/cloudforce-one/events/${eventId}`, options); + } } export interface ThreatEventCreateResponse { @@ -372,6 +392,56 @@ export interface ThreatEventEditResponse { releasabilityId?: string; } +export interface ThreatEventGetResponse { + attacker: string; + + attackerCountry: string; + + category: string; + + date: string; + + event: string; + + indicator: string; + + indicatorType: string; + + indicatorTypeId: number; + + killChain: number; + + mitreAttack: Array; + + numReferenced: number; + + numReferences: number; + + rawId: string; + + referenced: Array; + + referencedIds: Array; + + references: Array; + + referencesIds: Array; + + tags: Array; + + targetCountry: string; + + targetIndustry: string; + + tlp: string; + + uuid: string; + + insight?: string; + + releasabilityId?: string; +} + export interface ThreatEventCreateParams { /** * Path param: Account ID. @@ -673,6 +743,13 @@ export namespace ThreatEventEditParams { } } +export interface ThreatEventGetParams { + /** + * Account ID. + */ + account_id: string; +} + ThreatEvents.Attackers = Attackers; ThreatEvents.Categories = Categories; ThreatEvents.Countries = Countries; @@ -693,11 +770,13 @@ export declare namespace ThreatEvents { type ThreatEventDeleteResponse as ThreatEventDeleteResponse, type ThreatEventBulkCreateResponse as ThreatEventBulkCreateResponse, type ThreatEventEditResponse as ThreatEventEditResponse, + type ThreatEventGetResponse as ThreatEventGetResponse, type ThreatEventCreateParams as ThreatEventCreateParams, type ThreatEventListParams as ThreatEventListParams, type ThreatEventDeleteParams as ThreatEventDeleteParams, type ThreatEventBulkCreateParams as ThreatEventBulkCreateParams, type ThreatEventEditParams as ThreatEventEditParams, + type ThreatEventGetParams as ThreatEventGetParams, }; export { diff --git a/src/resources/custom-pages.ts b/src/resources/custom-pages.ts index 6bd1b13cf7..4c861b1e41 100644 --- a/src/resources/custom-pages.ts +++ b/src/resources/custom-pages.ts @@ -24,13 +24,15 @@ export class CustomPages extends APIResource { */ update( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params: CustomPageUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { @@ -123,36 +125,42 @@ export class CustomPages extends APIResource { */ get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params?: CustomPageGetParams, options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params: CustomPageGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { 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 c581632a76..f8b3034d84 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 138942ad57..a4db89243d 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. @@ -120,12 +99,12 @@ export interface Key { /** * Arbitrary JSON that is associated with a key. */ - metadata?: unknown; + metadata?: { [key: string]: unknown }; } export interface KeyBulkDeleteResponse { /** - * Number of keys successfully updated. + * Number of keys successfully updated */ successful_key_count?: number; @@ -135,49 +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 { - /** - * The metadata associated with the key. - */ - metadata: unknown; - - /** - * The value associated with the key. - */ - 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; @@ -189,27 +128,26 @@ export interface KeyBulkUpdateResponse { export interface KeyListParams extends CursorPaginationAfterParams { /** - * Path param: Identifier. + * 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. + * Query param: The number of keys to return. 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. + * 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; @@ -219,31 +157,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; @@ -256,38 +172,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 }; /** - * Arbitrary JSON that is associated with a key. + * A UTF-8 encoded string to be stored, up to 25 MiB in length. */ - metadata?: unknown; + value?: string; } } @@ -297,12 +214,10 @@ export declare namespace Keys { export { type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, - type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorPaginationAfter as KeysCursorPaginationAfter, 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 927ba8a17d..5e16f872e9 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -37,11 +37,11 @@ export class Metadata extends APIResource { /** * Arbitrary JSON that is associated with a key. */ -export type MetadataGetResponse = unknown; +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 df179e53bb..3ec43aa7c5 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: [{}], * }, * ); * ``` @@ -272,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; @@ -286,49 +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 { - /** - * The metadata associated with the key. - */ - metadata: unknown; - - /** - * The value associated with the key. - */ - 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; @@ -340,7 +270,7 @@ export interface NamespaceBulkUpdateResponse { export interface NamespaceCreateParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -352,7 +282,7 @@ export interface NamespaceCreateParams { export interface NamespaceUpdateParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -364,7 +294,7 @@ export interface NamespaceUpdateParams { export interface NamespaceListParams extends V4PagePaginationArrayParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -381,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; @@ -398,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; @@ -435,44 +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 }; /** - * Arbitrary JSON that is associated with a key. + * A UTF-8 encoded string to be stored, up to 25 MiB in length. */ - metadata?: unknown; + value?: string; } } export interface NamespaceGetParams { /** - * Identifier. + * Identifier */ account_id: string; } @@ -481,14 +390,14 @@ Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; Namespaces.Keys = Keys; Namespaces.KeysCursorPaginationAfter = KeysCursorPaginationAfter; 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, @@ -496,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, }; @@ -505,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, KeysCursorPaginationAfter as KeysCursorPaginationAfter, type KeyListParams as KeyListParams, type KeyBulkDeleteParams as KeyBulkDeleteParams, - type KeyBulkGetParams as KeyBulkGetParams, type KeyBulkUpdateParams as KeyBulkUpdateParams, }; @@ -521,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 49566f425a..1fa5ff39ed 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,8 +38,13 @@ 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, - __multipartSyntax: 'json', ...options }), + Core.maybeMultipartFormRequestOptions({ + query: { expiration, expiration_ttl }, + body, + __multipartSyntax: 'json', + ...options, + headers: { 'Content-Type': '*/*', ...options?.headers }, + }), ) as Core.APIPromise<{ result: ValueUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } @@ -114,42 +120,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: Associates arbitrary JSON data with a key/value pair. - */ - metadata?: unknown; } export interface ValueDeleteParams { /** - * Identifier. + * Identifier */ account_id: string; } export interface ValueGetParams { /** - * Identifier. + * Identifier */ account_id: string; } diff --git a/src/resources/leaked-credential-checks/detections.ts b/src/resources/leaked-credential-checks/detections.ts index ca2e008bd9..2a6de390ad 100644 --- a/src/resources/leaked-credential-checks/detections.ts +++ b/src/resources/leaked-credential-checks/detections.ts @@ -1,243 +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 Detections extends APIResource { - /** - * Create user-defined detection pattern for Leaked Credential Checks. - * - * @example - * ```ts - * const detection = - * await client.leakedCredentialChecks.detections.create({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - create( - params: DetectionCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.post(`/zones/${zone_id}/leaked-credential-checks/detections`, { - body, - ...options, - }) as Core.APIPromise<{ result: DetectionCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Update user-defined detection pattern for Leaked Credential Checks. - * - * @example - * ```ts - * const detection = - * await client.leakedCredentialChecks.detections.update( - * '18a14bafaa8eb1df04ce683ec18c765e', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - update( - detectionId: string, - params: DetectionUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.put(`/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: DetectionUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * List user-defined detection patterns for Leaked Credential Checks. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const detectionListResponse of client.leakedCredentialChecks.detections.list( - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` - */ - list( - params: DetectionListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { zone_id } = params; - return this._client.getAPIList( - `/zones/${zone_id}/leaked-credential-checks/detections`, - DetectionListResponsesSinglePage, - options, - ); - } - - /** - * Remove user-defined detection pattern for Leaked Credential Checks. - * - * @example - * ```ts - * const detection = - * await client.leakedCredentialChecks.detections.delete( - * '18a14bafaa8eb1df04ce683ec18c765e', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - delete( - detectionId: string, - params: DetectionDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id } = params; - return ( - this._client.delete( - `/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, - options, - ) as Core.APIPromise<{ result: DetectionDeleteResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export class DetectionListResponsesSinglePage extends SinglePage {} - -/** - * Defines a custom set of username/password expressions to match Leaked Credential - * Checks on. - */ -export interface DetectionCreateResponse { - /** - * Defines the unique ID for this custom detection. - */ - id?: string; - - /** - * Defines ehe ruleset expression to use in matching the password in a request. - */ - password?: string; - - /** - * Defines the ruleset expression to use in matching the username in a request. - */ - username?: string; -} - -/** - * Defines a custom set of username/password expressions to match Leaked Credential - * Checks on. - */ -export interface DetectionUpdateResponse { - /** - * Defines the unique ID for this custom detection. - */ - id?: string; - - /** - * Defines ehe ruleset expression to use in matching the password in a request. - */ - password?: string; - - /** - * Defines the ruleset expression to use in matching the username in a request. - */ - username?: string; -} - -/** - * Defines a custom set of username/password expressions to match Leaked Credential - * Checks on. - */ -export interface DetectionListResponse { - /** - * Defines the unique ID for this custom detection. - */ - id?: string; - - /** - * Defines ehe ruleset expression to use in matching the password in a request. - */ - password?: string; - - /** - * Defines the ruleset expression to use in matching the username in a request. - */ - username?: string; -} - -export type DetectionDeleteResponse = unknown; - -export interface DetectionCreateParams { - /** - * Path param: Defines an identifier. - */ - zone_id: string; - - /** - * Body param: Defines ehe ruleset expression to use in matching the password in a - * request. - */ - password?: string; - - /** - * Body param: Defines the ruleset expression to use in matching the username in a - * request. - */ - username?: string; -} - -export interface DetectionUpdateParams { - /** - * Path param: Defines an identifier. - */ - zone_id: string; - - /** - * Body param: Defines ehe ruleset expression to use in matching the password in a - * request. - */ - password?: string; - - /** - * Body param: Defines the ruleset expression to use in matching the username in a - * request. - */ - username?: string; -} - -export interface DetectionListParams { - /** - * Defines an identifier. - */ - zone_id: string; -} - -export interface DetectionDeleteParams { - /** - * Defines an identifier. - */ - zone_id: string; -} - -Detections.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; - -export declare namespace Detections { - export { - type DetectionCreateResponse as DetectionCreateResponse, - type DetectionUpdateResponse as DetectionUpdateResponse, - type DetectionListResponse as DetectionListResponse, - type DetectionDeleteResponse as DetectionDeleteResponse, - DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, - type DetectionCreateParams as DetectionCreateParams, - type DetectionUpdateParams as DetectionUpdateParams, - type DetectionListParams as DetectionListParams, - type DetectionDeleteParams as DetectionDeleteParams, - }; -} +export class Detections extends APIResource {} diff --git a/src/resources/leaked-credential-checks/index.ts b/src/resources/leaked-credential-checks/index.ts index 1844848bf2..7e3e1a0dd7 100644 --- a/src/resources/leaked-credential-checks/index.ts +++ b/src/resources/leaked-credential-checks/index.ts @@ -1,15 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { - DetectionListResponsesSinglePage, - Detections, - type DetectionCreateResponse, - type DetectionUpdateResponse, - type DetectionListResponse, - type DetectionDeleteResponse, - type DetectionCreateParams, - type DetectionUpdateParams, - type DetectionListParams, - type DetectionDeleteParams, -} from './detections'; +export { Detections } from './detections'; export { LeakedCredentialChecks } from './leaked-credential-checks'; diff --git a/src/resources/leaked-credential-checks/leaked-credential-checks.ts b/src/resources/leaked-credential-checks/leaked-credential-checks.ts index d8d8de90c1..c89821160c 100644 --- a/src/resources/leaked-credential-checks/leaked-credential-checks.ts +++ b/src/resources/leaked-credential-checks/leaked-credential-checks.ts @@ -1,132 +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 DetectionsAPI from './detections'; -import { - DetectionCreateParams, - DetectionCreateResponse, - DetectionDeleteParams, - DetectionDeleteResponse, - DetectionListParams, - DetectionListResponse, - DetectionListResponsesSinglePage, - DetectionUpdateParams, - DetectionUpdateResponse, - Detections, -} from './detections'; +import { Detections } from './detections'; export class LeakedCredentialChecks extends APIResource { detections: DetectionsAPI.Detections = new DetectionsAPI.Detections(this._client); - - /** - * Updates the current status of Leaked Credential Checks. - * - * @example - * ```ts - * const leakedCredentialCheck = - * await client.leakedCredentialChecks.create({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - create( - params: LeakedCredentialCheckCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.post(`/zones/${zone_id}/leaked-credential-checks`, { - body, - ...options, - }) as Core.APIPromise<{ result: LeakedCredentialCheckCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the current status of Leaked Credential Checks. - * - * @example - * ```ts - * const leakedCredentialCheck = - * await client.leakedCredentialChecks.get({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - get( - params: LeakedCredentialCheckGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id } = params; - return ( - this._client.get(`/zones/${zone_id}/leaked-credential-checks`, options) as Core.APIPromise<{ - result: LeakedCredentialCheckGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -/** - * Defines the overall status for Leaked Credential Checks. - */ -export interface LeakedCredentialCheckCreateResponse { - /** - * Determines whether or not Leaked Credential Checks are enabled. - */ - enabled?: boolean; -} - -/** - * Defines the overall status for Leaked Credential Checks. - */ -export interface LeakedCredentialCheckGetResponse { - /** - * Determines whether or not Leaked Credential Checks are enabled. - */ - enabled?: boolean; -} - -export interface LeakedCredentialCheckCreateParams { - /** - * Path param: Defines an identifier. - */ - zone_id: string; - - /** - * Body param: Determines whether or not Leaked Credential Checks are enabled. - */ - enabled?: boolean; -} - -export interface LeakedCredentialCheckGetParams { - /** - * Defines an identifier. - */ - zone_id: string; } LeakedCredentialChecks.Detections = Detections; -LeakedCredentialChecks.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; export declare namespace LeakedCredentialChecks { - export { - type LeakedCredentialCheckCreateResponse as LeakedCredentialCheckCreateResponse, - type LeakedCredentialCheckGetResponse as LeakedCredentialCheckGetResponse, - type LeakedCredentialCheckCreateParams as LeakedCredentialCheckCreateParams, - type LeakedCredentialCheckGetParams as LeakedCredentialCheckGetParams, - }; - - export { - Detections as Detections, - type DetectionCreateResponse as DetectionCreateResponse, - type DetectionUpdateResponse as DetectionUpdateResponse, - type DetectionListResponse as DetectionListResponse, - type DetectionDeleteResponse as DetectionDeleteResponse, - DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, - type DetectionCreateParams as DetectionCreateParams, - type DetectionUpdateParams as DetectionUpdateParams, - type DetectionListParams as DetectionListParams, - type DetectionDeleteParams as DetectionDeleteParams, - }; + export { Detections as Detections }; } 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 6e40d6cfa9..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 5e289166d6..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 6f0ab3dbaa..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/connectors/snapshots/latest.ts b/src/resources/magic-transit/connectors/snapshots/latest.ts index c51d9f1abe..16d9eaff01 100644 --- a/src/resources/magic-transit/connectors/snapshots/latest.ts +++ b/src/resources/magic-transit/connectors/snapshots/latest.ts @@ -72,8 +72,6 @@ export namespace LatestListResponse { */ v: string; - bonds?: Array; - /** * Count of processors/cores */ @@ -878,21 +876,6 @@ export namespace LatestListResponse { } export namespace Item { - /** - * Snapshot Bond - */ - export interface Bond { - /** - * Name of the network interface - */ - name: string; - - /** - * Current status of the network interface - */ - status: string; - } - /** * Snapshot DHCP lease */ @@ -1296,11 +1279,6 @@ export namespace LatestListResponse { * Connector identifier */ connector_id?: string; - - /** - * MTU as measured between the two ends of the tunnel - */ - probed_mtu?: number; } } } diff --git a/src/resources/magic-transit/connectors/snapshots/snapshots.ts b/src/resources/magic-transit/connectors/snapshots/snapshots.ts index a7d1e0d815..69b5c098e5 100644 --- a/src/resources/magic-transit/connectors/snapshots/snapshots.ts +++ b/src/resources/magic-transit/connectors/snapshots/snapshots.ts @@ -123,8 +123,6 @@ export interface SnapshotGetResponse { */ v: string; - bonds?: Array; - /** * Count of processors/cores */ @@ -929,21 +927,6 @@ export interface SnapshotGetResponse { } export namespace SnapshotGetResponse { - /** - * Snapshot Bond - */ - export interface Bond { - /** - * Name of the network interface - */ - name: string; - - /** - * Current status of the network interface - */ - status: string; - } - /** * Snapshot DHCP lease */ @@ -1347,11 +1330,6 @@ export namespace SnapshotGetResponse { * Connector identifier */ connector_id?: string; - - /** - * MTU as measured between the two ends of the tunnel - */ - probed_mtu?: number; } } diff --git a/src/resources/organizations/organizations.ts b/src/resources/organizations/organizations.ts index aa9aafb4b4..edc39aac94 100644 --- a/src/resources/organizations/organizations.ts +++ b/src/resources/organizations/organizations.ts @@ -61,12 +61,11 @@ export class Organizations extends APIResource { * Delete an organization. The organization MUST be empty before deleting. It must * not contain any sub-organizations, accounts, members or users. */ - delete(organizationId: string, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.delete(`/organizations/${organizationId}`, options) as Core.APIPromise<{ - result: OrganizationDeleteResponse; - }> - )._thenUnwrap((obj) => obj.result); + delete(organizationId: string, options?: Core.RequestOptions): Core.APIPromise { + return this._client.delete(`/organizations/${organizationId}`, { + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); } /** @@ -148,10 +147,6 @@ export namespace Organization { } } -export interface OrganizationDeleteResponse { - id: string; -} - export interface OrganizationCreateParams { name: string; @@ -295,7 +290,6 @@ Organizations.OrganizationProfileResource = OrganizationProfileResource; export declare namespace Organizations { export { type Organization as Organization, - type OrganizationDeleteResponse as OrganizationDeleteResponse, OrganizationsSinglePage as OrganizationsSinglePage, type OrganizationCreateParams as OrganizationCreateParams, type OrganizationUpdateParams as OrganizationUpdateParams, diff --git a/src/resources/queues/consumers.ts b/src/resources/queues/consumers.ts index 43eae71410..93596e00ee 100644 --- a/src/resources/queues/consumers.ts +++ b/src/resources/queues/consumers.ts @@ -106,33 +106,6 @@ export class Consumers extends APIResource { const { account_id } = params; return this._client.delete(`/accounts/${account_id}/queues/${queueId}/consumers/${consumerId}`, options); } - - /** - * Fetches the consumer for a queue by consumer id - * - * @example - * ```ts - * const consumer = await client.queues.consumers.get( - * '023e105f4ecef8ad9ca31a8372d0c353', - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - get( - queueId: string, - consumerId: string, - params: ConsumerGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - 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); - } } export class ConsumersSinglePage extends SinglePage {} @@ -491,13 +464,6 @@ export interface ConsumerDeleteParams { account_id: string; } -export interface ConsumerGetParams { - /** - * A Resource identifier. - */ - account_id: string; -} - Consumers.ConsumersSinglePage = ConsumersSinglePage; export declare namespace Consumers { @@ -509,6 +475,5 @@ export declare namespace Consumers { 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 ebf2923861..32568cd469 100644 --- a/src/resources/queues/index.ts +++ b/src/resources/queues/index.ts @@ -9,30 +9,15 @@ export { type ConsumerUpdateParams, type ConsumerListParams, type ConsumerDeleteParams, - 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'; -export { - SubscriptionListResponsesV4PagePaginationArray, - Subscriptions, - type SubscriptionCreateResponse, - type SubscriptionUpdateResponse, - type SubscriptionListResponse, - type SubscriptionDeleteResponse, - type SubscriptionCreateParams, - type SubscriptionUpdateParams, - type SubscriptionListParams, - type SubscriptionDeleteParams, -} from './subscriptions'; +export { Subscriptions } from './subscriptions'; 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 667ab7a44a..15d1651711 100644 --- a/src/resources/queues/queues.ts +++ b/src/resources/queues/queues.ts @@ -9,7 +9,6 @@ import { ConsumerCreateParams, ConsumerDeleteParams, ConsumerDeleteResponse, - ConsumerGetParams, ConsumerListParams, ConsumerUpdateParams, Consumers, @@ -19,29 +18,15 @@ import * as MessagesAPI from './messages'; import { MessageAckParams, MessageAckResponse, - MessageBulkPushParams, - MessageBulkPushResponse, MessagePullParams, MessagePullResponse, - MessagePushParams, - MessagePushResponse, + MessagePullResponsesSinglePage, Messages, } from './messages'; import * as PurgeAPI from './purge'; import { Purge, PurgeStartParams, PurgeStatusParams, PurgeStatusResponse } from './purge'; import * as SubscriptionsAPI from './subscriptions'; -import { - SubscriptionCreateParams, - SubscriptionCreateResponse, - SubscriptionDeleteParams, - SubscriptionDeleteResponse, - SubscriptionListParams, - SubscriptionListResponse, - SubscriptionListResponsesV4PagePaginationArray, - SubscriptionUpdateParams, - SubscriptionUpdateResponse, - Subscriptions, -} from './subscriptions'; +import { Subscriptions } from './subscriptions'; import { SinglePage } from '../../pagination'; export class Queues extends APIResource { @@ -343,11 +328,11 @@ export interface QueueGetParams { Queues.QueuesSinglePage = QueuesSinglePage; Queues.Messages = Messages; +Queues.MessagePullResponsesSinglePage = MessagePullResponsesSinglePage; Queues.Purge = Purge; Queues.Consumers = Consumers; Queues.ConsumersSinglePage = ConsumersSinglePage; Queues.Subscriptions = Subscriptions; -Queues.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; export declare namespace Queues { export { @@ -365,13 +350,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 { @@ -390,19 +372,7 @@ export declare namespace Queues { type ConsumerUpdateParams as ConsumerUpdateParams, type ConsumerListParams as ConsumerListParams, type ConsumerDeleteParams as ConsumerDeleteParams, - type ConsumerGetParams as ConsumerGetParams, }; - export { - Subscriptions as Subscriptions, - type SubscriptionCreateResponse as SubscriptionCreateResponse, - type SubscriptionUpdateResponse as SubscriptionUpdateResponse, - type SubscriptionListResponse as SubscriptionListResponse, - type SubscriptionDeleteResponse as SubscriptionDeleteResponse, - SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, - type SubscriptionCreateParams as SubscriptionCreateParams, - type SubscriptionUpdateParams as SubscriptionUpdateParams, - type SubscriptionListParams as SubscriptionListParams, - type SubscriptionDeleteParams as SubscriptionDeleteParams, - }; + export { Subscriptions as Subscriptions }; } diff --git a/src/resources/queues/subscriptions.ts b/src/resources/queues/subscriptions.ts index 3bb405e3fc..42d6ea9ea6 100644 --- a/src/resources/queues/subscriptions.ts +++ b/src/resources/queues/subscriptions.ts @@ -1,874 +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 Subscriptions extends APIResource { - /** - * Create a new event subscription for a queue - * - * @example - * ```ts - * const subscription = - * await client.queues.subscriptions.create({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - create( - params: SubscriptionCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/event_subscriptions/subscriptions`, { - body, - ...options, - }) as Core.APIPromise<{ result: SubscriptionCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Update an existing event subscription - * - * @example - * ```ts - * const subscription = - * await client.queues.subscriptions.update( - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - update( - subscriptionId: string, - params: SubscriptionUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.patch(`/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: SubscriptionUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Get a paginated list of event subscriptions with optional sorting and filtering - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const subscriptionListResponse of client.queues.subscriptions.list( - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` - */ - list( - params: SubscriptionListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id, ...query } = params; - return this._client.getAPIList( - `/accounts/${account_id}/event_subscriptions/subscriptions`, - SubscriptionListResponsesV4PagePaginationArray, - { query, ...options }, - ); - } - - /** - * Delete an existing event subscription - * - * @example - * ```ts - * const subscription = - * await client.queues.subscriptions.delete( - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - delete( - subscriptionId: string, - params: SubscriptionDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.delete( - `/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, - options, - ) as Core.APIPromise<{ result: SubscriptionDeleteResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export class SubscriptionListResponsesV4PagePaginationArray extends V4PagePaginationArray {} - -export interface SubscriptionCreateResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionCreateResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionCreateResponse.MqEventSourceImages - | SubscriptionCreateResponse.MqEventSourceKV - | SubscriptionCreateResponse.MqEventSourceR2 - | SubscriptionCreateResponse.MqEventSourceSuperSlurper - | SubscriptionCreateResponse.MqEventSourceVectorize - | SubscriptionCreateResponse.MqEventSourceWorkersAIModel - | SubscriptionCreateResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionCreateResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionCreateResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionUpdateResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionUpdateResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionUpdateResponse.MqEventSourceImages - | SubscriptionUpdateResponse.MqEventSourceKV - | SubscriptionUpdateResponse.MqEventSourceR2 - | SubscriptionUpdateResponse.MqEventSourceSuperSlurper - | SubscriptionUpdateResponse.MqEventSourceVectorize - | SubscriptionUpdateResponse.MqEventSourceWorkersAIModel - | SubscriptionUpdateResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionUpdateResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionUpdateResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionListResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionListResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionListResponse.MqEventSourceImages - | SubscriptionListResponse.MqEventSourceKV - | SubscriptionListResponse.MqEventSourceR2 - | SubscriptionListResponse.MqEventSourceSuperSlurper - | SubscriptionListResponse.MqEventSourceVectorize - | SubscriptionListResponse.MqEventSourceWorkersAIModel - | SubscriptionListResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionListResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionListResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionDeleteResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionDeleteResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionDeleteResponse.MqEventSourceImages - | SubscriptionDeleteResponse.MqEventSourceKV - | SubscriptionDeleteResponse.MqEventSourceR2 - | SubscriptionDeleteResponse.MqEventSourceSuperSlurper - | SubscriptionDeleteResponse.MqEventSourceVectorize - | SubscriptionDeleteResponse.MqEventSourceWorkersAIModel - | SubscriptionDeleteResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionDeleteResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionDeleteResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionCreateParams { - /** - * Path param: A Resource identifier. - */ - account_id: string; - - /** - * Body param: Destination configuration for the subscription - */ - destination?: SubscriptionCreateParams.Destination; - - /** - * Body param: Whether the subscription is active - */ - enabled?: boolean; - - /** - * Body param: List of event types this subscription handles - */ - events?: Array; - - /** - * Body param: Name of the subscription - */ - name?: string; - - /** - * Body param: Source configuration for the subscription - */ - source?: - | SubscriptionCreateParams.MqEventSourceImages - | SubscriptionCreateParams.MqEventSourceKV - | SubscriptionCreateParams.MqEventSourceR2 - | SubscriptionCreateParams.MqEventSourceSuperSlurper - | SubscriptionCreateParams.MqEventSourceVectorize - | SubscriptionCreateParams.MqEventSourceWorkersAIModel - | SubscriptionCreateParams.MqEventSourceWorkersBuildsWorker - | SubscriptionCreateParams.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionCreateParams { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionUpdateParams { - /** - * Path param: A Resource identifier. - */ - account_id: string; - - /** - * Body param: Destination configuration for the subscription - */ - destination?: SubscriptionUpdateParams.Destination; - - /** - * Body param: Whether the subscription is active - */ - enabled?: boolean; - - /** - * Body param: List of event types this subscription handles - */ - events?: Array; - - /** - * Body param: Name of the subscription - */ - name?: string; -} - -export namespace SubscriptionUpdateParams { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } -} - -export interface SubscriptionListParams extends V4PagePaginationArrayParams { - /** - * Path param: A Resource identifier. - */ - account_id: string; - - /** - * Query param: Sort direction - */ - direction?: 'asc' | 'desc'; - - /** - * Query param: Field to sort by - */ - order?: 'created_at' | 'name' | 'enabled' | 'source'; -} - -export interface SubscriptionDeleteParams { - /** - * A Resource identifier. - */ - account_id: string; -} - -Subscriptions.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; - -export declare namespace Subscriptions { - export { - type SubscriptionCreateResponse as SubscriptionCreateResponse, - type SubscriptionUpdateResponse as SubscriptionUpdateResponse, - type SubscriptionListResponse as SubscriptionListResponse, - type SubscriptionDeleteResponse as SubscriptionDeleteResponse, - SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, - type SubscriptionCreateParams as SubscriptionCreateParams, - type SubscriptionUpdateParams as SubscriptionUpdateParams, - type SubscriptionListParams as SubscriptionListParams, - type SubscriptionDeleteParams as SubscriptionDeleteParams, - }; -} +export class Subscriptions extends APIResource {} diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts index 829a017a4b..4ba71c4acf 100644 --- a/src/resources/radar/ct/logs.ts +++ b/src/resources/radar/ct/logs.ts @@ -121,12 +121,6 @@ export namespace LogGetResponse { */ api: 'RFC6962' | 'STATIC'; - /** - * The average throughput of the CT log, measured in certificates per hour - * (certs/hour). - */ - avgThroughput: number; - /** * A brief description of the certificate log. */ @@ -137,11 +131,6 @@ export namespace LogGetResponse { */ endExclusive: string; - /** - * Timestamp of the most recent update to the CT log. - */ - lastUpdate: string; - /** * The organization responsible for operating the certificate log. */ @@ -179,18 +168,6 @@ export namespace LogGetResponse { */ stateTimestamp: string; - /** - * Number of certificates that are eligible for inclusion to this log but have not - * been included yet. Based on certificates signed by trusted root CAs within the - * log's accepted date range. - */ - submittableCertCount: string | null; - - /** - * Number of certificates already included in this CT log. - */ - submittedCertCount: string | null; - /** * The URL for the certificate log. */ diff --git a/src/resources/secrets-store/stores/secrets.ts b/src/resources/secrets-store/stores/secrets.ts index ec0ca694ed..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', 'ai_gateway', 'dex', 'access'], + * scopes: ['workers', 'ai_gateway'], * value: 'api-token-secret-123', * }, * ], @@ -135,7 +135,7 @@ export class Secrets extends APIResource { * { * account_id: '985e105f4ecef8ad9ca31a8372d0c353', * name: 'MY_API_KEY', - * scopes: ['workers', 'ai_gateway', 'dex', 'access'], + * scopes: ['workers', 'ai_gateway'], * }, * ); * ``` diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts index d2cb382d90..4af2451c88 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts @@ -63,6 +63,7 @@ export type BindingGetResponse = | BindingGetResponse.WorkersBindingKindSecretText | BindingGetResponse.WorkersBindingKindSendEmail | BindingGetResponse.WorkersBindingKindService + | BindingGetResponse.WorkersBindingKindTailConsumer | BindingGetResponse.WorkersBindingKindTextBlob | BindingGetResponse.WorkersBindingKindVectorize | BindingGetResponse.WorkersBindingKindVersionMetadata @@ -492,6 +493,23 @@ export namespace BindingGetResponse { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. 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 554313f4d3..78e5e95423 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -372,6 +372,7 @@ export namespace ScriptUpdateParams { | Metadata.WorkersBindingKindSecretText | Metadata.WorkersBindingKindSendEmail | Metadata.WorkersBindingKindService + | Metadata.WorkersBindingKindTailConsumer | Metadata.WorkersBindingKindTextBlob | Metadata.WorkersBindingKindVectorize | Metadata.WorkersBindingKindVersionMetadata @@ -945,6 +946,23 @@ export namespace ScriptUpdateParams { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. 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 fb897aea3f..216456a041 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -91,6 +91,7 @@ export interface SettingEditResponse { | SettingEditResponse.WorkersBindingKindSecretText | SettingEditResponse.WorkersBindingKindSendEmail | SettingEditResponse.WorkersBindingKindService + | SettingEditResponse.WorkersBindingKindTailConsumer | SettingEditResponse.WorkersBindingKindTextBlob | SettingEditResponse.WorkersBindingKindVectorize | SettingEditResponse.WorkersBindingKindVersionMetadata @@ -571,6 +572,23 @@ export namespace SettingEditResponse { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -825,6 +843,7 @@ export interface SettingGetResponse { | SettingGetResponse.WorkersBindingKindSecretText | SettingGetResponse.WorkersBindingKindSendEmail | SettingGetResponse.WorkersBindingKindService + | SettingGetResponse.WorkersBindingKindTailConsumer | SettingGetResponse.WorkersBindingKindTextBlob | SettingGetResponse.WorkersBindingKindVectorize | SettingGetResponse.WorkersBindingKindVersionMetadata @@ -1305,6 +1324,23 @@ export namespace SettingGetResponse { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1572,6 +1608,7 @@ export namespace SettingEditParams { | Settings.WorkersBindingKindSecretText | Settings.WorkersBindingKindSendEmail | Settings.WorkersBindingKindService + | Settings.WorkersBindingKindTailConsumer | Settings.WorkersBindingKindTextBlob | Settings.WorkersBindingKindVectorize | Settings.WorkersBindingKindVersionMetadata @@ -2062,6 +2099,23 @@ export namespace SettingEditParams { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers/beta/workers/versions.ts b/src/resources/workers/beta/workers/versions.ts index 66bebbd506..185cea7033 100644 --- a/src/resources/workers/beta/workers/versions.ts +++ b/src/resources/workers/beta/workers/versions.ts @@ -176,6 +176,7 @@ export interface Version { | Version.WorkersBindingKindSecretText | Version.WorkersBindingKindSendEmail | Version.WorkersBindingKindService + | Version.WorkersBindingKindTailConsumer | Version.WorkersBindingKindTextBlob | Version.WorkersBindingKindVectorize | Version.WorkersBindingKindVersionMetadata @@ -733,6 +734,23 @@ export namespace Version { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1021,6 +1039,7 @@ export interface VersionCreateParams { | VersionCreateParams.WorkersBindingKindSecretText | VersionCreateParams.WorkersBindingKindSendEmail | VersionCreateParams.WorkersBindingKindService + | VersionCreateParams.WorkersBindingKindTailConsumer | VersionCreateParams.WorkersBindingKindTextBlob | VersionCreateParams.WorkersBindingKindVectorize | VersionCreateParams.WorkersBindingKindVersionMetadata @@ -1574,6 +1593,23 @@ export namespace VersionCreateParams { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. 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/workers/scripts/script-and-version-settings.ts b/src/resources/workers/scripts/script-and-version-settings.ts index 54237b4091..d6ef7552ca 100644 --- a/src/resources/workers/scripts/script-and-version-settings.ts +++ b/src/resources/workers/scripts/script-and-version-settings.ts @@ -87,6 +87,7 @@ export interface ScriptAndVersionSettingEditResponse { | ScriptAndVersionSettingEditResponse.WorkersBindingKindSecretText | ScriptAndVersionSettingEditResponse.WorkersBindingKindSendEmail | ScriptAndVersionSettingEditResponse.WorkersBindingKindService + | ScriptAndVersionSettingEditResponse.WorkersBindingKindTailConsumer | ScriptAndVersionSettingEditResponse.WorkersBindingKindTextBlob | ScriptAndVersionSettingEditResponse.WorkersBindingKindVectorize | ScriptAndVersionSettingEditResponse.WorkersBindingKindVersionMetadata @@ -567,6 +568,23 @@ export namespace ScriptAndVersionSettingEditResponse { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -821,6 +839,7 @@ export interface ScriptAndVersionSettingGetResponse { | ScriptAndVersionSettingGetResponse.WorkersBindingKindSecretText | ScriptAndVersionSettingGetResponse.WorkersBindingKindSendEmail | ScriptAndVersionSettingGetResponse.WorkersBindingKindService + | ScriptAndVersionSettingGetResponse.WorkersBindingKindTailConsumer | ScriptAndVersionSettingGetResponse.WorkersBindingKindTextBlob | ScriptAndVersionSettingGetResponse.WorkersBindingKindVectorize | ScriptAndVersionSettingGetResponse.WorkersBindingKindVersionMetadata @@ -1301,6 +1320,23 @@ export namespace ScriptAndVersionSettingGetResponse { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1568,6 +1604,7 @@ export namespace ScriptAndVersionSettingEditParams { | Settings.WorkersBindingKindSecretText | Settings.WorkersBindingKindSendEmail | Settings.WorkersBindingKindService + | Settings.WorkersBindingKindTailConsumer | Settings.WorkersBindingKindTextBlob | Settings.WorkersBindingKindVectorize | Settings.WorkersBindingKindVersionMetadata @@ -2058,6 +2095,23 @@ export namespace ScriptAndVersionSettingEditParams { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index a52d8a4ad2..70546d5580 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -681,6 +681,7 @@ export namespace ScriptUpdateParams { | Metadata.WorkersBindingKindSecretText | Metadata.WorkersBindingKindSendEmail | Metadata.WorkersBindingKindService + | Metadata.WorkersBindingKindTailConsumer | Metadata.WorkersBindingKindTextBlob | Metadata.WorkersBindingKindVectorize | Metadata.WorkersBindingKindVersionMetadata @@ -1254,6 +1255,23 @@ export namespace ScriptUpdateParams { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers/scripts/versions.ts b/src/resources/workers/scripts/versions.ts index 67d82e7c99..c9027b6f0c 100644 --- a/src/resources/workers/scripts/versions.ts +++ b/src/resources/workers/scripts/versions.ts @@ -134,6 +134,7 @@ export namespace VersionCreateResponse { | Resources.WorkersBindingKindSecretText | Resources.WorkersBindingKindSendEmail | Resources.WorkersBindingKindService + | Resources.WorkersBindingKindTailConsumer | Resources.WorkersBindingKindTextBlob | Resources.WorkersBindingKindVectorize | Resources.WorkersBindingKindVersionMetadata @@ -569,6 +570,23 @@ export namespace VersionCreateResponse { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -852,6 +870,7 @@ export namespace VersionGetResponse { | Resources.WorkersBindingKindSecretText | Resources.WorkersBindingKindSendEmail | Resources.WorkersBindingKindService + | Resources.WorkersBindingKindTailConsumer | Resources.WorkersBindingKindTextBlob | Resources.WorkersBindingKindVectorize | Resources.WorkersBindingKindVersionMetadata @@ -1287,6 +1306,23 @@ export namespace VersionGetResponse { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1562,6 +1598,7 @@ export namespace VersionCreateParams { | Metadata.WorkersBindingKindSecretText | Metadata.WorkersBindingKindSendEmail | Metadata.WorkersBindingKindService + | Metadata.WorkersBindingKindTailConsumer | Metadata.WorkersBindingKindTextBlob | Metadata.WorkersBindingKindVectorize | Metadata.WorkersBindingKindVersionMetadata @@ -2038,6 +2075,23 @@ export namespace VersionCreateParams { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. 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 2740494438..8ab49d5567 100644 --- a/src/resources/workflows/instances/instances.ts +++ b/src/resources/workflows/instances/instances.ts @@ -1,429 +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: `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. - */ - date_end?: string; - - /** - * Query param: Accepts ISO 8601 with no timezone offsets and in UTC. - */ - date_start?: string; - - /** - * Query param: should only be used when `cursor` is used, defines a new direction - * for the cursor - */ - direction?: 'asc' | 'desc'; - - /** - * 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/access/applications/applications.ts b/src/resources/zero-trust/access/applications/applications.ts index 00a1c63b2a..1c6afd035f 100644 --- a/src/resources/zero-trust/access/applications/applications.ts +++ b/src/resources/zero-trust/access/applications/applications.ts @@ -1667,9 +1667,7 @@ export type ApplicationType = | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * The application type. @@ -1685,9 +1683,7 @@ export type ApplicationTypeParam = | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; export interface CORSHeaders { /** @@ -2674,11 +2670,7 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | SelfHostedApplication.PublicDestination - | SelfHostedApplication.PrivateDestination - | SelfHostedApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -2787,6 +2779,10 @@ export namespace ApplicationCreateResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -2818,19 +2814,6 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -3280,9 +3263,7 @@ export namespace ApplicationCreateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -3354,11 +3335,7 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserSSHApplication.PublicDestination - | BrowserSSHApplication.PrivateDestination - | BrowserSSHApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -3467,6 +3444,10 @@ export namespace ApplicationCreateResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -3498,19 +3479,6 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -3713,9 +3681,7 @@ export namespace ApplicationCreateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -3787,11 +3753,7 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserVNCApplication.PublicDestination - | BrowserVNCApplication.PrivateDestination - | BrowserVNCApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -3900,6 +3862,10 @@ export namespace ApplicationCreateResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -3931,19 +3897,6 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -4140,9 +4093,7 @@ export namespace ApplicationCreateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -4908,11 +4859,7 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserRdpApplication.PublicDestination - | BrowserRdpApplication.PrivateDestination - | BrowserRdpApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -5039,6 +4986,10 @@ export namespace ApplicationCreateResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -5070,19 +5021,6 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -5360,11 +5298,7 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | SelfHostedApplication.PublicDestination - | SelfHostedApplication.PrivateDestination - | SelfHostedApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -5473,6 +5407,10 @@ export namespace ApplicationUpdateResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -5504,19 +5442,6 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -5966,9 +5891,7 @@ export namespace ApplicationUpdateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -6040,11 +5963,7 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserSSHApplication.PublicDestination - | BrowserSSHApplication.PrivateDestination - | BrowserSSHApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -6153,6 +6072,10 @@ export namespace ApplicationUpdateResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -6184,19 +6107,6 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -6399,9 +6309,7 @@ export namespace ApplicationUpdateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -6473,11 +6381,7 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserVNCApplication.PublicDestination - | BrowserVNCApplication.PrivateDestination - | BrowserVNCApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -6586,6 +6490,10 @@ export namespace ApplicationUpdateResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -6617,19 +6525,6 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -6826,9 +6721,7 @@ export namespace ApplicationUpdateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -7594,11 +7487,7 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserRdpApplication.PublicDestination - | BrowserRdpApplication.PrivateDestination - | BrowserRdpApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -7725,6 +7614,10 @@ export namespace ApplicationUpdateResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -7756,19 +7649,6 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -8046,11 +7926,7 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | SelfHostedApplication.PublicDestination - | SelfHostedApplication.PrivateDestination - | SelfHostedApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -8159,6 +8035,10 @@ export namespace ApplicationListResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -8190,19 +8070,6 @@ export namespace ApplicationListResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -8652,9 +8519,7 @@ export namespace ApplicationListResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -8726,11 +8591,7 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserSSHApplication.PublicDestination - | BrowserSSHApplication.PrivateDestination - | BrowserSSHApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -8839,6 +8700,10 @@ export namespace ApplicationListResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -8870,19 +8735,6 @@ export namespace ApplicationListResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -9085,9 +8937,7 @@ export namespace ApplicationListResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -9159,11 +9009,7 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserVNCApplication.PublicDestination - | BrowserVNCApplication.PrivateDestination - | BrowserVNCApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -9272,6 +9118,10 @@ export namespace ApplicationListResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -9303,19 +9153,6 @@ export namespace ApplicationListResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -9512,9 +9349,7 @@ export namespace ApplicationListResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -10280,11 +10115,7 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserRdpApplication.PublicDestination - | BrowserRdpApplication.PrivateDestination - | BrowserRdpApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -10411,6 +10242,10 @@ export namespace ApplicationListResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -10442,19 +10277,6 @@ export namespace ApplicationListResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -10739,11 +10561,7 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | SelfHostedApplication.PublicDestination - | SelfHostedApplication.PrivateDestination - | SelfHostedApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -10852,6 +10670,10 @@ export namespace ApplicationGetResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -10883,19 +10705,6 @@ export namespace ApplicationGetResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -11345,9 +11154,7 @@ export namespace ApplicationGetResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -11419,11 +11226,7 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserSSHApplication.PublicDestination - | BrowserSSHApplication.PrivateDestination - | BrowserSSHApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -11532,6 +11335,10 @@ export namespace ApplicationGetResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -11563,19 +11370,6 @@ export namespace ApplicationGetResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -11778,9 +11572,7 @@ export namespace ApplicationGetResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -11852,11 +11644,7 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserVNCApplication.PublicDestination - | BrowserVNCApplication.PrivateDestination - | BrowserVNCApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -11965,6 +11753,10 @@ export namespace ApplicationGetResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -11996,19 +11788,6 @@ export namespace ApplicationGetResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -12205,9 +11984,7 @@ export namespace ApplicationGetResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -12973,11 +12750,7 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserRdpApplication.PublicDestination - | BrowserRdpApplication.PrivateDestination - | BrowserRdpApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -13104,6 +12877,10 @@ export namespace ApplicationGetResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -13135,19 +12912,6 @@ export namespace ApplicationGetResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -13434,11 +13198,7 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array< - | SelfHostedApplication.PublicDestination - | SelfHostedApplication.PrivateDestination - | SelfHostedApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Body param: Enables the binding cookie, which increases security against @@ -13553,6 +13313,10 @@ export declare namespace ApplicationCreateParams { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -13584,19 +13348,6 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - /** * A JSON that links a reusable policy to an application. */ @@ -14023,9 +13774,7 @@ export declare namespace ApplicationCreateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -14104,11 +13853,7 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array< - | BrowserSSHApplication.PublicDestination - | BrowserSSHApplication.PrivateDestination - | BrowserSSHApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Body param: Enables the binding cookie, which increases security against @@ -14223,6 +13968,10 @@ export declare namespace ApplicationCreateParams { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -14254,19 +14003,6 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - /** * A JSON that links a reusable policy to an application. */ @@ -14452,9 +14188,7 @@ export declare namespace ApplicationCreateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -14533,11 +14267,7 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array< - | BrowserVNCApplication.PublicDestination - | BrowserVNCApplication.PrivateDestination - | BrowserVNCApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Body param: Enables the binding cookie, which increases security against @@ -14652,6 +14382,10 @@ export declare namespace ApplicationCreateParams { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -14683,19 +14417,6 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - /** * A JSON that links a reusable policy to an application. */ @@ -14875,9 +14596,7 @@ export declare namespace ApplicationCreateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -15605,11 +15324,7 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array< - | BrowserRdpApplication.PublicDestination - | BrowserRdpApplication.PrivateDestination - | BrowserRdpApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Body param: Enables the binding cookie, which increases security against @@ -15742,6 +15457,10 @@ export declare namespace ApplicationCreateParams { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -15773,19 +15492,6 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - /** * A JSON that links a reusable policy to an application. */ @@ -16053,11 +15759,7 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array< - | SelfHostedApplication.PublicDestination - | SelfHostedApplication.PrivateDestination - | SelfHostedApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Body param: Enables the binding cookie, which increases security against @@ -16172,6 +15874,10 @@ export declare namespace ApplicationUpdateParams { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -16203,19 +15909,6 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - /** * A JSON that links a reusable policy to an application. */ @@ -16642,9 +16335,7 @@ export declare namespace ApplicationUpdateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -16723,11 +16414,7 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array< - | BrowserSSHApplication.PublicDestination - | BrowserSSHApplication.PrivateDestination - | BrowserSSHApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Body param: Enables the binding cookie, which increases security against @@ -16842,6 +16529,10 @@ export declare namespace ApplicationUpdateParams { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -16873,19 +16564,6 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - /** * A JSON that links a reusable policy to an application. */ @@ -17071,9 +16749,7 @@ export declare namespace ApplicationUpdateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -17152,11 +16828,7 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array< - | BrowserVNCApplication.PublicDestination - | BrowserVNCApplication.PrivateDestination - | BrowserVNCApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Body param: Enables the binding cookie, which increases security against @@ -17271,6 +16943,10 @@ export declare namespace ApplicationUpdateParams { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -17302,19 +16978,6 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - /** * A JSON that links a reusable policy to an application. */ @@ -17494,9 +17157,7 @@ export declare namespace ApplicationUpdateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -18224,11 +17885,7 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array< - | BrowserRdpApplication.PublicDestination - | BrowserRdpApplication.PrivateDestination - | BrowserRdpApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Body param: Enables the binding cookie, which increases security against @@ -18361,6 +18018,10 @@ export declare namespace ApplicationUpdateParams { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -18392,19 +18053,6 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - /** * A JSON that links a reusable policy to an application. */ diff --git a/src/resources/zero-trust/access/logs/access-requests.ts b/src/resources/zero-trust/access/logs/access-requests.ts index 4905779655..eb75000b09 100644 --- a/src/resources/zero-trust/access/logs/access-requests.ts +++ b/src/resources/zero-trust/access/logs/access-requests.ts @@ -43,20 +43,6 @@ export interface AccessRequestListParams { */ direction?: 'desc' | 'asc'; - /** - * Query param: Filter by user email. Defaults to substring matching. To force - * exact matching, set `email_exact=true`. Example (default): `email=@example.com` - * returns all events with that domain. Example (exact): - * `email=user@example.com&email_exact=true` returns only that user. - */ - email?: string; - - /** - * Query param: When true, `email` is matched exactly instead of substring - * matching. - */ - email_exact?: boolean; - /** * Query param: The maximum number of log entries to retrieve. */ @@ -81,11 +67,6 @@ export interface AccessRequestListParams { * Query param: The latest event timestamp to query. */ until?: string; - - /** - * Query param: Filter by user UUID. - */ - user_id?: string; } export declare namespace AccessRequests { diff --git a/src/resources/zero-trust/devices/dex-tests.ts b/src/resources/zero-trust/devices/dex-tests.ts index 4446969263..024ac99cae 100644 --- a/src/resources/zero-trust/devices/dex-tests.ts +++ b/src/resources/zero-trust/devices/dex-tests.ts @@ -13,7 +13,10 @@ export class DEXTests extends APIResource { * const dexTest = * await client.zeroTrust.devices.dexTests.create({ * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: {}, + * data: { + * host: 'https://dash.cloudflare.com', + * kind: 'http', + * }, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -40,7 +43,10 @@ export class DEXTests extends APIResource { * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: {}, + * data: { + * host: 'https://dash.cloudflare.com', + * kind: 'http', + * }, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -271,24 +277,24 @@ export namespace DEXTestCreateResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -351,24 +357,24 @@ export namespace DEXTestUpdateResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -431,24 +437,24 @@ export namespace DEXTestListResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -516,24 +522,24 @@ export namespace DEXTestDeleteResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -597,24 +603,24 @@ export namespace DEXTestGetResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -680,24 +686,24 @@ export namespace DEXTestCreateParams { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -763,24 +769,24 @@ export namespace DEXTestUpdateParams { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default 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/zero-trust/dex/dex.ts b/src/resources/zero-trust/dex/dex.ts index f12a3ad01f..a500404035 100644 --- a/src/resources/zero-trust/dex/dex.ts +++ b/src/resources/zero-trust/dex/dex.ts @@ -29,6 +29,7 @@ import { FleetStatusLiveParams, FleetStatusLiveResponse, FleetStatusOverTimeParams, + FleetStatusOverTimeResponse, LiveStat, } from './fleet-status/fleet-status'; import * as HTTPTestsAPI from './http-tests/http-tests'; @@ -53,6 +54,9 @@ export class DEX extends APIResource { } export interface DigitalExperienceMonitor { + /** + * API Resource UUID tag. + */ id: string; /** @@ -208,6 +212,7 @@ export declare namespace DEX { FleetStatus as FleetStatus, type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, + type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts index a64c26da75..43f7978b75 100644 --- a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts +++ b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts @@ -44,20 +44,25 @@ export class FleetStatus extends APIResource { * * @example * ```ts - * await client.zeroTrust.dex.fleetStatus.overTime({ - * account_id: '01a7362d577a6c3019a474fd6f485823', - * from: '2023-10-11T00:00:00Z', - * to: '2023-10-11T00:00:00Z', - * }); + * const response = + * await client.zeroTrust.dex.fleetStatus.overTime({ + * account_id: '01a7362d577a6c3019a474fd6f485823', + * from: '2023-10-11T00:00:00Z', + * to: '2023-10-11T00:00:00Z', + * }); * ``` */ - overTime(params: FleetStatusOverTimeParams, options?: Core.RequestOptions): Core.APIPromise { + overTime( + params: FleetStatusOverTimeParams, + options?: Core.RequestOptions, + ): Core.APIPromise { const { account_id, ...query } = params; - return this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { - query, - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + return ( + this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { + query, + ...options, + }) as Core.APIPromise<{ result: FleetStatusOverTimeResponse }> + )._thenUnwrap((obj) => obj.result); } } @@ -93,6 +98,53 @@ export namespace FleetStatusLiveResponse { } } +export interface FleetStatusOverTimeResponse { + deviceStats?: FleetStatusOverTimeResponse.DeviceStats; +} + +export namespace FleetStatusOverTimeResponse { + export interface DeviceStats { + byMode?: Array; + + byStatus?: Array; + + /** + * Number of unique devices + */ + uniqueDevicesTotal?: number; + } + + export namespace DeviceStats { + export interface ByMode { + /** + * Timestamp in ISO format + */ + timestamp?: string; + + /** + * Number of unique devices + */ + uniqueDevicesTotal?: number; + + value?: string; + } + + export interface ByStatus { + /** + * Timestamp in ISO format + */ + timestamp?: string; + + /** + * Number of unique devices + */ + uniqueDevicesTotal?: number; + + value?: string; + } + } +} + export interface FleetStatusLiveParams { /** * Path param: Unique identifier for account @@ -139,6 +191,7 @@ export declare namespace FleetStatus { export { type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, + type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/index.ts b/src/resources/zero-trust/dex/fleet-status/index.ts index 31cdb34bb8..8bf3ee7730 100644 --- a/src/resources/zero-trust/dex/fleet-status/index.ts +++ b/src/resources/zero-trust/dex/fleet-status/index.ts @@ -10,6 +10,7 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, + type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status'; diff --git a/src/resources/zero-trust/dex/index.ts b/src/resources/zero-trust/dex/index.ts index f97aa02d43..d0f4eae54c 100644 --- a/src/resources/zero-trust/dex/index.ts +++ b/src/resources/zero-trust/dex/index.ts @@ -20,6 +20,7 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, + type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status/index'; diff --git a/src/resources/zero-trust/dlp/entries/custom.ts b/src/resources/zero-trust/dlp/entries/custom.ts index 15d6ea9d8c..dcd4d0928f 100644 --- a/src/resources/zero-trust/dlp/entries/custom.ts +++ b/src/resources/zero-trust/dlp/entries/custom.ts @@ -17,6 +17,7 @@ export class Custom extends APIResource { * enabled: true, * name: 'name', * pattern: { regex: 'regex' }, + * profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * }); * ``` */ @@ -470,7 +471,7 @@ export interface CustomCreateParams { /** * Body param: */ - profile_id?: string; + profile_id: string; } export interface CustomUpdateParams { diff --git a/src/resources/zero-trust/dlp/entries/entries.ts b/src/resources/zero-trust/dlp/entries/entries.ts index de1cb6ba36..31eb68b9ee 100644 --- a/src/resources/zero-trust/dlp/entries/entries.ts +++ b/src/resources/zero-trust/dlp/entries/entries.ts @@ -65,6 +65,7 @@ export class Entries extends APIResource { * enabled: true, * name: 'name', * pattern: { regex: 'regex' }, + * profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * }); * ``` */ @@ -636,7 +637,7 @@ export interface EntryCreateParams { /** * Body param: */ - profile_id?: string; + profile_id: string; } export type EntryUpdateParams = diff --git a/src/resources/zero-trust/gateway/rules.ts b/src/resources/zero-trust/gateway/rules.ts index 328aafe540..0431f40330 100644 --- a/src/resources/zero-trust/gateway/rules.ts +++ b/src/resources/zero-trust/gateway/rules.ts @@ -295,7 +295,7 @@ export interface GatewayRule { /** * Specify the protocol or layer to evaluate the traffic, identity, and device - * posture expressions. Can only contain a single value. + * posture expressions. */ filters: Array; @@ -1558,7 +1558,7 @@ export interface RuleCreateParams { /** * Body param: Specify the protocol or layer to evaluate the traffic, identity, and - * device posture expressions. Can only contain a single value. + * device posture expressions. */ filters?: Array; @@ -1689,7 +1689,7 @@ export interface RuleUpdateParams { /** * Body param: Specify the protocol or layer to evaluate the traffic, identity, and - * device posture expressions. Can only contain a single value. + * device posture expressions. */ filters?: Array; diff --git a/tests/api-resources/abuse-reports.test.ts b/tests/api-resources/abuse-reports.test.ts new file mode 100644 index 0000000000..77af5bcdfb --- /dev/null +++ b/tests/api-resources/abuse-reports.test.ts @@ -0,0 +1,69 @@ +// 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 abuseReports', () => { + // TODO: investigate unauthorized HTTP response + test.skip('create: only required params', async () => { + const responsePromise = client.abuseReports.create('report_type', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + 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(); + 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 unauthorized HTTP response + test.skip('create: required and optional params', async () => { + const response = await client.abuseReports.create('report_type', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + 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', + comments: 'x', + company: 'x', + reported_country: 'xx', + reported_user_agent: 'x', + tele: 'x', + title: 'x', + }); + }); +}); diff --git a/tests/api-resources/accounts/accounts.test.ts b/tests/api-resources/accounts/accounts.test.ts index c3e50bb520..562c65986b 100644 --- a/tests/api-resources/accounts/accounts.test.ts +++ b/tests/api-resources/accounts/accounts.test.ts @@ -51,7 +51,6 @@ describe('resource accounts', () => { id: '023e105f4ecef8ad9ca31a8372d0c353', name: 'Demo Account', type: 'standard', - managed_by: {}, settings: { abuse_contact_email: 'abuse_contact_email', enforce_twofactor: true }, }); }); diff --git a/tests/api-resources/api-gateway/configurations.test.ts b/tests/api-resources/api-gateway/configurations.test.ts index 40818b7ce6..307fcd648e 100644 --- a/tests/api-resources/api-gateway/configurations.test.ts +++ b/tests/api-resources/api-gateway/configurations.test.ts @@ -47,6 +47,7 @@ describe('resource configurations', () => { test('get: required and optional params', async () => { const response = await client.apiGateway.configurations.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + properties: ['auth_id_characteristics'], }); }); }); 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 68105203c4..694b31d176 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 @@ -179,4 +179,21 @@ describe('resource threatEvents', () => { tlp: 'amber', }); }); + + // TODO: HTTP 401 from prism + test.skip('get: only required params', async () => { + const responsePromise = client.cloudforceOne.threatEvents.get('event_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.get('event_id', { account_id: 'account_id' }); + }); }); 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 a543062bc0..d69492f799 100644 --- a/tests/api-resources/kv/namespaces/namespaces.test.ts +++ b/tests/api-resources/kv/namespaces/namespaces.test.ts @@ -69,7 +69,7 @@ describe('resource namespaces', () => { direction: 'asc', order: 'id', page: 1, - per_page: 1, + per_page: 5, }); }); @@ -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 03fbaa4b52..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: {}, }); }); diff --git a/tests/api-resources/leaked-credential-checks/detections.test.ts b/tests/api-resources/leaked-credential-checks/detections.test.ts deleted file mode 100644 index f9a1af0b8e..0000000000 --- a/tests/api-resources/leaked-credential-checks/detections.test.ts +++ /dev/null @@ -1,98 +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 detections', () => { - test('create: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.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.leakedCredentialChecks.detections.create({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - password: 'lookup_json_string(http.request.body.raw, "secret")', - username: 'lookup_json_string(http.request.body.raw, "user")', - }); - }); - - test('update: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.update( - '18a14bafaa8eb1df04ce683ec18c765e', - { 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('update: required and optional params', async () => { - const response = await client.leakedCredentialChecks.detections.update( - '18a14bafaa8eb1df04ce683ec18c765e', - { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - password: 'lookup_json_string(http.request.body.raw, "secret")', - username: 'lookup_json_string(http.request.body.raw, "user")', - }, - ); - }); - - test('list: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.list({ - 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('list: required and optional params', async () => { - const response = await client.leakedCredentialChecks.detections.list({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - }); - - test('delete: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.delete( - '18a14bafaa8eb1df04ce683ec18c765e', - { 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('delete: required and optional params', async () => { - const response = await client.leakedCredentialChecks.detections.delete( - '18a14bafaa8eb1df04ce683ec18c765e', - { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); - }); -}); diff --git a/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts b/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts deleted file mode 100644 index c7c208f9ed..0000000000 --- a/tests/api-resources/leaked-credential-checks/leaked-credential-checks.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 leakedCredentialChecks', () => { - test('create: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.create({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - enabled: true, - }); - }); - - test('get: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); - }); -}); 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/consumers.test.ts b/tests/api-resources/queues/consumers.test.ts index e4275cc8e0..9cff12967c 100644 --- a/tests/api-resources/queues/consumers.test.ts +++ b/tests/api-resources/queues/consumers.test.ts @@ -115,27 +115,4 @@ describe('resource consumers', () => { { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); }); - - test('get: only required params', async () => { - const responsePromise = client.queues.consumers.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '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('get: required and optional params', async () => { - const response = await client.queues.consumers.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); - }); }); 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/queues/subscriptions.test.ts b/tests/api-resources/queues/subscriptions.test.ts deleted file mode 100644 index fed29a3ae9..0000000000 --- a/tests/api-resources/queues/subscriptions.test.ts +++ /dev/null @@ -1,101 +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 subscriptions', () => { - test('create: only required params', async () => { - const responsePromise = client.queues.subscriptions.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.queues.subscriptions.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - destination: { queue_id: 'queue_id', type: 'queues.queue' }, - enabled: true, - events: ['string'], - name: 'name', - source: { type: 'images' }, - }); - }); - - test('update: only required params', async () => { - const responsePromise = client.queues.subscriptions.update('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('update: required and optional params', async () => { - const response = await client.queues.subscriptions.update('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - destination: { queue_id: 'queue_id', type: 'queues.queue' }, - enabled: true, - events: ['string'], - name: 'name', - }); - }); - - test('list: only required params', async () => { - const responsePromise = client.queues.subscriptions.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.queues.subscriptions.list({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - direction: 'asc', - order: 'created_at', - page: 1, - per_page: 1, - }); - }); - - test('delete: only required params', async () => { - const responsePromise = client.queues.subscriptions.delete('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('delete: required and optional params', async () => { - const response = await client.queues.subscriptions.delete('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - }); -}); diff --git a/tests/api-resources/secrets-store/stores/secrets.test.ts b/tests/api-resources/secrets-store/stores/secrets.test.ts index 51d39096f9..afb8337e61 100644 --- a/tests/api-resources/secrets-store/stores/secrets.test.ts +++ b/tests/api-resources/secrets-store/stores/secrets.test.ts @@ -13,13 +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', 'ai_gateway', 'dex', 'access'], - 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); @@ -36,7 +30,7 @@ describe('resource secrets', () => { body: [ { name: 'MY_API_KEY', - scopes: ['workers', 'ai_gateway', 'dex', 'access'], + scopes: ['workers', 'ai_gateway'], value: 'api-token-secret-123', comment: 'info about my secret', }, @@ -66,7 +60,7 @@ describe('resource secrets', () => { order: 'name', page: 2, per_page: 20, - scopes: [['workers', 'ai_gateway', 'dex', 'access']], + scopes: [['workers', 'ai_gateway']], search: 'search', }); }); @@ -122,7 +116,7 @@ describe('resource secrets', () => { { account_id: '985e105f4ecef8ad9ca31a8372d0c353', name: 'MY_API_KEY', - scopes: ['workers', 'ai_gateway', 'dex', 'access'], + scopes: ['workers', 'ai_gateway'], }, ); const rawResponse = await responsePromise.asResponse(); @@ -142,7 +136,7 @@ describe('resource secrets', () => { { account_id: '985e105f4ecef8ad9ca31a8372d0c353', name: 'MY_API_KEY', - scopes: ['workers', 'ai_gateway', 'dex', 'access'], + scopes: ['workers', 'ai_gateway'], comment: 'info about my secret', }, ); @@ -172,7 +166,7 @@ describe('resource secrets', () => { { account_id: '985e105f4ecef8ad9ca31a8372d0c353', comment: 'info about my secret', - scopes: ['workers', 'ai_gateway', 'dex', 'access'], + scopes: ['workers', 'ai_gateway'], }, ); }); 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 cdad8d0e4b..0000000000 --- a/tests/api-resources/workflows/instances/instances.test.ts +++ /dev/null @@ -1,89 +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', - cursor: 'cursor', - date_end: '2019-12-27T18:11:19.117Z', - date_start: '2019-12-27T18:11:19.117Z', - direction: 'asc', - 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' }); - }); -}); diff --git a/tests/api-resources/zero-trust/access/applications/applications.test.ts b/tests/api-resources/zero-trust/access/applications/applications.test.ts index e4607eeda4..225d81744d 100644 --- a/tests/api-resources/zero-trust/access/applications/applications.test.ts +++ b/tests/api-resources/zero-trust/access/applications/applications.test.ts @@ -78,7 +78,6 @@ describe('resource applications', () => { type: 'private', vnet_id: 'vnet_id', }, - { mcp_server_id: 'mcp-server-1', type: 'via_mcp_server_portal' }, ], enable_binding_cookie: true, http_only_cookie_attribute: true, @@ -183,7 +182,6 @@ describe('resource applications', () => { type: 'private', vnet_id: 'vnet_id', }, - { mcp_server_id: 'mcp-server-1', type: 'via_mcp_server_portal' }, ], enable_binding_cookie: true, http_only_cookie_attribute: true, 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 50ec6a1d24..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 @@ -27,14 +27,11 @@ describe('resource accessRequests', () => { const response = await client.zeroTrust.access.logs.accessRequests.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', direction: 'desc', - email: 'user@example.com', - email_exact: true, limit: 0, page: 0, per_page: 0, since: '2020-07-01T05:20:00Z', until: '2020-10-01T05:20:00Z', - user_id: 'f757c5c3-c1b2-50f7-9126-150a099b6f7e', }); }); }); diff --git a/tests/api-resources/zero-trust/devices/dex-tests.test.ts b/tests/api-resources/zero-trust/devices/dex-tests.test.ts index 246e9b7961..0669d5569c 100644 --- a/tests/api-resources/zero-trust/devices/dex-tests.test.ts +++ b/tests/api-resources/zero-trust/devices/dex-tests.test.ts @@ -13,7 +13,7 @@ describe('resource dexTests', () => { test('create: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.create({ account_id: '01a7362d577a6c3019a474fd6f485823', - data: {}, + data: { host: 'https://dash.cloudflare.com', kind: 'http' }, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -35,7 +35,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'id', default: true, name: 'name' }], + target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], targeted: true, }); }); @@ -43,7 +43,7 @@ describe('resource dexTests', () => { test('update: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', - data: {}, + data: { host: 'https://dash.cloudflare.com', kind: 'http' }, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -65,7 +65,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'id', default: true, name: 'name' }], + target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], targeted: true, }); }); diff --git a/tests/api-resources/zero-trust/dlp/entries/custom.test.ts b/tests/api-resources/zero-trust/dlp/entries/custom.test.ts index a07726b8c7..fa0b9659df 100644 --- a/tests/api-resources/zero-trust/dlp/entries/custom.test.ts +++ b/tests/api-resources/zero-trust/dlp/entries/custom.test.ts @@ -16,6 +16,7 @@ describe('resource custom', () => { enabled: true, name: 'name', pattern: { regex: 'regex' }, + profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); diff --git a/tests/api-resources/zero-trust/dlp/entries/entries.test.ts b/tests/api-resources/zero-trust/dlp/entries/entries.test.ts index aaeb9ac8db..0758392e54 100644 --- a/tests/api-resources/zero-trust/dlp/entries/entries.test.ts +++ b/tests/api-resources/zero-trust/dlp/entries/entries.test.ts @@ -16,6 +16,7 @@ describe('resource entries', () => { enabled: true, name: 'name', pattern: { regex: 'regex' }, + profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); From 9fd9cb77c33102309695e0dae321f0bef5ad3ac7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Oct 2025 19:25:40 +0000 Subject: [PATCH 272/451] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 213 ++- scripts/detect-breaking-changes | 19 + .../alerting/destinations/webhooks.ts | 6 +- src/resources/alerting/policies.ts | 19 +- .../cloudforce-one/threat-events/index.ts | 6 +- .../threat-events/indicator-types.ts | 48 +- .../threat-events/threat-events.ts | 8 +- src/resources/custom-pages.ts | 48 +- .../email-security/investigate/investigate.ts | 46 - 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 | 139 +- src/resources/kv/namespaces/metadata.ts | 4 +- src/resources/kv/namespaces/namespaces.ts | 164 +- src/resources/kv/namespaces/values.ts | 33 +- .../leaked-credential-checks/detections.ts | 240 ++- .../leaked-credential-checks/index.ts | 13 +- .../leaked-credential-checks.ts | 121 +- 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/organizations/organizations.ts | 116 +- src/resources/pages/index.ts | 1 - src/resources/pages/pages.ts | 6 +- .../pages/projects/deployments/deployments.ts | 66 - src/resources/pages/projects/index.ts | 1 - src/resources/pages/projects/projects.ts | 569 +----- src/resources/pipelines.ts | 138 +- src/resources/queues/consumers.ts | 35 + src/resources/queues/index.ts | 19 +- src/resources/queues/messages.ts | 217 ++- src/resources/queues/queues.ts | 40 +- src/resources/queues/subscriptions.ts | 871 +++++++++- .../r2/super-slurper/connectivity-precheck.ts | 76 +- src/resources/r2/super-slurper/jobs/jobs.ts | 52 +- src/resources/radar/as112/as112.ts | 642 +------ src/resources/radar/as112/index.ts | 10 +- src/resources/radar/as112/summary.ts | 34 +- .../radar/as112/timeseries-groups.ts | 36 +- src/resources/radar/attacks/attacks.ts | 28 +- src/resources/radar/attacks/index.ts | 20 +- src/resources/radar/attacks/layer3/index.ts | 10 +- src/resources/radar/attacks/layer3/layer3.ts | 426 ----- src/resources/radar/attacks/layer3/summary.ts | 42 +- .../radar/attacks/layer3/timeseries-groups.ts | 42 +- src/resources/radar/attacks/layer7/index.ts | 10 +- src/resources/radar/attacks/layer7/layer7.ts | 604 ------- src/resources/radar/attacks/layer7/summary.ts | 42 +- .../radar/attacks/layer7/timeseries-groups.ts | 42 +- src/resources/radar/dns/dns.ts | 739 +------- src/resources/radar/dns/index.ts | 10 +- src/resources/radar/dns/summary.ts | 54 +- src/resources/radar/dns/timeseries-groups.ts | 60 +- src/resources/radar/email/email.ts | 32 +- src/resources/radar/email/index.ts | 16 +- src/resources/radar/email/routing/index.ts | 8 +- src/resources/radar/email/routing/routing.ts | 429 ----- src/resources/radar/email/routing/summary.ts | 36 +- .../radar/email/routing/timeseries-groups.ts | 36 +- src/resources/radar/email/security/index.ts | 8 +- .../radar/email/security/security.ts | 472 ----- src/resources/radar/email/security/summary.ts | 54 +- .../radar/email/security/timeseries-groups.ts | 54 +- src/resources/radar/entities/asns.ts | 12 +- src/resources/radar/index.ts | 20 +- src/resources/radar/netflows/netflows.ts | 2 +- src/resources/radar/radar.ts | 28 +- src/resources/stream/downloads.ts | 5 +- .../dispatch/namespaces/scripts/bindings.ts | 2 +- .../dispatch/namespaces/scripts/scripts.ts | 2 +- .../dispatch/namespaces/scripts/settings.ts | 6 +- .../workers/beta/workers/versions.ts | 4 +- src/resources/workers/beta/workers/workers.ts | 138 -- src/resources/workers/observability/index.ts | 12 +- .../workers/observability/observability.ts | 26 +- .../workers/observability/telemetry.ts | 1538 ++++++++++++++++- .../scripts/script-and-version-settings.ts | 6 +- src/resources/workers/scripts/scripts.ts | 2 +- src/resources/workers/scripts/versions.ts | 11 +- src/resources/workflows/index.ts | 23 +- src/resources/workflows/instances/events.ts | 40 +- src/resources/workflows/instances/index.ts | 18 +- .../workflows/instances/instances.ts | 416 ++++- src/resources/workflows/instances/status.ts | 54 +- src/resources/workflows/versions.ts | 87 +- src/resources/workflows/workflows.ts | 274 ++- src/resources/zero-trust/devices/dex-tests.ts | 80 +- src/resources/zero-trust/dex/colos.ts | 17 +- src/resources/zero-trust/dex/dex.ts | 5 - .../dex/fleet-status/fleet-status.ts | 75 +- .../zero-trust/dex/fleet-status/index.ts | 1 - src/resources/zero-trust/dex/index.ts | 1 - src/resources/zones/settings.ts | 38 +- .../alerting/destinations/webhooks.test.ts | 51 +- tests/api-resources/alerting/policies.test.ts | 26 +- .../threat-events/indicator-types.test.ts | 33 + .../api-resources/kv/namespaces/keys.test.ts | 31 +- .../kv/namespaces/namespaces.test.ts | 33 +- .../kv/namespaces/values.test.ts | 3 +- .../detections.test.ts | 98 ++ .../leaked-credential-checks.test.ts | 49 + .../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 + .../organization-profile.test.ts | 40 +- .../organizations/organizations.test.ts | 51 +- .../projects/deployments/deployments.test.ts | 14 +- .../pages/projects/projects.test.ts | 70 +- tests/api-resources/pipelines.test.ts | 20 +- tests/api-resources/queues/consumers.test.ts | 23 + tests/api-resources/queues/messages.test.ts | 43 + .../queues/subscriptions.test.ts | 101 ++ .../connectivity-precheck.test.ts | 20 +- .../r2/super-slurper/jobs/jobs.test.ts | 6 +- tests/api-resources/radar/as112/as112.test.ts | 83 - .../radar/attacks/layer3/layer3.test.ts | 84 - .../radar/attacks/layer7/layer7.test.ts | 88 - tests/api-resources/radar/dns/dns.test.ts | 89 - .../radar/email/routing/routing.test.ts | 97 -- .../radar/email/security/security.test.ts | 95 - .../workers/observability/telemetry.test.ts | 110 ++ .../workers/scripts/versions.test.ts | 6 +- .../workflows/instances/events.test.ts | 32 + .../workflows/instances/instances.test.ts | 89 + .../workflows/instances/status.test.ts | 33 + .../api-resources/workflows/versions.test.ts | 50 + .../api-resources/workflows/workflows.test.ts | 85 + .../zero-trust/devices/dex-tests.test.ts | 8 +- 141 files changed, 6853 insertions(+), 5800 deletions(-) create mode 100644 tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts create mode 100644 tests/api-resources/leaked-credential-checks/detections.test.ts create mode 100644 tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts 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/queues/subscriptions.test.ts delete mode 100644 tests/api-resources/radar/email/routing/routing.test.ts delete mode 100644 tests/api-resources/radar/email/security/security.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 3eda3dc310..4bf3c51952 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1814 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cceecd20dfd89884f795e75b433848994bed610b79802c65104f0c70d3ada54e.yml -openapi_spec_hash: c33c0e26e48c004c1781a36748d0144c +configured_endpoints: 1839 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ca8fbfa82d19dca400ec61b8c93392de1acd157860e435419f9a5e9ec8c586e0.yml +openapi_spec_hash: 77d55c70bc3824ac61bd056e2319ee18 config_hash: eab23d0b8fa818f1d1dc0e9e18de4266 diff --git a/api.md b/api.md index 19918fe7f0..7a9b01da24 100644 --- a/api.md +++ b/api.md @@ -134,7 +134,6 @@ Methods: - client.organizations.create({ ...params }) -> Organization - client.organizations.update(organizationId, { ...params }) -> Organization -- client.organizations.list({ ...params }) -> OrganizationsSinglePage - client.organizations.delete(organizationId) -> void - client.organizations.get(organizationId) -> Organization @@ -1740,16 +1739,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: @@ -2239,6 +2283,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 @@ -2246,18 +2302,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 @@ -2267,12 +2324,14 @@ Types: - Key - KeyBulkDeleteResponse +- KeyBulkGetResponse - KeyBulkUpdateResponse Methods: - 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 ### Metadata @@ -2341,12 +2400,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 @@ -2372,9 +2435,24 @@ Methods: - 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 ## Subscriptions +Types: + +- SubscriptionCreateResponse +- SubscriptionUpdateResponse +- SubscriptionListResponse +- SubscriptionDeleteResponse + +Methods: + +- client.queues.subscriptions.create({ ...params }) -> SubscriptionCreateResponse +- client.queues.subscriptions.update(subscriptionId, { ...params }) -> SubscriptionUpdateResponse +- client.queues.subscriptions.list({ ...params }) -> SubscriptionListResponsesV4PagePaginationArray +- client.queues.subscriptions.delete(subscriptionId, { ...params }) -> SubscriptionDeleteResponse + # APIGateway ## Configurations @@ -3871,7 +3949,7 @@ Types: Methods: - client.pages.projects.create({ ...params }) -> Project -- client.pages.projects.list({ ...params }) -> DeploymentsV4PagePaginationArray +- client.pages.projects.list({ ...params }) -> DeploymentsSinglePage - client.pages.projects.delete(projectName, { ...params }) -> ProjectDeleteResponse | null - client.pages.projects.edit(projectName, { ...params }) -> Project - client.pages.projects.get(projectName, { ...params }) -> Project @@ -5432,12 +5510,11 @@ Types: - LiveStat - FleetStatusLiveResponse -- FleetStatusOverTimeResponse Methods: - client.zeroTrust.dex.fleetStatus.live({ ...params }) -> FleetStatusLiveResponse -- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> FleetStatusOverTimeResponse +- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> void #### Devices @@ -6646,15 +6723,11 @@ Methods: Types: -- DNSSummaryV2Response - DNSTimeseriesResponse -- DNSTimeseriesGroupsV2Response Methods: -- client.radar.dns.summaryV2(dimension, { ...params }) -> DNSSummaryV2Response - client.radar.dns.timeseries({ ...params }) -> DNSTimeseriesResponse -- client.radar.dns.timeseriesGroupsV2(dimension, { ...params }) -> DNSTimeseriesGroupsV2Response ### Top @@ -6780,15 +6853,11 @@ Methods: Types: -- AS112SummaryV2Response - AS112TimeseriesResponse -- AS112TimeseriesGroupsV2Response Methods: -- client.radar.as112.summaryV2(dimension, { ...params }) -> AS112SummaryV2Response - client.radar.as112.timeseries({ ...params }) -> AS112TimeseriesResponse -- client.radar.as112.timeseriesGroupsV2(dimension, { ...params }) -> AS112TimeseriesGroupsV2Response ### Summary @@ -6855,16 +6924,6 @@ Types: ### Routing -Types: - -- RoutingSummaryV2Response -- RoutingTimeseriesGroupsV2Response - -Methods: - -- client.radar.email.routing.summaryV2(dimension, { ...params }) -> RoutingSummaryV2Response -- client.radar.email.routing.timeseriesGroupsV2(dimension, { ...params }) -> RoutingTimeseriesGroupsV2Response - #### Summary Types: @@ -6907,16 +6966,6 @@ Methods: ### Security -Types: - -- SecuritySummaryV2Response -- SecurityTimeseriesGroupsV2Response - -Methods: - -- client.radar.email.security.summaryV2(dimension, { ...params }) -> SecuritySummaryV2Response -- client.radar.email.security.timeseriesGroupsV2(dimension, { ...params }) -> SecurityTimeseriesGroupsV2Response - #### Top ##### Tlds @@ -7017,15 +7066,11 @@ Methods: Types: -- Layer3SummaryV2Response - Layer3TimeseriesResponse -- Layer3TimeseriesGroupsV2Response Methods: -- client.radar.attacks.layer3.summaryV2(dimension, { ...params }) -> Layer3SummaryV2Response - client.radar.attacks.layer3.timeseries({ ...params }) -> Layer3TimeseriesResponse -- client.radar.attacks.layer3.timeseriesGroupsV2(dimension, { ...params }) -> Layer3TimeseriesGroupsV2Response #### Summary @@ -7101,15 +7146,11 @@ Methods: Types: -- Layer7SummaryV2Response - Layer7TimeseriesResponse -- Layer7TimeseriesGroupsV2Response Methods: -- client.radar.attacks.layer7.summaryV2(dimension, { ...params }) -> Layer7SummaryV2Response - client.radar.attacks.layer7.timeseries({ ...params }) -> Layer7TimeseriesResponse -- client.radar.attacks.layer7.timeseriesGroupsV2(dimension, { ...params }) -> Layer7TimeseriesGroupsV2Response #### Summary @@ -8122,6 +8163,14 @@ Methods: ### IndicatorTypes +Types: + +- IndicatorTypeListResponse + +Methods: + +- client.cloudforceOne.threatEvents.indicatorTypes.list({ ...params }) -> IndicatorTypeListResponse + ### Raw Types: @@ -8394,14 +8443,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: @@ -8456,8 +8559,32 @@ Methods: # LeakedCredentialChecks +Types: + +- LeakedCredentialCheckCreateResponse +- LeakedCredentialCheckGetResponse + +Methods: + +- client.leakedCredentialChecks.create({ ...params }) -> LeakedCredentialCheckCreateResponse +- client.leakedCredentialChecks.get({ ...params }) -> LeakedCredentialCheckGetResponse + ## Detections +Types: + +- DetectionCreateResponse +- DetectionUpdateResponse +- DetectionListResponse +- DetectionDeleteResponse + +Methods: + +- client.leakedCredentialChecks.detections.create({ ...params }) -> DetectionCreateResponse +- client.leakedCredentialChecks.detections.update(detectionId, { ...params }) -> DetectionUpdateResponse +- client.leakedCredentialChecks.detections.list({ ...params }) -> DetectionListResponsesSinglePage +- client.leakedCredentialChecks.detections.delete(detectionId, { ...params }) -> DetectionDeleteResponse + # ContentScanning Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index e73689a349..0d840a0aee 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -145,6 +145,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 @@ -185,6 +193,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 @@ -197,6 +207,7 @@ TEST_PATHS=( tests/api-resources/queues/messages.test.ts tests/api-resources/queues/purge.test.ts tests/api-resources/queues/consumers.test.ts + tests/api-resources/queues/subscriptions.test.ts tests/api-resources/api-gateway/api-gateway.test.ts tests/api-resources/api-gateway/configurations.test.ts tests/api-resources/api-gateway/discovery/discovery.test.ts @@ -676,6 +687,7 @@ TEST_PATHS=( tests/api-resources/cloudforce-one/threat-events/categories.test.ts tests/api-resources/cloudforce-one/threat-events/countries.test.ts tests/api-resources/cloudforce-one/threat-events/datasets/datasets.test.ts + tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts tests/api-resources/cloudforce-one/threat-events/raw.test.ts tests/api-resources/cloudforce-one/threat-events/relate.test.ts tests/api-resources/cloudforce-one/threat-events/tags.test.ts @@ -699,9 +711,16 @@ 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 + tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts + tests/api-resources/leaked-credential-checks/detections.test.ts tests/api-resources/content-scanning/content-scanning.test.ts tests/api-resources/content-scanning/payloads.test.ts tests/api-resources/content-scanning/settings.test.ts diff --git a/src/resources/alerting/destinations/webhooks.ts b/src/resources/alerting/destinations/webhooks.ts index 605e015ae3..279c67d0bf 100644 --- a/src/resources/alerting/destinations/webhooks.ts +++ b/src/resources/alerting/destinations/webhooks.ts @@ -35,7 +35,7 @@ export class Webhooks extends APIResource { * ```ts * const webhook = * await client.alerting.destinations.webhooks.update( - * 'b115d5ec15c641ee8b7692c449b5227b', + * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * name: 'Slack Webhook', @@ -90,7 +90,7 @@ export class Webhooks extends APIResource { * ```ts * const webhook = * await client.alerting.destinations.webhooks.delete( - * 'b115d5ec15c641ee8b7692c449b5227b', + * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -114,7 +114,7 @@ export class Webhooks extends APIResource { * ```ts * const webhooks = * await client.alerting.destinations.webhooks.get( - * 'b115d5ec15c641ee8b7692c449b5227b', + * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` diff --git a/src/resources/alerting/policies.ts b/src/resources/alerting/policies.ts index 7e22a6cc36..c2caed4005 100644 --- a/src/resources/alerting/policies.ts +++ b/src/resources/alerting/policies.ts @@ -35,7 +35,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.update( - * '0da2b59ef118439d8097bdfb215203c9', + * '0da2b59e-f118-439d-8097-bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -85,7 +85,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.delete( - * '0da2b59ef118439d8097bdfb215203c9', + * '0da2b59e-f118-439d-8097-bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -105,7 +105,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.get( - * '0da2b59ef118439d8097bdfb215203c9', + * '0da2b59e-f118-439d-8097-bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -211,7 +211,6 @@ export interface Policy { * possible values. */ alert_type?: - | 'abuse_report_alert' | 'access_custom_certificate_expiration_type' | 'advanced_ddos_attack_l4_alert' | 'advanced_ddos_attack_l7_alert' @@ -521,11 +520,6 @@ export interface PolicyFilter { */ tunnel_name?: Array; - /** - * Usage depends on specific alert type - */ - type?: Array; - /** * Usage depends on specific alert type */ @@ -745,11 +739,6 @@ export interface PolicyFilterParam { */ tunnel_name?: Array; - /** - * Usage depends on specific alert type - */ - type?: Array; - /** * Usage depends on specific alert type */ @@ -836,7 +825,6 @@ export interface PolicyCreateParams { * possible values. */ alert_type: - | 'abuse_report_alert' | 'access_custom_certificate_expiration_type' | 'advanced_ddos_attack_l4_alert' | 'advanced_ddos_attack_l7_alert' @@ -958,7 +946,6 @@ export interface PolicyUpdateParams { * possible values. */ alert_type?: - | 'abuse_report_alert' | 'access_custom_certificate_expiration_type' | 'advanced_ddos_attack_l4_alert' | 'advanced_ddos_attack_l7_alert' diff --git a/src/resources/cloudforce-one/threat-events/index.ts b/src/resources/cloudforce-one/threat-events/index.ts index d797682ddd..02c8bab160 100644 --- a/src/resources/cloudforce-one/threat-events/index.ts +++ b/src/resources/cloudforce-one/threat-events/index.ts @@ -36,7 +36,11 @@ export { type EventTagCreateParams, type EventTagDeleteParams, } from './event-tags'; -export { IndicatorTypes } from './indicator-types'; +export { + IndicatorTypes, + type IndicatorTypeListResponse, + type IndicatorTypeListParams, +} from './indicator-types'; export { Insights } from './insights'; export { Raw, type RawEditResponse, type RawGetResponse, type RawEditParams, type RawGetParams } from './raw'; export { Relate, type RelateDeleteResponse, type RelateDeleteParams } from './relate'; diff --git a/src/resources/cloudforce-one/threat-events/indicator-types.ts b/src/resources/cloudforce-one/threat-events/indicator-types.ts index 99e5ccc453..7fa1b77a16 100644 --- a/src/resources/cloudforce-one/threat-events/indicator-types.ts +++ b/src/resources/cloudforce-one/threat-events/indicator-types.ts @@ -1,5 +1,51 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; -export class IndicatorTypes extends APIResource {} +export class IndicatorTypes extends APIResource { + /** + * Lists all indicator types + * + * @example + * ```ts + * const indicatorTypes = + * await client.cloudforceOne.threatEvents.indicatorTypes.list( + * { account_id: 'account_id' }, + * ); + * ``` + */ + list( + params: IndicatorTypeListParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.get(`/accounts/${account_id}/cloudforce-one/events/indicatorTypes`, options); + } +} + +export interface IndicatorTypeListResponse { + items: IndicatorTypeListResponse.Items; + + type: string; +} + +export namespace IndicatorTypeListResponse { + export interface Items { + type: string; + } +} + +export interface IndicatorTypeListParams { + /** + * Account ID. + */ + account_id: string; +} + +export declare namespace IndicatorTypes { + export { + type IndicatorTypeListResponse as IndicatorTypeListResponse, + type IndicatorTypeListParams as IndicatorTypeListParams, + }; +} diff --git a/src/resources/cloudforce-one/threat-events/threat-events.ts b/src/resources/cloudforce-one/threat-events/threat-events.ts index d23c37b5db..119f0b95d8 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -31,7 +31,7 @@ import { EventTags, } from './event-tags'; import * as IndicatorTypesAPI from './indicator-types'; -import { IndicatorTypes } from './indicator-types'; +import { IndicatorTypeListParams, IndicatorTypeListResponse, IndicatorTypes } from './indicator-types'; import * as InsightsAPI from './insights'; import { Insights } from './insights'; import * as RawAPI from './raw'; @@ -821,7 +821,11 @@ export declare namespace ThreatEvents { type DatasetRawParams as DatasetRawParams, }; - export { IndicatorTypes as IndicatorTypes }; + export { + IndicatorTypes as IndicatorTypes, + type IndicatorTypeListResponse as IndicatorTypeListResponse, + type IndicatorTypeListParams as IndicatorTypeListParams, + }; export { RawAPIRaw as Raw, diff --git a/src/resources/custom-pages.ts b/src/resources/custom-pages.ts index 4c861b1e41..6bd1b13cf7 100644 --- a/src/resources/custom-pages.ts +++ b/src/resources/custom-pages.ts @@ -24,15 +24,13 @@ export class CustomPages extends APIResource { */ update( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', params: CustomPageUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { @@ -125,42 +123,36 @@ export class CustomPages extends APIResource { */ get( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', params?: CustomPageGetParams, options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', params: CustomPageGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { diff --git a/src/resources/email-security/investigate/investigate.ts b/src/resources/email-security/investigate/investigate.ts index 7093627a0f..a15d9630ba 100644 --- a/src/resources/email-security/investigate/investigate.ts +++ b/src/resources/email-security/investigate/investigate.ts @@ -199,33 +199,10 @@ export namespace InvestigateListResponse { } export interface Finding { - attachment?: string | null; - detail?: string | null; - detection?: - | 'MALICIOUS' - | 'MALICIOUS-BEC' - | 'SUSPICIOUS' - | 'SPOOF' - | 'SPAM' - | 'BULK' - | 'ENCRYPTED' - | 'EXTERNAL' - | 'UNKNOWN' - | 'NONE' - | null; - - field?: string | null; - name?: string | null; - portion?: string | null; - - reason?: string | null; - - score?: number | null; - value?: string | null; } @@ -344,33 +321,10 @@ export namespace InvestigateGetResponse { } export interface Finding { - attachment?: string | null; - detail?: string | null; - detection?: - | 'MALICIOUS' - | 'MALICIOUS-BEC' - | 'SUSPICIOUS' - | 'SPOOF' - | 'SPAM' - | 'BULK' - | 'ENCRYPTED' - | 'EXTERNAL' - | 'UNKNOWN' - | 'NONE' - | null; - - field?: string | null; - name?: string | null; - portion?: string | null; - - reason?: string | null; - - score?: number | null; - value?: string | null; } 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 f8b3034d84..c581632a76 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 a4db89243d..138942ad57 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. @@ -99,12 +120,12 @@ export interface Key { /** * 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 +135,49 @@ 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 { + /** + * The metadata associated with the key. + */ + metadata: unknown; + + /** + * The value associated with the key. + */ + 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,26 +189,27 @@ export interface KeyBulkUpdateResponse { export interface KeyListParams extends CursorPaginationAfterParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; /** - * Query param: The number of keys to return. The cursor attribute may be used to - * iterate over the next batch of keys if there are more than the limit. + * 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: 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; @@ -157,9 +219,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; @@ -172,39 +256,38 @@ 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. + * Arbitrary JSON that is associated with a key. */ - value?: string; + metadata?: unknown; } } @@ -214,10 +297,12 @@ export declare namespace Keys { export { type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, + type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorPaginationAfter as KeysCursorPaginationAfter, 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..927ba8a17d 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -37,11 +37,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 3ec43aa7c5..df179e53bb 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' }], * }, * ); * ``` @@ -240,13 +272,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 +286,49 @@ 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 { + /** + * The metadata associated with the key. + */ + metadata: unknown; + + /** + * The value associated with the key. + */ + 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 +340,7 @@ export interface NamespaceBulkUpdateResponse { export interface NamespaceCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -282,7 +352,7 @@ export interface NamespaceCreateParams { export interface NamespaceUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -294,7 +364,7 @@ export interface NamespaceUpdateParams { export interface NamespaceListParams extends V4PagePaginationArrayParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -311,14 +381,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 +398,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 +435,44 @@ 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. + * Arbitrary JSON that is associated with a key. */ - value?: string; + metadata?: unknown; } } export interface NamespaceGetParams { /** - * Identifier + * Identifier. */ account_id: string; } @@ -390,14 +481,14 @@ Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; Namespaces.Keys = Keys; Namespaces.KeysCursorPaginationAfter = KeysCursorPaginationAfter; 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 +496,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 +505,12 @@ export declare namespace Namespaces { Keys as Keys, type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, + type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorPaginationAfter as KeysCursorPaginationAfter, type KeyListParams as KeyListParams, type KeyBulkDeleteParams as KeyBulkDeleteParams, + type KeyBulkGetParams as KeyBulkGetParams, type KeyBulkUpdateParams as KeyBulkUpdateParams, }; @@ -427,7 +521,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 1fa5ff39ed..49566f425a 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,13 +37,8 @@ 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, - __multipartSyntax: 'json', - ...options, - headers: { 'Content-Type': '*/*', ...options?.headers }, - }), + Core.multipartFormRequestOptions({ query: { expiration, expiration_ttl }, body, + __multipartSyntax: 'json', ...options }), ) as Core.APIPromise<{ result: ValueUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } @@ -120,43 +114,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: Associates arbitrary JSON data with a key/value pair. + */ + metadata?: unknown; } export interface ValueDeleteParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface ValueGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/leaked-credential-checks/detections.ts b/src/resources/leaked-credential-checks/detections.ts index 2a6de390ad..ca2e008bd9 100644 --- a/src/resources/leaked-credential-checks/detections.ts +++ b/src/resources/leaked-credential-checks/detections.ts @@ -1,5 +1,243 @@ // 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 Detections extends APIResource {} +export class Detections extends APIResource { + /** + * Create user-defined detection pattern for Leaked Credential Checks. + * + * @example + * ```ts + * const detection = + * await client.leakedCredentialChecks.detections.create({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create( + params: DetectionCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/leaked-credential-checks/detections`, { + body, + ...options, + }) as Core.APIPromise<{ result: DetectionCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update user-defined detection pattern for Leaked Credential Checks. + * + * @example + * ```ts + * const detection = + * await client.leakedCredentialChecks.detections.update( + * '18a14bafaa8eb1df04ce683ec18c765e', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + update( + detectionId: string, + params: DetectionUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.put(`/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: DetectionUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List user-defined detection patterns for Leaked Credential Checks. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const detectionListResponse of client.leakedCredentialChecks.detections.list( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: DetectionListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { zone_id } = params; + return this._client.getAPIList( + `/zones/${zone_id}/leaked-credential-checks/detections`, + DetectionListResponsesSinglePage, + options, + ); + } + + /** + * Remove user-defined detection pattern for Leaked Credential Checks. + * + * @example + * ```ts + * const detection = + * await client.leakedCredentialChecks.detections.delete( + * '18a14bafaa8eb1df04ce683ec18c765e', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + detectionId: string, + params: DetectionDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.delete( + `/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, + options, + ) as Core.APIPromise<{ result: DetectionDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class DetectionListResponsesSinglePage extends SinglePage {} + +/** + * Defines a custom set of username/password expressions to match Leaked Credential + * Checks on. + */ +export interface DetectionCreateResponse { + /** + * Defines the unique ID for this custom detection. + */ + id?: string; + + /** + * Defines ehe ruleset expression to use in matching the password in a request. + */ + password?: string; + + /** + * Defines the ruleset expression to use in matching the username in a request. + */ + username?: string; +} + +/** + * Defines a custom set of username/password expressions to match Leaked Credential + * Checks on. + */ +export interface DetectionUpdateResponse { + /** + * Defines the unique ID for this custom detection. + */ + id?: string; + + /** + * Defines ehe ruleset expression to use in matching the password in a request. + */ + password?: string; + + /** + * Defines the ruleset expression to use in matching the username in a request. + */ + username?: string; +} + +/** + * Defines a custom set of username/password expressions to match Leaked Credential + * Checks on. + */ +export interface DetectionListResponse { + /** + * Defines the unique ID for this custom detection. + */ + id?: string; + + /** + * Defines ehe ruleset expression to use in matching the password in a request. + */ + password?: string; + + /** + * Defines the ruleset expression to use in matching the username in a request. + */ + username?: string; +} + +export type DetectionDeleteResponse = unknown; + +export interface DetectionCreateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: Defines ehe ruleset expression to use in matching the password in a + * request. + */ + password?: string; + + /** + * Body param: Defines the ruleset expression to use in matching the username in a + * request. + */ + username?: string; +} + +export interface DetectionUpdateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: Defines ehe ruleset expression to use in matching the password in a + * request. + */ + password?: string; + + /** + * Body param: Defines the ruleset expression to use in matching the username in a + * request. + */ + username?: string; +} + +export interface DetectionListParams { + /** + * Defines an identifier. + */ + zone_id: string; +} + +export interface DetectionDeleteParams { + /** + * Defines an identifier. + */ + zone_id: string; +} + +Detections.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; + +export declare namespace Detections { + export { + type DetectionCreateResponse as DetectionCreateResponse, + type DetectionUpdateResponse as DetectionUpdateResponse, + type DetectionListResponse as DetectionListResponse, + type DetectionDeleteResponse as DetectionDeleteResponse, + DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, + type DetectionCreateParams as DetectionCreateParams, + type DetectionUpdateParams as DetectionUpdateParams, + type DetectionListParams as DetectionListParams, + type DetectionDeleteParams as DetectionDeleteParams, + }; +} diff --git a/src/resources/leaked-credential-checks/index.ts b/src/resources/leaked-credential-checks/index.ts index 7e3e1a0dd7..1844848bf2 100644 --- a/src/resources/leaked-credential-checks/index.ts +++ b/src/resources/leaked-credential-checks/index.ts @@ -1,4 +1,15 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Detections } from './detections'; +export { + DetectionListResponsesSinglePage, + Detections, + type DetectionCreateResponse, + type DetectionUpdateResponse, + type DetectionListResponse, + type DetectionDeleteResponse, + type DetectionCreateParams, + type DetectionUpdateParams, + type DetectionListParams, + type DetectionDeleteParams, +} from './detections'; export { LeakedCredentialChecks } from './leaked-credential-checks'; diff --git a/src/resources/leaked-credential-checks/leaked-credential-checks.ts b/src/resources/leaked-credential-checks/leaked-credential-checks.ts index c89821160c..d8d8de90c1 100644 --- a/src/resources/leaked-credential-checks/leaked-credential-checks.ts +++ b/src/resources/leaked-credential-checks/leaked-credential-checks.ts @@ -1,15 +1,132 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; +import * as Core from '../../core'; import * as DetectionsAPI from './detections'; -import { Detections } from './detections'; +import { + DetectionCreateParams, + DetectionCreateResponse, + DetectionDeleteParams, + DetectionDeleteResponse, + DetectionListParams, + DetectionListResponse, + DetectionListResponsesSinglePage, + DetectionUpdateParams, + DetectionUpdateResponse, + Detections, +} from './detections'; export class LeakedCredentialChecks extends APIResource { detections: DetectionsAPI.Detections = new DetectionsAPI.Detections(this._client); + + /** + * Updates the current status of Leaked Credential Checks. + * + * @example + * ```ts + * const leakedCredentialCheck = + * await client.leakedCredentialChecks.create({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create( + params: LeakedCredentialCheckCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/leaked-credential-checks`, { + body, + ...options, + }) as Core.APIPromise<{ result: LeakedCredentialCheckCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the current status of Leaked Credential Checks. + * + * @example + * ```ts + * const leakedCredentialCheck = + * await client.leakedCredentialChecks.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + get( + params: LeakedCredentialCheckGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.get(`/zones/${zone_id}/leaked-credential-checks`, options) as Core.APIPromise<{ + result: LeakedCredentialCheckGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +/** + * Defines the overall status for Leaked Credential Checks. + */ +export interface LeakedCredentialCheckCreateResponse { + /** + * Determines whether or not Leaked Credential Checks are enabled. + */ + enabled?: boolean; +} + +/** + * Defines the overall status for Leaked Credential Checks. + */ +export interface LeakedCredentialCheckGetResponse { + /** + * Determines whether or not Leaked Credential Checks are enabled. + */ + enabled?: boolean; +} + +export interface LeakedCredentialCheckCreateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: Determines whether or not Leaked Credential Checks are enabled. + */ + enabled?: boolean; +} + +export interface LeakedCredentialCheckGetParams { + /** + * Defines an identifier. + */ + zone_id: string; } LeakedCredentialChecks.Detections = Detections; +LeakedCredentialChecks.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; export declare namespace LeakedCredentialChecks { - export { Detections as Detections }; + export { + type LeakedCredentialCheckCreateResponse as LeakedCredentialCheckCreateResponse, + type LeakedCredentialCheckGetResponse as LeakedCredentialCheckGetResponse, + type LeakedCredentialCheckCreateParams as LeakedCredentialCheckCreateParams, + type LeakedCredentialCheckGetParams as LeakedCredentialCheckGetParams, + }; + + export { + Detections as Detections, + type DetectionCreateResponse as DetectionCreateResponse, + type DetectionUpdateResponse as DetectionUpdateResponse, + type DetectionListResponse as DetectionListResponse, + type DetectionDeleteResponse as DetectionDeleteResponse, + DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, + type DetectionCreateParams as DetectionCreateParams, + type DetectionUpdateParams as DetectionUpdateParams, + type DetectionListParams as DetectionListParams, + type DetectionDeleteParams as DetectionDeleteParams, + }; } 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..6e40d6cfa9 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..5e289166d6 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..6f0ab3dbaa 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/organizations/organizations.ts b/src/resources/organizations/organizations.ts index edc39aac94..ac7c354a5f 100644 --- a/src/resources/organizations/organizations.ts +++ b/src/resources/organizations/organizations.ts @@ -1,7 +1,6 @@ // 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 OrganizationProfileAPI from './organization-profile'; import { @@ -9,7 +8,6 @@ import { OrganizationProfileResource, OrganizationProfileUpdateParams, } from './organization-profile'; -import { SinglePage } from '../../pagination'; export class Organizations extends APIResource { organizationProfile: OrganizationProfileAPI.OrganizationProfileResource = @@ -39,24 +37,6 @@ export class Organizations extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Retrieve a list of organizations a particular user has access to. - */ - list( - query?: OrganizationListParams, - options?: Core.RequestOptions, - ): Core.PagePromise; - list(options?: Core.RequestOptions): Core.PagePromise; - list( - query: OrganizationListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.PagePromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return this._client.getAPIList('/organizations', OrganizationsSinglePage, { query, ...options }); - } - /** * Delete an organization. The organization MUST be empty before deleting. It must * not contain any sub-organizations, accounts, members or users. @@ -80,10 +60,8 @@ export class Organizations extends APIResource { } } -export class OrganizationsSinglePage extends SinglePage {} - /** - * References an Organization in the Cloudflare data model. + * Represents an Organization in the Cloudflare data model */ export interface Organization { id: string; @@ -102,7 +80,7 @@ export interface Organization { export namespace Organization { export interface Meta { /** - * Enable features for Organizations. + * Organization flags for feature enablement */ flags?: Meta.Flags; @@ -113,7 +91,7 @@ export namespace Organization { export namespace Meta { /** - * Enable features for Organizations. + * Organization flags for feature enablement */ export interface Flags { account_creation: string; @@ -199,101 +177,13 @@ export namespace OrganizationUpdateParams { } } -export interface OrganizationListParams { - /** - * Only return organizations with the specified IDs (ex. id=foo&id=bar). Send - * multiple elements by repeating the query value. - */ - id?: Array; - - containing?: OrganizationListParams.Containing; - - name?: OrganizationListParams.Name; - - /** - * The amount of items to return. Defaults to 10. - */ - page_size?: number; - - /** - * An opaque token returned from the last list response that when provided will - * retrieve the next page. - * - * Parameters used to filter the retrieved list must remain in subsequent requests - * with a page token. - */ - page_token?: string; - - parent?: OrganizationListParams.Parent; -} - -export namespace OrganizationListParams { - export interface Containing { - /** - * Filter the list of organizations to the ones that contain this particular - * account. - */ - account?: string; - - /** - * Filter the list of organizations to the ones that contain this particular - * organization. - */ - organization?: string; - - /** - * Filter the list of organizations to the ones that contain this particular user. - * - * IMPORTANT: Just because an organization "contains" a user is not a - * representation of any authorization or privilege to manage any resources - * therein. An organization "containing" a user simply means the user is managed by - * that organization. - */ - user?: string; - } - - export interface Name { - /** - * (case-insensitive) Filter the list of organizations to where the name contains a - * particular string. - */ - contains?: string; - - /** - * (case-insensitive) Filter the list of organizations to where the name ends with - * a particular string. - */ - endsWith?: string; - - /** - * (case-insensitive) Filter the list of organizations to where the name starts - * with a particular string. - */ - startsWith?: string; - } - - export interface Parent { - /** - * Filter the list of organizations to the ones that are a sub-organization of the - * specified organization. - * - * "null" is a valid value to provide for this parameter. It means "where an - * organization has no parent (i.e. it is a 'root' organization)." - */ - id?: (string & {}) | 'null'; - } -} - -Organizations.OrganizationsSinglePage = OrganizationsSinglePage; Organizations.OrganizationProfileResource = OrganizationProfileResource; export declare namespace Organizations { export { type Organization as Organization, - OrganizationsSinglePage as OrganizationsSinglePage, type OrganizationCreateParams as OrganizationCreateParams, type OrganizationUpdateParams as OrganizationUpdateParams, - type OrganizationListParams as OrganizationListParams, }; export { diff --git a/src/resources/pages/index.ts b/src/resources/pages/index.ts index ede14daf73..2b2862b5c1 100644 --- a/src/resources/pages/index.ts +++ b/src/resources/pages/index.ts @@ -2,7 +2,6 @@ export { DeploymentsSinglePage, - DeploymentsV4PagePaginationArray, Projects, type Deployment, type Project, diff --git a/src/resources/pages/pages.ts b/src/resources/pages/pages.ts index e0331f786f..e92779690f 100644 --- a/src/resources/pages/pages.ts +++ b/src/resources/pages/pages.ts @@ -4,7 +4,7 @@ import { APIResource } from '../../resource'; import * as ProjectsAPI from './projects/projects'; import { Deployment, - DeploymentsV4PagePaginationArray, + DeploymentsSinglePage, Project, ProjectCreateParams, ProjectDeleteParams, @@ -23,7 +23,7 @@ export class Pages extends APIResource { } Pages.Projects = Projects; -Pages.DeploymentsV4PagePaginationArray = DeploymentsV4PagePaginationArray; +Pages.DeploymentsSinglePage = DeploymentsSinglePage; export declare namespace Pages { export { @@ -33,7 +33,7 @@ export declare namespace Pages { type Stage as Stage, type ProjectDeleteResponse as ProjectDeleteResponse, type ProjectPurgeBuildCacheResponse as ProjectPurgeBuildCacheResponse, - DeploymentsV4PagePaginationArray as DeploymentsV4PagePaginationArray, + DeploymentsSinglePage as DeploymentsSinglePage, type ProjectCreateParams as ProjectCreateParams, type ProjectListParams as ProjectListParams, type ProjectDeleteParams as ProjectDeleteParams, diff --git a/src/resources/pages/projects/deployments/deployments.ts b/src/resources/pages/projects/deployments/deployments.ts index e1a307e7bf..97b2b41db9 100644 --- a/src/resources/pages/projects/deployments/deployments.ts +++ b/src/resources/pages/projects/deployments/deployments.ts @@ -192,77 +192,11 @@ export interface DeploymentCreateParams { */ account_id: string; - /** - * Body param: Headers configuration file for the deployment. - */ - _headers?: Core.Uploadable; - - /** - * Body param: Redirects configuration file for the deployment. - */ - _redirects?: Core.Uploadable; - - /** - * Body param: Routes configuration file defining routing rules. - */ - '_routes.json'?: Core.Uploadable; - - /** - * Body param: Worker bundle file in multipart/form-data format. Mutually exclusive - * with `_worker.js`. Cannot specify both `_worker.js` and `_worker.bundle` in the - * same request. Maximum size: 25 MiB. - */ - '_worker.bundle'?: Core.Uploadable; - - /** - * Body param: Worker JavaScript file. Mutually exclusive with `_worker.bundle`. - * Cannot specify both `_worker.js` and `_worker.bundle` in the same request. - */ - '_worker.js'?: Core.Uploadable; - /** * Body param: The branch to build the new deployment from. The `HEAD` of the * branch will be used. If omitted, the production branch will be used by default. */ branch?: string; - - /** - * Body param: Boolean string indicating if the working directory has uncommitted - * changes. - */ - commit_dirty?: 'true' | 'false'; - - /** - * Body param: Git commit SHA associated with this deployment. - */ - commit_hash?: string; - - /** - * Body param: Git commit message associated with this deployment. - */ - commit_message?: string; - - /** - * Body param: Functions routing configuration file. - */ - 'functions-filepath-routing-config.json'?: Core.Uploadable; - - /** - * Body param: JSON string containing a manifest of files to deploy. Maps file - * paths to their content hashes. Required for direct upload deployments. Maximum - * 20,000 entries. - */ - manifest?: string; - - /** - * Body param: The build output directory path. - */ - pages_build_output_dir?: string; - - /** - * Body param: Hash of the Wrangler configuration file used for this deployment. - */ - wrangler_config_hash?: string; } export interface DeploymentListParams { diff --git a/src/resources/pages/projects/index.ts b/src/resources/pages/projects/index.ts index 867a3f7b6b..a40f121ec5 100644 --- a/src/resources/pages/projects/index.ts +++ b/src/resources/pages/projects/index.ts @@ -12,7 +12,6 @@ export { } from './deployments/index'; export { DeploymentsSinglePage, - DeploymentsV4PagePaginationArray, Projects, type Deployment, type Project, diff --git a/src/resources/pages/projects/projects.ts b/src/resources/pages/projects/projects.ts index f14c2e99bf..01225591dc 100644 --- a/src/resources/pages/projects/projects.ts +++ b/src/resources/pages/projects/projects.ts @@ -28,7 +28,7 @@ import { DeploymentRollbackParams, Deployments, } from './deployments/deployments'; -import { SinglePage, V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; +import { SinglePage } from '../../../pagination'; export class Projects extends APIResource { deployments: DeploymentsAPI.Deployments = new DeploymentsAPI.Deployments(this._client); @@ -41,8 +41,6 @@ export class Projects extends APIResource { * ```ts * const project = await client.pages.projects.create({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * name: 'my-pages-app', - * production_branch: 'main', * }); * ``` */ @@ -71,13 +69,9 @@ export class Projects extends APIResource { list( params: ProjectListParams, options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id, ...query } = params; - return this._client.getAPIList( - `/accounts/${account_id}/pages/projects`, - DeploymentsV4PagePaginationArray, - { query, ...options }, - ); + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList(`/accounts/${account_id}/pages/projects`, DeploymentsSinglePage, options); } /** @@ -113,11 +107,7 @@ export class Projects extends APIResource { * ```ts * const project = await client.pages.projects.edit( * 'this-is-my-project-01', - * { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * name: 'my-pages-app', - * production_branch: 'main', - * }, + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ @@ -186,8 +176,6 @@ export class Projects extends APIResource { } } -export class DeploymentsV4PagePaginationArray extends V4PagePaginationArray {} - export class DeploymentsSinglePage extends SinglePage {} export interface Deployment { @@ -221,7 +209,7 @@ export interface Deployment { */ env_vars?: { [key: string]: Deployment.PagesPlainTextEnvVar | null | Deployment.PagesSecretTextEnvVar | null; - } | null; + }; /** * Type of deploy. @@ -371,74 +359,31 @@ export namespace Deployment { export interface Source { config?: Source.Config; - /** - * The source control management provider. - */ - type?: 'github' | 'gitlab'; + type?: string; } export namespace Source { export interface Config { - /** - * @deprecated Use `production_deployments_enabled` and - * `preview_deployment_setting` for more granular control. - */ deployments_enabled?: boolean; - /** - * The owner of the repository. - */ owner?: string; - /** - * A list of paths that should be excluded from triggering a preview deployment. - * Wildcard syntax (`*`) is supported. - */ path_excludes?: Array; - /** - * A list of paths that should be watched to trigger a preview deployment. Wildcard - * syntax (`*`) is supported. - */ path_includes?: Array; - /** - * Whether to enable PR comments. - */ pr_comments_enabled?: boolean; - /** - * A list of branches that should not trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_excludes?: Array; - /** - * A list of branches that should trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_includes?: Array; - /** - * Controls whether commits to preview branches trigger a preview deployment. - */ preview_deployment_setting?: 'all' | 'none' | 'custom'; - /** - * The production branch of the repository. - */ production_branch?: string; - /** - * Whether to trigger a production deployment on commits to the production branch. - */ production_deployments_enabled?: boolean; - /** - * The name of the repository. - */ repo_name?: string; } } @@ -446,27 +391,17 @@ export namespace Deployment { export interface Project { /** - * ID of the project. - */ - id: string; - - /** - * Name of the project. - */ - name: string; - - /** - * Production branch of the project. Used to identify production deployments. + * Id of the project. */ - production_branch: string; + id?: string; /** * Configs for the project build process. */ - build_config?: Project.BuildConfig | null; + build_config?: Project.BuildConfig; /** - * Most recent production deployment of the project. + * Most recent deployment to the repo. */ canonical_deployment?: Deployment | null; @@ -478,7 +413,7 @@ export interface Project { /** * Configs for deployments in a project. */ - deployment_configs?: Project.DeploymentConfigs | null; + deployment_configs?: Project.DeploymentConfigs; /** * A list of associated custom domains for the project. @@ -486,29 +421,19 @@ export interface Project { domains?: Array; /** - * Framework the project is using. - */ - framework?: string; - - /** - * Version of the framework the project is using. - */ - framework_version?: string; - - /** - * Most recent deployment of the project. + * Most recent deployment to the repo. */ latest_deployment?: Deployment | null; /** - * Name of the preview script. + * Name of the project. */ - preview_script_name?: string; + name?: string; /** - * Name of the production script. + * Production branch of the project. Used to identify production deployments. */ - production_script_name?: string; + production_branch?: string; source?: Project.Source; @@ -516,11 +441,6 @@ export interface Project { * The Cloudflare subdomain associated with the project. */ subdomain?: string; - - /** - * Whether the project uses functions. - */ - uses_functions?: boolean; } export namespace Project { @@ -566,12 +486,12 @@ export namespace Project { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview | null; + preview?: DeploymentConfigs.Preview; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production | null; + production?: DeploymentConfigs.Production; } export namespace DeploymentConfigs { @@ -584,11 +504,6 @@ export namespace Project { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; - /** - * Whether to always use the latest compatibility date for Pages Functions. - */ - always_use_latest_compatibility_date?: boolean; - /** * Analytics Engine bindings used for Pages Functions. */ @@ -599,11 +514,6 @@ export namespace Project { */ browsers?: { [key: string]: Preview.Browsers | null } | null; - /** - * The major version of the build image to use for Pages Functions. - */ - build_image_major_version?: number; - /** * Compatibility date used for Pages Functions. */ @@ -612,7 +522,7 @@ export namespace Project { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array | null; + compatibility_flags?: Array; /** * D1 databases used for Pages Functions. @@ -629,12 +539,7 @@ export namespace Project { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - } | null; - - /** - * Whether to fail open when the deployment config cannot be applied. - */ - fail_open?: boolean; + }; /** * Hyperdrive bindings used for Pages Functions. @@ -646,11 +551,6 @@ export namespace Project { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; - /** - * Limits for Pages Functions. - */ - limits?: Preview.Limits | null; - /** * mTLS bindings used for Pages Functions. */ @@ -676,20 +576,10 @@ export namespace Project { */ services?: { [key: string]: Preview.Services | null } | null; - /** - * @deprecated All new projects now use the Standard usage model. - */ - usage_model?: 'standard' | 'bundled' | 'unbound'; - /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; - - /** - * Hash of the Wrangler configuration used for the deployment. - */ - wrangler_config_hash?: string; } export namespace Preview { @@ -776,16 +666,6 @@ export namespace Project { namespace_id?: string; } - /** - * Limits for Pages Functions. - */ - export interface Limits { - /** - * CPU time limit in milliseconds. - */ - cpu_ms?: number; - } - /** * mTLS binding. */ @@ -865,11 +745,6 @@ export namespace Project { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; - /** - * Whether to always use the latest compatibility date for Pages Functions. - */ - always_use_latest_compatibility_date?: boolean; - /** * Analytics Engine bindings used for Pages Functions. */ @@ -880,11 +755,6 @@ export namespace Project { */ browsers?: { [key: string]: Production.Browsers | null } | null; - /** - * The major version of the build image to use for Pages Functions. - */ - build_image_major_version?: number; - /** * Compatibility date used for Pages Functions. */ @@ -893,7 +763,7 @@ export namespace Project { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array | null; + compatibility_flags?: Array; /** * D1 databases used for Pages Functions. @@ -910,12 +780,7 @@ export namespace Project { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - } | null; - - /** - * Whether to fail open when the deployment config cannot be applied. - */ - fail_open?: boolean; + }; /** * Hyperdrive bindings used for Pages Functions. @@ -927,11 +792,6 @@ export namespace Project { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; - /** - * Limits for Pages Functions. - */ - limits?: Production.Limits | null; - /** * mTLS bindings used for Pages Functions. */ @@ -957,20 +817,10 @@ export namespace Project { */ services?: { [key: string]: Production.Services | null } | null; - /** - * @deprecated All new projects now use the Standard usage model. - */ - usage_model?: 'standard' | 'bundled' | 'unbound'; - /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; - - /** - * Hash of the Wrangler configuration used for the deployment. - */ - wrangler_config_hash?: string; } export namespace Production { @@ -1057,16 +907,6 @@ export namespace Project { namespace_id?: string; } - /** - * Limits for Pages Functions. - */ - export interface Limits { - /** - * CPU time limit in milliseconds. - */ - cpu_ms?: number; - } - /** * mTLS binding. */ @@ -1141,74 +981,31 @@ export namespace Project { export interface Source { config?: Source.Config; - /** - * The source control management provider. - */ - type?: 'github' | 'gitlab'; + type?: string; } export namespace Source { export interface Config { - /** - * @deprecated Use `production_deployments_enabled` and - * `preview_deployment_setting` for more granular control. - */ deployments_enabled?: boolean; - /** - * The owner of the repository. - */ owner?: string; - /** - * A list of paths that should be excluded from triggering a preview deployment. - * Wildcard syntax (`*`) is supported. - */ path_excludes?: Array; - /** - * A list of paths that should be watched to trigger a preview deployment. Wildcard - * syntax (`*`) is supported. - */ path_includes?: Array; - /** - * Whether to enable PR comments. - */ pr_comments_enabled?: boolean; - /** - * A list of branches that should not trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_excludes?: Array; - /** - * A list of branches that should trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_includes?: Array; - /** - * Controls whether commits to preview branches trigger a preview deployment. - */ preview_deployment_setting?: 'all' | 'none' | 'custom'; - /** - * The production branch of the repository. - */ production_branch?: string; - /** - * Whether to trigger a production deployment on commits to the production branch. - */ production_deployments_enabled?: boolean; - /** - * The name of the repository. - */ repo_name?: string; } } @@ -1250,25 +1047,25 @@ export interface ProjectCreateParams { account_id: string; /** - * Body param: Name of the project. + * Body param: Configs for the project build process. */ - name: string; + build_config?: ProjectCreateParams.BuildConfig; /** - * Body param: Production branch of the project. Used to identify production - * deployments. + * Body param: Configs for deployments in a project. */ - production_branch: string; + deployment_configs?: ProjectCreateParams.DeploymentConfigs; /** - * Body param: Configs for the project build process. + * Body param: Name of the project. */ - build_config?: ProjectCreateParams.BuildConfig | null; + name?: string; /** - * Body param: Configs for deployments in a project. + * Body param: Production branch of the project. Used to identify production + * deployments. */ - deployment_configs?: ProjectCreateParams.DeploymentConfigs | null; + production_branch?: string; /** * Body param: @@ -1319,12 +1116,12 @@ export namespace ProjectCreateParams { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview | null; + preview?: DeploymentConfigs.Preview; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production | null; + production?: DeploymentConfigs.Production; } export namespace DeploymentConfigs { @@ -1337,11 +1134,6 @@ export namespace ProjectCreateParams { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; - /** - * Whether to always use the latest compatibility date for Pages Functions. - */ - always_use_latest_compatibility_date?: boolean; - /** * Analytics Engine bindings used for Pages Functions. */ @@ -1352,11 +1144,6 @@ export namespace ProjectCreateParams { */ browsers?: { [key: string]: Preview.Browsers | null } | null; - /** - * The major version of the build image to use for Pages Functions. - */ - build_image_major_version?: number; - /** * Compatibility date used for Pages Functions. */ @@ -1365,7 +1152,7 @@ export namespace ProjectCreateParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array | null; + compatibility_flags?: Array; /** * D1 databases used for Pages Functions. @@ -1382,12 +1169,7 @@ export namespace ProjectCreateParams { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - } | null; - - /** - * Whether to fail open when the deployment config cannot be applied. - */ - fail_open?: boolean; + }; /** * Hyperdrive bindings used for Pages Functions. @@ -1399,11 +1181,6 @@ export namespace ProjectCreateParams { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; - /** - * Limits for Pages Functions. - */ - limits?: Preview.Limits | null; - /** * mTLS bindings used for Pages Functions. */ @@ -1429,20 +1206,10 @@ export namespace ProjectCreateParams { */ services?: { [key: string]: Preview.Services | null } | null; - /** - * @deprecated All new projects now use the Standard usage model. - */ - usage_model?: 'standard' | 'bundled' | 'unbound'; - /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; - - /** - * Hash of the Wrangler configuration used for the deployment. - */ - wrangler_config_hash?: string; } export namespace Preview { @@ -1529,16 +1296,6 @@ export namespace ProjectCreateParams { namespace_id?: string; } - /** - * Limits for Pages Functions. - */ - export interface Limits { - /** - * CPU time limit in milliseconds. - */ - cpu_ms?: number; - } - /** * mTLS binding. */ @@ -1618,11 +1375,6 @@ export namespace ProjectCreateParams { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; - /** - * Whether to always use the latest compatibility date for Pages Functions. - */ - always_use_latest_compatibility_date?: boolean; - /** * Analytics Engine bindings used for Pages Functions. */ @@ -1633,11 +1385,6 @@ export namespace ProjectCreateParams { */ browsers?: { [key: string]: Production.Browsers | null } | null; - /** - * The major version of the build image to use for Pages Functions. - */ - build_image_major_version?: number; - /** * Compatibility date used for Pages Functions. */ @@ -1646,7 +1393,7 @@ export namespace ProjectCreateParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array | null; + compatibility_flags?: Array; /** * D1 databases used for Pages Functions. @@ -1663,12 +1410,7 @@ export namespace ProjectCreateParams { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - } | null; - - /** - * Whether to fail open when the deployment config cannot be applied. - */ - fail_open?: boolean; + }; /** * Hyperdrive bindings used for Pages Functions. @@ -1680,11 +1422,6 @@ export namespace ProjectCreateParams { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; - /** - * Limits for Pages Functions. - */ - limits?: Production.Limits | null; - /** * mTLS bindings used for Pages Functions. */ @@ -1710,20 +1447,10 @@ export namespace ProjectCreateParams { */ services?: { [key: string]: Production.Services | null } | null; - /** - * @deprecated All new projects now use the Standard usage model. - */ - usage_model?: 'standard' | 'bundled' | 'unbound'; - /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; - - /** - * Hash of the Wrangler configuration used for the deployment. - */ - wrangler_config_hash?: string; } export namespace Production { @@ -1810,16 +1537,6 @@ export namespace ProjectCreateParams { namespace_id?: string; } - /** - * Limits for Pages Functions. - */ - export interface Limits { - /** - * CPU time limit in milliseconds. - */ - cpu_ms?: number; - } - /** * mTLS binding. */ @@ -1894,82 +1611,39 @@ export namespace ProjectCreateParams { export interface Source { config?: Source.Config; - /** - * The source control management provider. - */ - type?: 'github' | 'gitlab'; + type?: string; } export namespace Source { export interface Config { - /** - * @deprecated Use `production_deployments_enabled` and - * `preview_deployment_setting` for more granular control. - */ deployments_enabled?: boolean; - /** - * The owner of the repository. - */ owner?: string; - /** - * A list of paths that should be excluded from triggering a preview deployment. - * Wildcard syntax (`*`) is supported. - */ path_excludes?: Array; - /** - * A list of paths that should be watched to trigger a preview deployment. Wildcard - * syntax (`*`) is supported. - */ path_includes?: Array; - /** - * Whether to enable PR comments. - */ pr_comments_enabled?: boolean; - /** - * A list of branches that should not trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_excludes?: Array; - /** - * A list of branches that should trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_includes?: Array; - /** - * Controls whether commits to preview branches trigger a preview deployment. - */ preview_deployment_setting?: 'all' | 'none' | 'custom'; - /** - * The production branch of the repository. - */ production_branch?: string; - /** - * Whether to trigger a production deployment on commits to the production branch. - */ production_deployments_enabled?: boolean; - /** - * The name of the repository. - */ repo_name?: string; } } } -export interface ProjectListParams extends V4PagePaginationArrayParams { +export interface ProjectListParams { /** - * Path param: Identifier + * Identifier */ account_id: string; } @@ -1988,25 +1662,25 @@ export interface ProjectEditParams { account_id: string; /** - * Body param: Name of the project. + * Body param: Configs for the project build process. */ - name: string; + build_config?: ProjectEditParams.BuildConfig; /** - * Body param: Production branch of the project. Used to identify production - * deployments. + * Body param: Configs for deployments in a project. */ - production_branch: string; + deployment_configs?: ProjectEditParams.DeploymentConfigs; /** - * Body param: Configs for the project build process. + * Body param: Name of the project. */ - build_config?: ProjectEditParams.BuildConfig | null; + name?: string; /** - * Body param: Configs for deployments in a project. + * Body param: Production branch of the project. Used to identify production + * deployments. */ - deployment_configs?: ProjectEditParams.DeploymentConfigs | null; + production_branch?: string; /** * Body param: @@ -2057,12 +1731,12 @@ export namespace ProjectEditParams { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview | null; + preview?: DeploymentConfigs.Preview; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production | null; + production?: DeploymentConfigs.Production; } export namespace DeploymentConfigs { @@ -2075,11 +1749,6 @@ export namespace ProjectEditParams { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; - /** - * Whether to always use the latest compatibility date for Pages Functions. - */ - always_use_latest_compatibility_date?: boolean; - /** * Analytics Engine bindings used for Pages Functions. */ @@ -2090,11 +1759,6 @@ export namespace ProjectEditParams { */ browsers?: { [key: string]: Preview.Browsers | null } | null; - /** - * The major version of the build image to use for Pages Functions. - */ - build_image_major_version?: number; - /** * Compatibility date used for Pages Functions. */ @@ -2103,7 +1767,7 @@ export namespace ProjectEditParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array | null; + compatibility_flags?: Array; /** * D1 databases used for Pages Functions. @@ -2120,12 +1784,7 @@ export namespace ProjectEditParams { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - } | null; - - /** - * Whether to fail open when the deployment config cannot be applied. - */ - fail_open?: boolean; + }; /** * Hyperdrive bindings used for Pages Functions. @@ -2137,11 +1796,6 @@ export namespace ProjectEditParams { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; - /** - * Limits for Pages Functions. - */ - limits?: Preview.Limits | null; - /** * mTLS bindings used for Pages Functions. */ @@ -2167,20 +1821,10 @@ export namespace ProjectEditParams { */ services?: { [key: string]: Preview.Services | null } | null; - /** - * @deprecated All new projects now use the Standard usage model. - */ - usage_model?: 'standard' | 'bundled' | 'unbound'; - /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; - - /** - * Hash of the Wrangler configuration used for the deployment. - */ - wrangler_config_hash?: string; } export namespace Preview { @@ -2267,16 +1911,6 @@ export namespace ProjectEditParams { namespace_id?: string; } - /** - * Limits for Pages Functions. - */ - export interface Limits { - /** - * CPU time limit in milliseconds. - */ - cpu_ms?: number; - } - /** * mTLS binding. */ @@ -2356,11 +1990,6 @@ export namespace ProjectEditParams { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; - /** - * Whether to always use the latest compatibility date for Pages Functions. - */ - always_use_latest_compatibility_date?: boolean; - /** * Analytics Engine bindings used for Pages Functions. */ @@ -2371,11 +2000,6 @@ export namespace ProjectEditParams { */ browsers?: { [key: string]: Production.Browsers | null } | null; - /** - * The major version of the build image to use for Pages Functions. - */ - build_image_major_version?: number; - /** * Compatibility date used for Pages Functions. */ @@ -2384,7 +2008,7 @@ export namespace ProjectEditParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array | null; + compatibility_flags?: Array; /** * D1 databases used for Pages Functions. @@ -2401,12 +2025,7 @@ export namespace ProjectEditParams { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - } | null; - - /** - * Whether to fail open when the deployment config cannot be applied. - */ - fail_open?: boolean; + }; /** * Hyperdrive bindings used for Pages Functions. @@ -2418,11 +2037,6 @@ export namespace ProjectEditParams { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; - /** - * Limits for Pages Functions. - */ - limits?: Production.Limits | null; - /** * mTLS bindings used for Pages Functions. */ @@ -2448,20 +2062,10 @@ export namespace ProjectEditParams { */ services?: { [key: string]: Production.Services | null } | null; - /** - * @deprecated All new projects now use the Standard usage model. - */ - usage_model?: 'standard' | 'bundled' | 'unbound'; - /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; - - /** - * Hash of the Wrangler configuration used for the deployment. - */ - wrangler_config_hash?: string; } export namespace Production { @@ -2548,16 +2152,6 @@ export namespace ProjectEditParams { namespace_id?: string; } - /** - * Limits for Pages Functions. - */ - export interface Limits { - /** - * CPU time limit in milliseconds. - */ - cpu_ms?: number; - } - /** * mTLS binding. */ @@ -2632,74 +2226,31 @@ export namespace ProjectEditParams { export interface Source { config?: Source.Config; - /** - * The source control management provider. - */ - type?: 'github' | 'gitlab'; + type?: string; } export namespace Source { export interface Config { - /** - * @deprecated Use `production_deployments_enabled` and - * `preview_deployment_setting` for more granular control. - */ deployments_enabled?: boolean; - /** - * The owner of the repository. - */ owner?: string; - /** - * A list of paths that should be excluded from triggering a preview deployment. - * Wildcard syntax (`*`) is supported. - */ path_excludes?: Array; - /** - * A list of paths that should be watched to trigger a preview deployment. Wildcard - * syntax (`*`) is supported. - */ path_includes?: Array; - /** - * Whether to enable PR comments. - */ pr_comments_enabled?: boolean; - /** - * A list of branches that should not trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_excludes?: Array; - /** - * A list of branches that should trigger a preview deployment. Wildcard syntax - * (`*`) is supported. Must be used with `preview_deployment_setting` set to - * `custom`. - */ preview_branch_includes?: Array; - /** - * Controls whether commits to preview branches trigger a preview deployment. - */ preview_deployment_setting?: 'all' | 'none' | 'custom'; - /** - * The production branch of the repository. - */ production_branch?: string; - /** - * Whether to trigger a production deployment on commits to the production branch. - */ production_deployments_enabled?: boolean; - /** - * The name of the repository. - */ repo_name?: string; } } @@ -2719,7 +2270,7 @@ export interface ProjectPurgeBuildCacheParams { account_id: string; } -Projects.DeploymentsV4PagePaginationArray = DeploymentsV4PagePaginationArray; +Projects.DeploymentsSinglePage = DeploymentsSinglePage; Projects.Deployments = Deployments; Projects.Domains = Domains; Projects.DomainListResponsesSinglePage = DomainListResponsesSinglePage; @@ -2731,7 +2282,7 @@ export declare namespace Projects { type Stage as Stage, type ProjectDeleteResponse as ProjectDeleteResponse, type ProjectPurgeBuildCacheResponse as ProjectPurgeBuildCacheResponse, - DeploymentsV4PagePaginationArray as DeploymentsV4PagePaginationArray, + DeploymentsSinglePage as DeploymentsSinglePage, type ProjectCreateParams as ProjectCreateParams, type ProjectListParams as ProjectListParams, type ProjectDeleteParams as ProjectDeleteParams, diff --git a/src/resources/pipelines.ts b/src/resources/pipelines.ts index cfc4b0add9..02e40368e4 100644 --- a/src/resources/pipelines.ts +++ b/src/resources/pipelines.ts @@ -5,10 +5,29 @@ import * as Core from '../core'; export class Pipelines extends APIResource { /** - * [DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint - * instead. + * Create a new pipeline. * - * @deprecated + * @example + * ```ts + * const pipeline = await client.pipelines.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * destination: { + * batch: {}, + * compression: {}, + * credentials: { + * access_key_id: '', + * endpoint: + * 'https://123f8a8258064ed892a347f173372359.r2.cloudflarestorage.com', + * secret_access_key: '', + * }, + * format: 'json', + * path: { bucket: 'bucket' }, + * type: 'r2', + * }, + * name: 'sample_pipeline', + * source: [{ format: 'json', type: 'type' }], + * }); + * ``` */ create( params: PipelineCreateParams, @@ -23,10 +42,26 @@ export class Pipelines extends APIResource { } /** - * [DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines - * endpoint instead. + * Update an existing pipeline. * - * @deprecated + * @example + * ```ts + * const pipeline = await client.pipelines.update( + * 'sample_pipeline', + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * destination: { + * batch: {}, + * compression: {}, + * format: 'json', + * path: { bucket: 'bucket' }, + * type: 'r2', + * }, + * name: 'sample_pipeline', + * source: [{ format: 'json', type: 'type' }], + * }, + * ); + * ``` */ update( pipelineName: string, @@ -43,10 +78,14 @@ export class Pipelines extends APIResource { } /** - * [DEPRECATED] List, filter, and paginate pipelines in an account. Use the new - * /pipelines/v1/pipelines endpoint instead. + * List, filter, and paginate pipelines in an account. * - * @deprecated + * @example + * ```ts + * const pipelines = await client.pipelines.list({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ list(params: PipelineListParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...query } = params; @@ -54,10 +93,14 @@ export class Pipelines extends APIResource { } /** - * [DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint - * instead. + * Delete a pipeline. * - * @deprecated + * @example + * ```ts + * await client.pipelines.delete('sample_pipeline', { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ delete( pipelineName: string, @@ -72,10 +115,15 @@ export class Pipelines extends APIResource { } /** - * [DEPRECATED] Get configuration of a pipeline. Use the new - * /pipelines/v1/pipelines endpoint instead. + * Get configuration of a pipeline. * - * @deprecated + * @example + * ```ts + * const pipeline = await client.pipelines.get( + * 'sample_pipeline', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ get( pipelineName: string, @@ -92,8 +140,7 @@ export class Pipelines extends APIResource { } /** - * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new - * streams/sinks/pipelines API instead. + * Describes the configuration of a pipeline. */ export interface PipelineCreateResponse { /** @@ -191,10 +238,6 @@ export namespace PipelineCreateResponse { } } - /** - * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API - * instead. - */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -220,10 +263,6 @@ export namespace PipelineCreateResponse { } } - /** - * @deprecated [DEPRECATED] Worker binding source configuration. Use the new - * streams API instead. - */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -235,8 +274,7 @@ export namespace PipelineCreateResponse { } /** - * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new - * streams/sinks/pipelines API instead. + * Describes the configuration of a pipeline. */ export interface PipelineUpdateResponse { /** @@ -334,10 +372,6 @@ export namespace PipelineUpdateResponse { } } - /** - * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API - * instead. - */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -363,10 +397,6 @@ export namespace PipelineUpdateResponse { } } - /** - * @deprecated [DEPRECATED] Worker binding source configuration. Use the new - * streams API instead. - */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -412,8 +442,7 @@ export namespace PipelineListResponse { } /** - * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new - * streams/sinks/pipelines API instead. + * Describes the configuration of a pipeline. */ export interface Result { /** @@ -511,10 +540,6 @@ export namespace PipelineListResponse { } } - /** - * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API - * instead. - */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -540,10 +565,6 @@ export namespace PipelineListResponse { } } - /** - * @deprecated [DEPRECATED] Worker binding source configuration. Use the new - * streams API instead. - */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -556,8 +577,7 @@ export namespace PipelineListResponse { } /** - * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new - * streams/sinks/pipelines API instead. + * Describes the configuration of a pipeline. */ export interface PipelineGetResponse { /** @@ -655,10 +675,6 @@ export namespace PipelineGetResponse { } } - /** - * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API - * instead. - */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -684,10 +700,6 @@ export namespace PipelineGetResponse { } } - /** - * @deprecated [DEPRECATED] Worker binding source configuration. Use the new - * streams API instead. - */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -809,10 +821,6 @@ export namespace PipelineCreateParams { } } - /** - * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API - * instead. - */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -838,10 +846,6 @@ export namespace PipelineCreateParams { } } - /** - * @deprecated [DEPRECATED] Worker binding source configuration. Use the new - * streams API instead. - */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -963,10 +967,6 @@ export namespace PipelineUpdateParams { } } - /** - * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API - * instead. - */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -992,10 +992,6 @@ export namespace PipelineUpdateParams { } } - /** - * @deprecated [DEPRECATED] Worker binding source configuration. Use the new - * streams API instead. - */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. diff --git a/src/resources/queues/consumers.ts b/src/resources/queues/consumers.ts index 93596e00ee..43eae71410 100644 --- a/src/resources/queues/consumers.ts +++ b/src/resources/queues/consumers.ts @@ -106,6 +106,33 @@ export class Consumers extends APIResource { const { account_id } = params; return this._client.delete(`/accounts/${account_id}/queues/${queueId}/consumers/${consumerId}`, options); } + + /** + * Fetches the consumer for a queue by consumer id + * + * @example + * ```ts + * const consumer = await client.queues.consumers.get( + * '023e105f4ecef8ad9ca31a8372d0c353', + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + queueId: string, + consumerId: string, + params: ConsumerGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + 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); + } } export class ConsumersSinglePage extends SinglePage {} @@ -464,6 +491,13 @@ export interface ConsumerDeleteParams { account_id: string; } +export interface ConsumerGetParams { + /** + * A Resource identifier. + */ + account_id: string; +} + Consumers.ConsumersSinglePage = ConsumersSinglePage; export declare namespace Consumers { @@ -475,5 +509,6 @@ export declare namespace Consumers { 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 32568cd469..ebf2923861 100644 --- a/src/resources/queues/index.ts +++ b/src/resources/queues/index.ts @@ -9,15 +9,30 @@ export { type ConsumerUpdateParams, type ConsumerListParams, type ConsumerDeleteParams, + 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'; -export { Subscriptions } from './subscriptions'; +export { + SubscriptionListResponsesV4PagePaginationArray, + Subscriptions, + type SubscriptionCreateResponse, + type SubscriptionUpdateResponse, + type SubscriptionListResponse, + type SubscriptionDeleteResponse, + type SubscriptionCreateParams, + type SubscriptionUpdateParams, + type SubscriptionListParams, + type SubscriptionDeleteParams, +} from './subscriptions'; 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 15d1651711..667ab7a44a 100644 --- a/src/resources/queues/queues.ts +++ b/src/resources/queues/queues.ts @@ -9,6 +9,7 @@ import { ConsumerCreateParams, ConsumerDeleteParams, ConsumerDeleteResponse, + ConsumerGetParams, ConsumerListParams, ConsumerUpdateParams, Consumers, @@ -18,15 +19,29 @@ import * as MessagesAPI from './messages'; import { MessageAckParams, MessageAckResponse, + MessageBulkPushParams, + MessageBulkPushResponse, MessagePullParams, MessagePullResponse, - MessagePullResponsesSinglePage, + MessagePushParams, + MessagePushResponse, Messages, } from './messages'; import * as PurgeAPI from './purge'; import { Purge, PurgeStartParams, PurgeStatusParams, PurgeStatusResponse } from './purge'; import * as SubscriptionsAPI from './subscriptions'; -import { Subscriptions } from './subscriptions'; +import { + SubscriptionCreateParams, + SubscriptionCreateResponse, + SubscriptionDeleteParams, + SubscriptionDeleteResponse, + SubscriptionListParams, + SubscriptionListResponse, + SubscriptionListResponsesV4PagePaginationArray, + SubscriptionUpdateParams, + SubscriptionUpdateResponse, + Subscriptions, +} from './subscriptions'; import { SinglePage } from '../../pagination'; export class Queues extends APIResource { @@ -328,11 +343,11 @@ export interface QueueGetParams { Queues.QueuesSinglePage = QueuesSinglePage; Queues.Messages = Messages; -Queues.MessagePullResponsesSinglePage = MessagePullResponsesSinglePage; Queues.Purge = Purge; Queues.Consumers = Consumers; Queues.ConsumersSinglePage = ConsumersSinglePage; Queues.Subscriptions = Subscriptions; +Queues.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; export declare namespace Queues { export { @@ -350,10 +365,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 { @@ -372,7 +390,19 @@ export declare namespace Queues { type ConsumerUpdateParams as ConsumerUpdateParams, type ConsumerListParams as ConsumerListParams, type ConsumerDeleteParams as ConsumerDeleteParams, + type ConsumerGetParams as ConsumerGetParams, }; - export { Subscriptions as Subscriptions }; + export { + Subscriptions as Subscriptions, + type SubscriptionCreateResponse as SubscriptionCreateResponse, + type SubscriptionUpdateResponse as SubscriptionUpdateResponse, + type SubscriptionListResponse as SubscriptionListResponse, + type SubscriptionDeleteResponse as SubscriptionDeleteResponse, + SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, + type SubscriptionCreateParams as SubscriptionCreateParams, + type SubscriptionUpdateParams as SubscriptionUpdateParams, + type SubscriptionListParams as SubscriptionListParams, + type SubscriptionDeleteParams as SubscriptionDeleteParams, + }; } diff --git a/src/resources/queues/subscriptions.ts b/src/resources/queues/subscriptions.ts index 42d6ea9ea6..3bb405e3fc 100644 --- a/src/resources/queues/subscriptions.ts +++ b/src/resources/queues/subscriptions.ts @@ -1,5 +1,874 @@ // 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 Subscriptions extends APIResource {} +export class Subscriptions extends APIResource { + /** + * Create a new event subscription for a queue + * + * @example + * ```ts + * const subscription = + * await client.queues.subscriptions.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create( + params: SubscriptionCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/event_subscriptions/subscriptions`, { + body, + ...options, + }) as Core.APIPromise<{ result: SubscriptionCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update an existing event subscription + * + * @example + * ```ts + * const subscription = + * await client.queues.subscriptions.update( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + update( + subscriptionId: string, + params: SubscriptionUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.patch(`/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: SubscriptionUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a paginated list of event subscriptions with optional sorting and filtering + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const subscriptionListResponse of client.queues.subscriptions.list( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: SubscriptionListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/event_subscriptions/subscriptions`, + SubscriptionListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Delete an existing event subscription + * + * @example + * ```ts + * const subscription = + * await client.queues.subscriptions.delete( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + subscriptionId: string, + params: SubscriptionDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete( + `/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, + options, + ) as Core.APIPromise<{ result: SubscriptionDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class SubscriptionListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface SubscriptionCreateResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionCreateResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionCreateResponse.MqEventSourceImages + | SubscriptionCreateResponse.MqEventSourceKV + | SubscriptionCreateResponse.MqEventSourceR2 + | SubscriptionCreateResponse.MqEventSourceSuperSlurper + | SubscriptionCreateResponse.MqEventSourceVectorize + | SubscriptionCreateResponse.MqEventSourceWorkersAIModel + | SubscriptionCreateResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionCreateResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionCreateResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionUpdateResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionUpdateResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionUpdateResponse.MqEventSourceImages + | SubscriptionUpdateResponse.MqEventSourceKV + | SubscriptionUpdateResponse.MqEventSourceR2 + | SubscriptionUpdateResponse.MqEventSourceSuperSlurper + | SubscriptionUpdateResponse.MqEventSourceVectorize + | SubscriptionUpdateResponse.MqEventSourceWorkersAIModel + | SubscriptionUpdateResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionUpdateResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionUpdateResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionListResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionListResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionListResponse.MqEventSourceImages + | SubscriptionListResponse.MqEventSourceKV + | SubscriptionListResponse.MqEventSourceR2 + | SubscriptionListResponse.MqEventSourceSuperSlurper + | SubscriptionListResponse.MqEventSourceVectorize + | SubscriptionListResponse.MqEventSourceWorkersAIModel + | SubscriptionListResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionListResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionListResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionDeleteResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionDeleteResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionDeleteResponse.MqEventSourceImages + | SubscriptionDeleteResponse.MqEventSourceKV + | SubscriptionDeleteResponse.MqEventSourceR2 + | SubscriptionDeleteResponse.MqEventSourceSuperSlurper + | SubscriptionDeleteResponse.MqEventSourceVectorize + | SubscriptionDeleteResponse.MqEventSourceWorkersAIModel + | SubscriptionDeleteResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionDeleteResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionDeleteResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionCreateParams { + /** + * Path param: A Resource identifier. + */ + account_id: string; + + /** + * Body param: Destination configuration for the subscription + */ + destination?: SubscriptionCreateParams.Destination; + + /** + * Body param: Whether the subscription is active + */ + enabled?: boolean; + + /** + * Body param: List of event types this subscription handles + */ + events?: Array; + + /** + * Body param: Name of the subscription + */ + name?: string; + + /** + * Body param: Source configuration for the subscription + */ + source?: + | SubscriptionCreateParams.MqEventSourceImages + | SubscriptionCreateParams.MqEventSourceKV + | SubscriptionCreateParams.MqEventSourceR2 + | SubscriptionCreateParams.MqEventSourceSuperSlurper + | SubscriptionCreateParams.MqEventSourceVectorize + | SubscriptionCreateParams.MqEventSourceWorkersAIModel + | SubscriptionCreateParams.MqEventSourceWorkersBuildsWorker + | SubscriptionCreateParams.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionCreateParams { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionUpdateParams { + /** + * Path param: A Resource identifier. + */ + account_id: string; + + /** + * Body param: Destination configuration for the subscription + */ + destination?: SubscriptionUpdateParams.Destination; + + /** + * Body param: Whether the subscription is active + */ + enabled?: boolean; + + /** + * Body param: List of event types this subscription handles + */ + events?: Array; + + /** + * Body param: Name of the subscription + */ + name?: string; +} + +export namespace SubscriptionUpdateParams { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } +} + +export interface SubscriptionListParams extends V4PagePaginationArrayParams { + /** + * Path param: A Resource identifier. + */ + account_id: string; + + /** + * Query param: Sort direction + */ + direction?: 'asc' | 'desc'; + + /** + * Query param: Field to sort by + */ + order?: 'created_at' | 'name' | 'enabled' | 'source'; +} + +export interface SubscriptionDeleteParams { + /** + * A Resource identifier. + */ + account_id: string; +} + +Subscriptions.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; + +export declare namespace Subscriptions { + export { + type SubscriptionCreateResponse as SubscriptionCreateResponse, + type SubscriptionUpdateResponse as SubscriptionUpdateResponse, + type SubscriptionListResponse as SubscriptionListResponse, + type SubscriptionDeleteResponse as SubscriptionDeleteResponse, + SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, + type SubscriptionCreateParams as SubscriptionCreateParams, + type SubscriptionUpdateParams as SubscriptionUpdateParams, + type SubscriptionListParams as SubscriptionListParams, + type SubscriptionDeleteParams as SubscriptionDeleteParams, + }; +} diff --git a/src/resources/r2/super-slurper/connectivity-precheck.ts b/src/resources/r2/super-slurper/connectivity-precheck.ts index 2283824388..654a8193d5 100644 --- a/src/resources/r2/super-slurper/connectivity-precheck.ts +++ b/src/resources/r2/super-slurper/connectivity-precheck.ts @@ -13,12 +13,6 @@ export class ConnectivityPrecheck extends APIResource { * const response = * await client.r2.superSlurper.connectivityPrecheck.source({ * account_id: 'account_id', - * bucket: 'bucket', - * secret: { - * accessKeyId: 'accessKeyId', - * secretAccessKey: 'secretAccessKey', - * }, - * vendor: 's3', * }); * ``` */ @@ -43,12 +37,6 @@ export class ConnectivityPrecheck extends APIResource { * const response = * await client.r2.superSlurper.connectivityPrecheck.target({ * account_id: 'account_id', - * bucket: 'bucket', - * secret: { - * accessKeyId: 'accessKeyId', - * secretAccessKey: 'secretAccessKey', - * }, - * vendor: 'r2', * }); * ``` */ @@ -89,17 +77,7 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket: string; - - /** - * Body param: - */ - secret: R2SlurperS3SourceSchema.Secret; - - /** - * Body param: - */ - vendor: 's3'; + bucket?: string; /** * Body param: @@ -109,19 +87,19 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - pathPrefix?: string | null; + secret?: R2SlurperS3SourceSchema.Secret; /** * Body param: */ - region?: string | null; + vendor?: 's3'; } export namespace R2SlurperS3SourceSchema { export interface Secret { - accessKeyId: string; + accessKeyId?: string; - secretAccessKey: string; + secretAccessKey?: string; } } @@ -134,29 +112,24 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket: string; - - /** - * Body param: - */ - secret: R2SlurperGcsSourceSchema.Secret; + bucket?: string; /** * Body param: */ - vendor: 'gcs'; + secret?: R2SlurperGcsSourceSchema.Secret; /** * Body param: */ - pathPrefix?: string | null; + vendor?: 'gcs'; } export namespace R2SlurperGcsSourceSchema { export interface Secret { - clientEmail: string; + clientEmail?: string; - privateKey: string; + privateKey?: string; } } @@ -169,34 +142,29 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket: string; - - /** - * Body param: - */ - secret: R2SlurperR2SourceSchema.Secret; + bucket?: string; /** * Body param: */ - vendor: SippyAPI.ProviderParam; + jurisdiction?: 'default' | 'eu' | 'fedramp'; /** * Body param: */ - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret?: R2SlurperR2SourceSchema.Secret; /** * Body param: */ - pathPrefix?: string | null; + vendor?: SippyAPI.ProviderParam; } export namespace R2SlurperR2SourceSchema { export interface Secret { - accessKeyId: string; + accessKeyId?: string; - secretAccessKey: string; + secretAccessKey?: string; } } } @@ -210,29 +178,29 @@ export interface ConnectivityPrecheckTargetParams { /** * Body param: */ - bucket: string; + bucket?: string; /** * Body param: */ - secret: ConnectivityPrecheckTargetParams.Secret; + jurisdiction?: 'default' | 'eu' | 'fedramp'; /** * Body param: */ - vendor: SippyAPI.ProviderParam; + secret?: ConnectivityPrecheckTargetParams.Secret; /** * Body param: */ - jurisdiction?: 'default' | 'eu' | 'fedramp'; + vendor?: SippyAPI.ProviderParam; } export namespace ConnectivityPrecheckTargetParams { export interface Secret { - accessKeyId: string; + accessKeyId?: string; - secretAccessKey: string; + secretAccessKey?: string; } } diff --git a/src/resources/r2/super-slurper/jobs/jobs.ts b/src/resources/r2/super-slurper/jobs/jobs.ts index 7732e944b1..0e70bb10e5 100644 --- a/src/resources/r2/super-slurper/jobs/jobs.ts +++ b/src/resources/r2/super-slurper/jobs/jobs.ts @@ -360,80 +360,72 @@ export interface JobCreateParams { export namespace JobCreateParams { export interface R2SlurperS3SourceSchema { - bucket: string; - - secret: R2SlurperS3SourceSchema.Secret; - - vendor: 's3'; + bucket?: string; endpoint?: string | null; - pathPrefix?: string | null; + secret?: R2SlurperS3SourceSchema.Secret; - region?: string | null; + vendor?: 's3'; } export namespace R2SlurperS3SourceSchema { export interface Secret { - accessKeyId: string; + accessKeyId?: string; - secretAccessKey: string; + secretAccessKey?: string; } } export interface R2SlurperGcsSourceSchema { - bucket: string; - - secret: R2SlurperGcsSourceSchema.Secret; + bucket?: string; - vendor: 'gcs'; + secret?: R2SlurperGcsSourceSchema.Secret; - pathPrefix?: string | null; + vendor?: 'gcs'; } export namespace R2SlurperGcsSourceSchema { export interface Secret { - clientEmail: string; + clientEmail?: string; - privateKey: string; + privateKey?: string; } } export interface R2SlurperR2SourceSchema { - bucket: string; - - secret: R2SlurperR2SourceSchema.Secret; - - vendor: SippyAPI.ProviderParam; + bucket?: string; jurisdiction?: 'default' | 'eu' | 'fedramp'; - pathPrefix?: string | null; + secret?: R2SlurperR2SourceSchema.Secret; + + vendor?: SippyAPI.ProviderParam; } export namespace R2SlurperR2SourceSchema { export interface Secret { - accessKeyId: string; + accessKeyId?: string; - secretAccessKey: string; + secretAccessKey?: string; } } export interface Target { - bucket: string; + bucket?: string; - secret: Target.Secret; + jurisdiction?: 'default' | 'eu' | 'fedramp'; - vendor: SippyAPI.ProviderParam; + secret?: Target.Secret; - jurisdiction?: 'default' | 'eu' | 'fedramp'; + vendor?: SippyAPI.ProviderParam; } export namespace Target { export interface Secret { - accessKeyId: string; + accessKeyId?: string; - secretAccessKey: string; + secretAccessKey?: string; } } } diff --git a/src/resources/radar/as112/as112.ts b/src/resources/radar/as112/as112.ts index a617daa990..876d8d74aa 100644 --- a/src/resources/radar/as112/as112.ts +++ b/src/resources/radar/as112/as112.ts @@ -55,40 +55,6 @@ export class AS112 extends APIResource { ); top: TopAPI.Top = new TopAPI.Top(this._client); - /** - * Retrieves the distribution of AS112 queries by the specified dimension. - * - * @example - * ```ts - * const response = await client.radar.as112.summaryV2( - * 'DNSSEC', - * ); - * ``` - */ - summaryV2( - dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', - query?: AS112SummaryV2Params, - options?: Core.RequestOptions, - ): Core.APIPromise; - summaryV2( - dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', - options?: Core.RequestOptions, - ): Core.APIPromise; - summaryV2( - dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', - query: AS112SummaryV2Params | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summaryV2(dimension, {}, query); - } - return ( - this._client.get(`/radar/as112/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: AS112SummaryV2Response; - }> - )._thenUnwrap((obj) => obj.result); - } - /** * Retrieves the AS112 DNS queries over time. * @@ -115,137 +81,6 @@ export class AS112 extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Retrieves the distribution of AS112 queries grouped by dimension over time. - * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroupsV2('DNSSEC'); - * ``` - */ - timeseriesGroupsV2( - dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', - query?: AS112TimeseriesGroupsV2Params, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroupsV2( - dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroupsV2( - dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', - query: AS112TimeseriesGroupsV2Params | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroupsV2(dimension, {}, query); - } - return ( - this._client.get(`/radar/as112/timeseries_groups/${dimension}`, { - query, - ...options, - }) as Core.APIPromise<{ result: AS112TimeseriesGroupsV2Response }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface AS112SummaryV2Response { - /** - * Metadata for the results. - */ - meta: AS112SummaryV2Response.Meta; - - summary_0: { [key: string]: string }; -} - -export namespace AS112SummaryV2Response { - /** - * 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 AS112TimeseriesResponse { @@ -361,117 +196,14 @@ export namespace AS112TimeseriesResponse { } } -export interface AS112TimeseriesGroupsV2Response { - /** - * Metadata for the results. - */ - meta: AS112TimeseriesGroupsV2Response.Meta; - - serie_0: AS112TimeseriesGroupsV2Response.Serie0; -} - -export namespace AS112TimeseriesGroupsV2Response { +export interface AS112TimeseriesParams { /** - * Metadata for the results. + * 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/). */ - 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; - } -} + aggInterval?: '15m' | '1h' | '1d' | '1w'; -export interface AS112SummaryV2Params { /** * Filters results by continent. Specify a comma-separated list of alpha-2 codes. * Prefix with `-` to exclude continents from results. For example, `-EU,NA` @@ -501,366 +233,6 @@ export interface AS112SummaryV2Params { */ 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 DNS transport protocol. - */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; - - /** - * Filters results by DNS query type. - */ - queryType?: - | 'A' - | 'AAAA' - | 'A6' - | 'AFSDB' - | 'ANY' - | 'APL' - | 'ATMA' - | 'AXFR' - | 'CAA' - | 'CDNSKEY' - | 'CDS' - | 'CERT' - | 'CNAME' - | 'CSYNC' - | 'DHCID' - | 'DLV' - | 'DNAME' - | 'DNSKEY' - | 'DOA' - | 'DS' - | 'EID' - | 'EUI48' - | 'EUI64' - | 'GPOS' - | 'GID' - | 'HINFO' - | 'HIP' - | 'HTTPS' - | 'IPSECKEY' - | 'ISDN' - | 'IXFR' - | 'KEY' - | 'KX' - | 'L32' - | 'L64' - | 'LOC' - | 'LP' - | 'MAILA' - | 'MAILB' - | 'MB' - | 'MD' - | 'MF' - | 'MG' - | 'MINFO' - | 'MR' - | 'MX' - | 'NAPTR' - | 'NB' - | 'NBSTAT' - | 'NID' - | 'NIMLOC' - | 'NINFO' - | 'NS' - | 'NSAP' - | 'NSEC' - | 'NSEC3' - | 'NSEC3PARAM' - | 'NULL' - | 'NXT' - | 'OPENPGPKEY' - | 'OPT' - | 'PTR' - | 'PX' - | 'RKEY' - | 'RP' - | 'RRSIG' - | 'RT' - | 'SIG' - | 'SINK' - | 'SMIMEA' - | 'SOA' - | 'SPF' - | 'SRV' - | 'SSHFP' - | 'SVCB' - | 'TA' - | 'TALINK' - | 'TKEY' - | 'TLSA' - | 'TSIG' - | 'TXT' - | 'UINFO' - | 'UID' - | 'UNSPEC' - | 'URI' - | 'WKS' - | 'X25' - | 'ZONEMD' - | null; - - /** - * Filters results by DNS response code. - */ - responseCode?: - | 'NOERROR' - | 'FORMERR' - | 'SERVFAIL' - | 'NXDOMAIN' - | 'NOTIMP' - | 'REFUSED' - | 'YXDOMAIN' - | 'YXRRSET' - | 'NXRRSET' - | 'NOTAUTH' - | 'NOTZONE' - | 'BADSIG' - | 'BADKEY' - | 'BADTIME' - | 'BADMODE' - | 'BADNAME' - | 'BADALG' - | 'BADTRUNC' - | 'BADCOOKIE'; -} - -export interface AS112TimeseriesParams { - /** - * 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 continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Filters results by DNS transport protocol. - */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; - - /** - * Filters results by DNS query type. - */ - queryType?: - | 'A' - | 'AAAA' - | 'A6' - | 'AFSDB' - | 'ANY' - | 'APL' - | 'ATMA' - | 'AXFR' - | 'CAA' - | 'CDNSKEY' - | 'CDS' - | 'CERT' - | 'CNAME' - | 'CSYNC' - | 'DHCID' - | 'DLV' - | 'DNAME' - | 'DNSKEY' - | 'DOA' - | 'DS' - | 'EID' - | 'EUI48' - | 'EUI64' - | 'GPOS' - | 'GID' - | 'HINFO' - | 'HIP' - | 'HTTPS' - | 'IPSECKEY' - | 'ISDN' - | 'IXFR' - | 'KEY' - | 'KX' - | 'L32' - | 'L64' - | 'LOC' - | 'LP' - | 'MAILA' - | 'MAILB' - | 'MB' - | 'MD' - | 'MF' - | 'MG' - | 'MINFO' - | 'MR' - | 'MX' - | 'NAPTR' - | 'NB' - | 'NBSTAT' - | 'NID' - | 'NIMLOC' - | 'NINFO' - | 'NS' - | 'NSAP' - | 'NSEC' - | 'NSEC3' - | 'NSEC3PARAM' - | 'NULL' - | 'NXT' - | 'OPENPGPKEY' - | 'OPT' - | 'PTR' - | 'PX' - | 'RKEY' - | 'RP' - | 'RRSIG' - | 'RT' - | 'SIG' - | 'SINK' - | 'SMIMEA' - | 'SOA' - | 'SPF' - | 'SRV' - | 'SSHFP' - | 'SVCB' - | 'TA' - | 'TALINK' - | 'TKEY' - | 'TLSA' - | 'TSIG' - | 'TXT' - | 'UINFO' - | 'UID' - | 'UNSPEC' - | 'URI' - | 'WKS' - | 'X25' - | 'ZONEMD' - | null; - - /** - * Filters results by DNS response code. - */ - responseCode?: - | 'NOERROR' - | 'FORMERR' - | 'SERVFAIL' - | 'NXDOMAIN' - | 'NOTIMP' - | 'REFUSED' - | 'YXDOMAIN' - | 'YXRRSET' - | 'NXRRSET' - | 'NOTAUTH' - | 'NOTZONE' - | 'BADSIG' - | 'BADKEY' - | 'BADTIME' - | 'BADMODE' - | 'BADNAME' - | 'BADALG' - | 'BADTRUNC' - | 'BADCOOKIE'; -} - -export interface AS112TimeseriesGroupsV2Params { - /** - * 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 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` @@ -1003,12 +375,8 @@ AS112.Top = Top; export declare namespace AS112 { export { - type AS112SummaryV2Response as AS112SummaryV2Response, type AS112TimeseriesResponse as AS112TimeseriesResponse, - type AS112TimeseriesGroupsV2Response as AS112TimeseriesGroupsV2Response, - type AS112SummaryV2Params as AS112SummaryV2Params, type AS112TimeseriesParams as AS112TimeseriesParams, - type AS112TimeseriesGroupsV2Params as AS112TimeseriesGroupsV2Params, }; export { diff --git a/src/resources/radar/as112/index.ts b/src/resources/radar/as112/index.ts index f3e1911eea..7b5e4752cb 100644 --- a/src/resources/radar/as112/index.ts +++ b/src/resources/radar/as112/index.ts @@ -1,14 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { - AS112, - type AS112SummaryV2Response, - type AS112TimeseriesResponse, - type AS112TimeseriesGroupsV2Response, - type AS112SummaryV2Params, - type AS112TimeseriesParams, - type AS112TimeseriesGroupsV2Params, -} from './as112'; +export { AS112, type AS112TimeseriesResponse, type AS112TimeseriesParams } from './as112'; export { Summary, type SummaryDNSSECResponse, diff --git a/src/resources/radar/as112/summary.ts b/src/resources/radar/as112/summary.ts index d6034b19c4..c59fdaeb5a 100644 --- a/src/resources/radar/as112/summary.ts +++ b/src/resources/radar/as112/summary.ts @@ -9,7 +9,10 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by DNSSEC (DNS Security * Extensions) support. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.as112.summary.dnssec(); + * ``` */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -31,7 +34,10 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by EDNS (Extension Mechanisms * for DNS) support. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.as112.summary.edns(); + * ``` */ edns(query?: SummaryEdnsParams, options?: Core.RequestOptions): Core.APIPromise; edns(options?: Core.RequestOptions): Core.APIPromise; @@ -52,7 +58,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by IP version. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.summary.ipVersion(); + * ``` */ ipVersion( query?: SummaryIPVersionParams, @@ -76,7 +86,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by protocol. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.summary.protocol(); + * ``` */ protocol( query?: SummaryProtocolParams, @@ -100,7 +114,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by type. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.summary.queryType(); + * ``` */ queryType( query?: SummaryQueryTypeParams, @@ -124,7 +142,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of AS112 DNS requests classified by response code. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.summary.responseCodes(); + * ``` */ responseCodes( query?: SummaryResponseCodesParams, diff --git a/src/resources/radar/as112/timeseries-groups.ts b/src/resources/radar/as112/timeseries-groups.ts index e5593df35c..a9e2aa049c 100644 --- a/src/resources/radar/as112/timeseries-groups.ts +++ b/src/resources/radar/as112/timeseries-groups.ts @@ -9,7 +9,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by DNSSEC (DNS Security * Extensions) support over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroups.dnssec(); + * ``` */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -34,7 +38,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by EDNS (Extension Mechanisms * for DNS) support over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroups.edns(); + * ``` */ edns( query?: TimeseriesGroupEdnsParams, @@ -58,7 +66,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by IP version over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroups.ipVersion(); + * ``` */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -84,7 +96,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by protocol over * time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroups.protocol(); + * ``` */ protocol( query?: TimeseriesGroupProtocolParams, @@ -108,7 +124,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by type over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroups.queryType(); + * ``` */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -134,7 +154,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by response code * over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroups.responseCodes(); + * ``` */ responseCodes( query?: TimeseriesGroupResponseCodesParams, diff --git a/src/resources/radar/attacks/attacks.ts b/src/resources/radar/attacks/attacks.ts index 4346cf6862..9d3c9c4aef 100644 --- a/src/resources/radar/attacks/attacks.ts +++ b/src/resources/radar/attacks/attacks.ts @@ -2,25 +2,9 @@ import { APIResource } from '../../../resource'; import * as Layer3API from './layer3/layer3'; -import { - Layer3, - Layer3SummaryV2Params, - Layer3SummaryV2Response, - Layer3TimeseriesGroupsV2Params, - Layer3TimeseriesGroupsV2Response, - Layer3TimeseriesParams, - Layer3TimeseriesResponse, -} from './layer3/layer3'; +import { Layer3, Layer3TimeseriesParams, Layer3TimeseriesResponse } from './layer3/layer3'; import * as Layer7API from './layer7/layer7'; -import { - Layer7, - Layer7SummaryV2Params, - Layer7SummaryV2Response, - Layer7TimeseriesGroupsV2Params, - Layer7TimeseriesGroupsV2Response, - Layer7TimeseriesParams, - Layer7TimeseriesResponse, -} from './layer7/layer7'; +import { Layer7, Layer7TimeseriesParams, Layer7TimeseriesResponse } from './layer7/layer7'; export class Attacks extends APIResource { layer3: Layer3API.Layer3 = new Layer3API.Layer3(this._client); @@ -33,21 +17,13 @@ Attacks.Layer7 = Layer7; export declare namespace Attacks { export { Layer3 as Layer3, - type Layer3SummaryV2Response as Layer3SummaryV2Response, type Layer3TimeseriesResponse as Layer3TimeseriesResponse, - type Layer3TimeseriesGroupsV2Response as Layer3TimeseriesGroupsV2Response, - type Layer3SummaryV2Params as Layer3SummaryV2Params, type Layer3TimeseriesParams as Layer3TimeseriesParams, - type Layer3TimeseriesGroupsV2Params as Layer3TimeseriesGroupsV2Params, }; export { Layer7 as Layer7, - type Layer7SummaryV2Response as Layer7SummaryV2Response, type Layer7TimeseriesResponse as Layer7TimeseriesResponse, - type Layer7TimeseriesGroupsV2Response as Layer7TimeseriesGroupsV2Response, - type Layer7SummaryV2Params as Layer7SummaryV2Params, type Layer7TimeseriesParams as Layer7TimeseriesParams, - type Layer7TimeseriesGroupsV2Params as Layer7TimeseriesGroupsV2Params, }; } diff --git a/src/resources/radar/attacks/index.ts b/src/resources/radar/attacks/index.ts index 5ff5753f57..28216f9bd4 100644 --- a/src/resources/radar/attacks/index.ts +++ b/src/resources/radar/attacks/index.ts @@ -1,21 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Attacks } from './attacks'; -export { - Layer3, - type Layer3SummaryV2Response, - type Layer3TimeseriesResponse, - type Layer3TimeseriesGroupsV2Response, - type Layer3SummaryV2Params, - type Layer3TimeseriesParams, - type Layer3TimeseriesGroupsV2Params, -} from './layer3/index'; -export { - Layer7, - type Layer7SummaryV2Response, - type Layer7TimeseriesResponse, - type Layer7TimeseriesGroupsV2Response, - type Layer7SummaryV2Params, - type Layer7TimeseriesParams, - type Layer7TimeseriesGroupsV2Params, -} from './layer7/index'; +export { Layer3, type Layer3TimeseriesResponse, type Layer3TimeseriesParams } from './layer3/index'; +export { Layer7, type Layer7TimeseriesResponse, type Layer7TimeseriesParams } from './layer7/index'; diff --git a/src/resources/radar/attacks/layer3/index.ts b/src/resources/radar/attacks/layer3/index.ts index 5cda25b111..aea57a5a87 100644 --- a/src/resources/radar/attacks/layer3/index.ts +++ b/src/resources/radar/attacks/layer3/index.ts @@ -1,14 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { - Layer3, - type Layer3SummaryV2Response, - type Layer3TimeseriesResponse, - type Layer3TimeseriesGroupsV2Response, - type Layer3SummaryV2Params, - type Layer3TimeseriesParams, - type Layer3TimeseriesGroupsV2Params, -} from './layer3'; +export { Layer3, type Layer3TimeseriesResponse, type Layer3TimeseriesParams } from './layer3'; export { Summary, type SummaryBitrateResponse, diff --git a/src/resources/radar/attacks/layer3/layer3.ts b/src/resources/radar/attacks/layer3/layer3.ts index 673db07fec..3fcf323b99 100644 --- a/src/resources/radar/attacks/layer3/layer3.ts +++ b/src/resources/radar/attacks/layer3/layer3.ts @@ -57,40 +57,6 @@ export class Layer3 extends APIResource { ); top: TopAPI.Top = new TopAPI.Top(this._client); - /** - * Retrieves the distribution of layer 3 attacks by the specified dimension. - * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summaryV2('PROTOCOL'); - * ``` - */ - summaryV2( - dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', - query?: Layer3SummaryV2Params, - options?: Core.RequestOptions, - ): Core.APIPromise; - summaryV2( - dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', - options?: Core.RequestOptions, - ): Core.APIPromise; - summaryV2( - dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', - query: Layer3SummaryV2Params | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summaryV2(dimension, {}, query); - } - return ( - this._client.get(`/radar/attacks/layer3/summary/${dimension}`, { - query, - ...options, - }) as Core.APIPromise<{ result: Layer3SummaryV2Response }> - )._thenUnwrap((obj) => obj.result); - } - /** * Retrieves layer 3 attacks over time. * @@ -118,139 +84,6 @@ export class Layer3 extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Retrieves the distribution of layer 3 attacks grouped by dimension over time. - * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroupsV2( - * 'PROTOCOL', - * ); - * ``` - */ - timeseriesGroupsV2( - dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', - query?: Layer3TimeseriesGroupsV2Params, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroupsV2( - dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroupsV2( - dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', - query: Layer3TimeseriesGroupsV2Params | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroupsV2(dimension, {}, query); - } - return ( - this._client.get(`/radar/attacks/layer3/timeseries_groups/${dimension}`, { - query, - ...options, - }) as Core.APIPromise<{ result: Layer3TimeseriesGroupsV2Response }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface Layer3SummaryV2Response { - /** - * Metadata for the results. - */ - meta: Layer3SummaryV2Response.Meta; - - summary_0: { [key: string]: string }; -} - -export namespace Layer3SummaryV2Response { - /** - * 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 Layer3TimeseriesResponse { @@ -366,182 +199,6 @@ export namespace Layer3TimeseriesResponse { } } -export interface Layer3TimeseriesGroupsV2Response { - /** - * Metadata for the results. - */ - meta: Layer3TimeseriesGroupsV2Response.Meta; - - serie_0: Layer3TimeseriesGroupsV2Response.Serie0; -} - -export namespace Layer3TimeseriesGroupsV2Response { - /** - * 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 Layer3SummaryV2Params { - /** - * 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; - - /** - * Specifies whether the `location` filter applies to the source or target - * location. - */ - direction?: 'ORIGIN' | 'TARGET'; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results by IP version (Ipv4 vs. IPv6). - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - - /** - * 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 the results by layer 3/4 protocol. - */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; -} - export interface Layer3TimeseriesParams { /** * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). @@ -627,97 +284,14 @@ export interface Layer3TimeseriesParams { protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; } -export interface Layer3TimeseriesGroupsV2Params { - /** - * 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 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; - - /** - * Specifies whether the `location` filter applies to the source or target - * location. - */ - direction?: 'ORIGIN' | 'TARGET'; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results by IP version (Ipv4 vs. IPv6). - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - - /** - * 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' | 'MIN0_MAX'; - - /** - * Filters the results by layer 3/4 protocol. - */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; -} - Layer3.Summary = Summary; Layer3.TimeseriesGroups = TimeseriesGroups; Layer3.Top = Top; export declare namespace Layer3 { export { - type Layer3SummaryV2Response as Layer3SummaryV2Response, type Layer3TimeseriesResponse as Layer3TimeseriesResponse, - type Layer3TimeseriesGroupsV2Response as Layer3TimeseriesGroupsV2Response, - type Layer3SummaryV2Params as Layer3SummaryV2Params, type Layer3TimeseriesParams as Layer3TimeseriesParams, - type Layer3TimeseriesGroupsV2Params as Layer3TimeseriesGroupsV2Params, }; export { diff --git a/src/resources/radar/attacks/layer3/summary.ts b/src/resources/radar/attacks/layer3/summary.ts index bc4ccc4c81..73ed7d7c70 100644 --- a/src/resources/radar/attacks/layer3/summary.ts +++ b/src/resources/radar/attacks/layer3/summary.ts @@ -8,7 +8,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.bitrate(); + * ``` */ bitrate( query?: SummaryBitrateParams, @@ -32,7 +36,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.duration(); + * ``` */ duration( query?: SummaryDurationParams, @@ -56,7 +64,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.industry(); + * ``` */ industry( query?: SummaryIndustryParams, @@ -80,7 +92,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.ipVersion(); + * ``` */ ipVersion( query?: SummaryIPVersionParams, @@ -104,7 +120,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.protocol(); + * ``` */ protocol( query?: SummaryProtocolParams, @@ -128,7 +148,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.vector(); + * ``` */ vector(query?: SummaryVectorParams, options?: Core.RequestOptions): Core.APIPromise; vector(options?: Core.RequestOptions): Core.APIPromise; @@ -149,7 +173,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summary.vertical(); + * ``` */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer3/timeseries-groups.ts b/src/resources/radar/attacks/layer3/timeseries-groups.ts index 9f8d171a40..740bb97cae 100644 --- a/src/resources/radar/attacks/layer3/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer3/timeseries-groups.ts @@ -8,7 +8,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.bitrate(); + * ``` */ bitrate( query?: TimeseriesGroupBitrateParams, @@ -33,7 +37,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.duration(); + * ``` */ duration( query?: TimeseriesGroupDurationParams, @@ -58,7 +66,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.industry(); + * ``` */ industry( query?: TimeseriesGroupIndustryParams, @@ -83,7 +95,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.ipVersion(); + * ``` */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -108,7 +124,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.protocol(); + * ``` */ protocol( query?: TimeseriesGroupProtocolParams, @@ -133,7 +153,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.vector(); + * ``` */ vector( query?: TimeseriesGroupVectorParams, @@ -158,7 +182,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroups.vertical(); + * ``` */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer7/index.ts b/src/resources/radar/attacks/layer7/index.ts index 20456df07c..ea12e3b31d 100644 --- a/src/resources/radar/attacks/layer7/index.ts +++ b/src/resources/radar/attacks/layer7/index.ts @@ -1,14 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { - Layer7, - type Layer7SummaryV2Response, - type Layer7TimeseriesResponse, - type Layer7TimeseriesGroupsV2Response, - type Layer7SummaryV2Params, - type Layer7TimeseriesParams, - type Layer7TimeseriesGroupsV2Params, -} from './layer7'; +export { Layer7, type Layer7TimeseriesResponse, type Layer7TimeseriesParams } from './layer7'; export { Summary, type SummaryHTTPMethodResponse, diff --git a/src/resources/radar/attacks/layer7/layer7.ts b/src/resources/radar/attacks/layer7/layer7.ts index b997d1b7f5..633b50c1a5 100644 --- a/src/resources/radar/attacks/layer7/layer7.ts +++ b/src/resources/radar/attacks/layer7/layer7.ts @@ -57,63 +57,6 @@ export class Layer7 extends APIResource { ); top: TopAPI.Top = new TopAPI.Top(this._client); - /** - * Retrieves the distribution of layer 7 attacks by the specified dimension. - * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summaryV2( - * 'HTTP_METHOD', - * ); - * ``` - */ - summaryV2( - dimension: - | 'HTTP_METHOD' - | 'HTTP_VERSION' - | 'IP_VERSION' - | 'MANAGED_RULES' - | 'MITIGATION_PRODUCT' - | 'VERTICAL' - | 'INDUSTRY', - query?: Layer7SummaryV2Params, - options?: Core.RequestOptions, - ): Core.APIPromise; - summaryV2( - dimension: - | 'HTTP_METHOD' - | 'HTTP_VERSION' - | 'IP_VERSION' - | 'MANAGED_RULES' - | 'MITIGATION_PRODUCT' - | 'VERTICAL' - | 'INDUSTRY', - options?: Core.RequestOptions, - ): Core.APIPromise; - summaryV2( - dimension: - | 'HTTP_METHOD' - | 'HTTP_VERSION' - | 'IP_VERSION' - | 'MANAGED_RULES' - | 'MITIGATION_PRODUCT' - | 'VERTICAL' - | 'INDUSTRY', - query: Layer7SummaryV2Params | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summaryV2(dimension, {}, query); - } - return ( - this._client.get(`/radar/attacks/layer7/summary/${dimension}`, { - query, - ...options, - }) as Core.APIPromise<{ result: Layer7SummaryV2Response }> - )._thenUnwrap((obj) => obj.result); - } - /** * Retrieves layer 7 attacks over time. * @@ -141,160 +84,6 @@ export class Layer7 extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Retrieves the distribution of layer 7 attacks grouped by dimension over time. - * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroupsV2( - * 'HTTP_METHOD', - * ); - * ``` - */ - timeseriesGroupsV2( - dimension: - | 'HTTP_METHOD' - | 'HTTP_VERSION' - | 'IP_VERSION' - | 'MANAGED_RULES' - | 'MITIGATION_PRODUCT' - | 'VERTICAL' - | 'INDUSTRY', - query?: Layer7TimeseriesGroupsV2Params, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroupsV2( - dimension: - | 'HTTP_METHOD' - | 'HTTP_VERSION' - | 'IP_VERSION' - | 'MANAGED_RULES' - | 'MITIGATION_PRODUCT' - | 'VERTICAL' - | 'INDUSTRY', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroupsV2( - dimension: - | 'HTTP_METHOD' - | 'HTTP_VERSION' - | 'IP_VERSION' - | 'MANAGED_RULES' - | 'MITIGATION_PRODUCT' - | 'VERTICAL' - | 'INDUSTRY', - query: Layer7TimeseriesGroupsV2Params | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroupsV2(dimension, {}, query); - } - return ( - this._client.get(`/radar/attacks/layer7/timeseries_groups/${dimension}`, { - query, - ...options, - }) as Core.APIPromise<{ result: Layer7TimeseriesGroupsV2Response }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface Layer7SummaryV2Response { - /** - * Metadata for the results. - */ - meta: Layer7SummaryV2Response.Meta; - - summary_0: { [key: string]: string }; -} - -export namespace Layer7SummaryV2Response { - /** - * 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 Layer7TimeseriesResponse { @@ -407,249 +196,6 @@ export namespace Layer7TimeseriesResponse { } } -export interface Layer7TimeseriesGroupsV2Response { - /** - * Metadata for the results. - */ - meta: Layer7TimeseriesGroupsV2Response.Meta; - - serie_0: Layer7TimeseriesGroupsV2Response.Serie0; -} - -export namespace Layer7TimeseriesGroupsV2Response { - /** - * 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 Layer7SummaryV2Params { - /** - * 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'; - - /** - * Filters results by HTTP method. - */ - httpMethod?: Array< - | 'GET' - | 'POST' - | 'DELETE' - | 'PUT' - | 'HEAD' - | 'PURGE' - | 'OPTIONS' - | 'PROPFIND' - | 'MKCOL' - | 'PATCH' - | 'ACL' - | 'BCOPY' - | 'BDELETE' - | 'BMOVE' - | 'BPROPFIND' - | 'BPROPPATCH' - | 'CHECKIN' - | 'CHECKOUT' - | 'CONNECT' - | 'COPY' - | 'LABEL' - | 'LOCK' - | 'MERGE' - | 'MKACTIVITY' - | 'MKWORKSPACE' - | 'MOVE' - | 'NOTIFY' - | 'ORDERPATCH' - | 'POLL' - | 'PROPPATCH' - | 'REPORT' - | 'SEARCH' - | 'SUBSCRIBE' - | 'TRACE' - | 'UNCHECKOUT' - | 'UNLOCK' - | 'UNSUBSCRIBE' - | 'UPDATE' - | 'VERSIONCONTROL' - | 'BASELINECONTROL' - | 'XMSENUMATTS' - | 'RPC_OUT_DATA' - | 'RPC_IN_DATA' - | 'JSON' - | 'COOK' - | 'TRACK' - >; - - /** - * Filters results by HTTP version. - */ - httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; - - /** - * Filters results by IP version (Ipv4 vs. IPv6). - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - - /** - * 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; - - /** - * Filters the results by layer 7 mitigation product. - */ - mitigationProduct?: Array< - | 'DDOS' - | 'WAF' - | 'BOT_MANAGEMENT' - | 'ACCESS_RULES' - | 'IP_REPUTATION' - | 'API_SHIELD' - | 'DATA_LOSS_PREVENTION' - >; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; -} - export interface Layer7TimeseriesParams { /** * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). @@ -789,164 +335,14 @@ export interface Layer7TimeseriesParams { normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; } -export interface Layer7TimeseriesGroupsV2Params { - /** - * 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'; - - /** - * Filters results by HTTP method. - */ - httpMethod?: Array< - | 'GET' - | 'POST' - | 'DELETE' - | 'PUT' - | 'HEAD' - | 'PURGE' - | 'OPTIONS' - | 'PROPFIND' - | 'MKCOL' - | 'PATCH' - | 'ACL' - | 'BCOPY' - | 'BDELETE' - | 'BMOVE' - | 'BPROPFIND' - | 'BPROPPATCH' - | 'CHECKIN' - | 'CHECKOUT' - | 'CONNECT' - | 'COPY' - | 'LABEL' - | 'LOCK' - | 'MERGE' - | 'MKACTIVITY' - | 'MKWORKSPACE' - | 'MOVE' - | 'NOTIFY' - | 'ORDERPATCH' - | 'POLL' - | 'PROPPATCH' - | 'REPORT' - | 'SEARCH' - | 'SUBSCRIBE' - | 'TRACE' - | 'UNCHECKOUT' - | 'UNLOCK' - | 'UNSUBSCRIBE' - | 'UPDATE' - | 'VERSIONCONTROL' - | 'BASELINECONTROL' - | 'XMSENUMATTS' - | 'RPC_OUT_DATA' - | 'RPC_IN_DATA' - | 'JSON' - | 'COOK' - | 'TRACK' - >; - - /** - * Filters results by HTTP version. - */ - httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; - - /** - * Filters results by IP version (Ipv4 vs. IPv6). - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - - /** - * 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; - - /** - * Filters the results by layer 7 mitigation product. - */ - mitigationProduct?: Array< - | 'DDOS' - | 'WAF' - | 'BOT_MANAGEMENT' - | 'ACCESS_RULES' - | 'IP_REPUTATION' - | 'API_SHIELD' - | 'DATA_LOSS_PREVENTION' - >; - - /** - * 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' | 'MIN0_MAX'; -} - Layer7.Summary = Summary; Layer7.TimeseriesGroups = TimeseriesGroups; Layer7.Top = Top; export declare namespace Layer7 { export { - type Layer7SummaryV2Response as Layer7SummaryV2Response, type Layer7TimeseriesResponse as Layer7TimeseriesResponse, - type Layer7TimeseriesGroupsV2Response as Layer7TimeseriesGroupsV2Response, - type Layer7SummaryV2Params as Layer7SummaryV2Params, type Layer7TimeseriesParams as Layer7TimeseriesParams, - type Layer7TimeseriesGroupsV2Params as Layer7TimeseriesGroupsV2Params, }; export { diff --git a/src/resources/radar/attacks/layer7/summary.ts b/src/resources/radar/attacks/layer7/summary.ts index 160eb24dd8..4afa3d68d0 100644 --- a/src/resources/radar/attacks/layer7/summary.ts +++ b/src/resources/radar/attacks/layer7/summary.ts @@ -8,7 +8,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.httpMethod(); + * ``` */ httpMethod( query?: SummaryHTTPMethodParams, @@ -33,7 +37,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.httpVersion(); + * ``` */ httpVersion( query?: SummaryHTTPVersionParams, @@ -58,7 +66,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.industry(); + * ``` */ industry( query?: SummaryIndustryParams, @@ -82,7 +94,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.ipVersion(); + * ``` */ ipVersion( query?: SummaryIPVersionParams, @@ -106,7 +122,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.managedRules(); + * ``` */ managedRules( query?: SummaryManagedRulesParams, @@ -131,7 +151,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.mitigationProduct(); + * ``` */ mitigationProduct( query?: SummaryMitigationProductParams, @@ -156,7 +180,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summary.vertical(); + * ``` */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer7/timeseries-groups.ts b/src/resources/radar/attacks/layer7/timeseries-groups.ts index ce7c62ce1e..ab7e962788 100644 --- a/src/resources/radar/attacks/layer7/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer7/timeseries-groups.ts @@ -8,7 +8,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.httpMethod(); + * ``` */ httpMethod( query?: TimeseriesGroupHTTPMethodParams, @@ -33,7 +37,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.httpVersion(); + * ``` */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -58,7 +66,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.industry(); + * ``` */ industry( query?: TimeseriesGroupIndustryParams, @@ -83,7 +95,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version used over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.ipVersion(); + * ``` */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -108,7 +124,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.managedRules(); + * ``` */ managedRules( query?: TimeseriesGroupManagedRulesParams, @@ -133,7 +153,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.mitigationProduct(); + * ``` */ mitigationProduct( query?: TimeseriesGroupMitigationProductParams, @@ -158,7 +182,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroups.vertical(); + * ``` */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/dns/dns.ts b/src/resources/radar/dns/dns.ts index f5210942fb..8220269674 100644 --- a/src/resources/radar/dns/dns.ts +++ b/src/resources/radar/dns/dns.ts @@ -61,70 +61,6 @@ export class DNS extends APIResource { this._client, ); - /** - * Retrieves the distribution of DNS queries by the specified dimension. - * - * @example - * ```ts - * const response = await client.radar.dns.summaryV2( - * 'IP_VERSION', - * ); - * ``` - */ - summaryV2( - dimension: - | 'IP_VERSION' - | 'CACHE_HIT' - | 'DNSSEC' - | 'DNSSEC_AWARE' - | 'DNSSEC_E2E' - | 'MATCHING_ANSWER' - | 'PROTOCOL' - | 'QUERY_TYPE' - | 'RESPONSE_CODE' - | 'RESPONSE_TTL', - query?: DNSSummaryV2Params, - options?: Core.RequestOptions, - ): Core.APIPromise; - summaryV2( - dimension: - | 'IP_VERSION' - | 'CACHE_HIT' - | 'DNSSEC' - | 'DNSSEC_AWARE' - | 'DNSSEC_E2E' - | 'MATCHING_ANSWER' - | 'PROTOCOL' - | 'QUERY_TYPE' - | 'RESPONSE_CODE' - | 'RESPONSE_TTL', - options?: Core.RequestOptions, - ): Core.APIPromise; - summaryV2( - dimension: - | 'IP_VERSION' - | 'CACHE_HIT' - | 'DNSSEC' - | 'DNSSEC_AWARE' - | 'DNSSEC_E2E' - | 'MATCHING_ANSWER' - | 'PROTOCOL' - | 'QUERY_TYPE' - | 'RESPONSE_CODE' - | 'RESPONSE_TTL', - query: DNSSummaryV2Params | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summaryV2(dimension, {}, query); - } - return ( - this._client.get(`/radar/dns/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: DNSSummaryV2Response; - }> - )._thenUnwrap((obj) => obj.result); - } - /** * Retrieves normalized query volume to the 1.1.1.1 DNS resolver over time. * @@ -151,168 +87,6 @@ export class DNS extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Retrieves the distribution of DNS queries grouped by dimension over time. - * - * @example - * ```ts - * const response = await client.radar.dns.timeseriesGroupsV2( - * 'IP_VERSION', - * ); - * ``` - */ - timeseriesGroupsV2( - dimension: - | 'IP_VERSION' - | 'CACHE_HIT' - | 'DNSSEC' - | 'DNSSEC_AWARE' - | 'DNSSEC_E2E' - | 'MATCHING_ANSWER' - | 'PROTOCOL' - | 'QUERY_TYPE' - | 'RESPONSE_CODE' - | 'RESPONSE_TTL', - query?: DNSTimeseriesGroupsV2Params, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroupsV2( - dimension: - | 'IP_VERSION' - | 'CACHE_HIT' - | 'DNSSEC' - | 'DNSSEC_AWARE' - | 'DNSSEC_E2E' - | 'MATCHING_ANSWER' - | 'PROTOCOL' - | 'QUERY_TYPE' - | 'RESPONSE_CODE' - | 'RESPONSE_TTL', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroupsV2( - dimension: - | 'IP_VERSION' - | 'CACHE_HIT' - | 'DNSSEC' - | 'DNSSEC_AWARE' - | 'DNSSEC_E2E' - | 'MATCHING_ANSWER' - | 'PROTOCOL' - | 'QUERY_TYPE' - | 'RESPONSE_CODE' - | 'RESPONSE_TTL', - query: DNSTimeseriesGroupsV2Params | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroupsV2(dimension, {}, query); - } - return ( - this._client.get(`/radar/dns/timeseries_groups/${dimension}`, { - query, - ...options, - }) as Core.APIPromise<{ result: DNSTimeseriesGroupsV2Response }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface DNSSummaryV2Response { - /** - * Metadata for the results. - */ - meta: DNSSummaryV2Response.Meta; - - summary_0: { [key: string]: string }; -} - -export namespace DNSSummaryV2Response { - /** - * 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 DNSTimeseriesResponse { @@ -428,117 +202,14 @@ export namespace DNSTimeseriesResponse { } } -export interface DNSTimeseriesGroupsV2Response { - /** - * Metadata for the results. - */ - meta: DNSTimeseriesGroupsV2Response.Meta; - - serie_0: DNSTimeseriesGroupsV2Response.Serie0; -} - -export namespace DNSTimeseriesGroupsV2Response { +export interface DNSTimeseriesParams { /** - * Metadata for the results. + * 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/). */ - 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; - } -} + aggInterval?: '15m' | '1h' | '1d' | '1w'; -export interface DNSSummaryV2Params { /** * Filters results by Autonomous System. Specify one or more Autonomous System * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from @@ -576,402 +247,6 @@ export interface DNSSummaryV2Params { */ 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; - - /** - * Specifies whether the response includes empty DNS responses (NODATA). - */ - nodata?: boolean; - - /** - * Filters results by DNS transport protocol. - */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; - - /** - * Filters results by DNS query type. - */ - queryType?: - | 'A' - | 'AAAA' - | 'A6' - | 'AFSDB' - | 'ANY' - | 'APL' - | 'ATMA' - | 'AXFR' - | 'CAA' - | 'CDNSKEY' - | 'CDS' - | 'CERT' - | 'CNAME' - | 'CSYNC' - | 'DHCID' - | 'DLV' - | 'DNAME' - | 'DNSKEY' - | 'DOA' - | 'DS' - | 'EID' - | 'EUI48' - | 'EUI64' - | 'GPOS' - | 'GID' - | 'HINFO' - | 'HIP' - | 'HTTPS' - | 'IPSECKEY' - | 'ISDN' - | 'IXFR' - | 'KEY' - | 'KX' - | 'L32' - | 'L64' - | 'LOC' - | 'LP' - | 'MAILA' - | 'MAILB' - | 'MB' - | 'MD' - | 'MF' - | 'MG' - | 'MINFO' - | 'MR' - | 'MX' - | 'NAPTR' - | 'NB' - | 'NBSTAT' - | 'NID' - | 'NIMLOC' - | 'NINFO' - | 'NS' - | 'NSAP' - | 'NSEC' - | 'NSEC3' - | 'NSEC3PARAM' - | 'NULL' - | 'NXT' - | 'OPENPGPKEY' - | 'OPT' - | 'PTR' - | 'PX' - | 'RKEY' - | 'RP' - | 'RRSIG' - | 'RT' - | 'SIG' - | 'SINK' - | 'SMIMEA' - | 'SOA' - | 'SPF' - | 'SRV' - | 'SSHFP' - | 'SVCB' - | 'TA' - | 'TALINK' - | 'TKEY' - | 'TLSA' - | 'TSIG' - | 'TXT' - | 'UINFO' - | 'UID' - | 'UNSPEC' - | 'URI' - | 'WKS' - | 'X25' - | 'ZONEMD' - | null; - - /** - * Filters results by DNS response code. - */ - responseCode?: - | 'NOERROR' - | 'FORMERR' - | 'SERVFAIL' - | 'NXDOMAIN' - | 'NOTIMP' - | 'REFUSED' - | 'YXDOMAIN' - | 'YXRRSET' - | 'NXRRSET' - | 'NOTAUTH' - | 'NOTZONE' - | 'BADSIG' - | 'BADKEY' - | 'BADTIME' - | 'BADMODE' - | 'BADNAME' - | 'BADALG' - | 'BADTRUNC' - | 'BADCOOKIE'; - - /** - * Filters results by country code top-level domain (ccTLD). - */ - tld?: Array; -} - -export interface DNSTimeseriesParams { - /** - * 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'; - - /** - * 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; - - /** - * Specifies whether the response includes empty DNS responses (NODATA). - */ - nodata?: boolean; - - /** - * Filters results by DNS transport protocol. - */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; - - /** - * Filters results by DNS query type. - */ - queryType?: - | 'A' - | 'AAAA' - | 'A6' - | 'AFSDB' - | 'ANY' - | 'APL' - | 'ATMA' - | 'AXFR' - | 'CAA' - | 'CDNSKEY' - | 'CDS' - | 'CERT' - | 'CNAME' - | 'CSYNC' - | 'DHCID' - | 'DLV' - | 'DNAME' - | 'DNSKEY' - | 'DOA' - | 'DS' - | 'EID' - | 'EUI48' - | 'EUI64' - | 'GPOS' - | 'GID' - | 'HINFO' - | 'HIP' - | 'HTTPS' - | 'IPSECKEY' - | 'ISDN' - | 'IXFR' - | 'KEY' - | 'KX' - | 'L32' - | 'L64' - | 'LOC' - | 'LP' - | 'MAILA' - | 'MAILB' - | 'MB' - | 'MD' - | 'MF' - | 'MG' - | 'MINFO' - | 'MR' - | 'MX' - | 'NAPTR' - | 'NB' - | 'NBSTAT' - | 'NID' - | 'NIMLOC' - | 'NINFO' - | 'NS' - | 'NSAP' - | 'NSEC' - | 'NSEC3' - | 'NSEC3PARAM' - | 'NULL' - | 'NXT' - | 'OPENPGPKEY' - | 'OPT' - | 'PTR' - | 'PX' - | 'RKEY' - | 'RP' - | 'RRSIG' - | 'RT' - | 'SIG' - | 'SINK' - | 'SMIMEA' - | 'SOA' - | 'SPF' - | 'SRV' - | 'SSHFP' - | 'SVCB' - | 'TA' - | 'TALINK' - | 'TKEY' - | 'TLSA' - | 'TSIG' - | 'TXT' - | 'UINFO' - | 'UID' - | 'UNSPEC' - | 'URI' - | 'WKS' - | 'X25' - | 'ZONEMD' - | null; - - /** - * Filters results by DNS response code. - */ - responseCode?: - | 'NOERROR' - | 'FORMERR' - | 'SERVFAIL' - | 'NXDOMAIN' - | 'NOTIMP' - | 'REFUSED' - | 'YXDOMAIN' - | 'YXRRSET' - | 'NXRRSET' - | 'NOTAUTH' - | 'NOTZONE' - | 'BADSIG' - | 'BADKEY' - | 'BADTIME' - | 'BADMODE' - | 'BADNAME' - | 'BADALG' - | 'BADTRUNC' - | 'BADCOOKIE'; - - /** - * Filters results by country code top-level domain (ccTLD). - */ - tld?: Array; -} - -export interface DNSTimeseriesGroupsV2Params { - /** - * 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` @@ -1124,12 +399,8 @@ DNS.TimeseriesGroups = TimeseriesGroups; export declare namespace DNS { export { - type DNSSummaryV2Response as DNSSummaryV2Response, type DNSTimeseriesResponse as DNSTimeseriesResponse, - type DNSTimeseriesGroupsV2Response as DNSTimeseriesGroupsV2Response, - type DNSSummaryV2Params as DNSSummaryV2Params, type DNSTimeseriesParams as DNSTimeseriesParams, - type DNSTimeseriesGroupsV2Params as DNSTimeseriesGroupsV2Params, }; export { diff --git a/src/resources/radar/dns/index.ts b/src/resources/radar/dns/index.ts index d86325efb1..5254679872 100644 --- a/src/resources/radar/dns/index.ts +++ b/src/resources/radar/dns/index.ts @@ -1,14 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { - DNS, - type DNSSummaryV2Response, - type DNSTimeseriesResponse, - type DNSTimeseriesGroupsV2Response, - type DNSSummaryV2Params, - type DNSTimeseriesParams, - type DNSTimeseriesGroupsV2Params, -} from './dns'; +export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns'; export { Summary, type SummaryCacheHitResponse, diff --git a/src/resources/radar/dns/summary.ts b/src/resources/radar/dns/summary.ts index 575afc929b..9bc87aa1f9 100644 --- a/src/resources/radar/dns/summary.ts +++ b/src/resources/radar/dns/summary.ts @@ -8,7 +8,10 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by cache status. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.dns.summary.cacheHit(); + * ``` */ cacheHit( query?: SummaryCacheHitParams, @@ -33,7 +36,10 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.dns.summary.dnssec(); + * ``` */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -55,7 +61,11 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.summary.dnssecAware(); + * ``` */ dnssecAware( query?: SummaryDNSSECAwareParams, @@ -80,7 +90,10 @@ export class Summary extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.dns.summary.dnssecE2E(); + * ``` */ dnssecE2E( query?: SummaryDNSSECE2EParams, @@ -104,7 +117,10 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by IP version. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.dns.summary.ipVersion(); + * ``` */ ipVersion( query?: SummaryIPVersionParams, @@ -128,7 +144,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.summary.matchingAnswer(); + * ``` */ matchingAnswer( query?: SummaryMatchingAnswerParams, @@ -152,7 +172,10 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.dns.summary.protocol(); + * ``` */ protocol( query?: SummaryProtocolParams, @@ -176,7 +199,10 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by type. * - * @deprecated + * @example + * ```ts + * const response = await client.radar.dns.summary.queryType(); + * ``` */ queryType( query?: SummaryQueryTypeParams, @@ -200,7 +226,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by response code. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.summary.responseCode(); + * ``` */ responseCode( query?: SummaryResponseCodeParams, @@ -224,7 +254,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by minimum response TTL. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.summary.responseTTL(); + * ``` */ responseTTL( query?: SummaryResponseTTLParams, diff --git a/src/resources/radar/dns/timeseries-groups.ts b/src/resources/radar/dns/timeseries-groups.ts index 5e1ea8a4e1..9a242a93fb 100644 --- a/src/resources/radar/dns/timeseries-groups.ts +++ b/src/resources/radar/dns/timeseries-groups.ts @@ -8,7 +8,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by cache status over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.cacheHit(); + * ``` */ cacheHit( query?: TimeseriesGroupCacheHitParams, @@ -33,7 +37,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.dnssec(); + * ``` */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -58,7 +66,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.dnssecAware(); + * ``` */ dnssecAware( query?: TimeseriesGroupDNSSECAwareParams, @@ -84,7 +96,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.dnssecE2E(); + * ``` */ dnssecE2E( query?: TimeseriesGroupDNSSECE2EParams, @@ -108,7 +124,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by IP version over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.ipVersion(); + * ``` */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -132,7 +152,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.matchingAnswer(); + * ``` */ matchingAnswer( query?: TimeseriesGroupMatchingAnswerParams, @@ -157,7 +181,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.protocol(); + * ``` */ protocol( query?: TimeseriesGroupProtocolParams, @@ -181,7 +209,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by type over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.queryType(); + * ``` */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -205,7 +237,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by response code over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.responseCode(); + * ``` */ responseCode( query?: TimeseriesGroupResponseCodeParams, @@ -230,7 +266,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by minimum answer TTL over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.dns.timeseriesGroups.responseTTL(); + * ``` */ responseTTL( query?: TimeseriesGroupResponseTTLParams, diff --git a/src/resources/radar/email/email.ts b/src/resources/radar/email/email.ts index e490d29630..460238da53 100644 --- a/src/resources/radar/email/email.ts +++ b/src/resources/radar/email/email.ts @@ -2,21 +2,9 @@ import { APIResource } from '../../../resource'; import * as RoutingAPI from './routing/routing'; -import { - Routing, - RoutingSummaryV2Params, - RoutingSummaryV2Response, - RoutingTimeseriesGroupsV2Params, - RoutingTimeseriesGroupsV2Response, -} from './routing/routing'; +import { Routing } from './routing/routing'; import * as SecurityAPI from './security/security'; -import { - Security, - SecuritySummaryV2Params, - SecuritySummaryV2Response, - SecurityTimeseriesGroupsV2Params, - SecurityTimeseriesGroupsV2Response, -} from './security/security'; +import { Security } from './security/security'; export class Email extends APIResource { routing: RoutingAPI.Routing = new RoutingAPI.Routing(this._client); @@ -54,19 +42,7 @@ Email.Security = Security; export declare namespace Email { export { type RadarEmailSeries as RadarEmailSeries, type RadarEmailSummary as RadarEmailSummary }; - export { - Routing as Routing, - type RoutingSummaryV2Response as RoutingSummaryV2Response, - type RoutingTimeseriesGroupsV2Response as RoutingTimeseriesGroupsV2Response, - type RoutingSummaryV2Params as RoutingSummaryV2Params, - type RoutingTimeseriesGroupsV2Params as RoutingTimeseriesGroupsV2Params, - }; + export { Routing as Routing }; - export { - Security as Security, - type SecuritySummaryV2Response as SecuritySummaryV2Response, - type SecurityTimeseriesGroupsV2Response as SecurityTimeseriesGroupsV2Response, - type SecuritySummaryV2Params as SecuritySummaryV2Params, - type SecurityTimeseriesGroupsV2Params as SecurityTimeseriesGroupsV2Params, - }; + export { Security as Security }; } diff --git a/src/resources/radar/email/index.ts b/src/resources/radar/email/index.ts index 47de1d26d8..0e113c2250 100644 --- a/src/resources/radar/email/index.ts +++ b/src/resources/radar/email/index.ts @@ -1,17 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Email, type RadarEmailSeries, type RadarEmailSummary } from './email'; -export { - Routing, - type RoutingSummaryV2Response, - type RoutingTimeseriesGroupsV2Response, - type RoutingSummaryV2Params, - type RoutingTimeseriesGroupsV2Params, -} from './routing/index'; -export { - Security, - type SecuritySummaryV2Response, - type SecurityTimeseriesGroupsV2Response, - type SecuritySummaryV2Params, - type SecurityTimeseriesGroupsV2Params, -} from './security/index'; +export { Routing } from './routing/index'; +export { Security } from './security/index'; diff --git a/src/resources/radar/email/routing/index.ts b/src/resources/radar/email/routing/index.ts index 4e2cf69ee7..a7447f6d0f 100644 --- a/src/resources/radar/email/routing/index.ts +++ b/src/resources/radar/email/routing/index.ts @@ -1,12 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { - Routing, - type RoutingSummaryV2Response, - type RoutingTimeseriesGroupsV2Response, - type RoutingSummaryV2Params, - type RoutingTimeseriesGroupsV2Params, -} from './routing'; +export { Routing } from './routing'; export { Summary, type SummaryARCResponse, diff --git a/src/resources/radar/email/routing/routing.ts b/src/resources/radar/email/routing/routing.ts index 49efcfd36c..f4c5d68359 100644 --- a/src/resources/radar/email/routing/routing.ts +++ b/src/resources/radar/email/routing/routing.ts @@ -1,8 +1,6 @@ // 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 SummaryAPI from './summary'; import { Summary, @@ -41,439 +39,12 @@ export class Routing extends APIResource { timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( this._client, ); - - /** - * Retrieves the distribution of email routing metrics by the specified dimension. - * - * @example - * ```ts - * const response = await client.radar.email.routing.summaryV2( - * 'IP_VERSION', - * ); - * ``` - */ - summaryV2( - dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', - query?: RoutingSummaryV2Params, - options?: Core.RequestOptions, - ): Core.APIPromise; - summaryV2( - dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', - options?: Core.RequestOptions, - ): Core.APIPromise; - summaryV2( - dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', - query: RoutingSummaryV2Params | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summaryV2(dimension, {}, query); - } - return ( - this._client.get(`/radar/email/routing/summary/${dimension}`, { - query, - ...options, - }) as Core.APIPromise<{ result: RoutingSummaryV2Response }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the distribution of email routing metrics grouped by dimension over - * time. - * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroupsV2( - * 'IP_VERSION', - * ); - * ``` - */ - timeseriesGroupsV2( - dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', - query?: RoutingTimeseriesGroupsV2Params, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroupsV2( - dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroupsV2( - dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', - query: RoutingTimeseriesGroupsV2Params | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroupsV2(dimension, {}, query); - } - return ( - this._client.get(`/radar/email/routing/timeseries_groups/${dimension}`, { - query, - ...options, - }) as Core.APIPromise<{ result: RoutingTimeseriesGroupsV2Response }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface RoutingSummaryV2Response { - /** - * Metadata for the results. - */ - meta: RoutingSummaryV2Response.Meta; - - summary_0: { [key: string]: string }; -} - -export namespace RoutingSummaryV2Response { - /** - * 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 RoutingTimeseriesGroupsV2Response { - /** - * Metadata for the results. - */ - meta: RoutingTimeseriesGroupsV2Response.Meta; - - serie_0: RoutingTimeseriesGroupsV2Response.Serie0; -} - -export namespace RoutingTimeseriesGroupsV2Response { - /** - * 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 RoutingSummaryV2Params { - /** - * Filters results by ARC (Authenticated Received Chain) validation. - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * 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 DKIM (DomainKeys Identified Mail) validation status. - */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Filters results by DMARC (Domain-based Message Authentication, Reporting and - * Conformance) validation status. - */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Filters results by encryption status (encrypted vs. not-encrypted). - */ - encrypted?: Array<'ENCRYPTED' | 'NOT_ENCRYPTED'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results by IP version (Ipv4 vs. IPv6). - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Filters results by SPF (Sender Policy Framework) validation status. - */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; -} - -export interface RoutingTimeseriesGroupsV2Params { - /** - * 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 ARC (Authenticated Received Chain) validation. - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * 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 DKIM (DomainKeys Identified Mail) validation status. - */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Filters results by DMARC (Domain-based Message Authentication, Reporting and - * Conformance) validation status. - */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Filters results by encryption status (encrypted vs. not-encrypted). - */ - encrypted?: Array<'ENCRYPTED' | 'NOT_ENCRYPTED'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results by IP version (Ipv4 vs. IPv6). - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Filters results by SPF (Sender Policy Framework) validation status. - */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; } Routing.Summary = Summary; Routing.TimeseriesGroups = TimeseriesGroups; export declare namespace Routing { - export { - type RoutingSummaryV2Response as RoutingSummaryV2Response, - type RoutingTimeseriesGroupsV2Response as RoutingTimeseriesGroupsV2Response, - type RoutingSummaryV2Params as RoutingSummaryV2Params, - type RoutingTimeseriesGroupsV2Params as RoutingTimeseriesGroupsV2Params, - }; - export { Summary as Summary, type SummaryARCResponse as SummaryARCResponse, diff --git a/src/resources/radar/email/routing/summary.ts b/src/resources/radar/email/routing/summary.ts index 00defd2b84..4085dc05e9 100644 --- a/src/resources/radar/email/routing/summary.ts +++ b/src/resources/radar/email/routing/summary.ts @@ -10,7 +10,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.summary.arc(); + * ``` */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -32,7 +36,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.summary.dkim(); + * ``` */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -54,7 +62,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.summary.dmarc(); + * ``` */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -76,7 +88,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted). * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.summary.encrypted(); + * ``` */ encrypted( query?: SummaryEncryptedParams, @@ -100,7 +116,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by IP version. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.summary.ipVersion(); + * ``` */ ipVersion( query?: SummaryIPVersionParams, @@ -125,7 +145,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.summary.spf(); + * ``` */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/email/routing/timeseries-groups.ts b/src/resources/radar/email/routing/timeseries-groups.ts index 3a9801b143..c398945534 100644 --- a/src/resources/radar/email/routing/timeseries-groups.ts +++ b/src/resources/radar/email/routing/timeseries-groups.ts @@ -10,7 +10,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroups.arc(); + * ``` */ arc( query?: TimeseriesGroupARCParams, @@ -36,7 +40,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroups.dkim(); + * ``` */ dkim( query?: TimeseriesGroupDKIMParams, @@ -62,7 +70,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroups.dmarc(); + * ``` */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -88,7 +100,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted) over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroups.encrypted(); + * ``` */ encrypted( query?: TimeseriesGroupEncryptedParams, @@ -113,7 +129,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by IP version over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroups.ipVersion(); + * ``` */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -139,7 +159,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroups.spf(); + * ``` */ spf( query?: TimeseriesGroupSPFParams, diff --git a/src/resources/radar/email/security/index.ts b/src/resources/radar/email/security/index.ts index 01cfb4dade..b48f43fb39 100644 --- a/src/resources/radar/email/security/index.ts +++ b/src/resources/radar/email/security/index.ts @@ -1,12 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { - Security, - type SecuritySummaryV2Response, - type SecurityTimeseriesGroupsV2Response, - type SecuritySummaryV2Params, - type SecurityTimeseriesGroupsV2Params, -} from './security'; +export { Security } from './security'; export { Summary, type SummaryARCResponse, diff --git a/src/resources/radar/email/security/security.ts b/src/resources/radar/email/security/security.ts index a4b1700f96..c1c1c5f337 100644 --- a/src/resources/radar/email/security/security.ts +++ b/src/resources/radar/email/security/security.ts @@ -1,8 +1,6 @@ // 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 SummaryAPI from './summary'; import { Summary, @@ -56,469 +54,6 @@ export class Security extends APIResource { timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( this._client, ); - - /** - * Retrieves the distribution of email security metrics by the specified dimension. - * - * @example - * ```ts - * const response = - * await client.radar.email.security.summaryV2('SPAM'); - * ``` - */ - summaryV2( - dimension: - | 'SPAM' - | 'MALICIOUS' - | 'SPOOF' - | 'THREAT_CATEGORY' - | 'ARC' - | 'DKIM' - | 'DMARC' - | 'SPF' - | 'TLS_VERSION', - query?: SecuritySummaryV2Params, - options?: Core.RequestOptions, - ): Core.APIPromise; - summaryV2( - dimension: - | 'SPAM' - | 'MALICIOUS' - | 'SPOOF' - | 'THREAT_CATEGORY' - | 'ARC' - | 'DKIM' - | 'DMARC' - | 'SPF' - | 'TLS_VERSION', - options?: Core.RequestOptions, - ): Core.APIPromise; - summaryV2( - dimension: - | 'SPAM' - | 'MALICIOUS' - | 'SPOOF' - | 'THREAT_CATEGORY' - | 'ARC' - | 'DKIM' - | 'DMARC' - | 'SPF' - | 'TLS_VERSION', - query: SecuritySummaryV2Params | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summaryV2(dimension, {}, query); - } - return ( - this._client.get(`/radar/email/security/summary/${dimension}`, { - query, - ...options, - }) as Core.APIPromise<{ result: SecuritySummaryV2Response }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the distribution of email security metrics grouped by dimension over - * time. - * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroupsV2( - * 'SPAM', - * ); - * ``` - */ - timeseriesGroupsV2( - dimension: - | 'SPAM' - | 'MALICIOUS' - | 'SPOOF' - | 'THREAT_CATEGORY' - | 'ARC' - | 'DKIM' - | 'DMARC' - | 'SPF' - | 'TLS_VERSION', - query?: SecurityTimeseriesGroupsV2Params, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroupsV2( - dimension: - | 'SPAM' - | 'MALICIOUS' - | 'SPOOF' - | 'THREAT_CATEGORY' - | 'ARC' - | 'DKIM' - | 'DMARC' - | 'SPF' - | 'TLS_VERSION', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroupsV2( - dimension: - | 'SPAM' - | 'MALICIOUS' - | 'SPOOF' - | 'THREAT_CATEGORY' - | 'ARC' - | 'DKIM' - | 'DMARC' - | 'SPF' - | 'TLS_VERSION', - query: SecurityTimeseriesGroupsV2Params | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroupsV2(dimension, {}, query); - } - return ( - this._client.get(`/radar/email/security/timeseries_groups/${dimension}`, { - query, - ...options, - }) as Core.APIPromise<{ result: SecurityTimeseriesGroupsV2Response }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface SecuritySummaryV2Response { - /** - * Metadata for the results. - */ - meta: SecuritySummaryV2Response.Meta; - - summary_0: { [key: string]: string }; -} - -export namespace SecuritySummaryV2Response { - /** - * 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 SecurityTimeseriesGroupsV2Response { - /** - * Metadata for the results. - */ - meta: SecurityTimeseriesGroupsV2Response.Meta; - - serie_0: SecurityTimeseriesGroupsV2Response.Serie0; -} - -export namespace SecurityTimeseriesGroupsV2Response { - /** - * 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 SecuritySummaryV2Params { - /** - * Filters results by ARC (Authenticated Received Chain) validation. - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * 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 DKIM (DomainKeys Identified Mail) validation status. - */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Filters results by DMARC (Domain-based Message Authentication, Reporting and - * Conformance) validation status. - */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Filters results by SPF (Sender Policy Framework) validation status. - */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Filters results by TLS version. - */ - tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3'>; -} - -export interface SecurityTimeseriesGroupsV2Params { - /** - * 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 ARC (Authenticated Received Chain) validation. - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * 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 DKIM (DomainKeys Identified Mail) validation status. - */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Filters results by DMARC (Domain-based Message Authentication, Reporting and - * Conformance) validation status. - */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Filters results by SPF (Sender Policy Framework) validation status. - */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Filters results by TLS version. - */ - tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3'>; } Security.Top = Top; @@ -526,13 +61,6 @@ Security.Summary = Summary; Security.TimeseriesGroups = TimeseriesGroups; export declare namespace Security { - export { - type SecuritySummaryV2Response as SecuritySummaryV2Response, - type SecurityTimeseriesGroupsV2Response as SecurityTimeseriesGroupsV2Response, - type SecuritySummaryV2Params as SecuritySummaryV2Params, - type SecurityTimeseriesGroupsV2Params as SecurityTimeseriesGroupsV2Params, - }; - export { Top as Top }; export { diff --git a/src/resources/radar/email/security/summary.ts b/src/resources/radar/email/security/summary.ts index 5136a742ff..3a984c2f4f 100644 --- a/src/resources/radar/email/security/summary.ts +++ b/src/resources/radar/email/security/summary.ts @@ -10,7 +10,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.arc(); + * ``` */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -32,7 +36,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.dkim(); + * ``` */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -54,7 +62,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.dmarc(); + * ``` */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -75,7 +87,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by malicious classification. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.malicious(); + * ``` */ malicious( query?: SummaryMaliciousParams, @@ -99,7 +115,11 @@ export class Summary extends APIResource { /** * Retrieves the proportion of emails by spam classification (spam vs. non-spam). * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.spam(); + * ``` */ spam(query?: SummarySpamParams, options?: Core.RequestOptions): Core.APIPromise; spam(options?: Core.RequestOptions): Core.APIPromise; @@ -121,7 +141,11 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.spf(); + * ``` */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; @@ -143,7 +167,11 @@ export class Summary extends APIResource { * Retrieves the proportion of emails by spoof classification (spoof vs. * non-spoof). * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.spoof(); + * ``` */ spoof(query?: SummarySpoofParams, options?: Core.RequestOptions): Core.APIPromise; spoof(options?: Core.RequestOptions): Core.APIPromise; @@ -164,7 +192,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by threat categories. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.threatCategory(); + * ``` */ threatCategory( query?: SummaryThreatCategoryParams, @@ -189,7 +221,11 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by TLS version. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.summary.tlsVersion(); + * ``` */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/email/security/timeseries-groups.ts b/src/resources/radar/email/security/timeseries-groups.ts index aa620088a0..2fb9bbef99 100644 --- a/src/resources/radar/email/security/timeseries-groups.ts +++ b/src/resources/radar/email/security/timeseries-groups.ts @@ -10,7 +10,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.arc(); + * ``` */ arc( query?: TimeseriesGroupARCParams, @@ -36,7 +40,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.dkim(); + * ``` */ dkim( query?: TimeseriesGroupDKIMParams, @@ -62,7 +70,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.dmarc(); + * ``` */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -87,7 +99,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by malicious classification over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.malicious(); + * ``` */ malicious( query?: TimeseriesGroupMaliciousParams, @@ -113,7 +129,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spam classification (spam vs. non-spam) * over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.spam(); + * ``` */ spam( query?: TimeseriesGroupSpamParams, @@ -139,7 +159,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.spf(); + * ``` */ spf( query?: TimeseriesGroupSPFParams, @@ -165,7 +189,11 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spoof classification (spoof vs. * non-spoof) over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.spoof(); + * ``` */ spoof( query?: TimeseriesGroupSpoofParams, @@ -190,7 +218,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by threat category over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.threatCategory(); + * ``` */ threatCategory( query?: TimeseriesGroupThreatCategoryParams, @@ -215,7 +247,11 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by TLS version over time. * - * @deprecated + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroups.tlsVersion(); + * ``` */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/entities/asns.ts b/src/resources/radar/entities/asns.ts index 7697e9dd84..66ecf4a6e9 100644 --- a/src/resources/radar/entities/asns.ts +++ b/src/resources/radar/entities/asns.ts @@ -194,20 +194,10 @@ export namespace ASNAsSetResponse { */ name: string; - /** - * The AS number following hierarchical AS-SET name - */ - hierarchical_asn?: number; - /** * The inferred AS number of the AS-SET */ - inferred_asn?: number; - - /** - * The AS number matching PeeringDB record - */ - peeringdb_asn?: number; + asn?: number; } } diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index 8bade1de40..a9f5840d83 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -1,15 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { AI } from './ai/index'; -export { - AS112, - type AS112SummaryV2Response, - type AS112TimeseriesResponse, - type AS112TimeseriesGroupsV2Response, - type AS112SummaryV2Params, - type AS112TimeseriesParams, - type AS112TimeseriesGroupsV2Params, -} from './as112/index'; +export { AS112, type AS112TimeseriesResponse, type AS112TimeseriesParams } from './as112/index'; export { Annotations, type AnnotationListResponse, type AnnotationListParams } from './annotations/index'; export { Attacks } from './attacks/index'; export { BGP, type BGPTimeseriesResponse, type BGPTimeseriesParams } from './bgp/index'; @@ -35,15 +27,7 @@ export { type CtTimeseriesParams, type CtTimeseriesGroupsParams, } from './ct/index'; -export { - DNS, - type DNSSummaryV2Response, - type DNSTimeseriesResponse, - type DNSTimeseriesGroupsV2Response, - type DNSSummaryV2Params, - type DNSTimeseriesParams, - type DNSTimeseriesGroupsV2Params, -} from './dns/index'; +export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns/index'; export { Datasets, type DatasetListResponse, diff --git a/src/resources/radar/netflows/netflows.ts b/src/resources/radar/netflows/netflows.ts index 2b4c86b9ae..e94d801f26 100644 --- a/src/resources/radar/netflows/netflows.ts +++ b/src/resources/radar/netflows/netflows.ts @@ -13,7 +13,7 @@ export class Netflows extends APIResource { * Retrieves the distribution of network traffic (NetFlows) by HTTP vs other * protocols. * - * @deprecated Use [Get Network Traffic Distribution By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/netflows/methods/summary_v2/) instead. + * @deprecated */ summary( query?: NetflowSummaryParams, diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 1349fb443f..523d08c47e 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -33,15 +33,7 @@ import { AI } from './ai/ai'; import * as AnnotationsAPI from './annotations/annotations'; import { AnnotationListParams, AnnotationListResponse, Annotations } from './annotations/annotations'; import * as AS112API from './as112/as112'; -import { - AS112, - AS112SummaryV2Params, - AS112SummaryV2Response, - AS112TimeseriesGroupsV2Params, - AS112TimeseriesGroupsV2Response, - AS112TimeseriesParams, - AS112TimeseriesResponse, -} from './as112/as112'; +import { AS112, AS112TimeseriesParams, AS112TimeseriesResponse } from './as112/as112'; import * as AttacksAPI from './attacks/attacks'; import { Attacks } from './attacks/attacks'; import * as BGPAPI from './bgp/bgp'; @@ -71,15 +63,7 @@ import { CtTimeseriesResponse, } from './ct/ct'; import * as DNSAPI from './dns/dns'; -import { - DNS, - DNSSummaryV2Params, - DNSSummaryV2Response, - DNSTimeseriesGroupsV2Params, - DNSTimeseriesGroupsV2Response, - DNSTimeseriesParams, - DNSTimeseriesResponse, -} from './dns/dns'; +import { DNS, DNSTimeseriesParams, DNSTimeseriesResponse } from './dns/dns'; import * as EmailAPI from './email/email'; import { Email, RadarEmailSeries, RadarEmailSummary } from './email/email'; import * as EntitiesAPI from './entities/entities'; @@ -239,12 +223,8 @@ export declare namespace Radar { export { DNS as DNS, - type DNSSummaryV2Response as DNSSummaryV2Response, type DNSTimeseriesResponse as DNSTimeseriesResponse, - type DNSTimeseriesGroupsV2Response as DNSTimeseriesGroupsV2Response, - type DNSSummaryV2Params as DNSSummaryV2Params, type DNSTimeseriesParams as DNSTimeseriesParams, - type DNSTimeseriesGroupsV2Params as DNSTimeseriesGroupsV2Params, }; export { @@ -269,12 +249,8 @@ export declare namespace Radar { export { AS112 as AS112, - type AS112SummaryV2Response as AS112SummaryV2Response, type AS112TimeseriesResponse as AS112TimeseriesResponse, - type AS112TimeseriesGroupsV2Response as AS112TimeseriesGroupsV2Response, - type AS112SummaryV2Params as AS112SummaryV2Params, type AS112TimeseriesParams as AS112TimeseriesParams, - type AS112TimeseriesGroupsV2Params as AS112TimeseriesGroupsV2Params, }; export { diff --git a/src/resources/stream/downloads.ts b/src/resources/stream/downloads.ts index 1fd7a50c02..a9d2589f13 100644 --- a/src/resources/stream/downloads.ts +++ b/src/resources/stream/downloads.ts @@ -6,8 +6,7 @@ import * as Core from '../../core'; export class Downloads extends APIResource { /** * Creates a download for a video when a video is ready to view. Use - * `/downloads/{download_type}` instead for type-specific downloads. Available - * types are `default` and `audio`. + * `/downloads/{download_type}` instead for type-specific downloads. * * @example * ```ts @@ -36,7 +35,7 @@ export class Downloads extends APIResource { /** * Delete the downloads for a video. Use `/downloads/{download_type}` instead for - * type-specific downloads. Available types are `default` and `audio`. + * type-specific downloads. * * @example * ```ts diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts index 4af2451c88..8b15a53e2d 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts @@ -168,7 +168,7 @@ export namespace BindingGetResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; 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 78e5e95423..9170366dbd 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -616,7 +616,7 @@ export namespace ScriptUpdateParams { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; 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 216456a041..fea3a53ffc 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -247,7 +247,7 @@ export namespace SettingEditResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -999,7 +999,7 @@ export namespace SettingGetResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -1769,7 +1769,7 @@ export namespace SettingEditParams { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; diff --git a/src/resources/workers/beta/workers/versions.ts b/src/resources/workers/beta/workers/versions.ts index 185cea7033..300510fc56 100644 --- a/src/resources/workers/beta/workers/versions.ts +++ b/src/resources/workers/beta/workers/versions.ts @@ -409,7 +409,7 @@ export namespace Version { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -1263,7 +1263,7 @@ export namespace VersionCreateParams { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; diff --git a/src/resources/workers/beta/workers/workers.ts b/src/resources/workers/beta/workers/workers.ts index d4e49b0055..ba7791704e 100644 --- a/src/resources/workers/beta/workers/workers.ts +++ b/src/resources/workers/beta/workers/workers.ts @@ -193,11 +193,6 @@ export interface Worker { */ observability: Worker.Observability; - /** - * Other resources that reference the Worker and depend on it existing. - */ - references: Worker.References; - /** * Subdomain settings for the Worker. */ @@ -264,139 +259,6 @@ export namespace Worker { } } - /** - * Other resources that reference the Worker and depend on it existing. - */ - export interface References { - /** - * Other Workers that reference the Worker as an outbound for a dispatch namespace. - */ - dispatch_namespace_outbounds: Array; - - /** - * Custom domains connected to the Worker. - */ - domains: Array; - - /** - * Other Workers that reference Durable Object classes implemented by the Worker. - */ - durable_objects: Array; - - /** - * Queues that send messages to the Worker. - */ - queues: Array; - - /** - * Other Workers that reference the Worker using - * [service bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/). - */ - workers: Array; - } - - export namespace References { - export interface DispatchNamespaceOutbound { - /** - * ID of the dispatch namespace. - */ - namespace_id: string; - - /** - * Name of the dispatch namespace. - */ - namespace_name: string; - - /** - * ID of the Worker using the dispatch namespace. - */ - worker_id: string; - - /** - * Name of the Worker using the dispatch namespace. - */ - worker_name: string; - } - - export interface Domain { - /** - * ID of the custom domain. - */ - id: string; - - /** - * ID of the TLS certificate issued for the custom domain. - */ - certificate_id: string; - - /** - * Full hostname of the custom domain, including the zone name. - */ - hostname: string; - - /** - * ID of the zone. - */ - zone_id: string; - - /** - * Name of the zone. - */ - zone_name: string; - } - - export interface DurableObject { - /** - * ID of the Durable Object namespace being used. - */ - namespace_id: string; - - /** - * Name of the Durable Object namespace being used. - */ - namespace_name: string; - - /** - * ID of the Worker using the Durable Object implementation. - */ - worker_id: string; - - /** - * Name of the Worker using the Durable Object implementation. - */ - worker_name: string; - } - - export interface Queue { - /** - * ID of the queue consumer configuration. - */ - queue_consumer_id: string; - - /** - * ID of the queue. - */ - queue_id: string; - - /** - * Name of the queue. - */ - queue_name: string; - } - - export interface Worker { - /** - * ID of the referencing Worker. - */ - id: string; - - /** - * Name of the referencing Worker. - */ - name: string; - } - } - /** * Subdomain settings for the Worker. */ 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/workers/scripts/script-and-version-settings.ts b/src/resources/workers/scripts/script-and-version-settings.ts index d6ef7552ca..05bc7152a0 100644 --- a/src/resources/workers/scripts/script-and-version-settings.ts +++ b/src/resources/workers/scripts/script-and-version-settings.ts @@ -243,7 +243,7 @@ export namespace ScriptAndVersionSettingEditResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -995,7 +995,7 @@ export namespace ScriptAndVersionSettingGetResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -1765,7 +1765,7 @@ export namespace ScriptAndVersionSettingEditParams { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index 70546d5580..d96bb354dc 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -925,7 +925,7 @@ export namespace ScriptUpdateParams { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; diff --git a/src/resources/workers/scripts/versions.ts b/src/resources/workers/scripts/versions.ts index c9027b6f0c..d4334609ad 100644 --- a/src/resources/workers/scripts/versions.ts +++ b/src/resources/workers/scripts/versions.ts @@ -245,7 +245,7 @@ export namespace VersionCreateResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -981,7 +981,7 @@ export namespace VersionGetResponse { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; @@ -1634,11 +1634,6 @@ export namespace VersionCreateParams { export namespace Metadata { export interface Annotations { - /** - * Associated alias for a version. - */ - 'workers/alias'?: string; - /** * Human-readable message about the version. Truncated to 100 bytes. */ @@ -1745,7 +1740,7 @@ export namespace VersionCreateParams { name: string; /** - * The name of the dispatch namespace. + * Namespace to bind to. */ namespace: string; 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..2740494438 100644 --- a/src/resources/workflows/instances/instances.ts +++ b/src/resources/workflows/instances/instances.ts @@ -1,21 +1,429 @@ // 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: `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. + */ + date_end?: string; + + /** + * Query param: Accepts ISO 8601 with no timezone offsets and in UTC. + */ + date_start?: string; + + /** + * Query param: should only be used when `cursor` is used, defines a new direction + * for the cursor + */ + direction?: 'asc' | 'desc'; + + /** + * 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/devices/dex-tests.ts b/src/resources/zero-trust/devices/dex-tests.ts index 024ac99cae..4446969263 100644 --- a/src/resources/zero-trust/devices/dex-tests.ts +++ b/src/resources/zero-trust/devices/dex-tests.ts @@ -13,10 +13,7 @@ export class DEXTests extends APIResource { * const dexTest = * await client.zeroTrust.devices.dexTests.create({ * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: { - * host: 'https://dash.cloudflare.com', - * kind: 'http', - * }, + * data: {}, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -43,10 +40,7 @@ export class DEXTests extends APIResource { * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: { - * host: 'https://dash.cloudflare.com', - * kind: 'http', - * }, + * data: {}, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -277,24 +271,24 @@ export namespace DEXTestCreateResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -357,24 +351,24 @@ export namespace DEXTestUpdateResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -437,24 +431,24 @@ export namespace DEXTestListResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -522,24 +516,24 @@ export namespace DEXTestDeleteResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -603,24 +597,24 @@ export namespace DEXTestGetResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -686,24 +680,24 @@ export namespace DEXTestCreateParams { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -769,24 +763,24 @@ export namespace DEXTestUpdateParams { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default 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/zero-trust/dex/dex.ts b/src/resources/zero-trust/dex/dex.ts index a500404035..f12a3ad01f 100644 --- a/src/resources/zero-trust/dex/dex.ts +++ b/src/resources/zero-trust/dex/dex.ts @@ -29,7 +29,6 @@ import { FleetStatusLiveParams, FleetStatusLiveResponse, FleetStatusOverTimeParams, - FleetStatusOverTimeResponse, LiveStat, } from './fleet-status/fleet-status'; import * as HTTPTestsAPI from './http-tests/http-tests'; @@ -54,9 +53,6 @@ export class DEX extends APIResource { } export interface DigitalExperienceMonitor { - /** - * API Resource UUID tag. - */ id: string; /** @@ -212,7 +208,6 @@ export declare namespace DEX { FleetStatus as FleetStatus, type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, - type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts index 43f7978b75..a64c26da75 100644 --- a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts +++ b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts @@ -44,25 +44,20 @@ export class FleetStatus extends APIResource { * * @example * ```ts - * const response = - * await client.zeroTrust.dex.fleetStatus.overTime({ - * account_id: '01a7362d577a6c3019a474fd6f485823', - * from: '2023-10-11T00:00:00Z', - * to: '2023-10-11T00:00:00Z', - * }); + * await client.zeroTrust.dex.fleetStatus.overTime({ + * account_id: '01a7362d577a6c3019a474fd6f485823', + * from: '2023-10-11T00:00:00Z', + * to: '2023-10-11T00:00:00Z', + * }); * ``` */ - overTime( - params: FleetStatusOverTimeParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + overTime(params: FleetStatusOverTimeParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...query } = params; - return ( - this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { - query, - ...options, - }) as Core.APIPromise<{ result: FleetStatusOverTimeResponse }> - )._thenUnwrap((obj) => obj.result); + return this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { + query, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); } } @@ -98,53 +93,6 @@ export namespace FleetStatusLiveResponse { } } -export interface FleetStatusOverTimeResponse { - deviceStats?: FleetStatusOverTimeResponse.DeviceStats; -} - -export namespace FleetStatusOverTimeResponse { - export interface DeviceStats { - byMode?: Array; - - byStatus?: Array; - - /** - * Number of unique devices - */ - uniqueDevicesTotal?: number; - } - - export namespace DeviceStats { - export interface ByMode { - /** - * Timestamp in ISO format - */ - timestamp?: string; - - /** - * Number of unique devices - */ - uniqueDevicesTotal?: number; - - value?: string; - } - - export interface ByStatus { - /** - * Timestamp in ISO format - */ - timestamp?: string; - - /** - * Number of unique devices - */ - uniqueDevicesTotal?: number; - - value?: string; - } - } -} - export interface FleetStatusLiveParams { /** * Path param: Unique identifier for account @@ -191,7 +139,6 @@ export declare namespace FleetStatus { export { type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, - type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/index.ts b/src/resources/zero-trust/dex/fleet-status/index.ts index 8bf3ee7730..31cdb34bb8 100644 --- a/src/resources/zero-trust/dex/fleet-status/index.ts +++ b/src/resources/zero-trust/dex/fleet-status/index.ts @@ -10,7 +10,6 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, - type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status'; diff --git a/src/resources/zero-trust/dex/index.ts b/src/resources/zero-trust/dex/index.ts index d0f4eae54c..f97aa02d43 100644 --- a/src/resources/zero-trust/dex/index.ts +++ b/src/resources/zero-trust/dex/index.ts @@ -20,7 +20,6 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, - type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status/index'; diff --git a/src/resources/zones/settings.ts b/src/resources/zones/settings.ts index 4a3ad6c613..0838680bb9 100644 --- a/src/resources/zones/settings.ts +++ b/src/resources/zones/settings.ts @@ -301,8 +301,13 @@ export interface BrowserCacheTTL { id?: 'browser_cache_ttl'; /** - * The number of seconds to cache resources for. Setting this to 0 enables "Respect - * Existing Headers". + * The number of seconds to cache resources for. Minimum values by plan: + * + * - Free: 7200 seconds (2 hours) + * - Pro: 3600 seconds (1 hour) + * - Business: 1 second + * - Enterprise: 1 second Setting this to 0 enables "Respect Existing Headers" and + * is allowed for all plans. */ value?: number; } @@ -314,8 +319,13 @@ export interface BrowserCacheTTLParam { id?: 'browser_cache_ttl'; /** - * The number of seconds to cache resources for. Setting this to 0 enables "Respect - * Existing Headers". + * The number of seconds to cache resources for. Minimum values by plan: + * + * - Free: 7200 seconds (2 hours) + * - Pro: 3600 seconds (1 hour) + * - Business: 1 second + * - Enterprise: 1 second Setting this to 0 enables "Respect Existing Headers" and + * is allowed for all plans. */ value?: number; } @@ -1092,10 +1102,6 @@ export interface PseudoIPV4 { modified_on?: string | null; } -/** - * @deprecated This page rule is deprecated. This functionality is no longer - * supported. - */ export interface ResponseBuffering { /** * Turn on or off whether Cloudflare should wait for an entire file from the origin @@ -1110,10 +1116,6 @@ export interface ResponseBuffering { value?: 'on' | 'off'; } -/** - * @deprecated This page rule is deprecated. This functionality is no longer - * supported. - */ export interface ResponseBufferingParam { /** * Turn on or off whether Cloudflare should wait for an entire file from the origin @@ -2213,8 +2215,10 @@ export namespace SettingEditResponse { } /** - * @deprecated This zone setting is deprecated. This functionality is no longer - * supported. + * Enables or disables buffering of responses from the proxied server. Cloudflare + * may buffer the whole payload to deliver it at once to the client versus allowing + * it to be delivered in chunks. By default, the proxied server streams directly + * and is not buffered by Cloudflare. This is limited to Enterprise Zones. */ export interface ZonesSchemasResponseBuffering { /** @@ -3254,8 +3258,10 @@ export namespace SettingGetResponse { } /** - * @deprecated This zone setting is deprecated. This functionality is no longer - * supported. + * Enables or disables buffering of responses from the proxied server. Cloudflare + * may buffer the whole payload to deliver it at once to the client versus allowing + * it to be delivered in chunks. By default, the proxied server streams directly + * and is not buffered by Cloudflare. This is limited to Enterprise Zones. */ export interface ZonesSchemasResponseBuffering { /** diff --git a/tests/api-resources/alerting/destinations/webhooks.test.ts b/tests/api-resources/alerting/destinations/webhooks.test.ts index f7e64ac407..400214bb31 100644 --- a/tests/api-resources/alerting/destinations/webhooks.test.ts +++ b/tests/api-resources/alerting/destinations/webhooks.test.ts @@ -38,11 +38,14 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('update: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.update('b115d5ec15c641ee8b7692c449b5227b', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'Slack Webhook', - url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', - }); + const responsePromise = client.alerting.destinations.webhooks.update( + 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'Slack Webhook', + url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -54,12 +57,15 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('update: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.update('b115d5ec15c641ee8b7692c449b5227b', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'Slack Webhook', - url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', - secret: 'secret', - }); + const response = await client.alerting.destinations.webhooks.update( + 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'Slack Webhook', + url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + secret: 'secret', + }, + ); }); test('list: only required params', async () => { @@ -82,9 +88,10 @@ describe('resource webhooks', () => { }); test('delete: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.delete('b115d5ec15c641ee8b7692c449b5227b', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.alerting.destinations.webhooks.delete( + 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -95,16 +102,18 @@ describe('resource webhooks', () => { }); test('delete: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.delete('b115d5ec15c641ee8b7692c449b5227b', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const response = await client.alerting.destinations.webhooks.delete( + 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); }); // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('get: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.get('b115d5ec15c641ee8b7692c449b5227b', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.alerting.destinations.webhooks.get( + 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -116,7 +125,7 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('get: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.get('b115d5ec15c641ee8b7692c449b5227b', { + const response = await client.alerting.destinations.webhooks.get('b115d5ec-15c6-41ee-8b76-92c449b5227b', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/alerting/policies.test.ts b/tests/api-resources/alerting/policies.test.ts index c3b23203ae..aed5640624 100644 --- a/tests/api-resources/alerting/policies.test.ts +++ b/tests/api-resources/alerting/policies.test.ts @@ -35,9 +35,9 @@ describe('resource policies', () => { alert_type: 'universal_ssl_event_type', enabled: true, mechanisms: { - email: [{ id: 'id' }], - pagerduty: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], - webhooks: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], + email: [{ id: 'test@example.com' }], + pagerduty: [{ id: 'e8133a15-00a4-4d69-aec1-32f70c51f6e5' }], + webhooks: [{ id: '14cc1190-5d2b-4b98-a696-c424cb2ad05f' }], }, name: 'SSL Notification Event Policy', alert_interval: '30m', @@ -83,7 +83,6 @@ describe('resource policies', () => { traffic_exclusions: ['security_events'], tunnel_id: ['string'], tunnel_name: ['string'], - type: ['string'], where: ['string'], zones: ['string'], }, @@ -92,7 +91,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('update: only required params', async () => { - const responsePromise = client.alerting.policies.update('0da2b59ef118439d8097bdfb215203c9', { + const responsePromise = client.alerting.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -106,7 +105,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('update: required and optional params', async () => { - const response = await client.alerting.policies.update('0da2b59ef118439d8097bdfb215203c9', { + const response = await client.alerting.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', alert_interval: '30m', alert_type: 'universal_ssl_event_type', @@ -153,14 +152,13 @@ describe('resource policies', () => { traffic_exclusions: ['security_events'], tunnel_id: ['string'], tunnel_name: ['string'], - type: ['string'], where: ['string'], zones: ['string'], }, mechanisms: { - email: [{ id: 'id' }], - pagerduty: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], - webhooks: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], + email: [{ id: 'test@example.com' }], + pagerduty: [{ id: 'e8133a15-00a4-4d69-aec1-32f70c51f6e5' }], + webhooks: [{ id: '14cc1190-5d2b-4b98-a696-c424cb2ad05f' }], }, name: 'SSL Notification Event Policy', }); @@ -182,7 +180,7 @@ describe('resource policies', () => { }); test('delete: only required params', async () => { - const responsePromise = client.alerting.policies.delete('0da2b59ef118439d8097bdfb215203c9', { + const responsePromise = client.alerting.policies.delete('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -195,14 +193,14 @@ describe('resource policies', () => { }); test('delete: required and optional params', async () => { - const response = await client.alerting.policies.delete('0da2b59ef118439d8097bdfb215203c9', { + const response = await client.alerting.policies.delete('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('get: only required params', async () => { - const responsePromise = client.alerting.policies.get('0da2b59ef118439d8097bdfb215203c9', { + const responsePromise = client.alerting.policies.get('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -216,7 +214,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('get: required and optional params', async () => { - const response = await client.alerting.policies.get('0da2b59ef118439d8097bdfb215203c9', { + const response = await client.alerting.policies.get('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts b/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts new file mode 100644 index 0000000000..9bd29bee68 --- /dev/null +++ b/tests/api-resources/cloudforce-one/threat-events/indicator-types.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 indicatorTypes', () => { + // TODO: HTTP 401 from prism + test.skip('list: only required params', async () => { + const responsePromise = client.cloudforceOne.threatEvents.indicatorTypes.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); + }); + + // TODO: HTTP 401 from prism + test.skip('list: required and optional params', async () => { + const response = await client.cloudforceOne.threatEvents.indicatorTypes.list({ + account_id: 'account_id', + }); + }); +}); 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..a543062bc0 100644 --- a/tests/api-resources/kv/namespaces/namespaces.test.ts +++ b/tests/api-resources/kv/namespaces/namespaces.test.ts @@ -69,7 +69,7 @@ describe('resource namespaces', () => { direction: 'asc', order: 'id', page: 1, - per_page: 5, + per_page: 1, }); }); @@ -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..03fbaa4b52 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: {}, }); }); diff --git a/tests/api-resources/leaked-credential-checks/detections.test.ts b/tests/api-resources/leaked-credential-checks/detections.test.ts new file mode 100644 index 0000000000..f9a1af0b8e --- /dev/null +++ b/tests/api-resources/leaked-credential-checks/detections.test.ts @@ -0,0 +1,98 @@ +// 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 detections', () => { + test('create: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.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.leakedCredentialChecks.detections.create({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + password: 'lookup_json_string(http.request.body.raw, "secret")', + username: 'lookup_json_string(http.request.body.raw, "user")', + }); + }); + + test('update: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.update( + '18a14bafaa8eb1df04ce683ec18c765e', + { 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('update: required and optional params', async () => { + const response = await client.leakedCredentialChecks.detections.update( + '18a14bafaa8eb1df04ce683ec18c765e', + { + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + password: 'lookup_json_string(http.request.body.raw, "secret")', + username: 'lookup_json_string(http.request.body.raw, "user")', + }, + ); + }); + + test('list: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.list({ + 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('list: required and optional params', async () => { + const response = await client.leakedCredentialChecks.detections.list({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); + + test('delete: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.delete( + '18a14bafaa8eb1df04ce683ec18c765e', + { 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('delete: required and optional params', async () => { + const response = await client.leakedCredentialChecks.detections.delete( + '18a14bafaa8eb1df04ce683ec18c765e', + { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + }); +}); diff --git a/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts b/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts new file mode 100644 index 0000000000..c7c208f9ed --- /dev/null +++ b/tests/api-resources/leaked-credential-checks/leaked-credential-checks.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 leakedCredentialChecks', () => { + test('create: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.create({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + enabled: true, + }); + }); + + test('get: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + }); +}); 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/organizations/organization-profile.test.ts b/tests/api-resources/organizations/organization-profile.test.ts index 84e064f2c7..538af4ce1e 100644 --- a/tests/api-resources/organizations/organization-profile.test.ts +++ b/tests/api-resources/organizations/organization-profile.test.ts @@ -11,16 +11,13 @@ const client = new Cloudflare({ describe('resource organizationProfile', () => { test('update: only required params', async () => { - const responsePromise = client.organizations.organizationProfile.update( - 'a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', - { - business_address: 'business_address', - business_email: 'business_email', - business_name: 'business_name', - business_phone: 'business_phone', - external_metadata: 'external_metadata', - }, - ); + const responsePromise = client.organizations.organizationProfile.update('organization_id', { + business_address: 'business_address', + business_email: 'business_email', + business_name: 'business_name', + business_phone: 'business_phone', + external_metadata: 'external_metadata', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -31,20 +28,17 @@ describe('resource organizationProfile', () => { }); test('update: required and optional params', async () => { - const response = await client.organizations.organizationProfile.update( - 'a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', - { - business_address: 'business_address', - business_email: 'business_email', - business_name: 'business_name', - business_phone: 'business_phone', - external_metadata: 'external_metadata', - }, - ); + const response = await client.organizations.organizationProfile.update('organization_id', { + business_address: 'business_address', + business_email: 'business_email', + business_name: 'business_name', + business_phone: 'business_phone', + external_metadata: 'external_metadata', + }); }); test('get', async () => { - const responsePromise = client.organizations.organizationProfile.get('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8'); + const responsePromise = client.organizations.organizationProfile.get('organization_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -57,9 +51,7 @@ describe('resource organizationProfile', () => { 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.organizations.organizationProfile.get('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', { - path: '/_stainless_unknown_path', - }), + client.organizations.organizationProfile.get('organization_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); }); diff --git a/tests/api-resources/organizations/organizations.test.ts b/tests/api-resources/organizations/organizations.test.ts index 8f918319cb..ea45081967 100644 --- a/tests/api-resources/organizations/organizations.test.ts +++ b/tests/api-resources/organizations/organizations.test.ts @@ -24,7 +24,7 @@ describe('resource organizations', () => { test('create: required and optional params', async () => { const response = await client.organizations.create({ name: 'name', - parent: { id: 'a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8' }, + parent: { id: 'id' }, profile: { business_address: 'business_address', business_email: 'business_email', @@ -36,7 +36,7 @@ describe('resource organizations', () => { }); test('update: only required params', async () => { - const responsePromise = client.organizations.update('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', { name: 'name' }); + const responsePromise = client.organizations.update('organization_id', { name: 'name' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -47,9 +47,9 @@ describe('resource organizations', () => { }); test('update: required and optional params', async () => { - const response = await client.organizations.update('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', { + const response = await client.organizations.update('organization_id', { name: 'name', - parent: { id: 'a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8' }, + parent: { id: 'id' }, profile: { business_address: 'business_address', business_email: 'business_email', @@ -60,43 +60,8 @@ describe('resource organizations', () => { }); }); - test('list', async () => { - const responsePromise = client.organizations.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.organizations.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.organizations.list( - { - id: ['a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8'], - containing: { account: 'account', organization: 'organization', user: 'user' }, - name: { contains: 'contains', endsWith: 'endsWith', startsWith: 'startsWith' }, - page_size: 0, - page_token: 'page_token', - parent: { id: 'a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8' }, - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - test('delete', async () => { - const responsePromise = client.organizations.delete('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8'); + const responsePromise = client.organizations.delete('organization_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -109,12 +74,12 @@ describe('resource organizations', () => { test('delete: 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.organizations.delete('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', { path: '/_stainless_unknown_path' }), + client.organizations.delete('organization_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); test('get', async () => { - const responsePromise = client.organizations.get('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8'); + const responsePromise = client.organizations.get('organization_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -127,7 +92,7 @@ describe('resource organizations', () => { 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.organizations.get('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', { path: '/_stainless_unknown_path' }), + client.organizations.get('organization_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); }); diff --git a/tests/api-resources/pages/projects/deployments/deployments.test.ts b/tests/api-resources/pages/projects/deployments/deployments.test.ts index 67899467e8..41d5114e2a 100644 --- a/tests/api-resources/pages/projects/deployments/deployments.test.ts +++ b/tests/api-resources/pages/projects/deployments/deployments.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Cloudflare, { toFile } from 'cloudflare'; +import Cloudflare from 'cloudflare'; import { Response } from 'node-fetch'; const client = new Cloudflare({ @@ -28,19 +28,7 @@ describe('resource deployments', () => { test.skip('create: required and optional params', async () => { const response = await client.pages.projects.deployments.create('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - _headers: await toFile(Buffer.from('# my file contents'), 'README.md'), - _redirects: await toFile(Buffer.from('# my file contents'), 'README.md'), - '_routes.json': await toFile(Buffer.from('# my file contents'), 'README.md'), - '_worker.bundle': await toFile(Buffer.from('# my file contents'), 'README.md'), - '_worker.js': await toFile(Buffer.from('# my file contents'), 'README.md'), branch: 'staging', - commit_dirty: 'false', - commit_hash: 'a1b2c3d4e5f6', - commit_message: 'Update homepage', - 'functions-filepath-routing-config.json': await toFile(Buffer.from('# my file contents'), 'README.md'), - manifest: '{"index.html": "abc123", "style.css": "def456"}', - pages_build_output_dir: 'dist', - wrangler_config_hash: 'wrangler_config_hash', }); }); diff --git a/tests/api-resources/pages/projects/projects.test.ts b/tests/api-resources/pages/projects/projects.test.ts index 4f2c4122e8..2057a0124d 100644 --- a/tests/api-resources/pages/projects/projects.test.ts +++ b/tests/api-resources/pages/projects/projects.test.ts @@ -11,11 +11,7 @@ const client = new Cloudflare({ describe('resource projects', () => { test('create: only required params', async () => { - const responsePromise = client.pages.projects.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'my-pages-app', - production_branch: 'main', - }); + const responsePromise = client.pages.projects.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -28,8 +24,6 @@ describe('resource projects', () => { test('create: required and optional params', async () => { const response = await client.pages.projects.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'my-pages-app', - production_branch: 'main', build_config: { build_caching: true, build_command: 'npm run build', @@ -41,19 +35,15 @@ describe('resource projects', () => { deployment_configs: { preview: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, - always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - build_image_major_version: 3, - compatibility_date: '2025-01-01', + compatibility_date: '2022-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, - fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, - limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -65,25 +55,19 @@ describe('resource projects', () => { service: 'example-worker', }, }, - usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, - wrangler_config_hash: 'abc123def456', }, production: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, - always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - build_image_major_version: 3, - compatibility_date: '2025-01-01', + compatibility_date: '2022-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, - fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, - limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -95,26 +79,26 @@ describe('resource projects', () => { service: 'example-worker', }, }, - usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, - wrangler_config_hash: 'abc123def456', }, }, + name: 'NextJS Blog', + production_branch: 'main', source: { config: { deployments_enabled: true, - owner: 'my-org', + owner: 'owner', path_excludes: ['string'], path_includes: ['string'], pr_comments_enabled: true, preview_branch_excludes: ['string'], preview_branch_includes: ['string'], preview_deployment_setting: 'all', - production_branch: 'main', + production_branch: 'production_branch', production_deployments_enabled: true, - repo_name: 'my-repo', + repo_name: 'repo_name', }, - type: 'github', + type: 'type', }, }); }); @@ -131,11 +115,7 @@ describe('resource projects', () => { }); test('list: required and optional params', async () => { - const response = await client.pages.projects.list({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - page: 1, - per_page: 10, - }); + const response = await client.pages.projects.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); }); test('delete: only required params', async () => { @@ -160,8 +140,6 @@ describe('resource projects', () => { test('edit: only required params', async () => { const responsePromise = client.pages.projects.edit('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'my-pages-app', - production_branch: 'main', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -175,8 +153,6 @@ describe('resource projects', () => { test('edit: required and optional params', async () => { const response = await client.pages.projects.edit('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'my-pages-app', - production_branch: 'main', build_config: { build_caching: true, build_command: 'npm run build', @@ -188,19 +164,15 @@ describe('resource projects', () => { deployment_configs: { preview: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, - always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - build_image_major_version: 3, - compatibility_date: '2025-01-01', + compatibility_date: '2022-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, - fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, - limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -212,25 +184,19 @@ describe('resource projects', () => { service: 'example-worker', }, }, - usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, - wrangler_config_hash: 'abc123def456', }, production: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, - always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - build_image_major_version: 3, - compatibility_date: '2025-01-01', + compatibility_date: '2022-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, - fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, - limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -242,26 +208,26 @@ describe('resource projects', () => { service: 'example-worker', }, }, - usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, - wrangler_config_hash: 'abc123def456', }, }, + name: 'NextJS Blog', + production_branch: 'main', source: { config: { deployments_enabled: true, - owner: 'my-org', + owner: 'owner', path_excludes: ['string'], path_includes: ['string'], pr_comments_enabled: true, preview_branch_excludes: ['string'], preview_branch_includes: ['string'], preview_deployment_setting: 'all', - production_branch: 'main', + production_branch: 'production_branch', production_deployments_enabled: true, - repo_name: 'my-repo', + repo_name: 'repo_name', }, - type: 'github', + type: 'type', }, }); }); diff --git a/tests/api-resources/pipelines.test.ts b/tests/api-resources/pipelines.test.ts index 390a133372..40730e8ec8 100644 --- a/tests/api-resources/pipelines.test.ts +++ b/tests/api-resources/pipelines.test.ts @@ -12,7 +12,7 @@ const client = new Cloudflare({ describe('resource pipelines', () => { test('create: only required params', async () => { const responsePromise = client.pipelines.create({ - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination: { batch: {}, compression: {}, @@ -39,7 +39,7 @@ describe('resource pipelines', () => { test('create: required and optional params', async () => { const response = await client.pipelines.create({ - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination: { batch: { max_bytes: 1000, max_duration_s: 0.25, max_rows: 100 }, compression: { type: 'gzip' }, @@ -64,7 +64,7 @@ describe('resource pipelines', () => { test('update: only required params', async () => { const responsePromise = client.pipelines.update('sample_pipeline', { - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination: { batch: {}, compression: {}, format: 'json', path: { bucket: 'bucket' }, type: 'r2' }, name: 'sample_pipeline', source: [{ format: 'json', type: 'type' }], @@ -80,7 +80,7 @@ describe('resource pipelines', () => { test('update: required and optional params', async () => { const response = await client.pipelines.update('sample_pipeline', { - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination: { batch: { max_bytes: 1000, max_duration_s: 0.25, max_rows: 100 }, compression: { type: 'gzip' }, @@ -104,7 +104,7 @@ describe('resource pipelines', () => { }); test('list: only required params', async () => { - const responsePromise = client.pipelines.list({ account_id: '0123105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = client.pipelines.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -116,7 +116,7 @@ describe('resource pipelines', () => { test('list: required and optional params', async () => { const response = await client.pipelines.list({ - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', page: 'page', per_page: 'per_page', search: 'search', @@ -125,7 +125,7 @@ describe('resource pipelines', () => { test('delete: only required params', async () => { const responsePromise = client.pipelines.delete('sample_pipeline', { - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -138,13 +138,13 @@ describe('resource pipelines', () => { test('delete: required and optional params', async () => { const response = await client.pipelines.delete('sample_pipeline', { - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); test('get: only required params', async () => { const responsePromise = client.pipelines.get('sample_pipeline', { - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -157,7 +157,7 @@ describe('resource pipelines', () => { test('get: required and optional params', async () => { const response = await client.pipelines.get('sample_pipeline', { - account_id: '0123105f4ecef8ad9ca31a8372d0c353', + account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); }); diff --git a/tests/api-resources/queues/consumers.test.ts b/tests/api-resources/queues/consumers.test.ts index 9cff12967c..e4275cc8e0 100644 --- a/tests/api-resources/queues/consumers.test.ts +++ b/tests/api-resources/queues/consumers.test.ts @@ -115,4 +115,27 @@ describe('resource consumers', () => { { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); }); + + test('get: only required params', async () => { + const responsePromise = client.queues.consumers.get( + '023e105f4ecef8ad9ca31a8372d0c353', + '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('get: required and optional params', async () => { + const response = await client.queues.consumers.get( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + }); }); 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/queues/subscriptions.test.ts b/tests/api-resources/queues/subscriptions.test.ts new file mode 100644 index 0000000000..fed29a3ae9 --- /dev/null +++ b/tests/api-resources/queues/subscriptions.test.ts @@ -0,0 +1,101 @@ +// 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 subscriptions', () => { + test('create: only required params', async () => { + const responsePromise = client.queues.subscriptions.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.queues.subscriptions.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + destination: { queue_id: 'queue_id', type: 'queues.queue' }, + enabled: true, + events: ['string'], + name: 'name', + source: { type: 'images' }, + }); + }); + + test('update: only required params', async () => { + const responsePromise = client.queues.subscriptions.update('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('update: required and optional params', async () => { + const response = await client.queues.subscriptions.update('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + destination: { queue_id: 'queue_id', type: 'queues.queue' }, + enabled: true, + events: ['string'], + name: 'name', + }); + }); + + test('list: only required params', async () => { + const responsePromise = client.queues.subscriptions.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.queues.subscriptions.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + direction: 'asc', + order: 'created_at', + page: 1, + per_page: 1, + }); + }); + + test('delete: only required params', async () => { + const responsePromise = client.queues.subscriptions.delete('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('delete: required and optional params', async () => { + const response = await client.queues.subscriptions.delete('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); +}); diff --git a/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts b/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts index 597bcca970..c3238ed19b 100644 --- a/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts +++ b/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts @@ -11,12 +11,7 @@ const client = new Cloudflare({ describe('resource connectivityPrecheck', () => { test('source: only required params', async () => { - const responsePromise = client.r2.superSlurper.connectivityPrecheck.source({ - account_id: 'account_id', - bucket: 'bucket', - secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, - vendor: 's3', - }); + const responsePromise = client.r2.superSlurper.connectivityPrecheck.source({ account_id: 'account_id' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -30,21 +25,14 @@ describe('resource connectivityPrecheck', () => { const response = await client.r2.superSlurper.connectivityPrecheck.source({ account_id: 'account_id', bucket: 'bucket', + endpoint: 'endpoint', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 's3', - endpoint: 'endpoint', - pathPrefix: 'pathPrefix', - region: 'region', }); }); test('target: only required params', async () => { - const responsePromise = client.r2.superSlurper.connectivityPrecheck.target({ - account_id: 'account_id', - bucket: 'bucket', - secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, - vendor: 'r2', - }); + const responsePromise = client.r2.superSlurper.connectivityPrecheck.target({ account_id: 'account_id' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -58,9 +46,9 @@ describe('resource connectivityPrecheck', () => { const response = await client.r2.superSlurper.connectivityPrecheck.target({ account_id: 'account_id', bucket: 'bucket', + jurisdiction: 'default', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 'r2', - jurisdiction: 'default', }); }); }); diff --git a/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts b/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts index e2806bfb82..8376af108a 100644 --- a/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts +++ b/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts @@ -27,17 +27,15 @@ describe('resource jobs', () => { overwrite: true, source: { bucket: 'bucket', + endpoint: 'endpoint', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 's3', - endpoint: 'endpoint', - pathPrefix: 'pathPrefix', - region: 'region', }, target: { bucket: 'bucket', + jurisdiction: 'default', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 'r2', - jurisdiction: 'default', }, }); }); diff --git a/tests/api-resources/radar/as112/as112.test.ts b/tests/api-resources/radar/as112/as112.test.ts index 3b30d3a5e2..c6ff5db158 100644 --- a/tests/api-resources/radar/as112/as112.test.ts +++ b/tests/api-resources/radar/as112/as112.test.ts @@ -10,47 +10,6 @@ const client = new Cloudflare({ }); describe('resource as112', () => { - test('summaryV2', async () => { - const responsePromise = client.radar.as112.summaryV2('DNSSEC'); - 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('summaryV2: 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.as112.summaryV2('DNSSEC', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('summaryV2: 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.as112.summaryV2( - 'DNSSEC', - { - 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'], - protocol: 'UDP', - queryType: 'A', - responseCode: 'NOERROR', - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - test('timeseries', async () => { const responsePromise = client.radar.as112.timeseries(); const rawResponse = await responsePromise.asResponse(); @@ -90,46 +49,4 @@ describe('resource as112', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - test('timeseriesGroupsV2', async () => { - const responsePromise = client.radar.as112.timeseriesGroupsV2('DNSSEC'); - 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('timeseriesGroupsV2: 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.as112.timeseriesGroupsV2('DNSSEC', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroupsV2: 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.as112.timeseriesGroupsV2( - 'DNSSEC', - { - aggInterval: '1h', - 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'], - protocol: 'UDP', - queryType: 'A', - responseCode: 'NOERROR', - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); }); diff --git a/tests/api-resources/radar/attacks/layer3/layer3.test.ts b/tests/api-resources/radar/attacks/layer3/layer3.test.ts index 9f5162d959..b3d845624c 100644 --- a/tests/api-resources/radar/attacks/layer3/layer3.test.ts +++ b/tests/api-resources/radar/attacks/layer3/layer3.test.ts @@ -10,47 +10,6 @@ const client = new Cloudflare({ }); describe('resource layer3', () => { - test('summaryV2', async () => { - const responsePromise = client.radar.attacks.layer3.summaryV2('PROTOCOL'); - 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('summaryV2: 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.attacks.layer3.summaryV2('PROTOCOL', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('summaryV2: 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.attacks.layer3.summaryV2( - 'PROTOCOL', - { - continent: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - direction: 'ORIGIN', - format: 'JSON', - ipVersion: ['IPv4'], - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - protocol: ['UDP'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - test('timeseries', async () => { const responsePromise = client.radar.attacks.layer3.timeseries(); const rawResponse = await responsePromise.asResponse(); @@ -93,47 +52,4 @@ describe('resource layer3', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - test('timeseriesGroupsV2', async () => { - const responsePromise = client.radar.attacks.layer3.timeseriesGroupsV2('PROTOCOL'); - 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('timeseriesGroupsV2: 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.attacks.layer3.timeseriesGroupsV2('PROTOCOL', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroupsV2: 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.attacks.layer3.timeseriesGroupsV2( - 'PROTOCOL', - { - aggInterval: '1h', - continent: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - direction: 'ORIGIN', - format: 'JSON', - ipVersion: ['IPv4'], - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - normalization: 'PERCENTAGE', - protocol: ['UDP'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); }); diff --git a/tests/api-resources/radar/attacks/layer7/layer7.test.ts b/tests/api-resources/radar/attacks/layer7/layer7.test.ts index 78d5defbed..edab41b510 100644 --- a/tests/api-resources/radar/attacks/layer7/layer7.test.ts +++ b/tests/api-resources/radar/attacks/layer7/layer7.test.ts @@ -10,49 +10,6 @@ const client = new Cloudflare({ }); describe('resource layer7', () => { - test('summaryV2', async () => { - const responsePromise = client.radar.attacks.layer7.summaryV2('HTTP_METHOD'); - 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('summaryV2: 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.attacks.layer7.summaryV2('HTTP_METHOD', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('summaryV2: 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.attacks.layer7.summaryV2( - 'HTTP_METHOD', - { - asn: ['string'], - continent: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - httpMethod: ['GET'], - httpVersion: ['HTTPv1'], - ipVersion: ['IPv4'], - limitPerGroup: 10, - location: ['string'], - mitigationProduct: ['DDOS'], - name: ['main_series'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - test('timeseries', async () => { const responsePromise = client.radar.attacks.layer7.timeseries(); const rawResponse = await responsePromise.asResponse(); @@ -95,49 +52,4 @@ describe('resource layer7', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - test('timeseriesGroupsV2', async () => { - const responsePromise = client.radar.attacks.layer7.timeseriesGroupsV2('HTTP_METHOD'); - 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('timeseriesGroupsV2: 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.attacks.layer7.timeseriesGroupsV2('HTTP_METHOD', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroupsV2: 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.attacks.layer7.timeseriesGroupsV2( - 'HTTP_METHOD', - { - aggInterval: '1h', - asn: ['string'], - continent: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - httpMethod: ['GET'], - httpVersion: ['HTTPv1'], - ipVersion: ['IPv4'], - limitPerGroup: 10, - location: ['string'], - mitigationProduct: ['DDOS'], - name: ['main_series'], - normalization: 'PERCENTAGE', - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); }); diff --git a/tests/api-resources/radar/dns/dns.test.ts b/tests/api-resources/radar/dns/dns.test.ts index 57b258f9f3..bff5419da4 100644 --- a/tests/api-resources/radar/dns/dns.test.ts +++ b/tests/api-resources/radar/dns/dns.test.ts @@ -10,50 +10,6 @@ const client = new Cloudflare({ }); describe('resource dns', () => { - test('summaryV2', async () => { - const responsePromise = client.radar.dns.summaryV2('IP_VERSION'); - 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('summaryV2: 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.dns.summaryV2('IP_VERSION', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('summaryV2: 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.dns.summaryV2( - 'IP_VERSION', - { - 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'], - nodata: true, - protocol: 'UDP', - queryType: 'A', - responseCode: 'NOERROR', - tld: ['string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - test('timeseries', async () => { const responsePromise = client.radar.dns.timeseries(); const rawResponse = await responsePromise.asResponse(); @@ -96,49 +52,4 @@ describe('resource dns', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - test('timeseriesGroupsV2', async () => { - const responsePromise = client.radar.dns.timeseriesGroupsV2('IP_VERSION'); - 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('timeseriesGroupsV2: 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.dns.timeseriesGroupsV2('IP_VERSION', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroupsV2: 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.dns.timeseriesGroupsV2( - 'IP_VERSION', - { - 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'], - nodata: true, - protocol: 'UDP', - queryType: 'A', - responseCode: 'NOERROR', - tld: ['string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); }); diff --git a/tests/api-resources/radar/email/routing/routing.test.ts b/tests/api-resources/radar/email/routing/routing.test.ts deleted file mode 100644 index c66901f98c..0000000000 --- a/tests/api-resources/radar/email/routing/routing.test.ts +++ /dev/null @@ -1,97 +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 routing', () => { - test('summaryV2', async () => { - const responsePromise = client.radar.email.routing.summaryV2('IP_VERSION'); - 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('summaryV2: 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.email.routing.summaryV2('IP_VERSION', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('summaryV2: 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.email.routing.summaryV2( - 'IP_VERSION', - { - arc: ['PASS'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - dkim: ['PASS'], - dmarc: ['PASS'], - encrypted: ['ENCRYPTED'], - format: 'JSON', - ipVersion: ['IPv4'], - limitPerGroup: 10, - name: ['main_series'], - spf: ['PASS'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroupsV2', async () => { - const responsePromise = client.radar.email.routing.timeseriesGroupsV2('IP_VERSION'); - 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('timeseriesGroupsV2: 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.email.routing.timeseriesGroupsV2('IP_VERSION', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroupsV2: 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.email.routing.timeseriesGroupsV2( - 'IP_VERSION', - { - aggInterval: '1h', - arc: ['PASS'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - dkim: ['PASS'], - dmarc: ['PASS'], - encrypted: ['ENCRYPTED'], - format: 'JSON', - ipVersion: ['IPv4'], - limitPerGroup: 10, - name: ['main_series'], - spf: ['PASS'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/email/security/security.test.ts b/tests/api-resources/radar/email/security/security.test.ts deleted file mode 100644 index 185796f987..0000000000 --- a/tests/api-resources/radar/email/security/security.test.ts +++ /dev/null @@ -1,95 +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 security', () => { - test('summaryV2', async () => { - const responsePromise = client.radar.email.security.summaryV2('SPAM'); - 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('summaryV2: 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.email.security.summaryV2('SPAM', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('summaryV2: 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.email.security.summaryV2( - 'SPAM', - { - arc: ['PASS'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - dkim: ['PASS'], - dmarc: ['PASS'], - format: 'JSON', - limitPerGroup: 10, - name: ['main_series'], - spf: ['PASS'], - tlsVersion: ['TLSv1_0'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroupsV2', async () => { - const responsePromise = client.radar.email.security.timeseriesGroupsV2('SPAM'); - 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('timeseriesGroupsV2: 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.email.security.timeseriesGroupsV2('SPAM', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroupsV2: 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.email.security.timeseriesGroupsV2( - 'SPAM', - { - aggInterval: '1h', - arc: ['PASS'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - dkim: ['PASS'], - dmarc: ['PASS'], - format: 'JSON', - limitPerGroup: 10, - name: ['main_series'], - spf: ['PASS'], - tlsVersion: ['TLSv1_0'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); 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/workers/scripts/versions.test.ts b/tests/api-resources/workers/scripts/versions.test.ts index 437f382fd7..82c89f8328 100644 --- a/tests/api-resources/workers/scripts/versions.test.ts +++ b/tests/api-resources/workers/scripts/versions.test.ts @@ -31,11 +31,7 @@ describe('resource versions', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', metadata: { main_module: 'worker.js', - annotations: { - 'workers/alias': 'staging', - 'workers/message': 'Fixed worker code.', - 'workers/tag': 'workers/tag', - }, + annotations: { 'workers/message': 'Fixed worker code.', 'workers/tag': 'workers/tag' }, bindings: [{ name: 'MY_ENV_VAR', text: 'my_data', type: 'plain_text' }], compatibility_date: '2021-01-01', compatibility_flags: ['nodejs_compat'], 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..cdad8d0e4b --- /dev/null +++ b/tests/api-resources/workflows/instances/instances.test.ts @@ -0,0 +1,89 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource 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', + cursor: 'cursor', + date_end: '2019-12-27T18:11:19.117Z', + date_start: '2019-12-27T18:11:19.117Z', + direction: 'asc', + 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' }); + }); +}); diff --git a/tests/api-resources/zero-trust/devices/dex-tests.test.ts b/tests/api-resources/zero-trust/devices/dex-tests.test.ts index 0669d5569c..246e9b7961 100644 --- a/tests/api-resources/zero-trust/devices/dex-tests.test.ts +++ b/tests/api-resources/zero-trust/devices/dex-tests.test.ts @@ -13,7 +13,7 @@ describe('resource dexTests', () => { test('create: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.create({ account_id: '01a7362d577a6c3019a474fd6f485823', - data: { host: 'https://dash.cloudflare.com', kind: 'http' }, + data: {}, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -35,7 +35,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], + target_policies: [{ id: 'id', default: true, name: 'name' }], targeted: true, }); }); @@ -43,7 +43,7 @@ describe('resource dexTests', () => { test('update: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', - data: { host: 'https://dash.cloudflare.com', kind: 'http' }, + data: {}, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -65,7 +65,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], + target_policies: [{ id: 'id', default: true, name: 'name' }], targeted: true, }); }); From 4ac69f7b79452feea2da6e96a8f255057c869f72 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Oct 2025 19:55:38 +0000 Subject: [PATCH 273/451] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 213 +-- scripts/detect-breaking-changes | 19 - .../alerting/destinations/webhooks.ts | 6 +- src/resources/alerting/policies.ts | 19 +- .../cloudforce-one/threat-events/index.ts | 6 +- .../threat-events/indicator-types.ts | 48 +- .../threat-events/threat-events.ts | 8 +- src/resources/custom-pages.ts | 48 +- .../email-security/investigate/investigate.ts | 46 + 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 | 139 +- src/resources/kv/namespaces/metadata.ts | 4 +- src/resources/kv/namespaces/namespaces.ts | 164 +- src/resources/kv/namespaces/values.ts | 33 +- .../leaked-credential-checks/detections.ts | 240 +-- .../leaked-credential-checks/index.ts | 13 +- .../leaked-credential-checks.ts | 121 +- 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/organizations/organizations.ts | 116 +- src/resources/pages/index.ts | 1 + src/resources/pages/pages.ts | 6 +- .../pages/projects/deployments/deployments.ts | 66 + src/resources/pages/projects/index.ts | 1 + src/resources/pages/projects/projects.ts | 569 +++++- src/resources/pipelines.ts | 138 +- src/resources/queues/consumers.ts | 35 - src/resources/queues/index.ts | 19 +- src/resources/queues/messages.ts | 217 +-- src/resources/queues/queues.ts | 40 +- src/resources/queues/subscriptions.ts | 871 +--------- .../r2/super-slurper/connectivity-precheck.ts | 76 +- src/resources/r2/super-slurper/jobs/jobs.ts | 52 +- src/resources/radar/as112/as112.ts | 642 ++++++- src/resources/radar/as112/index.ts | 10 +- src/resources/radar/as112/summary.ts | 34 +- .../radar/as112/timeseries-groups.ts | 36 +- src/resources/radar/attacks/attacks.ts | 28 +- src/resources/radar/attacks/index.ts | 20 +- src/resources/radar/attacks/layer3/index.ts | 10 +- src/resources/radar/attacks/layer3/layer3.ts | 426 +++++ src/resources/radar/attacks/layer3/summary.ts | 42 +- .../radar/attacks/layer3/timeseries-groups.ts | 42 +- src/resources/radar/attacks/layer7/index.ts | 10 +- src/resources/radar/attacks/layer7/layer7.ts | 604 +++++++ src/resources/radar/attacks/layer7/summary.ts | 42 +- .../radar/attacks/layer7/timeseries-groups.ts | 42 +- src/resources/radar/dns/dns.ts | 739 +++++++- src/resources/radar/dns/index.ts | 10 +- src/resources/radar/dns/summary.ts | 54 +- src/resources/radar/dns/timeseries-groups.ts | 60 +- src/resources/radar/email/email.ts | 32 +- src/resources/radar/email/index.ts | 16 +- src/resources/radar/email/routing/index.ts | 8 +- src/resources/radar/email/routing/routing.ts | 429 +++++ src/resources/radar/email/routing/summary.ts | 36 +- .../radar/email/routing/timeseries-groups.ts | 36 +- src/resources/radar/email/security/index.ts | 8 +- .../radar/email/security/security.ts | 472 +++++ src/resources/radar/email/security/summary.ts | 54 +- .../radar/email/security/timeseries-groups.ts | 54 +- src/resources/radar/entities/asns.ts | 12 +- src/resources/radar/index.ts | 20 +- src/resources/radar/netflows/netflows.ts | 2 +- src/resources/radar/radar.ts | 28 +- src/resources/stream/downloads.ts | 5 +- .../dispatch/namespaces/scripts/bindings.ts | 2 +- .../dispatch/namespaces/scripts/scripts.ts | 2 +- .../dispatch/namespaces/scripts/settings.ts | 6 +- .../workers/beta/workers/versions.ts | 4 +- src/resources/workers/beta/workers/workers.ts | 138 ++ src/resources/workers/observability/index.ts | 12 +- .../workers/observability/observability.ts | 26 +- .../workers/observability/telemetry.ts | 1538 +---------------- .../scripts/script-and-version-settings.ts | 6 +- src/resources/workers/scripts/scripts.ts | 2 +- src/resources/workers/scripts/versions.ts | 11 +- src/resources/workflows/index.ts | 23 +- src/resources/workflows/instances/events.ts | 40 +- src/resources/workflows/instances/index.ts | 18 +- .../workflows/instances/instances.ts | 416 +---- src/resources/workflows/instances/status.ts | 54 +- src/resources/workflows/versions.ts | 87 +- src/resources/workflows/workflows.ts | 274 +-- src/resources/zero-trust/devices/dex-tests.ts | 80 +- src/resources/zero-trust/dex/colos.ts | 17 +- src/resources/zero-trust/dex/dex.ts | 5 + .../dex/fleet-status/fleet-status.ts | 75 +- .../zero-trust/dex/fleet-status/index.ts | 1 + src/resources/zero-trust/dex/index.ts | 1 + src/resources/zones/settings.ts | 38 +- .../alerting/destinations/webhooks.test.ts | 51 +- tests/api-resources/alerting/policies.test.ts | 26 +- .../threat-events/indicator-types.test.ts | 33 - .../api-resources/kv/namespaces/keys.test.ts | 31 +- .../kv/namespaces/namespaces.test.ts | 33 +- .../kv/namespaces/values.test.ts | 3 +- .../detections.test.ts | 98 -- .../leaked-credential-checks.test.ts | 49 - .../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 - .../organization-profile.test.ts | 40 +- .../organizations/organizations.test.ts | 51 +- .../projects/deployments/deployments.test.ts | 14 +- .../pages/projects/projects.test.ts | 70 +- tests/api-resources/pipelines.test.ts | 20 +- tests/api-resources/queues/consumers.test.ts | 23 - tests/api-resources/queues/messages.test.ts | 43 - .../queues/subscriptions.test.ts | 101 -- .../connectivity-precheck.test.ts | 20 +- .../r2/super-slurper/jobs/jobs.test.ts | 6 +- tests/api-resources/radar/as112/as112.test.ts | 83 + .../radar/attacks/layer3/layer3.test.ts | 84 + .../radar/attacks/layer7/layer7.test.ts | 88 + tests/api-resources/radar/dns/dns.test.ts | 89 + .../radar/email/routing/routing.test.ts | 97 ++ .../radar/email/security/security.test.ts | 95 + .../workers/observability/telemetry.test.ts | 110 -- .../workers/scripts/versions.test.ts | 6 +- .../workflows/instances/events.test.ts | 32 - .../workflows/instances/instances.test.ts | 89 - .../workflows/instances/status.test.ts | 33 - .../api-resources/workflows/versions.test.ts | 50 - .../api-resources/workflows/workflows.test.ts | 85 - .../zero-trust/devices/dex-tests.test.ts | 8 +- 141 files changed, 5800 insertions(+), 6853 deletions(-) delete mode 100644 tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts delete mode 100644 tests/api-resources/leaked-credential-checks/detections.test.ts delete mode 100644 tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts 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/queues/subscriptions.test.ts create mode 100644 tests/api-resources/radar/email/routing/routing.test.ts create mode 100644 tests/api-resources/radar/email/security/security.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 4bf3c51952..3eda3dc310 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1839 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ca8fbfa82d19dca400ec61b8c93392de1acd157860e435419f9a5e9ec8c586e0.yml -openapi_spec_hash: 77d55c70bc3824ac61bd056e2319ee18 +configured_endpoints: 1814 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cceecd20dfd89884f795e75b433848994bed610b79802c65104f0c70d3ada54e.yml +openapi_spec_hash: c33c0e26e48c004c1781a36748d0144c config_hash: eab23d0b8fa818f1d1dc0e9e18de4266 diff --git a/api.md b/api.md index 7a9b01da24..19918fe7f0 100644 --- a/api.md +++ b/api.md @@ -134,6 +134,7 @@ Methods: - client.organizations.create({ ...params }) -> Organization - client.organizations.update(organizationId, { ...params }) -> Organization +- client.organizations.list({ ...params }) -> OrganizationsSinglePage - client.organizations.delete(organizationId) -> void - client.organizations.get(organizationId) -> Organization @@ -1739,61 +1740,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: @@ -2283,18 +2239,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 @@ -2302,19 +2246,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 @@ -2324,14 +2267,12 @@ Types: - Key - KeyBulkDeleteResponse -- KeyBulkGetResponse - KeyBulkUpdateResponse Methods: - 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 ### Metadata @@ -2400,16 +2341,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 @@ -2435,24 +2372,9 @@ Methods: - 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 ## Subscriptions -Types: - -- SubscriptionCreateResponse -- SubscriptionUpdateResponse -- SubscriptionListResponse -- SubscriptionDeleteResponse - -Methods: - -- client.queues.subscriptions.create({ ...params }) -> SubscriptionCreateResponse -- client.queues.subscriptions.update(subscriptionId, { ...params }) -> SubscriptionUpdateResponse -- client.queues.subscriptions.list({ ...params }) -> SubscriptionListResponsesV4PagePaginationArray -- client.queues.subscriptions.delete(subscriptionId, { ...params }) -> SubscriptionDeleteResponse - # APIGateway ## Configurations @@ -3949,7 +3871,7 @@ Types: Methods: - client.pages.projects.create({ ...params }) -> Project -- client.pages.projects.list({ ...params }) -> DeploymentsSinglePage +- client.pages.projects.list({ ...params }) -> DeploymentsV4PagePaginationArray - client.pages.projects.delete(projectName, { ...params }) -> ProjectDeleteResponse | null - client.pages.projects.edit(projectName, { ...params }) -> Project - client.pages.projects.get(projectName, { ...params }) -> Project @@ -5510,11 +5432,12 @@ Types: - LiveStat - FleetStatusLiveResponse +- FleetStatusOverTimeResponse Methods: - client.zeroTrust.dex.fleetStatus.live({ ...params }) -> FleetStatusLiveResponse -- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> void +- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> FleetStatusOverTimeResponse #### Devices @@ -6723,11 +6646,15 @@ Methods: Types: +- DNSSummaryV2Response - DNSTimeseriesResponse +- DNSTimeseriesGroupsV2Response Methods: +- client.radar.dns.summaryV2(dimension, { ...params }) -> DNSSummaryV2Response - client.radar.dns.timeseries({ ...params }) -> DNSTimeseriesResponse +- client.radar.dns.timeseriesGroupsV2(dimension, { ...params }) -> DNSTimeseriesGroupsV2Response ### Top @@ -6853,11 +6780,15 @@ Methods: Types: +- AS112SummaryV2Response - AS112TimeseriesResponse +- AS112TimeseriesGroupsV2Response Methods: +- client.radar.as112.summaryV2(dimension, { ...params }) -> AS112SummaryV2Response - client.radar.as112.timeseries({ ...params }) -> AS112TimeseriesResponse +- client.radar.as112.timeseriesGroupsV2(dimension, { ...params }) -> AS112TimeseriesGroupsV2Response ### Summary @@ -6924,6 +6855,16 @@ Types: ### Routing +Types: + +- RoutingSummaryV2Response +- RoutingTimeseriesGroupsV2Response + +Methods: + +- client.radar.email.routing.summaryV2(dimension, { ...params }) -> RoutingSummaryV2Response +- client.radar.email.routing.timeseriesGroupsV2(dimension, { ...params }) -> RoutingTimeseriesGroupsV2Response + #### Summary Types: @@ -6966,6 +6907,16 @@ Methods: ### Security +Types: + +- SecuritySummaryV2Response +- SecurityTimeseriesGroupsV2Response + +Methods: + +- client.radar.email.security.summaryV2(dimension, { ...params }) -> SecuritySummaryV2Response +- client.radar.email.security.timeseriesGroupsV2(dimension, { ...params }) -> SecurityTimeseriesGroupsV2Response + #### Top ##### Tlds @@ -7066,11 +7017,15 @@ Methods: Types: +- Layer3SummaryV2Response - Layer3TimeseriesResponse +- Layer3TimeseriesGroupsV2Response Methods: +- client.radar.attacks.layer3.summaryV2(dimension, { ...params }) -> Layer3SummaryV2Response - client.radar.attacks.layer3.timeseries({ ...params }) -> Layer3TimeseriesResponse +- client.radar.attacks.layer3.timeseriesGroupsV2(dimension, { ...params }) -> Layer3TimeseriesGroupsV2Response #### Summary @@ -7146,11 +7101,15 @@ Methods: Types: +- Layer7SummaryV2Response - Layer7TimeseriesResponse +- Layer7TimeseriesGroupsV2Response Methods: +- client.radar.attacks.layer7.summaryV2(dimension, { ...params }) -> Layer7SummaryV2Response - client.radar.attacks.layer7.timeseries({ ...params }) -> Layer7TimeseriesResponse +- client.radar.attacks.layer7.timeseriesGroupsV2(dimension, { ...params }) -> Layer7TimeseriesGroupsV2Response #### Summary @@ -8163,14 +8122,6 @@ Methods: ### IndicatorTypes -Types: - -- IndicatorTypeListResponse - -Methods: - -- client.cloudforceOne.threatEvents.indicatorTypes.list({ ...params }) -> IndicatorTypeListResponse - ### Raw Types: @@ -8443,68 +8394,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: @@ -8559,32 +8456,8 @@ Methods: # LeakedCredentialChecks -Types: - -- LeakedCredentialCheckCreateResponse -- LeakedCredentialCheckGetResponse - -Methods: - -- client.leakedCredentialChecks.create({ ...params }) -> LeakedCredentialCheckCreateResponse -- client.leakedCredentialChecks.get({ ...params }) -> LeakedCredentialCheckGetResponse - ## Detections -Types: - -- DetectionCreateResponse -- DetectionUpdateResponse -- DetectionListResponse -- DetectionDeleteResponse - -Methods: - -- client.leakedCredentialChecks.detections.create({ ...params }) -> DetectionCreateResponse -- client.leakedCredentialChecks.detections.update(detectionId, { ...params }) -> DetectionUpdateResponse -- client.leakedCredentialChecks.detections.list({ ...params }) -> DetectionListResponsesSinglePage -- client.leakedCredentialChecks.detections.delete(detectionId, { ...params }) -> DetectionDeleteResponse - # ContentScanning Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 0d840a0aee..e73689a349 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -145,14 +145,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 @@ -193,8 +185,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 @@ -207,7 +197,6 @@ TEST_PATHS=( tests/api-resources/queues/messages.test.ts tests/api-resources/queues/purge.test.ts tests/api-resources/queues/consumers.test.ts - tests/api-resources/queues/subscriptions.test.ts tests/api-resources/api-gateway/api-gateway.test.ts tests/api-resources/api-gateway/configurations.test.ts tests/api-resources/api-gateway/discovery/discovery.test.ts @@ -687,7 +676,6 @@ TEST_PATHS=( tests/api-resources/cloudforce-one/threat-events/categories.test.ts tests/api-resources/cloudforce-one/threat-events/countries.test.ts tests/api-resources/cloudforce-one/threat-events/datasets/datasets.test.ts - tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts tests/api-resources/cloudforce-one/threat-events/raw.test.ts tests/api-resources/cloudforce-one/threat-events/relate.test.ts tests/api-resources/cloudforce-one/threat-events/tags.test.ts @@ -711,16 +699,9 @@ 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 - tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts - tests/api-resources/leaked-credential-checks/detections.test.ts tests/api-resources/content-scanning/content-scanning.test.ts tests/api-resources/content-scanning/payloads.test.ts tests/api-resources/content-scanning/settings.test.ts diff --git a/src/resources/alerting/destinations/webhooks.ts b/src/resources/alerting/destinations/webhooks.ts index 279c67d0bf..605e015ae3 100644 --- a/src/resources/alerting/destinations/webhooks.ts +++ b/src/resources/alerting/destinations/webhooks.ts @@ -35,7 +35,7 @@ export class Webhooks extends APIResource { * ```ts * const webhook = * await client.alerting.destinations.webhooks.update( - * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + * 'b115d5ec15c641ee8b7692c449b5227b', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * name: 'Slack Webhook', @@ -90,7 +90,7 @@ export class Webhooks extends APIResource { * ```ts * const webhook = * await client.alerting.destinations.webhooks.delete( - * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + * 'b115d5ec15c641ee8b7692c449b5227b', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -114,7 +114,7 @@ export class Webhooks extends APIResource { * ```ts * const webhooks = * await client.alerting.destinations.webhooks.get( - * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + * 'b115d5ec15c641ee8b7692c449b5227b', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` diff --git a/src/resources/alerting/policies.ts b/src/resources/alerting/policies.ts index c2caed4005..7e22a6cc36 100644 --- a/src/resources/alerting/policies.ts +++ b/src/resources/alerting/policies.ts @@ -35,7 +35,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.update( - * '0da2b59e-f118-439d-8097-bdfb215203c9', + * '0da2b59ef118439d8097bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -85,7 +85,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.delete( - * '0da2b59e-f118-439d-8097-bdfb215203c9', + * '0da2b59ef118439d8097bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -105,7 +105,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.get( - * '0da2b59e-f118-439d-8097-bdfb215203c9', + * '0da2b59ef118439d8097bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -211,6 +211,7 @@ export interface Policy { * possible values. */ alert_type?: + | 'abuse_report_alert' | 'access_custom_certificate_expiration_type' | 'advanced_ddos_attack_l4_alert' | 'advanced_ddos_attack_l7_alert' @@ -520,6 +521,11 @@ export interface PolicyFilter { */ tunnel_name?: Array; + /** + * Usage depends on specific alert type + */ + type?: Array; + /** * Usage depends on specific alert type */ @@ -739,6 +745,11 @@ export interface PolicyFilterParam { */ tunnel_name?: Array; + /** + * Usage depends on specific alert type + */ + type?: Array; + /** * Usage depends on specific alert type */ @@ -825,6 +836,7 @@ export interface PolicyCreateParams { * possible values. */ alert_type: + | 'abuse_report_alert' | 'access_custom_certificate_expiration_type' | 'advanced_ddos_attack_l4_alert' | 'advanced_ddos_attack_l7_alert' @@ -946,6 +958,7 @@ export interface PolicyUpdateParams { * possible values. */ alert_type?: + | 'abuse_report_alert' | 'access_custom_certificate_expiration_type' | 'advanced_ddos_attack_l4_alert' | 'advanced_ddos_attack_l7_alert' diff --git a/src/resources/cloudforce-one/threat-events/index.ts b/src/resources/cloudforce-one/threat-events/index.ts index 02c8bab160..d797682ddd 100644 --- a/src/resources/cloudforce-one/threat-events/index.ts +++ b/src/resources/cloudforce-one/threat-events/index.ts @@ -36,11 +36,7 @@ export { type EventTagCreateParams, type EventTagDeleteParams, } from './event-tags'; -export { - IndicatorTypes, - type IndicatorTypeListResponse, - type IndicatorTypeListParams, -} from './indicator-types'; +export { IndicatorTypes } from './indicator-types'; export { Insights } from './insights'; export { Raw, type RawEditResponse, type RawGetResponse, type RawEditParams, type RawGetParams } from './raw'; export { Relate, type RelateDeleteResponse, type RelateDeleteParams } from './relate'; diff --git a/src/resources/cloudforce-one/threat-events/indicator-types.ts b/src/resources/cloudforce-one/threat-events/indicator-types.ts index 7fa1b77a16..99e5ccc453 100644 --- a/src/resources/cloudforce-one/threat-events/indicator-types.ts +++ b/src/resources/cloudforce-one/threat-events/indicator-types.ts @@ -1,51 +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 IndicatorTypes extends APIResource { - /** - * Lists all indicator types - * - * @example - * ```ts - * const indicatorTypes = - * await client.cloudforceOne.threatEvents.indicatorTypes.list( - * { account_id: 'account_id' }, - * ); - * ``` - */ - list( - params: IndicatorTypeListParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return this._client.get(`/accounts/${account_id}/cloudforce-one/events/indicatorTypes`, options); - } -} - -export interface IndicatorTypeListResponse { - items: IndicatorTypeListResponse.Items; - - type: string; -} - -export namespace IndicatorTypeListResponse { - export interface Items { - type: string; - } -} - -export interface IndicatorTypeListParams { - /** - * Account ID. - */ - account_id: string; -} - -export declare namespace IndicatorTypes { - export { - type IndicatorTypeListResponse as IndicatorTypeListResponse, - type IndicatorTypeListParams as IndicatorTypeListParams, - }; -} +export class IndicatorTypes 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 119f0b95d8..d23c37b5db 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -31,7 +31,7 @@ import { EventTags, } from './event-tags'; import * as IndicatorTypesAPI from './indicator-types'; -import { IndicatorTypeListParams, IndicatorTypeListResponse, IndicatorTypes } from './indicator-types'; +import { IndicatorTypes } from './indicator-types'; import * as InsightsAPI from './insights'; import { Insights } from './insights'; import * as RawAPI from './raw'; @@ -821,11 +821,7 @@ export declare namespace ThreatEvents { type DatasetRawParams as DatasetRawParams, }; - export { - IndicatorTypes as IndicatorTypes, - type IndicatorTypeListResponse as IndicatorTypeListResponse, - type IndicatorTypeListParams as IndicatorTypeListParams, - }; + export { IndicatorTypes as IndicatorTypes }; export { RawAPIRaw as Raw, diff --git a/src/resources/custom-pages.ts b/src/resources/custom-pages.ts index 6bd1b13cf7..4c861b1e41 100644 --- a/src/resources/custom-pages.ts +++ b/src/resources/custom-pages.ts @@ -24,13 +24,15 @@ export class CustomPages extends APIResource { */ update( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params: CustomPageUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { @@ -123,36 +125,42 @@ export class CustomPages extends APIResource { */ get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params?: CustomPageGetParams, options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params: CustomPageGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { diff --git a/src/resources/email-security/investigate/investigate.ts b/src/resources/email-security/investigate/investigate.ts index a15d9630ba..7093627a0f 100644 --- a/src/resources/email-security/investigate/investigate.ts +++ b/src/resources/email-security/investigate/investigate.ts @@ -199,10 +199,33 @@ export namespace InvestigateListResponse { } export interface Finding { + attachment?: string | null; + detail?: string | null; + detection?: + | 'MALICIOUS' + | 'MALICIOUS-BEC' + | 'SUSPICIOUS' + | 'SPOOF' + | 'SPAM' + | 'BULK' + | 'ENCRYPTED' + | 'EXTERNAL' + | 'UNKNOWN' + | 'NONE' + | null; + + field?: string | null; + name?: string | null; + portion?: string | null; + + reason?: string | null; + + score?: number | null; + value?: string | null; } @@ -321,10 +344,33 @@ export namespace InvestigateGetResponse { } export interface Finding { + attachment?: string | null; + detail?: string | null; + detection?: + | 'MALICIOUS' + | 'MALICIOUS-BEC' + | 'SUSPICIOUS' + | 'SPOOF' + | 'SPAM' + | 'BULK' + | 'ENCRYPTED' + | 'EXTERNAL' + | 'UNKNOWN' + | 'NONE' + | null; + + field?: string | null; + name?: string | null; + portion?: string | null; + + reason?: string | null; + + score?: number | null; + value?: string | null; } 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 c581632a76..f8b3034d84 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 138942ad57..a4db89243d 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. @@ -120,12 +99,12 @@ export interface Key { /** * Arbitrary JSON that is associated with a key. */ - metadata?: unknown; + metadata?: { [key: string]: unknown }; } export interface KeyBulkDeleteResponse { /** - * Number of keys successfully updated. + * Number of keys successfully updated */ successful_key_count?: number; @@ -135,49 +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 { - /** - * The metadata associated with the key. - */ - metadata: unknown; - - /** - * The value associated with the key. - */ - 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; @@ -189,27 +128,26 @@ export interface KeyBulkUpdateResponse { export interface KeyListParams extends CursorPaginationAfterParams { /** - * Path param: Identifier. + * 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. + * Query param: The number of keys to return. 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. + * 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; @@ -219,31 +157,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; @@ -256,38 +172,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 }; /** - * Arbitrary JSON that is associated with a key. + * A UTF-8 encoded string to be stored, up to 25 MiB in length. */ - metadata?: unknown; + value?: string; } } @@ -297,12 +214,10 @@ export declare namespace Keys { export { type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, - type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorPaginationAfter as KeysCursorPaginationAfter, 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 927ba8a17d..5e16f872e9 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -37,11 +37,11 @@ export class Metadata extends APIResource { /** * Arbitrary JSON that is associated with a key. */ -export type MetadataGetResponse = unknown; +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 df179e53bb..3ec43aa7c5 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: [{}], * }, * ); * ``` @@ -272,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; @@ -286,49 +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 { - /** - * The metadata associated with the key. - */ - metadata: unknown; - - /** - * The value associated with the key. - */ - 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; @@ -340,7 +270,7 @@ export interface NamespaceBulkUpdateResponse { export interface NamespaceCreateParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -352,7 +282,7 @@ export interface NamespaceCreateParams { export interface NamespaceUpdateParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -364,7 +294,7 @@ export interface NamespaceUpdateParams { export interface NamespaceListParams extends V4PagePaginationArrayParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -381,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; @@ -398,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; @@ -435,44 +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 }; /** - * Arbitrary JSON that is associated with a key. + * A UTF-8 encoded string to be stored, up to 25 MiB in length. */ - metadata?: unknown; + value?: string; } } export interface NamespaceGetParams { /** - * Identifier. + * Identifier */ account_id: string; } @@ -481,14 +390,14 @@ Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; Namespaces.Keys = Keys; Namespaces.KeysCursorPaginationAfter = KeysCursorPaginationAfter; 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, @@ -496,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, }; @@ -505,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, KeysCursorPaginationAfter as KeysCursorPaginationAfter, type KeyListParams as KeyListParams, type KeyBulkDeleteParams as KeyBulkDeleteParams, - type KeyBulkGetParams as KeyBulkGetParams, type KeyBulkUpdateParams as KeyBulkUpdateParams, }; @@ -521,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 49566f425a..1fa5ff39ed 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,8 +38,13 @@ 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, - __multipartSyntax: 'json', ...options }), + Core.maybeMultipartFormRequestOptions({ + query: { expiration, expiration_ttl }, + body, + __multipartSyntax: 'json', + ...options, + headers: { 'Content-Type': '*/*', ...options?.headers }, + }), ) as Core.APIPromise<{ result: ValueUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } @@ -114,42 +120,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: Associates arbitrary JSON data with a key/value pair. - */ - metadata?: unknown; } export interface ValueDeleteParams { /** - * Identifier. + * Identifier */ account_id: string; } export interface ValueGetParams { /** - * Identifier. + * Identifier */ account_id: string; } diff --git a/src/resources/leaked-credential-checks/detections.ts b/src/resources/leaked-credential-checks/detections.ts index ca2e008bd9..2a6de390ad 100644 --- a/src/resources/leaked-credential-checks/detections.ts +++ b/src/resources/leaked-credential-checks/detections.ts @@ -1,243 +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 Detections extends APIResource { - /** - * Create user-defined detection pattern for Leaked Credential Checks. - * - * @example - * ```ts - * const detection = - * await client.leakedCredentialChecks.detections.create({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - create( - params: DetectionCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.post(`/zones/${zone_id}/leaked-credential-checks/detections`, { - body, - ...options, - }) as Core.APIPromise<{ result: DetectionCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Update user-defined detection pattern for Leaked Credential Checks. - * - * @example - * ```ts - * const detection = - * await client.leakedCredentialChecks.detections.update( - * '18a14bafaa8eb1df04ce683ec18c765e', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - update( - detectionId: string, - params: DetectionUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.put(`/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: DetectionUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * List user-defined detection patterns for Leaked Credential Checks. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const detectionListResponse of client.leakedCredentialChecks.detections.list( - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` - */ - list( - params: DetectionListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { zone_id } = params; - return this._client.getAPIList( - `/zones/${zone_id}/leaked-credential-checks/detections`, - DetectionListResponsesSinglePage, - options, - ); - } - - /** - * Remove user-defined detection pattern for Leaked Credential Checks. - * - * @example - * ```ts - * const detection = - * await client.leakedCredentialChecks.detections.delete( - * '18a14bafaa8eb1df04ce683ec18c765e', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - delete( - detectionId: string, - params: DetectionDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id } = params; - return ( - this._client.delete( - `/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, - options, - ) as Core.APIPromise<{ result: DetectionDeleteResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export class DetectionListResponsesSinglePage extends SinglePage {} - -/** - * Defines a custom set of username/password expressions to match Leaked Credential - * Checks on. - */ -export interface DetectionCreateResponse { - /** - * Defines the unique ID for this custom detection. - */ - id?: string; - - /** - * Defines ehe ruleset expression to use in matching the password in a request. - */ - password?: string; - - /** - * Defines the ruleset expression to use in matching the username in a request. - */ - username?: string; -} - -/** - * Defines a custom set of username/password expressions to match Leaked Credential - * Checks on. - */ -export interface DetectionUpdateResponse { - /** - * Defines the unique ID for this custom detection. - */ - id?: string; - - /** - * Defines ehe ruleset expression to use in matching the password in a request. - */ - password?: string; - - /** - * Defines the ruleset expression to use in matching the username in a request. - */ - username?: string; -} - -/** - * Defines a custom set of username/password expressions to match Leaked Credential - * Checks on. - */ -export interface DetectionListResponse { - /** - * Defines the unique ID for this custom detection. - */ - id?: string; - - /** - * Defines ehe ruleset expression to use in matching the password in a request. - */ - password?: string; - - /** - * Defines the ruleset expression to use in matching the username in a request. - */ - username?: string; -} - -export type DetectionDeleteResponse = unknown; - -export interface DetectionCreateParams { - /** - * Path param: Defines an identifier. - */ - zone_id: string; - - /** - * Body param: Defines ehe ruleset expression to use in matching the password in a - * request. - */ - password?: string; - - /** - * Body param: Defines the ruleset expression to use in matching the username in a - * request. - */ - username?: string; -} - -export interface DetectionUpdateParams { - /** - * Path param: Defines an identifier. - */ - zone_id: string; - - /** - * Body param: Defines ehe ruleset expression to use in matching the password in a - * request. - */ - password?: string; - - /** - * Body param: Defines the ruleset expression to use in matching the username in a - * request. - */ - username?: string; -} - -export interface DetectionListParams { - /** - * Defines an identifier. - */ - zone_id: string; -} - -export interface DetectionDeleteParams { - /** - * Defines an identifier. - */ - zone_id: string; -} - -Detections.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; - -export declare namespace Detections { - export { - type DetectionCreateResponse as DetectionCreateResponse, - type DetectionUpdateResponse as DetectionUpdateResponse, - type DetectionListResponse as DetectionListResponse, - type DetectionDeleteResponse as DetectionDeleteResponse, - DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, - type DetectionCreateParams as DetectionCreateParams, - type DetectionUpdateParams as DetectionUpdateParams, - type DetectionListParams as DetectionListParams, - type DetectionDeleteParams as DetectionDeleteParams, - }; -} +export class Detections extends APIResource {} diff --git a/src/resources/leaked-credential-checks/index.ts b/src/resources/leaked-credential-checks/index.ts index 1844848bf2..7e3e1a0dd7 100644 --- a/src/resources/leaked-credential-checks/index.ts +++ b/src/resources/leaked-credential-checks/index.ts @@ -1,15 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { - DetectionListResponsesSinglePage, - Detections, - type DetectionCreateResponse, - type DetectionUpdateResponse, - type DetectionListResponse, - type DetectionDeleteResponse, - type DetectionCreateParams, - type DetectionUpdateParams, - type DetectionListParams, - type DetectionDeleteParams, -} from './detections'; +export { Detections } from './detections'; export { LeakedCredentialChecks } from './leaked-credential-checks'; diff --git a/src/resources/leaked-credential-checks/leaked-credential-checks.ts b/src/resources/leaked-credential-checks/leaked-credential-checks.ts index d8d8de90c1..c89821160c 100644 --- a/src/resources/leaked-credential-checks/leaked-credential-checks.ts +++ b/src/resources/leaked-credential-checks/leaked-credential-checks.ts @@ -1,132 +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 DetectionsAPI from './detections'; -import { - DetectionCreateParams, - DetectionCreateResponse, - DetectionDeleteParams, - DetectionDeleteResponse, - DetectionListParams, - DetectionListResponse, - DetectionListResponsesSinglePage, - DetectionUpdateParams, - DetectionUpdateResponse, - Detections, -} from './detections'; +import { Detections } from './detections'; export class LeakedCredentialChecks extends APIResource { detections: DetectionsAPI.Detections = new DetectionsAPI.Detections(this._client); - - /** - * Updates the current status of Leaked Credential Checks. - * - * @example - * ```ts - * const leakedCredentialCheck = - * await client.leakedCredentialChecks.create({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - create( - params: LeakedCredentialCheckCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.post(`/zones/${zone_id}/leaked-credential-checks`, { - body, - ...options, - }) as Core.APIPromise<{ result: LeakedCredentialCheckCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the current status of Leaked Credential Checks. - * - * @example - * ```ts - * const leakedCredentialCheck = - * await client.leakedCredentialChecks.get({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - get( - params: LeakedCredentialCheckGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id } = params; - return ( - this._client.get(`/zones/${zone_id}/leaked-credential-checks`, options) as Core.APIPromise<{ - result: LeakedCredentialCheckGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -/** - * Defines the overall status for Leaked Credential Checks. - */ -export interface LeakedCredentialCheckCreateResponse { - /** - * Determines whether or not Leaked Credential Checks are enabled. - */ - enabled?: boolean; -} - -/** - * Defines the overall status for Leaked Credential Checks. - */ -export interface LeakedCredentialCheckGetResponse { - /** - * Determines whether or not Leaked Credential Checks are enabled. - */ - enabled?: boolean; -} - -export interface LeakedCredentialCheckCreateParams { - /** - * Path param: Defines an identifier. - */ - zone_id: string; - - /** - * Body param: Determines whether or not Leaked Credential Checks are enabled. - */ - enabled?: boolean; -} - -export interface LeakedCredentialCheckGetParams { - /** - * Defines an identifier. - */ - zone_id: string; } LeakedCredentialChecks.Detections = Detections; -LeakedCredentialChecks.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; export declare namespace LeakedCredentialChecks { - export { - type LeakedCredentialCheckCreateResponse as LeakedCredentialCheckCreateResponse, - type LeakedCredentialCheckGetResponse as LeakedCredentialCheckGetResponse, - type LeakedCredentialCheckCreateParams as LeakedCredentialCheckCreateParams, - type LeakedCredentialCheckGetParams as LeakedCredentialCheckGetParams, - }; - - export { - Detections as Detections, - type DetectionCreateResponse as DetectionCreateResponse, - type DetectionUpdateResponse as DetectionUpdateResponse, - type DetectionListResponse as DetectionListResponse, - type DetectionDeleteResponse as DetectionDeleteResponse, - DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, - type DetectionCreateParams as DetectionCreateParams, - type DetectionUpdateParams as DetectionUpdateParams, - type DetectionListParams as DetectionListParams, - type DetectionDeleteParams as DetectionDeleteParams, - }; + export { Detections as Detections }; } 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 6e40d6cfa9..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 5e289166d6..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 6f0ab3dbaa..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/organizations/organizations.ts b/src/resources/organizations/organizations.ts index ac7c354a5f..edc39aac94 100644 --- a/src/resources/organizations/organizations.ts +++ b/src/resources/organizations/organizations.ts @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; +import { isRequestOptions } from '../../core'; import * as Core from '../../core'; import * as OrganizationProfileAPI from './organization-profile'; import { @@ -8,6 +9,7 @@ import { OrganizationProfileResource, OrganizationProfileUpdateParams, } from './organization-profile'; +import { SinglePage } from '../../pagination'; export class Organizations extends APIResource { organizationProfile: OrganizationProfileAPI.OrganizationProfileResource = @@ -37,6 +39,24 @@ export class Organizations extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Retrieve a list of organizations a particular user has access to. + */ + list( + query?: OrganizationListParams, + options?: Core.RequestOptions, + ): Core.PagePromise; + list(options?: Core.RequestOptions): Core.PagePromise; + list( + query: OrganizationListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.PagePromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return this._client.getAPIList('/organizations', OrganizationsSinglePage, { query, ...options }); + } + /** * Delete an organization. The organization MUST be empty before deleting. It must * not contain any sub-organizations, accounts, members or users. @@ -60,8 +80,10 @@ export class Organizations extends APIResource { } } +export class OrganizationsSinglePage extends SinglePage {} + /** - * Represents an Organization in the Cloudflare data model + * References an Organization in the Cloudflare data model. */ export interface Organization { id: string; @@ -80,7 +102,7 @@ export interface Organization { export namespace Organization { export interface Meta { /** - * Organization flags for feature enablement + * Enable features for Organizations. */ flags?: Meta.Flags; @@ -91,7 +113,7 @@ export namespace Organization { export namespace Meta { /** - * Organization flags for feature enablement + * Enable features for Organizations. */ export interface Flags { account_creation: string; @@ -177,13 +199,101 @@ export namespace OrganizationUpdateParams { } } +export interface OrganizationListParams { + /** + * Only return organizations with the specified IDs (ex. id=foo&id=bar). Send + * multiple elements by repeating the query value. + */ + id?: Array; + + containing?: OrganizationListParams.Containing; + + name?: OrganizationListParams.Name; + + /** + * The amount of items to return. Defaults to 10. + */ + page_size?: number; + + /** + * An opaque token returned from the last list response that when provided will + * retrieve the next page. + * + * Parameters used to filter the retrieved list must remain in subsequent requests + * with a page token. + */ + page_token?: string; + + parent?: OrganizationListParams.Parent; +} + +export namespace OrganizationListParams { + export interface Containing { + /** + * Filter the list of organizations to the ones that contain this particular + * account. + */ + account?: string; + + /** + * Filter the list of organizations to the ones that contain this particular + * organization. + */ + organization?: string; + + /** + * Filter the list of organizations to the ones that contain this particular user. + * + * IMPORTANT: Just because an organization "contains" a user is not a + * representation of any authorization or privilege to manage any resources + * therein. An organization "containing" a user simply means the user is managed by + * that organization. + */ + user?: string; + } + + export interface Name { + /** + * (case-insensitive) Filter the list of organizations to where the name contains a + * particular string. + */ + contains?: string; + + /** + * (case-insensitive) Filter the list of organizations to where the name ends with + * a particular string. + */ + endsWith?: string; + + /** + * (case-insensitive) Filter the list of organizations to where the name starts + * with a particular string. + */ + startsWith?: string; + } + + export interface Parent { + /** + * Filter the list of organizations to the ones that are a sub-organization of the + * specified organization. + * + * "null" is a valid value to provide for this parameter. It means "where an + * organization has no parent (i.e. it is a 'root' organization)." + */ + id?: (string & {}) | 'null'; + } +} + +Organizations.OrganizationsSinglePage = OrganizationsSinglePage; Organizations.OrganizationProfileResource = OrganizationProfileResource; export declare namespace Organizations { export { type Organization as Organization, + OrganizationsSinglePage as OrganizationsSinglePage, type OrganizationCreateParams as OrganizationCreateParams, type OrganizationUpdateParams as OrganizationUpdateParams, + type OrganizationListParams as OrganizationListParams, }; export { diff --git a/src/resources/pages/index.ts b/src/resources/pages/index.ts index 2b2862b5c1..ede14daf73 100644 --- a/src/resources/pages/index.ts +++ b/src/resources/pages/index.ts @@ -2,6 +2,7 @@ export { DeploymentsSinglePage, + DeploymentsV4PagePaginationArray, Projects, type Deployment, type Project, diff --git a/src/resources/pages/pages.ts b/src/resources/pages/pages.ts index e92779690f..e0331f786f 100644 --- a/src/resources/pages/pages.ts +++ b/src/resources/pages/pages.ts @@ -4,7 +4,7 @@ import { APIResource } from '../../resource'; import * as ProjectsAPI from './projects/projects'; import { Deployment, - DeploymentsSinglePage, + DeploymentsV4PagePaginationArray, Project, ProjectCreateParams, ProjectDeleteParams, @@ -23,7 +23,7 @@ export class Pages extends APIResource { } Pages.Projects = Projects; -Pages.DeploymentsSinglePage = DeploymentsSinglePage; +Pages.DeploymentsV4PagePaginationArray = DeploymentsV4PagePaginationArray; export declare namespace Pages { export { @@ -33,7 +33,7 @@ export declare namespace Pages { type Stage as Stage, type ProjectDeleteResponse as ProjectDeleteResponse, type ProjectPurgeBuildCacheResponse as ProjectPurgeBuildCacheResponse, - DeploymentsSinglePage as DeploymentsSinglePage, + DeploymentsV4PagePaginationArray as DeploymentsV4PagePaginationArray, type ProjectCreateParams as ProjectCreateParams, type ProjectListParams as ProjectListParams, type ProjectDeleteParams as ProjectDeleteParams, diff --git a/src/resources/pages/projects/deployments/deployments.ts b/src/resources/pages/projects/deployments/deployments.ts index 97b2b41db9..e1a307e7bf 100644 --- a/src/resources/pages/projects/deployments/deployments.ts +++ b/src/resources/pages/projects/deployments/deployments.ts @@ -192,11 +192,77 @@ export interface DeploymentCreateParams { */ account_id: string; + /** + * Body param: Headers configuration file for the deployment. + */ + _headers?: Core.Uploadable; + + /** + * Body param: Redirects configuration file for the deployment. + */ + _redirects?: Core.Uploadable; + + /** + * Body param: Routes configuration file defining routing rules. + */ + '_routes.json'?: Core.Uploadable; + + /** + * Body param: Worker bundle file in multipart/form-data format. Mutually exclusive + * with `_worker.js`. Cannot specify both `_worker.js` and `_worker.bundle` in the + * same request. Maximum size: 25 MiB. + */ + '_worker.bundle'?: Core.Uploadable; + + /** + * Body param: Worker JavaScript file. Mutually exclusive with `_worker.bundle`. + * Cannot specify both `_worker.js` and `_worker.bundle` in the same request. + */ + '_worker.js'?: Core.Uploadable; + /** * Body param: The branch to build the new deployment from. The `HEAD` of the * branch will be used. If omitted, the production branch will be used by default. */ branch?: string; + + /** + * Body param: Boolean string indicating if the working directory has uncommitted + * changes. + */ + commit_dirty?: 'true' | 'false'; + + /** + * Body param: Git commit SHA associated with this deployment. + */ + commit_hash?: string; + + /** + * Body param: Git commit message associated with this deployment. + */ + commit_message?: string; + + /** + * Body param: Functions routing configuration file. + */ + 'functions-filepath-routing-config.json'?: Core.Uploadable; + + /** + * Body param: JSON string containing a manifest of files to deploy. Maps file + * paths to their content hashes. Required for direct upload deployments. Maximum + * 20,000 entries. + */ + manifest?: string; + + /** + * Body param: The build output directory path. + */ + pages_build_output_dir?: string; + + /** + * Body param: Hash of the Wrangler configuration file used for this deployment. + */ + wrangler_config_hash?: string; } export interface DeploymentListParams { diff --git a/src/resources/pages/projects/index.ts b/src/resources/pages/projects/index.ts index a40f121ec5..867a3f7b6b 100644 --- a/src/resources/pages/projects/index.ts +++ b/src/resources/pages/projects/index.ts @@ -12,6 +12,7 @@ export { } from './deployments/index'; export { DeploymentsSinglePage, + DeploymentsV4PagePaginationArray, Projects, type Deployment, type Project, diff --git a/src/resources/pages/projects/projects.ts b/src/resources/pages/projects/projects.ts index 01225591dc..f14c2e99bf 100644 --- a/src/resources/pages/projects/projects.ts +++ b/src/resources/pages/projects/projects.ts @@ -28,7 +28,7 @@ import { DeploymentRollbackParams, Deployments, } from './deployments/deployments'; -import { SinglePage } from '../../../pagination'; +import { SinglePage, V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; export class Projects extends APIResource { deployments: DeploymentsAPI.Deployments = new DeploymentsAPI.Deployments(this._client); @@ -41,6 +41,8 @@ export class Projects extends APIResource { * ```ts * const project = await client.pages.projects.create({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * name: 'my-pages-app', + * production_branch: 'main', * }); * ``` */ @@ -69,9 +71,13 @@ export class Projects extends APIResource { list( params: ProjectListParams, options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id } = params; - return this._client.getAPIList(`/accounts/${account_id}/pages/projects`, DeploymentsSinglePage, options); + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/pages/projects`, + DeploymentsV4PagePaginationArray, + { query, ...options }, + ); } /** @@ -107,7 +113,11 @@ export class Projects extends APIResource { * ```ts * const project = await client.pages.projects.edit( * 'this-is-my-project-01', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * name: 'my-pages-app', + * production_branch: 'main', + * }, * ); * ``` */ @@ -176,6 +186,8 @@ export class Projects extends APIResource { } } +export class DeploymentsV4PagePaginationArray extends V4PagePaginationArray {} + export class DeploymentsSinglePage extends SinglePage {} export interface Deployment { @@ -209,7 +221,7 @@ export interface Deployment { */ env_vars?: { [key: string]: Deployment.PagesPlainTextEnvVar | null | Deployment.PagesSecretTextEnvVar | null; - }; + } | null; /** * Type of deploy. @@ -359,31 +371,74 @@ export namespace Deployment { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } @@ -391,17 +446,27 @@ export namespace Deployment { export interface Project { /** - * Id of the project. + * ID of the project. */ - id?: string; + id: string; + + /** + * Name of the project. + */ + name: string; + + /** + * Production branch of the project. Used to identify production deployments. + */ + production_branch: string; /** * Configs for the project build process. */ - build_config?: Project.BuildConfig; + build_config?: Project.BuildConfig | null; /** - * Most recent deployment to the repo. + * Most recent production deployment of the project. */ canonical_deployment?: Deployment | null; @@ -413,7 +478,7 @@ export interface Project { /** * Configs for deployments in a project. */ - deployment_configs?: Project.DeploymentConfigs; + deployment_configs?: Project.DeploymentConfigs | null; /** * A list of associated custom domains for the project. @@ -421,19 +486,29 @@ export interface Project { domains?: Array; /** - * Most recent deployment to the repo. + * Framework the project is using. + */ + framework?: string; + + /** + * Version of the framework the project is using. + */ + framework_version?: string; + + /** + * Most recent deployment of the project. */ latest_deployment?: Deployment | null; /** - * Name of the project. + * Name of the preview script. */ - name?: string; + preview_script_name?: string; /** - * Production branch of the project. Used to identify production deployments. + * Name of the production script. */ - production_branch?: string; + production_script_name?: string; source?: Project.Source; @@ -441,6 +516,11 @@ export interface Project { * The Cloudflare subdomain associated with the project. */ subdomain?: string; + + /** + * Whether the project uses functions. + */ + uses_functions?: boolean; } export namespace Project { @@ -486,12 +566,12 @@ export namespace Project { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview; + preview?: DeploymentConfigs.Preview | null; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production; + production?: DeploymentConfigs.Production | null; } export namespace DeploymentConfigs { @@ -504,6 +584,11 @@ export namespace Project { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -514,6 +599,11 @@ export namespace Project { */ browsers?: { [key: string]: Preview.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -522,7 +612,7 @@ export namespace Project { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -539,7 +629,12 @@ export namespace Project { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -551,6 +646,11 @@ export namespace Project { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Preview.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -576,10 +676,20 @@ export namespace Project { */ services?: { [key: string]: Preview.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Preview { @@ -666,6 +776,16 @@ export namespace Project { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -745,6 +865,11 @@ export namespace Project { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -755,6 +880,11 @@ export namespace Project { */ browsers?: { [key: string]: Production.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -763,7 +893,7 @@ export namespace Project { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -780,7 +910,12 @@ export namespace Project { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -792,6 +927,11 @@ export namespace Project { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Production.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -817,10 +957,20 @@ export namespace Project { */ services?: { [key: string]: Production.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Production { @@ -907,6 +1057,16 @@ export namespace Project { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -981,31 +1141,74 @@ export namespace Project { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } @@ -1047,25 +1250,25 @@ export interface ProjectCreateParams { account_id: string; /** - * Body param: Configs for the project build process. + * Body param: Name of the project. */ - build_config?: ProjectCreateParams.BuildConfig; + name: string; /** - * Body param: Configs for deployments in a project. + * Body param: Production branch of the project. Used to identify production + * deployments. */ - deployment_configs?: ProjectCreateParams.DeploymentConfigs; + production_branch: string; /** - * Body param: Name of the project. + * Body param: Configs for the project build process. */ - name?: string; + build_config?: ProjectCreateParams.BuildConfig | null; /** - * Body param: Production branch of the project. Used to identify production - * deployments. + * Body param: Configs for deployments in a project. */ - production_branch?: string; + deployment_configs?: ProjectCreateParams.DeploymentConfigs | null; /** * Body param: @@ -1116,12 +1319,12 @@ export namespace ProjectCreateParams { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview; + preview?: DeploymentConfigs.Preview | null; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production; + production?: DeploymentConfigs.Production | null; } export namespace DeploymentConfigs { @@ -1134,6 +1337,11 @@ export namespace ProjectCreateParams { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -1144,6 +1352,11 @@ export namespace ProjectCreateParams { */ browsers?: { [key: string]: Preview.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -1152,7 +1365,7 @@ export namespace ProjectCreateParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -1169,7 +1382,12 @@ export namespace ProjectCreateParams { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -1181,6 +1399,11 @@ export namespace ProjectCreateParams { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Preview.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -1206,10 +1429,20 @@ export namespace ProjectCreateParams { */ services?: { [key: string]: Preview.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Preview { @@ -1296,6 +1529,16 @@ export namespace ProjectCreateParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -1375,6 +1618,11 @@ export namespace ProjectCreateParams { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -1385,6 +1633,11 @@ export namespace ProjectCreateParams { */ browsers?: { [key: string]: Production.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -1393,7 +1646,7 @@ export namespace ProjectCreateParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -1410,7 +1663,12 @@ export namespace ProjectCreateParams { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -1422,6 +1680,11 @@ export namespace ProjectCreateParams { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Production.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -1447,10 +1710,20 @@ export namespace ProjectCreateParams { */ services?: { [key: string]: Production.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Production { @@ -1537,6 +1810,16 @@ export namespace ProjectCreateParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -1611,39 +1894,82 @@ export namespace ProjectCreateParams { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } } -export interface ProjectListParams { +export interface ProjectListParams extends V4PagePaginationArrayParams { /** - * Identifier + * Path param: Identifier */ account_id: string; } @@ -1662,25 +1988,25 @@ export interface ProjectEditParams { account_id: string; /** - * Body param: Configs for the project build process. + * Body param: Name of the project. */ - build_config?: ProjectEditParams.BuildConfig; + name: string; /** - * Body param: Configs for deployments in a project. + * Body param: Production branch of the project. Used to identify production + * deployments. */ - deployment_configs?: ProjectEditParams.DeploymentConfigs; + production_branch: string; /** - * Body param: Name of the project. + * Body param: Configs for the project build process. */ - name?: string; + build_config?: ProjectEditParams.BuildConfig | null; /** - * Body param: Production branch of the project. Used to identify production - * deployments. + * Body param: Configs for deployments in a project. */ - production_branch?: string; + deployment_configs?: ProjectEditParams.DeploymentConfigs | null; /** * Body param: @@ -1731,12 +2057,12 @@ export namespace ProjectEditParams { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview; + preview?: DeploymentConfigs.Preview | null; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production; + production?: DeploymentConfigs.Production | null; } export namespace DeploymentConfigs { @@ -1749,6 +2075,11 @@ export namespace ProjectEditParams { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -1759,6 +2090,11 @@ export namespace ProjectEditParams { */ browsers?: { [key: string]: Preview.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -1767,7 +2103,7 @@ export namespace ProjectEditParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -1784,7 +2120,12 @@ export namespace ProjectEditParams { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -1796,6 +2137,11 @@ export namespace ProjectEditParams { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Preview.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -1821,10 +2167,20 @@ export namespace ProjectEditParams { */ services?: { [key: string]: Preview.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Preview { @@ -1911,6 +2267,16 @@ export namespace ProjectEditParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -1990,6 +2356,11 @@ export namespace ProjectEditParams { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -2000,6 +2371,11 @@ export namespace ProjectEditParams { */ browsers?: { [key: string]: Production.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -2008,7 +2384,7 @@ export namespace ProjectEditParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -2025,7 +2401,12 @@ export namespace ProjectEditParams { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -2037,6 +2418,11 @@ export namespace ProjectEditParams { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Production.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -2062,10 +2448,20 @@ export namespace ProjectEditParams { */ services?: { [key: string]: Production.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Production { @@ -2152,6 +2548,16 @@ export namespace ProjectEditParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -2226,31 +2632,74 @@ export namespace ProjectEditParams { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } @@ -2270,7 +2719,7 @@ export interface ProjectPurgeBuildCacheParams { account_id: string; } -Projects.DeploymentsSinglePage = DeploymentsSinglePage; +Projects.DeploymentsV4PagePaginationArray = DeploymentsV4PagePaginationArray; Projects.Deployments = Deployments; Projects.Domains = Domains; Projects.DomainListResponsesSinglePage = DomainListResponsesSinglePage; @@ -2282,7 +2731,7 @@ export declare namespace Projects { type Stage as Stage, type ProjectDeleteResponse as ProjectDeleteResponse, type ProjectPurgeBuildCacheResponse as ProjectPurgeBuildCacheResponse, - DeploymentsSinglePage as DeploymentsSinglePage, + DeploymentsV4PagePaginationArray as DeploymentsV4PagePaginationArray, type ProjectCreateParams as ProjectCreateParams, type ProjectListParams as ProjectListParams, type ProjectDeleteParams as ProjectDeleteParams, diff --git a/src/resources/pipelines.ts b/src/resources/pipelines.ts index 02e40368e4..cfc4b0add9 100644 --- a/src/resources/pipelines.ts +++ b/src/resources/pipelines.ts @@ -5,29 +5,10 @@ import * as Core from '../core'; export class Pipelines extends APIResource { /** - * Create a new pipeline. + * [DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint + * instead. * - * @example - * ```ts - * const pipeline = await client.pipelines.create({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * destination: { - * batch: {}, - * compression: {}, - * credentials: { - * access_key_id: '', - * endpoint: - * 'https://123f8a8258064ed892a347f173372359.r2.cloudflarestorage.com', - * secret_access_key: '', - * }, - * format: 'json', - * path: { bucket: 'bucket' }, - * type: 'r2', - * }, - * name: 'sample_pipeline', - * source: [{ format: 'json', type: 'type' }], - * }); - * ``` + * @deprecated */ create( params: PipelineCreateParams, @@ -42,26 +23,10 @@ export class Pipelines extends APIResource { } /** - * Update an existing pipeline. + * [DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines + * endpoint instead. * - * @example - * ```ts - * const pipeline = await client.pipelines.update( - * 'sample_pipeline', - * { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * destination: { - * batch: {}, - * compression: {}, - * format: 'json', - * path: { bucket: 'bucket' }, - * type: 'r2', - * }, - * name: 'sample_pipeline', - * source: [{ format: 'json', type: 'type' }], - * }, - * ); - * ``` + * @deprecated */ update( pipelineName: string, @@ -78,14 +43,10 @@ export class Pipelines extends APIResource { } /** - * List, filter, and paginate pipelines in an account. + * [DEPRECATED] List, filter, and paginate pipelines in an account. Use the new + * /pipelines/v1/pipelines endpoint instead. * - * @example - * ```ts - * const pipelines = await client.pipelines.list({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` + * @deprecated */ list(params: PipelineListParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...query } = params; @@ -93,14 +54,10 @@ export class Pipelines extends APIResource { } /** - * Delete a pipeline. + * [DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint + * instead. * - * @example - * ```ts - * await client.pipelines.delete('sample_pipeline', { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` + * @deprecated */ delete( pipelineName: string, @@ -115,15 +72,10 @@ export class Pipelines extends APIResource { } /** - * Get configuration of a pipeline. + * [DEPRECATED] Get configuration of a pipeline. Use the new + * /pipelines/v1/pipelines endpoint instead. * - * @example - * ```ts - * const pipeline = await client.pipelines.get( - * 'sample_pipeline', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` + * @deprecated */ get( pipelineName: string, @@ -140,7 +92,8 @@ export class Pipelines extends APIResource { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface PipelineCreateResponse { /** @@ -238,6 +191,10 @@ export namespace PipelineCreateResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -263,6 +220,10 @@ export namespace PipelineCreateResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -274,7 +235,8 @@ export namespace PipelineCreateResponse { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface PipelineUpdateResponse { /** @@ -372,6 +334,10 @@ export namespace PipelineUpdateResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -397,6 +363,10 @@ export namespace PipelineUpdateResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -442,7 +412,8 @@ export namespace PipelineListResponse { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface Result { /** @@ -540,6 +511,10 @@ export namespace PipelineListResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -565,6 +540,10 @@ export namespace PipelineListResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -577,7 +556,8 @@ export namespace PipelineListResponse { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface PipelineGetResponse { /** @@ -675,6 +655,10 @@ export namespace PipelineGetResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -700,6 +684,10 @@ export namespace PipelineGetResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -821,6 +809,10 @@ export namespace PipelineCreateParams { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -846,6 +838,10 @@ export namespace PipelineCreateParams { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -967,6 +963,10 @@ export namespace PipelineUpdateParams { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -992,6 +992,10 @@ export namespace PipelineUpdateParams { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. diff --git a/src/resources/queues/consumers.ts b/src/resources/queues/consumers.ts index 43eae71410..93596e00ee 100644 --- a/src/resources/queues/consumers.ts +++ b/src/resources/queues/consumers.ts @@ -106,33 +106,6 @@ export class Consumers extends APIResource { const { account_id } = params; return this._client.delete(`/accounts/${account_id}/queues/${queueId}/consumers/${consumerId}`, options); } - - /** - * Fetches the consumer for a queue by consumer id - * - * @example - * ```ts - * const consumer = await client.queues.consumers.get( - * '023e105f4ecef8ad9ca31a8372d0c353', - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - get( - queueId: string, - consumerId: string, - params: ConsumerGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - 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); - } } export class ConsumersSinglePage extends SinglePage {} @@ -491,13 +464,6 @@ export interface ConsumerDeleteParams { account_id: string; } -export interface ConsumerGetParams { - /** - * A Resource identifier. - */ - account_id: string; -} - Consumers.ConsumersSinglePage = ConsumersSinglePage; export declare namespace Consumers { @@ -509,6 +475,5 @@ export declare namespace Consumers { 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 ebf2923861..32568cd469 100644 --- a/src/resources/queues/index.ts +++ b/src/resources/queues/index.ts @@ -9,30 +9,15 @@ export { type ConsumerUpdateParams, type ConsumerListParams, type ConsumerDeleteParams, - 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'; -export { - SubscriptionListResponsesV4PagePaginationArray, - Subscriptions, - type SubscriptionCreateResponse, - type SubscriptionUpdateResponse, - type SubscriptionListResponse, - type SubscriptionDeleteResponse, - type SubscriptionCreateParams, - type SubscriptionUpdateParams, - type SubscriptionListParams, - type SubscriptionDeleteParams, -} from './subscriptions'; +export { Subscriptions } from './subscriptions'; 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 667ab7a44a..15d1651711 100644 --- a/src/resources/queues/queues.ts +++ b/src/resources/queues/queues.ts @@ -9,7 +9,6 @@ import { ConsumerCreateParams, ConsumerDeleteParams, ConsumerDeleteResponse, - ConsumerGetParams, ConsumerListParams, ConsumerUpdateParams, Consumers, @@ -19,29 +18,15 @@ import * as MessagesAPI from './messages'; import { MessageAckParams, MessageAckResponse, - MessageBulkPushParams, - MessageBulkPushResponse, MessagePullParams, MessagePullResponse, - MessagePushParams, - MessagePushResponse, + MessagePullResponsesSinglePage, Messages, } from './messages'; import * as PurgeAPI from './purge'; import { Purge, PurgeStartParams, PurgeStatusParams, PurgeStatusResponse } from './purge'; import * as SubscriptionsAPI from './subscriptions'; -import { - SubscriptionCreateParams, - SubscriptionCreateResponse, - SubscriptionDeleteParams, - SubscriptionDeleteResponse, - SubscriptionListParams, - SubscriptionListResponse, - SubscriptionListResponsesV4PagePaginationArray, - SubscriptionUpdateParams, - SubscriptionUpdateResponse, - Subscriptions, -} from './subscriptions'; +import { Subscriptions } from './subscriptions'; import { SinglePage } from '../../pagination'; export class Queues extends APIResource { @@ -343,11 +328,11 @@ export interface QueueGetParams { Queues.QueuesSinglePage = QueuesSinglePage; Queues.Messages = Messages; +Queues.MessagePullResponsesSinglePage = MessagePullResponsesSinglePage; Queues.Purge = Purge; Queues.Consumers = Consumers; Queues.ConsumersSinglePage = ConsumersSinglePage; Queues.Subscriptions = Subscriptions; -Queues.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; export declare namespace Queues { export { @@ -365,13 +350,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 { @@ -390,19 +372,7 @@ export declare namespace Queues { type ConsumerUpdateParams as ConsumerUpdateParams, type ConsumerListParams as ConsumerListParams, type ConsumerDeleteParams as ConsumerDeleteParams, - type ConsumerGetParams as ConsumerGetParams, }; - export { - Subscriptions as Subscriptions, - type SubscriptionCreateResponse as SubscriptionCreateResponse, - type SubscriptionUpdateResponse as SubscriptionUpdateResponse, - type SubscriptionListResponse as SubscriptionListResponse, - type SubscriptionDeleteResponse as SubscriptionDeleteResponse, - SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, - type SubscriptionCreateParams as SubscriptionCreateParams, - type SubscriptionUpdateParams as SubscriptionUpdateParams, - type SubscriptionListParams as SubscriptionListParams, - type SubscriptionDeleteParams as SubscriptionDeleteParams, - }; + export { Subscriptions as Subscriptions }; } diff --git a/src/resources/queues/subscriptions.ts b/src/resources/queues/subscriptions.ts index 3bb405e3fc..42d6ea9ea6 100644 --- a/src/resources/queues/subscriptions.ts +++ b/src/resources/queues/subscriptions.ts @@ -1,874 +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 Subscriptions extends APIResource { - /** - * Create a new event subscription for a queue - * - * @example - * ```ts - * const subscription = - * await client.queues.subscriptions.create({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - create( - params: SubscriptionCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/event_subscriptions/subscriptions`, { - body, - ...options, - }) as Core.APIPromise<{ result: SubscriptionCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Update an existing event subscription - * - * @example - * ```ts - * const subscription = - * await client.queues.subscriptions.update( - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - update( - subscriptionId: string, - params: SubscriptionUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.patch(`/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: SubscriptionUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Get a paginated list of event subscriptions with optional sorting and filtering - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const subscriptionListResponse of client.queues.subscriptions.list( - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` - */ - list( - params: SubscriptionListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id, ...query } = params; - return this._client.getAPIList( - `/accounts/${account_id}/event_subscriptions/subscriptions`, - SubscriptionListResponsesV4PagePaginationArray, - { query, ...options }, - ); - } - - /** - * Delete an existing event subscription - * - * @example - * ```ts - * const subscription = - * await client.queues.subscriptions.delete( - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - delete( - subscriptionId: string, - params: SubscriptionDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.delete( - `/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, - options, - ) as Core.APIPromise<{ result: SubscriptionDeleteResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export class SubscriptionListResponsesV4PagePaginationArray extends V4PagePaginationArray {} - -export interface SubscriptionCreateResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionCreateResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionCreateResponse.MqEventSourceImages - | SubscriptionCreateResponse.MqEventSourceKV - | SubscriptionCreateResponse.MqEventSourceR2 - | SubscriptionCreateResponse.MqEventSourceSuperSlurper - | SubscriptionCreateResponse.MqEventSourceVectorize - | SubscriptionCreateResponse.MqEventSourceWorkersAIModel - | SubscriptionCreateResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionCreateResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionCreateResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionUpdateResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionUpdateResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionUpdateResponse.MqEventSourceImages - | SubscriptionUpdateResponse.MqEventSourceKV - | SubscriptionUpdateResponse.MqEventSourceR2 - | SubscriptionUpdateResponse.MqEventSourceSuperSlurper - | SubscriptionUpdateResponse.MqEventSourceVectorize - | SubscriptionUpdateResponse.MqEventSourceWorkersAIModel - | SubscriptionUpdateResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionUpdateResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionUpdateResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionListResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionListResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionListResponse.MqEventSourceImages - | SubscriptionListResponse.MqEventSourceKV - | SubscriptionListResponse.MqEventSourceR2 - | SubscriptionListResponse.MqEventSourceSuperSlurper - | SubscriptionListResponse.MqEventSourceVectorize - | SubscriptionListResponse.MqEventSourceWorkersAIModel - | SubscriptionListResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionListResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionListResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionDeleteResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionDeleteResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionDeleteResponse.MqEventSourceImages - | SubscriptionDeleteResponse.MqEventSourceKV - | SubscriptionDeleteResponse.MqEventSourceR2 - | SubscriptionDeleteResponse.MqEventSourceSuperSlurper - | SubscriptionDeleteResponse.MqEventSourceVectorize - | SubscriptionDeleteResponse.MqEventSourceWorkersAIModel - | SubscriptionDeleteResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionDeleteResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionDeleteResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionCreateParams { - /** - * Path param: A Resource identifier. - */ - account_id: string; - - /** - * Body param: Destination configuration for the subscription - */ - destination?: SubscriptionCreateParams.Destination; - - /** - * Body param: Whether the subscription is active - */ - enabled?: boolean; - - /** - * Body param: List of event types this subscription handles - */ - events?: Array; - - /** - * Body param: Name of the subscription - */ - name?: string; - - /** - * Body param: Source configuration for the subscription - */ - source?: - | SubscriptionCreateParams.MqEventSourceImages - | SubscriptionCreateParams.MqEventSourceKV - | SubscriptionCreateParams.MqEventSourceR2 - | SubscriptionCreateParams.MqEventSourceSuperSlurper - | SubscriptionCreateParams.MqEventSourceVectorize - | SubscriptionCreateParams.MqEventSourceWorkersAIModel - | SubscriptionCreateParams.MqEventSourceWorkersBuildsWorker - | SubscriptionCreateParams.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionCreateParams { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionUpdateParams { - /** - * Path param: A Resource identifier. - */ - account_id: string; - - /** - * Body param: Destination configuration for the subscription - */ - destination?: SubscriptionUpdateParams.Destination; - - /** - * Body param: Whether the subscription is active - */ - enabled?: boolean; - - /** - * Body param: List of event types this subscription handles - */ - events?: Array; - - /** - * Body param: Name of the subscription - */ - name?: string; -} - -export namespace SubscriptionUpdateParams { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } -} - -export interface SubscriptionListParams extends V4PagePaginationArrayParams { - /** - * Path param: A Resource identifier. - */ - account_id: string; - - /** - * Query param: Sort direction - */ - direction?: 'asc' | 'desc'; - - /** - * Query param: Field to sort by - */ - order?: 'created_at' | 'name' | 'enabled' | 'source'; -} - -export interface SubscriptionDeleteParams { - /** - * A Resource identifier. - */ - account_id: string; -} - -Subscriptions.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; - -export declare namespace Subscriptions { - export { - type SubscriptionCreateResponse as SubscriptionCreateResponse, - type SubscriptionUpdateResponse as SubscriptionUpdateResponse, - type SubscriptionListResponse as SubscriptionListResponse, - type SubscriptionDeleteResponse as SubscriptionDeleteResponse, - SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, - type SubscriptionCreateParams as SubscriptionCreateParams, - type SubscriptionUpdateParams as SubscriptionUpdateParams, - type SubscriptionListParams as SubscriptionListParams, - type SubscriptionDeleteParams as SubscriptionDeleteParams, - }; -} +export class Subscriptions extends APIResource {} diff --git a/src/resources/r2/super-slurper/connectivity-precheck.ts b/src/resources/r2/super-slurper/connectivity-precheck.ts index 654a8193d5..2283824388 100644 --- a/src/resources/r2/super-slurper/connectivity-precheck.ts +++ b/src/resources/r2/super-slurper/connectivity-precheck.ts @@ -13,6 +13,12 @@ export class ConnectivityPrecheck extends APIResource { * const response = * await client.r2.superSlurper.connectivityPrecheck.source({ * account_id: 'account_id', + * bucket: 'bucket', + * secret: { + * accessKeyId: 'accessKeyId', + * secretAccessKey: 'secretAccessKey', + * }, + * vendor: 's3', * }); * ``` */ @@ -37,6 +43,12 @@ export class ConnectivityPrecheck extends APIResource { * const response = * await client.r2.superSlurper.connectivityPrecheck.target({ * account_id: 'account_id', + * bucket: 'bucket', + * secret: { + * accessKeyId: 'accessKeyId', + * secretAccessKey: 'secretAccessKey', + * }, + * vendor: 'r2', * }); * ``` */ @@ -77,7 +89,17 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket?: string; + bucket: string; + + /** + * Body param: + */ + secret: R2SlurperS3SourceSchema.Secret; + + /** + * Body param: + */ + vendor: 's3'; /** * Body param: @@ -87,19 +109,19 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - secret?: R2SlurperS3SourceSchema.Secret; + pathPrefix?: string | null; /** * Body param: */ - vendor?: 's3'; + region?: string | null; } export namespace R2SlurperS3SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } @@ -112,24 +134,29 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket?: string; + bucket: string; + + /** + * Body param: + */ + secret: R2SlurperGcsSourceSchema.Secret; /** * Body param: */ - secret?: R2SlurperGcsSourceSchema.Secret; + vendor: 'gcs'; /** * Body param: */ - vendor?: 'gcs'; + pathPrefix?: string | null; } export namespace R2SlurperGcsSourceSchema { export interface Secret { - clientEmail?: string; + clientEmail: string; - privateKey?: string; + privateKey: string; } } @@ -142,29 +169,34 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket?: string; + bucket: string; /** * Body param: */ - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: R2SlurperR2SourceSchema.Secret; + + /** + * Body param: + */ + vendor: SippyAPI.ProviderParam; /** * Body param: */ - secret?: R2SlurperR2SourceSchema.Secret; + jurisdiction?: 'default' | 'eu' | 'fedramp'; /** * Body param: */ - vendor?: SippyAPI.ProviderParam; + pathPrefix?: string | null; } export namespace R2SlurperR2SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } } @@ -178,29 +210,29 @@ export interface ConnectivityPrecheckTargetParams { /** * Body param: */ - bucket?: string; + bucket: string; /** * Body param: */ - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: ConnectivityPrecheckTargetParams.Secret; /** * Body param: */ - secret?: ConnectivityPrecheckTargetParams.Secret; + vendor: SippyAPI.ProviderParam; /** * Body param: */ - vendor?: SippyAPI.ProviderParam; + jurisdiction?: 'default' | 'eu' | 'fedramp'; } export namespace ConnectivityPrecheckTargetParams { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } diff --git a/src/resources/r2/super-slurper/jobs/jobs.ts b/src/resources/r2/super-slurper/jobs/jobs.ts index 0e70bb10e5..7732e944b1 100644 --- a/src/resources/r2/super-slurper/jobs/jobs.ts +++ b/src/resources/r2/super-slurper/jobs/jobs.ts @@ -360,72 +360,80 @@ export interface JobCreateParams { export namespace JobCreateParams { export interface R2SlurperS3SourceSchema { - bucket?: string; + bucket: string; + + secret: R2SlurperS3SourceSchema.Secret; + + vendor: 's3'; endpoint?: string | null; - secret?: R2SlurperS3SourceSchema.Secret; + pathPrefix?: string | null; - vendor?: 's3'; + region?: string | null; } export namespace R2SlurperS3SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } export interface R2SlurperGcsSourceSchema { - bucket?: string; + bucket: string; - secret?: R2SlurperGcsSourceSchema.Secret; + secret: R2SlurperGcsSourceSchema.Secret; - vendor?: 'gcs'; + vendor: 'gcs'; + + pathPrefix?: string | null; } export namespace R2SlurperGcsSourceSchema { export interface Secret { - clientEmail?: string; + clientEmail: string; - privateKey?: string; + privateKey: string; } } export interface R2SlurperR2SourceSchema { - bucket?: string; + bucket: string; - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: R2SlurperR2SourceSchema.Secret; - secret?: R2SlurperR2SourceSchema.Secret; + vendor: SippyAPI.ProviderParam; + + jurisdiction?: 'default' | 'eu' | 'fedramp'; - vendor?: SippyAPI.ProviderParam; + pathPrefix?: string | null; } export namespace R2SlurperR2SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } export interface Target { - bucket?: string; + bucket: string; - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: Target.Secret; - secret?: Target.Secret; + vendor: SippyAPI.ProviderParam; - vendor?: SippyAPI.ProviderParam; + jurisdiction?: 'default' | 'eu' | 'fedramp'; } export namespace Target { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } } diff --git a/src/resources/radar/as112/as112.ts b/src/resources/radar/as112/as112.ts index 876d8d74aa..a617daa990 100644 --- a/src/resources/radar/as112/as112.ts +++ b/src/resources/radar/as112/as112.ts @@ -55,6 +55,40 @@ export class AS112 extends APIResource { ); top: TopAPI.Top = new TopAPI.Top(this._client); + /** + * Retrieves the distribution of AS112 queries by the specified dimension. + * + * @example + * ```ts + * const response = await client.radar.as112.summaryV2( + * 'DNSSEC', + * ); + * ``` + */ + summaryV2( + dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', + query?: AS112SummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', + query: AS112SummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/as112/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: AS112SummaryV2Response; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves the AS112 DNS queries over time. * @@ -81,6 +115,137 @@ export class AS112 extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieves the distribution of AS112 queries grouped by dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroupsV2('DNSSEC'); + * ``` + */ + timeseriesGroupsV2( + dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', + query?: AS112TimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', + query: AS112TimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/as112/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: AS112TimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface AS112SummaryV2Response { + /** + * Metadata for the results. + */ + meta: AS112SummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace AS112SummaryV2Response { + /** + * 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 AS112TimeseriesResponse { @@ -196,14 +361,117 @@ export namespace AS112TimeseriesResponse { } } -export interface AS112TimeseriesParams { +export interface AS112TimeseriesGroupsV2Response { /** - * 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/). + * Metadata for the results. */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; + meta: AS112TimeseriesGroupsV2Response.Meta; + + serie_0: AS112TimeseriesGroupsV2Response.Serie0; +} + +export namespace AS112TimeseriesGroupsV2Response { + /** + * 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 AS112SummaryV2Params { /** * Filters results by continent. Specify a comma-separated list of alpha-2 codes. * Prefix with `-` to exclude continents from results. For example, `-EU,NA` @@ -233,6 +501,366 @@ export interface AS112TimeseriesParams { */ 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 DNS transport protocol. + */ + protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + + /** + * Filters results by DNS query type. + */ + queryType?: + | 'A' + | 'AAAA' + | 'A6' + | 'AFSDB' + | 'ANY' + | 'APL' + | 'ATMA' + | 'AXFR' + | 'CAA' + | 'CDNSKEY' + | 'CDS' + | 'CERT' + | 'CNAME' + | 'CSYNC' + | 'DHCID' + | 'DLV' + | 'DNAME' + | 'DNSKEY' + | 'DOA' + | 'DS' + | 'EID' + | 'EUI48' + | 'EUI64' + | 'GPOS' + | 'GID' + | 'HINFO' + | 'HIP' + | 'HTTPS' + | 'IPSECKEY' + | 'ISDN' + | 'IXFR' + | 'KEY' + | 'KX' + | 'L32' + | 'L64' + | 'LOC' + | 'LP' + | 'MAILA' + | 'MAILB' + | 'MB' + | 'MD' + | 'MF' + | 'MG' + | 'MINFO' + | 'MR' + | 'MX' + | 'NAPTR' + | 'NB' + | 'NBSTAT' + | 'NID' + | 'NIMLOC' + | 'NINFO' + | 'NS' + | 'NSAP' + | 'NSEC' + | 'NSEC3' + | 'NSEC3PARAM' + | 'NULL' + | 'NXT' + | 'OPENPGPKEY' + | 'OPT' + | 'PTR' + | 'PX' + | 'RKEY' + | 'RP' + | 'RRSIG' + | 'RT' + | 'SIG' + | 'SINK' + | 'SMIMEA' + | 'SOA' + | 'SPF' + | 'SRV' + | 'SSHFP' + | 'SVCB' + | 'TA' + | 'TALINK' + | 'TKEY' + | 'TLSA' + | 'TSIG' + | 'TXT' + | 'UINFO' + | 'UID' + | 'UNSPEC' + | 'URI' + | 'WKS' + | 'X25' + | 'ZONEMD' + | null; + + /** + * Filters results by DNS response code. + */ + responseCode?: + | 'NOERROR' + | 'FORMERR' + | 'SERVFAIL' + | 'NXDOMAIN' + | 'NOTIMP' + | 'REFUSED' + | 'YXDOMAIN' + | 'YXRRSET' + | 'NXRRSET' + | 'NOTAUTH' + | 'NOTZONE' + | 'BADSIG' + | 'BADKEY' + | 'BADTIME' + | 'BADMODE' + | 'BADNAME' + | 'BADALG' + | 'BADTRUNC' + | 'BADCOOKIE'; +} + +export interface AS112TimeseriesParams { + /** + * 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 continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by DNS transport protocol. + */ + protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + + /** + * Filters results by DNS query type. + */ + queryType?: + | 'A' + | 'AAAA' + | 'A6' + | 'AFSDB' + | 'ANY' + | 'APL' + | 'ATMA' + | 'AXFR' + | 'CAA' + | 'CDNSKEY' + | 'CDS' + | 'CERT' + | 'CNAME' + | 'CSYNC' + | 'DHCID' + | 'DLV' + | 'DNAME' + | 'DNSKEY' + | 'DOA' + | 'DS' + | 'EID' + | 'EUI48' + | 'EUI64' + | 'GPOS' + | 'GID' + | 'HINFO' + | 'HIP' + | 'HTTPS' + | 'IPSECKEY' + | 'ISDN' + | 'IXFR' + | 'KEY' + | 'KX' + | 'L32' + | 'L64' + | 'LOC' + | 'LP' + | 'MAILA' + | 'MAILB' + | 'MB' + | 'MD' + | 'MF' + | 'MG' + | 'MINFO' + | 'MR' + | 'MX' + | 'NAPTR' + | 'NB' + | 'NBSTAT' + | 'NID' + | 'NIMLOC' + | 'NINFO' + | 'NS' + | 'NSAP' + | 'NSEC' + | 'NSEC3' + | 'NSEC3PARAM' + | 'NULL' + | 'NXT' + | 'OPENPGPKEY' + | 'OPT' + | 'PTR' + | 'PX' + | 'RKEY' + | 'RP' + | 'RRSIG' + | 'RT' + | 'SIG' + | 'SINK' + | 'SMIMEA' + | 'SOA' + | 'SPF' + | 'SRV' + | 'SSHFP' + | 'SVCB' + | 'TA' + | 'TALINK' + | 'TKEY' + | 'TLSA' + | 'TSIG' + | 'TXT' + | 'UINFO' + | 'UID' + | 'UNSPEC' + | 'URI' + | 'WKS' + | 'X25' + | 'ZONEMD' + | null; + + /** + * Filters results by DNS response code. + */ + responseCode?: + | 'NOERROR' + | 'FORMERR' + | 'SERVFAIL' + | 'NXDOMAIN' + | 'NOTIMP' + | 'REFUSED' + | 'YXDOMAIN' + | 'YXRRSET' + | 'NXRRSET' + | 'NOTAUTH' + | 'NOTZONE' + | 'BADSIG' + | 'BADKEY' + | 'BADTIME' + | 'BADMODE' + | 'BADNAME' + | 'BADALG' + | 'BADTRUNC' + | 'BADCOOKIE'; +} + +export interface AS112TimeseriesGroupsV2Params { + /** + * 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 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` @@ -375,8 +1003,12 @@ AS112.Top = Top; export declare namespace AS112 { export { + type AS112SummaryV2Response as AS112SummaryV2Response, type AS112TimeseriesResponse as AS112TimeseriesResponse, + type AS112TimeseriesGroupsV2Response as AS112TimeseriesGroupsV2Response, + type AS112SummaryV2Params as AS112SummaryV2Params, type AS112TimeseriesParams as AS112TimeseriesParams, + type AS112TimeseriesGroupsV2Params as AS112TimeseriesGroupsV2Params, }; export { diff --git a/src/resources/radar/as112/index.ts b/src/resources/radar/as112/index.ts index 7b5e4752cb..f3e1911eea 100644 --- a/src/resources/radar/as112/index.ts +++ b/src/resources/radar/as112/index.ts @@ -1,6 +1,14 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { AS112, type AS112TimeseriesResponse, type AS112TimeseriesParams } from './as112'; +export { + AS112, + type AS112SummaryV2Response, + type AS112TimeseriesResponse, + type AS112TimeseriesGroupsV2Response, + type AS112SummaryV2Params, + type AS112TimeseriesParams, + type AS112TimeseriesGroupsV2Params, +} from './as112'; export { Summary, type SummaryDNSSECResponse, diff --git a/src/resources/radar/as112/summary.ts b/src/resources/radar/as112/summary.ts index c59fdaeb5a..d6034b19c4 100644 --- a/src/resources/radar/as112/summary.ts +++ b/src/resources/radar/as112/summary.ts @@ -9,10 +9,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by DNSSEC (DNS Security * Extensions) support. * - * @example - * ```ts - * const response = await client.radar.as112.summary.dnssec(); - * ``` + * @deprecated */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -34,10 +31,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by EDNS (Extension Mechanisms * for DNS) support. * - * @example - * ```ts - * const response = await client.radar.as112.summary.edns(); - * ``` + * @deprecated */ edns(query?: SummaryEdnsParams, options?: Core.RequestOptions): Core.APIPromise; edns(options?: Core.RequestOptions): Core.APIPromise; @@ -58,11 +52,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by IP version. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -86,11 +76,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by protocol. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.protocol(); - * ``` + * @deprecated */ protocol( query?: SummaryProtocolParams, @@ -114,11 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by type. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.queryType(); - * ``` + * @deprecated */ queryType( query?: SummaryQueryTypeParams, @@ -142,11 +124,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of AS112 DNS requests classified by response code. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.responseCodes(); - * ``` + * @deprecated */ responseCodes( query?: SummaryResponseCodesParams, diff --git a/src/resources/radar/as112/timeseries-groups.ts b/src/resources/radar/as112/timeseries-groups.ts index a9e2aa049c..e5593df35c 100644 --- a/src/resources/radar/as112/timeseries-groups.ts +++ b/src/resources/radar/as112/timeseries-groups.ts @@ -9,11 +9,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by DNSSEC (DNS Security * Extensions) support over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.dnssec(); - * ``` + * @deprecated */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -38,11 +34,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by EDNS (Extension Mechanisms * for DNS) support over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.edns(); - * ``` + * @deprecated */ edns( query?: TimeseriesGroupEdnsParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -96,11 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by protocol over * time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.protocol(); - * ``` + * @deprecated */ protocol( query?: TimeseriesGroupProtocolParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by type over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.queryType(); - * ``` + * @deprecated */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -154,11 +134,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by response code * over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.responseCodes(); - * ``` + * @deprecated */ responseCodes( query?: TimeseriesGroupResponseCodesParams, diff --git a/src/resources/radar/attacks/attacks.ts b/src/resources/radar/attacks/attacks.ts index 9d3c9c4aef..4346cf6862 100644 --- a/src/resources/radar/attacks/attacks.ts +++ b/src/resources/radar/attacks/attacks.ts @@ -2,9 +2,25 @@ import { APIResource } from '../../../resource'; import * as Layer3API from './layer3/layer3'; -import { Layer3, Layer3TimeseriesParams, Layer3TimeseriesResponse } from './layer3/layer3'; +import { + Layer3, + Layer3SummaryV2Params, + Layer3SummaryV2Response, + Layer3TimeseriesGroupsV2Params, + Layer3TimeseriesGroupsV2Response, + Layer3TimeseriesParams, + Layer3TimeseriesResponse, +} from './layer3/layer3'; import * as Layer7API from './layer7/layer7'; -import { Layer7, Layer7TimeseriesParams, Layer7TimeseriesResponse } from './layer7/layer7'; +import { + Layer7, + Layer7SummaryV2Params, + Layer7SummaryV2Response, + Layer7TimeseriesGroupsV2Params, + Layer7TimeseriesGroupsV2Response, + Layer7TimeseriesParams, + Layer7TimeseriesResponse, +} from './layer7/layer7'; export class Attacks extends APIResource { layer3: Layer3API.Layer3 = new Layer3API.Layer3(this._client); @@ -17,13 +33,21 @@ Attacks.Layer7 = Layer7; export declare namespace Attacks { export { Layer3 as Layer3, + type Layer3SummaryV2Response as Layer3SummaryV2Response, type Layer3TimeseriesResponse as Layer3TimeseriesResponse, + type Layer3TimeseriesGroupsV2Response as Layer3TimeseriesGroupsV2Response, + type Layer3SummaryV2Params as Layer3SummaryV2Params, type Layer3TimeseriesParams as Layer3TimeseriesParams, + type Layer3TimeseriesGroupsV2Params as Layer3TimeseriesGroupsV2Params, }; export { Layer7 as Layer7, + type Layer7SummaryV2Response as Layer7SummaryV2Response, type Layer7TimeseriesResponse as Layer7TimeseriesResponse, + type Layer7TimeseriesGroupsV2Response as Layer7TimeseriesGroupsV2Response, + type Layer7SummaryV2Params as Layer7SummaryV2Params, type Layer7TimeseriesParams as Layer7TimeseriesParams, + type Layer7TimeseriesGroupsV2Params as Layer7TimeseriesGroupsV2Params, }; } diff --git a/src/resources/radar/attacks/index.ts b/src/resources/radar/attacks/index.ts index 28216f9bd4..5ff5753f57 100644 --- a/src/resources/radar/attacks/index.ts +++ b/src/resources/radar/attacks/index.ts @@ -1,5 +1,21 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Attacks } from './attacks'; -export { Layer3, type Layer3TimeseriesResponse, type Layer3TimeseriesParams } from './layer3/index'; -export { Layer7, type Layer7TimeseriesResponse, type Layer7TimeseriesParams } from './layer7/index'; +export { + Layer3, + type Layer3SummaryV2Response, + type Layer3TimeseriesResponse, + type Layer3TimeseriesGroupsV2Response, + type Layer3SummaryV2Params, + type Layer3TimeseriesParams, + type Layer3TimeseriesGroupsV2Params, +} from './layer3/index'; +export { + Layer7, + type Layer7SummaryV2Response, + type Layer7TimeseriesResponse, + type Layer7TimeseriesGroupsV2Response, + type Layer7SummaryV2Params, + type Layer7TimeseriesParams, + type Layer7TimeseriesGroupsV2Params, +} from './layer7/index'; diff --git a/src/resources/radar/attacks/layer3/index.ts b/src/resources/radar/attacks/layer3/index.ts index aea57a5a87..5cda25b111 100644 --- a/src/resources/radar/attacks/layer3/index.ts +++ b/src/resources/radar/attacks/layer3/index.ts @@ -1,6 +1,14 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Layer3, type Layer3TimeseriesResponse, type Layer3TimeseriesParams } from './layer3'; +export { + Layer3, + type Layer3SummaryV2Response, + type Layer3TimeseriesResponse, + type Layer3TimeseriesGroupsV2Response, + type Layer3SummaryV2Params, + type Layer3TimeseriesParams, + type Layer3TimeseriesGroupsV2Params, +} from './layer3'; export { Summary, type SummaryBitrateResponse, diff --git a/src/resources/radar/attacks/layer3/layer3.ts b/src/resources/radar/attacks/layer3/layer3.ts index 3fcf323b99..673db07fec 100644 --- a/src/resources/radar/attacks/layer3/layer3.ts +++ b/src/resources/radar/attacks/layer3/layer3.ts @@ -57,6 +57,40 @@ export class Layer3 extends APIResource { ); top: TopAPI.Top = new TopAPI.Top(this._client); + /** + * Retrieves the distribution of layer 3 attacks by the specified dimension. + * + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summaryV2('PROTOCOL'); + * ``` + */ + summaryV2( + dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', + query?: Layer3SummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', + query: Layer3SummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/attacks/layer3/summary/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: Layer3SummaryV2Response }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves layer 3 attacks over time. * @@ -84,6 +118,139 @@ export class Layer3 extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieves the distribution of layer 3 attacks grouped by dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroupsV2( + * 'PROTOCOL', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', + query?: Layer3TimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', + query: Layer3TimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/attacks/layer3/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: Layer3TimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface Layer3SummaryV2Response { + /** + * Metadata for the results. + */ + meta: Layer3SummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace Layer3SummaryV2Response { + /** + * 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 Layer3TimeseriesResponse { @@ -199,6 +366,182 @@ export namespace Layer3TimeseriesResponse { } } +export interface Layer3TimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + meta: Layer3TimeseriesGroupsV2Response.Meta; + + serie_0: Layer3TimeseriesGroupsV2Response.Serie0; +} + +export namespace Layer3TimeseriesGroupsV2Response { + /** + * 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 Layer3SummaryV2Params { + /** + * 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; + + /** + * Specifies whether the `location` filter applies to the source or target + * location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * 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 the results by layer 3/4 protocol. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + export interface Layer3TimeseriesParams { /** * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). @@ -284,14 +627,97 @@ export interface Layer3TimeseriesParams { protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; } +export interface Layer3TimeseriesGroupsV2Params { + /** + * 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 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; + + /** + * Specifies whether the `location` filter applies to the source or target + * location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * 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' | 'MIN0_MAX'; + + /** + * Filters the results by layer 3/4 protocol. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + Layer3.Summary = Summary; Layer3.TimeseriesGroups = TimeseriesGroups; Layer3.Top = Top; export declare namespace Layer3 { export { + type Layer3SummaryV2Response as Layer3SummaryV2Response, type Layer3TimeseriesResponse as Layer3TimeseriesResponse, + type Layer3TimeseriesGroupsV2Response as Layer3TimeseriesGroupsV2Response, + type Layer3SummaryV2Params as Layer3SummaryV2Params, type Layer3TimeseriesParams as Layer3TimeseriesParams, + type Layer3TimeseriesGroupsV2Params as Layer3TimeseriesGroupsV2Params, }; export { diff --git a/src/resources/radar/attacks/layer3/summary.ts b/src/resources/radar/attacks/layer3/summary.ts index 73ed7d7c70..bc4ccc4c81 100644 --- a/src/resources/radar/attacks/layer3/summary.ts +++ b/src/resources/radar/attacks/layer3/summary.ts @@ -8,11 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.bitrate(); - * ``` + * @deprecated */ bitrate( query?: SummaryBitrateParams, @@ -36,11 +32,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.duration(); - * ``` + * @deprecated */ duration( query?: SummaryDurationParams, @@ -64,11 +56,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.industry(); - * ``` + * @deprecated */ industry( query?: SummaryIndustryParams, @@ -92,11 +80,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -120,11 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.protocol(); - * ``` + * @deprecated */ protocol( query?: SummaryProtocolParams, @@ -148,11 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.vector(); - * ``` + * @deprecated */ vector(query?: SummaryVectorParams, options?: Core.RequestOptions): Core.APIPromise; vector(options?: Core.RequestOptions): Core.APIPromise; @@ -173,11 +149,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.vertical(); - * ``` + * @deprecated */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer3/timeseries-groups.ts b/src/resources/radar/attacks/layer3/timeseries-groups.ts index 740bb97cae..9f8d171a40 100644 --- a/src/resources/radar/attacks/layer3/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer3/timeseries-groups.ts @@ -8,11 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.bitrate(); - * ``` + * @deprecated */ bitrate( query?: TimeseriesGroupBitrateParams, @@ -37,11 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.duration(); - * ``` + * @deprecated */ duration( query?: TimeseriesGroupDurationParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.industry(); - * ``` + * @deprecated */ industry( query?: TimeseriesGroupIndustryParams, @@ -95,11 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.protocol(); - * ``` + * @deprecated */ protocol( query?: TimeseriesGroupProtocolParams, @@ -153,11 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.vector(); - * ``` + * @deprecated */ vector( query?: TimeseriesGroupVectorParams, @@ -182,11 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.vertical(); - * ``` + * @deprecated */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer7/index.ts b/src/resources/radar/attacks/layer7/index.ts index ea12e3b31d..20456df07c 100644 --- a/src/resources/radar/attacks/layer7/index.ts +++ b/src/resources/radar/attacks/layer7/index.ts @@ -1,6 +1,14 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Layer7, type Layer7TimeseriesResponse, type Layer7TimeseriesParams } from './layer7'; +export { + Layer7, + type Layer7SummaryV2Response, + type Layer7TimeseriesResponse, + type Layer7TimeseriesGroupsV2Response, + type Layer7SummaryV2Params, + type Layer7TimeseriesParams, + type Layer7TimeseriesGroupsV2Params, +} from './layer7'; export { Summary, type SummaryHTTPMethodResponse, diff --git a/src/resources/radar/attacks/layer7/layer7.ts b/src/resources/radar/attacks/layer7/layer7.ts index 633b50c1a5..b997d1b7f5 100644 --- a/src/resources/radar/attacks/layer7/layer7.ts +++ b/src/resources/radar/attacks/layer7/layer7.ts @@ -57,6 +57,63 @@ export class Layer7 extends APIResource { ); top: TopAPI.Top = new TopAPI.Top(this._client); + /** + * Retrieves the distribution of layer 7 attacks by the specified dimension. + * + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summaryV2( + * 'HTTP_METHOD', + * ); + * ``` + */ + summaryV2( + dimension: + | 'HTTP_METHOD' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'MANAGED_RULES' + | 'MITIGATION_PRODUCT' + | 'VERTICAL' + | 'INDUSTRY', + query?: Layer7SummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'HTTP_METHOD' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'MANAGED_RULES' + | 'MITIGATION_PRODUCT' + | 'VERTICAL' + | 'INDUSTRY', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'HTTP_METHOD' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'MANAGED_RULES' + | 'MITIGATION_PRODUCT' + | 'VERTICAL' + | 'INDUSTRY', + query: Layer7SummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/attacks/layer7/summary/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: Layer7SummaryV2Response }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves layer 7 attacks over time. * @@ -84,6 +141,160 @@ export class Layer7 extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieves the distribution of layer 7 attacks grouped by dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroupsV2( + * 'HTTP_METHOD', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: + | 'HTTP_METHOD' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'MANAGED_RULES' + | 'MITIGATION_PRODUCT' + | 'VERTICAL' + | 'INDUSTRY', + query?: Layer7TimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'HTTP_METHOD' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'MANAGED_RULES' + | 'MITIGATION_PRODUCT' + | 'VERTICAL' + | 'INDUSTRY', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'HTTP_METHOD' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'MANAGED_RULES' + | 'MITIGATION_PRODUCT' + | 'VERTICAL' + | 'INDUSTRY', + query: Layer7TimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/attacks/layer7/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: Layer7TimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface Layer7SummaryV2Response { + /** + * Metadata for the results. + */ + meta: Layer7SummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace Layer7SummaryV2Response { + /** + * 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 Layer7TimeseriesResponse { @@ -196,6 +407,249 @@ export namespace Layer7TimeseriesResponse { } } +export interface Layer7TimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + meta: Layer7TimeseriesGroupsV2Response.Meta; + + serie_0: Layer7TimeseriesGroupsV2Response.Serie0; +} + +export namespace Layer7TimeseriesGroupsV2Response { + /** + * 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 Layer7SummaryV2Params { + /** + * 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'; + + /** + * Filters results by HTTP method. + */ + httpMethod?: Array< + | 'GET' + | 'POST' + | 'DELETE' + | 'PUT' + | 'HEAD' + | 'PURGE' + | 'OPTIONS' + | 'PROPFIND' + | 'MKCOL' + | 'PATCH' + | 'ACL' + | 'BCOPY' + | 'BDELETE' + | 'BMOVE' + | 'BPROPFIND' + | 'BPROPPATCH' + | 'CHECKIN' + | 'CHECKOUT' + | 'CONNECT' + | 'COPY' + | 'LABEL' + | 'LOCK' + | 'MERGE' + | 'MKACTIVITY' + | 'MKWORKSPACE' + | 'MOVE' + | 'NOTIFY' + | 'ORDERPATCH' + | 'POLL' + | 'PROPPATCH' + | 'REPORT' + | 'SEARCH' + | 'SUBSCRIBE' + | 'TRACE' + | 'UNCHECKOUT' + | 'UNLOCK' + | 'UNSUBSCRIBE' + | 'UPDATE' + | 'VERSIONCONTROL' + | 'BASELINECONTROL' + | 'XMSENUMATTS' + | 'RPC_OUT_DATA' + | 'RPC_IN_DATA' + | 'JSON' + | 'COOK' + | 'TRACK' + >; + + /** + * Filters results by HTTP version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * 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; + + /** + * Filters the results by layer 7 mitigation product. + */ + mitigationProduct?: Array< + | 'DDOS' + | 'WAF' + | 'BOT_MANAGEMENT' + | 'ACCESS_RULES' + | 'IP_REPUTATION' + | 'API_SHIELD' + | 'DATA_LOSS_PREVENTION' + >; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + export interface Layer7TimeseriesParams { /** * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). @@ -335,14 +789,164 @@ export interface Layer7TimeseriesParams { normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; } +export interface Layer7TimeseriesGroupsV2Params { + /** + * 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'; + + /** + * Filters results by HTTP method. + */ + httpMethod?: Array< + | 'GET' + | 'POST' + | 'DELETE' + | 'PUT' + | 'HEAD' + | 'PURGE' + | 'OPTIONS' + | 'PROPFIND' + | 'MKCOL' + | 'PATCH' + | 'ACL' + | 'BCOPY' + | 'BDELETE' + | 'BMOVE' + | 'BPROPFIND' + | 'BPROPPATCH' + | 'CHECKIN' + | 'CHECKOUT' + | 'CONNECT' + | 'COPY' + | 'LABEL' + | 'LOCK' + | 'MERGE' + | 'MKACTIVITY' + | 'MKWORKSPACE' + | 'MOVE' + | 'NOTIFY' + | 'ORDERPATCH' + | 'POLL' + | 'PROPPATCH' + | 'REPORT' + | 'SEARCH' + | 'SUBSCRIBE' + | 'TRACE' + | 'UNCHECKOUT' + | 'UNLOCK' + | 'UNSUBSCRIBE' + | 'UPDATE' + | 'VERSIONCONTROL' + | 'BASELINECONTROL' + | 'XMSENUMATTS' + | 'RPC_OUT_DATA' + | 'RPC_IN_DATA' + | 'JSON' + | 'COOK' + | 'TRACK' + >; + + /** + * Filters results by HTTP version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * 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; + + /** + * Filters the results by layer 7 mitigation product. + */ + mitigationProduct?: Array< + | 'DDOS' + | 'WAF' + | 'BOT_MANAGEMENT' + | 'ACCESS_RULES' + | 'IP_REPUTATION' + | 'API_SHIELD' + | 'DATA_LOSS_PREVENTION' + >; + + /** + * 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' | 'MIN0_MAX'; +} + Layer7.Summary = Summary; Layer7.TimeseriesGroups = TimeseriesGroups; Layer7.Top = Top; export declare namespace Layer7 { export { + type Layer7SummaryV2Response as Layer7SummaryV2Response, type Layer7TimeseriesResponse as Layer7TimeseriesResponse, + type Layer7TimeseriesGroupsV2Response as Layer7TimeseriesGroupsV2Response, + type Layer7SummaryV2Params as Layer7SummaryV2Params, type Layer7TimeseriesParams as Layer7TimeseriesParams, + type Layer7TimeseriesGroupsV2Params as Layer7TimeseriesGroupsV2Params, }; export { diff --git a/src/resources/radar/attacks/layer7/summary.ts b/src/resources/radar/attacks/layer7/summary.ts index 4afa3d68d0..160eb24dd8 100644 --- a/src/resources/radar/attacks/layer7/summary.ts +++ b/src/resources/radar/attacks/layer7/summary.ts @@ -8,11 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.httpMethod(); - * ``` + * @deprecated */ httpMethod( query?: SummaryHTTPMethodParams, @@ -37,11 +33,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.httpVersion(); - * ``` + * @deprecated */ httpVersion( query?: SummaryHTTPVersionParams, @@ -66,11 +58,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.industry(); - * ``` + * @deprecated */ industry( query?: SummaryIndustryParams, @@ -94,11 +82,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -122,11 +106,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.managedRules(); - * ``` + * @deprecated */ managedRules( query?: SummaryManagedRulesParams, @@ -151,11 +131,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.mitigationProduct(); - * ``` + * @deprecated */ mitigationProduct( query?: SummaryMitigationProductParams, @@ -180,11 +156,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.vertical(); - * ``` + * @deprecated */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer7/timeseries-groups.ts b/src/resources/radar/attacks/layer7/timeseries-groups.ts index ab7e962788..ce7c62ce1e 100644 --- a/src/resources/radar/attacks/layer7/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer7/timeseries-groups.ts @@ -8,11 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.httpMethod(); - * ``` + * @deprecated */ httpMethod( query?: TimeseriesGroupHTTPMethodParams, @@ -37,11 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.httpVersion(); - * ``` + * @deprecated */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.industry(); - * ``` + * @deprecated */ industry( query?: TimeseriesGroupIndustryParams, @@ -95,11 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version used over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.managedRules(); - * ``` + * @deprecated */ managedRules( query?: TimeseriesGroupManagedRulesParams, @@ -153,11 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.mitigationProduct(); - * ``` + * @deprecated */ mitigationProduct( query?: TimeseriesGroupMitigationProductParams, @@ -182,11 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.vertical(); - * ``` + * @deprecated */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/dns/dns.ts b/src/resources/radar/dns/dns.ts index 8220269674..f5210942fb 100644 --- a/src/resources/radar/dns/dns.ts +++ b/src/resources/radar/dns/dns.ts @@ -61,6 +61,70 @@ export class DNS extends APIResource { this._client, ); + /** + * Retrieves the distribution of DNS queries by the specified dimension. + * + * @example + * ```ts + * const response = await client.radar.dns.summaryV2( + * 'IP_VERSION', + * ); + * ``` + */ + summaryV2( + dimension: + | 'IP_VERSION' + | 'CACHE_HIT' + | 'DNSSEC' + | 'DNSSEC_AWARE' + | 'DNSSEC_E2E' + | 'MATCHING_ANSWER' + | 'PROTOCOL' + | 'QUERY_TYPE' + | 'RESPONSE_CODE' + | 'RESPONSE_TTL', + query?: DNSSummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'IP_VERSION' + | 'CACHE_HIT' + | 'DNSSEC' + | 'DNSSEC_AWARE' + | 'DNSSEC_E2E' + | 'MATCHING_ANSWER' + | 'PROTOCOL' + | 'QUERY_TYPE' + | 'RESPONSE_CODE' + | 'RESPONSE_TTL', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'IP_VERSION' + | 'CACHE_HIT' + | 'DNSSEC' + | 'DNSSEC_AWARE' + | 'DNSSEC_E2E' + | 'MATCHING_ANSWER' + | 'PROTOCOL' + | 'QUERY_TYPE' + | 'RESPONSE_CODE' + | 'RESPONSE_TTL', + query: DNSSummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/dns/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: DNSSummaryV2Response; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves normalized query volume to the 1.1.1.1 DNS resolver over time. * @@ -87,6 +151,168 @@ export class DNS extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieves the distribution of DNS queries grouped by dimension over time. + * + * @example + * ```ts + * const response = await client.radar.dns.timeseriesGroupsV2( + * 'IP_VERSION', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: + | 'IP_VERSION' + | 'CACHE_HIT' + | 'DNSSEC' + | 'DNSSEC_AWARE' + | 'DNSSEC_E2E' + | 'MATCHING_ANSWER' + | 'PROTOCOL' + | 'QUERY_TYPE' + | 'RESPONSE_CODE' + | 'RESPONSE_TTL', + query?: DNSTimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'IP_VERSION' + | 'CACHE_HIT' + | 'DNSSEC' + | 'DNSSEC_AWARE' + | 'DNSSEC_E2E' + | 'MATCHING_ANSWER' + | 'PROTOCOL' + | 'QUERY_TYPE' + | 'RESPONSE_CODE' + | 'RESPONSE_TTL', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'IP_VERSION' + | 'CACHE_HIT' + | 'DNSSEC' + | 'DNSSEC_AWARE' + | 'DNSSEC_E2E' + | 'MATCHING_ANSWER' + | 'PROTOCOL' + | 'QUERY_TYPE' + | 'RESPONSE_CODE' + | 'RESPONSE_TTL', + query: DNSTimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/dns/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: DNSTimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface DNSSummaryV2Response { + /** + * Metadata for the results. + */ + meta: DNSSummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace DNSSummaryV2Response { + /** + * 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 DNSTimeseriesResponse { @@ -202,14 +428,117 @@ export namespace DNSTimeseriesResponse { } } -export interface DNSTimeseriesParams { +export interface DNSTimeseriesGroupsV2Response { /** - * 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/). + * Metadata for the results. */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; + meta: DNSTimeseriesGroupsV2Response.Meta; + + serie_0: DNSTimeseriesGroupsV2Response.Serie0; +} + +export namespace DNSTimeseriesGroupsV2Response { + /** + * 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 DNSSummaryV2Params { /** * Filters results by Autonomous System. Specify one or more Autonomous System * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from @@ -247,6 +576,402 @@ export interface DNSTimeseriesParams { */ 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; + + /** + * Specifies whether the response includes empty DNS responses (NODATA). + */ + nodata?: boolean; + + /** + * Filters results by DNS transport protocol. + */ + protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + + /** + * Filters results by DNS query type. + */ + queryType?: + | 'A' + | 'AAAA' + | 'A6' + | 'AFSDB' + | 'ANY' + | 'APL' + | 'ATMA' + | 'AXFR' + | 'CAA' + | 'CDNSKEY' + | 'CDS' + | 'CERT' + | 'CNAME' + | 'CSYNC' + | 'DHCID' + | 'DLV' + | 'DNAME' + | 'DNSKEY' + | 'DOA' + | 'DS' + | 'EID' + | 'EUI48' + | 'EUI64' + | 'GPOS' + | 'GID' + | 'HINFO' + | 'HIP' + | 'HTTPS' + | 'IPSECKEY' + | 'ISDN' + | 'IXFR' + | 'KEY' + | 'KX' + | 'L32' + | 'L64' + | 'LOC' + | 'LP' + | 'MAILA' + | 'MAILB' + | 'MB' + | 'MD' + | 'MF' + | 'MG' + | 'MINFO' + | 'MR' + | 'MX' + | 'NAPTR' + | 'NB' + | 'NBSTAT' + | 'NID' + | 'NIMLOC' + | 'NINFO' + | 'NS' + | 'NSAP' + | 'NSEC' + | 'NSEC3' + | 'NSEC3PARAM' + | 'NULL' + | 'NXT' + | 'OPENPGPKEY' + | 'OPT' + | 'PTR' + | 'PX' + | 'RKEY' + | 'RP' + | 'RRSIG' + | 'RT' + | 'SIG' + | 'SINK' + | 'SMIMEA' + | 'SOA' + | 'SPF' + | 'SRV' + | 'SSHFP' + | 'SVCB' + | 'TA' + | 'TALINK' + | 'TKEY' + | 'TLSA' + | 'TSIG' + | 'TXT' + | 'UINFO' + | 'UID' + | 'UNSPEC' + | 'URI' + | 'WKS' + | 'X25' + | 'ZONEMD' + | null; + + /** + * Filters results by DNS response code. + */ + responseCode?: + | 'NOERROR' + | 'FORMERR' + | 'SERVFAIL' + | 'NXDOMAIN' + | 'NOTIMP' + | 'REFUSED' + | 'YXDOMAIN' + | 'YXRRSET' + | 'NXRRSET' + | 'NOTAUTH' + | 'NOTZONE' + | 'BADSIG' + | 'BADKEY' + | 'BADTIME' + | 'BADMODE' + | 'BADNAME' + | 'BADALG' + | 'BADTRUNC' + | 'BADCOOKIE'; + + /** + * Filters results by country code top-level domain (ccTLD). + */ + tld?: Array; +} + +export interface DNSTimeseriesParams { + /** + * 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'; + + /** + * 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; + + /** + * Specifies whether the response includes empty DNS responses (NODATA). + */ + nodata?: boolean; + + /** + * Filters results by DNS transport protocol. + */ + protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + + /** + * Filters results by DNS query type. + */ + queryType?: + | 'A' + | 'AAAA' + | 'A6' + | 'AFSDB' + | 'ANY' + | 'APL' + | 'ATMA' + | 'AXFR' + | 'CAA' + | 'CDNSKEY' + | 'CDS' + | 'CERT' + | 'CNAME' + | 'CSYNC' + | 'DHCID' + | 'DLV' + | 'DNAME' + | 'DNSKEY' + | 'DOA' + | 'DS' + | 'EID' + | 'EUI48' + | 'EUI64' + | 'GPOS' + | 'GID' + | 'HINFO' + | 'HIP' + | 'HTTPS' + | 'IPSECKEY' + | 'ISDN' + | 'IXFR' + | 'KEY' + | 'KX' + | 'L32' + | 'L64' + | 'LOC' + | 'LP' + | 'MAILA' + | 'MAILB' + | 'MB' + | 'MD' + | 'MF' + | 'MG' + | 'MINFO' + | 'MR' + | 'MX' + | 'NAPTR' + | 'NB' + | 'NBSTAT' + | 'NID' + | 'NIMLOC' + | 'NINFO' + | 'NS' + | 'NSAP' + | 'NSEC' + | 'NSEC3' + | 'NSEC3PARAM' + | 'NULL' + | 'NXT' + | 'OPENPGPKEY' + | 'OPT' + | 'PTR' + | 'PX' + | 'RKEY' + | 'RP' + | 'RRSIG' + | 'RT' + | 'SIG' + | 'SINK' + | 'SMIMEA' + | 'SOA' + | 'SPF' + | 'SRV' + | 'SSHFP' + | 'SVCB' + | 'TA' + | 'TALINK' + | 'TKEY' + | 'TLSA' + | 'TSIG' + | 'TXT' + | 'UINFO' + | 'UID' + | 'UNSPEC' + | 'URI' + | 'WKS' + | 'X25' + | 'ZONEMD' + | null; + + /** + * Filters results by DNS response code. + */ + responseCode?: + | 'NOERROR' + | 'FORMERR' + | 'SERVFAIL' + | 'NXDOMAIN' + | 'NOTIMP' + | 'REFUSED' + | 'YXDOMAIN' + | 'YXRRSET' + | 'NXRRSET' + | 'NOTAUTH' + | 'NOTZONE' + | 'BADSIG' + | 'BADKEY' + | 'BADTIME' + | 'BADMODE' + | 'BADNAME' + | 'BADALG' + | 'BADTRUNC' + | 'BADCOOKIE'; + + /** + * Filters results by country code top-level domain (ccTLD). + */ + tld?: Array; +} + +export interface DNSTimeseriesGroupsV2Params { + /** + * 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` @@ -399,8 +1124,12 @@ DNS.TimeseriesGroups = TimeseriesGroups; export declare namespace DNS { export { + type DNSSummaryV2Response as DNSSummaryV2Response, type DNSTimeseriesResponse as DNSTimeseriesResponse, + type DNSTimeseriesGroupsV2Response as DNSTimeseriesGroupsV2Response, + type DNSSummaryV2Params as DNSSummaryV2Params, type DNSTimeseriesParams as DNSTimeseriesParams, + type DNSTimeseriesGroupsV2Params as DNSTimeseriesGroupsV2Params, }; export { diff --git a/src/resources/radar/dns/index.ts b/src/resources/radar/dns/index.ts index 5254679872..d86325efb1 100644 --- a/src/resources/radar/dns/index.ts +++ b/src/resources/radar/dns/index.ts @@ -1,6 +1,14 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns'; +export { + DNS, + type DNSSummaryV2Response, + type DNSTimeseriesResponse, + type DNSTimeseriesGroupsV2Response, + type DNSSummaryV2Params, + type DNSTimeseriesParams, + type DNSTimeseriesGroupsV2Params, +} from './dns'; export { Summary, type SummaryCacheHitResponse, diff --git a/src/resources/radar/dns/summary.ts b/src/resources/radar/dns/summary.ts index 9bc87aa1f9..575afc929b 100644 --- a/src/resources/radar/dns/summary.ts +++ b/src/resources/radar/dns/summary.ts @@ -8,10 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by cache status. * - * @example - * ```ts - * const response = await client.radar.dns.summary.cacheHit(); - * ``` + * @deprecated */ cacheHit( query?: SummaryCacheHitParams, @@ -36,10 +33,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support. * - * @example - * ```ts - * const response = await client.radar.dns.summary.dnssec(); - * ``` + * @deprecated */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -61,11 +55,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.dnssecAware(); - * ``` + * @deprecated */ dnssecAware( query?: SummaryDNSSECAwareParams, @@ -90,10 +80,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status. * - * @example - * ```ts - * const response = await client.radar.dns.summary.dnssecE2E(); - * ``` + * @deprecated */ dnssecE2E( query?: SummaryDNSSECE2EParams, @@ -117,10 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by IP version. * - * @example - * ```ts - * const response = await client.radar.dns.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -144,11 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.matchingAnswer(); - * ``` + * @deprecated */ matchingAnswer( query?: SummaryMatchingAnswerParams, @@ -172,10 +152,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol. * - * @example - * ```ts - * const response = await client.radar.dns.summary.protocol(); - * ``` + * @deprecated */ protocol( query?: SummaryProtocolParams, @@ -199,10 +176,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by type. * - * @example - * ```ts - * const response = await client.radar.dns.summary.queryType(); - * ``` + * @deprecated */ queryType( query?: SummaryQueryTypeParams, @@ -226,11 +200,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by response code. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.responseCode(); - * ``` + * @deprecated */ responseCode( query?: SummaryResponseCodeParams, @@ -254,11 +224,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by minimum response TTL. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.responseTTL(); - * ``` + * @deprecated */ responseTTL( query?: SummaryResponseTTLParams, diff --git a/src/resources/radar/dns/timeseries-groups.ts b/src/resources/radar/dns/timeseries-groups.ts index 9a242a93fb..5e1ea8a4e1 100644 --- a/src/resources/radar/dns/timeseries-groups.ts +++ b/src/resources/radar/dns/timeseries-groups.ts @@ -8,11 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by cache status over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.cacheHit(); - * ``` + * @deprecated */ cacheHit( query?: TimeseriesGroupCacheHitParams, @@ -37,11 +33,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.dnssec(); - * ``` + * @deprecated */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.dnssecAware(); - * ``` + * @deprecated */ dnssecAware( query?: TimeseriesGroupDNSSECAwareParams, @@ -96,11 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.dnssecE2E(); - * ``` + * @deprecated */ dnssecE2E( query?: TimeseriesGroupDNSSECE2EParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -152,11 +132,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.matchingAnswer(); - * ``` + * @deprecated */ matchingAnswer( query?: TimeseriesGroupMatchingAnswerParams, @@ -181,11 +157,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.protocol(); - * ``` + * @deprecated */ protocol( query?: TimeseriesGroupProtocolParams, @@ -209,11 +181,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by type over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.queryType(); - * ``` + * @deprecated */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -237,11 +205,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by response code over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.responseCode(); - * ``` + * @deprecated */ responseCode( query?: TimeseriesGroupResponseCodeParams, @@ -266,11 +230,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by minimum answer TTL over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.responseTTL(); - * ``` + * @deprecated */ responseTTL( query?: TimeseriesGroupResponseTTLParams, diff --git a/src/resources/radar/email/email.ts b/src/resources/radar/email/email.ts index 460238da53..e490d29630 100644 --- a/src/resources/radar/email/email.ts +++ b/src/resources/radar/email/email.ts @@ -2,9 +2,21 @@ import { APIResource } from '../../../resource'; import * as RoutingAPI from './routing/routing'; -import { Routing } from './routing/routing'; +import { + Routing, + RoutingSummaryV2Params, + RoutingSummaryV2Response, + RoutingTimeseriesGroupsV2Params, + RoutingTimeseriesGroupsV2Response, +} from './routing/routing'; import * as SecurityAPI from './security/security'; -import { Security } from './security/security'; +import { + Security, + SecuritySummaryV2Params, + SecuritySummaryV2Response, + SecurityTimeseriesGroupsV2Params, + SecurityTimeseriesGroupsV2Response, +} from './security/security'; export class Email extends APIResource { routing: RoutingAPI.Routing = new RoutingAPI.Routing(this._client); @@ -42,7 +54,19 @@ Email.Security = Security; export declare namespace Email { export { type RadarEmailSeries as RadarEmailSeries, type RadarEmailSummary as RadarEmailSummary }; - export { Routing as Routing }; + export { + Routing as Routing, + type RoutingSummaryV2Response as RoutingSummaryV2Response, + type RoutingTimeseriesGroupsV2Response as RoutingTimeseriesGroupsV2Response, + type RoutingSummaryV2Params as RoutingSummaryV2Params, + type RoutingTimeseriesGroupsV2Params as RoutingTimeseriesGroupsV2Params, + }; - export { Security as Security }; + export { + Security as Security, + type SecuritySummaryV2Response as SecuritySummaryV2Response, + type SecurityTimeseriesGroupsV2Response as SecurityTimeseriesGroupsV2Response, + type SecuritySummaryV2Params as SecuritySummaryV2Params, + type SecurityTimeseriesGroupsV2Params as SecurityTimeseriesGroupsV2Params, + }; } diff --git a/src/resources/radar/email/index.ts b/src/resources/radar/email/index.ts index 0e113c2250..47de1d26d8 100644 --- a/src/resources/radar/email/index.ts +++ b/src/resources/radar/email/index.ts @@ -1,5 +1,17 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Email, type RadarEmailSeries, type RadarEmailSummary } from './email'; -export { Routing } from './routing/index'; -export { Security } from './security/index'; +export { + Routing, + type RoutingSummaryV2Response, + type RoutingTimeseriesGroupsV2Response, + type RoutingSummaryV2Params, + type RoutingTimeseriesGroupsV2Params, +} from './routing/index'; +export { + Security, + type SecuritySummaryV2Response, + type SecurityTimeseriesGroupsV2Response, + type SecuritySummaryV2Params, + type SecurityTimeseriesGroupsV2Params, +} from './security/index'; diff --git a/src/resources/radar/email/routing/index.ts b/src/resources/radar/email/routing/index.ts index a7447f6d0f..4e2cf69ee7 100644 --- a/src/resources/radar/email/routing/index.ts +++ b/src/resources/radar/email/routing/index.ts @@ -1,6 +1,12 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Routing } from './routing'; +export { + Routing, + type RoutingSummaryV2Response, + type RoutingTimeseriesGroupsV2Response, + type RoutingSummaryV2Params, + type RoutingTimeseriesGroupsV2Params, +} from './routing'; export { Summary, type SummaryARCResponse, diff --git a/src/resources/radar/email/routing/routing.ts b/src/resources/radar/email/routing/routing.ts index f4c5d68359..49efcfd36c 100644 --- a/src/resources/radar/email/routing/routing.ts +++ b/src/resources/radar/email/routing/routing.ts @@ -1,6 +1,8 @@ // 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 SummaryAPI from './summary'; import { Summary, @@ -39,12 +41,439 @@ export class Routing extends APIResource { timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( this._client, ); + + /** + * Retrieves the distribution of email routing metrics by the specified dimension. + * + * @example + * ```ts + * const response = await client.radar.email.routing.summaryV2( + * 'IP_VERSION', + * ); + * ``` + */ + summaryV2( + dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', + query?: RoutingSummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', + query: RoutingSummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/email/routing/summary/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: RoutingSummaryV2Response }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of email routing metrics grouped by dimension over + * time. + * + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroupsV2( + * 'IP_VERSION', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', + query?: RoutingTimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', + query: RoutingTimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/email/routing/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: RoutingTimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface RoutingSummaryV2Response { + /** + * Metadata for the results. + */ + meta: RoutingSummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace RoutingSummaryV2Response { + /** + * 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 RoutingTimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + meta: RoutingTimeseriesGroupsV2Response.Meta; + + serie_0: RoutingTimeseriesGroupsV2Response.Serie0; +} + +export namespace RoutingTimeseriesGroupsV2Response { + /** + * 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 RoutingSummaryV2Params { + /** + * Filters results by ARC (Authenticated Received Chain) validation. + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * 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 DKIM (DomainKeys Identified Mail) validation status. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by DMARC (Domain-based Message Authentication, Reporting and + * Conformance) validation status. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by encryption status (encrypted vs. not-encrypted). + */ + encrypted?: Array<'ENCRYPTED' | 'NOT_ENCRYPTED'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by SPF (Sender Policy Framework) validation status. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export interface RoutingTimeseriesGroupsV2Params { + /** + * 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 ARC (Authenticated Received Chain) validation. + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * 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 DKIM (DomainKeys Identified Mail) validation status. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by DMARC (Domain-based Message Authentication, Reporting and + * Conformance) validation status. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by encryption status (encrypted vs. not-encrypted). + */ + encrypted?: Array<'ENCRYPTED' | 'NOT_ENCRYPTED'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by SPF (Sender Policy Framework) validation status. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; } Routing.Summary = Summary; Routing.TimeseriesGroups = TimeseriesGroups; export declare namespace Routing { + export { + type RoutingSummaryV2Response as RoutingSummaryV2Response, + type RoutingTimeseriesGroupsV2Response as RoutingTimeseriesGroupsV2Response, + type RoutingSummaryV2Params as RoutingSummaryV2Params, + type RoutingTimeseriesGroupsV2Params as RoutingTimeseriesGroupsV2Params, + }; + export { Summary as Summary, type SummaryARCResponse as SummaryARCResponse, diff --git a/src/resources/radar/email/routing/summary.ts b/src/resources/radar/email/routing/summary.ts index 4085dc05e9..00defd2b84 100644 --- a/src/resources/radar/email/routing/summary.ts +++ b/src/resources/radar/email/routing/summary.ts @@ -10,11 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.arc(); - * ``` + * @deprecated */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -36,11 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.dkim(); - * ``` + * @deprecated */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -62,11 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.dmarc(); - * ``` + * @deprecated */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -88,11 +76,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted). * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.encrypted(); - * ``` + * @deprecated */ encrypted( query?: SummaryEncryptedParams, @@ -116,11 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by IP version. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -145,11 +125,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.spf(); - * ``` + * @deprecated */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/email/routing/timeseries-groups.ts b/src/resources/radar/email/routing/timeseries-groups.ts index c398945534..3a9801b143 100644 --- a/src/resources/radar/email/routing/timeseries-groups.ts +++ b/src/resources/radar/email/routing/timeseries-groups.ts @@ -10,11 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.arc(); - * ``` + * @deprecated */ arc( query?: TimeseriesGroupARCParams, @@ -40,11 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.dkim(); - * ``` + * @deprecated */ dkim( query?: TimeseriesGroupDKIMParams, @@ -70,11 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.dmarc(); - * ``` + * @deprecated */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -100,11 +88,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted) over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.encrypted(); - * ``` + * @deprecated */ encrypted( query?: TimeseriesGroupEncryptedParams, @@ -129,11 +113,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -159,11 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.spf(); - * ``` + * @deprecated */ spf( query?: TimeseriesGroupSPFParams, diff --git a/src/resources/radar/email/security/index.ts b/src/resources/radar/email/security/index.ts index b48f43fb39..01cfb4dade 100644 --- a/src/resources/radar/email/security/index.ts +++ b/src/resources/radar/email/security/index.ts @@ -1,6 +1,12 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Security } from './security'; +export { + Security, + type SecuritySummaryV2Response, + type SecurityTimeseriesGroupsV2Response, + type SecuritySummaryV2Params, + type SecurityTimeseriesGroupsV2Params, +} from './security'; export { Summary, type SummaryARCResponse, diff --git a/src/resources/radar/email/security/security.ts b/src/resources/radar/email/security/security.ts index c1c1c5f337..a4b1700f96 100644 --- a/src/resources/radar/email/security/security.ts +++ b/src/resources/radar/email/security/security.ts @@ -1,6 +1,8 @@ // 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 SummaryAPI from './summary'; import { Summary, @@ -54,6 +56,469 @@ export class Security extends APIResource { timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( this._client, ); + + /** + * Retrieves the distribution of email security metrics by the specified dimension. + * + * @example + * ```ts + * const response = + * await client.radar.email.security.summaryV2('SPAM'); + * ``` + */ + summaryV2( + dimension: + | 'SPAM' + | 'MALICIOUS' + | 'SPOOF' + | 'THREAT_CATEGORY' + | 'ARC' + | 'DKIM' + | 'DMARC' + | 'SPF' + | 'TLS_VERSION', + query?: SecuritySummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'SPAM' + | 'MALICIOUS' + | 'SPOOF' + | 'THREAT_CATEGORY' + | 'ARC' + | 'DKIM' + | 'DMARC' + | 'SPF' + | 'TLS_VERSION', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'SPAM' + | 'MALICIOUS' + | 'SPOOF' + | 'THREAT_CATEGORY' + | 'ARC' + | 'DKIM' + | 'DMARC' + | 'SPF' + | 'TLS_VERSION', + query: SecuritySummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/email/security/summary/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: SecuritySummaryV2Response }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of email security metrics grouped by dimension over + * time. + * + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroupsV2( + * 'SPAM', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: + | 'SPAM' + | 'MALICIOUS' + | 'SPOOF' + | 'THREAT_CATEGORY' + | 'ARC' + | 'DKIM' + | 'DMARC' + | 'SPF' + | 'TLS_VERSION', + query?: SecurityTimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'SPAM' + | 'MALICIOUS' + | 'SPOOF' + | 'THREAT_CATEGORY' + | 'ARC' + | 'DKIM' + | 'DMARC' + | 'SPF' + | 'TLS_VERSION', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'SPAM' + | 'MALICIOUS' + | 'SPOOF' + | 'THREAT_CATEGORY' + | 'ARC' + | 'DKIM' + | 'DMARC' + | 'SPF' + | 'TLS_VERSION', + query: SecurityTimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/email/security/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: SecurityTimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SecuritySummaryV2Response { + /** + * Metadata for the results. + */ + meta: SecuritySummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace SecuritySummaryV2Response { + /** + * 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 SecurityTimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + meta: SecurityTimeseriesGroupsV2Response.Meta; + + serie_0: SecurityTimeseriesGroupsV2Response.Serie0; +} + +export namespace SecurityTimeseriesGroupsV2Response { + /** + * 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 SecuritySummaryV2Params { + /** + * Filters results by ARC (Authenticated Received Chain) validation. + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * 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 DKIM (DomainKeys Identified Mail) validation status. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by DMARC (Domain-based Message Authentication, Reporting and + * Conformance) validation status. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by SPF (Sender Policy Framework) validation status. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by TLS version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3'>; +} + +export interface SecurityTimeseriesGroupsV2Params { + /** + * 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 ARC (Authenticated Received Chain) validation. + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * 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 DKIM (DomainKeys Identified Mail) validation status. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by DMARC (Domain-based Message Authentication, Reporting and + * Conformance) validation status. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by SPF (Sender Policy Framework) validation status. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by TLS version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3'>; } Security.Top = Top; @@ -61,6 +526,13 @@ Security.Summary = Summary; Security.TimeseriesGroups = TimeseriesGroups; export declare namespace Security { + export { + type SecuritySummaryV2Response as SecuritySummaryV2Response, + type SecurityTimeseriesGroupsV2Response as SecurityTimeseriesGroupsV2Response, + type SecuritySummaryV2Params as SecuritySummaryV2Params, + type SecurityTimeseriesGroupsV2Params as SecurityTimeseriesGroupsV2Params, + }; + export { Top as Top }; export { diff --git a/src/resources/radar/email/security/summary.ts b/src/resources/radar/email/security/summary.ts index 3a984c2f4f..5136a742ff 100644 --- a/src/resources/radar/email/security/summary.ts +++ b/src/resources/radar/email/security/summary.ts @@ -10,11 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.arc(); - * ``` + * @deprecated */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -36,11 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.dkim(); - * ``` + * @deprecated */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -62,11 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.dmarc(); - * ``` + * @deprecated */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -87,11 +75,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by malicious classification. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.malicious(); - * ``` + * @deprecated */ malicious( query?: SummaryMaliciousParams, @@ -115,11 +99,7 @@ export class Summary extends APIResource { /** * Retrieves the proportion of emails by spam classification (spam vs. non-spam). * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.spam(); - * ``` + * @deprecated */ spam(query?: SummarySpamParams, options?: Core.RequestOptions): Core.APIPromise; spam(options?: Core.RequestOptions): Core.APIPromise; @@ -141,11 +121,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.spf(); - * ``` + * @deprecated */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; @@ -167,11 +143,7 @@ export class Summary extends APIResource { * Retrieves the proportion of emails by spoof classification (spoof vs. * non-spoof). * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.spoof(); - * ``` + * @deprecated */ spoof(query?: SummarySpoofParams, options?: Core.RequestOptions): Core.APIPromise; spoof(options?: Core.RequestOptions): Core.APIPromise; @@ -192,11 +164,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by threat categories. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.threatCategory(); - * ``` + * @deprecated */ threatCategory( query?: SummaryThreatCategoryParams, @@ -221,11 +189,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by TLS version. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.tlsVersion(); - * ``` + * @deprecated */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/email/security/timeseries-groups.ts b/src/resources/radar/email/security/timeseries-groups.ts index 2fb9bbef99..aa620088a0 100644 --- a/src/resources/radar/email/security/timeseries-groups.ts +++ b/src/resources/radar/email/security/timeseries-groups.ts @@ -10,11 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.arc(); - * ``` + * @deprecated */ arc( query?: TimeseriesGroupARCParams, @@ -40,11 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.dkim(); - * ``` + * @deprecated */ dkim( query?: TimeseriesGroupDKIMParams, @@ -70,11 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.dmarc(); - * ``` + * @deprecated */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -99,11 +87,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by malicious classification over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.malicious(); - * ``` + * @deprecated */ malicious( query?: TimeseriesGroupMaliciousParams, @@ -129,11 +113,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spam classification (spam vs. non-spam) * over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.spam(); - * ``` + * @deprecated */ spam( query?: TimeseriesGroupSpamParams, @@ -159,11 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.spf(); - * ``` + * @deprecated */ spf( query?: TimeseriesGroupSPFParams, @@ -189,11 +165,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spoof classification (spoof vs. * non-spoof) over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.spoof(); - * ``` + * @deprecated */ spoof( query?: TimeseriesGroupSpoofParams, @@ -218,11 +190,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by threat category over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.threatCategory(); - * ``` + * @deprecated */ threatCategory( query?: TimeseriesGroupThreatCategoryParams, @@ -247,11 +215,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by TLS version over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.tlsVersion(); - * ``` + * @deprecated */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/entities/asns.ts b/src/resources/radar/entities/asns.ts index 66ecf4a6e9..7697e9dd84 100644 --- a/src/resources/radar/entities/asns.ts +++ b/src/resources/radar/entities/asns.ts @@ -194,10 +194,20 @@ export namespace ASNAsSetResponse { */ name: string; + /** + * The AS number following hierarchical AS-SET name + */ + hierarchical_asn?: number; + /** * The inferred AS number of the AS-SET */ - asn?: number; + inferred_asn?: number; + + /** + * The AS number matching PeeringDB record + */ + peeringdb_asn?: number; } } diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index a9f5840d83..8bade1de40 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -1,7 +1,15 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { AI } from './ai/index'; -export { AS112, type AS112TimeseriesResponse, type AS112TimeseriesParams } from './as112/index'; +export { + AS112, + type AS112SummaryV2Response, + type AS112TimeseriesResponse, + type AS112TimeseriesGroupsV2Response, + type AS112SummaryV2Params, + type AS112TimeseriesParams, + type AS112TimeseriesGroupsV2Params, +} from './as112/index'; export { Annotations, type AnnotationListResponse, type AnnotationListParams } from './annotations/index'; export { Attacks } from './attacks/index'; export { BGP, type BGPTimeseriesResponse, type BGPTimeseriesParams } from './bgp/index'; @@ -27,7 +35,15 @@ export { type CtTimeseriesParams, type CtTimeseriesGroupsParams, } from './ct/index'; -export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns/index'; +export { + DNS, + type DNSSummaryV2Response, + type DNSTimeseriesResponse, + type DNSTimeseriesGroupsV2Response, + type DNSSummaryV2Params, + type DNSTimeseriesParams, + type DNSTimeseriesGroupsV2Params, +} from './dns/index'; export { Datasets, type DatasetListResponse, diff --git a/src/resources/radar/netflows/netflows.ts b/src/resources/radar/netflows/netflows.ts index e94d801f26..2b4c86b9ae 100644 --- a/src/resources/radar/netflows/netflows.ts +++ b/src/resources/radar/netflows/netflows.ts @@ -13,7 +13,7 @@ export class Netflows extends APIResource { * Retrieves the distribution of network traffic (NetFlows) by HTTP vs other * protocols. * - * @deprecated + * @deprecated Use [Get Network Traffic Distribution By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/netflows/methods/summary_v2/) instead. */ summary( query?: NetflowSummaryParams, diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 523d08c47e..1349fb443f 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -33,7 +33,15 @@ import { AI } from './ai/ai'; import * as AnnotationsAPI from './annotations/annotations'; import { AnnotationListParams, AnnotationListResponse, Annotations } from './annotations/annotations'; import * as AS112API from './as112/as112'; -import { AS112, AS112TimeseriesParams, AS112TimeseriesResponse } from './as112/as112'; +import { + AS112, + AS112SummaryV2Params, + AS112SummaryV2Response, + AS112TimeseriesGroupsV2Params, + AS112TimeseriesGroupsV2Response, + AS112TimeseriesParams, + AS112TimeseriesResponse, +} from './as112/as112'; import * as AttacksAPI from './attacks/attacks'; import { Attacks } from './attacks/attacks'; import * as BGPAPI from './bgp/bgp'; @@ -63,7 +71,15 @@ import { CtTimeseriesResponse, } from './ct/ct'; import * as DNSAPI from './dns/dns'; -import { DNS, DNSTimeseriesParams, DNSTimeseriesResponse } from './dns/dns'; +import { + DNS, + DNSSummaryV2Params, + DNSSummaryV2Response, + DNSTimeseriesGroupsV2Params, + DNSTimeseriesGroupsV2Response, + DNSTimeseriesParams, + DNSTimeseriesResponse, +} from './dns/dns'; import * as EmailAPI from './email/email'; import { Email, RadarEmailSeries, RadarEmailSummary } from './email/email'; import * as EntitiesAPI from './entities/entities'; @@ -223,8 +239,12 @@ export declare namespace Radar { export { DNS as DNS, + type DNSSummaryV2Response as DNSSummaryV2Response, type DNSTimeseriesResponse as DNSTimeseriesResponse, + type DNSTimeseriesGroupsV2Response as DNSTimeseriesGroupsV2Response, + type DNSSummaryV2Params as DNSSummaryV2Params, type DNSTimeseriesParams as DNSTimeseriesParams, + type DNSTimeseriesGroupsV2Params as DNSTimeseriesGroupsV2Params, }; export { @@ -249,8 +269,12 @@ export declare namespace Radar { export { AS112 as AS112, + type AS112SummaryV2Response as AS112SummaryV2Response, type AS112TimeseriesResponse as AS112TimeseriesResponse, + type AS112TimeseriesGroupsV2Response as AS112TimeseriesGroupsV2Response, + type AS112SummaryV2Params as AS112SummaryV2Params, type AS112TimeseriesParams as AS112TimeseriesParams, + type AS112TimeseriesGroupsV2Params as AS112TimeseriesGroupsV2Params, }; export { diff --git a/src/resources/stream/downloads.ts b/src/resources/stream/downloads.ts index a9d2589f13..1fd7a50c02 100644 --- a/src/resources/stream/downloads.ts +++ b/src/resources/stream/downloads.ts @@ -6,7 +6,8 @@ import * as Core from '../../core'; export class Downloads extends APIResource { /** * Creates a download for a video when a video is ready to view. Use - * `/downloads/{download_type}` instead for type-specific downloads. + * `/downloads/{download_type}` instead for type-specific downloads. Available + * types are `default` and `audio`. * * @example * ```ts @@ -35,7 +36,7 @@ export class Downloads extends APIResource { /** * Delete the downloads for a video. Use `/downloads/{download_type}` instead for - * type-specific downloads. + * type-specific downloads. Available types are `default` and `audio`. * * @example * ```ts diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts index 8b15a53e2d..4af2451c88 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts @@ -168,7 +168,7 @@ export namespace BindingGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; 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 9170366dbd..78e5e95423 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -616,7 +616,7 @@ export namespace ScriptUpdateParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; 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 fea3a53ffc..216456a041 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -247,7 +247,7 @@ export namespace SettingEditResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -999,7 +999,7 @@ export namespace SettingGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1769,7 +1769,7 @@ export namespace SettingEditParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; diff --git a/src/resources/workers/beta/workers/versions.ts b/src/resources/workers/beta/workers/versions.ts index 300510fc56..185cea7033 100644 --- a/src/resources/workers/beta/workers/versions.ts +++ b/src/resources/workers/beta/workers/versions.ts @@ -409,7 +409,7 @@ export namespace Version { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1263,7 +1263,7 @@ export namespace VersionCreateParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; diff --git a/src/resources/workers/beta/workers/workers.ts b/src/resources/workers/beta/workers/workers.ts index ba7791704e..d4e49b0055 100644 --- a/src/resources/workers/beta/workers/workers.ts +++ b/src/resources/workers/beta/workers/workers.ts @@ -193,6 +193,11 @@ export interface Worker { */ observability: Worker.Observability; + /** + * Other resources that reference the Worker and depend on it existing. + */ + references: Worker.References; + /** * Subdomain settings for the Worker. */ @@ -259,6 +264,139 @@ export namespace Worker { } } + /** + * Other resources that reference the Worker and depend on it existing. + */ + export interface References { + /** + * Other Workers that reference the Worker as an outbound for a dispatch namespace. + */ + dispatch_namespace_outbounds: Array; + + /** + * Custom domains connected to the Worker. + */ + domains: Array; + + /** + * Other Workers that reference Durable Object classes implemented by the Worker. + */ + durable_objects: Array; + + /** + * Queues that send messages to the Worker. + */ + queues: Array; + + /** + * Other Workers that reference the Worker using + * [service bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/). + */ + workers: Array; + } + + export namespace References { + export interface DispatchNamespaceOutbound { + /** + * ID of the dispatch namespace. + */ + namespace_id: string; + + /** + * Name of the dispatch namespace. + */ + namespace_name: string; + + /** + * ID of the Worker using the dispatch namespace. + */ + worker_id: string; + + /** + * Name of the Worker using the dispatch namespace. + */ + worker_name: string; + } + + export interface Domain { + /** + * ID of the custom domain. + */ + id: string; + + /** + * ID of the TLS certificate issued for the custom domain. + */ + certificate_id: string; + + /** + * Full hostname of the custom domain, including the zone name. + */ + hostname: string; + + /** + * ID of the zone. + */ + zone_id: string; + + /** + * Name of the zone. + */ + zone_name: string; + } + + export interface DurableObject { + /** + * ID of the Durable Object namespace being used. + */ + namespace_id: string; + + /** + * Name of the Durable Object namespace being used. + */ + namespace_name: string; + + /** + * ID of the Worker using the Durable Object implementation. + */ + worker_id: string; + + /** + * Name of the Worker using the Durable Object implementation. + */ + worker_name: string; + } + + export interface Queue { + /** + * ID of the queue consumer configuration. + */ + queue_consumer_id: string; + + /** + * ID of the queue. + */ + queue_id: string; + + /** + * Name of the queue. + */ + queue_name: string; + } + + export interface Worker { + /** + * ID of the referencing Worker. + */ + id: string; + + /** + * Name of the referencing Worker. + */ + name: string; + } + } + /** * Subdomain settings for the Worker. */ 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/workers/scripts/script-and-version-settings.ts b/src/resources/workers/scripts/script-and-version-settings.ts index 05bc7152a0..d6ef7552ca 100644 --- a/src/resources/workers/scripts/script-and-version-settings.ts +++ b/src/resources/workers/scripts/script-and-version-settings.ts @@ -243,7 +243,7 @@ export namespace ScriptAndVersionSettingEditResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -995,7 +995,7 @@ export namespace ScriptAndVersionSettingGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1765,7 +1765,7 @@ export namespace ScriptAndVersionSettingEditParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index d96bb354dc..70546d5580 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -925,7 +925,7 @@ export namespace ScriptUpdateParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; diff --git a/src/resources/workers/scripts/versions.ts b/src/resources/workers/scripts/versions.ts index d4334609ad..c9027b6f0c 100644 --- a/src/resources/workers/scripts/versions.ts +++ b/src/resources/workers/scripts/versions.ts @@ -245,7 +245,7 @@ export namespace VersionCreateResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -981,7 +981,7 @@ export namespace VersionGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1634,6 +1634,11 @@ export namespace VersionCreateParams { export namespace Metadata { export interface Annotations { + /** + * Associated alias for a version. + */ + 'workers/alias'?: string; + /** * Human-readable message about the version. Truncated to 100 bytes. */ @@ -1740,7 +1745,7 @@ export namespace VersionCreateParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; 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 2740494438..8ab49d5567 100644 --- a/src/resources/workflows/instances/instances.ts +++ b/src/resources/workflows/instances/instances.ts @@ -1,429 +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: `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. - */ - date_end?: string; - - /** - * Query param: Accepts ISO 8601 with no timezone offsets and in UTC. - */ - date_start?: string; - - /** - * Query param: should only be used when `cursor` is used, defines a new direction - * for the cursor - */ - direction?: 'asc' | 'desc'; - - /** - * 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/devices/dex-tests.ts b/src/resources/zero-trust/devices/dex-tests.ts index 4446969263..024ac99cae 100644 --- a/src/resources/zero-trust/devices/dex-tests.ts +++ b/src/resources/zero-trust/devices/dex-tests.ts @@ -13,7 +13,10 @@ export class DEXTests extends APIResource { * const dexTest = * await client.zeroTrust.devices.dexTests.create({ * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: {}, + * data: { + * host: 'https://dash.cloudflare.com', + * kind: 'http', + * }, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -40,7 +43,10 @@ export class DEXTests extends APIResource { * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: {}, + * data: { + * host: 'https://dash.cloudflare.com', + * kind: 'http', + * }, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -271,24 +277,24 @@ export namespace DEXTestCreateResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -351,24 +357,24 @@ export namespace DEXTestUpdateResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -431,24 +437,24 @@ export namespace DEXTestListResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -516,24 +522,24 @@ export namespace DEXTestDeleteResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -597,24 +603,24 @@ export namespace DEXTestGetResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -680,24 +686,24 @@ export namespace DEXTestCreateParams { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -763,24 +769,24 @@ export namespace DEXTestUpdateParams { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default 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/zero-trust/dex/dex.ts b/src/resources/zero-trust/dex/dex.ts index f12a3ad01f..a500404035 100644 --- a/src/resources/zero-trust/dex/dex.ts +++ b/src/resources/zero-trust/dex/dex.ts @@ -29,6 +29,7 @@ import { FleetStatusLiveParams, FleetStatusLiveResponse, FleetStatusOverTimeParams, + FleetStatusOverTimeResponse, LiveStat, } from './fleet-status/fleet-status'; import * as HTTPTestsAPI from './http-tests/http-tests'; @@ -53,6 +54,9 @@ export class DEX extends APIResource { } export interface DigitalExperienceMonitor { + /** + * API Resource UUID tag. + */ id: string; /** @@ -208,6 +212,7 @@ export declare namespace DEX { FleetStatus as FleetStatus, type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, + type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts index a64c26da75..43f7978b75 100644 --- a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts +++ b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts @@ -44,20 +44,25 @@ export class FleetStatus extends APIResource { * * @example * ```ts - * await client.zeroTrust.dex.fleetStatus.overTime({ - * account_id: '01a7362d577a6c3019a474fd6f485823', - * from: '2023-10-11T00:00:00Z', - * to: '2023-10-11T00:00:00Z', - * }); + * const response = + * await client.zeroTrust.dex.fleetStatus.overTime({ + * account_id: '01a7362d577a6c3019a474fd6f485823', + * from: '2023-10-11T00:00:00Z', + * to: '2023-10-11T00:00:00Z', + * }); * ``` */ - overTime(params: FleetStatusOverTimeParams, options?: Core.RequestOptions): Core.APIPromise { + overTime( + params: FleetStatusOverTimeParams, + options?: Core.RequestOptions, + ): Core.APIPromise { const { account_id, ...query } = params; - return this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { - query, - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + return ( + this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { + query, + ...options, + }) as Core.APIPromise<{ result: FleetStatusOverTimeResponse }> + )._thenUnwrap((obj) => obj.result); } } @@ -93,6 +98,53 @@ export namespace FleetStatusLiveResponse { } } +export interface FleetStatusOverTimeResponse { + deviceStats?: FleetStatusOverTimeResponse.DeviceStats; +} + +export namespace FleetStatusOverTimeResponse { + export interface DeviceStats { + byMode?: Array; + + byStatus?: Array; + + /** + * Number of unique devices + */ + uniqueDevicesTotal?: number; + } + + export namespace DeviceStats { + export interface ByMode { + /** + * Timestamp in ISO format + */ + timestamp?: string; + + /** + * Number of unique devices + */ + uniqueDevicesTotal?: number; + + value?: string; + } + + export interface ByStatus { + /** + * Timestamp in ISO format + */ + timestamp?: string; + + /** + * Number of unique devices + */ + uniqueDevicesTotal?: number; + + value?: string; + } + } +} + export interface FleetStatusLiveParams { /** * Path param: Unique identifier for account @@ -139,6 +191,7 @@ export declare namespace FleetStatus { export { type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, + type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/index.ts b/src/resources/zero-trust/dex/fleet-status/index.ts index 31cdb34bb8..8bf3ee7730 100644 --- a/src/resources/zero-trust/dex/fleet-status/index.ts +++ b/src/resources/zero-trust/dex/fleet-status/index.ts @@ -10,6 +10,7 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, + type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status'; diff --git a/src/resources/zero-trust/dex/index.ts b/src/resources/zero-trust/dex/index.ts index f97aa02d43..d0f4eae54c 100644 --- a/src/resources/zero-trust/dex/index.ts +++ b/src/resources/zero-trust/dex/index.ts @@ -20,6 +20,7 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, + type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status/index'; diff --git a/src/resources/zones/settings.ts b/src/resources/zones/settings.ts index 0838680bb9..4a3ad6c613 100644 --- a/src/resources/zones/settings.ts +++ b/src/resources/zones/settings.ts @@ -301,13 +301,8 @@ export interface BrowserCacheTTL { id?: 'browser_cache_ttl'; /** - * The number of seconds to cache resources for. Minimum values by plan: - * - * - Free: 7200 seconds (2 hours) - * - Pro: 3600 seconds (1 hour) - * - Business: 1 second - * - Enterprise: 1 second Setting this to 0 enables "Respect Existing Headers" and - * is allowed for all plans. + * The number of seconds to cache resources for. Setting this to 0 enables "Respect + * Existing Headers". */ value?: number; } @@ -319,13 +314,8 @@ export interface BrowserCacheTTLParam { id?: 'browser_cache_ttl'; /** - * The number of seconds to cache resources for. Minimum values by plan: - * - * - Free: 7200 seconds (2 hours) - * - Pro: 3600 seconds (1 hour) - * - Business: 1 second - * - Enterprise: 1 second Setting this to 0 enables "Respect Existing Headers" and - * is allowed for all plans. + * The number of seconds to cache resources for. Setting this to 0 enables "Respect + * Existing Headers". */ value?: number; } @@ -1102,6 +1092,10 @@ export interface PseudoIPV4 { modified_on?: string | null; } +/** + * @deprecated This page rule is deprecated. This functionality is no longer + * supported. + */ export interface ResponseBuffering { /** * Turn on or off whether Cloudflare should wait for an entire file from the origin @@ -1116,6 +1110,10 @@ export interface ResponseBuffering { value?: 'on' | 'off'; } +/** + * @deprecated This page rule is deprecated. This functionality is no longer + * supported. + */ export interface ResponseBufferingParam { /** * Turn on or off whether Cloudflare should wait for an entire file from the origin @@ -2215,10 +2213,8 @@ export namespace SettingEditResponse { } /** - * Enables or disables buffering of responses from the proxied server. Cloudflare - * may buffer the whole payload to deliver it at once to the client versus allowing - * it to be delivered in chunks. By default, the proxied server streams directly - * and is not buffered by Cloudflare. This is limited to Enterprise Zones. + * @deprecated This zone setting is deprecated. This functionality is no longer + * supported. */ export interface ZonesSchemasResponseBuffering { /** @@ -3258,10 +3254,8 @@ export namespace SettingGetResponse { } /** - * Enables or disables buffering of responses from the proxied server. Cloudflare - * may buffer the whole payload to deliver it at once to the client versus allowing - * it to be delivered in chunks. By default, the proxied server streams directly - * and is not buffered by Cloudflare. This is limited to Enterprise Zones. + * @deprecated This zone setting is deprecated. This functionality is no longer + * supported. */ export interface ZonesSchemasResponseBuffering { /** diff --git a/tests/api-resources/alerting/destinations/webhooks.test.ts b/tests/api-resources/alerting/destinations/webhooks.test.ts index 400214bb31..f7e64ac407 100644 --- a/tests/api-resources/alerting/destinations/webhooks.test.ts +++ b/tests/api-resources/alerting/destinations/webhooks.test.ts @@ -38,14 +38,11 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('update: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.update( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'Slack Webhook', - url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', - }, - ); + const responsePromise = client.alerting.destinations.webhooks.update('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'Slack Webhook', + url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -57,15 +54,12 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('update: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.update( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - name: 'Slack Webhook', - url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', - secret: 'secret', - }, - ); + const response = await client.alerting.destinations.webhooks.update('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'Slack Webhook', + url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + secret: 'secret', + }); }); test('list: only required params', async () => { @@ -88,10 +82,9 @@ describe('resource webhooks', () => { }); test('delete: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.delete( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); + const responsePromise = client.alerting.destinations.webhooks.delete('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -102,18 +95,16 @@ describe('resource webhooks', () => { }); test('delete: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.delete( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); + const response = await client.alerting.destinations.webhooks.delete('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('get: only required params', async () => { - const responsePromise = client.alerting.destinations.webhooks.get( - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); + const responsePromise = client.alerting.destinations.webhooks.get('b115d5ec15c641ee8b7692c449b5227b', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -125,7 +116,7 @@ describe('resource webhooks', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4291 test.skip('get: required and optional params', async () => { - const response = await client.alerting.destinations.webhooks.get('b115d5ec-15c6-41ee-8b76-92c449b5227b', { + const response = await client.alerting.destinations.webhooks.get('b115d5ec15c641ee8b7692c449b5227b', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/alerting/policies.test.ts b/tests/api-resources/alerting/policies.test.ts index aed5640624..c3b23203ae 100644 --- a/tests/api-resources/alerting/policies.test.ts +++ b/tests/api-resources/alerting/policies.test.ts @@ -35,9 +35,9 @@ describe('resource policies', () => { alert_type: 'universal_ssl_event_type', enabled: true, mechanisms: { - email: [{ id: 'test@example.com' }], - pagerduty: [{ id: 'e8133a15-00a4-4d69-aec1-32f70c51f6e5' }], - webhooks: [{ id: '14cc1190-5d2b-4b98-a696-c424cb2ad05f' }], + email: [{ id: 'id' }], + pagerduty: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], + webhooks: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], }, name: 'SSL Notification Event Policy', alert_interval: '30m', @@ -83,6 +83,7 @@ describe('resource policies', () => { traffic_exclusions: ['security_events'], tunnel_id: ['string'], tunnel_name: ['string'], + type: ['string'], where: ['string'], zones: ['string'], }, @@ -91,7 +92,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('update: only required params', async () => { - const responsePromise = client.alerting.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', { + const responsePromise = client.alerting.policies.update('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -105,7 +106,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('update: required and optional params', async () => { - const response = await client.alerting.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', { + const response = await client.alerting.policies.update('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', alert_interval: '30m', alert_type: 'universal_ssl_event_type', @@ -152,13 +153,14 @@ describe('resource policies', () => { traffic_exclusions: ['security_events'], tunnel_id: ['string'], tunnel_name: ['string'], + type: ['string'], where: ['string'], zones: ['string'], }, mechanisms: { - email: [{ id: 'test@example.com' }], - pagerduty: [{ id: 'e8133a15-00a4-4d69-aec1-32f70c51f6e5' }], - webhooks: [{ id: '14cc1190-5d2b-4b98-a696-c424cb2ad05f' }], + email: [{ id: 'id' }], + pagerduty: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], + webhooks: [{ id: 'f174e90afafe4643bbbc4a0ed4fc8415' }], }, name: 'SSL Notification Event Policy', }); @@ -180,7 +182,7 @@ describe('resource policies', () => { }); test('delete: only required params', async () => { - const responsePromise = client.alerting.policies.delete('0da2b59e-f118-439d-8097-bdfb215203c9', { + const responsePromise = client.alerting.policies.delete('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -193,14 +195,14 @@ describe('resource policies', () => { }); test('delete: required and optional params', async () => { - const response = await client.alerting.policies.delete('0da2b59e-f118-439d-8097-bdfb215203c9', { + const response = await client.alerting.policies.delete('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('get: only required params', async () => { - const responsePromise = client.alerting.policies.get('0da2b59e-f118-439d-8097-bdfb215203c9', { + const responsePromise = client.alerting.policies.get('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -214,7 +216,7 @@ describe('resource policies', () => { // prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9327225061/job/25676826349?pr=482#step:5:4274 test.skip('get: required and optional params', async () => { - const response = await client.alerting.policies.get('0da2b59e-f118-439d-8097-bdfb215203c9', { + const response = await client.alerting.policies.get('0da2b59ef118439d8097bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts b/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts deleted file mode 100644 index 9bd29bee68..0000000000 --- a/tests/api-resources/cloudforce-one/threat-events/indicator-types.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 indicatorTypes', () => { - // TODO: HTTP 401 from prism - test.skip('list: only required params', async () => { - const responsePromise = client.cloudforceOne.threatEvents.indicatorTypes.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); - }); - - // TODO: HTTP 401 from prism - test.skip('list: required and optional params', async () => { - const response = await client.cloudforceOne.threatEvents.indicatorTypes.list({ - account_id: 'account_id', - }); - }); -}); 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 a543062bc0..d69492f799 100644 --- a/tests/api-resources/kv/namespaces/namespaces.test.ts +++ b/tests/api-resources/kv/namespaces/namespaces.test.ts @@ -69,7 +69,7 @@ describe('resource namespaces', () => { direction: 'asc', order: 'id', page: 1, - per_page: 1, + per_page: 5, }); }); @@ -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 03fbaa4b52..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: {}, }); }); diff --git a/tests/api-resources/leaked-credential-checks/detections.test.ts b/tests/api-resources/leaked-credential-checks/detections.test.ts deleted file mode 100644 index f9a1af0b8e..0000000000 --- a/tests/api-resources/leaked-credential-checks/detections.test.ts +++ /dev/null @@ -1,98 +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 detections', () => { - test('create: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.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.leakedCredentialChecks.detections.create({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - password: 'lookup_json_string(http.request.body.raw, "secret")', - username: 'lookup_json_string(http.request.body.raw, "user")', - }); - }); - - test('update: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.update( - '18a14bafaa8eb1df04ce683ec18c765e', - { 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('update: required and optional params', async () => { - const response = await client.leakedCredentialChecks.detections.update( - '18a14bafaa8eb1df04ce683ec18c765e', - { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - password: 'lookup_json_string(http.request.body.raw, "secret")', - username: 'lookup_json_string(http.request.body.raw, "user")', - }, - ); - }); - - test('list: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.list({ - 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('list: required and optional params', async () => { - const response = await client.leakedCredentialChecks.detections.list({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - }); - - test('delete: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.delete( - '18a14bafaa8eb1df04ce683ec18c765e', - { 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('delete: required and optional params', async () => { - const response = await client.leakedCredentialChecks.detections.delete( - '18a14bafaa8eb1df04ce683ec18c765e', - { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); - }); -}); diff --git a/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts b/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts deleted file mode 100644 index c7c208f9ed..0000000000 --- a/tests/api-resources/leaked-credential-checks/leaked-credential-checks.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 leakedCredentialChecks', () => { - test('create: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.create({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - enabled: true, - }); - }); - - test('get: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); - }); -}); 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/organizations/organization-profile.test.ts b/tests/api-resources/organizations/organization-profile.test.ts index 538af4ce1e..84e064f2c7 100644 --- a/tests/api-resources/organizations/organization-profile.test.ts +++ b/tests/api-resources/organizations/organization-profile.test.ts @@ -11,13 +11,16 @@ const client = new Cloudflare({ describe('resource organizationProfile', () => { test('update: only required params', async () => { - const responsePromise = client.organizations.organizationProfile.update('organization_id', { - business_address: 'business_address', - business_email: 'business_email', - business_name: 'business_name', - business_phone: 'business_phone', - external_metadata: 'external_metadata', - }); + const responsePromise = client.organizations.organizationProfile.update( + 'a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', + { + business_address: 'business_address', + business_email: 'business_email', + business_name: 'business_name', + business_phone: 'business_phone', + external_metadata: 'external_metadata', + }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -28,17 +31,20 @@ describe('resource organizationProfile', () => { }); test('update: required and optional params', async () => { - const response = await client.organizations.organizationProfile.update('organization_id', { - business_address: 'business_address', - business_email: 'business_email', - business_name: 'business_name', - business_phone: 'business_phone', - external_metadata: 'external_metadata', - }); + const response = await client.organizations.organizationProfile.update( + 'a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', + { + business_address: 'business_address', + business_email: 'business_email', + business_name: 'business_name', + business_phone: 'business_phone', + external_metadata: 'external_metadata', + }, + ); }); test('get', async () => { - const responsePromise = client.organizations.organizationProfile.get('organization_id'); + const responsePromise = client.organizations.organizationProfile.get('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -51,7 +57,9 @@ describe('resource organizationProfile', () => { 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.organizations.organizationProfile.get('organization_id', { path: '/_stainless_unknown_path' }), + client.organizations.organizationProfile.get('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', { + path: '/_stainless_unknown_path', + }), ).rejects.toThrow(Cloudflare.NotFoundError); }); }); diff --git a/tests/api-resources/organizations/organizations.test.ts b/tests/api-resources/organizations/organizations.test.ts index ea45081967..8f918319cb 100644 --- a/tests/api-resources/organizations/organizations.test.ts +++ b/tests/api-resources/organizations/organizations.test.ts @@ -24,7 +24,7 @@ describe('resource organizations', () => { test('create: required and optional params', async () => { const response = await client.organizations.create({ name: 'name', - parent: { id: 'id' }, + parent: { id: 'a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8' }, profile: { business_address: 'business_address', business_email: 'business_email', @@ -36,7 +36,7 @@ describe('resource organizations', () => { }); test('update: only required params', async () => { - const responsePromise = client.organizations.update('organization_id', { name: 'name' }); + const responsePromise = client.organizations.update('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', { name: 'name' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -47,9 +47,9 @@ describe('resource organizations', () => { }); test('update: required and optional params', async () => { - const response = await client.organizations.update('organization_id', { + const response = await client.organizations.update('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', { name: 'name', - parent: { id: 'id' }, + parent: { id: 'a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8' }, profile: { business_address: 'business_address', business_email: 'business_email', @@ -60,8 +60,43 @@ describe('resource organizations', () => { }); }); + test('list', async () => { + const responsePromise = client.organizations.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.organizations.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.organizations.list( + { + id: ['a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8'], + containing: { account: 'account', organization: 'organization', user: 'user' }, + name: { contains: 'contains', endsWith: 'endsWith', startsWith: 'startsWith' }, + page_size: 0, + page_token: 'page_token', + parent: { id: 'a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8' }, + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + test('delete', async () => { - const responsePromise = client.organizations.delete('organization_id'); + const responsePromise = client.organizations.delete('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -74,12 +109,12 @@ describe('resource organizations', () => { test('delete: 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.organizations.delete('organization_id', { path: '/_stainless_unknown_path' }), + client.organizations.delete('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); test('get', async () => { - const responsePromise = client.organizations.get('organization_id'); + const responsePromise = client.organizations.get('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -92,7 +127,7 @@ describe('resource organizations', () => { 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.organizations.get('organization_id', { path: '/_stainless_unknown_path' }), + client.organizations.get('a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); }); diff --git a/tests/api-resources/pages/projects/deployments/deployments.test.ts b/tests/api-resources/pages/projects/deployments/deployments.test.ts index 41d5114e2a..67899467e8 100644 --- a/tests/api-resources/pages/projects/deployments/deployments.test.ts +++ b/tests/api-resources/pages/projects/deployments/deployments.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({ @@ -28,7 +28,19 @@ describe('resource deployments', () => { test.skip('create: required and optional params', async () => { const response = await client.pages.projects.deployments.create('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + _headers: await toFile(Buffer.from('# my file contents'), 'README.md'), + _redirects: await toFile(Buffer.from('# my file contents'), 'README.md'), + '_routes.json': await toFile(Buffer.from('# my file contents'), 'README.md'), + '_worker.bundle': await toFile(Buffer.from('# my file contents'), 'README.md'), + '_worker.js': await toFile(Buffer.from('# my file contents'), 'README.md'), branch: 'staging', + commit_dirty: 'false', + commit_hash: 'a1b2c3d4e5f6', + commit_message: 'Update homepage', + 'functions-filepath-routing-config.json': await toFile(Buffer.from('# my file contents'), 'README.md'), + manifest: '{"index.html": "abc123", "style.css": "def456"}', + pages_build_output_dir: 'dist', + wrangler_config_hash: 'wrangler_config_hash', }); }); diff --git a/tests/api-resources/pages/projects/projects.test.ts b/tests/api-resources/pages/projects/projects.test.ts index 2057a0124d..4f2c4122e8 100644 --- a/tests/api-resources/pages/projects/projects.test.ts +++ b/tests/api-resources/pages/projects/projects.test.ts @@ -11,7 +11,11 @@ const client = new Cloudflare({ describe('resource projects', () => { test('create: only required params', async () => { - const responsePromise = client.pages.projects.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = client.pages.projects.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'my-pages-app', + production_branch: 'main', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -24,6 +28,8 @@ describe('resource projects', () => { test('create: required and optional params', async () => { const response = await client.pages.projects.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'my-pages-app', + production_branch: 'main', build_config: { build_caching: true, build_command: 'npm run build', @@ -35,15 +41,19 @@ describe('resource projects', () => { deployment_configs: { preview: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, + always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - compatibility_date: '2022-01-01', + build_image_major_version: 3, + compatibility_date: '2025-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, + fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, + limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -55,19 +65,25 @@ describe('resource projects', () => { service: 'example-worker', }, }, + usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, + wrangler_config_hash: 'abc123def456', }, production: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, + always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - compatibility_date: '2022-01-01', + build_image_major_version: 3, + compatibility_date: '2025-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, + fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, + limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -79,26 +95,26 @@ describe('resource projects', () => { service: 'example-worker', }, }, + usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, + wrangler_config_hash: 'abc123def456', }, }, - name: 'NextJS Blog', - production_branch: 'main', source: { config: { deployments_enabled: true, - owner: 'owner', + owner: 'my-org', path_excludes: ['string'], path_includes: ['string'], pr_comments_enabled: true, preview_branch_excludes: ['string'], preview_branch_includes: ['string'], preview_deployment_setting: 'all', - production_branch: 'production_branch', + production_branch: 'main', production_deployments_enabled: true, - repo_name: 'repo_name', + repo_name: 'my-repo', }, - type: 'type', + type: 'github', }, }); }); @@ -115,7 +131,11 @@ describe('resource projects', () => { }); test('list: required and optional params', async () => { - const response = await client.pages.projects.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const response = await client.pages.projects.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + page: 1, + per_page: 10, + }); }); test('delete: only required params', async () => { @@ -140,6 +160,8 @@ describe('resource projects', () => { test('edit: only required params', async () => { const responsePromise = client.pages.projects.edit('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'my-pages-app', + production_branch: 'main', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -153,6 +175,8 @@ describe('resource projects', () => { test('edit: required and optional params', async () => { const response = await client.pages.projects.edit('this-is-my-project-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'my-pages-app', + production_branch: 'main', build_config: { build_caching: true, build_command: 'npm run build', @@ -164,15 +188,19 @@ describe('resource projects', () => { deployment_configs: { preview: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, + always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - compatibility_date: '2022-01-01', + build_image_major_version: 3, + compatibility_date: '2025-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, + fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, + limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -184,19 +212,25 @@ describe('resource projects', () => { service: 'example-worker', }, }, + usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, + wrangler_config_hash: 'abc123def456', }, production: { ai_bindings: { AI_BINDING: { project_id: 'some-project-id' } }, + always_use_latest_compatibility_date: false, analytics_engine_datasets: { ANALYTICS_ENGINE_BINDING: { dataset: 'api_analytics' } }, browsers: { BROWSER: {} }, - compatibility_date: '2022-01-01', + build_image_major_version: 3, + compatibility_date: '2025-01-01', compatibility_flags: ['url_standard'], d1_databases: { D1_BINDING: { id: '445e2955-951a-43f8-a35b-a4d0c8138f63' } }, durable_object_namespaces: { DO_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, env_vars: { foo: { type: 'plain_text', value: 'hello world' } }, + fail_open: true, hyperdrive_bindings: { HYPERDRIVE: { id: 'a76a99bc342644deb02c38d66082262a' } }, kv_namespaces: { KV_BINDING: { namespace_id: '5eb63bbbe01eeed093cb22bb8f5acdc3' } }, + limits: { cpu_ms: 100 }, mtls_certificates: { MTLS: { certificate_id: 'd7cdd17c-916f-4cb7-aabe-585eb382ec4e' } }, placement: { mode: 'smart' }, queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } }, @@ -208,26 +242,26 @@ describe('resource projects', () => { service: 'example-worker', }, }, + usage_model: 'standard', vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } }, + wrangler_config_hash: 'abc123def456', }, }, - name: 'NextJS Blog', - production_branch: 'main', source: { config: { deployments_enabled: true, - owner: 'owner', + owner: 'my-org', path_excludes: ['string'], path_includes: ['string'], pr_comments_enabled: true, preview_branch_excludes: ['string'], preview_branch_includes: ['string'], preview_deployment_setting: 'all', - production_branch: 'production_branch', + production_branch: 'main', production_deployments_enabled: true, - repo_name: 'repo_name', + repo_name: 'my-repo', }, - type: 'type', + type: 'github', }, }); }); diff --git a/tests/api-resources/pipelines.test.ts b/tests/api-resources/pipelines.test.ts index 40730e8ec8..390a133372 100644 --- a/tests/api-resources/pipelines.test.ts +++ b/tests/api-resources/pipelines.test.ts @@ -12,7 +12,7 @@ const client = new Cloudflare({ describe('resource pipelines', () => { test('create: only required params', async () => { const responsePromise = client.pipelines.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', destination: { batch: {}, compression: {}, @@ -39,7 +39,7 @@ describe('resource pipelines', () => { test('create: required and optional params', async () => { const response = await client.pipelines.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', destination: { batch: { max_bytes: 1000, max_duration_s: 0.25, max_rows: 100 }, compression: { type: 'gzip' }, @@ -64,7 +64,7 @@ describe('resource pipelines', () => { test('update: only required params', async () => { const responsePromise = client.pipelines.update('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', destination: { batch: {}, compression: {}, format: 'json', path: { bucket: 'bucket' }, type: 'r2' }, name: 'sample_pipeline', source: [{ format: 'json', type: 'type' }], @@ -80,7 +80,7 @@ describe('resource pipelines', () => { test('update: required and optional params', async () => { const response = await client.pipelines.update('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', destination: { batch: { max_bytes: 1000, max_duration_s: 0.25, max_rows: 100 }, compression: { type: 'gzip' }, @@ -104,7 +104,7 @@ describe('resource pipelines', () => { }); test('list: only required params', async () => { - const responsePromise = client.pipelines.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = client.pipelines.list({ account_id: '0123105f4ecef8ad9ca31a8372d0c353' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -116,7 +116,7 @@ describe('resource pipelines', () => { test('list: required and optional params', async () => { const response = await client.pipelines.list({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', page: 'page', per_page: 'per_page', search: 'search', @@ -125,7 +125,7 @@ describe('resource pipelines', () => { test('delete: only required params', async () => { const responsePromise = client.pipelines.delete('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -138,13 +138,13 @@ describe('resource pipelines', () => { test('delete: required and optional params', async () => { const response = await client.pipelines.delete('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', }); }); test('get: only required params', async () => { const responsePromise = client.pipelines.get('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -157,7 +157,7 @@ describe('resource pipelines', () => { test('get: required and optional params', async () => { const response = await client.pipelines.get('sample_pipeline', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', + account_id: '0123105f4ecef8ad9ca31a8372d0c353', }); }); }); diff --git a/tests/api-resources/queues/consumers.test.ts b/tests/api-resources/queues/consumers.test.ts index e4275cc8e0..9cff12967c 100644 --- a/tests/api-resources/queues/consumers.test.ts +++ b/tests/api-resources/queues/consumers.test.ts @@ -115,27 +115,4 @@ describe('resource consumers', () => { { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); }); - - test('get: only required params', async () => { - const responsePromise = client.queues.consumers.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '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('get: required and optional params', async () => { - const response = await client.queues.consumers.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); - }); }); 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/queues/subscriptions.test.ts b/tests/api-resources/queues/subscriptions.test.ts deleted file mode 100644 index fed29a3ae9..0000000000 --- a/tests/api-resources/queues/subscriptions.test.ts +++ /dev/null @@ -1,101 +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 subscriptions', () => { - test('create: only required params', async () => { - const responsePromise = client.queues.subscriptions.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.queues.subscriptions.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - destination: { queue_id: 'queue_id', type: 'queues.queue' }, - enabled: true, - events: ['string'], - name: 'name', - source: { type: 'images' }, - }); - }); - - test('update: only required params', async () => { - const responsePromise = client.queues.subscriptions.update('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('update: required and optional params', async () => { - const response = await client.queues.subscriptions.update('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - destination: { queue_id: 'queue_id', type: 'queues.queue' }, - enabled: true, - events: ['string'], - name: 'name', - }); - }); - - test('list: only required params', async () => { - const responsePromise = client.queues.subscriptions.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.queues.subscriptions.list({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - direction: 'asc', - order: 'created_at', - page: 1, - per_page: 1, - }); - }); - - test('delete: only required params', async () => { - const responsePromise = client.queues.subscriptions.delete('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('delete: required and optional params', async () => { - const response = await client.queues.subscriptions.delete('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - }); -}); diff --git a/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts b/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts index c3238ed19b..597bcca970 100644 --- a/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts +++ b/tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts @@ -11,7 +11,12 @@ const client = new Cloudflare({ describe('resource connectivityPrecheck', () => { test('source: only required params', async () => { - const responsePromise = client.r2.superSlurper.connectivityPrecheck.source({ account_id: 'account_id' }); + const responsePromise = client.r2.superSlurper.connectivityPrecheck.source({ + account_id: 'account_id', + bucket: 'bucket', + secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, + vendor: 's3', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,14 +30,21 @@ describe('resource connectivityPrecheck', () => { const response = await client.r2.superSlurper.connectivityPrecheck.source({ account_id: 'account_id', bucket: 'bucket', - endpoint: 'endpoint', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 's3', + endpoint: 'endpoint', + pathPrefix: 'pathPrefix', + region: 'region', }); }); test('target: only required params', async () => { - const responsePromise = client.r2.superSlurper.connectivityPrecheck.target({ account_id: 'account_id' }); + const responsePromise = client.r2.superSlurper.connectivityPrecheck.target({ + account_id: 'account_id', + bucket: 'bucket', + secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, + vendor: 'r2', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -46,9 +58,9 @@ describe('resource connectivityPrecheck', () => { const response = await client.r2.superSlurper.connectivityPrecheck.target({ account_id: 'account_id', bucket: 'bucket', - jurisdiction: 'default', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 'r2', + jurisdiction: 'default', }); }); }); diff --git a/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts b/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts index 8376af108a..e2806bfb82 100644 --- a/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts +++ b/tests/api-resources/r2/super-slurper/jobs/jobs.test.ts @@ -27,15 +27,17 @@ describe('resource jobs', () => { overwrite: true, source: { bucket: 'bucket', - endpoint: 'endpoint', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 's3', + endpoint: 'endpoint', + pathPrefix: 'pathPrefix', + region: 'region', }, target: { bucket: 'bucket', - jurisdiction: 'default', secret: { accessKeyId: 'accessKeyId', secretAccessKey: 'secretAccessKey' }, vendor: 'r2', + jurisdiction: 'default', }, }); }); diff --git a/tests/api-resources/radar/as112/as112.test.ts b/tests/api-resources/radar/as112/as112.test.ts index c6ff5db158..3b30d3a5e2 100644 --- a/tests/api-resources/radar/as112/as112.test.ts +++ b/tests/api-resources/radar/as112/as112.test.ts @@ -10,6 +10,47 @@ const client = new Cloudflare({ }); describe('resource as112', () => { + test('summaryV2', async () => { + const responsePromise = client.radar.as112.summaryV2('DNSSEC'); + 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('summaryV2: 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.as112.summaryV2('DNSSEC', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summaryV2: 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.as112.summaryV2( + 'DNSSEC', + { + 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'], + protocol: 'UDP', + queryType: 'A', + responseCode: 'NOERROR', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + test('timeseries', async () => { const responsePromise = client.radar.as112.timeseries(); const rawResponse = await responsePromise.asResponse(); @@ -49,4 +90,46 @@ describe('resource as112', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); + + test('timeseriesGroupsV2', async () => { + const responsePromise = client.radar.as112.timeseriesGroupsV2('DNSSEC'); + 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('timeseriesGroupsV2: 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.as112.timeseriesGroupsV2('DNSSEC', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2: 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.as112.timeseriesGroupsV2( + 'DNSSEC', + { + aggInterval: '1h', + 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'], + protocol: 'UDP', + queryType: 'A', + responseCode: 'NOERROR', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/radar/attacks/layer3/layer3.test.ts b/tests/api-resources/radar/attacks/layer3/layer3.test.ts index b3d845624c..9f5162d959 100644 --- a/tests/api-resources/radar/attacks/layer3/layer3.test.ts +++ b/tests/api-resources/radar/attacks/layer3/layer3.test.ts @@ -10,6 +10,47 @@ const client = new Cloudflare({ }); describe('resource layer3', () => { + test('summaryV2', async () => { + const responsePromise = client.radar.attacks.layer3.summaryV2('PROTOCOL'); + 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('summaryV2: 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.attacks.layer3.summaryV2('PROTOCOL', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summaryV2: 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.attacks.layer3.summaryV2( + 'PROTOCOL', + { + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4'], + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + protocol: ['UDP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + test('timeseries', async () => { const responsePromise = client.radar.attacks.layer3.timeseries(); const rawResponse = await responsePromise.asResponse(); @@ -52,4 +93,47 @@ describe('resource layer3', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); + + test('timeseriesGroupsV2', async () => { + const responsePromise = client.radar.attacks.layer3.timeseriesGroupsV2('PROTOCOL'); + 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('timeseriesGroupsV2: 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.attacks.layer3.timeseriesGroupsV2('PROTOCOL', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2: 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.attacks.layer3.timeseriesGroupsV2( + 'PROTOCOL', + { + aggInterval: '1h', + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4'], + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + normalization: 'PERCENTAGE', + protocol: ['UDP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/radar/attacks/layer7/layer7.test.ts b/tests/api-resources/radar/attacks/layer7/layer7.test.ts index edab41b510..78d5defbed 100644 --- a/tests/api-resources/radar/attacks/layer7/layer7.test.ts +++ b/tests/api-resources/radar/attacks/layer7/layer7.test.ts @@ -10,6 +10,49 @@ const client = new Cloudflare({ }); describe('resource layer7', () => { + test('summaryV2', async () => { + const responsePromise = client.radar.attacks.layer7.summaryV2('HTTP_METHOD'); + 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('summaryV2: 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.attacks.layer7.summaryV2('HTTP_METHOD', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summaryV2: 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.attacks.layer7.summaryV2( + 'HTTP_METHOD', + { + asn: ['string'], + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + httpMethod: ['GET'], + httpVersion: ['HTTPv1'], + ipVersion: ['IPv4'], + limitPerGroup: 10, + location: ['string'], + mitigationProduct: ['DDOS'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + test('timeseries', async () => { const responsePromise = client.radar.attacks.layer7.timeseries(); const rawResponse = await responsePromise.asResponse(); @@ -52,4 +95,49 @@ describe('resource layer7', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); + + test('timeseriesGroupsV2', async () => { + const responsePromise = client.radar.attacks.layer7.timeseriesGroupsV2('HTTP_METHOD'); + 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('timeseriesGroupsV2: 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.attacks.layer7.timeseriesGroupsV2('HTTP_METHOD', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2: 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.attacks.layer7.timeseriesGroupsV2( + 'HTTP_METHOD', + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + httpMethod: ['GET'], + httpVersion: ['HTTPv1'], + ipVersion: ['IPv4'], + limitPerGroup: 10, + location: ['string'], + mitigationProduct: ['DDOS'], + name: ['main_series'], + normalization: 'PERCENTAGE', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/radar/dns/dns.test.ts b/tests/api-resources/radar/dns/dns.test.ts index bff5419da4..57b258f9f3 100644 --- a/tests/api-resources/radar/dns/dns.test.ts +++ b/tests/api-resources/radar/dns/dns.test.ts @@ -10,6 +10,50 @@ const client = new Cloudflare({ }); describe('resource dns', () => { + test('summaryV2', async () => { + const responsePromise = client.radar.dns.summaryV2('IP_VERSION'); + 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('summaryV2: 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.dns.summaryV2('IP_VERSION', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summaryV2: 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.dns.summaryV2( + 'IP_VERSION', + { + 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'], + nodata: true, + protocol: 'UDP', + queryType: 'A', + responseCode: 'NOERROR', + tld: ['string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + test('timeseries', async () => { const responsePromise = client.radar.dns.timeseries(); const rawResponse = await responsePromise.asResponse(); @@ -52,4 +96,49 @@ describe('resource dns', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); + + test('timeseriesGroupsV2', async () => { + const responsePromise = client.radar.dns.timeseriesGroupsV2('IP_VERSION'); + 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('timeseriesGroupsV2: 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.dns.timeseriesGroupsV2('IP_VERSION', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2: 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.dns.timeseriesGroupsV2( + 'IP_VERSION', + { + 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'], + nodata: true, + protocol: 'UDP', + queryType: 'A', + responseCode: 'NOERROR', + tld: ['string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/radar/email/routing/routing.test.ts b/tests/api-resources/radar/email/routing/routing.test.ts new file mode 100644 index 0000000000..c66901f98c --- /dev/null +++ b/tests/api-resources/radar/email/routing/routing.test.ts @@ -0,0 +1,97 @@ +// 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 routing', () => { + test('summaryV2', async () => { + const responsePromise = client.radar.email.routing.summaryV2('IP_VERSION'); + 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('summaryV2: 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.email.routing.summaryV2('IP_VERSION', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summaryV2: 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.email.routing.summaryV2( + 'IP_VERSION', + { + arc: ['PASS'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + dkim: ['PASS'], + dmarc: ['PASS'], + encrypted: ['ENCRYPTED'], + format: 'JSON', + ipVersion: ['IPv4'], + limitPerGroup: 10, + name: ['main_series'], + spf: ['PASS'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2', async () => { + const responsePromise = client.radar.email.routing.timeseriesGroupsV2('IP_VERSION'); + 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('timeseriesGroupsV2: 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.email.routing.timeseriesGroupsV2('IP_VERSION', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2: 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.email.routing.timeseriesGroupsV2( + 'IP_VERSION', + { + aggInterval: '1h', + arc: ['PASS'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + dkim: ['PASS'], + dmarc: ['PASS'], + encrypted: ['ENCRYPTED'], + format: 'JSON', + ipVersion: ['IPv4'], + limitPerGroup: 10, + name: ['main_series'], + spf: ['PASS'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/email/security/security.test.ts b/tests/api-resources/radar/email/security/security.test.ts new file mode 100644 index 0000000000..185796f987 --- /dev/null +++ b/tests/api-resources/radar/email/security/security.test.ts @@ -0,0 +1,95 @@ +// 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 security', () => { + test('summaryV2', async () => { + const responsePromise = client.radar.email.security.summaryV2('SPAM'); + 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('summaryV2: 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.email.security.summaryV2('SPAM', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summaryV2: 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.email.security.summaryV2( + 'SPAM', + { + arc: ['PASS'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + dkim: ['PASS'], + dmarc: ['PASS'], + format: 'JSON', + limitPerGroup: 10, + name: ['main_series'], + spf: ['PASS'], + tlsVersion: ['TLSv1_0'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2', async () => { + const responsePromise = client.radar.email.security.timeseriesGroupsV2('SPAM'); + 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('timeseriesGroupsV2: 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.email.security.timeseriesGroupsV2('SPAM', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroupsV2: 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.email.security.timeseriesGroupsV2( + 'SPAM', + { + aggInterval: '1h', + arc: ['PASS'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + dkim: ['PASS'], + dmarc: ['PASS'], + format: 'JSON', + limitPerGroup: 10, + name: ['main_series'], + spf: ['PASS'], + tlsVersion: ['TLSv1_0'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); 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/workers/scripts/versions.test.ts b/tests/api-resources/workers/scripts/versions.test.ts index 82c89f8328..437f382fd7 100644 --- a/tests/api-resources/workers/scripts/versions.test.ts +++ b/tests/api-resources/workers/scripts/versions.test.ts @@ -31,7 +31,11 @@ describe('resource versions', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', metadata: { main_module: 'worker.js', - annotations: { 'workers/message': 'Fixed worker code.', 'workers/tag': 'workers/tag' }, + annotations: { + 'workers/alias': 'staging', + 'workers/message': 'Fixed worker code.', + 'workers/tag': 'workers/tag', + }, bindings: [{ name: 'MY_ENV_VAR', text: 'my_data', type: 'plain_text' }], compatibility_date: '2021-01-01', compatibility_flags: ['nodejs_compat'], 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 cdad8d0e4b..0000000000 --- a/tests/api-resources/workflows/instances/instances.test.ts +++ /dev/null @@ -1,89 +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', - cursor: 'cursor', - date_end: '2019-12-27T18:11:19.117Z', - date_start: '2019-12-27T18:11:19.117Z', - direction: 'asc', - 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' }); - }); -}); diff --git a/tests/api-resources/zero-trust/devices/dex-tests.test.ts b/tests/api-resources/zero-trust/devices/dex-tests.test.ts index 246e9b7961..0669d5569c 100644 --- a/tests/api-resources/zero-trust/devices/dex-tests.test.ts +++ b/tests/api-resources/zero-trust/devices/dex-tests.test.ts @@ -13,7 +13,7 @@ describe('resource dexTests', () => { test('create: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.create({ account_id: '01a7362d577a6c3019a474fd6f485823', - data: {}, + data: { host: 'https://dash.cloudflare.com', kind: 'http' }, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -35,7 +35,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'id', default: true, name: 'name' }], + target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], targeted: true, }); }); @@ -43,7 +43,7 @@ describe('resource dexTests', () => { test('update: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', - data: {}, + data: { host: 'https://dash.cloudflare.com', kind: 'http' }, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -65,7 +65,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'id', default: true, name: 'name' }], + target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], targeted: true, }); }); From 32e5a342f56237f866f4b5570550f12f90a3f451 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Oct 2025 21:09:45 +0000 Subject: [PATCH 274/451] feat: docs(zero_trust_gateway_policy): add /rules/tenants endpoint to Gateway API docs * docs(zero_trust_gateway_policy): add /rules/tenants endpoint to Gateway API docs --- .stats.yml | 4 +-- api.md | 1 + src/resources/zero-trust/gateway/gateway.ts | 2 ++ src/resources/zero-trust/gateway/index.ts | 1 + src/resources/zero-trust/gateway/rules.ts | 31 +++++++++++++++++++ .../zero-trust/gateway/rules.test.ts | 19 ++++++++++++ 6 files changed, 56 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3eda3dc310..967a1f90b1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1814 +configured_endpoints: 1815 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cceecd20dfd89884f795e75b433848994bed610b79802c65104f0c70d3ada54e.yml openapi_spec_hash: c33c0e26e48c004c1781a36748d0144c -config_hash: eab23d0b8fa818f1d1dc0e9e18de4266 +config_hash: e3e634649e3d70e58e153b878d29e446 diff --git a/api.md b/api.md index 19918fe7f0..5addeb3f91 100644 --- a/api.md +++ b/api.md @@ -6036,6 +6036,7 @@ Methods: - client.zeroTrust.gateway.rules.list({ ...params }) -> GatewayRulesSinglePage - client.zeroTrust.gateway.rules.delete(ruleId, { ...params }) -> RuleDeleteResponse - client.zeroTrust.gateway.rules.get(ruleId, { ...params }) -> GatewayRule +- client.zeroTrust.gateway.rules.listTenant({ ...params }) -> GatewayRulesSinglePage - client.zeroTrust.gateway.rules.resetExpiration(ruleId, { ...params }) -> GatewayRule ### Certificates diff --git a/src/resources/zero-trust/gateway/gateway.ts b/src/resources/zero-trust/gateway/gateway.ts index aac2ee3f1c..7ef59161cc 100644 --- a/src/resources/zero-trust/gateway/gateway.ts +++ b/src/resources/zero-trust/gateway/gateway.ts @@ -77,6 +77,7 @@ import { RuleDeleteResponse, RuleGetParams, RuleListParams, + RuleListTenantParams, RuleResetExpirationParams, RuleSetting, RuleUpdateParams, @@ -355,6 +356,7 @@ export declare namespace Gateway { type RuleListParams as RuleListParams, type RuleDeleteParams as RuleDeleteParams, type RuleGetParams as RuleGetParams, + type RuleListTenantParams as RuleListTenantParams, type RuleResetExpirationParams as RuleResetExpirationParams, }; diff --git a/src/resources/zero-trust/gateway/index.ts b/src/resources/zero-trust/gateway/index.ts index 49195f0430..479df24cca 100644 --- a/src/resources/zero-trust/gateway/index.ts +++ b/src/resources/zero-trust/gateway/index.ts @@ -82,6 +82,7 @@ export { type RuleListParams, type RuleDeleteParams, type RuleGetParams, + type RuleListTenantParams, type RuleResetExpirationParams, } from './rules'; export { diff --git a/src/resources/zero-trust/gateway/rules.ts b/src/resources/zero-trust/gateway/rules.ts index 0431f40330..3187b1c5d2 100644 --- a/src/resources/zero-trust/gateway/rules.ts +++ b/src/resources/zero-trust/gateway/rules.ts @@ -124,6 +124,32 @@ export class Rules extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * List Zero Trust Gateway rules for the parent account of an account in the MSP + * configuration. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const gatewayRule of client.zeroTrust.gateway.rules.listTenant( + * { account_id: '699d98642c564d2e855e9661899b7252' }, + * )) { + * // ... + * } + * ``` + */ + listTenant( + params: RuleListTenantParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList( + `/accounts/${account_id}/gateway/rules/tenant`, + GatewayRulesSinglePage, + options, + ); + } + /** * Resets the expiration of a Zero Trust Gateway Rule if its duration elapsed and * it has a default duration. The Zero Trust Gateway Rule must have values for both @@ -1772,6 +1798,10 @@ export interface RuleGetParams { account_id: string; } +export interface RuleListTenantParams { + account_id: string; +} + export interface RuleResetExpirationParams { account_id: string; } @@ -1793,6 +1823,7 @@ export declare namespace Rules { type RuleListParams as RuleListParams, type RuleDeleteParams as RuleDeleteParams, type RuleGetParams as RuleGetParams, + type RuleListTenantParams as RuleListTenantParams, type RuleResetExpirationParams as RuleResetExpirationParams, }; } diff --git a/tests/api-resources/zero-trust/gateway/rules.test.ts b/tests/api-resources/zero-trust/gateway/rules.test.ts index c55a36a12e..7277ad8327 100644 --- a/tests/api-resources/zero-trust/gateway/rules.test.ts +++ b/tests/api-resources/zero-trust/gateway/rules.test.ts @@ -275,6 +275,25 @@ describe('resource rules', () => { }); }); + test('listTenant: only required params', async () => { + const responsePromise = client.zeroTrust.gateway.rules.listTenant({ + account_id: '699d98642c564d2e855e9661899b7252', + }); + 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('listTenant: required and optional params', async () => { + const response = await client.zeroTrust.gateway.rules.listTenant({ + account_id: '699d98642c564d2e855e9661899b7252', + }); + }); + test('resetExpiration: only required params', async () => { const responsePromise = client.zeroTrust.gateway.rules.resetExpiration( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', From 9cd117b4aae7940f892ef798f5936e4720e0d7c5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 09:39:55 +0000 Subject: [PATCH 275/451] feat: feat: add connectivity directory service APIs to openapi.stainless.yml * fix: add proper terraform annotations to connectivity_directory_service * feat: add connectivity directory service APIs to openapi.stainless.yml --- .stats.yml | 4 +- api.md | 14 + scripts/detect-breaking-changes | 3 + src/resources/zero-trust/connectivity.ts | 3 + .../zero-trust/connectivity/connectivity.ts | 15 ++ .../zero-trust/connectivity/directory.ts | 3 + .../connectivity/directory/directory.ts | 29 ++ .../connectivity/directory/index.ts | 11 + .../connectivity/directory/services.ts | 252 ++++++++++++++++++ .../zero-trust/connectivity/index.ts | 4 + src/resources/zero-trust/index.ts | 1 + src/resources/zero-trust/zero-trust.ts | 6 + .../connectivity/directory/services.test.ts | 131 +++++++++ 13 files changed, 474 insertions(+), 2 deletions(-) create mode 100644 src/resources/zero-trust/connectivity.ts create mode 100644 src/resources/zero-trust/connectivity/connectivity.ts create mode 100644 src/resources/zero-trust/connectivity/directory.ts create mode 100644 src/resources/zero-trust/connectivity/directory/directory.ts create mode 100644 src/resources/zero-trust/connectivity/directory/index.ts create mode 100644 src/resources/zero-trust/connectivity/directory/services.ts create mode 100644 src/resources/zero-trust/connectivity/index.ts create mode 100644 tests/api-resources/zero-trust/connectivity/directory/services.test.ts diff --git a/.stats.yml b/.stats.yml index 967a1f90b1..fbe00e4042 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1815 +configured_endpoints: 1820 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cceecd20dfd89884f795e75b433848994bed610b79802c65104f0c70d3ada54e.yml openapi_spec_hash: c33c0e26e48c004c1781a36748d0144c -config_hash: e3e634649e3d70e58e153b878d29e446 +config_hash: ced339c69004cc06854b37a59f5d270a diff --git a/api.md b/api.md index 5addeb3f91..f3463816a6 100644 --- a/api.md +++ b/api.md @@ -5635,6 +5635,20 @@ Methods: - client.zeroTrust.connectivitySettings.edit({ ...params }) -> ConnectivitySettingEditResponse - client.zeroTrust.connectivitySettings.get({ ...params }) -> ConnectivitySettingGetResponse +## Connectivity + +### Directory + +#### Services + +Methods: + +- client.zeroTrust.connectivity.directory.services.create({ ...params }) -> void +- client.zeroTrust.connectivity.directory.services.update(serviceId, { ...params }) -> void +- client.zeroTrust.connectivity.directory.services.list({ ...params }) -> void +- client.zeroTrust.connectivity.directory.services.delete(serviceId, { ...params }) -> void +- client.zeroTrust.connectivity.directory.services.get(serviceId, { ...params }) -> void + ## DLP ### Datasets diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index e73689a349..c33941a74d 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -474,6 +474,9 @@ TEST_PATHS=( tests/api-resources/zero-trust/tunnels/warp-connector/warp-connector.test.ts tests/api-resources/zero-trust/tunnels/warp-connector/token.test.ts tests/api-resources/zero-trust/connectivity-settings.test.ts + tests/api-resources/zero-trust/connectivity/connectivity.test.ts + tests/api-resources/zero-trust/connectivity/directory/directory.test.ts + tests/api-resources/zero-trust/connectivity/directory/services.test.ts tests/api-resources/zero-trust/dlp/dlp.test.ts tests/api-resources/zero-trust/dlp/datasets/datasets.test.ts tests/api-resources/zero-trust/dlp/datasets/upload.test.ts diff --git a/src/resources/zero-trust/connectivity.ts b/src/resources/zero-trust/connectivity.ts new file mode 100644 index 0000000000..341db75965 --- /dev/null +++ b/src/resources/zero-trust/connectivity.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './connectivity/index'; diff --git a/src/resources/zero-trust/connectivity/connectivity.ts b/src/resources/zero-trust/connectivity/connectivity.ts new file mode 100644 index 0000000000..b85d3201fd --- /dev/null +++ b/src/resources/zero-trust/connectivity/connectivity.ts @@ -0,0 +1,15 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as DirectoryAPI from './directory/directory'; +import { Directory } from './directory/directory'; + +export class Connectivity extends APIResource { + directory: DirectoryAPI.Directory = new DirectoryAPI.Directory(this._client); +} + +Connectivity.Directory = Directory; + +export declare namespace Connectivity { + export { Directory as Directory }; +} diff --git a/src/resources/zero-trust/connectivity/directory.ts b/src/resources/zero-trust/connectivity/directory.ts new file mode 100644 index 0000000000..2756bf16f7 --- /dev/null +++ b/src/resources/zero-trust/connectivity/directory.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './directory/index'; diff --git a/src/resources/zero-trust/connectivity/directory/directory.ts b/src/resources/zero-trust/connectivity/directory/directory.ts new file mode 100644 index 0000000000..0c979324a6 --- /dev/null +++ b/src/resources/zero-trust/connectivity/directory/directory.ts @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../../resource'; +import * as ServicesAPI from './services'; +import { + ServiceCreateParams, + ServiceDeleteParams, + ServiceGetParams, + ServiceListParams, + ServiceUpdateParams, + Services, +} from './services'; + +export class Directory extends APIResource { + services: ServicesAPI.Services = new ServicesAPI.Services(this._client); +} + +Directory.Services = Services; + +export declare namespace Directory { + export { + Services as Services, + type ServiceCreateParams as ServiceCreateParams, + type ServiceUpdateParams as ServiceUpdateParams, + type ServiceListParams as ServiceListParams, + type ServiceDeleteParams as ServiceDeleteParams, + type ServiceGetParams as ServiceGetParams, + }; +} diff --git a/src/resources/zero-trust/connectivity/directory/index.ts b/src/resources/zero-trust/connectivity/directory/index.ts new file mode 100644 index 0000000000..78f208d56a --- /dev/null +++ b/src/resources/zero-trust/connectivity/directory/index.ts @@ -0,0 +1,11 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { Directory } from './directory'; +export { + Services, + type ServiceCreateParams, + type ServiceUpdateParams, + type ServiceListParams, + type ServiceDeleteParams, + type ServiceGetParams, +} from './services'; diff --git a/src/resources/zero-trust/connectivity/directory/services.ts b/src/resources/zero-trust/connectivity/directory/services.ts new file mode 100644 index 0000000000..74516c9f4d --- /dev/null +++ b/src/resources/zero-trust/connectivity/directory/services.ts @@ -0,0 +1,252 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../../resource'; +import * as Core from '../../../../core'; + +export class Services extends APIResource { + /** + * Create connectivity service + * + * @example + * ```ts + * await client.zeroTrust.connectivity.directory.services.create( + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * host: {}, + * name: 'name', + * type: 'http', + * }, + * ); + * ``` + */ + create(params: ServiceCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...body } = params; + return this._client.post(`/accounts/${account_id}/connectivity/directory/services`, { + body, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); + } + + /** + * Update connectivity service + * + * @example + * ```ts + * await client.zeroTrust.connectivity.directory.services.update( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { + * account_id: 'account_id', + * host: {}, + * name: 'name', + * type: 'http', + * }, + * ); + * ``` + */ + update( + serviceId: string, + params: ServiceUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return this._client.put(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { + body, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); + } + + /** + * List connectivity services + * + * @example + * ```ts + * await client.zeroTrust.connectivity.directory.services.list( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + list(params: ServiceListParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...query } = params; + return this._client.get(`/accounts/${account_id}/connectivity/directory/services`, { + query, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); + } + + /** + * Delete connectivity service + * + * @example + * ```ts + * await client.zeroTrust.connectivity.directory.services.delete( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'account_id' }, + * ); + * ``` + */ + delete( + serviceId: string, + params: ServiceDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.delete(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); + } + + /** + * Get connectivity service + * + * @example + * ```ts + * await client.zeroTrust.connectivity.directory.services.get( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'account_id' }, + * ); + * ``` + */ + get(serviceId: string, params: ServiceGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id } = params; + return this._client.get(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); + } +} + +export interface ServiceCreateParams { + /** + * Path param: Account identifier + */ + account_id: string; + + /** + * Body param: + */ + host: ServiceCreateParams.Host; + + /** + * Body param: + */ + name: string; + + /** + * Body param: + */ + type: 'http'; + + /** + * Body param: + */ + http_port?: number | null; + + /** + * Body param: + */ + https_port?: number | null; +} + +export namespace ServiceCreateParams { + export interface Host { + hostname?: string | null; + + ipv4?: string; + + ipv6?: string; + + network?: unknown; + + resolver_network?: unknown; + } +} + +export interface ServiceUpdateParams { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + host: ServiceUpdateParams.Host; + + /** + * Body param: + */ + name: string; + + /** + * Body param: + */ + type: 'http'; + + /** + * Body param: + */ + http_port?: number | null; + + /** + * Body param: + */ + https_port?: number | null; +} + +export namespace ServiceUpdateParams { + export interface Host { + hostname?: string | null; + + ipv4?: string; + + ipv6?: string; + + network?: unknown; + + resolver_network?: unknown; + } +} + +export interface ServiceListParams { + /** + * Path param: Account identifier + */ + account_id: string; + + /** + * Query param: Current page in the response + */ + page?: number; + + /** + * Query param: Max amount of entries returned per page + */ + per_page?: number; + + /** + * Query param: + */ + type?: 'http' | null; +} + +export interface ServiceDeleteParams { + account_id: string; +} + +export interface ServiceGetParams { + account_id: string; +} + +export declare namespace Services { + export { + type ServiceCreateParams as ServiceCreateParams, + type ServiceUpdateParams as ServiceUpdateParams, + type ServiceListParams as ServiceListParams, + type ServiceDeleteParams as ServiceDeleteParams, + type ServiceGetParams as ServiceGetParams, + }; +} diff --git a/src/resources/zero-trust/connectivity/index.ts b/src/resources/zero-trust/connectivity/index.ts new file mode 100644 index 0000000000..6672dc60e6 --- /dev/null +++ b/src/resources/zero-trust/connectivity/index.ts @@ -0,0 +1,4 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { Connectivity } from './connectivity'; +export { Directory } from './directory/index'; diff --git a/src/resources/zero-trust/index.ts b/src/resources/zero-trust/index.ts index 4c4c69ca79..9ed5acfcaf 100644 --- a/src/resources/zero-trust/index.ts +++ b/src/resources/zero-trust/index.ts @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Access } from './access/index'; +export { Connectivity } from './connectivity/index'; export { ConnectivitySettings, type ConnectivitySettingEditResponse, diff --git a/src/resources/zero-trust/zero-trust.ts b/src/resources/zero-trust/zero-trust.ts index fd2a007279..657e3b8f1d 100644 --- a/src/resources/zero-trust/zero-trust.ts +++ b/src/resources/zero-trust/zero-trust.ts @@ -13,6 +13,8 @@ import * as SeatsAPI from './seats'; import { Seat, SeatEditParams, Seats, SeatsSinglePage } from './seats'; import * as AccessAPI from './access/access'; import { Access } from './access/access'; +import * as ConnectivityAPI from './connectivity/connectivity'; +import { Connectivity } from './connectivity/connectivity'; import * as DevicesAPI from './devices/devices'; import { Device, @@ -93,6 +95,7 @@ export class ZeroTrust extends APIResource { tunnels: TunnelsAPI.Tunnels = new TunnelsAPI.Tunnels(this._client); connectivitySettings: ConnectivitySettingsAPI.ConnectivitySettings = new ConnectivitySettingsAPI.ConnectivitySettings(this._client); + connectivity: ConnectivityAPI.Connectivity = new ConnectivityAPI.Connectivity(this._client); dlp: DLPAPI.DLP = new DLPAPI.DLP(this._client); gateway: GatewayAPI.Gateway = new GatewayAPI.Gateway(this._client); networks: NetworksAPI.Networks = new NetworksAPI.Networks(this._client); @@ -112,6 +115,7 @@ ZeroTrust.DEX = DEX; ZeroTrust.Tunnels = Tunnels; ZeroTrust.TunnelListResponsesV4PagePaginationArray = TunnelListResponsesV4PagePaginationArray; ZeroTrust.ConnectivitySettings = ConnectivitySettings; +ZeroTrust.Connectivity = Connectivity; ZeroTrust.DLP = DLP; ZeroTrust.Gateway = Gateway; ZeroTrust.Networks = Networks; @@ -188,6 +192,8 @@ export declare namespace ZeroTrust { type ConnectivitySettingGetParams as ConnectivitySettingGetParams, }; + export { Connectivity as Connectivity }; + export { DLP as DLP }; export { diff --git a/tests/api-resources/zero-trust/connectivity/directory/services.test.ts b/tests/api-resources/zero-trust/connectivity/directory/services.test.ts new file mode 100644 index 0000000000..4e6440e25c --- /dev/null +++ b/tests/api-resources/zero-trust/connectivity/directory/services.test.ts @@ -0,0 +1,131 @@ +// 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 services', () => { + test('create: only required params', async () => { + const responsePromise = client.zeroTrust.connectivity.directory.services.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + host: {}, + name: 'name', + type: 'http', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.zeroTrust.connectivity.directory.services.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + host: { hostname: 'hostname', ipv4: 'ipv4', ipv6: 'ipv6', network: {}, resolver_network: {} }, + name: 'name', + type: 'http', + http_port: 1, + https_port: 1, + }); + }); + + test('update: only required params', async () => { + const responsePromise = client.zeroTrust.connectivity.directory.services.update( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: 'account_id', host: {}, name: 'name', type: 'http' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('update: required and optional params', async () => { + const response = await client.zeroTrust.connectivity.directory.services.update( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { + account_id: 'account_id', + host: { hostname: 'hostname', ipv4: 'ipv4', ipv6: 'ipv6', network: {}, resolver_network: {} }, + name: 'name', + type: 'http', + http_port: 1, + https_port: 1, + }, + ); + }); + + test('list: only required params', async () => { + const responsePromise = client.zeroTrust.connectivity.directory.services.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.zeroTrust.connectivity.directory.services.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + page: 1, + per_page: 1, + type: 'http', + }); + }); + + test('delete: only required params', async () => { + const responsePromise = client.zeroTrust.connectivity.directory.services.delete( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: 'account_id' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('delete: required and optional params', async () => { + const response = await client.zeroTrust.connectivity.directory.services.delete( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: 'account_id' }, + ); + }); + + test('get: only required params', async () => { + const responsePromise = client.zeroTrust.connectivity.directory.services.get( + '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.zeroTrust.connectivity.directory.services.get( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: 'account_id' }, + ); + }); +}); From 0e54b6d8871fbf936633021ddddbb5415c569f85 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 19:24:45 +0000 Subject: [PATCH 276/451] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 197 ++- scripts/detect-breaking-changes | 19 +- src/resources/abuse-reports.ts | 886 +--------- src/resources/accounts/accounts.ts | 30 + src/resources/api-gateway/api-gateway.ts | 2 - src/resources/api-gateway/configurations.ts | 43 +- src/resources/api-gateway/index.ts | 1 - .../cloudforce-one/cloudforce-one.ts | 4 - src/resources/cloudforce-one/index.ts | 2 - .../cloudforce-one/threat-events/index.ts | 2 - .../threat-events/threat-events.ts | 79 - src/resources/custom-pages.ts | 48 +- src/resources/dns/records.ts | 88 +- 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 | 139 +- src/resources/kv/namespaces/metadata.ts | 4 +- src/resources/kv/namespaces/namespaces.ts | 164 +- src/resources/kv/namespaces/values.ts | 33 +- .../leaked-credential-checks/detections.ts | 240 ++- .../leaked-credential-checks/index.ts | 13 +- .../leaked-credential-checks.ts | 121 +- 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 +- .../connectors/snapshots/latest.ts | 22 + .../connectors/snapshots/snapshots.ts | 22 + src/resources/organizations/organizations.ts | 16 +- src/resources/queues/consumers.ts | 35 + src/resources/queues/index.ts | 19 +- src/resources/queues/messages.ts | 217 ++- src/resources/queues/queues.ts | 40 +- src/resources/queues/subscriptions.ts | 871 +++++++++- src/resources/radar/ai/bots/summary.ts | 2 +- src/resources/radar/ai/inference/summary.ts | 4 +- .../ai/inference/timeseries-groups/summary.ts | 4 +- src/resources/radar/ai/timeseries-groups.ts | 2 +- src/resources/radar/as112/summary.ts | 12 +- .../radar/as112/timeseries-groups.ts | 12 +- src/resources/radar/attacks/layer3/summary.ts | 14 +- .../radar/attacks/layer3/timeseries-groups.ts | 14 +- src/resources/radar/attacks/layer3/top/top.ts | 4 +- src/resources/radar/attacks/layer7/summary.ts | 14 +- .../radar/attacks/layer7/timeseries-groups.ts | 14 +- src/resources/radar/attacks/layer7/top/top.ts | 4 +- src/resources/radar/ct/logs.ts | 23 + src/resources/radar/dns/summary.ts | 20 +- src/resources/radar/dns/timeseries-groups.ts | 20 +- src/resources/radar/email/routing/summary.ts | 12 +- .../radar/email/routing/timeseries-groups.ts | 12 +- src/resources/radar/email/security/summary.ts | 18 +- .../radar/email/security/timeseries-groups.ts | 18 +- src/resources/radar/http/summary.ts | 16 +- src/resources/radar/http/timeseries-groups.ts | 20 +- src/resources/radar/http/top.ts | 11 +- .../radar/leaked-credentials/summary.ts | 4 +- .../leaked-credentials/timeseries-groups.ts | 4 +- src/resources/secrets-store/stores/secrets.ts | 4 +- .../dispatch/namespaces/scripts/bindings.ts | 18 - .../dispatch/namespaces/scripts/scripts.ts | 18 - .../dispatch/namespaces/scripts/settings.ts | 54 - .../workers/beta/workers/versions.ts | 36 - src/resources/workers/observability/index.ts | 12 +- .../workers/observability/observability.ts | 26 +- .../workers/observability/telemetry.ts | 1538 ++++++++++++++++- .../scripts/script-and-version-settings.ts | 54 - src/resources/workers/scripts/scripts.ts | 18 - src/resources/workers/scripts/versions.ts | 54 - src/resources/workflows/index.ts | 23 +- src/resources/workflows/instances/events.ts | 40 +- src/resources/workflows/instances/index.ts | 18 +- .../workflows/instances/instances.ts | 416 ++++- src/resources/workflows/instances/status.ts | 54 +- src/resources/workflows/versions.ts | 87 +- src/resources/workflows/workflows.ts | 274 ++- .../access/applications/applications.ts | 632 +++++-- .../zero-trust/access/logs/access-requests.ts | 19 + .../connectivity/directory/directory.ts | 11 + .../connectivity/directory/index.ts | 5 + .../connectivity/directory/services.ts | 561 +++++- src/resources/zero-trust/devices/dex-tests.ts | 80 +- .../zero-trust/devices/posture/posture.ts | 4 +- src/resources/zero-trust/dex/colos.ts | 17 +- src/resources/zero-trust/dex/dex.ts | 5 - .../dex/fleet-status/fleet-status.ts | 75 +- .../zero-trust/dex/fleet-status/index.ts | 1 - src/resources/zero-trust/dex/index.ts | 1 - .../zero-trust/dlp/entries/custom.ts | 3 +- .../zero-trust/dlp/entries/entries.ts | 3 +- .../gateway/configurations/configurations.ts | 44 +- src/resources/zero-trust/gateway/rules.ts | 58 +- tests/api-resources/abuse-reports.test.ts | 69 - tests/api-resources/accounts/accounts.test.ts | 1 + .../api-gateway/configurations.test.ts | 1 - .../threat-events/threat-events.test.ts | 17 - .../api-resources/kv/namespaces/keys.test.ts | 31 +- .../kv/namespaces/namespaces.test.ts | 33 +- .../kv/namespaces/values.test.ts | 3 +- .../detections.test.ts | 98 ++ .../leaked-credential-checks.test.ts | 49 + .../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/consumers.test.ts | 23 + tests/api-resources/queues/messages.test.ts | 43 + .../queues/subscriptions.test.ts | 101 ++ .../secrets-store/stores/secrets.test.ts | 18 +- .../workers/observability/telemetry.test.ts | 110 ++ .../workflows/instances/events.test.ts | 32 + .../workflows/instances/instances.test.ts | 89 + .../workflows/instances/status.test.ts | 33 + .../api-resources/workflows/versions.test.ts | 50 + .../api-resources/workflows/workflows.test.ts | 85 + .../access/applications/applications.test.ts | 2 + .../access/logs/access-requests.test.ts | 3 + .../connectivity/directory/services.test.ts | 33 +- .../zero-trust/devices/dex-tests.test.ts | 8 +- .../zero-trust/dlp/entries/custom.test.ts | 1 - .../zero-trust/dlp/entries/entries.test.ts | 1 - 132 files changed, 7365 insertions(+), 2186 deletions(-) delete mode 100644 tests/api-resources/abuse-reports.test.ts create mode 100644 tests/api-resources/leaked-credential-checks/detections.test.ts create mode 100644 tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts 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/queues/subscriptions.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 fbe00e4042..bc2fda8e3a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1820 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cceecd20dfd89884f795e75b433848994bed610b79802c65104f0c70d3ada54e.yml -openapi_spec_hash: c33c0e26e48c004c1781a36748d0144c +configured_endpoints: 1855 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-915bb405f875913c47f1125a42f6dd7eee490896e7cf117e35b14d8cb273cfd5.yml +openapi_spec_hash: 039c43ebe70cf009895dd0553d7eb929 config_hash: ced339c69004cc06854b37a59f5d270a diff --git a/api.md b/api.md index f3463816a6..9106d9a28d 100644 --- a/api.md +++ b/api.md @@ -129,13 +129,14 @@ Methods: Types: - Organization +- OrganizationDeleteResponse Methods: - client.organizations.create({ ...params }) -> Organization - client.organizations.update(organizationId, { ...params }) -> Organization - client.organizations.list({ ...params }) -> OrganizationsSinglePage -- client.organizations.delete(organizationId) -> void +- client.organizations.delete(organizationId) -> OrganizationDeleteResponse - client.organizations.get(organizationId) -> Organization ## OrganizationProfile @@ -1740,16 +1741,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: @@ -2239,6 +2285,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 @@ -2246,18 +2304,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 @@ -2267,12 +2326,14 @@ Types: - Key - KeyBulkDeleteResponse +- KeyBulkGetResponse - KeyBulkUpdateResponse Methods: - 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 ### Metadata @@ -2341,12 +2402,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 @@ -2372,9 +2437,24 @@ Methods: - 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 ## Subscriptions +Types: + +- SubscriptionCreateResponse +- SubscriptionUpdateResponse +- SubscriptionListResponse +- SubscriptionDeleteResponse + +Methods: + +- client.queues.subscriptions.create({ ...params }) -> SubscriptionCreateResponse +- client.queues.subscriptions.update(subscriptionId, { ...params }) -> SubscriptionUpdateResponse +- client.queues.subscriptions.list({ ...params }) -> SubscriptionListResponsesV4PagePaginationArray +- client.queues.subscriptions.delete(subscriptionId, { ...params }) -> SubscriptionDeleteResponse + # APIGateway ## Configurations @@ -2382,11 +2462,10 @@ Methods: Types: - Configuration -- ConfigurationUpdateResponse Methods: -- client.apiGateway.configurations.update({ ...params }) -> ConfigurationUpdateResponse +- client.apiGateway.configurations.update({ ...params }) -> Configuration - client.apiGateway.configurations.get({ ...params }) -> Configuration ## Discovery @@ -5432,12 +5511,11 @@ Types: - LiveStat - FleetStatusLiveResponse -- FleetStatusOverTimeResponse Methods: - client.zeroTrust.dex.fleetStatus.live({ ...params }) -> FleetStatusLiveResponse -- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> FleetStatusOverTimeResponse +- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> void #### Devices @@ -5641,13 +5719,20 @@ Methods: #### Services +Types: + +- ServiceCreateResponse +- ServiceUpdateResponse +- ServiceListResponse +- ServiceGetResponse + Methods: -- client.zeroTrust.connectivity.directory.services.create({ ...params }) -> void -- client.zeroTrust.connectivity.directory.services.update(serviceId, { ...params }) -> void -- client.zeroTrust.connectivity.directory.services.list({ ...params }) -> void +- client.zeroTrust.connectivity.directory.services.create({ ...params }) -> ServiceCreateResponse +- client.zeroTrust.connectivity.directory.services.update(serviceId, { ...params }) -> ServiceUpdateResponse +- client.zeroTrust.connectivity.directory.services.list({ ...params }) -> ServiceListResponsesV4PagePaginationArray - client.zeroTrust.connectivity.directory.services.delete(serviceId, { ...params }) -> void -- client.zeroTrust.connectivity.directory.services.get(serviceId, { ...params }) -> void +- client.zeroTrust.connectivity.directory.services.get(serviceId, { ...params }) -> ServiceGetResponse ## DLP @@ -8064,7 +8149,6 @@ Types: - ThreatEventDeleteResponse - ThreatEventBulkCreateResponse - ThreatEventEditResponse -- ThreatEventGetResponse Methods: @@ -8073,7 +8157,6 @@ Methods: - client.cloudforceOne.threatEvents.delete(eventId, { ...params }) -> ThreatEventDeleteResponse - client.cloudforceOne.threatEvents.bulkCreate({ ...params }) -> ThreatEventBulkCreateResponse - client.cloudforceOne.threatEvents.edit(eventId, { ...params }) -> ThreatEventEditResponse -- client.cloudforceOne.threatEvents.get(eventId, { ...params }) -> ThreatEventGetResponse ### Attackers @@ -8409,14 +8492,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: @@ -8471,8 +8608,32 @@ Methods: # LeakedCredentialChecks +Types: + +- LeakedCredentialCheckCreateResponse +- LeakedCredentialCheckGetResponse + +Methods: + +- client.leakedCredentialChecks.create({ ...params }) -> LeakedCredentialCheckCreateResponse +- client.leakedCredentialChecks.get({ ...params }) -> LeakedCredentialCheckGetResponse + ## Detections +Types: + +- DetectionCreateResponse +- DetectionUpdateResponse +- DetectionListResponse +- DetectionDeleteResponse + +Methods: + +- client.leakedCredentialChecks.detections.create({ ...params }) -> DetectionCreateResponse +- client.leakedCredentialChecks.detections.update(detectionId, { ...params }) -> DetectionUpdateResponse +- client.leakedCredentialChecks.detections.list({ ...params }) -> DetectionListResponsesSinglePage +- client.leakedCredentialChecks.detections.delete(detectionId, { ...params }) -> DetectionDeleteResponse + # ContentScanning Types: @@ -8517,14 +8678,6 @@ Methods: # AbuseReports -Types: - -- AbuseReportCreateResponse - -Methods: - -- client.abuseReports.create(reportType, { ...params }) -> AbuseReportCreateResponse - # AI Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index c33941a74d..095ac81632 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -145,6 +145,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 @@ -185,6 +193,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 @@ -197,6 +207,7 @@ TEST_PATHS=( tests/api-resources/queues/messages.test.ts tests/api-resources/queues/purge.test.ts tests/api-resources/queues/consumers.test.ts + tests/api-resources/queues/subscriptions.test.ts tests/api-resources/api-gateway/api-gateway.test.ts tests/api-resources/api-gateway/configurations.test.ts tests/api-resources/api-gateway/discovery/discovery.test.ts @@ -702,13 +713,19 @@ 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 + tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts + tests/api-resources/leaked-credential-checks/detections.test.ts tests/api-resources/content-scanning/content-scanning.test.ts tests/api-resources/content-scanning/payloads.test.ts tests/api-resources/content-scanning/settings.test.ts - tests/api-resources/abuse-reports.test.ts tests/api-resources/ai/ai.test.ts tests/api-resources/ai/finetunes/finetunes.test.ts tests/api-resources/ai/finetunes/assets.test.ts diff --git a/src/resources/abuse-reports.ts b/src/resources/abuse-reports.ts index 451e42c504..2a55a7e639 100644 --- a/src/resources/abuse-reports.ts +++ b/src/resources/abuse-reports.ts @@ -1,889 +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 AbuseReports extends APIResource { - /** - * Submit the Abuse Report of a particular type - */ - create( - reportType: string, - params: AbuseReportCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/abuse-reports/${reportType}`, { - body, - ...options, - }) as Core.APIPromise<{ result: AbuseReportCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -/** - * The result should be 'success' for successful response - */ -export type AbuseReportCreateResponse = string; - -export type AbuseReportCreateParams = - | AbuseReportCreateParams.AbuseReportsDmcaReport - | AbuseReportCreateParams.AbuseReportsTrademarkReport - | AbuseReportCreateParams.AbuseReportsGeneralReport - | AbuseReportCreateParams.AbuseReportsPhishingReport - | AbuseReportCreateParams.AbuseReportsCsamReport - | AbuseReportCreateParams.AbuseReportsThreatReport - | AbuseReportCreateParams.AbuseReportsRegistrarWhoisReport - | AbuseReportCreateParams.AbuseReportsNcseiReport; - -export declare namespace AbuseReportCreateParams { - export interface AbuseReportsDmcaReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: string; - - /** - * Body param: The abuse report type. - */ - act: 'abuse_dmca'; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - address1: string; - - /** - * Body param: The name of the copyright holder. Text not exceeding 60 characters. - * This field may be released by Cloudflare to third parties such as the Lumen - * Database (https://lumendatabase.org/). - */ - agent_name: string; - - /** - * Body param: Can be `0` for false or `1` for true. Must be value: 1 for DMCA - * reports - */ - agree: 1; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - city: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - country: string; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send'; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - original_work: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send'; - - /** - * Body param: Required for DMCA reports, should be same as Name. An affirmation - * that all information in the report is true and accurate while agreeing to the - * policies of Cloudflare's abuse reports - */ - signature: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - state: string; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsTrademarkReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: string; - - /** - * Body param: The abuse report type. - */ - act: 'abuse_trademark'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send'; - - /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters. - */ - justification: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send'; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_number: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_office: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_symbol: string; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsGeneralReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: string; - - /** - * Body param: The abuse report type. - */ - act: 'abuse_general'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon'; - - /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters. - */ - justification: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon' | 'none'; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: A list of IP addresses separated by ‘\n’ (new line character). The - * list of destination IPs should not exceed 30 IP addresses. Each one of the IP - * addresses ought to be unique. - */ - destination_ips?: string; - - /** - * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. - * The total size of the field should not exceed 2000 characters. Each individual - * port/protocol should not exceed 100 characters. The list should not have more - * than 30 unique ports and protocols. - */ - ports_protocols?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: A list of IP addresses separated by ‘\n’ (new line character). The - * list of source IPs should not exceed 30 IP addresses. Each one of the IP - * addresses ought to be unique. - */ - source_ips?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsPhishingReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: string; - - /** - * Body param: The abuse report type. - */ - act: 'abuse_phishing'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon'; - - /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters. - */ - justification: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon'; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - original_work?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsCsamReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: string; - - /** - * Body param: The abuse report type. - */ - act: 'abuse_children'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon'; - - /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters. - */ - justification: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - ncmec_notification: 'send' | 'send-anon'; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon' | 'none'; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - country?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsThreatReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: string; - - /** - * Body param: The abuse report type. - */ - act: 'abuse_threat'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon'; - - /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters. - */ - justification: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon'; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsRegistrarWhoisReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: string; - - /** - * Body param: The abuse report type. - */ - act: 'abuse_registrar_whois'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon' | 'none'; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsNcseiReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: string; - - /** - * Body param: The abuse report type. - */ - act: 'abuse_ncsei'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon'; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: If the submitter is the target of NCSEI in the URLs of the abuse - * report. - */ - ncsei_subject_representation: boolean; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon' | 'none'; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - country?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } -} - -export declare namespace AbuseReports { - export { - type AbuseReportCreateResponse as AbuseReportCreateResponse, - type AbuseReportCreateParams as AbuseReportCreateParams, - }; -} +export class AbuseReports extends APIResource {} diff --git a/src/resources/accounts/accounts.ts b/src/resources/accounts/accounts.ts index 1f17f46efb..332d3d488d 100644 --- a/src/resources/accounts/accounts.ts +++ b/src/resources/accounts/accounts.ts @@ -175,6 +175,11 @@ export interface Account { */ created_on?: string; + /** + * Parent container details + */ + managed_by?: Account.ManagedBy; + /** * Account settings */ @@ -182,6 +187,21 @@ export interface Account { } export namespace Account { + /** + * Parent container details + */ + export interface ManagedBy { + /** + * ID of the parent Organization, if one exists + */ + parent_org_id?: string; + + /** + * Name of the parent Organization, if one exists + */ + parent_org_name?: string; + } + /** * Account settings */ @@ -257,6 +277,11 @@ export interface AccountUpdateParams { */ type: 'standard' | 'enterprise'; + /** + * Body param: Parent container details + */ + managed_by?: AccountUpdateParams.ManagedBy; + /** * Body param: Account settings */ @@ -264,6 +289,11 @@ export interface AccountUpdateParams { } export namespace AccountUpdateParams { + /** + * Parent container details + */ + export interface ManagedBy {} + /** * Account settings */ diff --git a/src/resources/api-gateway/api-gateway.ts b/src/resources/api-gateway/api-gateway.ts index 1f9fb727e9..701ac67835 100644 --- a/src/resources/api-gateway/api-gateway.ts +++ b/src/resources/api-gateway/api-gateway.ts @@ -6,7 +6,6 @@ import { Configuration, ConfigurationGetParams, ConfigurationUpdateParams, - ConfigurationUpdateResponse, Configurations, } from './configurations'; import * as SchemasAPI from './schemas'; @@ -82,7 +81,6 @@ export declare namespace APIGateway { export { Configurations as Configurations, type Configuration as Configuration, - type ConfigurationUpdateResponse as ConfigurationUpdateResponse, type ConfigurationUpdateParams as ConfigurationUpdateParams, type ConfigurationGetParams as ConfigurationGetParams, }; diff --git a/src/resources/api-gateway/configurations.ts b/src/resources/api-gateway/configurations.ts index 5659e51452..5082ea818a 100644 --- a/src/resources/api-gateway/configurations.ts +++ b/src/resources/api-gateway/configurations.ts @@ -2,11 +2,10 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as UserSchemasAPI from './user-schemas/user-schemas'; export class Configurations extends APIResource { /** - * Set configuration properties + * Update configuration properties * * @example * ```ts @@ -19,12 +18,14 @@ export class Configurations extends APIResource { * }); * ``` */ - update( - params: ConfigurationUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + update(params: ConfigurationUpdateParams, options?: Core.RequestOptions): Core.APIPromise { const { zone_id, ...body } = params; - return this._client.put(`/zones/${zone_id}/api_gateway/configuration`, { body, ...options }); + return ( + this._client.put(`/zones/${zone_id}/api_gateway/configuration`, { + body, + ...options, + }) as Core.APIPromise<{ result: Configuration }> + )._thenUnwrap((obj) => obj.result); } /** @@ -39,12 +40,11 @@ export class Configurations extends APIResource { * ``` */ get(params: ConfigurationGetParams, options?: Core.RequestOptions): Core.APIPromise { - const { zone_id, ...query } = params; + const { zone_id } = params; return ( - this._client.get(`/zones/${zone_id}/api_gateway/configuration`, { - query, - ...options, - }) as Core.APIPromise<{ result: Configuration }> + this._client.get(`/zones/${zone_id}/api_gateway/configuration`, options) as Core.APIPromise<{ + result: Configuration; + }> )._thenUnwrap((obj) => obj.result); } } @@ -93,17 +93,6 @@ export namespace Configuration { } } -export interface ConfigurationUpdateResponse { - errors: UserSchemasAPI.Message; - - messages: UserSchemasAPI.Message; - - /** - * Whether the API call was successful. - */ - success: true; -} - export interface ConfigurationUpdateParams { /** * Path param: Identifier. @@ -159,20 +148,14 @@ export namespace ConfigurationUpdateParams { export interface ConfigurationGetParams { /** - * Path param: Identifier. + * Identifier. */ zone_id: string; - - /** - * Query param: Requests information about certain properties. - */ - properties?: Array<'auth_id_characteristics'>; } export declare namespace Configurations { export { type Configuration as Configuration, - type ConfigurationUpdateResponse as ConfigurationUpdateResponse, type ConfigurationUpdateParams as ConfigurationUpdateParams, type ConfigurationGetParams as ConfigurationGetParams, }; diff --git a/src/resources/api-gateway/index.ts b/src/resources/api-gateway/index.ts index 5941af87f3..485f8290f8 100644 --- a/src/resources/api-gateway/index.ts +++ b/src/resources/api-gateway/index.ts @@ -4,7 +4,6 @@ export { APIGateway } from './api-gateway'; export { Configurations, type Configuration, - type ConfigurationUpdateResponse, type ConfigurationUpdateParams, type ConfigurationGetParams, } from './configurations'; diff --git a/src/resources/cloudforce-one/cloudforce-one.ts b/src/resources/cloudforce-one/cloudforce-one.ts index aeabfa782e..8c4fe620ba 100644 --- a/src/resources/cloudforce-one/cloudforce-one.ts +++ b/src/resources/cloudforce-one/cloudforce-one.ts @@ -41,8 +41,6 @@ import { ThreatEventDeleteResponse, ThreatEventEditParams, ThreatEventEditResponse, - ThreatEventGetParams, - ThreatEventGetResponse, ThreatEventListParams, ThreatEventListResponse, ThreatEvents, @@ -100,12 +98,10 @@ export declare namespace CloudforceOne { type ThreatEventDeleteResponse as ThreatEventDeleteResponse, type ThreatEventBulkCreateResponse as ThreatEventBulkCreateResponse, type ThreatEventEditResponse as ThreatEventEditResponse, - type ThreatEventGetResponse as ThreatEventGetResponse, type ThreatEventCreateParams as ThreatEventCreateParams, type ThreatEventListParams as ThreatEventListParams, type ThreatEventDeleteParams as ThreatEventDeleteParams, type ThreatEventBulkCreateParams as ThreatEventBulkCreateParams, type ThreatEventEditParams as ThreatEventEditParams, - type ThreatEventGetParams as ThreatEventGetParams, }; } diff --git a/src/resources/cloudforce-one/index.ts b/src/resources/cloudforce-one/index.ts index f69388911d..77ba414bca 100644 --- a/src/resources/cloudforce-one/index.ts +++ b/src/resources/cloudforce-one/index.ts @@ -35,11 +35,9 @@ export { type ThreatEventDeleteResponse, type ThreatEventBulkCreateResponse, type ThreatEventEditResponse, - type ThreatEventGetResponse, type ThreatEventCreateParams, type ThreatEventListParams, type ThreatEventDeleteParams, type ThreatEventBulkCreateParams, type ThreatEventEditParams, - type ThreatEventGetParams, } from './threat-events/index'; diff --git a/src/resources/cloudforce-one/threat-events/index.ts b/src/resources/cloudforce-one/threat-events/index.ts index d797682ddd..d687bf1e82 100644 --- a/src/resources/cloudforce-one/threat-events/index.ts +++ b/src/resources/cloudforce-one/threat-events/index.ts @@ -53,11 +53,9 @@ export { type ThreatEventDeleteResponse, type ThreatEventBulkCreateResponse, type ThreatEventEditResponse, - type ThreatEventGetResponse, type ThreatEventCreateParams, type ThreatEventListParams, type ThreatEventDeleteParams, type ThreatEventBulkCreateParams, type ThreatEventEditParams, - type ThreatEventGetParams, } from './threat-events'; diff --git a/src/resources/cloudforce-one/threat-events/threat-events.ts b/src/resources/cloudforce-one/threat-events/threat-events.ts index d23c37b5db..87dd60711b 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -207,26 +207,6 @@ export class ThreatEvents extends APIResource { ...options, }); } - - /** - * Reads an event - * - * @example - * ```ts - * const threatEvent = - * await client.cloudforceOne.threatEvents.get('event_id', { - * account_id: 'account_id', - * }); - * ``` - */ - get( - eventId: string, - params: ThreatEventGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return this._client.get(`/accounts/${account_id}/cloudforce-one/events/${eventId}`, options); - } } export interface ThreatEventCreateResponse { @@ -392,56 +372,6 @@ export interface ThreatEventEditResponse { releasabilityId?: string; } -export interface ThreatEventGetResponse { - attacker: string; - - attackerCountry: string; - - category: string; - - date: string; - - event: string; - - indicator: string; - - indicatorType: string; - - indicatorTypeId: number; - - killChain: number; - - mitreAttack: Array; - - numReferenced: number; - - numReferences: number; - - rawId: string; - - referenced: Array; - - referencedIds: Array; - - references: Array; - - referencesIds: Array; - - tags: Array; - - targetCountry: string; - - targetIndustry: string; - - tlp: string; - - uuid: string; - - insight?: string; - - releasabilityId?: string; -} - export interface ThreatEventCreateParams { /** * Path param: Account ID. @@ -743,13 +673,6 @@ export namespace ThreatEventEditParams { } } -export interface ThreatEventGetParams { - /** - * Account ID. - */ - account_id: string; -} - ThreatEvents.Attackers = Attackers; ThreatEvents.Categories = Categories; ThreatEvents.Countries = Countries; @@ -770,13 +693,11 @@ export declare namespace ThreatEvents { type ThreatEventDeleteResponse as ThreatEventDeleteResponse, type ThreatEventBulkCreateResponse as ThreatEventBulkCreateResponse, type ThreatEventEditResponse as ThreatEventEditResponse, - type ThreatEventGetResponse as ThreatEventGetResponse, type ThreatEventCreateParams as ThreatEventCreateParams, type ThreatEventListParams as ThreatEventListParams, type ThreatEventDeleteParams as ThreatEventDeleteParams, type ThreatEventBulkCreateParams as ThreatEventBulkCreateParams, type ThreatEventEditParams as ThreatEventEditParams, - type ThreatEventGetParams as ThreatEventGetParams, }; export { diff --git a/src/resources/custom-pages.ts b/src/resources/custom-pages.ts index 4c861b1e41..6bd1b13cf7 100644 --- a/src/resources/custom-pages.ts +++ b/src/resources/custom-pages.ts @@ -24,15 +24,13 @@ export class CustomPages extends APIResource { */ update( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', params: CustomPageUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { @@ -125,42 +123,36 @@ export class CustomPages extends APIResource { */ get( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', params?: CustomPageGetParams, options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', params: CustomPageGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { diff --git a/src/resources/dns/records.ts b/src/resources/dns/records.ts index 0a09cf3cb4..b3eb5c6bb2 100644 --- a/src/resources/dns/records.ts +++ b/src/resources/dns/records.ts @@ -3701,30 +3701,30 @@ export namespace Record { } export type RecordResponse = - | RecordResponse.ARecord - | RecordResponse.AAAARecord - | RecordResponse.CNAMERecord - | RecordResponse.MXRecord - | RecordResponse.NSRecord - | RecordResponse.OpenpgpkeyRecord - | RecordResponse.PTRRecord - | RecordResponse.TXTRecord - | RecordResponse.CAARecord - | RecordResponse.CERTRecord - | RecordResponse.DNSKEYRecord - | RecordResponse.DSRecord - | RecordResponse.HTTPSRecord - | RecordResponse.LOCRecord - | RecordResponse.NAPTRRecord - | RecordResponse.SMIMEARecord - | RecordResponse.SRVRecord - | RecordResponse.SSHFPRecord - | RecordResponse.SVCBRecord - | RecordResponse.TLSARecord - | RecordResponse.URIRecord; + | RecordResponse.A + | RecordResponse.AAAA + | RecordResponse.CNAME + | RecordResponse.MX + | RecordResponse.NS + | RecordResponse.Openpgpkey + | RecordResponse.PTR + | RecordResponse.TXT + | RecordResponse.CAA + | RecordResponse.CERT + | RecordResponse.DNSKEY + | RecordResponse.DS + | RecordResponse.HTTPS + | RecordResponse.LOC + | RecordResponse.NAPTR + | RecordResponse.SMIMEA + | RecordResponse.SRV + | RecordResponse.SSHFP + | RecordResponse.SVCB + | RecordResponse.TLSA + | RecordResponse.URI; export namespace RecordResponse { - export interface ARecord extends RecordsAPI.ARecord { + export interface A extends RecordsAPI.ARecord { /** * Identifier. */ @@ -3761,7 +3761,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface AAAARecord extends RecordsAPI.AAAARecord { + export interface AAAA extends RecordsAPI.AAAARecord { /** * Identifier. */ @@ -3798,7 +3798,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface CNAMERecord extends RecordsAPI.CNAMERecord { + export interface CNAME extends RecordsAPI.CNAMERecord { /** * Identifier. */ @@ -3835,7 +3835,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface MXRecord extends RecordsAPI.MXRecord { + export interface MX extends RecordsAPI.MXRecord { /** * Identifier. */ @@ -3872,7 +3872,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface NSRecord extends RecordsAPI.NSRecord { + export interface NS extends RecordsAPI.NSRecord { /** * Identifier. */ @@ -3909,7 +3909,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface OpenpgpkeyRecord { + export interface Openpgpkey { /** * Identifier. */ @@ -3960,7 +3960,7 @@ export namespace RecordResponse { /** * Settings for the DNS record. */ - settings: OpenpgpkeyRecord.Settings; + settings: Openpgpkey.Settings; /** * Custom tags for the DNS record. This field has no effect on DNS responses. @@ -3990,7 +3990,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export namespace OpenpgpkeyRecord { + export namespace Openpgpkey { /** * Settings for the DNS record. */ @@ -4013,7 +4013,7 @@ export namespace RecordResponse { } } - export interface PTRRecord extends RecordsAPI.PTRRecord { + export interface PTR extends RecordsAPI.PTRRecord { /** * Identifier. */ @@ -4050,7 +4050,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface TXTRecord extends RecordsAPI.TXTRecord { + export interface TXT extends RecordsAPI.TXTRecord { /** * Identifier. */ @@ -4087,7 +4087,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface CAARecord extends RecordsAPI.CAARecord { + export interface CAA extends RecordsAPI.CAARecord { /** * Identifier. */ @@ -4124,7 +4124,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface CERTRecord extends RecordsAPI.CERTRecord { + export interface CERT extends RecordsAPI.CERTRecord { /** * Identifier. */ @@ -4161,7 +4161,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface DNSKEYRecord extends RecordsAPI.DNSKEYRecord { + export interface DNSKEY extends RecordsAPI.DNSKEYRecord { /** * Identifier. */ @@ -4198,7 +4198,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface DSRecord extends RecordsAPI.DSRecord { + export interface DS extends RecordsAPI.DSRecord { /** * Identifier. */ @@ -4235,7 +4235,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface HTTPSRecord extends RecordsAPI.HTTPSRecord { + export interface HTTPS extends RecordsAPI.HTTPSRecord { /** * Identifier. */ @@ -4272,7 +4272,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface LOCRecord extends RecordsAPI.LOCRecord { + export interface LOC extends RecordsAPI.LOCRecord { /** * Identifier. */ @@ -4309,7 +4309,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface NAPTRRecord extends RecordsAPI.NAPTRRecord { + export interface NAPTR extends RecordsAPI.NAPTRRecord { /** * Identifier. */ @@ -4346,7 +4346,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SMIMEARecord extends RecordsAPI.SMIMEARecord { + export interface SMIMEA extends RecordsAPI.SMIMEARecord { /** * Identifier. */ @@ -4383,7 +4383,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SRVRecord extends RecordsAPI.SRVRecord { + export interface SRV extends RecordsAPI.SRVRecord { /** * Identifier. */ @@ -4420,7 +4420,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SSHFPRecord extends RecordsAPI.SSHFPRecord { + export interface SSHFP extends RecordsAPI.SSHFPRecord { /** * Identifier. */ @@ -4457,7 +4457,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SVCBRecord extends RecordsAPI.SVCBRecord { + export interface SVCB extends RecordsAPI.SVCBRecord { /** * Identifier. */ @@ -4494,7 +4494,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface TLSARecord extends RecordsAPI.TLSARecord { + export interface TLSA extends RecordsAPI.TLSARecord { /** * Identifier. */ @@ -4531,7 +4531,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface URIRecord extends RecordsAPI.URIRecord { + export interface URI extends RecordsAPI.URIRecord { /** * Identifier. */ 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 f8b3034d84..c581632a76 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 a4db89243d..138942ad57 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. @@ -99,12 +120,12 @@ export interface Key { /** * 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 +135,49 @@ 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 { + /** + * The metadata associated with the key. + */ + metadata: unknown; + + /** + * The value associated with the key. + */ + 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,26 +189,27 @@ export interface KeyBulkUpdateResponse { export interface KeyListParams extends CursorPaginationAfterParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; /** - * Query param: The number of keys to return. The cursor attribute may be used to - * iterate over the next batch of keys if there are more than the limit. + * 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: 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; @@ -157,9 +219,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; @@ -172,39 +256,38 @@ 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. + * Arbitrary JSON that is associated with a key. */ - value?: string; + metadata?: unknown; } } @@ -214,10 +297,12 @@ export declare namespace Keys { export { type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, + type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorPaginationAfter as KeysCursorPaginationAfter, 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..927ba8a17d 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -37,11 +37,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 3ec43aa7c5..df179e53bb 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' }], * }, * ); * ``` @@ -240,13 +272,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 +286,49 @@ 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 { + /** + * The metadata associated with the key. + */ + metadata: unknown; + + /** + * The value associated with the key. + */ + 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 +340,7 @@ export interface NamespaceBulkUpdateResponse { export interface NamespaceCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -282,7 +352,7 @@ export interface NamespaceCreateParams { export interface NamespaceUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -294,7 +364,7 @@ export interface NamespaceUpdateParams { export interface NamespaceListParams extends V4PagePaginationArrayParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -311,14 +381,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 +398,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 +435,44 @@ 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. + * Arbitrary JSON that is associated with a key. */ - value?: string; + metadata?: unknown; } } export interface NamespaceGetParams { /** - * Identifier + * Identifier. */ account_id: string; } @@ -390,14 +481,14 @@ Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; Namespaces.Keys = Keys; Namespaces.KeysCursorPaginationAfter = KeysCursorPaginationAfter; 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 +496,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 +505,12 @@ export declare namespace Namespaces { Keys as Keys, type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, + type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorPaginationAfter as KeysCursorPaginationAfter, type KeyListParams as KeyListParams, type KeyBulkDeleteParams as KeyBulkDeleteParams, + type KeyBulkGetParams as KeyBulkGetParams, type KeyBulkUpdateParams as KeyBulkUpdateParams, }; @@ -427,7 +521,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 1fa5ff39ed..49566f425a 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,13 +37,8 @@ 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, - __multipartSyntax: 'json', - ...options, - headers: { 'Content-Type': '*/*', ...options?.headers }, - }), + Core.multipartFormRequestOptions({ query: { expiration, expiration_ttl }, body, + __multipartSyntax: 'json', ...options }), ) as Core.APIPromise<{ result: ValueUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } @@ -120,43 +114,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: Associates arbitrary JSON data with a key/value pair. + */ + metadata?: unknown; } export interface ValueDeleteParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface ValueGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/leaked-credential-checks/detections.ts b/src/resources/leaked-credential-checks/detections.ts index 2a6de390ad..ca2e008bd9 100644 --- a/src/resources/leaked-credential-checks/detections.ts +++ b/src/resources/leaked-credential-checks/detections.ts @@ -1,5 +1,243 @@ // 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 Detections extends APIResource {} +export class Detections extends APIResource { + /** + * Create user-defined detection pattern for Leaked Credential Checks. + * + * @example + * ```ts + * const detection = + * await client.leakedCredentialChecks.detections.create({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create( + params: DetectionCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/leaked-credential-checks/detections`, { + body, + ...options, + }) as Core.APIPromise<{ result: DetectionCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update user-defined detection pattern for Leaked Credential Checks. + * + * @example + * ```ts + * const detection = + * await client.leakedCredentialChecks.detections.update( + * '18a14bafaa8eb1df04ce683ec18c765e', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + update( + detectionId: string, + params: DetectionUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.put(`/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: DetectionUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List user-defined detection patterns for Leaked Credential Checks. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const detectionListResponse of client.leakedCredentialChecks.detections.list( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: DetectionListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { zone_id } = params; + return this._client.getAPIList( + `/zones/${zone_id}/leaked-credential-checks/detections`, + DetectionListResponsesSinglePage, + options, + ); + } + + /** + * Remove user-defined detection pattern for Leaked Credential Checks. + * + * @example + * ```ts + * const detection = + * await client.leakedCredentialChecks.detections.delete( + * '18a14bafaa8eb1df04ce683ec18c765e', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + detectionId: string, + params: DetectionDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.delete( + `/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, + options, + ) as Core.APIPromise<{ result: DetectionDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class DetectionListResponsesSinglePage extends SinglePage {} + +/** + * Defines a custom set of username/password expressions to match Leaked Credential + * Checks on. + */ +export interface DetectionCreateResponse { + /** + * Defines the unique ID for this custom detection. + */ + id?: string; + + /** + * Defines ehe ruleset expression to use in matching the password in a request. + */ + password?: string; + + /** + * Defines the ruleset expression to use in matching the username in a request. + */ + username?: string; +} + +/** + * Defines a custom set of username/password expressions to match Leaked Credential + * Checks on. + */ +export interface DetectionUpdateResponse { + /** + * Defines the unique ID for this custom detection. + */ + id?: string; + + /** + * Defines ehe ruleset expression to use in matching the password in a request. + */ + password?: string; + + /** + * Defines the ruleset expression to use in matching the username in a request. + */ + username?: string; +} + +/** + * Defines a custom set of username/password expressions to match Leaked Credential + * Checks on. + */ +export interface DetectionListResponse { + /** + * Defines the unique ID for this custom detection. + */ + id?: string; + + /** + * Defines ehe ruleset expression to use in matching the password in a request. + */ + password?: string; + + /** + * Defines the ruleset expression to use in matching the username in a request. + */ + username?: string; +} + +export type DetectionDeleteResponse = unknown; + +export interface DetectionCreateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: Defines ehe ruleset expression to use in matching the password in a + * request. + */ + password?: string; + + /** + * Body param: Defines the ruleset expression to use in matching the username in a + * request. + */ + username?: string; +} + +export interface DetectionUpdateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: Defines ehe ruleset expression to use in matching the password in a + * request. + */ + password?: string; + + /** + * Body param: Defines the ruleset expression to use in matching the username in a + * request. + */ + username?: string; +} + +export interface DetectionListParams { + /** + * Defines an identifier. + */ + zone_id: string; +} + +export interface DetectionDeleteParams { + /** + * Defines an identifier. + */ + zone_id: string; +} + +Detections.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; + +export declare namespace Detections { + export { + type DetectionCreateResponse as DetectionCreateResponse, + type DetectionUpdateResponse as DetectionUpdateResponse, + type DetectionListResponse as DetectionListResponse, + type DetectionDeleteResponse as DetectionDeleteResponse, + DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, + type DetectionCreateParams as DetectionCreateParams, + type DetectionUpdateParams as DetectionUpdateParams, + type DetectionListParams as DetectionListParams, + type DetectionDeleteParams as DetectionDeleteParams, + }; +} diff --git a/src/resources/leaked-credential-checks/index.ts b/src/resources/leaked-credential-checks/index.ts index 7e3e1a0dd7..1844848bf2 100644 --- a/src/resources/leaked-credential-checks/index.ts +++ b/src/resources/leaked-credential-checks/index.ts @@ -1,4 +1,15 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Detections } from './detections'; +export { + DetectionListResponsesSinglePage, + Detections, + type DetectionCreateResponse, + type DetectionUpdateResponse, + type DetectionListResponse, + type DetectionDeleteResponse, + type DetectionCreateParams, + type DetectionUpdateParams, + type DetectionListParams, + type DetectionDeleteParams, +} from './detections'; export { LeakedCredentialChecks } from './leaked-credential-checks'; diff --git a/src/resources/leaked-credential-checks/leaked-credential-checks.ts b/src/resources/leaked-credential-checks/leaked-credential-checks.ts index c89821160c..d8d8de90c1 100644 --- a/src/resources/leaked-credential-checks/leaked-credential-checks.ts +++ b/src/resources/leaked-credential-checks/leaked-credential-checks.ts @@ -1,15 +1,132 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; +import * as Core from '../../core'; import * as DetectionsAPI from './detections'; -import { Detections } from './detections'; +import { + DetectionCreateParams, + DetectionCreateResponse, + DetectionDeleteParams, + DetectionDeleteResponse, + DetectionListParams, + DetectionListResponse, + DetectionListResponsesSinglePage, + DetectionUpdateParams, + DetectionUpdateResponse, + Detections, +} from './detections'; export class LeakedCredentialChecks extends APIResource { detections: DetectionsAPI.Detections = new DetectionsAPI.Detections(this._client); + + /** + * Updates the current status of Leaked Credential Checks. + * + * @example + * ```ts + * const leakedCredentialCheck = + * await client.leakedCredentialChecks.create({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create( + params: LeakedCredentialCheckCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/leaked-credential-checks`, { + body, + ...options, + }) as Core.APIPromise<{ result: LeakedCredentialCheckCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the current status of Leaked Credential Checks. + * + * @example + * ```ts + * const leakedCredentialCheck = + * await client.leakedCredentialChecks.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + get( + params: LeakedCredentialCheckGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.get(`/zones/${zone_id}/leaked-credential-checks`, options) as Core.APIPromise<{ + result: LeakedCredentialCheckGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +/** + * Defines the overall status for Leaked Credential Checks. + */ +export interface LeakedCredentialCheckCreateResponse { + /** + * Determines whether or not Leaked Credential Checks are enabled. + */ + enabled?: boolean; +} + +/** + * Defines the overall status for Leaked Credential Checks. + */ +export interface LeakedCredentialCheckGetResponse { + /** + * Determines whether or not Leaked Credential Checks are enabled. + */ + enabled?: boolean; +} + +export interface LeakedCredentialCheckCreateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: Determines whether or not Leaked Credential Checks are enabled. + */ + enabled?: boolean; +} + +export interface LeakedCredentialCheckGetParams { + /** + * Defines an identifier. + */ + zone_id: string; } LeakedCredentialChecks.Detections = Detections; +LeakedCredentialChecks.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; export declare namespace LeakedCredentialChecks { - export { Detections as Detections }; + export { + type LeakedCredentialCheckCreateResponse as LeakedCredentialCheckCreateResponse, + type LeakedCredentialCheckGetResponse as LeakedCredentialCheckGetResponse, + type LeakedCredentialCheckCreateParams as LeakedCredentialCheckCreateParams, + type LeakedCredentialCheckGetParams as LeakedCredentialCheckGetParams, + }; + + export { + Detections as Detections, + type DetectionCreateResponse as DetectionCreateResponse, + type DetectionUpdateResponse as DetectionUpdateResponse, + type DetectionListResponse as DetectionListResponse, + type DetectionDeleteResponse as DetectionDeleteResponse, + DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, + type DetectionCreateParams as DetectionCreateParams, + type DetectionUpdateParams as DetectionUpdateParams, + type DetectionListParams as DetectionListParams, + type DetectionDeleteParams as DetectionDeleteParams, + }; } 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..6e40d6cfa9 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..5e289166d6 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..6f0ab3dbaa 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/connectors/snapshots/latest.ts b/src/resources/magic-transit/connectors/snapshots/latest.ts index 16d9eaff01..c51d9f1abe 100644 --- a/src/resources/magic-transit/connectors/snapshots/latest.ts +++ b/src/resources/magic-transit/connectors/snapshots/latest.ts @@ -72,6 +72,8 @@ export namespace LatestListResponse { */ v: string; + bonds?: Array; + /** * Count of processors/cores */ @@ -876,6 +878,21 @@ export namespace LatestListResponse { } export namespace Item { + /** + * Snapshot Bond + */ + export interface Bond { + /** + * Name of the network interface + */ + name: string; + + /** + * Current status of the network interface + */ + status: string; + } + /** * Snapshot DHCP lease */ @@ -1279,6 +1296,11 @@ export namespace LatestListResponse { * Connector identifier */ connector_id?: string; + + /** + * MTU as measured between the two ends of the tunnel + */ + probed_mtu?: number; } } } diff --git a/src/resources/magic-transit/connectors/snapshots/snapshots.ts b/src/resources/magic-transit/connectors/snapshots/snapshots.ts index 69b5c098e5..a7d1e0d815 100644 --- a/src/resources/magic-transit/connectors/snapshots/snapshots.ts +++ b/src/resources/magic-transit/connectors/snapshots/snapshots.ts @@ -123,6 +123,8 @@ export interface SnapshotGetResponse { */ v: string; + bonds?: Array; + /** * Count of processors/cores */ @@ -927,6 +929,21 @@ export interface SnapshotGetResponse { } export namespace SnapshotGetResponse { + /** + * Snapshot Bond + */ + export interface Bond { + /** + * Name of the network interface + */ + name: string; + + /** + * Current status of the network interface + */ + status: string; + } + /** * Snapshot DHCP lease */ @@ -1330,6 +1347,11 @@ export namespace SnapshotGetResponse { * Connector identifier */ connector_id?: string; + + /** + * MTU as measured between the two ends of the tunnel + */ + probed_mtu?: number; } } diff --git a/src/resources/organizations/organizations.ts b/src/resources/organizations/organizations.ts index edc39aac94..aa9aafb4b4 100644 --- a/src/resources/organizations/organizations.ts +++ b/src/resources/organizations/organizations.ts @@ -61,11 +61,12 @@ export class Organizations extends APIResource { * Delete an organization. The organization MUST be empty before deleting. It must * not contain any sub-organizations, accounts, members or users. */ - delete(organizationId: string, options?: Core.RequestOptions): Core.APIPromise { - return this._client.delete(`/organizations/${organizationId}`, { - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + delete(organizationId: string, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.delete(`/organizations/${organizationId}`, options) as Core.APIPromise<{ + result: OrganizationDeleteResponse; + }> + )._thenUnwrap((obj) => obj.result); } /** @@ -147,6 +148,10 @@ export namespace Organization { } } +export interface OrganizationDeleteResponse { + id: string; +} + export interface OrganizationCreateParams { name: string; @@ -290,6 +295,7 @@ Organizations.OrganizationProfileResource = OrganizationProfileResource; export declare namespace Organizations { export { type Organization as Organization, + type OrganizationDeleteResponse as OrganizationDeleteResponse, OrganizationsSinglePage as OrganizationsSinglePage, type OrganizationCreateParams as OrganizationCreateParams, type OrganizationUpdateParams as OrganizationUpdateParams, diff --git a/src/resources/queues/consumers.ts b/src/resources/queues/consumers.ts index 93596e00ee..43eae71410 100644 --- a/src/resources/queues/consumers.ts +++ b/src/resources/queues/consumers.ts @@ -106,6 +106,33 @@ export class Consumers extends APIResource { const { account_id } = params; return this._client.delete(`/accounts/${account_id}/queues/${queueId}/consumers/${consumerId}`, options); } + + /** + * Fetches the consumer for a queue by consumer id + * + * @example + * ```ts + * const consumer = await client.queues.consumers.get( + * '023e105f4ecef8ad9ca31a8372d0c353', + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + queueId: string, + consumerId: string, + params: ConsumerGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + 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); + } } export class ConsumersSinglePage extends SinglePage {} @@ -464,6 +491,13 @@ export interface ConsumerDeleteParams { account_id: string; } +export interface ConsumerGetParams { + /** + * A Resource identifier. + */ + account_id: string; +} + Consumers.ConsumersSinglePage = ConsumersSinglePage; export declare namespace Consumers { @@ -475,5 +509,6 @@ export declare namespace Consumers { 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 32568cd469..ebf2923861 100644 --- a/src/resources/queues/index.ts +++ b/src/resources/queues/index.ts @@ -9,15 +9,30 @@ export { type ConsumerUpdateParams, type ConsumerListParams, type ConsumerDeleteParams, + 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'; -export { Subscriptions } from './subscriptions'; +export { + SubscriptionListResponsesV4PagePaginationArray, + Subscriptions, + type SubscriptionCreateResponse, + type SubscriptionUpdateResponse, + type SubscriptionListResponse, + type SubscriptionDeleteResponse, + type SubscriptionCreateParams, + type SubscriptionUpdateParams, + type SubscriptionListParams, + type SubscriptionDeleteParams, +} from './subscriptions'; 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 15d1651711..667ab7a44a 100644 --- a/src/resources/queues/queues.ts +++ b/src/resources/queues/queues.ts @@ -9,6 +9,7 @@ import { ConsumerCreateParams, ConsumerDeleteParams, ConsumerDeleteResponse, + ConsumerGetParams, ConsumerListParams, ConsumerUpdateParams, Consumers, @@ -18,15 +19,29 @@ import * as MessagesAPI from './messages'; import { MessageAckParams, MessageAckResponse, + MessageBulkPushParams, + MessageBulkPushResponse, MessagePullParams, MessagePullResponse, - MessagePullResponsesSinglePage, + MessagePushParams, + MessagePushResponse, Messages, } from './messages'; import * as PurgeAPI from './purge'; import { Purge, PurgeStartParams, PurgeStatusParams, PurgeStatusResponse } from './purge'; import * as SubscriptionsAPI from './subscriptions'; -import { Subscriptions } from './subscriptions'; +import { + SubscriptionCreateParams, + SubscriptionCreateResponse, + SubscriptionDeleteParams, + SubscriptionDeleteResponse, + SubscriptionListParams, + SubscriptionListResponse, + SubscriptionListResponsesV4PagePaginationArray, + SubscriptionUpdateParams, + SubscriptionUpdateResponse, + Subscriptions, +} from './subscriptions'; import { SinglePage } from '../../pagination'; export class Queues extends APIResource { @@ -328,11 +343,11 @@ export interface QueueGetParams { Queues.QueuesSinglePage = QueuesSinglePage; Queues.Messages = Messages; -Queues.MessagePullResponsesSinglePage = MessagePullResponsesSinglePage; Queues.Purge = Purge; Queues.Consumers = Consumers; Queues.ConsumersSinglePage = ConsumersSinglePage; Queues.Subscriptions = Subscriptions; +Queues.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; export declare namespace Queues { export { @@ -350,10 +365,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 { @@ -372,7 +390,19 @@ export declare namespace Queues { type ConsumerUpdateParams as ConsumerUpdateParams, type ConsumerListParams as ConsumerListParams, type ConsumerDeleteParams as ConsumerDeleteParams, + type ConsumerGetParams as ConsumerGetParams, }; - export { Subscriptions as Subscriptions }; + export { + Subscriptions as Subscriptions, + type SubscriptionCreateResponse as SubscriptionCreateResponse, + type SubscriptionUpdateResponse as SubscriptionUpdateResponse, + type SubscriptionListResponse as SubscriptionListResponse, + type SubscriptionDeleteResponse as SubscriptionDeleteResponse, + SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, + type SubscriptionCreateParams as SubscriptionCreateParams, + type SubscriptionUpdateParams as SubscriptionUpdateParams, + type SubscriptionListParams as SubscriptionListParams, + type SubscriptionDeleteParams as SubscriptionDeleteParams, + }; } diff --git a/src/resources/queues/subscriptions.ts b/src/resources/queues/subscriptions.ts index 42d6ea9ea6..3bb405e3fc 100644 --- a/src/resources/queues/subscriptions.ts +++ b/src/resources/queues/subscriptions.ts @@ -1,5 +1,874 @@ // 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 Subscriptions extends APIResource {} +export class Subscriptions extends APIResource { + /** + * Create a new event subscription for a queue + * + * @example + * ```ts + * const subscription = + * await client.queues.subscriptions.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create( + params: SubscriptionCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/event_subscriptions/subscriptions`, { + body, + ...options, + }) as Core.APIPromise<{ result: SubscriptionCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update an existing event subscription + * + * @example + * ```ts + * const subscription = + * await client.queues.subscriptions.update( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + update( + subscriptionId: string, + params: SubscriptionUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.patch(`/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: SubscriptionUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a paginated list of event subscriptions with optional sorting and filtering + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const subscriptionListResponse of client.queues.subscriptions.list( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: SubscriptionListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/event_subscriptions/subscriptions`, + SubscriptionListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Delete an existing event subscription + * + * @example + * ```ts + * const subscription = + * await client.queues.subscriptions.delete( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + subscriptionId: string, + params: SubscriptionDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete( + `/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, + options, + ) as Core.APIPromise<{ result: SubscriptionDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class SubscriptionListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface SubscriptionCreateResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionCreateResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionCreateResponse.MqEventSourceImages + | SubscriptionCreateResponse.MqEventSourceKV + | SubscriptionCreateResponse.MqEventSourceR2 + | SubscriptionCreateResponse.MqEventSourceSuperSlurper + | SubscriptionCreateResponse.MqEventSourceVectorize + | SubscriptionCreateResponse.MqEventSourceWorkersAIModel + | SubscriptionCreateResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionCreateResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionCreateResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionUpdateResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionUpdateResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionUpdateResponse.MqEventSourceImages + | SubscriptionUpdateResponse.MqEventSourceKV + | SubscriptionUpdateResponse.MqEventSourceR2 + | SubscriptionUpdateResponse.MqEventSourceSuperSlurper + | SubscriptionUpdateResponse.MqEventSourceVectorize + | SubscriptionUpdateResponse.MqEventSourceWorkersAIModel + | SubscriptionUpdateResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionUpdateResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionUpdateResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionListResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionListResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionListResponse.MqEventSourceImages + | SubscriptionListResponse.MqEventSourceKV + | SubscriptionListResponse.MqEventSourceR2 + | SubscriptionListResponse.MqEventSourceSuperSlurper + | SubscriptionListResponse.MqEventSourceVectorize + | SubscriptionListResponse.MqEventSourceWorkersAIModel + | SubscriptionListResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionListResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionListResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionDeleteResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionDeleteResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionDeleteResponse.MqEventSourceImages + | SubscriptionDeleteResponse.MqEventSourceKV + | SubscriptionDeleteResponse.MqEventSourceR2 + | SubscriptionDeleteResponse.MqEventSourceSuperSlurper + | SubscriptionDeleteResponse.MqEventSourceVectorize + | SubscriptionDeleteResponse.MqEventSourceWorkersAIModel + | SubscriptionDeleteResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionDeleteResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionDeleteResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionCreateParams { + /** + * Path param: A Resource identifier. + */ + account_id: string; + + /** + * Body param: Destination configuration for the subscription + */ + destination?: SubscriptionCreateParams.Destination; + + /** + * Body param: Whether the subscription is active + */ + enabled?: boolean; + + /** + * Body param: List of event types this subscription handles + */ + events?: Array; + + /** + * Body param: Name of the subscription + */ + name?: string; + + /** + * Body param: Source configuration for the subscription + */ + source?: + | SubscriptionCreateParams.MqEventSourceImages + | SubscriptionCreateParams.MqEventSourceKV + | SubscriptionCreateParams.MqEventSourceR2 + | SubscriptionCreateParams.MqEventSourceSuperSlurper + | SubscriptionCreateParams.MqEventSourceVectorize + | SubscriptionCreateParams.MqEventSourceWorkersAIModel + | SubscriptionCreateParams.MqEventSourceWorkersBuildsWorker + | SubscriptionCreateParams.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionCreateParams { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionUpdateParams { + /** + * Path param: A Resource identifier. + */ + account_id: string; + + /** + * Body param: Destination configuration for the subscription + */ + destination?: SubscriptionUpdateParams.Destination; + + /** + * Body param: Whether the subscription is active + */ + enabled?: boolean; + + /** + * Body param: List of event types this subscription handles + */ + events?: Array; + + /** + * Body param: Name of the subscription + */ + name?: string; +} + +export namespace SubscriptionUpdateParams { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } +} + +export interface SubscriptionListParams extends V4PagePaginationArrayParams { + /** + * Path param: A Resource identifier. + */ + account_id: string; + + /** + * Query param: Sort direction + */ + direction?: 'asc' | 'desc'; + + /** + * Query param: Field to sort by + */ + order?: 'created_at' | 'name' | 'enabled' | 'source'; +} + +export interface SubscriptionDeleteParams { + /** + * A Resource identifier. + */ + account_id: string; +} + +Subscriptions.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; + +export declare namespace Subscriptions { + export { + type SubscriptionCreateResponse as SubscriptionCreateResponse, + type SubscriptionUpdateResponse as SubscriptionUpdateResponse, + type SubscriptionListResponse as SubscriptionListResponse, + type SubscriptionDeleteResponse as SubscriptionDeleteResponse, + SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, + type SubscriptionCreateParams as SubscriptionCreateParams, + type SubscriptionUpdateParams as SubscriptionUpdateParams, + type SubscriptionListParams as SubscriptionListParams, + type SubscriptionDeleteParams as SubscriptionDeleteParams, + }; +} diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts index 75c99603d5..c9e77e1896 100644 --- a/src/resources/radar/ai/bots/summary.ts +++ b/src/resources/radar/ai/bots/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of traffic by AI user agent. * - * @deprecated + * @deprecated Use [Radar AI Bots Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/summary_v2/) instead. */ userAgent( query?: SummaryUserAgentParams, diff --git a/src/resources/radar/ai/inference/summary.ts b/src/resources/radar/ai/inference/summary.ts index a22b6f10e9..4b9b871ddc 100644 --- a/src/resources/radar/ai/inference/summary.ts +++ b/src/resources/radar/ai/inference/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by model. * - * @deprecated + * @deprecated Use [Radar AI Inference Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/summary_v2/) instead. */ model(query?: SummaryModelParams, options?: Core.RequestOptions): Core.APIPromise; model(options?: Core.RequestOptions): Core.APIPromise; @@ -29,7 +29,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by task. * - * @deprecated + * @deprecated Use [Radar AI Inference Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/summary_v2/) instead. */ task(query?: SummaryTaskParams, options?: Core.RequestOptions): Core.APIPromise; task(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/ai/inference/timeseries-groups/summary.ts b/src/resources/radar/ai/inference/timeseries-groups/summary.ts index bf808d1b21..43edd89a6c 100644 --- a/src/resources/radar/ai/inference/timeseries-groups/summary.ts +++ b/src/resources/radar/ai/inference/timeseries-groups/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by model over time. * - * @deprecated + * @deprecated Use [Radar AI Inference Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/timeseries_groups_v2/) instead. */ model(query?: SummaryModelParams, options?: Core.RequestOptions): Core.APIPromise; model(options?: Core.RequestOptions): Core.APIPromise; @@ -30,7 +30,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by task over time. * - * @deprecated + * @deprecated Use [Radar AI Inference Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/timeseries_groups_v2/) instead. */ task(query?: SummaryTaskParams, options?: Core.RequestOptions): Core.APIPromise; task(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index b5b307bf8b..c516b5d812 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -93,7 +93,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of traffic by AI user agent over time. * - * @deprecated + * @deprecated Use [Radar AI Bots Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/timeseries_groups/) instead. */ userAgent( query?: TimeseriesGroupUserAgentParams, diff --git a/src/resources/radar/as112/summary.ts b/src/resources/radar/as112/summary.ts index d6034b19c4..c83056b982 100644 --- a/src/resources/radar/as112/summary.ts +++ b/src/resources/radar/as112/summary.ts @@ -9,7 +9,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by DNSSEC (DNS Security * Extensions) support. * - * @deprecated + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -31,7 +31,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by EDNS (Extension Mechanisms * for DNS) support. * - * @deprecated + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ edns(query?: SummaryEdnsParams, options?: Core.RequestOptions): Core.APIPromise; edns(options?: Core.RequestOptions): Core.APIPromise; @@ -52,7 +52,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by IP version. * - * @deprecated + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -76,7 +76,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by protocol. * - * @deprecated + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ protocol( query?: SummaryProtocolParams, @@ -100,7 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by type. * - * @deprecated + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ queryType( query?: SummaryQueryTypeParams, @@ -124,7 +124,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of AS112 DNS requests classified by response code. * - * @deprecated + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ responseCodes( query?: SummaryResponseCodesParams, diff --git a/src/resources/radar/as112/timeseries-groups.ts b/src/resources/radar/as112/timeseries-groups.ts index e5593df35c..fd564e8245 100644 --- a/src/resources/radar/as112/timeseries-groups.ts +++ b/src/resources/radar/as112/timeseries-groups.ts @@ -9,7 +9,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by DNSSEC (DNS Security * Extensions) support over time. * - * @deprecated + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -34,7 +34,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by EDNS (Extension Mechanisms * for DNS) support over time. * - * @deprecated + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ edns( query?: TimeseriesGroupEdnsParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by IP version over time. * - * @deprecated + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -84,7 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by protocol over * time. * - * @deprecated + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ protocol( query?: TimeseriesGroupProtocolParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by type over time. * - * @deprecated + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -134,7 +134,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by response code * over time. * - * @deprecated + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ responseCodes( query?: TimeseriesGroupResponseCodesParams, diff --git a/src/resources/radar/attacks/layer3/summary.ts b/src/resources/radar/attacks/layer3/summary.ts index bc4ccc4c81..869dd46727 100644 --- a/src/resources/radar/attacks/layer3/summary.ts +++ b/src/resources/radar/attacks/layer3/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ bitrate( query?: SummaryBitrateParams, @@ -32,7 +32,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ duration( query?: SummaryDurationParams, @@ -56,7 +56,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ industry( query?: SummaryIndustryParams, @@ -80,7 +80,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -104,7 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ protocol( query?: SummaryProtocolParams, @@ -128,7 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ vector(query?: SummaryVectorParams, options?: Core.RequestOptions): Core.APIPromise; vector(options?: Core.RequestOptions): Core.APIPromise; @@ -149,7 +149,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer3/timeseries-groups.ts b/src/resources/radar/attacks/layer3/timeseries-groups.ts index 9f8d171a40..622eb83d71 100644 --- a/src/resources/radar/attacks/layer3/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer3/timeseries-groups.ts @@ -8,7 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ bitrate( query?: TimeseriesGroupBitrateParams, @@ -33,7 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ duration( query?: TimeseriesGroupDurationParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ industry( query?: TimeseriesGroupIndustryParams, @@ -83,7 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ protocol( query?: TimeseriesGroupProtocolParams, @@ -133,7 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ vector( query?: TimeseriesGroupVectorParams, @@ -158,7 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer3/top/top.ts b/src/resources/radar/attacks/layer3/top/top.ts index 2da56402ce..e8e5c6b5b8 100644 --- a/src/resources/radar/attacks/layer3/top/top.ts +++ b/src/resources/radar/attacks/layer3/top/top.ts @@ -47,7 +47,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by industry endpoint. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ industry(query?: TopIndustryParams, options?: Core.RequestOptions): Core.APIPromise; industry(options?: Core.RequestOptions): Core.APIPromise; @@ -69,7 +69,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by vertical endpoint. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ vertical(query?: TopVerticalParams, options?: Core.RequestOptions): Core.APIPromise; vertical(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/attacks/layer7/summary.ts b/src/resources/radar/attacks/layer7/summary.ts index 160eb24dd8..3d4b27fb58 100644 --- a/src/resources/radar/attacks/layer7/summary.ts +++ b/src/resources/radar/attacks/layer7/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ httpMethod( query?: SummaryHTTPMethodParams, @@ -33,7 +33,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ httpVersion( query?: SummaryHTTPVersionParams, @@ -58,7 +58,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ industry( query?: SummaryIndustryParams, @@ -82,7 +82,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -106,7 +106,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ managedRules( query?: SummaryManagedRulesParams, @@ -131,7 +131,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ mitigationProduct( query?: SummaryMitigationProductParams, @@ -156,7 +156,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer7/timeseries-groups.ts b/src/resources/radar/attacks/layer7/timeseries-groups.ts index ce7c62ce1e..ab5076ef90 100644 --- a/src/resources/radar/attacks/layer7/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer7/timeseries-groups.ts @@ -8,7 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ httpMethod( query?: TimeseriesGroupHTTPMethodParams, @@ -33,7 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ industry( query?: TimeseriesGroupIndustryParams, @@ -83,7 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version used over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ managedRules( query?: TimeseriesGroupManagedRulesParams, @@ -133,7 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ mitigationProduct( query?: TimeseriesGroupMitigationProductParams, @@ -158,7 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer7/top/top.ts b/src/resources/radar/attacks/layer7/top/top.ts index 74086112c2..1fa4d17fff 100644 --- a/src/resources/radar/attacks/layer7/top/top.ts +++ b/src/resources/radar/attacks/layer7/top/top.ts @@ -51,7 +51,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by industry endpoint. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ industry(query?: TopIndustryParams, options?: Core.RequestOptions): Core.APIPromise; industry(options?: Core.RequestOptions): Core.APIPromise; @@ -73,7 +73,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by vertical endpoint. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ vertical(query?: TopVerticalParams, options?: Core.RequestOptions): Core.APIPromise; vertical(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts index 4ba71c4acf..829a017a4b 100644 --- a/src/resources/radar/ct/logs.ts +++ b/src/resources/radar/ct/logs.ts @@ -121,6 +121,12 @@ export namespace LogGetResponse { */ api: 'RFC6962' | 'STATIC'; + /** + * The average throughput of the CT log, measured in certificates per hour + * (certs/hour). + */ + avgThroughput: number; + /** * A brief description of the certificate log. */ @@ -131,6 +137,11 @@ export namespace LogGetResponse { */ endExclusive: string; + /** + * Timestamp of the most recent update to the CT log. + */ + lastUpdate: string; + /** * The organization responsible for operating the certificate log. */ @@ -168,6 +179,18 @@ export namespace LogGetResponse { */ stateTimestamp: string; + /** + * Number of certificates that are eligible for inclusion to this log but have not + * been included yet. Based on certificates signed by trusted root CAs within the + * log's accepted date range. + */ + submittableCertCount: string | null; + + /** + * Number of certificates already included in this CT log. + */ + submittedCertCount: string | null; + /** * The URL for the certificate log. */ diff --git a/src/resources/radar/dns/summary.ts b/src/resources/radar/dns/summary.ts index 575afc929b..bea2bcf785 100644 --- a/src/resources/radar/dns/summary.ts +++ b/src/resources/radar/dns/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by cache status. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ cacheHit( query?: SummaryCacheHitParams, @@ -33,7 +33,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -55,7 +55,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ dnssecAware( query?: SummaryDNSSECAwareParams, @@ -80,7 +80,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ dnssecE2E( query?: SummaryDNSSECE2EParams, @@ -104,7 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by IP version. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -128,7 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ matchingAnswer( query?: SummaryMatchingAnswerParams, @@ -152,7 +152,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ protocol( query?: SummaryProtocolParams, @@ -176,7 +176,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by type. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ queryType( query?: SummaryQueryTypeParams, @@ -200,7 +200,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by response code. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ responseCode( query?: SummaryResponseCodeParams, @@ -224,7 +224,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by minimum response TTL. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ responseTTL( query?: SummaryResponseTTLParams, diff --git a/src/resources/radar/dns/timeseries-groups.ts b/src/resources/radar/dns/timeseries-groups.ts index 5e1ea8a4e1..b2120478af 100644 --- a/src/resources/radar/dns/timeseries-groups.ts +++ b/src/resources/radar/dns/timeseries-groups.ts @@ -8,7 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by cache status over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ cacheHit( query?: TimeseriesGroupCacheHitParams, @@ -33,7 +33,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ dnssecAware( query?: TimeseriesGroupDNSSECAwareParams, @@ -84,7 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ dnssecE2E( query?: TimeseriesGroupDNSSECE2EParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by IP version over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -132,7 +132,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ matchingAnswer( query?: TimeseriesGroupMatchingAnswerParams, @@ -157,7 +157,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ protocol( query?: TimeseriesGroupProtocolParams, @@ -181,7 +181,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by type over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -205,7 +205,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by response code over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ responseCode( query?: TimeseriesGroupResponseCodeParams, @@ -230,7 +230,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by minimum answer TTL over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ responseTTL( query?: TimeseriesGroupResponseTTLParams, diff --git a/src/resources/radar/email/routing/summary.ts b/src/resources/radar/email/routing/summary.ts index 00defd2b84..3d29f93974 100644 --- a/src/resources/radar/email/routing/summary.ts +++ b/src/resources/radar/email/routing/summary.ts @@ -10,7 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @deprecated + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -32,7 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @deprecated + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -54,7 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @deprecated + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -76,7 +76,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted). * - * @deprecated + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ encrypted( query?: SummaryEncryptedParams, @@ -100,7 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by IP version. * - * @deprecated + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -125,7 +125,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @deprecated + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/email/routing/timeseries-groups.ts b/src/resources/radar/email/routing/timeseries-groups.ts index 3a9801b143..4d12509309 100644 --- a/src/resources/radar/email/routing/timeseries-groups.ts +++ b/src/resources/radar/email/routing/timeseries-groups.ts @@ -10,7 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @deprecated + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ arc( query?: TimeseriesGroupARCParams, @@ -36,7 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @deprecated + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ dkim( query?: TimeseriesGroupDKIMParams, @@ -62,7 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @deprecated + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -88,7 +88,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted) over time. * - * @deprecated + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ encrypted( query?: TimeseriesGroupEncryptedParams, @@ -113,7 +113,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by IP version over time. * - * @deprecated + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -139,7 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @deprecated + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ spf( query?: TimeseriesGroupSPFParams, diff --git a/src/resources/radar/email/security/summary.ts b/src/resources/radar/email/security/summary.ts index 5136a742ff..c3432f9f36 100644 --- a/src/resources/radar/email/security/summary.ts +++ b/src/resources/radar/email/security/summary.ts @@ -10,7 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -32,7 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -54,7 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -75,7 +75,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by malicious classification. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ malicious( query?: SummaryMaliciousParams, @@ -99,7 +99,7 @@ export class Summary extends APIResource { /** * Retrieves the proportion of emails by spam classification (spam vs. non-spam). * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ spam(query?: SummarySpamParams, options?: Core.RequestOptions): Core.APIPromise; spam(options?: Core.RequestOptions): Core.APIPromise; @@ -121,7 +121,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; @@ -143,7 +143,7 @@ export class Summary extends APIResource { * Retrieves the proportion of emails by spoof classification (spoof vs. * non-spoof). * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ spoof(query?: SummarySpoofParams, options?: Core.RequestOptions): Core.APIPromise; spoof(options?: Core.RequestOptions): Core.APIPromise; @@ -164,7 +164,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by threat categories. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ threatCategory( query?: SummaryThreatCategoryParams, @@ -189,7 +189,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by TLS version. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/email/security/timeseries-groups.ts b/src/resources/radar/email/security/timeseries-groups.ts index aa620088a0..9b33cf953e 100644 --- a/src/resources/radar/email/security/timeseries-groups.ts +++ b/src/resources/radar/email/security/timeseries-groups.ts @@ -10,7 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ arc( query?: TimeseriesGroupARCParams, @@ -36,7 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ dkim( query?: TimeseriesGroupDKIMParams, @@ -62,7 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -87,7 +87,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by malicious classification over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ malicious( query?: TimeseriesGroupMaliciousParams, @@ -113,7 +113,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spam classification (spam vs. non-spam) * over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ spam( query?: TimeseriesGroupSpamParams, @@ -139,7 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ spf( query?: TimeseriesGroupSPFParams, @@ -165,7 +165,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spoof classification (spoof vs. * non-spoof) over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ spoof( query?: TimeseriesGroupSpoofParams, @@ -190,7 +190,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by threat category over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ threatCategory( query?: TimeseriesGroupThreatCategoryParams, @@ -215,7 +215,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by TLS version over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/http/summary.ts b/src/resources/radar/http/summary.ts index 9f7f84b12e..5c5792f467 100644 --- a/src/resources/radar/http/summary.ts +++ b/src/resources/radar/http/summary.ts @@ -11,7 +11,7 @@ export class Summary extends APIResource { * https://developers.cloudflare.com/radar/concepts/bot-classes/ for more * information. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ botClass( query?: SummaryBotClassParams, @@ -36,7 +36,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP requests generated by mobile, desktop, and * other types of devices. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ deviceType( query?: SummaryDeviceTypeParams, @@ -60,7 +60,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. HTTPS). * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ httpProtocol( query?: SummaryHTTPProtocolParams, @@ -84,7 +84,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP version. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ httpVersion( query?: SummaryHTTPVersionParams, @@ -108,7 +108,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by IP version. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -133,7 +133,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP requests by operating system (Windows, macOS, * Android, iOS, and others). * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ os(query?: SummaryOSParams, options?: Core.RequestOptions): Core.APIPromise; os(options?: Core.RequestOptions): Core.APIPromise; @@ -154,7 +154,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by post-quantum support. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ postQuantum( query?: SummaryPostQuantumParams, @@ -178,7 +178,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by TLS version. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/http/timeseries-groups.ts b/src/resources/radar/http/timeseries-groups.ts index a22fdb7774..6e44b45b29 100644 --- a/src/resources/radar/http/timeseries-groups.ts +++ b/src/resources/radar/http/timeseries-groups.ts @@ -10,7 +10,7 @@ export class TimeseriesGroups extends APIResource { * over time. Visit https://developers.cloudflare.com/radar/concepts/bot-classes/ * for more information. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ botClass( query?: TimeseriesGroupBotClassParams, @@ -34,7 +34,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by user agent over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ browser( query?: TimeseriesGroupBrowserParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by user agent family over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ browserFamily( query?: TimeseriesGroupBrowserFamilyParams, @@ -83,7 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by device type over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ deviceType( query?: TimeseriesGroupDeviceTypeParams, @@ -109,7 +109,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. HTTPS) * over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ httpProtocol( query?: TimeseriesGroupHTTPProtocolParams, @@ -134,7 +134,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP version over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -159,7 +159,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by IP version over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -183,7 +183,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by operating system over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ os( query?: TimeseriesGroupOSParams, @@ -207,7 +207,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by post-quantum support over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ postQuantum( query?: TimeseriesGroupPostQuantumParams, @@ -232,7 +232,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by TLS version over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/http/top.ts b/src/resources/radar/http/top.ts index 01ee05806f..8419bea370 100644 --- a/src/resources/radar/http/top.ts +++ b/src/resources/radar/http/top.ts @@ -8,10 +8,7 @@ export class Top extends APIResource { /** * Retrieves the top user agents by HTTP requests. * - * @example - * ```ts - * const response = await client.radar.http.top.browser(); - * ``` + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ browser(query?: TopBrowserParams, options?: Core.RequestOptions): Core.APIPromise; browser(options?: Core.RequestOptions): Core.APIPromise; @@ -32,11 +29,7 @@ export class Top extends APIResource { /** * Retrieves the top user agents, aggregated in families, by HTTP requests. * - * @example - * ```ts - * const response = - * await client.radar.http.top.browserFamily(); - * ``` + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ browserFamily( query?: TopBrowserFamilyParams, diff --git a/src/resources/radar/leaked-credentials/summary.ts b/src/resources/radar/leaked-credentials/summary.ts index 917ce13982..970fde6b56 100644 --- a/src/resources/radar/leaked-credentials/summary.ts +++ b/src/resources/radar/leaked-credentials/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP authentication requests by bot class. * - * @deprecated + * @deprecated Use [Radar Leaked Credentials Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/summary_v2/) instead. */ botClass( query?: SummaryBotClassParams, @@ -34,7 +34,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP authentication requests by compromised * credential status. * - * @deprecated + * @deprecated Use [Radar Leaked Credentials Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/summary_v2/) instead. */ compromised( query?: SummaryCompromisedParams, diff --git a/src/resources/radar/leaked-credentials/timeseries-groups.ts b/src/resources/radar/leaked-credentials/timeseries-groups.ts index 83aa48d077..859a012a8c 100644 --- a/src/resources/radar/leaked-credentials/timeseries-groups.ts +++ b/src/resources/radar/leaked-credentials/timeseries-groups.ts @@ -9,7 +9,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP authentication requests by bot class over * time. * - * @deprecated + * @deprecated Use [Radar Leaked Credentials Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/timeseries_groups_v2/) instead. */ botClass( query?: TimeseriesGroupBotClassParams, @@ -35,7 +35,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP authentication requests by compromised * credential status over time. * - * @deprecated + * @deprecated Use [Radar Leaked Credentials Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/timeseries_groups_v2/) instead. */ compromised( query?: TimeseriesGroupCompromisedParams, diff --git a/src/resources/secrets-store/stores/secrets.ts b/src/resources/secrets-store/stores/secrets.ts index 1ab72e50dc..ec0ca694ed 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', 'ai_gateway'], + * scopes: ['workers', 'ai_gateway', 'dex', 'access'], * value: 'api-token-secret-123', * }, * ], @@ -135,7 +135,7 @@ export class Secrets extends APIResource { * { * account_id: '985e105f4ecef8ad9ca31a8372d0c353', * name: 'MY_API_KEY', - * scopes: ['workers', 'ai_gateway'], + * scopes: ['workers', 'ai_gateway', 'dex', 'access'], * }, * ); * ``` diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts index 4af2451c88..d2cb382d90 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts @@ -63,7 +63,6 @@ export type BindingGetResponse = | BindingGetResponse.WorkersBindingKindSecretText | BindingGetResponse.WorkersBindingKindSendEmail | BindingGetResponse.WorkersBindingKindService - | BindingGetResponse.WorkersBindingKindTailConsumer | BindingGetResponse.WorkersBindingKindTextBlob | BindingGetResponse.WorkersBindingKindVectorize | BindingGetResponse.WorkersBindingKindVersionMetadata @@ -493,23 +492,6 @@ export namespace BindingGetResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. 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 78e5e95423..554313f4d3 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -372,7 +372,6 @@ export namespace ScriptUpdateParams { | Metadata.WorkersBindingKindSecretText | Metadata.WorkersBindingKindSendEmail | Metadata.WorkersBindingKindService - | Metadata.WorkersBindingKindTailConsumer | Metadata.WorkersBindingKindTextBlob | Metadata.WorkersBindingKindVectorize | Metadata.WorkersBindingKindVersionMetadata @@ -946,23 +945,6 @@ export namespace ScriptUpdateParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. 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 216456a041..fb897aea3f 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -91,7 +91,6 @@ export interface SettingEditResponse { | SettingEditResponse.WorkersBindingKindSecretText | SettingEditResponse.WorkersBindingKindSendEmail | SettingEditResponse.WorkersBindingKindService - | SettingEditResponse.WorkersBindingKindTailConsumer | SettingEditResponse.WorkersBindingKindTextBlob | SettingEditResponse.WorkersBindingKindVectorize | SettingEditResponse.WorkersBindingKindVersionMetadata @@ -572,23 +571,6 @@ export namespace SettingEditResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -843,7 +825,6 @@ export interface SettingGetResponse { | SettingGetResponse.WorkersBindingKindSecretText | SettingGetResponse.WorkersBindingKindSendEmail | SettingGetResponse.WorkersBindingKindService - | SettingGetResponse.WorkersBindingKindTailConsumer | SettingGetResponse.WorkersBindingKindTextBlob | SettingGetResponse.WorkersBindingKindVectorize | SettingGetResponse.WorkersBindingKindVersionMetadata @@ -1324,23 +1305,6 @@ export namespace SettingGetResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1608,7 +1572,6 @@ export namespace SettingEditParams { | Settings.WorkersBindingKindSecretText | Settings.WorkersBindingKindSendEmail | Settings.WorkersBindingKindService - | Settings.WorkersBindingKindTailConsumer | Settings.WorkersBindingKindTextBlob | Settings.WorkersBindingKindVectorize | Settings.WorkersBindingKindVersionMetadata @@ -2099,23 +2062,6 @@ export namespace SettingEditParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers/beta/workers/versions.ts b/src/resources/workers/beta/workers/versions.ts index 185cea7033..66bebbd506 100644 --- a/src/resources/workers/beta/workers/versions.ts +++ b/src/resources/workers/beta/workers/versions.ts @@ -176,7 +176,6 @@ export interface Version { | Version.WorkersBindingKindSecretText | Version.WorkersBindingKindSendEmail | Version.WorkersBindingKindService - | Version.WorkersBindingKindTailConsumer | Version.WorkersBindingKindTextBlob | Version.WorkersBindingKindVectorize | Version.WorkersBindingKindVersionMetadata @@ -734,23 +733,6 @@ export namespace Version { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1039,7 +1021,6 @@ export interface VersionCreateParams { | VersionCreateParams.WorkersBindingKindSecretText | VersionCreateParams.WorkersBindingKindSendEmail | VersionCreateParams.WorkersBindingKindService - | VersionCreateParams.WorkersBindingKindTailConsumer | VersionCreateParams.WorkersBindingKindTextBlob | VersionCreateParams.WorkersBindingKindVectorize | VersionCreateParams.WorkersBindingKindVersionMetadata @@ -1593,23 +1574,6 @@ export namespace VersionCreateParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. 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/workers/scripts/script-and-version-settings.ts b/src/resources/workers/scripts/script-and-version-settings.ts index d6ef7552ca..54237b4091 100644 --- a/src/resources/workers/scripts/script-and-version-settings.ts +++ b/src/resources/workers/scripts/script-and-version-settings.ts @@ -87,7 +87,6 @@ export interface ScriptAndVersionSettingEditResponse { | ScriptAndVersionSettingEditResponse.WorkersBindingKindSecretText | ScriptAndVersionSettingEditResponse.WorkersBindingKindSendEmail | ScriptAndVersionSettingEditResponse.WorkersBindingKindService - | ScriptAndVersionSettingEditResponse.WorkersBindingKindTailConsumer | ScriptAndVersionSettingEditResponse.WorkersBindingKindTextBlob | ScriptAndVersionSettingEditResponse.WorkersBindingKindVectorize | ScriptAndVersionSettingEditResponse.WorkersBindingKindVersionMetadata @@ -568,23 +567,6 @@ export namespace ScriptAndVersionSettingEditResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -839,7 +821,6 @@ export interface ScriptAndVersionSettingGetResponse { | ScriptAndVersionSettingGetResponse.WorkersBindingKindSecretText | ScriptAndVersionSettingGetResponse.WorkersBindingKindSendEmail | ScriptAndVersionSettingGetResponse.WorkersBindingKindService - | ScriptAndVersionSettingGetResponse.WorkersBindingKindTailConsumer | ScriptAndVersionSettingGetResponse.WorkersBindingKindTextBlob | ScriptAndVersionSettingGetResponse.WorkersBindingKindVectorize | ScriptAndVersionSettingGetResponse.WorkersBindingKindVersionMetadata @@ -1320,23 +1301,6 @@ export namespace ScriptAndVersionSettingGetResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1604,7 +1568,6 @@ export namespace ScriptAndVersionSettingEditParams { | Settings.WorkersBindingKindSecretText | Settings.WorkersBindingKindSendEmail | Settings.WorkersBindingKindService - | Settings.WorkersBindingKindTailConsumer | Settings.WorkersBindingKindTextBlob | Settings.WorkersBindingKindVectorize | Settings.WorkersBindingKindVersionMetadata @@ -2095,23 +2058,6 @@ export namespace ScriptAndVersionSettingEditParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index 70546d5580..a52d8a4ad2 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -681,7 +681,6 @@ export namespace ScriptUpdateParams { | Metadata.WorkersBindingKindSecretText | Metadata.WorkersBindingKindSendEmail | Metadata.WorkersBindingKindService - | Metadata.WorkersBindingKindTailConsumer | Metadata.WorkersBindingKindTextBlob | Metadata.WorkersBindingKindVectorize | Metadata.WorkersBindingKindVersionMetadata @@ -1255,23 +1254,6 @@ export namespace ScriptUpdateParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers/scripts/versions.ts b/src/resources/workers/scripts/versions.ts index c9027b6f0c..67d82e7c99 100644 --- a/src/resources/workers/scripts/versions.ts +++ b/src/resources/workers/scripts/versions.ts @@ -134,7 +134,6 @@ export namespace VersionCreateResponse { | Resources.WorkersBindingKindSecretText | Resources.WorkersBindingKindSendEmail | Resources.WorkersBindingKindService - | Resources.WorkersBindingKindTailConsumer | Resources.WorkersBindingKindTextBlob | Resources.WorkersBindingKindVectorize | Resources.WorkersBindingKindVersionMetadata @@ -570,23 +569,6 @@ export namespace VersionCreateResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -870,7 +852,6 @@ export namespace VersionGetResponse { | Resources.WorkersBindingKindSecretText | Resources.WorkersBindingKindSendEmail | Resources.WorkersBindingKindService - | Resources.WorkersBindingKindTailConsumer | Resources.WorkersBindingKindTextBlob | Resources.WorkersBindingKindVectorize | Resources.WorkersBindingKindVersionMetadata @@ -1306,23 +1287,6 @@ export namespace VersionGetResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1598,7 +1562,6 @@ export namespace VersionCreateParams { | Metadata.WorkersBindingKindSecretText | Metadata.WorkersBindingKindSendEmail | Metadata.WorkersBindingKindService - | Metadata.WorkersBindingKindTailConsumer | Metadata.WorkersBindingKindTextBlob | Metadata.WorkersBindingKindVectorize | Metadata.WorkersBindingKindVersionMetadata @@ -2075,23 +2038,6 @@ export namespace VersionCreateParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. 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..2740494438 100644 --- a/src/resources/workflows/instances/instances.ts +++ b/src/resources/workflows/instances/instances.ts @@ -1,21 +1,429 @@ // 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: `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. + */ + date_end?: string; + + /** + * Query param: Accepts ISO 8601 with no timezone offsets and in UTC. + */ + date_start?: string; + + /** + * Query param: should only be used when `cursor` is used, defines a new direction + * for the cursor + */ + direction?: 'asc' | 'desc'; + + /** + * 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/access/applications/applications.ts b/src/resources/zero-trust/access/applications/applications.ts index 1c6afd035f..00a1c63b2a 100644 --- a/src/resources/zero-trust/access/applications/applications.ts +++ b/src/resources/zero-trust/access/applications/applications.ts @@ -1667,7 +1667,9 @@ export type ApplicationType = | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * The application type. @@ -1683,7 +1685,9 @@ export type ApplicationTypeParam = | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; export interface CORSHeaders { /** @@ -2670,7 +2674,11 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | SelfHostedApplication.PublicDestination + | SelfHostedApplication.PrivateDestination + | SelfHostedApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -2779,10 +2787,6 @@ export namespace ApplicationCreateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -2814,6 +2818,19 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -3263,7 +3280,9 @@ export namespace ApplicationCreateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -3335,7 +3354,11 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserSSHApplication.PublicDestination + | BrowserSSHApplication.PrivateDestination + | BrowserSSHApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -3444,10 +3467,6 @@ export namespace ApplicationCreateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -3479,6 +3498,19 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -3681,7 +3713,9 @@ export namespace ApplicationCreateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -3753,7 +3787,11 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserVNCApplication.PublicDestination + | BrowserVNCApplication.PrivateDestination + | BrowserVNCApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -3862,10 +3900,6 @@ export namespace ApplicationCreateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -3897,6 +3931,19 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -4093,7 +4140,9 @@ export namespace ApplicationCreateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -4859,7 +4908,11 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserRdpApplication.PublicDestination + | BrowserRdpApplication.PrivateDestination + | BrowserRdpApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -4986,10 +5039,6 @@ export namespace ApplicationCreateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -5021,6 +5070,19 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -5298,7 +5360,11 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | SelfHostedApplication.PublicDestination + | SelfHostedApplication.PrivateDestination + | SelfHostedApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -5407,10 +5473,6 @@ export namespace ApplicationUpdateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -5442,6 +5504,19 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -5891,7 +5966,9 @@ export namespace ApplicationUpdateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -5963,7 +6040,11 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserSSHApplication.PublicDestination + | BrowserSSHApplication.PrivateDestination + | BrowserSSHApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -6072,10 +6153,6 @@ export namespace ApplicationUpdateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -6107,6 +6184,19 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -6309,7 +6399,9 @@ export namespace ApplicationUpdateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -6381,7 +6473,11 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserVNCApplication.PublicDestination + | BrowserVNCApplication.PrivateDestination + | BrowserVNCApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -6490,10 +6586,6 @@ export namespace ApplicationUpdateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -6525,6 +6617,19 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -6721,7 +6826,9 @@ export namespace ApplicationUpdateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -7487,7 +7594,11 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserRdpApplication.PublicDestination + | BrowserRdpApplication.PrivateDestination + | BrowserRdpApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -7614,10 +7725,6 @@ export namespace ApplicationUpdateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -7649,6 +7756,19 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -7926,7 +8046,11 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | SelfHostedApplication.PublicDestination + | SelfHostedApplication.PrivateDestination + | SelfHostedApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -8035,10 +8159,6 @@ export namespace ApplicationListResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -8070,6 +8190,19 @@ export namespace ApplicationListResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -8519,7 +8652,9 @@ export namespace ApplicationListResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -8591,7 +8726,11 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserSSHApplication.PublicDestination + | BrowserSSHApplication.PrivateDestination + | BrowserSSHApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -8700,10 +8839,6 @@ export namespace ApplicationListResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -8735,6 +8870,19 @@ export namespace ApplicationListResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -8937,7 +9085,9 @@ export namespace ApplicationListResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -9009,7 +9159,11 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserVNCApplication.PublicDestination + | BrowserVNCApplication.PrivateDestination + | BrowserVNCApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -9118,10 +9272,6 @@ export namespace ApplicationListResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -9153,6 +9303,19 @@ export namespace ApplicationListResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -9349,7 +9512,9 @@ export namespace ApplicationListResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -10115,7 +10280,11 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserRdpApplication.PublicDestination + | BrowserRdpApplication.PrivateDestination + | BrowserRdpApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -10242,10 +10411,6 @@ export namespace ApplicationListResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -10277,6 +10442,19 @@ export namespace ApplicationListResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -10561,7 +10739,11 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | SelfHostedApplication.PublicDestination + | SelfHostedApplication.PrivateDestination + | SelfHostedApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -10670,10 +10852,6 @@ export namespace ApplicationGetResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -10705,6 +10883,19 @@ export namespace ApplicationGetResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -11154,7 +11345,9 @@ export namespace ApplicationGetResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -11226,7 +11419,11 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserSSHApplication.PublicDestination + | BrowserSSHApplication.PrivateDestination + | BrowserSSHApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -11335,10 +11532,6 @@ export namespace ApplicationGetResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -11370,6 +11563,19 @@ export namespace ApplicationGetResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -11572,7 +11778,9 @@ export namespace ApplicationGetResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -11644,7 +11852,11 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserVNCApplication.PublicDestination + | BrowserVNCApplication.PrivateDestination + | BrowserVNCApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -11753,10 +11965,6 @@ export namespace ApplicationGetResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -11788,6 +11996,19 @@ export namespace ApplicationGetResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -11984,7 +12205,9 @@ export namespace ApplicationGetResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -12750,7 +12973,11 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserRdpApplication.PublicDestination + | BrowserRdpApplication.PrivateDestination + | BrowserRdpApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -12877,10 +13104,6 @@ export namespace ApplicationGetResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -12912,6 +13135,19 @@ export namespace ApplicationGetResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -13198,7 +13434,11 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | SelfHostedApplication.PublicDestination + | SelfHostedApplication.PrivateDestination + | SelfHostedApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -13313,10 +13553,6 @@ export declare namespace ApplicationCreateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -13348,6 +13584,19 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -13774,7 +14023,9 @@ export declare namespace ApplicationCreateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -13853,7 +14104,11 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserSSHApplication.PublicDestination + | BrowserSSHApplication.PrivateDestination + | BrowserSSHApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -13968,10 +14223,6 @@ export declare namespace ApplicationCreateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -14003,6 +14254,19 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -14188,7 +14452,9 @@ export declare namespace ApplicationCreateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -14267,7 +14533,11 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserVNCApplication.PublicDestination + | BrowserVNCApplication.PrivateDestination + | BrowserVNCApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -14382,10 +14652,6 @@ export declare namespace ApplicationCreateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -14417,6 +14683,19 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -14596,7 +14875,9 @@ export declare namespace ApplicationCreateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -15324,7 +15605,11 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserRdpApplication.PublicDestination + | BrowserRdpApplication.PrivateDestination + | BrowserRdpApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -15457,10 +15742,6 @@ export declare namespace ApplicationCreateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -15492,6 +15773,19 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -15759,7 +16053,11 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | SelfHostedApplication.PublicDestination + | SelfHostedApplication.PrivateDestination + | SelfHostedApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -15874,10 +16172,6 @@ export declare namespace ApplicationUpdateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -15909,6 +16203,19 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -16335,7 +16642,9 @@ export declare namespace ApplicationUpdateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -16414,7 +16723,11 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserSSHApplication.PublicDestination + | BrowserSSHApplication.PrivateDestination + | BrowserSSHApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -16529,10 +16842,6 @@ export declare namespace ApplicationUpdateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -16564,6 +16873,19 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -16749,7 +17071,9 @@ export declare namespace ApplicationUpdateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -16828,7 +17152,11 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserVNCApplication.PublicDestination + | BrowserVNCApplication.PrivateDestination + | BrowserVNCApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -16943,10 +17271,6 @@ export declare namespace ApplicationUpdateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -16978,6 +17302,19 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -17157,7 +17494,9 @@ export declare namespace ApplicationUpdateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -17885,7 +18224,11 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserRdpApplication.PublicDestination + | BrowserRdpApplication.PrivateDestination + | BrowserRdpApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -18018,10 +18361,6 @@ export declare namespace ApplicationUpdateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -18053,6 +18392,19 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ diff --git a/src/resources/zero-trust/access/logs/access-requests.ts b/src/resources/zero-trust/access/logs/access-requests.ts index eb75000b09..4905779655 100644 --- a/src/resources/zero-trust/access/logs/access-requests.ts +++ b/src/resources/zero-trust/access/logs/access-requests.ts @@ -43,6 +43,20 @@ export interface AccessRequestListParams { */ direction?: 'desc' | 'asc'; + /** + * Query param: Filter by user email. Defaults to substring matching. To force + * exact matching, set `email_exact=true`. Example (default): `email=@example.com` + * returns all events with that domain. Example (exact): + * `email=user@example.com&email_exact=true` returns only that user. + */ + email?: string; + + /** + * Query param: When true, `email` is matched exactly instead of substring + * matching. + */ + email_exact?: boolean; + /** * Query param: The maximum number of log entries to retrieve. */ @@ -67,6 +81,11 @@ export interface AccessRequestListParams { * Query param: The latest event timestamp to query. */ until?: string; + + /** + * Query param: Filter by user UUID. + */ + user_id?: string; } export declare namespace AccessRequests { diff --git a/src/resources/zero-trust/connectivity/directory/directory.ts b/src/resources/zero-trust/connectivity/directory/directory.ts index 0c979324a6..8d0ed0ede1 100644 --- a/src/resources/zero-trust/connectivity/directory/directory.ts +++ b/src/resources/zero-trust/connectivity/directory/directory.ts @@ -4,10 +4,15 @@ import { APIResource } from '../../../../resource'; import * as ServicesAPI from './services'; import { ServiceCreateParams, + ServiceCreateResponse, ServiceDeleteParams, ServiceGetParams, + ServiceGetResponse, ServiceListParams, + ServiceListResponse, + ServiceListResponsesV4PagePaginationArray, ServiceUpdateParams, + ServiceUpdateResponse, Services, } from './services'; @@ -16,10 +21,16 @@ export class Directory extends APIResource { } Directory.Services = Services; +Directory.ServiceListResponsesV4PagePaginationArray = ServiceListResponsesV4PagePaginationArray; export declare namespace Directory { export { Services as Services, + type ServiceCreateResponse as ServiceCreateResponse, + type ServiceUpdateResponse as ServiceUpdateResponse, + type ServiceListResponse as ServiceListResponse, + type ServiceGetResponse as ServiceGetResponse, + ServiceListResponsesV4PagePaginationArray as ServiceListResponsesV4PagePaginationArray, type ServiceCreateParams as ServiceCreateParams, type ServiceUpdateParams as ServiceUpdateParams, type ServiceListParams as ServiceListParams, diff --git a/src/resources/zero-trust/connectivity/directory/index.ts b/src/resources/zero-trust/connectivity/directory/index.ts index 78f208d56a..2d94b5e566 100644 --- a/src/resources/zero-trust/connectivity/directory/index.ts +++ b/src/resources/zero-trust/connectivity/directory/index.ts @@ -2,7 +2,12 @@ export { Directory } from './directory'; export { + ServiceListResponsesV4PagePaginationArray, Services, + type ServiceCreateResponse, + type ServiceUpdateResponse, + type ServiceListResponse, + type ServiceGetResponse, type ServiceCreateParams, type ServiceUpdateParams, type ServiceListParams, diff --git a/src/resources/zero-trust/connectivity/directory/services.ts b/src/resources/zero-trust/connectivity/directory/services.ts index 74516c9f4d..8942da54ff 100644 --- a/src/resources/zero-trust/connectivity/directory/services.ts +++ b/src/resources/zero-trust/connectivity/directory/services.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../../resource'; import * as Core from '../../../../core'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../../pagination'; export class Services extends APIResource { /** @@ -9,23 +10,30 @@ export class Services extends APIResource { * * @example * ```ts - * await client.zeroTrust.connectivity.directory.services.create( - * { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * host: {}, - * name: 'name', - * type: 'http', - * }, - * ); + * const service = + * await client.zeroTrust.connectivity.directory.services.create( + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * host: { + * hostname: 'api.example.com', + * resolver_network: { + * tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da', + * }, + * }, + * name: 'web-server', + * type: 'http', + * }, + * ); * ``` */ - create(params: ServiceCreateParams, options?: Core.RequestOptions): Core.APIPromise { + create(params: ServiceCreateParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; - return this._client.post(`/accounts/${account_id}/connectivity/directory/services`, { - body, - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + return ( + this._client.post(`/accounts/${account_id}/connectivity/directory/services`, { + body, + ...options, + }) as Core.APIPromise<{ result: ServiceCreateResponse }> + )._thenUnwrap((obj) => obj.result); } /** @@ -33,28 +41,35 @@ export class Services extends APIResource { * * @example * ```ts - * await client.zeroTrust.connectivity.directory.services.update( - * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * { - * account_id: 'account_id', - * host: {}, - * name: 'name', - * type: 'http', - * }, - * ); + * const service = + * await client.zeroTrust.connectivity.directory.services.update( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { + * account_id: 'account_id', + * host: { + * ipv4: '10.0.0.1', + * network: { + * tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da', + * }, + * }, + * name: 'web-app', + * type: 'http', + * }, + * ); * ``` */ update( serviceId: string, params: ServiceUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, ...body } = params; - return this._client.put(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { - body, - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + return ( + this._client.put(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: ServiceUpdateResponse }> + )._thenUnwrap((obj) => obj.result); } /** @@ -62,18 +77,24 @@ export class Services extends APIResource { * * @example * ```ts - * await client.zeroTrust.connectivity.directory.services.list( + * // Automatically fetches more pages as needed. + * for await (const serviceListResponse of client.zeroTrust.connectivity.directory.services.list( * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); + * )) { + * // ... + * } * ``` */ - list(params: ServiceListParams, options?: Core.RequestOptions): Core.APIPromise { + list( + params: ServiceListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { const { account_id, ...query } = params; - return this._client.get(`/accounts/${account_id}/connectivity/directory/services`, { - query, - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + return this._client.getAPIList( + `/accounts/${account_id}/connectivity/directory/services`, + ServiceListResponsesV4PagePaginationArray, + { query, ...options }, + ); } /** @@ -104,18 +125,331 @@ export class Services extends APIResource { * * @example * ```ts - * await client.zeroTrust.connectivity.directory.services.get( - * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * { account_id: 'account_id' }, - * ); + * const service = + * await client.zeroTrust.connectivity.directory.services.get( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'account_id' }, + * ); * ``` */ - get(serviceId: string, params: ServiceGetParams, options?: Core.RequestOptions): Core.APIPromise { + get( + serviceId: string, + params: ServiceGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { const { account_id } = params; - return this._client.get(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + return ( + this._client.get( + `/accounts/${account_id}/connectivity/directory/services/${serviceId}`, + options, + ) as Core.APIPromise<{ result: ServiceGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class ServiceListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface ServiceCreateResponse { + host: + | ServiceCreateResponse.InfraIPv4Host + | ServiceCreateResponse.InfraIPv6Host + | ServiceCreateResponse.InfraDualStackHost + | ServiceCreateResponse.InfraHostnameHost; + + name: string; + + type: 'http'; + + created_at?: string; + + http_port?: number | null; + + https_port?: number | null; + + service_id?: string; + + updated_at?: string; +} + +export namespace ServiceCreateResponse { + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; + + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } + } +} + +export interface ServiceUpdateResponse { + host: + | ServiceUpdateResponse.InfraIPv4Host + | ServiceUpdateResponse.InfraIPv6Host + | ServiceUpdateResponse.InfraDualStackHost + | ServiceUpdateResponse.InfraHostnameHost; + + name: string; + + type: 'http'; + + created_at?: string; + + http_port?: number | null; + + https_port?: number | null; + + service_id?: string; + + updated_at?: string; +} + +export namespace ServiceUpdateResponse { + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; + + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } + } +} + +export interface ServiceListResponse { + host: + | ServiceListResponse.InfraIPv4Host + | ServiceListResponse.InfraIPv6Host + | ServiceListResponse.InfraDualStackHost + | ServiceListResponse.InfraHostnameHost; + + name: string; + + type: 'http'; + + created_at?: string; + + http_port?: number | null; + + https_port?: number | null; + + service_id?: string; + + updated_at?: string; +} + +export namespace ServiceListResponse { + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; + + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } + } +} + +export interface ServiceGetResponse { + host: + | ServiceGetResponse.InfraIPv4Host + | ServiceGetResponse.InfraIPv6Host + | ServiceGetResponse.InfraDualStackHost + | ServiceGetResponse.InfraHostnameHost; + + name: string; + + type: 'http'; + + created_at?: string; + + http_port?: number | null; + + https_port?: number | null; + + service_id?: string; + + updated_at?: string; +} + +export namespace ServiceGetResponse { + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; + + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } } } @@ -128,7 +462,11 @@ export interface ServiceCreateParams { /** * Body param: */ - host: ServiceCreateParams.Host; + host: + | ServiceCreateParams.InfraIPv4Host + | ServiceCreateParams.InfraIPv6Host + | ServiceCreateParams.InfraDualStackHost + | ServiceCreateParams.InfraHostnameHost; /** * Body param: @@ -152,16 +490,56 @@ export interface ServiceCreateParams { } export namespace ServiceCreateParams { - export interface Host { - hostname?: string | null; + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; - ipv4?: string; + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } - ipv6?: string; + export interface InfraDualStackHost { + ipv4: string; - network?: unknown; + ipv6: string; - resolver_network?: unknown; + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } } } @@ -174,7 +552,11 @@ export interface ServiceUpdateParams { /** * Body param: */ - host: ServiceUpdateParams.Host; + host: + | ServiceUpdateParams.InfraIPv4Host + | ServiceUpdateParams.InfraIPv6Host + | ServiceUpdateParams.InfraDualStackHost + | ServiceUpdateParams.InfraHostnameHost; /** * Body param: @@ -198,35 +580,65 @@ export interface ServiceUpdateParams { } export namespace ServiceUpdateParams { - export interface Host { - hostname?: string | null; + export interface InfraIPv4Host { + ipv4: string; - ipv4?: string; + network: InfraIPv4Host.Network; + } - ipv6?: string; + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } - network?: unknown; + export interface InfraIPv6Host { + ipv6: string; - resolver_network?: unknown; + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } } } -export interface ServiceListParams { +export interface ServiceListParams extends V4PagePaginationArrayParams { /** * Path param: Account identifier */ account_id: string; - /** - * Query param: Current page in the response - */ - page?: number; - - /** - * Query param: Max amount of entries returned per page - */ - per_page?: number; - /** * Query param: */ @@ -241,8 +653,15 @@ export interface ServiceGetParams { account_id: string; } +Services.ServiceListResponsesV4PagePaginationArray = ServiceListResponsesV4PagePaginationArray; + export declare namespace Services { export { + type ServiceCreateResponse as ServiceCreateResponse, + type ServiceUpdateResponse as ServiceUpdateResponse, + type ServiceListResponse as ServiceListResponse, + type ServiceGetResponse as ServiceGetResponse, + ServiceListResponsesV4PagePaginationArray as ServiceListResponsesV4PagePaginationArray, type ServiceCreateParams as ServiceCreateParams, type ServiceUpdateParams as ServiceUpdateParams, type ServiceListParams as ServiceListParams, diff --git a/src/resources/zero-trust/devices/dex-tests.ts b/src/resources/zero-trust/devices/dex-tests.ts index 024ac99cae..4446969263 100644 --- a/src/resources/zero-trust/devices/dex-tests.ts +++ b/src/resources/zero-trust/devices/dex-tests.ts @@ -13,10 +13,7 @@ export class DEXTests extends APIResource { * const dexTest = * await client.zeroTrust.devices.dexTests.create({ * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: { - * host: 'https://dash.cloudflare.com', - * kind: 'http', - * }, + * data: {}, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -43,10 +40,7 @@ export class DEXTests extends APIResource { * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: { - * host: 'https://dash.cloudflare.com', - * kind: 'http', - * }, + * data: {}, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -277,24 +271,24 @@ export namespace DEXTestCreateResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -357,24 +351,24 @@ export namespace DEXTestUpdateResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -437,24 +431,24 @@ export namespace DEXTestListResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -522,24 +516,24 @@ export namespace DEXTestDeleteResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -603,24 +597,24 @@ export namespace DEXTestGetResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -686,24 +680,24 @@ export namespace DEXTestCreateParams { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -769,24 +763,24 @@ export namespace DEXTestUpdateParams { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default diff --git a/src/resources/zero-trust/devices/posture/posture.ts b/src/resources/zero-trust/devices/posture/posture.ts index 3b2bd2a898..54f186eca7 100644 --- a/src/resources/zero-trust/devices/posture/posture.ts +++ b/src/resources/zero-trust/devices/posture/posture.ts @@ -850,7 +850,7 @@ export interface OSVersionInput { /** * Additional version data. For Mac or iOS, the Product Version Extra. For Linux, - * the kernel release version. (Mac, iOS, and Linux only). + * the distribution name and version. (Mac, iOS, and Linux only). */ os_version_extra?: string; } @@ -883,7 +883,7 @@ export interface OSVersionInputParam { /** * Additional version data. For Mac or iOS, the Product Version Extra. For Linux, - * the kernel release version. (Mac, iOS, and Linux only). + * the distribution name and version. (Mac, iOS, and Linux only). */ os_version_extra?: string; } 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/zero-trust/dex/dex.ts b/src/resources/zero-trust/dex/dex.ts index a500404035..f12a3ad01f 100644 --- a/src/resources/zero-trust/dex/dex.ts +++ b/src/resources/zero-trust/dex/dex.ts @@ -29,7 +29,6 @@ import { FleetStatusLiveParams, FleetStatusLiveResponse, FleetStatusOverTimeParams, - FleetStatusOverTimeResponse, LiveStat, } from './fleet-status/fleet-status'; import * as HTTPTestsAPI from './http-tests/http-tests'; @@ -54,9 +53,6 @@ export class DEX extends APIResource { } export interface DigitalExperienceMonitor { - /** - * API Resource UUID tag. - */ id: string; /** @@ -212,7 +208,6 @@ export declare namespace DEX { FleetStatus as FleetStatus, type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, - type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts index 43f7978b75..a64c26da75 100644 --- a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts +++ b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts @@ -44,25 +44,20 @@ export class FleetStatus extends APIResource { * * @example * ```ts - * const response = - * await client.zeroTrust.dex.fleetStatus.overTime({ - * account_id: '01a7362d577a6c3019a474fd6f485823', - * from: '2023-10-11T00:00:00Z', - * to: '2023-10-11T00:00:00Z', - * }); + * await client.zeroTrust.dex.fleetStatus.overTime({ + * account_id: '01a7362d577a6c3019a474fd6f485823', + * from: '2023-10-11T00:00:00Z', + * to: '2023-10-11T00:00:00Z', + * }); * ``` */ - overTime( - params: FleetStatusOverTimeParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + overTime(params: FleetStatusOverTimeParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...query } = params; - return ( - this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { - query, - ...options, - }) as Core.APIPromise<{ result: FleetStatusOverTimeResponse }> - )._thenUnwrap((obj) => obj.result); + return this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { + query, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); } } @@ -98,53 +93,6 @@ export namespace FleetStatusLiveResponse { } } -export interface FleetStatusOverTimeResponse { - deviceStats?: FleetStatusOverTimeResponse.DeviceStats; -} - -export namespace FleetStatusOverTimeResponse { - export interface DeviceStats { - byMode?: Array; - - byStatus?: Array; - - /** - * Number of unique devices - */ - uniqueDevicesTotal?: number; - } - - export namespace DeviceStats { - export interface ByMode { - /** - * Timestamp in ISO format - */ - timestamp?: string; - - /** - * Number of unique devices - */ - uniqueDevicesTotal?: number; - - value?: string; - } - - export interface ByStatus { - /** - * Timestamp in ISO format - */ - timestamp?: string; - - /** - * Number of unique devices - */ - uniqueDevicesTotal?: number; - - value?: string; - } - } -} - export interface FleetStatusLiveParams { /** * Path param: Unique identifier for account @@ -191,7 +139,6 @@ export declare namespace FleetStatus { export { type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, - type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/index.ts b/src/resources/zero-trust/dex/fleet-status/index.ts index 8bf3ee7730..31cdb34bb8 100644 --- a/src/resources/zero-trust/dex/fleet-status/index.ts +++ b/src/resources/zero-trust/dex/fleet-status/index.ts @@ -10,7 +10,6 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, - type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status'; diff --git a/src/resources/zero-trust/dex/index.ts b/src/resources/zero-trust/dex/index.ts index d0f4eae54c..f97aa02d43 100644 --- a/src/resources/zero-trust/dex/index.ts +++ b/src/resources/zero-trust/dex/index.ts @@ -20,7 +20,6 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, - type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status/index'; diff --git a/src/resources/zero-trust/dlp/entries/custom.ts b/src/resources/zero-trust/dlp/entries/custom.ts index dcd4d0928f..15d6ea9d8c 100644 --- a/src/resources/zero-trust/dlp/entries/custom.ts +++ b/src/resources/zero-trust/dlp/entries/custom.ts @@ -17,7 +17,6 @@ export class Custom extends APIResource { * enabled: true, * name: 'name', * pattern: { regex: 'regex' }, - * profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * }); * ``` */ @@ -471,7 +470,7 @@ export interface CustomCreateParams { /** * Body param: */ - profile_id: string; + profile_id?: string; } export interface CustomUpdateParams { diff --git a/src/resources/zero-trust/dlp/entries/entries.ts b/src/resources/zero-trust/dlp/entries/entries.ts index 31eb68b9ee..de1cb6ba36 100644 --- a/src/resources/zero-trust/dlp/entries/entries.ts +++ b/src/resources/zero-trust/dlp/entries/entries.ts @@ -65,7 +65,6 @@ export class Entries extends APIResource { * enabled: true, * name: 'name', * pattern: { regex: 'regex' }, - * profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * }); * ``` */ @@ -637,7 +636,7 @@ export interface EntryCreateParams { /** * Body param: */ - profile_id: string; + profile_id?: string; } export type EntryUpdateParams = diff --git a/src/resources/zero-trust/gateway/configurations/configurations.ts b/src/resources/zero-trust/gateway/configurations/configurations.ts index 9f7a1aacb5..fb9a035b50 100755 --- a/src/resources/zero-trust/gateway/configurations/configurations.ts +++ b/src/resources/zero-trust/gateway/configurations/configurations.ts @@ -406,12 +406,11 @@ export interface CustomCertificateSettingsParam { } /** - * Specify user email settings for the firewall policies. When this is enabled, we - * standardize the email addresses in the identity part of the rule, so that they - * match the extended email variants in the firewall policies. When this setting is - * turned off, the email addresses in the identity part of the rule will be matched - * exactly as provided. If your email has `.` or `+` modifiers, you should enable - * this setting. + * Configures user email settings for firewall policies. When you enable this, the + * system standardizes email addresses in the identity portion of the rule to match + * extended email variants in firewall policies. When you disable this setting, the + * system matches email addresses exactly as you provide them. Enable this setting + * if your email uses `.` or `+` modifiers. */ export interface ExtendedEmailMatching { /** @@ -438,12 +437,11 @@ export interface ExtendedEmailMatching { } /** - * Specify user email settings for the firewall policies. When this is enabled, we - * standardize the email addresses in the identity part of the rule, so that they - * match the extended email variants in the firewall policies. When this setting is - * turned off, the email addresses in the identity part of the rule will be matched - * exactly as provided. If your email has `.` or `+` modifiers, you should enable - * this setting. + * Configures user email settings for firewall policies. When you enable this, the + * system standardizes email addresses in the identity portion of the rule to match + * extended email variants in firewall policies. When you disable this setting, the + * system matches email addresses exactly as you provide them. Enable this setting + * if your email uses `.` or `+` modifiers. */ export interface ExtendedEmailMatchingParam { /** @@ -515,12 +513,11 @@ export interface GatewayConfigurationSettings { custom_certificate?: CustomCertificateSettings | null; /** - * Specify user email settings for the firewall policies. When this is enabled, we - * standardize the email addresses in the identity part of the rule, so that they - * match the extended email variants in the firewall policies. When this setting is - * turned off, the email addresses in the identity part of the rule will be matched - * exactly as provided. If your email has `.` or `+` modifiers, you should enable - * this setting. + * Configures user email settings for firewall policies. When you enable this, the + * system standardizes email addresses in the identity portion of the rule to match + * extended email variants in firewall policies. When you disable this setting, the + * system matches email addresses exactly as you provide them. Enable this setting + * if your email uses `.` or `+` modifiers. */ extended_email_matching?: ExtendedEmailMatching | null; @@ -651,12 +648,11 @@ export interface GatewayConfigurationSettingsParam { custom_certificate?: CustomCertificateSettingsParam | null; /** - * Specify user email settings for the firewall policies. When this is enabled, we - * standardize the email addresses in the identity part of the rule, so that they - * match the extended email variants in the firewall policies. When this setting is - * turned off, the email addresses in the identity part of the rule will be matched - * exactly as provided. If your email has `.` or `+` modifiers, you should enable - * this setting. + * Configures user email settings for firewall policies. When you enable this, the + * system standardizes email addresses in the identity portion of the rule to match + * extended email variants in firewall policies. When you disable this setting, the + * system matches email addresses exactly as you provide them. Enable this setting + * if your email uses `.` or `+` modifiers. */ extended_email_matching?: ExtendedEmailMatchingParam | null; diff --git a/src/resources/zero-trust/gateway/rules.ts b/src/resources/zero-trust/gateway/rules.ts index 3187b1c5d2..845f44fd1f 100644 --- a/src/resources/zero-trust/gateway/rules.ts +++ b/src/resources/zero-trust/gateway/rules.ts @@ -321,7 +321,7 @@ export interface GatewayRule { /** * Specify the protocol or layer to evaluate the traffic, identity, and device - * posture expressions. + * posture expressions. Can only contain a single value. */ filters: Array; @@ -393,12 +393,10 @@ export interface GatewayRule { read_only?: boolean; /** - * Set settings related to this rule. Each setting is only valid for specific rule - * types and can only be used with the appropriate selectors. If Terraform drift is - * observed in these setting values, verify that the setting is supported for the - * given rule type and that the API response reflects the requested value. If the - * API response returns sanitized or modified values that differ from the request, - * use the API-provided values in Terraform to ensure consistency. + * Defines settings for this rule. Settings apply only to specific rule types and + * must use compatible selectors. If Terraform detects drift, confirm the setting + * supports your rule type and check whether the API modifies the value. Use + * API-returned values in your configuration to prevent drift. */ rule_settings?: RuleSetting; @@ -461,12 +459,10 @@ export namespace GatewayRule { } /** - * Set settings related to this rule. Each setting is only valid for specific rule - * types and can only be used with the appropriate selectors. If Terraform drift is - * observed in these setting values, verify that the setting is supported for the - * given rule type and that the API response reflects the requested value. If the - * API response returns sanitized or modified values that differ from the request, - * use the API-provided values in Terraform to ensure consistency. + * Defines settings for this rule. Settings apply only to specific rule types and + * must use compatible selectors. If Terraform detects drift, confirm the setting + * supports your rule type and check whether the API modifies the value. Use + * API-returned values in your configuration to prevent drift. */ export interface RuleSetting { /** @@ -920,12 +916,10 @@ export namespace RuleSetting { } /** - * Set settings related to this rule. Each setting is only valid for specific rule - * types and can only be used with the appropriate selectors. If Terraform drift is - * observed in these setting values, verify that the setting is supported for the - * given rule type and that the API response reflects the requested value. If the - * API response returns sanitized or modified values that differ from the request, - * use the API-provided values in Terraform to ensure consistency. + * Defines settings for this rule. Settings apply only to specific rule types and + * must use compatible selectors. If Terraform detects drift, confirm the setting + * supports your rule type and check whether the API modifies the value. Use + * API-returned values in your configuration to prevent drift. */ export interface RuleSettingParam { /** @@ -1584,7 +1578,7 @@ export interface RuleCreateParams { /** * Body param: Specify the protocol or layer to evaluate the traffic, identity, and - * device posture expressions. + * device posture expressions. Can only contain a single value. */ filters?: Array; @@ -1606,13 +1600,10 @@ export interface RuleCreateParams { precedence?: number; /** - * Body param: Set settings related to this rule. Each setting is only valid for - * specific rule types and can only be used with the appropriate selectors. If - * Terraform drift is observed in these setting values, verify that the setting is - * supported for the given rule type and that the API response reflects the - * requested value. If the API response returns sanitized or modified values that - * differ from the request, use the API-provided values in Terraform to ensure - * consistency. + * Body param: Defines settings for this rule. Settings apply only to specific rule + * types and must use compatible selectors. If Terraform detects drift, confirm the + * setting supports your rule type and check whether the API modifies the value. + * Use API-returned values in your configuration to prevent drift. */ rule_settings?: RuleSettingParam; @@ -1715,7 +1706,7 @@ export interface RuleUpdateParams { /** * Body param: Specify the protocol or layer to evaluate the traffic, identity, and - * device posture expressions. + * device posture expressions. Can only contain a single value. */ filters?: Array; @@ -1737,13 +1728,10 @@ export interface RuleUpdateParams { precedence?: number; /** - * Body param: Set settings related to this rule. Each setting is only valid for - * specific rule types and can only be used with the appropriate selectors. If - * Terraform drift is observed in these setting values, verify that the setting is - * supported for the given rule type and that the API response reflects the - * requested value. If the API response returns sanitized or modified values that - * differ from the request, use the API-provided values in Terraform to ensure - * consistency. + * Body param: Defines settings for this rule. Settings apply only to specific rule + * types and must use compatible selectors. If Terraform detects drift, confirm the + * setting supports your rule type and check whether the API modifies the value. + * Use API-returned values in your configuration to prevent drift. */ rule_settings?: RuleSettingParam; diff --git a/tests/api-resources/abuse-reports.test.ts b/tests/api-resources/abuse-reports.test.ts deleted file mode 100644 index 77af5bcdfb..0000000000 --- a/tests/api-resources/abuse-reports.test.ts +++ /dev/null @@ -1,69 +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 abuseReports', () => { - // TODO: investigate unauthorized HTTP response - test.skip('create: only required params', async () => { - const responsePromise = client.abuseReports.create('report_type', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - 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(); - 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 unauthorized HTTP response - test.skip('create: required and optional params', async () => { - const response = await client.abuseReports.create('report_type', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - 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', - comments: 'x', - company: 'x', - reported_country: 'xx', - reported_user_agent: 'x', - tele: 'x', - title: 'x', - }); - }); -}); diff --git a/tests/api-resources/accounts/accounts.test.ts b/tests/api-resources/accounts/accounts.test.ts index 562c65986b..c3e50bb520 100644 --- a/tests/api-resources/accounts/accounts.test.ts +++ b/tests/api-resources/accounts/accounts.test.ts @@ -51,6 +51,7 @@ describe('resource accounts', () => { id: '023e105f4ecef8ad9ca31a8372d0c353', name: 'Demo Account', type: 'standard', + managed_by: {}, settings: { abuse_contact_email: 'abuse_contact_email', enforce_twofactor: true }, }); }); diff --git a/tests/api-resources/api-gateway/configurations.test.ts b/tests/api-resources/api-gateway/configurations.test.ts index 307fcd648e..40818b7ce6 100644 --- a/tests/api-resources/api-gateway/configurations.test.ts +++ b/tests/api-resources/api-gateway/configurations.test.ts @@ -47,7 +47,6 @@ describe('resource configurations', () => { test('get: required and optional params', async () => { const response = await client.apiGateway.configurations.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - properties: ['auth_id_characteristics'], }); }); }); 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 694b31d176..68105203c4 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 @@ -179,21 +179,4 @@ describe('resource threatEvents', () => { tlp: 'amber', }); }); - - // TODO: HTTP 401 from prism - test.skip('get: only required params', async () => { - const responsePromise = client.cloudforceOne.threatEvents.get('event_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.get('event_id', { account_id: 'account_id' }); - }); }); 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..a543062bc0 100644 --- a/tests/api-resources/kv/namespaces/namespaces.test.ts +++ b/tests/api-resources/kv/namespaces/namespaces.test.ts @@ -69,7 +69,7 @@ describe('resource namespaces', () => { direction: 'asc', order: 'id', page: 1, - per_page: 5, + per_page: 1, }); }); @@ -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..03fbaa4b52 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: {}, }); }); diff --git a/tests/api-resources/leaked-credential-checks/detections.test.ts b/tests/api-resources/leaked-credential-checks/detections.test.ts new file mode 100644 index 0000000000..f9a1af0b8e --- /dev/null +++ b/tests/api-resources/leaked-credential-checks/detections.test.ts @@ -0,0 +1,98 @@ +// 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 detections', () => { + test('create: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.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.leakedCredentialChecks.detections.create({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + password: 'lookup_json_string(http.request.body.raw, "secret")', + username: 'lookup_json_string(http.request.body.raw, "user")', + }); + }); + + test('update: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.update( + '18a14bafaa8eb1df04ce683ec18c765e', + { 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('update: required and optional params', async () => { + const response = await client.leakedCredentialChecks.detections.update( + '18a14bafaa8eb1df04ce683ec18c765e', + { + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + password: 'lookup_json_string(http.request.body.raw, "secret")', + username: 'lookup_json_string(http.request.body.raw, "user")', + }, + ); + }); + + test('list: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.list({ + 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('list: required and optional params', async () => { + const response = await client.leakedCredentialChecks.detections.list({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); + + test('delete: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.delete( + '18a14bafaa8eb1df04ce683ec18c765e', + { 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('delete: required and optional params', async () => { + const response = await client.leakedCredentialChecks.detections.delete( + '18a14bafaa8eb1df04ce683ec18c765e', + { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + }); +}); diff --git a/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts b/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts new file mode 100644 index 0000000000..c7c208f9ed --- /dev/null +++ b/tests/api-resources/leaked-credential-checks/leaked-credential-checks.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 leakedCredentialChecks', () => { + test('create: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.create({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + enabled: true, + }); + }); + + test('get: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + }); +}); 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/consumers.test.ts b/tests/api-resources/queues/consumers.test.ts index 9cff12967c..e4275cc8e0 100644 --- a/tests/api-resources/queues/consumers.test.ts +++ b/tests/api-resources/queues/consumers.test.ts @@ -115,4 +115,27 @@ describe('resource consumers', () => { { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); }); + + test('get: only required params', async () => { + const responsePromise = client.queues.consumers.get( + '023e105f4ecef8ad9ca31a8372d0c353', + '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('get: required and optional params', async () => { + const response = await client.queues.consumers.get( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + }); }); 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/queues/subscriptions.test.ts b/tests/api-resources/queues/subscriptions.test.ts new file mode 100644 index 0000000000..fed29a3ae9 --- /dev/null +++ b/tests/api-resources/queues/subscriptions.test.ts @@ -0,0 +1,101 @@ +// 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 subscriptions', () => { + test('create: only required params', async () => { + const responsePromise = client.queues.subscriptions.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.queues.subscriptions.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + destination: { queue_id: 'queue_id', type: 'queues.queue' }, + enabled: true, + events: ['string'], + name: 'name', + source: { type: 'images' }, + }); + }); + + test('update: only required params', async () => { + const responsePromise = client.queues.subscriptions.update('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('update: required and optional params', async () => { + const response = await client.queues.subscriptions.update('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + destination: { queue_id: 'queue_id', type: 'queues.queue' }, + enabled: true, + events: ['string'], + name: 'name', + }); + }); + + test('list: only required params', async () => { + const responsePromise = client.queues.subscriptions.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.queues.subscriptions.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + direction: 'asc', + order: 'created_at', + page: 1, + per_page: 1, + }); + }); + + test('delete: only required params', async () => { + const responsePromise = client.queues.subscriptions.delete('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('delete: required and optional params', async () => { + const response = await client.queues.subscriptions.delete('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); +}); diff --git a/tests/api-resources/secrets-store/stores/secrets.test.ts b/tests/api-resources/secrets-store/stores/secrets.test.ts index afb8337e61..51d39096f9 100644 --- a/tests/api-resources/secrets-store/stores/secrets.test.ts +++ b/tests/api-resources/secrets-store/stores/secrets.test.ts @@ -13,7 +13,13 @@ 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', 'ai_gateway'], value: 'api-token-secret-123' }], + body: [ + { + name: 'MY_API_KEY', + scopes: ['workers', 'ai_gateway', 'dex', 'access'], + value: 'api-token-secret-123', + }, + ], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -30,7 +36,7 @@ describe('resource secrets', () => { body: [ { name: 'MY_API_KEY', - scopes: ['workers', 'ai_gateway'], + scopes: ['workers', 'ai_gateway', 'dex', 'access'], value: 'api-token-secret-123', comment: 'info about my secret', }, @@ -60,7 +66,7 @@ describe('resource secrets', () => { order: 'name', page: 2, per_page: 20, - scopes: [['workers', 'ai_gateway']], + scopes: [['workers', 'ai_gateway', 'dex', 'access']], search: 'search', }); }); @@ -116,7 +122,7 @@ describe('resource secrets', () => { { account_id: '985e105f4ecef8ad9ca31a8372d0c353', name: 'MY_API_KEY', - scopes: ['workers', 'ai_gateway'], + scopes: ['workers', 'ai_gateway', 'dex', 'access'], }, ); const rawResponse = await responsePromise.asResponse(); @@ -136,7 +142,7 @@ describe('resource secrets', () => { { account_id: '985e105f4ecef8ad9ca31a8372d0c353', name: 'MY_API_KEY', - scopes: ['workers', 'ai_gateway'], + scopes: ['workers', 'ai_gateway', 'dex', 'access'], comment: 'info about my secret', }, ); @@ -166,7 +172,7 @@ describe('resource secrets', () => { { account_id: '985e105f4ecef8ad9ca31a8372d0c353', comment: 'info about my secret', - scopes: ['workers', 'ai_gateway'], + scopes: ['workers', 'ai_gateway', 'dex', 'access'], }, ); }); 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..cdad8d0e4b --- /dev/null +++ b/tests/api-resources/workflows/instances/instances.test.ts @@ -0,0 +1,89 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource 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', + cursor: 'cursor', + date_end: '2019-12-27T18:11:19.117Z', + date_start: '2019-12-27T18:11:19.117Z', + direction: 'asc', + 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' }); + }); +}); diff --git a/tests/api-resources/zero-trust/access/applications/applications.test.ts b/tests/api-resources/zero-trust/access/applications/applications.test.ts index 225d81744d..e4607eeda4 100644 --- a/tests/api-resources/zero-trust/access/applications/applications.test.ts +++ b/tests/api-resources/zero-trust/access/applications/applications.test.ts @@ -78,6 +78,7 @@ describe('resource applications', () => { type: 'private', vnet_id: 'vnet_id', }, + { mcp_server_id: 'mcp-server-1', type: 'via_mcp_server_portal' }, ], enable_binding_cookie: true, http_only_cookie_attribute: true, @@ -182,6 +183,7 @@ describe('resource applications', () => { type: 'private', vnet_id: 'vnet_id', }, + { mcp_server_id: 'mcp-server-1', type: 'via_mcp_server_portal' }, ], enable_binding_cookie: true, http_only_cookie_attribute: true, 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 e939ee60e6..50ec6a1d24 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 @@ -27,11 +27,14 @@ describe('resource accessRequests', () => { const response = await client.zeroTrust.access.logs.accessRequests.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', direction: 'desc', + email: 'user@example.com', + email_exact: true, limit: 0, page: 0, per_page: 0, since: '2020-07-01T05:20:00Z', until: '2020-10-01T05:20:00Z', + user_id: 'f757c5c3-c1b2-50f7-9126-150a099b6f7e', }); }); }); diff --git a/tests/api-resources/zero-trust/connectivity/directory/services.test.ts b/tests/api-resources/zero-trust/connectivity/directory/services.test.ts index 4e6440e25c..735afe06c3 100644 --- a/tests/api-resources/zero-trust/connectivity/directory/services.test.ts +++ b/tests/api-resources/zero-trust/connectivity/directory/services.test.ts @@ -13,8 +13,11 @@ describe('resource services', () => { test('create: only required params', async () => { const responsePromise = client.zeroTrust.connectivity.directory.services.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', - host: {}, - name: 'name', + host: { + hostname: 'api.example.com', + resolver_network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da' }, + }, + name: 'web-server', type: 'http', }); const rawResponse = await responsePromise.asResponse(); @@ -29,18 +32,26 @@ describe('resource services', () => { test('create: required and optional params', async () => { const response = await client.zeroTrust.connectivity.directory.services.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', - host: { hostname: 'hostname', ipv4: 'ipv4', ipv6: 'ipv6', network: {}, resolver_network: {} }, - name: 'name', + host: { + hostname: 'api.example.com', + resolver_network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da', resolver_ips: ['string'] }, + }, + name: 'web-server', type: 'http', - http_port: 1, - https_port: 1, + http_port: 8080, + https_port: 8443, }); }); test('update: only required params', async () => { const responsePromise = client.zeroTrust.connectivity.directory.services.update( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - { account_id: 'account_id', host: {}, name: 'name', type: 'http' }, + { + account_id: 'account_id', + host: { ipv4: '10.0.0.1', network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da' } }, + name: 'web-app', + type: 'http', + }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -56,11 +67,11 @@ describe('resource services', () => { '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: 'account_id', - host: { hostname: 'hostname', ipv4: 'ipv4', ipv6: 'ipv6', network: {}, resolver_network: {} }, - name: 'name', + host: { ipv4: '10.0.0.1', network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da' } }, + name: 'web-app', type: 'http', - http_port: 1, - https_port: 1, + http_port: 8080, + https_port: 8443, }, ); }); diff --git a/tests/api-resources/zero-trust/devices/dex-tests.test.ts b/tests/api-resources/zero-trust/devices/dex-tests.test.ts index 0669d5569c..246e9b7961 100644 --- a/tests/api-resources/zero-trust/devices/dex-tests.test.ts +++ b/tests/api-resources/zero-trust/devices/dex-tests.test.ts @@ -13,7 +13,7 @@ describe('resource dexTests', () => { test('create: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.create({ account_id: '01a7362d577a6c3019a474fd6f485823', - data: { host: 'https://dash.cloudflare.com', kind: 'http' }, + data: {}, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -35,7 +35,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], + target_policies: [{ id: 'id', default: true, name: 'name' }], targeted: true, }); }); @@ -43,7 +43,7 @@ describe('resource dexTests', () => { test('update: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', - data: { host: 'https://dash.cloudflare.com', kind: 'http' }, + data: {}, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -65,7 +65,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], + target_policies: [{ id: 'id', default: true, name: 'name' }], targeted: true, }); }); diff --git a/tests/api-resources/zero-trust/dlp/entries/custom.test.ts b/tests/api-resources/zero-trust/dlp/entries/custom.test.ts index fa0b9659df..a07726b8c7 100644 --- a/tests/api-resources/zero-trust/dlp/entries/custom.test.ts +++ b/tests/api-resources/zero-trust/dlp/entries/custom.test.ts @@ -16,7 +16,6 @@ describe('resource custom', () => { enabled: true, name: 'name', pattern: { regex: 'regex' }, - profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); diff --git a/tests/api-resources/zero-trust/dlp/entries/entries.test.ts b/tests/api-resources/zero-trust/dlp/entries/entries.test.ts index 0758392e54..aaeb9ac8db 100644 --- a/tests/api-resources/zero-trust/dlp/entries/entries.test.ts +++ b/tests/api-resources/zero-trust/dlp/entries/entries.test.ts @@ -16,7 +16,6 @@ describe('resource entries', () => { enabled: true, name: 'name', pattern: { regex: 'regex' }, - profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); From 1a2d99f9b7daed21785d9470d6da42e7005cd4cd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 19:26:46 +0000 Subject: [PATCH 277/451] chore(api): update composite API spec --- .stats.yml | 4 +- api.md | 15 +- src/resources/dns/records.ts | 88 +-- src/resources/radar/ai/bots/summary.ts | 2 +- src/resources/radar/ai/inference/summary.ts | 4 +- .../ai/inference/timeseries-groups/summary.ts | 4 +- src/resources/radar/ai/timeseries-groups.ts | 2 +- src/resources/radar/as112/summary.ts | 12 +- .../radar/as112/timeseries-groups.ts | 12 +- src/resources/radar/attacks/layer3/summary.ts | 14 +- .../radar/attacks/layer3/timeseries-groups.ts | 14 +- src/resources/radar/attacks/layer3/top/top.ts | 4 +- src/resources/radar/attacks/layer7/summary.ts | 14 +- .../radar/attacks/layer7/timeseries-groups.ts | 14 +- src/resources/radar/attacks/layer7/top/top.ts | 4 +- src/resources/radar/dns/summary.ts | 20 +- src/resources/radar/dns/timeseries-groups.ts | 20 +- src/resources/radar/email/routing/summary.ts | 12 +- .../radar/email/routing/timeseries-groups.ts | 12 +- src/resources/radar/email/security/summary.ts | 18 +- .../radar/email/security/timeseries-groups.ts | 18 +- src/resources/radar/http/summary.ts | 16 +- src/resources/radar/http/timeseries-groups.ts | 20 +- src/resources/radar/http/top.ts | 11 +- .../radar/leaked-credentials/summary.ts | 4 +- .../leaked-credentials/timeseries-groups.ts | 4 +- .../connectivity/directory/directory.ts | 11 - .../connectivity/directory/index.ts | 5 - .../connectivity/directory/services.ts | 561 +++--------------- .../zero-trust/devices/posture/posture.ts | 4 +- .../gateway/configurations/configurations.ts | 44 +- src/resources/zero-trust/gateway/rules.ts | 52 +- .../connectivity/directory/services.test.ts | 33 +- 33 files changed, 321 insertions(+), 751 deletions(-) diff --git a/.stats.yml b/.stats.yml index bc2fda8e3a..4cf021b837 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1855 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-915bb405f875913c47f1125a42f6dd7eee490896e7cf117e35b14d8cb273cfd5.yml -openapi_spec_hash: 039c43ebe70cf009895dd0553d7eb929 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fa078e98d33794f32c77256479dceb7d6b9e0ad95da89fa01474b2c1731cad3d.yml +openapi_spec_hash: eb25624c59f39858b740347f8f092a1d config_hash: ced339c69004cc06854b37a59f5d270a diff --git a/api.md b/api.md index 9106d9a28d..ddd67b189b 100644 --- a/api.md +++ b/api.md @@ -5719,20 +5719,13 @@ Methods: #### Services -Types: - -- ServiceCreateResponse -- ServiceUpdateResponse -- ServiceListResponse -- ServiceGetResponse - Methods: -- client.zeroTrust.connectivity.directory.services.create({ ...params }) -> ServiceCreateResponse -- client.zeroTrust.connectivity.directory.services.update(serviceId, { ...params }) -> ServiceUpdateResponse -- client.zeroTrust.connectivity.directory.services.list({ ...params }) -> ServiceListResponsesV4PagePaginationArray +- client.zeroTrust.connectivity.directory.services.create({ ...params }) -> void +- client.zeroTrust.connectivity.directory.services.update(serviceId, { ...params }) -> void +- client.zeroTrust.connectivity.directory.services.list({ ...params }) -> void - client.zeroTrust.connectivity.directory.services.delete(serviceId, { ...params }) -> void -- client.zeroTrust.connectivity.directory.services.get(serviceId, { ...params }) -> ServiceGetResponse +- client.zeroTrust.connectivity.directory.services.get(serviceId, { ...params }) -> void ## DLP diff --git a/src/resources/dns/records.ts b/src/resources/dns/records.ts index b3eb5c6bb2..0a09cf3cb4 100644 --- a/src/resources/dns/records.ts +++ b/src/resources/dns/records.ts @@ -3701,30 +3701,30 @@ export namespace Record { } export type RecordResponse = - | RecordResponse.A - | RecordResponse.AAAA - | RecordResponse.CNAME - | RecordResponse.MX - | RecordResponse.NS - | RecordResponse.Openpgpkey - | RecordResponse.PTR - | RecordResponse.TXT - | RecordResponse.CAA - | RecordResponse.CERT - | RecordResponse.DNSKEY - | RecordResponse.DS - | RecordResponse.HTTPS - | RecordResponse.LOC - | RecordResponse.NAPTR - | RecordResponse.SMIMEA - | RecordResponse.SRV - | RecordResponse.SSHFP - | RecordResponse.SVCB - | RecordResponse.TLSA - | RecordResponse.URI; + | RecordResponse.ARecord + | RecordResponse.AAAARecord + | RecordResponse.CNAMERecord + | RecordResponse.MXRecord + | RecordResponse.NSRecord + | RecordResponse.OpenpgpkeyRecord + | RecordResponse.PTRRecord + | RecordResponse.TXTRecord + | RecordResponse.CAARecord + | RecordResponse.CERTRecord + | RecordResponse.DNSKEYRecord + | RecordResponse.DSRecord + | RecordResponse.HTTPSRecord + | RecordResponse.LOCRecord + | RecordResponse.NAPTRRecord + | RecordResponse.SMIMEARecord + | RecordResponse.SRVRecord + | RecordResponse.SSHFPRecord + | RecordResponse.SVCBRecord + | RecordResponse.TLSARecord + | RecordResponse.URIRecord; export namespace RecordResponse { - export interface A extends RecordsAPI.ARecord { + export interface ARecord extends RecordsAPI.ARecord { /** * Identifier. */ @@ -3761,7 +3761,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface AAAA extends RecordsAPI.AAAARecord { + export interface AAAARecord extends RecordsAPI.AAAARecord { /** * Identifier. */ @@ -3798,7 +3798,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface CNAME extends RecordsAPI.CNAMERecord { + export interface CNAMERecord extends RecordsAPI.CNAMERecord { /** * Identifier. */ @@ -3835,7 +3835,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface MX extends RecordsAPI.MXRecord { + export interface MXRecord extends RecordsAPI.MXRecord { /** * Identifier. */ @@ -3872,7 +3872,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface NS extends RecordsAPI.NSRecord { + export interface NSRecord extends RecordsAPI.NSRecord { /** * Identifier. */ @@ -3909,7 +3909,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface Openpgpkey { + export interface OpenpgpkeyRecord { /** * Identifier. */ @@ -3960,7 +3960,7 @@ export namespace RecordResponse { /** * Settings for the DNS record. */ - settings: Openpgpkey.Settings; + settings: OpenpgpkeyRecord.Settings; /** * Custom tags for the DNS record. This field has no effect on DNS responses. @@ -3990,7 +3990,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export namespace Openpgpkey { + export namespace OpenpgpkeyRecord { /** * Settings for the DNS record. */ @@ -4013,7 +4013,7 @@ export namespace RecordResponse { } } - export interface PTR extends RecordsAPI.PTRRecord { + export interface PTRRecord extends RecordsAPI.PTRRecord { /** * Identifier. */ @@ -4050,7 +4050,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface TXT extends RecordsAPI.TXTRecord { + export interface TXTRecord extends RecordsAPI.TXTRecord { /** * Identifier. */ @@ -4087,7 +4087,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface CAA extends RecordsAPI.CAARecord { + export interface CAARecord extends RecordsAPI.CAARecord { /** * Identifier. */ @@ -4124,7 +4124,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface CERT extends RecordsAPI.CERTRecord { + export interface CERTRecord extends RecordsAPI.CERTRecord { /** * Identifier. */ @@ -4161,7 +4161,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface DNSKEY extends RecordsAPI.DNSKEYRecord { + export interface DNSKEYRecord extends RecordsAPI.DNSKEYRecord { /** * Identifier. */ @@ -4198,7 +4198,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface DS extends RecordsAPI.DSRecord { + export interface DSRecord extends RecordsAPI.DSRecord { /** * Identifier. */ @@ -4235,7 +4235,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface HTTPS extends RecordsAPI.HTTPSRecord { + export interface HTTPSRecord extends RecordsAPI.HTTPSRecord { /** * Identifier. */ @@ -4272,7 +4272,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface LOC extends RecordsAPI.LOCRecord { + export interface LOCRecord extends RecordsAPI.LOCRecord { /** * Identifier. */ @@ -4309,7 +4309,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface NAPTR extends RecordsAPI.NAPTRRecord { + export interface NAPTRRecord extends RecordsAPI.NAPTRRecord { /** * Identifier. */ @@ -4346,7 +4346,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SMIMEA extends RecordsAPI.SMIMEARecord { + export interface SMIMEARecord extends RecordsAPI.SMIMEARecord { /** * Identifier. */ @@ -4383,7 +4383,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SRV extends RecordsAPI.SRVRecord { + export interface SRVRecord extends RecordsAPI.SRVRecord { /** * Identifier. */ @@ -4420,7 +4420,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SSHFP extends RecordsAPI.SSHFPRecord { + export interface SSHFPRecord extends RecordsAPI.SSHFPRecord { /** * Identifier. */ @@ -4457,7 +4457,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SVCB extends RecordsAPI.SVCBRecord { + export interface SVCBRecord extends RecordsAPI.SVCBRecord { /** * Identifier. */ @@ -4494,7 +4494,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface TLSA extends RecordsAPI.TLSARecord { + export interface TLSARecord extends RecordsAPI.TLSARecord { /** * Identifier. */ @@ -4531,7 +4531,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface URI extends RecordsAPI.URIRecord { + export interface URIRecord extends RecordsAPI.URIRecord { /** * Identifier. */ diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts index c9e77e1896..75c99603d5 100644 --- a/src/resources/radar/ai/bots/summary.ts +++ b/src/resources/radar/ai/bots/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of traffic by AI user agent. * - * @deprecated Use [Radar AI Bots Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/summary_v2/) instead. + * @deprecated */ userAgent( query?: SummaryUserAgentParams, diff --git a/src/resources/radar/ai/inference/summary.ts b/src/resources/radar/ai/inference/summary.ts index 4b9b871ddc..a22b6f10e9 100644 --- a/src/resources/radar/ai/inference/summary.ts +++ b/src/resources/radar/ai/inference/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by model. * - * @deprecated Use [Radar AI Inference Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/summary_v2/) instead. + * @deprecated */ model(query?: SummaryModelParams, options?: Core.RequestOptions): Core.APIPromise; model(options?: Core.RequestOptions): Core.APIPromise; @@ -29,7 +29,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by task. * - * @deprecated Use [Radar AI Inference Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/summary_v2/) instead. + * @deprecated */ task(query?: SummaryTaskParams, options?: Core.RequestOptions): Core.APIPromise; task(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/ai/inference/timeseries-groups/summary.ts b/src/resources/radar/ai/inference/timeseries-groups/summary.ts index 43edd89a6c..bf808d1b21 100644 --- a/src/resources/radar/ai/inference/timeseries-groups/summary.ts +++ b/src/resources/radar/ai/inference/timeseries-groups/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by model over time. * - * @deprecated Use [Radar AI Inference Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/timeseries_groups_v2/) instead. + * @deprecated */ model(query?: SummaryModelParams, options?: Core.RequestOptions): Core.APIPromise; model(options?: Core.RequestOptions): Core.APIPromise; @@ -30,7 +30,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by task over time. * - * @deprecated Use [Radar AI Inference Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/timeseries_groups_v2/) instead. + * @deprecated */ task(query?: SummaryTaskParams, options?: Core.RequestOptions): Core.APIPromise; task(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index c516b5d812..b5b307bf8b 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -93,7 +93,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of traffic by AI user agent over time. * - * @deprecated Use [Radar AI Bots Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/timeseries_groups/) instead. + * @deprecated */ userAgent( query?: TimeseriesGroupUserAgentParams, diff --git a/src/resources/radar/as112/summary.ts b/src/resources/radar/as112/summary.ts index c83056b982..d6034b19c4 100644 --- a/src/resources/radar/as112/summary.ts +++ b/src/resources/radar/as112/summary.ts @@ -9,7 +9,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by DNSSEC (DNS Security * Extensions) support. * - * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. + * @deprecated */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -31,7 +31,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by EDNS (Extension Mechanisms * for DNS) support. * - * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. + * @deprecated */ edns(query?: SummaryEdnsParams, options?: Core.RequestOptions): Core.APIPromise; edns(options?: Core.RequestOptions): Core.APIPromise; @@ -52,7 +52,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by IP version. * - * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -76,7 +76,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by protocol. * - * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. + * @deprecated */ protocol( query?: SummaryProtocolParams, @@ -100,7 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by type. * - * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. + * @deprecated */ queryType( query?: SummaryQueryTypeParams, @@ -124,7 +124,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of AS112 DNS requests classified by response code. * - * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. + * @deprecated */ responseCodes( query?: SummaryResponseCodesParams, diff --git a/src/resources/radar/as112/timeseries-groups.ts b/src/resources/radar/as112/timeseries-groups.ts index fd564e8245..e5593df35c 100644 --- a/src/resources/radar/as112/timeseries-groups.ts +++ b/src/resources/radar/as112/timeseries-groups.ts @@ -9,7 +9,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by DNSSEC (DNS Security * Extensions) support over time. * - * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. + * @deprecated */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -34,7 +34,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by EDNS (Extension Mechanisms * for DNS) support over time. * - * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. + * @deprecated */ edns( query?: TimeseriesGroupEdnsParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by IP version over time. * - * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -84,7 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by protocol over * time. * - * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. + * @deprecated */ protocol( query?: TimeseriesGroupProtocolParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by type over time. * - * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. + * @deprecated */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -134,7 +134,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by response code * over time. * - * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. + * @deprecated */ responseCodes( query?: TimeseriesGroupResponseCodesParams, diff --git a/src/resources/radar/attacks/layer3/summary.ts b/src/resources/radar/attacks/layer3/summary.ts index 869dd46727..bc4ccc4c81 100644 --- a/src/resources/radar/attacks/layer3/summary.ts +++ b/src/resources/radar/attacks/layer3/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate. * - * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. + * @deprecated */ bitrate( query?: SummaryBitrateParams, @@ -32,7 +32,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration. * - * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. + * @deprecated */ duration( query?: SummaryDurationParams, @@ -56,7 +56,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry. * - * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. + * @deprecated */ industry( query?: SummaryIndustryParams, @@ -80,7 +80,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version. * - * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -104,7 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol. * - * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. + * @deprecated */ protocol( query?: SummaryProtocolParams, @@ -128,7 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector. * - * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. + * @deprecated */ vector(query?: SummaryVectorParams, options?: Core.RequestOptions): Core.APIPromise; vector(options?: Core.RequestOptions): Core.APIPromise; @@ -149,7 +149,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical. * - * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. + * @deprecated */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer3/timeseries-groups.ts b/src/resources/radar/attacks/layer3/timeseries-groups.ts index 622eb83d71..9f8d171a40 100644 --- a/src/resources/radar/attacks/layer3/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer3/timeseries-groups.ts @@ -8,7 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate over time. * - * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. + * @deprecated */ bitrate( query?: TimeseriesGroupBitrateParams, @@ -33,7 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration over time. * - * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. + * @deprecated */ duration( query?: TimeseriesGroupDurationParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry over time. * - * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. + * @deprecated */ industry( query?: TimeseriesGroupIndustryParams, @@ -83,7 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version over time. * - * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol over time. * - * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. + * @deprecated */ protocol( query?: TimeseriesGroupProtocolParams, @@ -133,7 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector over time. * - * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. + * @deprecated */ vector( query?: TimeseriesGroupVectorParams, @@ -158,7 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical over time. * - * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. + * @deprecated */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer3/top/top.ts b/src/resources/radar/attacks/layer3/top/top.ts index e8e5c6b5b8..2da56402ce 100644 --- a/src/resources/radar/attacks/layer3/top/top.ts +++ b/src/resources/radar/attacks/layer3/top/top.ts @@ -47,7 +47,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by industry endpoint. * - * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. + * @deprecated */ industry(query?: TopIndustryParams, options?: Core.RequestOptions): Core.APIPromise; industry(options?: Core.RequestOptions): Core.APIPromise; @@ -69,7 +69,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by vertical endpoint. * - * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. + * @deprecated */ vertical(query?: TopVerticalParams, options?: Core.RequestOptions): Core.APIPromise; vertical(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/attacks/layer7/summary.ts b/src/resources/radar/attacks/layer7/summary.ts index 3d4b27fb58..160eb24dd8 100644 --- a/src/resources/radar/attacks/layer7/summary.ts +++ b/src/resources/radar/attacks/layer7/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method. * - * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. + * @deprecated */ httpMethod( query?: SummaryHTTPMethodParams, @@ -33,7 +33,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version. * - * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. + * @deprecated */ httpVersion( query?: SummaryHTTPVersionParams, @@ -58,7 +58,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry. * - * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. + * @deprecated */ industry( query?: SummaryIndustryParams, @@ -82,7 +82,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version. * - * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -106,7 +106,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules. * - * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. + * @deprecated */ managedRules( query?: SummaryManagedRulesParams, @@ -131,7 +131,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product. * - * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. + * @deprecated */ mitigationProduct( query?: SummaryMitigationProductParams, @@ -156,7 +156,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical. * - * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. + * @deprecated */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer7/timeseries-groups.ts b/src/resources/radar/attacks/layer7/timeseries-groups.ts index ab5076ef90..ce7c62ce1e 100644 --- a/src/resources/radar/attacks/layer7/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer7/timeseries-groups.ts @@ -8,7 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method over time. * - * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. + * @deprecated */ httpMethod( query?: TimeseriesGroupHTTPMethodParams, @@ -33,7 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version over time. * - * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. + * @deprecated */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry over time. * - * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. + * @deprecated */ industry( query?: TimeseriesGroupIndustryParams, @@ -83,7 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version used over time. * - * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules over time. * - * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. + * @deprecated */ managedRules( query?: TimeseriesGroupManagedRulesParams, @@ -133,7 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product over time. * - * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. + * @deprecated */ mitigationProduct( query?: TimeseriesGroupMitigationProductParams, @@ -158,7 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical over time. * - * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. + * @deprecated */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer7/top/top.ts b/src/resources/radar/attacks/layer7/top/top.ts index 1fa4d17fff..74086112c2 100644 --- a/src/resources/radar/attacks/layer7/top/top.ts +++ b/src/resources/radar/attacks/layer7/top/top.ts @@ -51,7 +51,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by industry endpoint. * - * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. + * @deprecated */ industry(query?: TopIndustryParams, options?: Core.RequestOptions): Core.APIPromise; industry(options?: Core.RequestOptions): Core.APIPromise; @@ -73,7 +73,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by vertical endpoint. * - * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. + * @deprecated */ vertical(query?: TopVerticalParams, options?: Core.RequestOptions): Core.APIPromise; vertical(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/dns/summary.ts b/src/resources/radar/dns/summary.ts index bea2bcf785..575afc929b 100644 --- a/src/resources/radar/dns/summary.ts +++ b/src/resources/radar/dns/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by cache status. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ cacheHit( query?: SummaryCacheHitParams, @@ -33,7 +33,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -55,7 +55,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ dnssecAware( query?: SummaryDNSSECAwareParams, @@ -80,7 +80,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ dnssecE2E( query?: SummaryDNSSECE2EParams, @@ -104,7 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by IP version. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -128,7 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ matchingAnswer( query?: SummaryMatchingAnswerParams, @@ -152,7 +152,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ protocol( query?: SummaryProtocolParams, @@ -176,7 +176,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by type. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ queryType( query?: SummaryQueryTypeParams, @@ -200,7 +200,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by response code. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ responseCode( query?: SummaryResponseCodeParams, @@ -224,7 +224,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by minimum response TTL. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ responseTTL( query?: SummaryResponseTTLParams, diff --git a/src/resources/radar/dns/timeseries-groups.ts b/src/resources/radar/dns/timeseries-groups.ts index b2120478af..5e1ea8a4e1 100644 --- a/src/resources/radar/dns/timeseries-groups.ts +++ b/src/resources/radar/dns/timeseries-groups.ts @@ -8,7 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by cache status over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ cacheHit( query?: TimeseriesGroupCacheHitParams, @@ -33,7 +33,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ dnssecAware( query?: TimeseriesGroupDNSSECAwareParams, @@ -84,7 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ dnssecE2E( query?: TimeseriesGroupDNSSECE2EParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by IP version over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -132,7 +132,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ matchingAnswer( query?: TimeseriesGroupMatchingAnswerParams, @@ -157,7 +157,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ protocol( query?: TimeseriesGroupProtocolParams, @@ -181,7 +181,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by type over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -205,7 +205,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by response code over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ responseCode( query?: TimeseriesGroupResponseCodeParams, @@ -230,7 +230,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by minimum answer TTL over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ responseTTL( query?: TimeseriesGroupResponseTTLParams, diff --git a/src/resources/radar/email/routing/summary.ts b/src/resources/radar/email/routing/summary.ts index 3d29f93974..00defd2b84 100644 --- a/src/resources/radar/email/routing/summary.ts +++ b/src/resources/radar/email/routing/summary.ts @@ -10,7 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. + * @deprecated */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -32,7 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. + * @deprecated */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -54,7 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. + * @deprecated */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -76,7 +76,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted). * - * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. + * @deprecated */ encrypted( query?: SummaryEncryptedParams, @@ -100,7 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by IP version. * - * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -125,7 +125,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. + * @deprecated */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/email/routing/timeseries-groups.ts b/src/resources/radar/email/routing/timeseries-groups.ts index 4d12509309..3a9801b143 100644 --- a/src/resources/radar/email/routing/timeseries-groups.ts +++ b/src/resources/radar/email/routing/timeseries-groups.ts @@ -10,7 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. + * @deprecated */ arc( query?: TimeseriesGroupARCParams, @@ -36,7 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. + * @deprecated */ dkim( query?: TimeseriesGroupDKIMParams, @@ -62,7 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. + * @deprecated */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -88,7 +88,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted) over time. * - * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. + * @deprecated */ encrypted( query?: TimeseriesGroupEncryptedParams, @@ -113,7 +113,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by IP version over time. * - * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -139,7 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. + * @deprecated */ spf( query?: TimeseriesGroupSPFParams, diff --git a/src/resources/radar/email/security/summary.ts b/src/resources/radar/email/security/summary.ts index c3432f9f36..5136a742ff 100644 --- a/src/resources/radar/email/security/summary.ts +++ b/src/resources/radar/email/security/summary.ts @@ -10,7 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. + * @deprecated */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -32,7 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. + * @deprecated */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -54,7 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. + * @deprecated */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -75,7 +75,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by malicious classification. * - * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. + * @deprecated */ malicious( query?: SummaryMaliciousParams, @@ -99,7 +99,7 @@ export class Summary extends APIResource { /** * Retrieves the proportion of emails by spam classification (spam vs. non-spam). * - * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. + * @deprecated */ spam(query?: SummarySpamParams, options?: Core.RequestOptions): Core.APIPromise; spam(options?: Core.RequestOptions): Core.APIPromise; @@ -121,7 +121,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. + * @deprecated */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; @@ -143,7 +143,7 @@ export class Summary extends APIResource { * Retrieves the proportion of emails by spoof classification (spoof vs. * non-spoof). * - * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. + * @deprecated */ spoof(query?: SummarySpoofParams, options?: Core.RequestOptions): Core.APIPromise; spoof(options?: Core.RequestOptions): Core.APIPromise; @@ -164,7 +164,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by threat categories. * - * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. + * @deprecated */ threatCategory( query?: SummaryThreatCategoryParams, @@ -189,7 +189,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by TLS version. * - * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. + * @deprecated */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/email/security/timeseries-groups.ts b/src/resources/radar/email/security/timeseries-groups.ts index 9b33cf953e..aa620088a0 100644 --- a/src/resources/radar/email/security/timeseries-groups.ts +++ b/src/resources/radar/email/security/timeseries-groups.ts @@ -10,7 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. + * @deprecated */ arc( query?: TimeseriesGroupARCParams, @@ -36,7 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. + * @deprecated */ dkim( query?: TimeseriesGroupDKIMParams, @@ -62,7 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. + * @deprecated */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -87,7 +87,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by malicious classification over time. * - * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. + * @deprecated */ malicious( query?: TimeseriesGroupMaliciousParams, @@ -113,7 +113,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spam classification (spam vs. non-spam) * over time. * - * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. + * @deprecated */ spam( query?: TimeseriesGroupSpamParams, @@ -139,7 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. + * @deprecated */ spf( query?: TimeseriesGroupSPFParams, @@ -165,7 +165,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spoof classification (spoof vs. * non-spoof) over time. * - * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. + * @deprecated */ spoof( query?: TimeseriesGroupSpoofParams, @@ -190,7 +190,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by threat category over time. * - * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. + * @deprecated */ threatCategory( query?: TimeseriesGroupThreatCategoryParams, @@ -215,7 +215,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by TLS version over time. * - * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. + * @deprecated */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/http/summary.ts b/src/resources/radar/http/summary.ts index 5c5792f467..9f7f84b12e 100644 --- a/src/resources/radar/http/summary.ts +++ b/src/resources/radar/http/summary.ts @@ -11,7 +11,7 @@ export class Summary extends APIResource { * https://developers.cloudflare.com/radar/concepts/bot-classes/ for more * information. * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @deprecated */ botClass( query?: SummaryBotClassParams, @@ -36,7 +36,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP requests generated by mobile, desktop, and * other types of devices. * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @deprecated */ deviceType( query?: SummaryDeviceTypeParams, @@ -60,7 +60,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. HTTPS). * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @deprecated */ httpProtocol( query?: SummaryHTTPProtocolParams, @@ -84,7 +84,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP version. * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @deprecated */ httpVersion( query?: SummaryHTTPVersionParams, @@ -108,7 +108,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by IP version. * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -133,7 +133,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP requests by operating system (Windows, macOS, * Android, iOS, and others). * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @deprecated */ os(query?: SummaryOSParams, options?: Core.RequestOptions): Core.APIPromise; os(options?: Core.RequestOptions): Core.APIPromise; @@ -154,7 +154,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by post-quantum support. * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @deprecated */ postQuantum( query?: SummaryPostQuantumParams, @@ -178,7 +178,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by TLS version. * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @deprecated */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/http/timeseries-groups.ts b/src/resources/radar/http/timeseries-groups.ts index 6e44b45b29..a22fdb7774 100644 --- a/src/resources/radar/http/timeseries-groups.ts +++ b/src/resources/radar/http/timeseries-groups.ts @@ -10,7 +10,7 @@ export class TimeseriesGroups extends APIResource { * over time. Visit https://developers.cloudflare.com/radar/concepts/bot-classes/ * for more information. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ botClass( query?: TimeseriesGroupBotClassParams, @@ -34,7 +34,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by user agent over time. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ browser( query?: TimeseriesGroupBrowserParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by user agent family over time. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ browserFamily( query?: TimeseriesGroupBrowserFamilyParams, @@ -83,7 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by device type over time. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ deviceType( query?: TimeseriesGroupDeviceTypeParams, @@ -109,7 +109,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. HTTPS) * over time. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ httpProtocol( query?: TimeseriesGroupHTTPProtocolParams, @@ -134,7 +134,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP version over time. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -159,7 +159,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by IP version over time. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -183,7 +183,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by operating system over time. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ os( query?: TimeseriesGroupOSParams, @@ -207,7 +207,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by post-quantum support over time. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ postQuantum( query?: TimeseriesGroupPostQuantumParams, @@ -232,7 +232,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by TLS version over time. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/http/top.ts b/src/resources/radar/http/top.ts index 8419bea370..01ee05806f 100644 --- a/src/resources/radar/http/top.ts +++ b/src/resources/radar/http/top.ts @@ -8,7 +8,10 @@ export class Top extends APIResource { /** * Retrieves the top user agents by HTTP requests. * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @example + * ```ts + * const response = await client.radar.http.top.browser(); + * ``` */ browser(query?: TopBrowserParams, options?: Core.RequestOptions): Core.APIPromise; browser(options?: Core.RequestOptions): Core.APIPromise; @@ -29,7 +32,11 @@ export class Top extends APIResource { /** * Retrieves the top user agents, aggregated in families, by HTTP requests. * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @example + * ```ts + * const response = + * await client.radar.http.top.browserFamily(); + * ``` */ browserFamily( query?: TopBrowserFamilyParams, diff --git a/src/resources/radar/leaked-credentials/summary.ts b/src/resources/radar/leaked-credentials/summary.ts index 970fde6b56..917ce13982 100644 --- a/src/resources/radar/leaked-credentials/summary.ts +++ b/src/resources/radar/leaked-credentials/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP authentication requests by bot class. * - * @deprecated Use [Radar Leaked Credentials Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/summary_v2/) instead. + * @deprecated */ botClass( query?: SummaryBotClassParams, @@ -34,7 +34,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP authentication requests by compromised * credential status. * - * @deprecated Use [Radar Leaked Credentials Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/summary_v2/) instead. + * @deprecated */ compromised( query?: SummaryCompromisedParams, diff --git a/src/resources/radar/leaked-credentials/timeseries-groups.ts b/src/resources/radar/leaked-credentials/timeseries-groups.ts index 859a012a8c..83aa48d077 100644 --- a/src/resources/radar/leaked-credentials/timeseries-groups.ts +++ b/src/resources/radar/leaked-credentials/timeseries-groups.ts @@ -9,7 +9,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP authentication requests by bot class over * time. * - * @deprecated Use [Radar Leaked Credentials Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/timeseries_groups_v2/) instead. + * @deprecated */ botClass( query?: TimeseriesGroupBotClassParams, @@ -35,7 +35,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP authentication requests by compromised * credential status over time. * - * @deprecated Use [Radar Leaked Credentials Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/timeseries_groups_v2/) instead. + * @deprecated */ compromised( query?: TimeseriesGroupCompromisedParams, diff --git a/src/resources/zero-trust/connectivity/directory/directory.ts b/src/resources/zero-trust/connectivity/directory/directory.ts index 8d0ed0ede1..0c979324a6 100644 --- a/src/resources/zero-trust/connectivity/directory/directory.ts +++ b/src/resources/zero-trust/connectivity/directory/directory.ts @@ -4,15 +4,10 @@ import { APIResource } from '../../../../resource'; import * as ServicesAPI from './services'; import { ServiceCreateParams, - ServiceCreateResponse, ServiceDeleteParams, ServiceGetParams, - ServiceGetResponse, ServiceListParams, - ServiceListResponse, - ServiceListResponsesV4PagePaginationArray, ServiceUpdateParams, - ServiceUpdateResponse, Services, } from './services'; @@ -21,16 +16,10 @@ export class Directory extends APIResource { } Directory.Services = Services; -Directory.ServiceListResponsesV4PagePaginationArray = ServiceListResponsesV4PagePaginationArray; export declare namespace Directory { export { Services as Services, - type ServiceCreateResponse as ServiceCreateResponse, - type ServiceUpdateResponse as ServiceUpdateResponse, - type ServiceListResponse as ServiceListResponse, - type ServiceGetResponse as ServiceGetResponse, - ServiceListResponsesV4PagePaginationArray as ServiceListResponsesV4PagePaginationArray, type ServiceCreateParams as ServiceCreateParams, type ServiceUpdateParams as ServiceUpdateParams, type ServiceListParams as ServiceListParams, diff --git a/src/resources/zero-trust/connectivity/directory/index.ts b/src/resources/zero-trust/connectivity/directory/index.ts index 2d94b5e566..78f208d56a 100644 --- a/src/resources/zero-trust/connectivity/directory/index.ts +++ b/src/resources/zero-trust/connectivity/directory/index.ts @@ -2,12 +2,7 @@ export { Directory } from './directory'; export { - ServiceListResponsesV4PagePaginationArray, Services, - type ServiceCreateResponse, - type ServiceUpdateResponse, - type ServiceListResponse, - type ServiceGetResponse, type ServiceCreateParams, type ServiceUpdateParams, type ServiceListParams, diff --git a/src/resources/zero-trust/connectivity/directory/services.ts b/src/resources/zero-trust/connectivity/directory/services.ts index 8942da54ff..74516c9f4d 100644 --- a/src/resources/zero-trust/connectivity/directory/services.ts +++ b/src/resources/zero-trust/connectivity/directory/services.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../../resource'; import * as Core from '../../../../core'; -import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../../pagination'; export class Services extends APIResource { /** @@ -10,30 +9,23 @@ export class Services extends APIResource { * * @example * ```ts - * const service = - * await client.zeroTrust.connectivity.directory.services.create( - * { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * host: { - * hostname: 'api.example.com', - * resolver_network: { - * tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da', - * }, - * }, - * name: 'web-server', - * type: 'http', - * }, - * ); + * await client.zeroTrust.connectivity.directory.services.create( + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * host: {}, + * name: 'name', + * type: 'http', + * }, + * ); * ``` */ - create(params: ServiceCreateParams, options?: Core.RequestOptions): Core.APIPromise { + create(params: ServiceCreateParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/connectivity/directory/services`, { - body, - ...options, - }) as Core.APIPromise<{ result: ServiceCreateResponse }> - )._thenUnwrap((obj) => obj.result); + return this._client.post(`/accounts/${account_id}/connectivity/directory/services`, { + body, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); } /** @@ -41,35 +33,28 @@ export class Services extends APIResource { * * @example * ```ts - * const service = - * await client.zeroTrust.connectivity.directory.services.update( - * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * { - * account_id: 'account_id', - * host: { - * ipv4: '10.0.0.1', - * network: { - * tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da', - * }, - * }, - * name: 'web-app', - * type: 'http', - * }, - * ); + * await client.zeroTrust.connectivity.directory.services.update( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { + * account_id: 'account_id', + * host: {}, + * name: 'name', + * type: 'http', + * }, + * ); * ``` */ update( serviceId: string, params: ServiceUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, ...body } = params; - return ( - this._client.put(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: ServiceUpdateResponse }> - )._thenUnwrap((obj) => obj.result); + return this._client.put(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { + body, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); } /** @@ -77,24 +62,18 @@ export class Services extends APIResource { * * @example * ```ts - * // Automatically fetches more pages as needed. - * for await (const serviceListResponse of client.zeroTrust.connectivity.directory.services.list( + * await client.zeroTrust.connectivity.directory.services.list( * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } + * ); * ``` */ - list( - params: ServiceListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { + list(params: ServiceListParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...query } = params; - return this._client.getAPIList( - `/accounts/${account_id}/connectivity/directory/services`, - ServiceListResponsesV4PagePaginationArray, - { query, ...options }, - ); + return this._client.get(`/accounts/${account_id}/connectivity/directory/services`, { + query, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); } /** @@ -125,331 +104,18 @@ export class Services extends APIResource { * * @example * ```ts - * const service = - * await client.zeroTrust.connectivity.directory.services.get( - * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * { account_id: 'account_id' }, - * ); + * await client.zeroTrust.connectivity.directory.services.get( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'account_id' }, + * ); * ``` */ - get( - serviceId: string, - params: ServiceGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + get(serviceId: string, params: ServiceGetParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/connectivity/directory/services/${serviceId}`, - options, - ) as Core.APIPromise<{ result: ServiceGetResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export class ServiceListResponsesV4PagePaginationArray extends V4PagePaginationArray {} - -export interface ServiceCreateResponse { - host: - | ServiceCreateResponse.InfraIPv4Host - | ServiceCreateResponse.InfraIPv6Host - | ServiceCreateResponse.InfraDualStackHost - | ServiceCreateResponse.InfraHostnameHost; - - name: string; - - type: 'http'; - - created_at?: string; - - http_port?: number | null; - - https_port?: number | null; - - service_id?: string; - - updated_at?: string; -} - -export namespace ServiceCreateResponse { - export interface InfraIPv4Host { - ipv4: string; - - network: InfraIPv4Host.Network; - } - - export namespace InfraIPv4Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraIPv6Host { - ipv6: string; - - network: InfraIPv6Host.Network; - } - - export namespace InfraIPv6Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraDualStackHost { - ipv4: string; - - ipv6: string; - - network: InfraDualStackHost.Network; - } - - export namespace InfraDualStackHost { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraHostnameHost { - hostname: string; - - resolver_network: InfraHostnameHost.ResolverNetwork; - } - - export namespace InfraHostnameHost { - export interface ResolverNetwork { - tunnel_id: string; - - resolver_ips?: Array | null; - } - } -} - -export interface ServiceUpdateResponse { - host: - | ServiceUpdateResponse.InfraIPv4Host - | ServiceUpdateResponse.InfraIPv6Host - | ServiceUpdateResponse.InfraDualStackHost - | ServiceUpdateResponse.InfraHostnameHost; - - name: string; - - type: 'http'; - - created_at?: string; - - http_port?: number | null; - - https_port?: number | null; - - service_id?: string; - - updated_at?: string; -} - -export namespace ServiceUpdateResponse { - export interface InfraIPv4Host { - ipv4: string; - - network: InfraIPv4Host.Network; - } - - export namespace InfraIPv4Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraIPv6Host { - ipv6: string; - - network: InfraIPv6Host.Network; - } - - export namespace InfraIPv6Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraDualStackHost { - ipv4: string; - - ipv6: string; - - network: InfraDualStackHost.Network; - } - - export namespace InfraDualStackHost { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraHostnameHost { - hostname: string; - - resolver_network: InfraHostnameHost.ResolverNetwork; - } - - export namespace InfraHostnameHost { - export interface ResolverNetwork { - tunnel_id: string; - - resolver_ips?: Array | null; - } - } -} - -export interface ServiceListResponse { - host: - | ServiceListResponse.InfraIPv4Host - | ServiceListResponse.InfraIPv6Host - | ServiceListResponse.InfraDualStackHost - | ServiceListResponse.InfraHostnameHost; - - name: string; - - type: 'http'; - - created_at?: string; - - http_port?: number | null; - - https_port?: number | null; - - service_id?: string; - - updated_at?: string; -} - -export namespace ServiceListResponse { - export interface InfraIPv4Host { - ipv4: string; - - network: InfraIPv4Host.Network; - } - - export namespace InfraIPv4Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraIPv6Host { - ipv6: string; - - network: InfraIPv6Host.Network; - } - - export namespace InfraIPv6Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraDualStackHost { - ipv4: string; - - ipv6: string; - - network: InfraDualStackHost.Network; - } - - export namespace InfraDualStackHost { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraHostnameHost { - hostname: string; - - resolver_network: InfraHostnameHost.ResolverNetwork; - } - - export namespace InfraHostnameHost { - export interface ResolverNetwork { - tunnel_id: string; - - resolver_ips?: Array | null; - } - } -} - -export interface ServiceGetResponse { - host: - | ServiceGetResponse.InfraIPv4Host - | ServiceGetResponse.InfraIPv6Host - | ServiceGetResponse.InfraDualStackHost - | ServiceGetResponse.InfraHostnameHost; - - name: string; - - type: 'http'; - - created_at?: string; - - http_port?: number | null; - - https_port?: number | null; - - service_id?: string; - - updated_at?: string; -} - -export namespace ServiceGetResponse { - export interface InfraIPv4Host { - ipv4: string; - - network: InfraIPv4Host.Network; - } - - export namespace InfraIPv4Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraIPv6Host { - ipv6: string; - - network: InfraIPv6Host.Network; - } - - export namespace InfraIPv6Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraDualStackHost { - ipv4: string; - - ipv6: string; - - network: InfraDualStackHost.Network; - } - - export namespace InfraDualStackHost { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraHostnameHost { - hostname: string; - - resolver_network: InfraHostnameHost.ResolverNetwork; - } - - export namespace InfraHostnameHost { - export interface ResolverNetwork { - tunnel_id: string; - - resolver_ips?: Array | null; - } + return this._client.get(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); } } @@ -462,11 +128,7 @@ export interface ServiceCreateParams { /** * Body param: */ - host: - | ServiceCreateParams.InfraIPv4Host - | ServiceCreateParams.InfraIPv6Host - | ServiceCreateParams.InfraDualStackHost - | ServiceCreateParams.InfraHostnameHost; + host: ServiceCreateParams.Host; /** * Body param: @@ -490,56 +152,16 @@ export interface ServiceCreateParams { } export namespace ServiceCreateParams { - export interface InfraIPv4Host { - ipv4: string; - - network: InfraIPv4Host.Network; - } - - export namespace InfraIPv4Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraIPv6Host { - ipv6: string; + export interface Host { + hostname?: string | null; - network: InfraIPv6Host.Network; - } - - export namespace InfraIPv6Host { - export interface Network { - tunnel_id: string; - } - } + ipv4?: string; - export interface InfraDualStackHost { - ipv4: string; + ipv6?: string; - ipv6: string; + network?: unknown; - network: InfraDualStackHost.Network; - } - - export namespace InfraDualStackHost { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraHostnameHost { - hostname: string; - - resolver_network: InfraHostnameHost.ResolverNetwork; - } - - export namespace InfraHostnameHost { - export interface ResolverNetwork { - tunnel_id: string; - - resolver_ips?: Array | null; - } + resolver_network?: unknown; } } @@ -552,11 +174,7 @@ export interface ServiceUpdateParams { /** * Body param: */ - host: - | ServiceUpdateParams.InfraIPv4Host - | ServiceUpdateParams.InfraIPv6Host - | ServiceUpdateParams.InfraDualStackHost - | ServiceUpdateParams.InfraHostnameHost; + host: ServiceUpdateParams.Host; /** * Body param: @@ -580,65 +198,35 @@ export interface ServiceUpdateParams { } export namespace ServiceUpdateParams { - export interface InfraIPv4Host { - ipv4: string; + export interface Host { + hostname?: string | null; - network: InfraIPv4Host.Network; - } + ipv4?: string; - export namespace InfraIPv4Host { - export interface Network { - tunnel_id: string; - } - } + ipv6?: string; - export interface InfraIPv6Host { - ipv6: string; + network?: unknown; - network: InfraIPv6Host.Network; - } - - export namespace InfraIPv6Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraDualStackHost { - ipv4: string; - - ipv6: string; - - network: InfraDualStackHost.Network; - } - - export namespace InfraDualStackHost { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraHostnameHost { - hostname: string; - - resolver_network: InfraHostnameHost.ResolverNetwork; - } - - export namespace InfraHostnameHost { - export interface ResolverNetwork { - tunnel_id: string; - - resolver_ips?: Array | null; - } + resolver_network?: unknown; } } -export interface ServiceListParams extends V4PagePaginationArrayParams { +export interface ServiceListParams { /** * Path param: Account identifier */ account_id: string; + /** + * Query param: Current page in the response + */ + page?: number; + + /** + * Query param: Max amount of entries returned per page + */ + per_page?: number; + /** * Query param: */ @@ -653,15 +241,8 @@ export interface ServiceGetParams { account_id: string; } -Services.ServiceListResponsesV4PagePaginationArray = ServiceListResponsesV4PagePaginationArray; - export declare namespace Services { export { - type ServiceCreateResponse as ServiceCreateResponse, - type ServiceUpdateResponse as ServiceUpdateResponse, - type ServiceListResponse as ServiceListResponse, - type ServiceGetResponse as ServiceGetResponse, - ServiceListResponsesV4PagePaginationArray as ServiceListResponsesV4PagePaginationArray, type ServiceCreateParams as ServiceCreateParams, type ServiceUpdateParams as ServiceUpdateParams, type ServiceListParams as ServiceListParams, diff --git a/src/resources/zero-trust/devices/posture/posture.ts b/src/resources/zero-trust/devices/posture/posture.ts index 54f186eca7..3b2bd2a898 100644 --- a/src/resources/zero-trust/devices/posture/posture.ts +++ b/src/resources/zero-trust/devices/posture/posture.ts @@ -850,7 +850,7 @@ export interface OSVersionInput { /** * Additional version data. For Mac or iOS, the Product Version Extra. For Linux, - * the distribution name and version. (Mac, iOS, and Linux only). + * the kernel release version. (Mac, iOS, and Linux only). */ os_version_extra?: string; } @@ -883,7 +883,7 @@ export interface OSVersionInputParam { /** * Additional version data. For Mac or iOS, the Product Version Extra. For Linux, - * the distribution name and version. (Mac, iOS, and Linux only). + * the kernel release version. (Mac, iOS, and Linux only). */ os_version_extra?: string; } diff --git a/src/resources/zero-trust/gateway/configurations/configurations.ts b/src/resources/zero-trust/gateway/configurations/configurations.ts index fb9a035b50..9f7a1aacb5 100755 --- a/src/resources/zero-trust/gateway/configurations/configurations.ts +++ b/src/resources/zero-trust/gateway/configurations/configurations.ts @@ -406,11 +406,12 @@ export interface CustomCertificateSettingsParam { } /** - * Configures user email settings for firewall policies. When you enable this, the - * system standardizes email addresses in the identity portion of the rule to match - * extended email variants in firewall policies. When you disable this setting, the - * system matches email addresses exactly as you provide them. Enable this setting - * if your email uses `.` or `+` modifiers. + * Specify user email settings for the firewall policies. When this is enabled, we + * standardize the email addresses in the identity part of the rule, so that they + * match the extended email variants in the firewall policies. When this setting is + * turned off, the email addresses in the identity part of the rule will be matched + * exactly as provided. If your email has `.` or `+` modifiers, you should enable + * this setting. */ export interface ExtendedEmailMatching { /** @@ -437,11 +438,12 @@ export interface ExtendedEmailMatching { } /** - * Configures user email settings for firewall policies. When you enable this, the - * system standardizes email addresses in the identity portion of the rule to match - * extended email variants in firewall policies. When you disable this setting, the - * system matches email addresses exactly as you provide them. Enable this setting - * if your email uses `.` or `+` modifiers. + * Specify user email settings for the firewall policies. When this is enabled, we + * standardize the email addresses in the identity part of the rule, so that they + * match the extended email variants in the firewall policies. When this setting is + * turned off, the email addresses in the identity part of the rule will be matched + * exactly as provided. If your email has `.` or `+` modifiers, you should enable + * this setting. */ export interface ExtendedEmailMatchingParam { /** @@ -513,11 +515,12 @@ export interface GatewayConfigurationSettings { custom_certificate?: CustomCertificateSettings | null; /** - * Configures user email settings for firewall policies. When you enable this, the - * system standardizes email addresses in the identity portion of the rule to match - * extended email variants in firewall policies. When you disable this setting, the - * system matches email addresses exactly as you provide them. Enable this setting - * if your email uses `.` or `+` modifiers. + * Specify user email settings for the firewall policies. When this is enabled, we + * standardize the email addresses in the identity part of the rule, so that they + * match the extended email variants in the firewall policies. When this setting is + * turned off, the email addresses in the identity part of the rule will be matched + * exactly as provided. If your email has `.` or `+` modifiers, you should enable + * this setting. */ extended_email_matching?: ExtendedEmailMatching | null; @@ -648,11 +651,12 @@ export interface GatewayConfigurationSettingsParam { custom_certificate?: CustomCertificateSettingsParam | null; /** - * Configures user email settings for firewall policies. When you enable this, the - * system standardizes email addresses in the identity portion of the rule to match - * extended email variants in firewall policies. When you disable this setting, the - * system matches email addresses exactly as you provide them. Enable this setting - * if your email uses `.` or `+` modifiers. + * Specify user email settings for the firewall policies. When this is enabled, we + * standardize the email addresses in the identity part of the rule, so that they + * match the extended email variants in the firewall policies. When this setting is + * turned off, the email addresses in the identity part of the rule will be matched + * exactly as provided. If your email has `.` or `+` modifiers, you should enable + * this setting. */ extended_email_matching?: ExtendedEmailMatchingParam | null; diff --git a/src/resources/zero-trust/gateway/rules.ts b/src/resources/zero-trust/gateway/rules.ts index 845f44fd1f..e672443115 100644 --- a/src/resources/zero-trust/gateway/rules.ts +++ b/src/resources/zero-trust/gateway/rules.ts @@ -393,10 +393,12 @@ export interface GatewayRule { read_only?: boolean; /** - * Defines settings for this rule. Settings apply only to specific rule types and - * must use compatible selectors. If Terraform detects drift, confirm the setting - * supports your rule type and check whether the API modifies the value. Use - * API-returned values in your configuration to prevent drift. + * Set settings related to this rule. Each setting is only valid for specific rule + * types and can only be used with the appropriate selectors. If Terraform drift is + * observed in these setting values, verify that the setting is supported for the + * given rule type and that the API response reflects the requested value. If the + * API response returns sanitized or modified values that differ from the request, + * use the API-provided values in Terraform to ensure consistency. */ rule_settings?: RuleSetting; @@ -459,10 +461,12 @@ export namespace GatewayRule { } /** - * Defines settings for this rule. Settings apply only to specific rule types and - * must use compatible selectors. If Terraform detects drift, confirm the setting - * supports your rule type and check whether the API modifies the value. Use - * API-returned values in your configuration to prevent drift. + * Set settings related to this rule. Each setting is only valid for specific rule + * types and can only be used with the appropriate selectors. If Terraform drift is + * observed in these setting values, verify that the setting is supported for the + * given rule type and that the API response reflects the requested value. If the + * API response returns sanitized or modified values that differ from the request, + * use the API-provided values in Terraform to ensure consistency. */ export interface RuleSetting { /** @@ -916,10 +920,12 @@ export namespace RuleSetting { } /** - * Defines settings for this rule. Settings apply only to specific rule types and - * must use compatible selectors. If Terraform detects drift, confirm the setting - * supports your rule type and check whether the API modifies the value. Use - * API-returned values in your configuration to prevent drift. + * Set settings related to this rule. Each setting is only valid for specific rule + * types and can only be used with the appropriate selectors. If Terraform drift is + * observed in these setting values, verify that the setting is supported for the + * given rule type and that the API response reflects the requested value. If the + * API response returns sanitized or modified values that differ from the request, + * use the API-provided values in Terraform to ensure consistency. */ export interface RuleSettingParam { /** @@ -1600,10 +1606,13 @@ export interface RuleCreateParams { precedence?: number; /** - * Body param: Defines settings for this rule. Settings apply only to specific rule - * types and must use compatible selectors. If Terraform detects drift, confirm the - * setting supports your rule type and check whether the API modifies the value. - * Use API-returned values in your configuration to prevent drift. + * Body param: Set settings related to this rule. Each setting is only valid for + * specific rule types and can only be used with the appropriate selectors. If + * Terraform drift is observed in these setting values, verify that the setting is + * supported for the given rule type and that the API response reflects the + * requested value. If the API response returns sanitized or modified values that + * differ from the request, use the API-provided values in Terraform to ensure + * consistency. */ rule_settings?: RuleSettingParam; @@ -1728,10 +1737,13 @@ export interface RuleUpdateParams { precedence?: number; /** - * Body param: Defines settings for this rule. Settings apply only to specific rule - * types and must use compatible selectors. If Terraform detects drift, confirm the - * setting supports your rule type and check whether the API modifies the value. - * Use API-returned values in your configuration to prevent drift. + * Body param: Set settings related to this rule. Each setting is only valid for + * specific rule types and can only be used with the appropriate selectors. If + * Terraform drift is observed in these setting values, verify that the setting is + * supported for the given rule type and that the API response reflects the + * requested value. If the API response returns sanitized or modified values that + * differ from the request, use the API-provided values in Terraform to ensure + * consistency. */ rule_settings?: RuleSettingParam; diff --git a/tests/api-resources/zero-trust/connectivity/directory/services.test.ts b/tests/api-resources/zero-trust/connectivity/directory/services.test.ts index 735afe06c3..4e6440e25c 100644 --- a/tests/api-resources/zero-trust/connectivity/directory/services.test.ts +++ b/tests/api-resources/zero-trust/connectivity/directory/services.test.ts @@ -13,11 +13,8 @@ describe('resource services', () => { test('create: only required params', async () => { const responsePromise = client.zeroTrust.connectivity.directory.services.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', - host: { - hostname: 'api.example.com', - resolver_network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da' }, - }, - name: 'web-server', + host: {}, + name: 'name', type: 'http', }); const rawResponse = await responsePromise.asResponse(); @@ -32,26 +29,18 @@ describe('resource services', () => { test('create: required and optional params', async () => { const response = await client.zeroTrust.connectivity.directory.services.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', - host: { - hostname: 'api.example.com', - resolver_network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da', resolver_ips: ['string'] }, - }, - name: 'web-server', + host: { hostname: 'hostname', ipv4: 'ipv4', ipv6: 'ipv6', network: {}, resolver_network: {} }, + name: 'name', type: 'http', - http_port: 8080, - https_port: 8443, + http_port: 1, + https_port: 1, }); }); test('update: only required params', async () => { const responsePromise = client.zeroTrust.connectivity.directory.services.update( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - { - account_id: 'account_id', - host: { ipv4: '10.0.0.1', network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da' } }, - name: 'web-app', - type: 'http', - }, + { account_id: 'account_id', host: {}, name: 'name', type: 'http' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -67,11 +56,11 @@ describe('resource services', () => { '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: 'account_id', - host: { ipv4: '10.0.0.1', network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da' } }, - name: 'web-app', + host: { hostname: 'hostname', ipv4: 'ipv4', ipv6: 'ipv6', network: {}, resolver_network: {} }, + name: 'name', type: 'http', - http_port: 8080, - https_port: 8443, + http_port: 1, + https_port: 1, }, ); }); From f8a8648843c5419968acdc8c7d15bb077dd59a62 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 20:00:39 +0000 Subject: [PATCH 278/451] chore(api): update composite API spec --- .stats.yml | 4 +- api.md | 15 +- src/resources/dns/records.ts | 88 +-- src/resources/radar/ai/bots/summary.ts | 2 +- src/resources/radar/ai/inference/summary.ts | 4 +- .../ai/inference/timeseries-groups/summary.ts | 4 +- src/resources/radar/ai/timeseries-groups.ts | 2 +- src/resources/radar/as112/summary.ts | 12 +- .../radar/as112/timeseries-groups.ts | 12 +- src/resources/radar/attacks/layer3/summary.ts | 14 +- .../radar/attacks/layer3/timeseries-groups.ts | 14 +- src/resources/radar/attacks/layer3/top/top.ts | 4 +- src/resources/radar/attacks/layer7/summary.ts | 14 +- .../radar/attacks/layer7/timeseries-groups.ts | 14 +- src/resources/radar/attacks/layer7/top/top.ts | 4 +- src/resources/radar/dns/summary.ts | 20 +- src/resources/radar/dns/timeseries-groups.ts | 20 +- src/resources/radar/email/routing/summary.ts | 12 +- .../radar/email/routing/timeseries-groups.ts | 12 +- src/resources/radar/email/security/summary.ts | 18 +- .../radar/email/security/timeseries-groups.ts | 18 +- src/resources/radar/http/summary.ts | 16 +- src/resources/radar/http/timeseries-groups.ts | 20 +- src/resources/radar/http/top.ts | 11 +- .../radar/leaked-credentials/summary.ts | 4 +- .../leaked-credentials/timeseries-groups.ts | 4 +- .../connectivity/directory/directory.ts | 11 + .../connectivity/directory/index.ts | 5 + .../connectivity/directory/services.ts | 561 +++++++++++++++--- .../zero-trust/devices/posture/posture.ts | 4 +- .../gateway/configurations/configurations.ts | 44 +- src/resources/zero-trust/gateway/rules.ts | 52 +- .../connectivity/directory/services.test.ts | 33 +- 33 files changed, 751 insertions(+), 321 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4cf021b837..0a34fc2286 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1855 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fa078e98d33794f32c77256479dceb7d6b9e0ad95da89fa01474b2c1731cad3d.yml -openapi_spec_hash: eb25624c59f39858b740347f8f092a1d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-46bf704f4474b456b8e26d6166a8aa9990664707f345c41a40485d6cb16eea97.yml +openapi_spec_hash: 0fc77cec03f8c19d51faaf99aef6cc0b config_hash: ced339c69004cc06854b37a59f5d270a diff --git a/api.md b/api.md index ddd67b189b..9106d9a28d 100644 --- a/api.md +++ b/api.md @@ -5719,13 +5719,20 @@ Methods: #### Services +Types: + +- ServiceCreateResponse +- ServiceUpdateResponse +- ServiceListResponse +- ServiceGetResponse + Methods: -- client.zeroTrust.connectivity.directory.services.create({ ...params }) -> void -- client.zeroTrust.connectivity.directory.services.update(serviceId, { ...params }) -> void -- client.zeroTrust.connectivity.directory.services.list({ ...params }) -> void +- client.zeroTrust.connectivity.directory.services.create({ ...params }) -> ServiceCreateResponse +- client.zeroTrust.connectivity.directory.services.update(serviceId, { ...params }) -> ServiceUpdateResponse +- client.zeroTrust.connectivity.directory.services.list({ ...params }) -> ServiceListResponsesV4PagePaginationArray - client.zeroTrust.connectivity.directory.services.delete(serviceId, { ...params }) -> void -- client.zeroTrust.connectivity.directory.services.get(serviceId, { ...params }) -> void +- client.zeroTrust.connectivity.directory.services.get(serviceId, { ...params }) -> ServiceGetResponse ## DLP diff --git a/src/resources/dns/records.ts b/src/resources/dns/records.ts index 0a09cf3cb4..b3eb5c6bb2 100644 --- a/src/resources/dns/records.ts +++ b/src/resources/dns/records.ts @@ -3701,30 +3701,30 @@ export namespace Record { } export type RecordResponse = - | RecordResponse.ARecord - | RecordResponse.AAAARecord - | RecordResponse.CNAMERecord - | RecordResponse.MXRecord - | RecordResponse.NSRecord - | RecordResponse.OpenpgpkeyRecord - | RecordResponse.PTRRecord - | RecordResponse.TXTRecord - | RecordResponse.CAARecord - | RecordResponse.CERTRecord - | RecordResponse.DNSKEYRecord - | RecordResponse.DSRecord - | RecordResponse.HTTPSRecord - | RecordResponse.LOCRecord - | RecordResponse.NAPTRRecord - | RecordResponse.SMIMEARecord - | RecordResponse.SRVRecord - | RecordResponse.SSHFPRecord - | RecordResponse.SVCBRecord - | RecordResponse.TLSARecord - | RecordResponse.URIRecord; + | RecordResponse.A + | RecordResponse.AAAA + | RecordResponse.CNAME + | RecordResponse.MX + | RecordResponse.NS + | RecordResponse.Openpgpkey + | RecordResponse.PTR + | RecordResponse.TXT + | RecordResponse.CAA + | RecordResponse.CERT + | RecordResponse.DNSKEY + | RecordResponse.DS + | RecordResponse.HTTPS + | RecordResponse.LOC + | RecordResponse.NAPTR + | RecordResponse.SMIMEA + | RecordResponse.SRV + | RecordResponse.SSHFP + | RecordResponse.SVCB + | RecordResponse.TLSA + | RecordResponse.URI; export namespace RecordResponse { - export interface ARecord extends RecordsAPI.ARecord { + export interface A extends RecordsAPI.ARecord { /** * Identifier. */ @@ -3761,7 +3761,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface AAAARecord extends RecordsAPI.AAAARecord { + export interface AAAA extends RecordsAPI.AAAARecord { /** * Identifier. */ @@ -3798,7 +3798,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface CNAMERecord extends RecordsAPI.CNAMERecord { + export interface CNAME extends RecordsAPI.CNAMERecord { /** * Identifier. */ @@ -3835,7 +3835,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface MXRecord extends RecordsAPI.MXRecord { + export interface MX extends RecordsAPI.MXRecord { /** * Identifier. */ @@ -3872,7 +3872,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface NSRecord extends RecordsAPI.NSRecord { + export interface NS extends RecordsAPI.NSRecord { /** * Identifier. */ @@ -3909,7 +3909,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface OpenpgpkeyRecord { + export interface Openpgpkey { /** * Identifier. */ @@ -3960,7 +3960,7 @@ export namespace RecordResponse { /** * Settings for the DNS record. */ - settings: OpenpgpkeyRecord.Settings; + settings: Openpgpkey.Settings; /** * Custom tags for the DNS record. This field has no effect on DNS responses. @@ -3990,7 +3990,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export namespace OpenpgpkeyRecord { + export namespace Openpgpkey { /** * Settings for the DNS record. */ @@ -4013,7 +4013,7 @@ export namespace RecordResponse { } } - export interface PTRRecord extends RecordsAPI.PTRRecord { + export interface PTR extends RecordsAPI.PTRRecord { /** * Identifier. */ @@ -4050,7 +4050,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface TXTRecord extends RecordsAPI.TXTRecord { + export interface TXT extends RecordsAPI.TXTRecord { /** * Identifier. */ @@ -4087,7 +4087,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface CAARecord extends RecordsAPI.CAARecord { + export interface CAA extends RecordsAPI.CAARecord { /** * Identifier. */ @@ -4124,7 +4124,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface CERTRecord extends RecordsAPI.CERTRecord { + export interface CERT extends RecordsAPI.CERTRecord { /** * Identifier. */ @@ -4161,7 +4161,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface DNSKEYRecord extends RecordsAPI.DNSKEYRecord { + export interface DNSKEY extends RecordsAPI.DNSKEYRecord { /** * Identifier. */ @@ -4198,7 +4198,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface DSRecord extends RecordsAPI.DSRecord { + export interface DS extends RecordsAPI.DSRecord { /** * Identifier. */ @@ -4235,7 +4235,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface HTTPSRecord extends RecordsAPI.HTTPSRecord { + export interface HTTPS extends RecordsAPI.HTTPSRecord { /** * Identifier. */ @@ -4272,7 +4272,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface LOCRecord extends RecordsAPI.LOCRecord { + export interface LOC extends RecordsAPI.LOCRecord { /** * Identifier. */ @@ -4309,7 +4309,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface NAPTRRecord extends RecordsAPI.NAPTRRecord { + export interface NAPTR extends RecordsAPI.NAPTRRecord { /** * Identifier. */ @@ -4346,7 +4346,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SMIMEARecord extends RecordsAPI.SMIMEARecord { + export interface SMIMEA extends RecordsAPI.SMIMEARecord { /** * Identifier. */ @@ -4383,7 +4383,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SRVRecord extends RecordsAPI.SRVRecord { + export interface SRV extends RecordsAPI.SRVRecord { /** * Identifier. */ @@ -4420,7 +4420,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SSHFPRecord extends RecordsAPI.SSHFPRecord { + export interface SSHFP extends RecordsAPI.SSHFPRecord { /** * Identifier. */ @@ -4457,7 +4457,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SVCBRecord extends RecordsAPI.SVCBRecord { + export interface SVCB extends RecordsAPI.SVCBRecord { /** * Identifier. */ @@ -4494,7 +4494,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface TLSARecord extends RecordsAPI.TLSARecord { + export interface TLSA extends RecordsAPI.TLSARecord { /** * Identifier. */ @@ -4531,7 +4531,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface URIRecord extends RecordsAPI.URIRecord { + export interface URI extends RecordsAPI.URIRecord { /** * Identifier. */ diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts index 75c99603d5..c9e77e1896 100644 --- a/src/resources/radar/ai/bots/summary.ts +++ b/src/resources/radar/ai/bots/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of traffic by AI user agent. * - * @deprecated + * @deprecated Use [Radar AI Bots Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/summary_v2/) instead. */ userAgent( query?: SummaryUserAgentParams, diff --git a/src/resources/radar/ai/inference/summary.ts b/src/resources/radar/ai/inference/summary.ts index a22b6f10e9..4b9b871ddc 100644 --- a/src/resources/radar/ai/inference/summary.ts +++ b/src/resources/radar/ai/inference/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by model. * - * @deprecated + * @deprecated Use [Radar AI Inference Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/summary_v2/) instead. */ model(query?: SummaryModelParams, options?: Core.RequestOptions): Core.APIPromise; model(options?: Core.RequestOptions): Core.APIPromise; @@ -29,7 +29,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by task. * - * @deprecated + * @deprecated Use [Radar AI Inference Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/summary_v2/) instead. */ task(query?: SummaryTaskParams, options?: Core.RequestOptions): Core.APIPromise; task(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/ai/inference/timeseries-groups/summary.ts b/src/resources/radar/ai/inference/timeseries-groups/summary.ts index bf808d1b21..43edd89a6c 100644 --- a/src/resources/radar/ai/inference/timeseries-groups/summary.ts +++ b/src/resources/radar/ai/inference/timeseries-groups/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by model over time. * - * @deprecated + * @deprecated Use [Radar AI Inference Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/timeseries_groups_v2/) instead. */ model(query?: SummaryModelParams, options?: Core.RequestOptions): Core.APIPromise; model(options?: Core.RequestOptions): Core.APIPromise; @@ -30,7 +30,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by task over time. * - * @deprecated + * @deprecated Use [Radar AI Inference Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/timeseries_groups_v2/) instead. */ task(query?: SummaryTaskParams, options?: Core.RequestOptions): Core.APIPromise; task(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index b5b307bf8b..c516b5d812 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -93,7 +93,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of traffic by AI user agent over time. * - * @deprecated + * @deprecated Use [Radar AI Bots Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/timeseries_groups/) instead. */ userAgent( query?: TimeseriesGroupUserAgentParams, diff --git a/src/resources/radar/as112/summary.ts b/src/resources/radar/as112/summary.ts index d6034b19c4..c83056b982 100644 --- a/src/resources/radar/as112/summary.ts +++ b/src/resources/radar/as112/summary.ts @@ -9,7 +9,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by DNSSEC (DNS Security * Extensions) support. * - * @deprecated + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -31,7 +31,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by EDNS (Extension Mechanisms * for DNS) support. * - * @deprecated + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ edns(query?: SummaryEdnsParams, options?: Core.RequestOptions): Core.APIPromise; edns(options?: Core.RequestOptions): Core.APIPromise; @@ -52,7 +52,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by IP version. * - * @deprecated + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -76,7 +76,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by protocol. * - * @deprecated + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ protocol( query?: SummaryProtocolParams, @@ -100,7 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by type. * - * @deprecated + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ queryType( query?: SummaryQueryTypeParams, @@ -124,7 +124,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of AS112 DNS requests classified by response code. * - * @deprecated + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ responseCodes( query?: SummaryResponseCodesParams, diff --git a/src/resources/radar/as112/timeseries-groups.ts b/src/resources/radar/as112/timeseries-groups.ts index e5593df35c..fd564e8245 100644 --- a/src/resources/radar/as112/timeseries-groups.ts +++ b/src/resources/radar/as112/timeseries-groups.ts @@ -9,7 +9,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by DNSSEC (DNS Security * Extensions) support over time. * - * @deprecated + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -34,7 +34,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by EDNS (Extension Mechanisms * for DNS) support over time. * - * @deprecated + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ edns( query?: TimeseriesGroupEdnsParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by IP version over time. * - * @deprecated + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -84,7 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by protocol over * time. * - * @deprecated + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ protocol( query?: TimeseriesGroupProtocolParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by type over time. * - * @deprecated + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -134,7 +134,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by response code * over time. * - * @deprecated + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ responseCodes( query?: TimeseriesGroupResponseCodesParams, diff --git a/src/resources/radar/attacks/layer3/summary.ts b/src/resources/radar/attacks/layer3/summary.ts index bc4ccc4c81..869dd46727 100644 --- a/src/resources/radar/attacks/layer3/summary.ts +++ b/src/resources/radar/attacks/layer3/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ bitrate( query?: SummaryBitrateParams, @@ -32,7 +32,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ duration( query?: SummaryDurationParams, @@ -56,7 +56,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ industry( query?: SummaryIndustryParams, @@ -80,7 +80,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -104,7 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ protocol( query?: SummaryProtocolParams, @@ -128,7 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ vector(query?: SummaryVectorParams, options?: Core.RequestOptions): Core.APIPromise; vector(options?: Core.RequestOptions): Core.APIPromise; @@ -149,7 +149,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer3/timeseries-groups.ts b/src/resources/radar/attacks/layer3/timeseries-groups.ts index 9f8d171a40..622eb83d71 100644 --- a/src/resources/radar/attacks/layer3/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer3/timeseries-groups.ts @@ -8,7 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ bitrate( query?: TimeseriesGroupBitrateParams, @@ -33,7 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ duration( query?: TimeseriesGroupDurationParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ industry( query?: TimeseriesGroupIndustryParams, @@ -83,7 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ protocol( query?: TimeseriesGroupProtocolParams, @@ -133,7 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ vector( query?: TimeseriesGroupVectorParams, @@ -158,7 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer3/top/top.ts b/src/resources/radar/attacks/layer3/top/top.ts index 2da56402ce..e8e5c6b5b8 100644 --- a/src/resources/radar/attacks/layer3/top/top.ts +++ b/src/resources/radar/attacks/layer3/top/top.ts @@ -47,7 +47,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by industry endpoint. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ industry(query?: TopIndustryParams, options?: Core.RequestOptions): Core.APIPromise; industry(options?: Core.RequestOptions): Core.APIPromise; @@ -69,7 +69,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by vertical endpoint. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ vertical(query?: TopVerticalParams, options?: Core.RequestOptions): Core.APIPromise; vertical(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/attacks/layer7/summary.ts b/src/resources/radar/attacks/layer7/summary.ts index 160eb24dd8..3d4b27fb58 100644 --- a/src/resources/radar/attacks/layer7/summary.ts +++ b/src/resources/radar/attacks/layer7/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ httpMethod( query?: SummaryHTTPMethodParams, @@ -33,7 +33,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ httpVersion( query?: SummaryHTTPVersionParams, @@ -58,7 +58,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ industry( query?: SummaryIndustryParams, @@ -82,7 +82,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -106,7 +106,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ managedRules( query?: SummaryManagedRulesParams, @@ -131,7 +131,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ mitigationProduct( query?: SummaryMitigationProductParams, @@ -156,7 +156,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer7/timeseries-groups.ts b/src/resources/radar/attacks/layer7/timeseries-groups.ts index ce7c62ce1e..ab5076ef90 100644 --- a/src/resources/radar/attacks/layer7/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer7/timeseries-groups.ts @@ -8,7 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ httpMethod( query?: TimeseriesGroupHTTPMethodParams, @@ -33,7 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ industry( query?: TimeseriesGroupIndustryParams, @@ -83,7 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version used over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ managedRules( query?: TimeseriesGroupManagedRulesParams, @@ -133,7 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ mitigationProduct( query?: TimeseriesGroupMitigationProductParams, @@ -158,7 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer7/top/top.ts b/src/resources/radar/attacks/layer7/top/top.ts index 74086112c2..1fa4d17fff 100644 --- a/src/resources/radar/attacks/layer7/top/top.ts +++ b/src/resources/radar/attacks/layer7/top/top.ts @@ -51,7 +51,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by industry endpoint. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ industry(query?: TopIndustryParams, options?: Core.RequestOptions): Core.APIPromise; industry(options?: Core.RequestOptions): Core.APIPromise; @@ -73,7 +73,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by vertical endpoint. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ vertical(query?: TopVerticalParams, options?: Core.RequestOptions): Core.APIPromise; vertical(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/dns/summary.ts b/src/resources/radar/dns/summary.ts index 575afc929b..bea2bcf785 100644 --- a/src/resources/radar/dns/summary.ts +++ b/src/resources/radar/dns/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by cache status. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ cacheHit( query?: SummaryCacheHitParams, @@ -33,7 +33,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -55,7 +55,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ dnssecAware( query?: SummaryDNSSECAwareParams, @@ -80,7 +80,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ dnssecE2E( query?: SummaryDNSSECE2EParams, @@ -104,7 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by IP version. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -128,7 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ matchingAnswer( query?: SummaryMatchingAnswerParams, @@ -152,7 +152,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ protocol( query?: SummaryProtocolParams, @@ -176,7 +176,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by type. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ queryType( query?: SummaryQueryTypeParams, @@ -200,7 +200,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by response code. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ responseCode( query?: SummaryResponseCodeParams, @@ -224,7 +224,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by minimum response TTL. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ responseTTL( query?: SummaryResponseTTLParams, diff --git a/src/resources/radar/dns/timeseries-groups.ts b/src/resources/radar/dns/timeseries-groups.ts index 5e1ea8a4e1..b2120478af 100644 --- a/src/resources/radar/dns/timeseries-groups.ts +++ b/src/resources/radar/dns/timeseries-groups.ts @@ -8,7 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by cache status over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ cacheHit( query?: TimeseriesGroupCacheHitParams, @@ -33,7 +33,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ dnssecAware( query?: TimeseriesGroupDNSSECAwareParams, @@ -84,7 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ dnssecE2E( query?: TimeseriesGroupDNSSECE2EParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by IP version over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -132,7 +132,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ matchingAnswer( query?: TimeseriesGroupMatchingAnswerParams, @@ -157,7 +157,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ protocol( query?: TimeseriesGroupProtocolParams, @@ -181,7 +181,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by type over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -205,7 +205,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by response code over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ responseCode( query?: TimeseriesGroupResponseCodeParams, @@ -230,7 +230,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by minimum answer TTL over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ responseTTL( query?: TimeseriesGroupResponseTTLParams, diff --git a/src/resources/radar/email/routing/summary.ts b/src/resources/radar/email/routing/summary.ts index 00defd2b84..3d29f93974 100644 --- a/src/resources/radar/email/routing/summary.ts +++ b/src/resources/radar/email/routing/summary.ts @@ -10,7 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @deprecated + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -32,7 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @deprecated + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -54,7 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @deprecated + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -76,7 +76,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted). * - * @deprecated + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ encrypted( query?: SummaryEncryptedParams, @@ -100,7 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by IP version. * - * @deprecated + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -125,7 +125,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @deprecated + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/email/routing/timeseries-groups.ts b/src/resources/radar/email/routing/timeseries-groups.ts index 3a9801b143..4d12509309 100644 --- a/src/resources/radar/email/routing/timeseries-groups.ts +++ b/src/resources/radar/email/routing/timeseries-groups.ts @@ -10,7 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @deprecated + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ arc( query?: TimeseriesGroupARCParams, @@ -36,7 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @deprecated + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ dkim( query?: TimeseriesGroupDKIMParams, @@ -62,7 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @deprecated + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -88,7 +88,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted) over time. * - * @deprecated + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ encrypted( query?: TimeseriesGroupEncryptedParams, @@ -113,7 +113,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by IP version over time. * - * @deprecated + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -139,7 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @deprecated + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ spf( query?: TimeseriesGroupSPFParams, diff --git a/src/resources/radar/email/security/summary.ts b/src/resources/radar/email/security/summary.ts index 5136a742ff..c3432f9f36 100644 --- a/src/resources/radar/email/security/summary.ts +++ b/src/resources/radar/email/security/summary.ts @@ -10,7 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -32,7 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -54,7 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -75,7 +75,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by malicious classification. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ malicious( query?: SummaryMaliciousParams, @@ -99,7 +99,7 @@ export class Summary extends APIResource { /** * Retrieves the proportion of emails by spam classification (spam vs. non-spam). * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ spam(query?: SummarySpamParams, options?: Core.RequestOptions): Core.APIPromise; spam(options?: Core.RequestOptions): Core.APIPromise; @@ -121,7 +121,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; @@ -143,7 +143,7 @@ export class Summary extends APIResource { * Retrieves the proportion of emails by spoof classification (spoof vs. * non-spoof). * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ spoof(query?: SummarySpoofParams, options?: Core.RequestOptions): Core.APIPromise; spoof(options?: Core.RequestOptions): Core.APIPromise; @@ -164,7 +164,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by threat categories. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ threatCategory( query?: SummaryThreatCategoryParams, @@ -189,7 +189,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by TLS version. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/email/security/timeseries-groups.ts b/src/resources/radar/email/security/timeseries-groups.ts index aa620088a0..9b33cf953e 100644 --- a/src/resources/radar/email/security/timeseries-groups.ts +++ b/src/resources/radar/email/security/timeseries-groups.ts @@ -10,7 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ arc( query?: TimeseriesGroupARCParams, @@ -36,7 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ dkim( query?: TimeseriesGroupDKIMParams, @@ -62,7 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -87,7 +87,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by malicious classification over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ malicious( query?: TimeseriesGroupMaliciousParams, @@ -113,7 +113,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spam classification (spam vs. non-spam) * over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ spam( query?: TimeseriesGroupSpamParams, @@ -139,7 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ spf( query?: TimeseriesGroupSPFParams, @@ -165,7 +165,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spoof classification (spoof vs. * non-spoof) over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ spoof( query?: TimeseriesGroupSpoofParams, @@ -190,7 +190,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by threat category over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ threatCategory( query?: TimeseriesGroupThreatCategoryParams, @@ -215,7 +215,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by TLS version over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/http/summary.ts b/src/resources/radar/http/summary.ts index 9f7f84b12e..5c5792f467 100644 --- a/src/resources/radar/http/summary.ts +++ b/src/resources/radar/http/summary.ts @@ -11,7 +11,7 @@ export class Summary extends APIResource { * https://developers.cloudflare.com/radar/concepts/bot-classes/ for more * information. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ botClass( query?: SummaryBotClassParams, @@ -36,7 +36,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP requests generated by mobile, desktop, and * other types of devices. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ deviceType( query?: SummaryDeviceTypeParams, @@ -60,7 +60,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. HTTPS). * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ httpProtocol( query?: SummaryHTTPProtocolParams, @@ -84,7 +84,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP version. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ httpVersion( query?: SummaryHTTPVersionParams, @@ -108,7 +108,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by IP version. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -133,7 +133,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP requests by operating system (Windows, macOS, * Android, iOS, and others). * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ os(query?: SummaryOSParams, options?: Core.RequestOptions): Core.APIPromise; os(options?: Core.RequestOptions): Core.APIPromise; @@ -154,7 +154,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by post-quantum support. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ postQuantum( query?: SummaryPostQuantumParams, @@ -178,7 +178,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by TLS version. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/http/timeseries-groups.ts b/src/resources/radar/http/timeseries-groups.ts index a22fdb7774..6e44b45b29 100644 --- a/src/resources/radar/http/timeseries-groups.ts +++ b/src/resources/radar/http/timeseries-groups.ts @@ -10,7 +10,7 @@ export class TimeseriesGroups extends APIResource { * over time. Visit https://developers.cloudflare.com/radar/concepts/bot-classes/ * for more information. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ botClass( query?: TimeseriesGroupBotClassParams, @@ -34,7 +34,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by user agent over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ browser( query?: TimeseriesGroupBrowserParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by user agent family over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ browserFamily( query?: TimeseriesGroupBrowserFamilyParams, @@ -83,7 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by device type over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ deviceType( query?: TimeseriesGroupDeviceTypeParams, @@ -109,7 +109,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. HTTPS) * over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ httpProtocol( query?: TimeseriesGroupHTTPProtocolParams, @@ -134,7 +134,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP version over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -159,7 +159,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by IP version over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -183,7 +183,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by operating system over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ os( query?: TimeseriesGroupOSParams, @@ -207,7 +207,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by post-quantum support over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ postQuantum( query?: TimeseriesGroupPostQuantumParams, @@ -232,7 +232,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by TLS version over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/http/top.ts b/src/resources/radar/http/top.ts index 01ee05806f..8419bea370 100644 --- a/src/resources/radar/http/top.ts +++ b/src/resources/radar/http/top.ts @@ -8,10 +8,7 @@ export class Top extends APIResource { /** * Retrieves the top user agents by HTTP requests. * - * @example - * ```ts - * const response = await client.radar.http.top.browser(); - * ``` + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ browser(query?: TopBrowserParams, options?: Core.RequestOptions): Core.APIPromise; browser(options?: Core.RequestOptions): Core.APIPromise; @@ -32,11 +29,7 @@ export class Top extends APIResource { /** * Retrieves the top user agents, aggregated in families, by HTTP requests. * - * @example - * ```ts - * const response = - * await client.radar.http.top.browserFamily(); - * ``` + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ browserFamily( query?: TopBrowserFamilyParams, diff --git a/src/resources/radar/leaked-credentials/summary.ts b/src/resources/radar/leaked-credentials/summary.ts index 917ce13982..970fde6b56 100644 --- a/src/resources/radar/leaked-credentials/summary.ts +++ b/src/resources/radar/leaked-credentials/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP authentication requests by bot class. * - * @deprecated + * @deprecated Use [Radar Leaked Credentials Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/summary_v2/) instead. */ botClass( query?: SummaryBotClassParams, @@ -34,7 +34,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP authentication requests by compromised * credential status. * - * @deprecated + * @deprecated Use [Radar Leaked Credentials Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/summary_v2/) instead. */ compromised( query?: SummaryCompromisedParams, diff --git a/src/resources/radar/leaked-credentials/timeseries-groups.ts b/src/resources/radar/leaked-credentials/timeseries-groups.ts index 83aa48d077..859a012a8c 100644 --- a/src/resources/radar/leaked-credentials/timeseries-groups.ts +++ b/src/resources/radar/leaked-credentials/timeseries-groups.ts @@ -9,7 +9,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP authentication requests by bot class over * time. * - * @deprecated + * @deprecated Use [Radar Leaked Credentials Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/timeseries_groups_v2/) instead. */ botClass( query?: TimeseriesGroupBotClassParams, @@ -35,7 +35,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP authentication requests by compromised * credential status over time. * - * @deprecated + * @deprecated Use [Radar Leaked Credentials Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/timeseries_groups_v2/) instead. */ compromised( query?: TimeseriesGroupCompromisedParams, diff --git a/src/resources/zero-trust/connectivity/directory/directory.ts b/src/resources/zero-trust/connectivity/directory/directory.ts index 0c979324a6..8d0ed0ede1 100644 --- a/src/resources/zero-trust/connectivity/directory/directory.ts +++ b/src/resources/zero-trust/connectivity/directory/directory.ts @@ -4,10 +4,15 @@ import { APIResource } from '../../../../resource'; import * as ServicesAPI from './services'; import { ServiceCreateParams, + ServiceCreateResponse, ServiceDeleteParams, ServiceGetParams, + ServiceGetResponse, ServiceListParams, + ServiceListResponse, + ServiceListResponsesV4PagePaginationArray, ServiceUpdateParams, + ServiceUpdateResponse, Services, } from './services'; @@ -16,10 +21,16 @@ export class Directory extends APIResource { } Directory.Services = Services; +Directory.ServiceListResponsesV4PagePaginationArray = ServiceListResponsesV4PagePaginationArray; export declare namespace Directory { export { Services as Services, + type ServiceCreateResponse as ServiceCreateResponse, + type ServiceUpdateResponse as ServiceUpdateResponse, + type ServiceListResponse as ServiceListResponse, + type ServiceGetResponse as ServiceGetResponse, + ServiceListResponsesV4PagePaginationArray as ServiceListResponsesV4PagePaginationArray, type ServiceCreateParams as ServiceCreateParams, type ServiceUpdateParams as ServiceUpdateParams, type ServiceListParams as ServiceListParams, diff --git a/src/resources/zero-trust/connectivity/directory/index.ts b/src/resources/zero-trust/connectivity/directory/index.ts index 78f208d56a..2d94b5e566 100644 --- a/src/resources/zero-trust/connectivity/directory/index.ts +++ b/src/resources/zero-trust/connectivity/directory/index.ts @@ -2,7 +2,12 @@ export { Directory } from './directory'; export { + ServiceListResponsesV4PagePaginationArray, Services, + type ServiceCreateResponse, + type ServiceUpdateResponse, + type ServiceListResponse, + type ServiceGetResponse, type ServiceCreateParams, type ServiceUpdateParams, type ServiceListParams, diff --git a/src/resources/zero-trust/connectivity/directory/services.ts b/src/resources/zero-trust/connectivity/directory/services.ts index 74516c9f4d..8942da54ff 100644 --- a/src/resources/zero-trust/connectivity/directory/services.ts +++ b/src/resources/zero-trust/connectivity/directory/services.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../../resource'; import * as Core from '../../../../core'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../../pagination'; export class Services extends APIResource { /** @@ -9,23 +10,30 @@ export class Services extends APIResource { * * @example * ```ts - * await client.zeroTrust.connectivity.directory.services.create( - * { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * host: {}, - * name: 'name', - * type: 'http', - * }, - * ); + * const service = + * await client.zeroTrust.connectivity.directory.services.create( + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * host: { + * hostname: 'api.example.com', + * resolver_network: { + * tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da', + * }, + * }, + * name: 'web-server', + * type: 'http', + * }, + * ); * ``` */ - create(params: ServiceCreateParams, options?: Core.RequestOptions): Core.APIPromise { + create(params: ServiceCreateParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; - return this._client.post(`/accounts/${account_id}/connectivity/directory/services`, { - body, - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + return ( + this._client.post(`/accounts/${account_id}/connectivity/directory/services`, { + body, + ...options, + }) as Core.APIPromise<{ result: ServiceCreateResponse }> + )._thenUnwrap((obj) => obj.result); } /** @@ -33,28 +41,35 @@ export class Services extends APIResource { * * @example * ```ts - * await client.zeroTrust.connectivity.directory.services.update( - * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * { - * account_id: 'account_id', - * host: {}, - * name: 'name', - * type: 'http', - * }, - * ); + * const service = + * await client.zeroTrust.connectivity.directory.services.update( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { + * account_id: 'account_id', + * host: { + * ipv4: '10.0.0.1', + * network: { + * tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da', + * }, + * }, + * name: 'web-app', + * type: 'http', + * }, + * ); * ``` */ update( serviceId: string, params: ServiceUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, ...body } = params; - return this._client.put(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { - body, - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + return ( + this._client.put(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: ServiceUpdateResponse }> + )._thenUnwrap((obj) => obj.result); } /** @@ -62,18 +77,24 @@ export class Services extends APIResource { * * @example * ```ts - * await client.zeroTrust.connectivity.directory.services.list( + * // Automatically fetches more pages as needed. + * for await (const serviceListResponse of client.zeroTrust.connectivity.directory.services.list( * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); + * )) { + * // ... + * } * ``` */ - list(params: ServiceListParams, options?: Core.RequestOptions): Core.APIPromise { + list( + params: ServiceListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { const { account_id, ...query } = params; - return this._client.get(`/accounts/${account_id}/connectivity/directory/services`, { - query, - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + return this._client.getAPIList( + `/accounts/${account_id}/connectivity/directory/services`, + ServiceListResponsesV4PagePaginationArray, + { query, ...options }, + ); } /** @@ -104,18 +125,331 @@ export class Services extends APIResource { * * @example * ```ts - * await client.zeroTrust.connectivity.directory.services.get( - * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * { account_id: 'account_id' }, - * ); + * const service = + * await client.zeroTrust.connectivity.directory.services.get( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'account_id' }, + * ); * ``` */ - get(serviceId: string, params: ServiceGetParams, options?: Core.RequestOptions): Core.APIPromise { + get( + serviceId: string, + params: ServiceGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { const { account_id } = params; - return this._client.get(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + return ( + this._client.get( + `/accounts/${account_id}/connectivity/directory/services/${serviceId}`, + options, + ) as Core.APIPromise<{ result: ServiceGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class ServiceListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface ServiceCreateResponse { + host: + | ServiceCreateResponse.InfraIPv4Host + | ServiceCreateResponse.InfraIPv6Host + | ServiceCreateResponse.InfraDualStackHost + | ServiceCreateResponse.InfraHostnameHost; + + name: string; + + type: 'http'; + + created_at?: string; + + http_port?: number | null; + + https_port?: number | null; + + service_id?: string; + + updated_at?: string; +} + +export namespace ServiceCreateResponse { + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; + + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } + } +} + +export interface ServiceUpdateResponse { + host: + | ServiceUpdateResponse.InfraIPv4Host + | ServiceUpdateResponse.InfraIPv6Host + | ServiceUpdateResponse.InfraDualStackHost + | ServiceUpdateResponse.InfraHostnameHost; + + name: string; + + type: 'http'; + + created_at?: string; + + http_port?: number | null; + + https_port?: number | null; + + service_id?: string; + + updated_at?: string; +} + +export namespace ServiceUpdateResponse { + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; + + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } + } +} + +export interface ServiceListResponse { + host: + | ServiceListResponse.InfraIPv4Host + | ServiceListResponse.InfraIPv6Host + | ServiceListResponse.InfraDualStackHost + | ServiceListResponse.InfraHostnameHost; + + name: string; + + type: 'http'; + + created_at?: string; + + http_port?: number | null; + + https_port?: number | null; + + service_id?: string; + + updated_at?: string; +} + +export namespace ServiceListResponse { + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; + + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } + } +} + +export interface ServiceGetResponse { + host: + | ServiceGetResponse.InfraIPv4Host + | ServiceGetResponse.InfraIPv6Host + | ServiceGetResponse.InfraDualStackHost + | ServiceGetResponse.InfraHostnameHost; + + name: string; + + type: 'http'; + + created_at?: string; + + http_port?: number | null; + + https_port?: number | null; + + service_id?: string; + + updated_at?: string; +} + +export namespace ServiceGetResponse { + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; + + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } } } @@ -128,7 +462,11 @@ export interface ServiceCreateParams { /** * Body param: */ - host: ServiceCreateParams.Host; + host: + | ServiceCreateParams.InfraIPv4Host + | ServiceCreateParams.InfraIPv6Host + | ServiceCreateParams.InfraDualStackHost + | ServiceCreateParams.InfraHostnameHost; /** * Body param: @@ -152,16 +490,56 @@ export interface ServiceCreateParams { } export namespace ServiceCreateParams { - export interface Host { - hostname?: string | null; + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; - ipv4?: string; + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } - ipv6?: string; + export interface InfraDualStackHost { + ipv4: string; - network?: unknown; + ipv6: string; - resolver_network?: unknown; + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } } } @@ -174,7 +552,11 @@ export interface ServiceUpdateParams { /** * Body param: */ - host: ServiceUpdateParams.Host; + host: + | ServiceUpdateParams.InfraIPv4Host + | ServiceUpdateParams.InfraIPv6Host + | ServiceUpdateParams.InfraDualStackHost + | ServiceUpdateParams.InfraHostnameHost; /** * Body param: @@ -198,35 +580,65 @@ export interface ServiceUpdateParams { } export namespace ServiceUpdateParams { - export interface Host { - hostname?: string | null; + export interface InfraIPv4Host { + ipv4: string; - ipv4?: string; + network: InfraIPv4Host.Network; + } - ipv6?: string; + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } - network?: unknown; + export interface InfraIPv6Host { + ipv6: string; - resolver_network?: unknown; + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } } } -export interface ServiceListParams { +export interface ServiceListParams extends V4PagePaginationArrayParams { /** * Path param: Account identifier */ account_id: string; - /** - * Query param: Current page in the response - */ - page?: number; - - /** - * Query param: Max amount of entries returned per page - */ - per_page?: number; - /** * Query param: */ @@ -241,8 +653,15 @@ export interface ServiceGetParams { account_id: string; } +Services.ServiceListResponsesV4PagePaginationArray = ServiceListResponsesV4PagePaginationArray; + export declare namespace Services { export { + type ServiceCreateResponse as ServiceCreateResponse, + type ServiceUpdateResponse as ServiceUpdateResponse, + type ServiceListResponse as ServiceListResponse, + type ServiceGetResponse as ServiceGetResponse, + ServiceListResponsesV4PagePaginationArray as ServiceListResponsesV4PagePaginationArray, type ServiceCreateParams as ServiceCreateParams, type ServiceUpdateParams as ServiceUpdateParams, type ServiceListParams as ServiceListParams, diff --git a/src/resources/zero-trust/devices/posture/posture.ts b/src/resources/zero-trust/devices/posture/posture.ts index 3b2bd2a898..54f186eca7 100644 --- a/src/resources/zero-trust/devices/posture/posture.ts +++ b/src/resources/zero-trust/devices/posture/posture.ts @@ -850,7 +850,7 @@ export interface OSVersionInput { /** * Additional version data. For Mac or iOS, the Product Version Extra. For Linux, - * the kernel release version. (Mac, iOS, and Linux only). + * the distribution name and version. (Mac, iOS, and Linux only). */ os_version_extra?: string; } @@ -883,7 +883,7 @@ export interface OSVersionInputParam { /** * Additional version data. For Mac or iOS, the Product Version Extra. For Linux, - * the kernel release version. (Mac, iOS, and Linux only). + * the distribution name and version. (Mac, iOS, and Linux only). */ os_version_extra?: string; } diff --git a/src/resources/zero-trust/gateway/configurations/configurations.ts b/src/resources/zero-trust/gateway/configurations/configurations.ts index 9f7a1aacb5..fb9a035b50 100755 --- a/src/resources/zero-trust/gateway/configurations/configurations.ts +++ b/src/resources/zero-trust/gateway/configurations/configurations.ts @@ -406,12 +406,11 @@ export interface CustomCertificateSettingsParam { } /** - * Specify user email settings for the firewall policies. When this is enabled, we - * standardize the email addresses in the identity part of the rule, so that they - * match the extended email variants in the firewall policies. When this setting is - * turned off, the email addresses in the identity part of the rule will be matched - * exactly as provided. If your email has `.` or `+` modifiers, you should enable - * this setting. + * Configures user email settings for firewall policies. When you enable this, the + * system standardizes email addresses in the identity portion of the rule to match + * extended email variants in firewall policies. When you disable this setting, the + * system matches email addresses exactly as you provide them. Enable this setting + * if your email uses `.` or `+` modifiers. */ export interface ExtendedEmailMatching { /** @@ -438,12 +437,11 @@ export interface ExtendedEmailMatching { } /** - * Specify user email settings for the firewall policies. When this is enabled, we - * standardize the email addresses in the identity part of the rule, so that they - * match the extended email variants in the firewall policies. When this setting is - * turned off, the email addresses in the identity part of the rule will be matched - * exactly as provided. If your email has `.` or `+` modifiers, you should enable - * this setting. + * Configures user email settings for firewall policies. When you enable this, the + * system standardizes email addresses in the identity portion of the rule to match + * extended email variants in firewall policies. When you disable this setting, the + * system matches email addresses exactly as you provide them. Enable this setting + * if your email uses `.` or `+` modifiers. */ export interface ExtendedEmailMatchingParam { /** @@ -515,12 +513,11 @@ export interface GatewayConfigurationSettings { custom_certificate?: CustomCertificateSettings | null; /** - * Specify user email settings for the firewall policies. When this is enabled, we - * standardize the email addresses in the identity part of the rule, so that they - * match the extended email variants in the firewall policies. When this setting is - * turned off, the email addresses in the identity part of the rule will be matched - * exactly as provided. If your email has `.` or `+` modifiers, you should enable - * this setting. + * Configures user email settings for firewall policies. When you enable this, the + * system standardizes email addresses in the identity portion of the rule to match + * extended email variants in firewall policies. When you disable this setting, the + * system matches email addresses exactly as you provide them. Enable this setting + * if your email uses `.` or `+` modifiers. */ extended_email_matching?: ExtendedEmailMatching | null; @@ -651,12 +648,11 @@ export interface GatewayConfigurationSettingsParam { custom_certificate?: CustomCertificateSettingsParam | null; /** - * Specify user email settings for the firewall policies. When this is enabled, we - * standardize the email addresses in the identity part of the rule, so that they - * match the extended email variants in the firewall policies. When this setting is - * turned off, the email addresses in the identity part of the rule will be matched - * exactly as provided. If your email has `.` or `+` modifiers, you should enable - * this setting. + * Configures user email settings for firewall policies. When you enable this, the + * system standardizes email addresses in the identity portion of the rule to match + * extended email variants in firewall policies. When you disable this setting, the + * system matches email addresses exactly as you provide them. Enable this setting + * if your email uses `.` or `+` modifiers. */ extended_email_matching?: ExtendedEmailMatchingParam | null; diff --git a/src/resources/zero-trust/gateway/rules.ts b/src/resources/zero-trust/gateway/rules.ts index e672443115..845f44fd1f 100644 --- a/src/resources/zero-trust/gateway/rules.ts +++ b/src/resources/zero-trust/gateway/rules.ts @@ -393,12 +393,10 @@ export interface GatewayRule { read_only?: boolean; /** - * Set settings related to this rule. Each setting is only valid for specific rule - * types and can only be used with the appropriate selectors. If Terraform drift is - * observed in these setting values, verify that the setting is supported for the - * given rule type and that the API response reflects the requested value. If the - * API response returns sanitized or modified values that differ from the request, - * use the API-provided values in Terraform to ensure consistency. + * Defines settings for this rule. Settings apply only to specific rule types and + * must use compatible selectors. If Terraform detects drift, confirm the setting + * supports your rule type and check whether the API modifies the value. Use + * API-returned values in your configuration to prevent drift. */ rule_settings?: RuleSetting; @@ -461,12 +459,10 @@ export namespace GatewayRule { } /** - * Set settings related to this rule. Each setting is only valid for specific rule - * types and can only be used with the appropriate selectors. If Terraform drift is - * observed in these setting values, verify that the setting is supported for the - * given rule type and that the API response reflects the requested value. If the - * API response returns sanitized or modified values that differ from the request, - * use the API-provided values in Terraform to ensure consistency. + * Defines settings for this rule. Settings apply only to specific rule types and + * must use compatible selectors. If Terraform detects drift, confirm the setting + * supports your rule type and check whether the API modifies the value. Use + * API-returned values in your configuration to prevent drift. */ export interface RuleSetting { /** @@ -920,12 +916,10 @@ export namespace RuleSetting { } /** - * Set settings related to this rule. Each setting is only valid for specific rule - * types and can only be used with the appropriate selectors. If Terraform drift is - * observed in these setting values, verify that the setting is supported for the - * given rule type and that the API response reflects the requested value. If the - * API response returns sanitized or modified values that differ from the request, - * use the API-provided values in Terraform to ensure consistency. + * Defines settings for this rule. Settings apply only to specific rule types and + * must use compatible selectors. If Terraform detects drift, confirm the setting + * supports your rule type and check whether the API modifies the value. Use + * API-returned values in your configuration to prevent drift. */ export interface RuleSettingParam { /** @@ -1606,13 +1600,10 @@ export interface RuleCreateParams { precedence?: number; /** - * Body param: Set settings related to this rule. Each setting is only valid for - * specific rule types and can only be used with the appropriate selectors. If - * Terraform drift is observed in these setting values, verify that the setting is - * supported for the given rule type and that the API response reflects the - * requested value. If the API response returns sanitized or modified values that - * differ from the request, use the API-provided values in Terraform to ensure - * consistency. + * Body param: Defines settings for this rule. Settings apply only to specific rule + * types and must use compatible selectors. If Terraform detects drift, confirm the + * setting supports your rule type and check whether the API modifies the value. + * Use API-returned values in your configuration to prevent drift. */ rule_settings?: RuleSettingParam; @@ -1737,13 +1728,10 @@ export interface RuleUpdateParams { precedence?: number; /** - * Body param: Set settings related to this rule. Each setting is only valid for - * specific rule types and can only be used with the appropriate selectors. If - * Terraform drift is observed in these setting values, verify that the setting is - * supported for the given rule type and that the API response reflects the - * requested value. If the API response returns sanitized or modified values that - * differ from the request, use the API-provided values in Terraform to ensure - * consistency. + * Body param: Defines settings for this rule. Settings apply only to specific rule + * types and must use compatible selectors. If Terraform detects drift, confirm the + * setting supports your rule type and check whether the API modifies the value. + * Use API-returned values in your configuration to prevent drift. */ rule_settings?: RuleSettingParam; diff --git a/tests/api-resources/zero-trust/connectivity/directory/services.test.ts b/tests/api-resources/zero-trust/connectivity/directory/services.test.ts index 4e6440e25c..735afe06c3 100644 --- a/tests/api-resources/zero-trust/connectivity/directory/services.test.ts +++ b/tests/api-resources/zero-trust/connectivity/directory/services.test.ts @@ -13,8 +13,11 @@ describe('resource services', () => { test('create: only required params', async () => { const responsePromise = client.zeroTrust.connectivity.directory.services.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', - host: {}, - name: 'name', + host: { + hostname: 'api.example.com', + resolver_network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da' }, + }, + name: 'web-server', type: 'http', }); const rawResponse = await responsePromise.asResponse(); @@ -29,18 +32,26 @@ describe('resource services', () => { test('create: required and optional params', async () => { const response = await client.zeroTrust.connectivity.directory.services.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', - host: { hostname: 'hostname', ipv4: 'ipv4', ipv6: 'ipv6', network: {}, resolver_network: {} }, - name: 'name', + host: { + hostname: 'api.example.com', + resolver_network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da', resolver_ips: ['string'] }, + }, + name: 'web-server', type: 'http', - http_port: 1, - https_port: 1, + http_port: 8080, + https_port: 8443, }); }); test('update: only required params', async () => { const responsePromise = client.zeroTrust.connectivity.directory.services.update( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - { account_id: 'account_id', host: {}, name: 'name', type: 'http' }, + { + account_id: 'account_id', + host: { ipv4: '10.0.0.1', network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da' } }, + name: 'web-app', + type: 'http', + }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -56,11 +67,11 @@ describe('resource services', () => { '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: 'account_id', - host: { hostname: 'hostname', ipv4: 'ipv4', ipv6: 'ipv6', network: {}, resolver_network: {} }, - name: 'name', + host: { ipv4: '10.0.0.1', network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da' } }, + name: 'web-app', type: 'http', - http_port: 1, - https_port: 1, + http_port: 8080, + https_port: 8443, }, ); }); From 465498a8b7eddc6e3578999ab88800db6b714721 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 20:28:28 +0000 Subject: [PATCH 279/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0a34fc2286..a2f76ddd4a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1855 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-46bf704f4474b456b8e26d6166a8aa9990664707f345c41a40485d6cb16eea97.yml -openapi_spec_hash: 0fc77cec03f8c19d51faaf99aef6cc0b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-200e83db2932f6582230357b81b4874fe4ea91add12ca8fc9adce41ccd153b0f.yml +openapi_spec_hash: f477b5154565e4597d180adefe8232a8 config_hash: ced339c69004cc06854b37a59f5d270a From 59c9fb341bf41a48fdd1164e59bc8c65c69de361 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 20:32:05 +0000 Subject: [PATCH 280/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a2f76ddd4a..e20906316f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1855 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-200e83db2932f6582230357b81b4874fe4ea91add12ca8fc9adce41ccd153b0f.yml -openapi_spec_hash: f477b5154565e4597d180adefe8232a8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-16d76a13fe2f95847bf6d267f2e9e26daf8462ba518de8c6f27163f4dd09010d.yml +openapi_spec_hash: e965ea71c0f1bb71933a3f10a122d4c8 config_hash: ced339c69004cc06854b37a59f5d270a From 83c711f5758b044959adad4aca8981c7e6621934 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 21:37:14 +0000 Subject: [PATCH 281/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e20906316f..57acf96d89 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1855 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-16d76a13fe2f95847bf6d267f2e9e26daf8462ba518de8c6f27163f4dd09010d.yml -openapi_spec_hash: e965ea71c0f1bb71933a3f10a122d4c8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-90808d61c82855d01afed337662c50972dc6ac8b779763650cecef6541c2d5cc.yml +openapi_spec_hash: 5c9d36950e74e02161a89f5051bccef1 config_hash: ced339c69004cc06854b37a59f5d270a From d38b204b917199ea795e27fc9a86bd71d930cf03 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 15 Oct 2025 16:39:49 +0000 Subject: [PATCH 282/451] feat: chore(abuse): rename path parameter * chore(abuse): rename path parameter --- .stats.yml | 4 +- api.md | 8 + scripts/detect-breaking-changes | 1 + src/resources/abuse-reports.ts | 886 +++++++++++++++++++++- tests/api-resources/abuse-reports.test.ts | 69 ++ 5 files changed, 965 insertions(+), 3 deletions(-) create mode 100644 tests/api-resources/abuse-reports.test.ts diff --git a/.stats.yml b/.stats.yml index 57acf96d89..68c313193d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1855 +configured_endpoints: 1856 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-90808d61c82855d01afed337662c50972dc6ac8b779763650cecef6541c2d5cc.yml openapi_spec_hash: 5c9d36950e74e02161a89f5051bccef1 -config_hash: ced339c69004cc06854b37a59f5d270a +config_hash: 8b4b3138e3a18ef5db3b0cadffd36a6e diff --git a/api.md b/api.md index 9106d9a28d..9dc54d436b 100644 --- a/api.md +++ b/api.md @@ -8678,6 +8678,14 @@ Methods: # AbuseReports +Types: + +- AbuseReportCreateResponse + +Methods: + +- client.abuseReports.create(reportParam, { ...params }) -> AbuseReportCreateResponse + # AI Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 095ac81632..bebf0a16f9 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -726,6 +726,7 @@ TEST_PATHS=( tests/api-resources/content-scanning/content-scanning.test.ts tests/api-resources/content-scanning/payloads.test.ts tests/api-resources/content-scanning/settings.test.ts + tests/api-resources/abuse-reports.test.ts tests/api-resources/ai/ai.test.ts tests/api-resources/ai/finetunes/finetunes.test.ts tests/api-resources/ai/finetunes/assets.test.ts diff --git a/src/resources/abuse-reports.ts b/src/resources/abuse-reports.ts index 2a55a7e639..451d8869ad 100644 --- a/src/resources/abuse-reports.ts +++ b/src/resources/abuse-reports.ts @@ -1,5 +1,889 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../resource'; +import * as Core from '../core'; -export class AbuseReports extends APIResource {} +export class AbuseReports extends APIResource { + /** + * Submit the Abuse Report of a particular type + */ + create( + reportParam: string, + params: AbuseReportCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/abuse-reports/${reportParam}`, { + body, + ...options, + }) as Core.APIPromise<{ result: AbuseReportCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +/** + * The result should be 'success' for successful response + */ +export type AbuseReportCreateResponse = string; + +export type AbuseReportCreateParams = + | AbuseReportCreateParams.AbuseReportsDmcaReport + | AbuseReportCreateParams.AbuseReportsTrademarkReport + | AbuseReportCreateParams.AbuseReportsGeneralReport + | AbuseReportCreateParams.AbuseReportsPhishingReport + | AbuseReportCreateParams.AbuseReportsCsamReport + | AbuseReportCreateParams.AbuseReportsThreatReport + | AbuseReportCreateParams.AbuseReportsRegistrarWhoisReport + | AbuseReportCreateParams.AbuseReportsNcseiReport; + +export declare namespace AbuseReportCreateParams { + export interface AbuseReportsDmcaReport { + /** + * Path param: The account ID of the submitter. + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_dmca'; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + address1: string; + + /** + * Body param: The name of the copyright holder. Text not exceeding 60 characters. + * This field may be released by Cloudflare to third parties such as the Lumen + * Database (https://lumendatabase.org/). + */ + agent_name: string; + + /** + * Body param: Can be `0` for false or `1` for true. Must be value: 1 for DMCA + * reports + */ + agree: 1; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + city: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + country: string; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send'; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + original_work: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send'; + + /** + * Body param: Required for DMCA reports, should be same as Name. An affirmation + * that all information in the report is true and accurate while agreeing to the + * policies of Cloudflare's abuse reports + */ + signature: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + state: string; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsTrademarkReport { + /** + * Path param: The account ID of the submitter. + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_trademark'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send'; + + /** + * Body param: Text not exceeding 1000 characters + */ + trademark_number: string; + + /** + * Body param: Text not exceeding 1000 characters + */ + trademark_office: string; + + /** + * Body param: Text not exceeding 1000 characters + */ + trademark_symbol: string; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsGeneralReport { + /** + * Path param: The account ID of the submitter. + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_general'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon' | 'none'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: A list of IP addresses separated by ‘\n’ (new line character). The + * list of destination IPs should not exceed 30 IP addresses. Each one of the IP + * addresses ought to be unique. + */ + destination_ips?: string; + + /** + * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. + * The total size of the field should not exceed 2000 characters. Each individual + * port/protocol should not exceed 100 characters. The list should not have more + * than 30 unique ports and protocols. + */ + ports_protocols?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: A list of IP addresses separated by ‘\n’ (new line character). The + * list of source IPs should not exceed 30 IP addresses. Each one of the IP + * addresses ought to be unique. + */ + source_ips?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsPhishingReport { + /** + * Path param: The account ID of the submitter. + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_phishing'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + original_work?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsCsamReport { + /** + * Path param: The account ID of the submitter. + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_children'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + ncmec_notification: 'send' | 'send-anon'; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon' | 'none'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + country?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsThreatReport { + /** + * Path param: The account ID of the submitter. + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_threat'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsRegistrarWhoisReport { + /** + * Path param: The account ID of the submitter. + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_registrar_whois'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon' | 'none'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsNcseiReport { + /** + * Path param: The account ID of the submitter. + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_ncsei'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: If the submitter is the target of NCSEI in the URLs of the abuse + * report. + */ + ncsei_subject_representation: boolean; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon' | 'none'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + country?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } +} + +export declare namespace AbuseReports { + export { + type AbuseReportCreateResponse as AbuseReportCreateResponse, + type AbuseReportCreateParams as AbuseReportCreateParams, + }; +} diff --git a/tests/api-resources/abuse-reports.test.ts b/tests/api-resources/abuse-reports.test.ts new file mode 100644 index 0000000000..4b1fb3b55a --- /dev/null +++ b/tests/api-resources/abuse-reports.test.ts @@ -0,0 +1,69 @@ +// 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 abuseReports', () => { + // TODO: investigate unauthorized HTTP response + test.skip('create: only required params', async () => { + const responsePromise = client.abuseReports.create('report_param', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + 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(); + 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 unauthorized HTTP response + test.skip('create: required and optional params', async () => { + const response = await client.abuseReports.create('report_param', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + 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', + comments: 'x', + company: 'x', + reported_country: 'xx', + reported_user_agent: 'x', + tele: 'x', + title: 'x', + }); + }); +}); From 611bc8ccbf6b04bb336d8a1981efc7c9c9dee297 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 01:36:23 +0000 Subject: [PATCH 283/451] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 2 + src/resources/queues/index.ts | 2 + src/resources/queues/queues.ts | 4 + src/resources/queues/subscriptions.ts | 172 ++++++++++++++++++ .../r2/buckets/event-notifications.ts | 7 +- src/resources/rulesets/rules.ts | 8 +- .../access/applications/applications.ts | 5 + .../queues/subscriptions.test.ts | 19 ++ .../r2/buckets/event-notifications.test.ts | 1 + 10 files changed, 217 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index 68c313193d..d6f5a167d3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1856 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-90808d61c82855d01afed337662c50972dc6ac8b779763650cecef6541c2d5cc.yml -openapi_spec_hash: 5c9d36950e74e02161a89f5051bccef1 +configured_endpoints: 1857 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-25948e3293c7ca8798d7722f962cf2fc566faa8880489e0746d3a16f1e02e523.yml +openapi_spec_hash: 97e3f177c34640dd60815a578f1ed7bd config_hash: 8b4b3138e3a18ef5db3b0cadffd36a6e diff --git a/api.md b/api.md index 9dc54d436b..0f4984b472 100644 --- a/api.md +++ b/api.md @@ -2447,6 +2447,7 @@ Types: - SubscriptionUpdateResponse - SubscriptionListResponse - SubscriptionDeleteResponse +- SubscriptionGetResponse Methods: @@ -2454,6 +2455,7 @@ Methods: - client.queues.subscriptions.update(subscriptionId, { ...params }) -> SubscriptionUpdateResponse - client.queues.subscriptions.list({ ...params }) -> SubscriptionListResponsesV4PagePaginationArray - client.queues.subscriptions.delete(subscriptionId, { ...params }) -> SubscriptionDeleteResponse +- client.queues.subscriptions.get(subscriptionId, { ...params }) -> SubscriptionGetResponse # APIGateway diff --git a/src/resources/queues/index.ts b/src/resources/queues/index.ts index ebf2923861..ab15d31aa7 100644 --- a/src/resources/queues/index.ts +++ b/src/resources/queues/index.ts @@ -31,8 +31,10 @@ export { type SubscriptionUpdateResponse, type SubscriptionListResponse, type SubscriptionDeleteResponse, + type SubscriptionGetResponse, type SubscriptionCreateParams, type SubscriptionUpdateParams, type SubscriptionListParams, type SubscriptionDeleteParams, + type SubscriptionGetParams, } from './subscriptions'; diff --git a/src/resources/queues/queues.ts b/src/resources/queues/queues.ts index 667ab7a44a..836f42bd41 100644 --- a/src/resources/queues/queues.ts +++ b/src/resources/queues/queues.ts @@ -35,6 +35,8 @@ import { SubscriptionCreateResponse, SubscriptionDeleteParams, SubscriptionDeleteResponse, + SubscriptionGetParams, + SubscriptionGetResponse, SubscriptionListParams, SubscriptionListResponse, SubscriptionListResponsesV4PagePaginationArray, @@ -399,10 +401,12 @@ export declare namespace Queues { type SubscriptionUpdateResponse as SubscriptionUpdateResponse, type SubscriptionListResponse as SubscriptionListResponse, type SubscriptionDeleteResponse as SubscriptionDeleteResponse, + type SubscriptionGetResponse as SubscriptionGetResponse, SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, type SubscriptionCreateParams as SubscriptionCreateParams, type SubscriptionUpdateParams as SubscriptionUpdateParams, type SubscriptionListParams as SubscriptionListParams, type SubscriptionDeleteParams as SubscriptionDeleteParams, + type SubscriptionGetParams as SubscriptionGetParams, }; } diff --git a/src/resources/queues/subscriptions.ts b/src/resources/queues/subscriptions.ts index 3bb405e3fc..74c9b0e81f 100644 --- a/src/resources/queues/subscriptions.ts +++ b/src/resources/queues/subscriptions.ts @@ -105,6 +105,31 @@ export class Subscriptions extends APIResource { ) as Core.APIPromise<{ result: SubscriptionDeleteResponse }> )._thenUnwrap((obj) => obj.result); } + + /** + * Get details about an existing event subscription + * + * @example + * ```ts + * const subscription = await client.queues.subscriptions.get( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + subscriptionId: string, + params: SubscriptionGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, + options, + ) as Core.APIPromise<{ result: SubscriptionGetResponse }> + )._thenUnwrap((obj) => obj.result); + } } export class SubscriptionListResponsesV4PagePaginationArray extends V4PagePaginationArray {} @@ -661,6 +686,144 @@ export namespace SubscriptionDeleteResponse { } } +export interface SubscriptionGetResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionGetResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionGetResponse.MqEventSourceImages + | SubscriptionGetResponse.MqEventSourceKV + | SubscriptionGetResponse.MqEventSourceR2 + | SubscriptionGetResponse.MqEventSourceSuperSlurper + | SubscriptionGetResponse.MqEventSourceVectorize + | SubscriptionGetResponse.MqEventSourceWorkersAIModel + | SubscriptionGetResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionGetResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionGetResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + export interface SubscriptionCreateParams { /** * Path param: A Resource identifier. @@ -857,6 +1020,13 @@ export interface SubscriptionDeleteParams { account_id: string; } +export interface SubscriptionGetParams { + /** + * A Resource identifier. + */ + account_id: string; +} + Subscriptions.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; export declare namespace Subscriptions { @@ -865,10 +1035,12 @@ export declare namespace Subscriptions { type SubscriptionUpdateResponse as SubscriptionUpdateResponse, type SubscriptionListResponse as SubscriptionListResponse, type SubscriptionDeleteResponse as SubscriptionDeleteResponse, + type SubscriptionGetResponse as SubscriptionGetResponse, SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, type SubscriptionCreateParams as SubscriptionCreateParams, type SubscriptionUpdateParams as SubscriptionUpdateParams, type SubscriptionListParams as SubscriptionListParams, type SubscriptionDeleteParams as SubscriptionDeleteParams, + type SubscriptionGetParams as SubscriptionGetParams, }; } diff --git a/src/resources/r2/buckets/event-notifications.ts b/src/resources/r2/buckets/event-notifications.ts index cb0ba791f0..b3f163f204 100644 --- a/src/resources/r2/buckets/event-notifications.ts +++ b/src/resources/r2/buckets/event-notifications.ts @@ -13,7 +13,10 @@ export class EventNotifications extends APIResource { * await client.r2.buckets.eventNotifications.update( * 'example-bucket', * 'queue_id', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * rules: [{ actions: ['PutObject', 'CopyObject'] }], + * }, * ); * ``` */ @@ -275,7 +278,7 @@ export interface EventNotificationUpdateParams { /** * Body param: Array of rules to drive notifications. */ - rules?: Array; + rules: Array; /** * Header param: Jurisdiction where objects in this bucket are guaranteed to be diff --git a/src/resources/rulesets/rules.ts b/src/resources/rulesets/rules.ts index ee0495559c..230322ad70 100644 --- a/src/resources/rulesets/rules.ts +++ b/src/resources/rulesets/rules.ts @@ -5850,7 +5850,7 @@ export namespace SetConfigRule { bic?: boolean; /** - * Whether to disable Cloudflare Apps. + * @deprecated Cloudflare Apps are deprected. */ disable_apps?: true; @@ -6087,7 +6087,7 @@ export namespace SetConfigRuleParam { bic?: boolean; /** - * Whether to disable Cloudflare Apps. + * @deprecated Cloudflare Apps are deprected. */ disable_apps?: true; @@ -11368,7 +11368,7 @@ export declare namespace RuleCreateParams { bic?: boolean; /** - * Whether to disable Cloudflare Apps. + * @deprecated Cloudflare Apps are deprected. */ disable_apps?: true; @@ -15560,7 +15560,7 @@ export declare namespace RuleEditParams { bic?: boolean; /** - * Whether to disable Cloudflare Apps. + * @deprecated Cloudflare Apps are deprected. */ disable_apps?: true; diff --git a/src/resources/zero-trust/access/applications/applications.ts b/src/resources/zero-trust/access/applications/applications.ts index 00a1c63b2a..7e7402cd82 100644 --- a/src/resources/zero-trust/access/applications/applications.ts +++ b/src/resources/zero-trust/access/applications/applications.ts @@ -18608,6 +18608,11 @@ export interface ApplicationListParams extends V4PagePaginationArrayParams { * Query param: Search for apps by other listed query parameters. */ search?: string; + + /** + * Query param: Target Criteria attributes in key=value format. + */ + target_attributes?: string; } export interface ApplicationDeleteParams { diff --git a/tests/api-resources/queues/subscriptions.test.ts b/tests/api-resources/queues/subscriptions.test.ts index fed29a3ae9..cefb7a8db1 100644 --- a/tests/api-resources/queues/subscriptions.test.ts +++ b/tests/api-resources/queues/subscriptions.test.ts @@ -98,4 +98,23 @@ describe('resource subscriptions', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); + + test('get: only required params', async () => { + const responsePromise = client.queues.subscriptions.get('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('get: required and optional params', async () => { + const response = await client.queues.subscriptions.get('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); }); diff --git a/tests/api-resources/r2/buckets/event-notifications.test.ts b/tests/api-resources/r2/buckets/event-notifications.test.ts index 120dc9ff67..07d3d03635 100644 --- a/tests/api-resources/r2/buckets/event-notifications.test.ts +++ b/tests/api-resources/r2/buckets/event-notifications.test.ts @@ -14,6 +14,7 @@ describe('resource eventNotifications', () => { test.skip('update: only required params', async () => { const responsePromise = client.r2.buckets.eventNotifications.update('example-bucket', 'queue_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + rules: [{ actions: ['PutObject', 'CopyObject'] }], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); From f0d5269fceff63a803a27e8075290503011cf380 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 19:59:30 +0000 Subject: [PATCH 284/451] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d6f5a167d3..64d8c7e1be 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1857 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-25948e3293c7ca8798d7722f962cf2fc566faa8880489e0746d3a16f1e02e523.yml openapi_spec_hash: 97e3f177c34640dd60815a578f1ed7bd -config_hash: 8b4b3138e3a18ef5db3b0cadffd36a6e +config_hash: e16fca6aff930b2279d586d92022f7d1 From 0df6de0cbb5be238ba0daf8e7b90ff6f7f7179d5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Oct 2025 15:18:48 +0000 Subject: [PATCH 285/451] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 10 +++ scripts/detect-breaking-changes | 1 + src/resources/abuse-reports.ts | 16 ++-- .../cloudforce-one/cloudforce-one.ts | 4 + src/resources/cloudforce-one/index.ts | 2 + .../cloudforce-one/threat-events/index.ts | 8 +- .../threat-events/indicator-types.ts | 43 +++++++++- .../threat-events/threat-events.ts | 82 ++++++++++++++++++- src/resources/rulesets/rules.ts | 12 ++- .../threat-events/indicator-types.test.ts | 33 ++++++++ .../threat-events/threat-events.test.ts | 17 ++++ 12 files changed, 215 insertions(+), 19 deletions(-) create mode 100644 tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts diff --git a/.stats.yml b/.stats.yml index 64d8c7e1be..0951afe38e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1857 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-25948e3293c7ca8798d7722f962cf2fc566faa8880489e0746d3a16f1e02e523.yml -openapi_spec_hash: 97e3f177c34640dd60815a578f1ed7bd +configured_endpoints: 1859 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ff0a3f42ea21b040e9bbddbe548b9ce8ada7133f171cfec847b1757b84e6c2cd.yml +openapi_spec_hash: d0ce24cbb42173ac9a438105e88a292b config_hash: e16fca6aff930b2279d586d92022f7d1 diff --git a/api.md b/api.md index 0f4984b472..112ba46fbe 100644 --- a/api.md +++ b/api.md @@ -8151,6 +8151,7 @@ Types: - ThreatEventDeleteResponse - ThreatEventBulkCreateResponse - ThreatEventEditResponse +- ThreatEventGetResponse Methods: @@ -8159,6 +8160,7 @@ Methods: - client.cloudforceOne.threatEvents.delete(eventId, { ...params }) -> ThreatEventDeleteResponse - client.cloudforceOne.threatEvents.bulkCreate({ ...params }) -> ThreatEventBulkCreateResponse - client.cloudforceOne.threatEvents.edit(eventId, { ...params }) -> ThreatEventEditResponse +- client.cloudforceOne.threatEvents.get(eventId, { ...params }) -> ThreatEventGetResponse ### Attackers @@ -8222,6 +8224,14 @@ Methods: ### IndicatorTypes +Types: + +- IndicatorTypeListResponse + +Methods: + +- client.cloudforceOne.threatEvents.indicatorTypes.list({ ...params }) -> IndicatorTypeListResponse + ### Raw Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index bebf0a16f9..93ee379c25 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -690,6 +690,7 @@ TEST_PATHS=( tests/api-resources/cloudforce-one/threat-events/categories.test.ts tests/api-resources/cloudforce-one/threat-events/countries.test.ts tests/api-resources/cloudforce-one/threat-events/datasets/datasets.test.ts + tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts tests/api-resources/cloudforce-one/threat-events/raw.test.ts tests/api-resources/cloudforce-one/threat-events/relate.test.ts tests/api-resources/cloudforce-one/threat-events/tags.test.ts diff --git a/src/resources/abuse-reports.ts b/src/resources/abuse-reports.ts index 451d8869ad..16775672c3 100644 --- a/src/resources/abuse-reports.ts +++ b/src/resources/abuse-reports.ts @@ -40,7 +40,7 @@ export type AbuseReportCreateParams = export declare namespace AbuseReportCreateParams { export interface AbuseReportsDmcaReport { /** - * Path param: The account ID of the submitter. + * Path param: Cloudflare Account ID */ account_id: string; @@ -181,7 +181,7 @@ export declare namespace AbuseReportCreateParams { export interface AbuseReportsTrademarkReport { /** - * Path param: The account ID of the submitter. + * Path param: Cloudflare Account ID */ account_id: string; @@ -289,7 +289,7 @@ export declare namespace AbuseReportCreateParams { export interface AbuseReportsGeneralReport { /** - * Path param: The account ID of the submitter. + * Path param: Cloudflare Account ID */ account_id: string; @@ -404,7 +404,7 @@ export declare namespace AbuseReportCreateParams { export interface AbuseReportsPhishingReport { /** - * Path param: The account ID of the submitter. + * Path param: Cloudflare Account ID */ account_id: string; @@ -504,7 +504,7 @@ export declare namespace AbuseReportCreateParams { export interface AbuseReportsCsamReport { /** - * Path param: The account ID of the submitter. + * Path param: Cloudflare Account ID */ account_id: string; @@ -610,7 +610,7 @@ export declare namespace AbuseReportCreateParams { export interface AbuseReportsThreatReport { /** - * Path param: The account ID of the submitter. + * Path param: Cloudflare Account ID */ account_id: string; @@ -703,7 +703,7 @@ export declare namespace AbuseReportCreateParams { export interface AbuseReportsRegistrarWhoisReport { /** - * Path param: The account ID of the submitter. + * Path param: Cloudflare Account ID */ account_id: string; @@ -783,7 +783,7 @@ export declare namespace AbuseReportCreateParams { export interface AbuseReportsNcseiReport { /** - * Path param: The account ID of the submitter. + * Path param: Cloudflare Account ID */ account_id: string; diff --git a/src/resources/cloudforce-one/cloudforce-one.ts b/src/resources/cloudforce-one/cloudforce-one.ts index 8c4fe620ba..aeabfa782e 100644 --- a/src/resources/cloudforce-one/cloudforce-one.ts +++ b/src/resources/cloudforce-one/cloudforce-one.ts @@ -41,6 +41,8 @@ import { ThreatEventDeleteResponse, ThreatEventEditParams, ThreatEventEditResponse, + ThreatEventGetParams, + ThreatEventGetResponse, ThreatEventListParams, ThreatEventListResponse, ThreatEvents, @@ -98,10 +100,12 @@ export declare namespace CloudforceOne { type ThreatEventDeleteResponse as ThreatEventDeleteResponse, type ThreatEventBulkCreateResponse as ThreatEventBulkCreateResponse, type ThreatEventEditResponse as ThreatEventEditResponse, + type ThreatEventGetResponse as ThreatEventGetResponse, type ThreatEventCreateParams as ThreatEventCreateParams, type ThreatEventListParams as ThreatEventListParams, type ThreatEventDeleteParams as ThreatEventDeleteParams, type ThreatEventBulkCreateParams as ThreatEventBulkCreateParams, type ThreatEventEditParams as ThreatEventEditParams, + type ThreatEventGetParams as ThreatEventGetParams, }; } diff --git a/src/resources/cloudforce-one/index.ts b/src/resources/cloudforce-one/index.ts index 77ba414bca..f69388911d 100644 --- a/src/resources/cloudforce-one/index.ts +++ b/src/resources/cloudforce-one/index.ts @@ -35,9 +35,11 @@ export { type ThreatEventDeleteResponse, type ThreatEventBulkCreateResponse, type ThreatEventEditResponse, + type ThreatEventGetResponse, type ThreatEventCreateParams, type ThreatEventListParams, type ThreatEventDeleteParams, type ThreatEventBulkCreateParams, type ThreatEventEditParams, + type ThreatEventGetParams, } from './threat-events/index'; diff --git a/src/resources/cloudforce-one/threat-events/index.ts b/src/resources/cloudforce-one/threat-events/index.ts index d687bf1e82..02c8bab160 100644 --- a/src/resources/cloudforce-one/threat-events/index.ts +++ b/src/resources/cloudforce-one/threat-events/index.ts @@ -36,7 +36,11 @@ export { type EventTagCreateParams, type EventTagDeleteParams, } from './event-tags'; -export { IndicatorTypes } from './indicator-types'; +export { + IndicatorTypes, + type IndicatorTypeListResponse, + type IndicatorTypeListParams, +} from './indicator-types'; export { Insights } from './insights'; export { Raw, type RawEditResponse, type RawGetResponse, type RawEditParams, type RawGetParams } from './raw'; export { Relate, type RelateDeleteResponse, type RelateDeleteParams } from './relate'; @@ -53,9 +57,11 @@ export { type ThreatEventDeleteResponse, type ThreatEventBulkCreateResponse, type ThreatEventEditResponse, + type ThreatEventGetResponse, type ThreatEventCreateParams, type ThreatEventListParams, type ThreatEventDeleteParams, type ThreatEventBulkCreateParams, type ThreatEventEditParams, + type ThreatEventGetParams, } from './threat-events'; diff --git a/src/resources/cloudforce-one/threat-events/indicator-types.ts b/src/resources/cloudforce-one/threat-events/indicator-types.ts index 99e5ccc453..030839110f 100644 --- a/src/resources/cloudforce-one/threat-events/indicator-types.ts +++ b/src/resources/cloudforce-one/threat-events/indicator-types.ts @@ -1,5 +1,46 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; -export class IndicatorTypes extends APIResource {} +export class IndicatorTypes extends APIResource { + /** + * This Method is deprecated. Please use /events/dataset/:dataset_id/indicatorTypes + * instead. + * + * @deprecated + */ + list( + params: IndicatorTypeListParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.get(`/accounts/${account_id}/cloudforce-one/events/indicatorTypes`, options); + } +} + +export interface IndicatorTypeListResponse { + items: IndicatorTypeListResponse.Items; + + type: string; +} + +export namespace IndicatorTypeListResponse { + export interface Items { + type: string; + } +} + +export interface IndicatorTypeListParams { + /** + * Account ID. + */ + account_id: string; +} + +export declare namespace IndicatorTypes { + export { + type IndicatorTypeListResponse as IndicatorTypeListResponse, + type IndicatorTypeListParams as IndicatorTypeListParams, + }; +} diff --git a/src/resources/cloudforce-one/threat-events/threat-events.ts b/src/resources/cloudforce-one/threat-events/threat-events.ts index 87dd60711b..8ad50fe4a8 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -31,7 +31,7 @@ import { EventTags, } from './event-tags'; import * as IndicatorTypesAPI from './indicator-types'; -import { IndicatorTypes } from './indicator-types'; +import { IndicatorTypeListParams, IndicatorTypeListResponse, IndicatorTypes } from './indicator-types'; import * as InsightsAPI from './insights'; import { Insights } from './insights'; import * as RawAPI from './raw'; @@ -207,6 +207,21 @@ export class ThreatEvents extends APIResource { ...options, }); } + + /** + * This Method is deprecated. Please use + * /events/dataset/:dataset_id/events/:event_id instead. + * + * @deprecated + */ + get( + eventId: string, + params: ThreatEventGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.get(`/accounts/${account_id}/cloudforce-one/events/${eventId}`, options); + } } export interface ThreatEventCreateResponse { @@ -372,6 +387,56 @@ export interface ThreatEventEditResponse { releasabilityId?: string; } +export interface ThreatEventGetResponse { + attacker: string; + + attackerCountry: string; + + category: string; + + date: string; + + event: string; + + indicator: string; + + indicatorType: string; + + indicatorTypeId: number; + + killChain: number; + + mitreAttack: Array; + + numReferenced: number; + + numReferences: number; + + rawId: string; + + referenced: Array; + + referencedIds: Array; + + references: Array; + + referencesIds: Array; + + tags: Array; + + targetCountry: string; + + targetIndustry: string; + + tlp: string; + + uuid: string; + + insight?: string; + + releasabilityId?: string; +} + export interface ThreatEventCreateParams { /** * Path param: Account ID. @@ -673,6 +738,13 @@ export namespace ThreatEventEditParams { } } +export interface ThreatEventGetParams { + /** + * Account ID. + */ + account_id: string; +} + ThreatEvents.Attackers = Attackers; ThreatEvents.Categories = Categories; ThreatEvents.Countries = Countries; @@ -693,11 +765,13 @@ export declare namespace ThreatEvents { type ThreatEventDeleteResponse as ThreatEventDeleteResponse, type ThreatEventBulkCreateResponse as ThreatEventBulkCreateResponse, type ThreatEventEditResponse as ThreatEventEditResponse, + type ThreatEventGetResponse as ThreatEventGetResponse, type ThreatEventCreateParams as ThreatEventCreateParams, type ThreatEventListParams as ThreatEventListParams, type ThreatEventDeleteParams as ThreatEventDeleteParams, type ThreatEventBulkCreateParams as ThreatEventBulkCreateParams, type ThreatEventEditParams as ThreatEventEditParams, + type ThreatEventGetParams as ThreatEventGetParams, }; export { @@ -742,7 +816,11 @@ export declare namespace ThreatEvents { type DatasetRawParams as DatasetRawParams, }; - export { IndicatorTypes as IndicatorTypes }; + export { + IndicatorTypes as IndicatorTypes, + type IndicatorTypeListResponse as IndicatorTypeListResponse, + type IndicatorTypeListParams as IndicatorTypeListParams, + }; export { RawAPIRaw as Raw, diff --git a/src/resources/rulesets/rules.ts b/src/resources/rulesets/rules.ts index 230322ad70..3cca8dc4a5 100644 --- a/src/resources/rulesets/rules.ts +++ b/src/resources/rulesets/rules.ts @@ -5885,7 +5885,8 @@ export namespace SetConfigRule { hotlink_protection?: boolean; /** - * Whether to enable Mirage. + * @deprecated Mirage is deprecated. More information at + * https://developers.cloudflare.com/speed/optimization/images/mirage/. */ mirage?: boolean; @@ -6122,7 +6123,8 @@ export namespace SetConfigRuleParam { hotlink_protection?: boolean; /** - * Whether to enable Mirage. + * @deprecated Mirage is deprecated. More information at + * https://developers.cloudflare.com/speed/optimization/images/mirage/. */ mirage?: boolean; @@ -11403,7 +11405,8 @@ export declare namespace RuleCreateParams { hotlink_protection?: boolean; /** - * Whether to enable Mirage. + * @deprecated Mirage is deprecated. More information at + * https://developers.cloudflare.com/speed/optimization/images/mirage/. */ mirage?: boolean; @@ -15595,7 +15598,8 @@ export declare namespace RuleEditParams { hotlink_protection?: boolean; /** - * Whether to enable Mirage. + * @deprecated Mirage is deprecated. More information at + * https://developers.cloudflare.com/speed/optimization/images/mirage/. */ mirage?: boolean; diff --git a/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts b/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts new file mode 100644 index 0000000000..9bd29bee68 --- /dev/null +++ b/tests/api-resources/cloudforce-one/threat-events/indicator-types.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 indicatorTypes', () => { + // TODO: HTTP 401 from prism + test.skip('list: only required params', async () => { + const responsePromise = client.cloudforceOne.threatEvents.indicatorTypes.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); + }); + + // TODO: HTTP 401 from prism + test.skip('list: required and optional params', async () => { + const response = await client.cloudforceOne.threatEvents.indicatorTypes.list({ + 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 68105203c4..694b31d176 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 @@ -179,4 +179,21 @@ describe('resource threatEvents', () => { tlp: 'amber', }); }); + + // TODO: HTTP 401 from prism + test.skip('get: only required params', async () => { + const responsePromise = client.cloudforceOne.threatEvents.get('event_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.get('event_id', { account_id: 'account_id' }); + }); }); From 8267da17e46d3fcdd2e09ec517d5c28b573e256e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Oct 2025 15:22:39 +0000 Subject: [PATCH 286/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0951afe38e..61e6ea47eb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1859 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ff0a3f42ea21b040e9bbddbe548b9ce8ada7133f171cfec847b1757b84e6c2cd.yml -openapi_spec_hash: d0ce24cbb42173ac9a438105e88a292b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-183f02e6e260ed61a48914917bf37884af04c54306709f2a111c72c9beb224f9.yml +openapi_spec_hash: 6c8c8ec5c3b2a86d66b6599fec576d51 config_hash: e16fca6aff930b2279d586d92022f7d1 From 07a290c3490aa21a6a133190e8eda48ecc7e5923 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Oct 2025 15:24:39 +0000 Subject: [PATCH 287/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 61e6ea47eb..b85b2cd821 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1859 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-183f02e6e260ed61a48914917bf37884af04c54306709f2a111c72c9beb224f9.yml -openapi_spec_hash: 6c8c8ec5c3b2a86d66b6599fec576d51 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7e834cd40bb339e3ba6df77eb65ed47198e3757d2f60e5dbc7c305f90506a2a2.yml +openapi_spec_hash: b43f3a9b9f5ed686237f866a479a0d13 config_hash: e16fca6aff930b2279d586d92022f7d1 From bd836c81d444bb4bedb6f2229c7d36031e41755c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Oct 2025 15:28:24 +0000 Subject: [PATCH 288/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b85b2cd821..61e6ea47eb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1859 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7e834cd40bb339e3ba6df77eb65ed47198e3757d2f60e5dbc7c305f90506a2a2.yml -openapi_spec_hash: b43f3a9b9f5ed686237f866a479a0d13 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-183f02e6e260ed61a48914917bf37884af04c54306709f2a111c72c9beb224f9.yml +openapi_spec_hash: 6c8c8ec5c3b2a86d66b6599fec576d51 config_hash: e16fca6aff930b2279d586d92022f7d1 From 14411b37b7750f07b7988d6dd1e7b80fcf212978 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Oct 2025 15:40:05 +0000 Subject: [PATCH 289/451] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 205 +-- scripts/detect-breaking-changes | 20 - src/resources/abuse-reports.ts | 886 +--------- src/resources/accounts/accounts.ts | 30 - src/resources/api-gateway/api-gateway.ts | 2 + src/resources/api-gateway/configurations.ts | 43 +- src/resources/api-gateway/index.ts | 1 + .../cloudforce-one/threat-events/index.ts | 6 +- .../threat-events/indicator-types.ts | 43 +- .../threat-events/threat-events.ts | 19 +- src/resources/custom-pages.ts | 48 +- src/resources/dns/records.ts | 88 +- 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 | 139 +- src/resources/kv/namespaces/metadata.ts | 4 +- src/resources/kv/namespaces/namespaces.ts | 164 +- src/resources/kv/namespaces/values.ts | 33 +- .../leaked-credential-checks/detections.ts | 240 +-- .../leaked-credential-checks/index.ts | 13 +- .../leaked-credential-checks.ts | 121 +- 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 +- .../connectors/snapshots/latest.ts | 22 - .../connectors/snapshots/snapshots.ts | 22 - src/resources/organizations/organizations.ts | 16 +- src/resources/queues/consumers.ts | 35 - src/resources/queues/index.ts | 21 +- src/resources/queues/messages.ts | 217 +-- src/resources/queues/queues.ts | 44 +- src/resources/queues/subscriptions.ts | 1043 +---------- .../r2/buckets/event-notifications.ts | 7 +- src/resources/radar/ai/bots/summary.ts | 2 +- src/resources/radar/ai/inference/summary.ts | 4 +- .../ai/inference/timeseries-groups/summary.ts | 4 +- src/resources/radar/ai/timeseries-groups.ts | 2 +- src/resources/radar/as112/summary.ts | 12 +- .../radar/as112/timeseries-groups.ts | 12 +- src/resources/radar/attacks/layer3/summary.ts | 14 +- .../radar/attacks/layer3/timeseries-groups.ts | 14 +- src/resources/radar/attacks/layer3/top/top.ts | 4 +- src/resources/radar/attacks/layer7/summary.ts | 14 +- .../radar/attacks/layer7/timeseries-groups.ts | 14 +- src/resources/radar/attacks/layer7/top/top.ts | 4 +- src/resources/radar/ct/logs.ts | 23 - src/resources/radar/dns/summary.ts | 20 +- src/resources/radar/dns/timeseries-groups.ts | 20 +- src/resources/radar/email/routing/summary.ts | 12 +- .../radar/email/routing/timeseries-groups.ts | 12 +- src/resources/radar/email/security/summary.ts | 18 +- .../radar/email/security/timeseries-groups.ts | 18 +- src/resources/radar/http/summary.ts | 16 +- src/resources/radar/http/timeseries-groups.ts | 20 +- src/resources/radar/http/top.ts | 11 +- .../radar/leaked-credentials/summary.ts | 4 +- .../leaked-credentials/timeseries-groups.ts | 4 +- src/resources/rulesets/rules.ts | 20 +- src/resources/secrets-store/stores/secrets.ts | 4 +- .../dispatch/namespaces/scripts/bindings.ts | 18 + .../dispatch/namespaces/scripts/scripts.ts | 18 + .../dispatch/namespaces/scripts/settings.ts | 54 + .../workers/beta/workers/versions.ts | 36 + src/resources/workers/observability/index.ts | 12 +- .../workers/observability/observability.ts | 26 +- .../workers/observability/telemetry.ts | 1538 +---------------- .../scripts/script-and-version-settings.ts | 54 + src/resources/workers/scripts/scripts.ts | 18 + src/resources/workers/scripts/versions.ts | 54 + src/resources/workflows/index.ts | 23 +- src/resources/workflows/instances/events.ts | 40 +- src/resources/workflows/instances/index.ts | 18 +- .../workflows/instances/instances.ts | 416 +---- src/resources/workflows/instances/status.ts | 54 +- src/resources/workflows/versions.ts | 87 +- src/resources/workflows/workflows.ts | 274 +-- .../access/applications/applications.ts | 637 ++----- .../zero-trust/access/logs/access-requests.ts | 19 - .../connectivity/directory/directory.ts | 11 - .../connectivity/directory/index.ts | 5 - .../connectivity/directory/services.ts | 561 +----- src/resources/zero-trust/devices/dex-tests.ts | 80 +- .../zero-trust/devices/posture/posture.ts | 4 +- src/resources/zero-trust/dex/colos.ts | 17 +- src/resources/zero-trust/dex/dex.ts | 5 + .../dex/fleet-status/fleet-status.ts | 75 +- .../zero-trust/dex/fleet-status/index.ts | 1 + src/resources/zero-trust/dex/index.ts | 1 + .../zero-trust/dlp/entries/custom.ts | 3 +- .../zero-trust/dlp/entries/entries.ts | 3 +- .../gateway/configurations/configurations.ts | 44 +- src/resources/zero-trust/gateway/rules.ts | 58 +- tests/api-resources/abuse-reports.test.ts | 69 - tests/api-resources/accounts/accounts.test.ts | 1 - .../api-gateway/configurations.test.ts | 1 + .../threat-events/indicator-types.test.ts | 33 - .../api-resources/kv/namespaces/keys.test.ts | 31 +- .../kv/namespaces/namespaces.test.ts | 33 +- .../kv/namespaces/values.test.ts | 3 +- .../detections.test.ts | 98 -- .../leaked-credential-checks.test.ts | 49 - .../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/consumers.test.ts | 23 - tests/api-resources/queues/messages.test.ts | 43 - .../queues/subscriptions.test.ts | 120 -- .../r2/buckets/event-notifications.test.ts | 1 - .../secrets-store/stores/secrets.test.ts | 18 +- .../workers/observability/telemetry.test.ts | 110 -- .../workflows/instances/events.test.ts | 32 - .../workflows/instances/instances.test.ts | 89 - .../workflows/instances/status.test.ts | 33 - .../api-resources/workflows/versions.test.ts | 50 - .../api-resources/workflows/workflows.test.ts | 85 - .../access/applications/applications.test.ts | 2 - .../access/logs/access-requests.test.ts | 3 - .../connectivity/directory/services.test.ts | 33 +- .../zero-trust/devices/dex-tests.test.ts | 8 +- .../zero-trust/dlp/entries/custom.test.ts | 1 + .../zero-trust/dlp/entries/entries.test.ts | 1 + 134 files changed, 1140 insertions(+), 8647 deletions(-) delete mode 100644 tests/api-resources/abuse-reports.test.ts delete mode 100644 tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts delete mode 100644 tests/api-resources/leaked-credential-checks/detections.test.ts delete mode 100644 tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts 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/queues/subscriptions.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 61e6ea47eb..0e8705a64d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1859 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-183f02e6e260ed61a48914917bf37884af04c54306709f2a111c72c9beb224f9.yml -openapi_spec_hash: 6c8c8ec5c3b2a86d66b6599fec576d51 +configured_endpoints: 1819 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cceecd20dfd89884f795e75b433848994bed610b79802c65104f0c70d3ada54e.yml +openapi_spec_hash: c33c0e26e48c004c1781a36748d0144c config_hash: e16fca6aff930b2279d586d92022f7d1 diff --git a/api.md b/api.md index 112ba46fbe..21fa3e261f 100644 --- a/api.md +++ b/api.md @@ -129,14 +129,13 @@ Methods: Types: - Organization -- OrganizationDeleteResponse Methods: - client.organizations.create({ ...params }) -> Organization - client.organizations.update(organizationId, { ...params }) -> Organization - client.organizations.list({ ...params }) -> OrganizationsSinglePage -- client.organizations.delete(organizationId) -> OrganizationDeleteResponse +- client.organizations.delete(organizationId) -> void - client.organizations.get(organizationId) -> Organization ## OrganizationProfile @@ -1741,61 +1740,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: @@ -2285,18 +2239,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 @@ -2304,19 +2246,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 @@ -2326,14 +2267,12 @@ Types: - Key - KeyBulkDeleteResponse -- KeyBulkGetResponse - KeyBulkUpdateResponse Methods: - 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 ### Metadata @@ -2402,16 +2341,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 @@ -2437,26 +2372,9 @@ Methods: - 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 ## Subscriptions -Types: - -- SubscriptionCreateResponse -- SubscriptionUpdateResponse -- SubscriptionListResponse -- SubscriptionDeleteResponse -- SubscriptionGetResponse - -Methods: - -- client.queues.subscriptions.create({ ...params }) -> SubscriptionCreateResponse -- client.queues.subscriptions.update(subscriptionId, { ...params }) -> SubscriptionUpdateResponse -- client.queues.subscriptions.list({ ...params }) -> SubscriptionListResponsesV4PagePaginationArray -- client.queues.subscriptions.delete(subscriptionId, { ...params }) -> SubscriptionDeleteResponse -- client.queues.subscriptions.get(subscriptionId, { ...params }) -> SubscriptionGetResponse - # APIGateway ## Configurations @@ -2464,10 +2382,11 @@ Methods: Types: - Configuration +- ConfigurationUpdateResponse Methods: -- client.apiGateway.configurations.update({ ...params }) -> Configuration +- client.apiGateway.configurations.update({ ...params }) -> ConfigurationUpdateResponse - client.apiGateway.configurations.get({ ...params }) -> Configuration ## Discovery @@ -5513,11 +5432,12 @@ Types: - LiveStat - FleetStatusLiveResponse +- FleetStatusOverTimeResponse Methods: - client.zeroTrust.dex.fleetStatus.live({ ...params }) -> FleetStatusLiveResponse -- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> void +- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> FleetStatusOverTimeResponse #### Devices @@ -5721,20 +5641,13 @@ Methods: #### Services -Types: - -- ServiceCreateResponse -- ServiceUpdateResponse -- ServiceListResponse -- ServiceGetResponse - Methods: -- client.zeroTrust.connectivity.directory.services.create({ ...params }) -> ServiceCreateResponse -- client.zeroTrust.connectivity.directory.services.update(serviceId, { ...params }) -> ServiceUpdateResponse -- client.zeroTrust.connectivity.directory.services.list({ ...params }) -> ServiceListResponsesV4PagePaginationArray +- client.zeroTrust.connectivity.directory.services.create({ ...params }) -> void +- client.zeroTrust.connectivity.directory.services.update(serviceId, { ...params }) -> void +- client.zeroTrust.connectivity.directory.services.list({ ...params }) -> void - client.zeroTrust.connectivity.directory.services.delete(serviceId, { ...params }) -> void -- client.zeroTrust.connectivity.directory.services.get(serviceId, { ...params }) -> ServiceGetResponse +- client.zeroTrust.connectivity.directory.services.get(serviceId, { ...params }) -> void ## DLP @@ -8224,14 +8137,6 @@ Methods: ### IndicatorTypes -Types: - -- IndicatorTypeListResponse - -Methods: - -- client.cloudforceOne.threatEvents.indicatorTypes.list({ ...params }) -> IndicatorTypeListResponse - ### Raw Types: @@ -8504,68 +8409,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: @@ -8620,32 +8471,8 @@ Methods: # LeakedCredentialChecks -Types: - -- LeakedCredentialCheckCreateResponse -- LeakedCredentialCheckGetResponse - -Methods: - -- client.leakedCredentialChecks.create({ ...params }) -> LeakedCredentialCheckCreateResponse -- client.leakedCredentialChecks.get({ ...params }) -> LeakedCredentialCheckGetResponse - ## Detections -Types: - -- DetectionCreateResponse -- DetectionUpdateResponse -- DetectionListResponse -- DetectionDeleteResponse - -Methods: - -- client.leakedCredentialChecks.detections.create({ ...params }) -> DetectionCreateResponse -- client.leakedCredentialChecks.detections.update(detectionId, { ...params }) -> DetectionUpdateResponse -- client.leakedCredentialChecks.detections.list({ ...params }) -> DetectionListResponsesSinglePage -- client.leakedCredentialChecks.detections.delete(detectionId, { ...params }) -> DetectionDeleteResponse - # ContentScanning Types: @@ -8690,14 +8517,6 @@ Methods: # AbuseReports -Types: - -- AbuseReportCreateResponse - -Methods: - -- client.abuseReports.create(reportParam, { ...params }) -> AbuseReportCreateResponse - # AI Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 93ee379c25..4a26d167be 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -145,14 +145,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 @@ -193,8 +185,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 @@ -207,7 +197,6 @@ TEST_PATHS=( tests/api-resources/queues/messages.test.ts tests/api-resources/queues/purge.test.ts tests/api-resources/queues/consumers.test.ts - tests/api-resources/queues/subscriptions.test.ts tests/api-resources/api-gateway/api-gateway.test.ts tests/api-resources/api-gateway/configurations.test.ts tests/api-resources/api-gateway/discovery/discovery.test.ts @@ -690,7 +679,6 @@ TEST_PATHS=( tests/api-resources/cloudforce-one/threat-events/categories.test.ts tests/api-resources/cloudforce-one/threat-events/countries.test.ts tests/api-resources/cloudforce-one/threat-events/datasets/datasets.test.ts - tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts tests/api-resources/cloudforce-one/threat-events/raw.test.ts tests/api-resources/cloudforce-one/threat-events/relate.test.ts tests/api-resources/cloudforce-one/threat-events/tags.test.ts @@ -714,20 +702,12 @@ 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 - tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts - tests/api-resources/leaked-credential-checks/detections.test.ts tests/api-resources/content-scanning/content-scanning.test.ts tests/api-resources/content-scanning/payloads.test.ts tests/api-resources/content-scanning/settings.test.ts - tests/api-resources/abuse-reports.test.ts tests/api-resources/ai/ai.test.ts tests/api-resources/ai/finetunes/finetunes.test.ts tests/api-resources/ai/finetunes/assets.test.ts diff --git a/src/resources/abuse-reports.ts b/src/resources/abuse-reports.ts index 16775672c3..2a55a7e639 100644 --- a/src/resources/abuse-reports.ts +++ b/src/resources/abuse-reports.ts @@ -1,889 +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 AbuseReports extends APIResource { - /** - * Submit the Abuse Report of a particular type - */ - create( - reportParam: string, - params: AbuseReportCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/abuse-reports/${reportParam}`, { - body, - ...options, - }) as Core.APIPromise<{ result: AbuseReportCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -/** - * The result should be 'success' for successful response - */ -export type AbuseReportCreateResponse = string; - -export type AbuseReportCreateParams = - | AbuseReportCreateParams.AbuseReportsDmcaReport - | AbuseReportCreateParams.AbuseReportsTrademarkReport - | AbuseReportCreateParams.AbuseReportsGeneralReport - | AbuseReportCreateParams.AbuseReportsPhishingReport - | AbuseReportCreateParams.AbuseReportsCsamReport - | AbuseReportCreateParams.AbuseReportsThreatReport - | AbuseReportCreateParams.AbuseReportsRegistrarWhoisReport - | AbuseReportCreateParams.AbuseReportsNcseiReport; - -export declare namespace AbuseReportCreateParams { - export interface AbuseReportsDmcaReport { - /** - * Path param: Cloudflare Account ID - */ - account_id: string; - - /** - * Body param: The report type for submitted reports. - */ - act: 'abuse_dmca'; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - address1: string; - - /** - * Body param: The name of the copyright holder. Text not exceeding 60 characters. - * This field may be released by Cloudflare to third parties such as the Lumen - * Database (https://lumendatabase.org/). - */ - agent_name: string; - - /** - * Body param: Can be `0` for false or `1` for true. Must be value: 1 for DMCA - * reports - */ - agree: 1; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - city: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - country: string; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send'; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - original_work: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send'; - - /** - * Body param: Required for DMCA reports, should be same as Name. An affirmation - * that all information in the report is true and accurate while agreeing to the - * policies of Cloudflare's abuse reports - */ - signature: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - state: string; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsTrademarkReport { - /** - * Path param: Cloudflare Account ID - */ - account_id: string; - - /** - * Body param: The report type for submitted reports. - */ - act: 'abuse_trademark'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send'; - - /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters. - */ - justification: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send'; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_number: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_office: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_symbol: string; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsGeneralReport { - /** - * Path param: Cloudflare Account ID - */ - account_id: string; - - /** - * Body param: The report type for submitted reports. - */ - act: 'abuse_general'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon'; - - /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters. - */ - justification: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon' | 'none'; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: A list of IP addresses separated by ‘\n’ (new line character). The - * list of destination IPs should not exceed 30 IP addresses. Each one of the IP - * addresses ought to be unique. - */ - destination_ips?: string; - - /** - * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. - * The total size of the field should not exceed 2000 characters. Each individual - * port/protocol should not exceed 100 characters. The list should not have more - * than 30 unique ports and protocols. - */ - ports_protocols?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: A list of IP addresses separated by ‘\n’ (new line character). The - * list of source IPs should not exceed 30 IP addresses. Each one of the IP - * addresses ought to be unique. - */ - source_ips?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsPhishingReport { - /** - * Path param: Cloudflare Account ID - */ - account_id: string; - - /** - * Body param: The report type for submitted reports. - */ - act: 'abuse_phishing'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon'; - - /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters. - */ - justification: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon'; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - original_work?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsCsamReport { - /** - * Path param: Cloudflare Account ID - */ - account_id: string; - - /** - * Body param: The report type for submitted reports. - */ - act: 'abuse_children'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon'; - - /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters. - */ - justification: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - ncmec_notification: 'send' | 'send-anon'; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon' | 'none'; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - country?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsThreatReport { - /** - * Path param: Cloudflare Account ID - */ - account_id: string; - - /** - * Body param: The report type for submitted reports. - */ - act: 'abuse_threat'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon'; - - /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters. - */ - justification: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon'; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsRegistrarWhoisReport { - /** - * Path param: Cloudflare Account ID - */ - account_id: string; - - /** - * Body param: The report type for submitted reports. - */ - act: 'abuse_registrar_whois'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon' | 'none'; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } - - export interface AbuseReportsNcseiReport { - /** - * Path param: Cloudflare Account ID - */ - account_id: string; - - /** - * Body param: The report type for submitted reports. - */ - act: 'abuse_ncsei'; - - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon'; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name: string; - - /** - * Body param: If the submitter is the target of NCSEI in the URLs of the abuse - * report. - */ - ncsei_subject_representation: boolean; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon' | 'none'; - - /** - * Body param: A list of valid URLs separated by ‘\n’ (new line character). The - * list of the URLs should not exceed 250 URLs. All URLs should have the same - * hostname. Each URL should be unique. This field may be released by Cloudflare to - * third parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - country?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: Text not exceeding 20 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - } -} - -export declare namespace AbuseReports { - export { - type AbuseReportCreateResponse as AbuseReportCreateResponse, - type AbuseReportCreateParams as AbuseReportCreateParams, - }; -} +export class AbuseReports extends APIResource {} diff --git a/src/resources/accounts/accounts.ts b/src/resources/accounts/accounts.ts index 332d3d488d..1f17f46efb 100644 --- a/src/resources/accounts/accounts.ts +++ b/src/resources/accounts/accounts.ts @@ -175,11 +175,6 @@ export interface Account { */ created_on?: string; - /** - * Parent container details - */ - managed_by?: Account.ManagedBy; - /** * Account settings */ @@ -187,21 +182,6 @@ export interface Account { } export namespace Account { - /** - * Parent container details - */ - export interface ManagedBy { - /** - * ID of the parent Organization, if one exists - */ - parent_org_id?: string; - - /** - * Name of the parent Organization, if one exists - */ - parent_org_name?: string; - } - /** * Account settings */ @@ -277,11 +257,6 @@ export interface AccountUpdateParams { */ type: 'standard' | 'enterprise'; - /** - * Body param: Parent container details - */ - managed_by?: AccountUpdateParams.ManagedBy; - /** * Body param: Account settings */ @@ -289,11 +264,6 @@ export interface AccountUpdateParams { } export namespace AccountUpdateParams { - /** - * Parent container details - */ - export interface ManagedBy {} - /** * Account settings */ diff --git a/src/resources/api-gateway/api-gateway.ts b/src/resources/api-gateway/api-gateway.ts index 701ac67835..1f9fb727e9 100644 --- a/src/resources/api-gateway/api-gateway.ts +++ b/src/resources/api-gateway/api-gateway.ts @@ -6,6 +6,7 @@ import { Configuration, ConfigurationGetParams, ConfigurationUpdateParams, + ConfigurationUpdateResponse, Configurations, } from './configurations'; import * as SchemasAPI from './schemas'; @@ -81,6 +82,7 @@ export declare namespace APIGateway { export { Configurations as Configurations, type Configuration as Configuration, + type ConfigurationUpdateResponse as ConfigurationUpdateResponse, type ConfigurationUpdateParams as ConfigurationUpdateParams, type ConfigurationGetParams as ConfigurationGetParams, }; diff --git a/src/resources/api-gateway/configurations.ts b/src/resources/api-gateway/configurations.ts index 5082ea818a..5659e51452 100644 --- a/src/resources/api-gateway/configurations.ts +++ b/src/resources/api-gateway/configurations.ts @@ -2,10 +2,11 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; +import * as UserSchemasAPI from './user-schemas/user-schemas'; export class Configurations extends APIResource { /** - * Update configuration properties + * Set configuration properties * * @example * ```ts @@ -18,14 +19,12 @@ export class Configurations extends APIResource { * }); * ``` */ - update(params: ConfigurationUpdateParams, options?: Core.RequestOptions): Core.APIPromise { + update( + params: ConfigurationUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { const { zone_id, ...body } = params; - return ( - this._client.put(`/zones/${zone_id}/api_gateway/configuration`, { - body, - ...options, - }) as Core.APIPromise<{ result: Configuration }> - )._thenUnwrap((obj) => obj.result); + return this._client.put(`/zones/${zone_id}/api_gateway/configuration`, { body, ...options }); } /** @@ -40,11 +39,12 @@ export class Configurations extends APIResource { * ``` */ get(params: ConfigurationGetParams, options?: Core.RequestOptions): Core.APIPromise { - const { zone_id } = params; + const { zone_id, ...query } = params; return ( - this._client.get(`/zones/${zone_id}/api_gateway/configuration`, options) as Core.APIPromise<{ - result: Configuration; - }> + this._client.get(`/zones/${zone_id}/api_gateway/configuration`, { + query, + ...options, + }) as Core.APIPromise<{ result: Configuration }> )._thenUnwrap((obj) => obj.result); } } @@ -93,6 +93,17 @@ export namespace Configuration { } } +export interface ConfigurationUpdateResponse { + errors: UserSchemasAPI.Message; + + messages: UserSchemasAPI.Message; + + /** + * Whether the API call was successful. + */ + success: true; +} + export interface ConfigurationUpdateParams { /** * Path param: Identifier. @@ -148,14 +159,20 @@ export namespace ConfigurationUpdateParams { export interface ConfigurationGetParams { /** - * Identifier. + * Path param: Identifier. */ zone_id: string; + + /** + * Query param: Requests information about certain properties. + */ + properties?: Array<'auth_id_characteristics'>; } export declare namespace Configurations { export { type Configuration as Configuration, + type ConfigurationUpdateResponse as ConfigurationUpdateResponse, type ConfigurationUpdateParams as ConfigurationUpdateParams, type ConfigurationGetParams as ConfigurationGetParams, }; diff --git a/src/resources/api-gateway/index.ts b/src/resources/api-gateway/index.ts index 485f8290f8..5941af87f3 100644 --- a/src/resources/api-gateway/index.ts +++ b/src/resources/api-gateway/index.ts @@ -4,6 +4,7 @@ export { APIGateway } from './api-gateway'; export { Configurations, type Configuration, + type ConfigurationUpdateResponse, type ConfigurationUpdateParams, type ConfigurationGetParams, } from './configurations'; diff --git a/src/resources/cloudforce-one/threat-events/index.ts b/src/resources/cloudforce-one/threat-events/index.ts index 02c8bab160..d797682ddd 100644 --- a/src/resources/cloudforce-one/threat-events/index.ts +++ b/src/resources/cloudforce-one/threat-events/index.ts @@ -36,11 +36,7 @@ export { type EventTagCreateParams, type EventTagDeleteParams, } from './event-tags'; -export { - IndicatorTypes, - type IndicatorTypeListResponse, - type IndicatorTypeListParams, -} from './indicator-types'; +export { IndicatorTypes } from './indicator-types'; export { Insights } from './insights'; export { Raw, type RawEditResponse, type RawGetResponse, type RawEditParams, type RawGetParams } from './raw'; export { Relate, type RelateDeleteResponse, type RelateDeleteParams } from './relate'; diff --git a/src/resources/cloudforce-one/threat-events/indicator-types.ts b/src/resources/cloudforce-one/threat-events/indicator-types.ts index 030839110f..99e5ccc453 100644 --- a/src/resources/cloudforce-one/threat-events/indicator-types.ts +++ b/src/resources/cloudforce-one/threat-events/indicator-types.ts @@ -1,46 +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 IndicatorTypes extends APIResource { - /** - * This Method is deprecated. Please use /events/dataset/:dataset_id/indicatorTypes - * instead. - * - * @deprecated - */ - list( - params: IndicatorTypeListParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return this._client.get(`/accounts/${account_id}/cloudforce-one/events/indicatorTypes`, options); - } -} - -export interface IndicatorTypeListResponse { - items: IndicatorTypeListResponse.Items; - - type: string; -} - -export namespace IndicatorTypeListResponse { - export interface Items { - type: string; - } -} - -export interface IndicatorTypeListParams { - /** - * Account ID. - */ - account_id: string; -} - -export declare namespace IndicatorTypes { - export { - type IndicatorTypeListResponse as IndicatorTypeListResponse, - type IndicatorTypeListParams as IndicatorTypeListParams, - }; -} +export class IndicatorTypes 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 8ad50fe4a8..d23c37b5db 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -31,7 +31,7 @@ import { EventTags, } from './event-tags'; import * as IndicatorTypesAPI from './indicator-types'; -import { IndicatorTypeListParams, IndicatorTypeListResponse, IndicatorTypes } from './indicator-types'; +import { IndicatorTypes } from './indicator-types'; import * as InsightsAPI from './insights'; import { Insights } from './insights'; import * as RawAPI from './raw'; @@ -209,10 +209,15 @@ export class ThreatEvents extends APIResource { } /** - * This Method is deprecated. Please use - * /events/dataset/:dataset_id/events/:event_id instead. + * Reads an event * - * @deprecated + * @example + * ```ts + * const threatEvent = + * await client.cloudforceOne.threatEvents.get('event_id', { + * account_id: 'account_id', + * }); + * ``` */ get( eventId: string, @@ -816,11 +821,7 @@ export declare namespace ThreatEvents { type DatasetRawParams as DatasetRawParams, }; - export { - IndicatorTypes as IndicatorTypes, - type IndicatorTypeListResponse as IndicatorTypeListResponse, - type IndicatorTypeListParams as IndicatorTypeListParams, - }; + export { IndicatorTypes as IndicatorTypes }; export { RawAPIRaw as Raw, diff --git a/src/resources/custom-pages.ts b/src/resources/custom-pages.ts index 6bd1b13cf7..4c861b1e41 100644 --- a/src/resources/custom-pages.ts +++ b/src/resources/custom-pages.ts @@ -24,13 +24,15 @@ export class CustomPages extends APIResource { */ update( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params: CustomPageUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { @@ -123,36 +125,42 @@ export class CustomPages extends APIResource { */ get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params?: CustomPageGetParams, options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params: CustomPageGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { diff --git a/src/resources/dns/records.ts b/src/resources/dns/records.ts index b3eb5c6bb2..0a09cf3cb4 100644 --- a/src/resources/dns/records.ts +++ b/src/resources/dns/records.ts @@ -3701,30 +3701,30 @@ export namespace Record { } export type RecordResponse = - | RecordResponse.A - | RecordResponse.AAAA - | RecordResponse.CNAME - | RecordResponse.MX - | RecordResponse.NS - | RecordResponse.Openpgpkey - | RecordResponse.PTR - | RecordResponse.TXT - | RecordResponse.CAA - | RecordResponse.CERT - | RecordResponse.DNSKEY - | RecordResponse.DS - | RecordResponse.HTTPS - | RecordResponse.LOC - | RecordResponse.NAPTR - | RecordResponse.SMIMEA - | RecordResponse.SRV - | RecordResponse.SSHFP - | RecordResponse.SVCB - | RecordResponse.TLSA - | RecordResponse.URI; + | RecordResponse.ARecord + | RecordResponse.AAAARecord + | RecordResponse.CNAMERecord + | RecordResponse.MXRecord + | RecordResponse.NSRecord + | RecordResponse.OpenpgpkeyRecord + | RecordResponse.PTRRecord + | RecordResponse.TXTRecord + | RecordResponse.CAARecord + | RecordResponse.CERTRecord + | RecordResponse.DNSKEYRecord + | RecordResponse.DSRecord + | RecordResponse.HTTPSRecord + | RecordResponse.LOCRecord + | RecordResponse.NAPTRRecord + | RecordResponse.SMIMEARecord + | RecordResponse.SRVRecord + | RecordResponse.SSHFPRecord + | RecordResponse.SVCBRecord + | RecordResponse.TLSARecord + | RecordResponse.URIRecord; export namespace RecordResponse { - export interface A extends RecordsAPI.ARecord { + export interface ARecord extends RecordsAPI.ARecord { /** * Identifier. */ @@ -3761,7 +3761,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface AAAA extends RecordsAPI.AAAARecord { + export interface AAAARecord extends RecordsAPI.AAAARecord { /** * Identifier. */ @@ -3798,7 +3798,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface CNAME extends RecordsAPI.CNAMERecord { + export interface CNAMERecord extends RecordsAPI.CNAMERecord { /** * Identifier. */ @@ -3835,7 +3835,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface MX extends RecordsAPI.MXRecord { + export interface MXRecord extends RecordsAPI.MXRecord { /** * Identifier. */ @@ -3872,7 +3872,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface NS extends RecordsAPI.NSRecord { + export interface NSRecord extends RecordsAPI.NSRecord { /** * Identifier. */ @@ -3909,7 +3909,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface Openpgpkey { + export interface OpenpgpkeyRecord { /** * Identifier. */ @@ -3960,7 +3960,7 @@ export namespace RecordResponse { /** * Settings for the DNS record. */ - settings: Openpgpkey.Settings; + settings: OpenpgpkeyRecord.Settings; /** * Custom tags for the DNS record. This field has no effect on DNS responses. @@ -3990,7 +3990,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export namespace Openpgpkey { + export namespace OpenpgpkeyRecord { /** * Settings for the DNS record. */ @@ -4013,7 +4013,7 @@ export namespace RecordResponse { } } - export interface PTR extends RecordsAPI.PTRRecord { + export interface PTRRecord extends RecordsAPI.PTRRecord { /** * Identifier. */ @@ -4050,7 +4050,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface TXT extends RecordsAPI.TXTRecord { + export interface TXTRecord extends RecordsAPI.TXTRecord { /** * Identifier. */ @@ -4087,7 +4087,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface CAA extends RecordsAPI.CAARecord { + export interface CAARecord extends RecordsAPI.CAARecord { /** * Identifier. */ @@ -4124,7 +4124,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface CERT extends RecordsAPI.CERTRecord { + export interface CERTRecord extends RecordsAPI.CERTRecord { /** * Identifier. */ @@ -4161,7 +4161,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface DNSKEY extends RecordsAPI.DNSKEYRecord { + export interface DNSKEYRecord extends RecordsAPI.DNSKEYRecord { /** * Identifier. */ @@ -4198,7 +4198,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface DS extends RecordsAPI.DSRecord { + export interface DSRecord extends RecordsAPI.DSRecord { /** * Identifier. */ @@ -4235,7 +4235,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface HTTPS extends RecordsAPI.HTTPSRecord { + export interface HTTPSRecord extends RecordsAPI.HTTPSRecord { /** * Identifier. */ @@ -4272,7 +4272,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface LOC extends RecordsAPI.LOCRecord { + export interface LOCRecord extends RecordsAPI.LOCRecord { /** * Identifier. */ @@ -4309,7 +4309,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface NAPTR extends RecordsAPI.NAPTRRecord { + export interface NAPTRRecord extends RecordsAPI.NAPTRRecord { /** * Identifier. */ @@ -4346,7 +4346,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SMIMEA extends RecordsAPI.SMIMEARecord { + export interface SMIMEARecord extends RecordsAPI.SMIMEARecord { /** * Identifier. */ @@ -4383,7 +4383,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SRV extends RecordsAPI.SRVRecord { + export interface SRVRecord extends RecordsAPI.SRVRecord { /** * Identifier. */ @@ -4420,7 +4420,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SSHFP extends RecordsAPI.SSHFPRecord { + export interface SSHFPRecord extends RecordsAPI.SSHFPRecord { /** * Identifier. */ @@ -4457,7 +4457,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SVCB extends RecordsAPI.SVCBRecord { + export interface SVCBRecord extends RecordsAPI.SVCBRecord { /** * Identifier. */ @@ -4494,7 +4494,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface TLSA extends RecordsAPI.TLSARecord { + export interface TLSARecord extends RecordsAPI.TLSARecord { /** * Identifier. */ @@ -4531,7 +4531,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface URI extends RecordsAPI.URIRecord { + export interface URIRecord extends RecordsAPI.URIRecord { /** * Identifier. */ 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 c581632a76..f8b3034d84 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 138942ad57..a4db89243d 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. @@ -120,12 +99,12 @@ export interface Key { /** * Arbitrary JSON that is associated with a key. */ - metadata?: unknown; + metadata?: { [key: string]: unknown }; } export interface KeyBulkDeleteResponse { /** - * Number of keys successfully updated. + * Number of keys successfully updated */ successful_key_count?: number; @@ -135,49 +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 { - /** - * The metadata associated with the key. - */ - metadata: unknown; - - /** - * The value associated with the key. - */ - 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; @@ -189,27 +128,26 @@ export interface KeyBulkUpdateResponse { export interface KeyListParams extends CursorPaginationAfterParams { /** - * Path param: Identifier. + * 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. + * Query param: The number of keys to return. 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. + * 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; @@ -219,31 +157,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; @@ -256,38 +172,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 }; /** - * Arbitrary JSON that is associated with a key. + * A UTF-8 encoded string to be stored, up to 25 MiB in length. */ - metadata?: unknown; + value?: string; } } @@ -297,12 +214,10 @@ export declare namespace Keys { export { type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, - type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorPaginationAfter as KeysCursorPaginationAfter, 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 927ba8a17d..5e16f872e9 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -37,11 +37,11 @@ export class Metadata extends APIResource { /** * Arbitrary JSON that is associated with a key. */ -export type MetadataGetResponse = unknown; +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 df179e53bb..3ec43aa7c5 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: [{}], * }, * ); * ``` @@ -272,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; @@ -286,49 +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 { - /** - * The metadata associated with the key. - */ - metadata: unknown; - - /** - * The value associated with the key. - */ - 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; @@ -340,7 +270,7 @@ export interface NamespaceBulkUpdateResponse { export interface NamespaceCreateParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -352,7 +282,7 @@ export interface NamespaceCreateParams { export interface NamespaceUpdateParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -364,7 +294,7 @@ export interface NamespaceUpdateParams { export interface NamespaceListParams extends V4PagePaginationArrayParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -381,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; @@ -398,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; @@ -435,44 +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 }; /** - * Arbitrary JSON that is associated with a key. + * A UTF-8 encoded string to be stored, up to 25 MiB in length. */ - metadata?: unknown; + value?: string; } } export interface NamespaceGetParams { /** - * Identifier. + * Identifier */ account_id: string; } @@ -481,14 +390,14 @@ Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; Namespaces.Keys = Keys; Namespaces.KeysCursorPaginationAfter = KeysCursorPaginationAfter; 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, @@ -496,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, }; @@ -505,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, KeysCursorPaginationAfter as KeysCursorPaginationAfter, type KeyListParams as KeyListParams, type KeyBulkDeleteParams as KeyBulkDeleteParams, - type KeyBulkGetParams as KeyBulkGetParams, type KeyBulkUpdateParams as KeyBulkUpdateParams, }; @@ -521,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 49566f425a..1fa5ff39ed 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,8 +38,13 @@ 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, - __multipartSyntax: 'json', ...options }), + Core.maybeMultipartFormRequestOptions({ + query: { expiration, expiration_ttl }, + body, + __multipartSyntax: 'json', + ...options, + headers: { 'Content-Type': '*/*', ...options?.headers }, + }), ) as Core.APIPromise<{ result: ValueUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } @@ -114,42 +120,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: Associates arbitrary JSON data with a key/value pair. - */ - metadata?: unknown; } export interface ValueDeleteParams { /** - * Identifier. + * Identifier */ account_id: string; } export interface ValueGetParams { /** - * Identifier. + * Identifier */ account_id: string; } diff --git a/src/resources/leaked-credential-checks/detections.ts b/src/resources/leaked-credential-checks/detections.ts index ca2e008bd9..2a6de390ad 100644 --- a/src/resources/leaked-credential-checks/detections.ts +++ b/src/resources/leaked-credential-checks/detections.ts @@ -1,243 +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 Detections extends APIResource { - /** - * Create user-defined detection pattern for Leaked Credential Checks. - * - * @example - * ```ts - * const detection = - * await client.leakedCredentialChecks.detections.create({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - create( - params: DetectionCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.post(`/zones/${zone_id}/leaked-credential-checks/detections`, { - body, - ...options, - }) as Core.APIPromise<{ result: DetectionCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Update user-defined detection pattern for Leaked Credential Checks. - * - * @example - * ```ts - * const detection = - * await client.leakedCredentialChecks.detections.update( - * '18a14bafaa8eb1df04ce683ec18c765e', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - update( - detectionId: string, - params: DetectionUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.put(`/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: DetectionUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * List user-defined detection patterns for Leaked Credential Checks. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const detectionListResponse of client.leakedCredentialChecks.detections.list( - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` - */ - list( - params: DetectionListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { zone_id } = params; - return this._client.getAPIList( - `/zones/${zone_id}/leaked-credential-checks/detections`, - DetectionListResponsesSinglePage, - options, - ); - } - - /** - * Remove user-defined detection pattern for Leaked Credential Checks. - * - * @example - * ```ts - * const detection = - * await client.leakedCredentialChecks.detections.delete( - * '18a14bafaa8eb1df04ce683ec18c765e', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - delete( - detectionId: string, - params: DetectionDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id } = params; - return ( - this._client.delete( - `/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, - options, - ) as Core.APIPromise<{ result: DetectionDeleteResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export class DetectionListResponsesSinglePage extends SinglePage {} - -/** - * Defines a custom set of username/password expressions to match Leaked Credential - * Checks on. - */ -export interface DetectionCreateResponse { - /** - * Defines the unique ID for this custom detection. - */ - id?: string; - - /** - * Defines ehe ruleset expression to use in matching the password in a request. - */ - password?: string; - - /** - * Defines the ruleset expression to use in matching the username in a request. - */ - username?: string; -} - -/** - * Defines a custom set of username/password expressions to match Leaked Credential - * Checks on. - */ -export interface DetectionUpdateResponse { - /** - * Defines the unique ID for this custom detection. - */ - id?: string; - - /** - * Defines ehe ruleset expression to use in matching the password in a request. - */ - password?: string; - - /** - * Defines the ruleset expression to use in matching the username in a request. - */ - username?: string; -} - -/** - * Defines a custom set of username/password expressions to match Leaked Credential - * Checks on. - */ -export interface DetectionListResponse { - /** - * Defines the unique ID for this custom detection. - */ - id?: string; - - /** - * Defines ehe ruleset expression to use in matching the password in a request. - */ - password?: string; - - /** - * Defines the ruleset expression to use in matching the username in a request. - */ - username?: string; -} - -export type DetectionDeleteResponse = unknown; - -export interface DetectionCreateParams { - /** - * Path param: Defines an identifier. - */ - zone_id: string; - - /** - * Body param: Defines ehe ruleset expression to use in matching the password in a - * request. - */ - password?: string; - - /** - * Body param: Defines the ruleset expression to use in matching the username in a - * request. - */ - username?: string; -} - -export interface DetectionUpdateParams { - /** - * Path param: Defines an identifier. - */ - zone_id: string; - - /** - * Body param: Defines ehe ruleset expression to use in matching the password in a - * request. - */ - password?: string; - - /** - * Body param: Defines the ruleset expression to use in matching the username in a - * request. - */ - username?: string; -} - -export interface DetectionListParams { - /** - * Defines an identifier. - */ - zone_id: string; -} - -export interface DetectionDeleteParams { - /** - * Defines an identifier. - */ - zone_id: string; -} - -Detections.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; - -export declare namespace Detections { - export { - type DetectionCreateResponse as DetectionCreateResponse, - type DetectionUpdateResponse as DetectionUpdateResponse, - type DetectionListResponse as DetectionListResponse, - type DetectionDeleteResponse as DetectionDeleteResponse, - DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, - type DetectionCreateParams as DetectionCreateParams, - type DetectionUpdateParams as DetectionUpdateParams, - type DetectionListParams as DetectionListParams, - type DetectionDeleteParams as DetectionDeleteParams, - }; -} +export class Detections extends APIResource {} diff --git a/src/resources/leaked-credential-checks/index.ts b/src/resources/leaked-credential-checks/index.ts index 1844848bf2..7e3e1a0dd7 100644 --- a/src/resources/leaked-credential-checks/index.ts +++ b/src/resources/leaked-credential-checks/index.ts @@ -1,15 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { - DetectionListResponsesSinglePage, - Detections, - type DetectionCreateResponse, - type DetectionUpdateResponse, - type DetectionListResponse, - type DetectionDeleteResponse, - type DetectionCreateParams, - type DetectionUpdateParams, - type DetectionListParams, - type DetectionDeleteParams, -} from './detections'; +export { Detections } from './detections'; export { LeakedCredentialChecks } from './leaked-credential-checks'; diff --git a/src/resources/leaked-credential-checks/leaked-credential-checks.ts b/src/resources/leaked-credential-checks/leaked-credential-checks.ts index d8d8de90c1..c89821160c 100644 --- a/src/resources/leaked-credential-checks/leaked-credential-checks.ts +++ b/src/resources/leaked-credential-checks/leaked-credential-checks.ts @@ -1,132 +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 DetectionsAPI from './detections'; -import { - DetectionCreateParams, - DetectionCreateResponse, - DetectionDeleteParams, - DetectionDeleteResponse, - DetectionListParams, - DetectionListResponse, - DetectionListResponsesSinglePage, - DetectionUpdateParams, - DetectionUpdateResponse, - Detections, -} from './detections'; +import { Detections } from './detections'; export class LeakedCredentialChecks extends APIResource { detections: DetectionsAPI.Detections = new DetectionsAPI.Detections(this._client); - - /** - * Updates the current status of Leaked Credential Checks. - * - * @example - * ```ts - * const leakedCredentialCheck = - * await client.leakedCredentialChecks.create({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - create( - params: LeakedCredentialCheckCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.post(`/zones/${zone_id}/leaked-credential-checks`, { - body, - ...options, - }) as Core.APIPromise<{ result: LeakedCredentialCheckCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the current status of Leaked Credential Checks. - * - * @example - * ```ts - * const leakedCredentialCheck = - * await client.leakedCredentialChecks.get({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - get( - params: LeakedCredentialCheckGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id } = params; - return ( - this._client.get(`/zones/${zone_id}/leaked-credential-checks`, options) as Core.APIPromise<{ - result: LeakedCredentialCheckGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -/** - * Defines the overall status for Leaked Credential Checks. - */ -export interface LeakedCredentialCheckCreateResponse { - /** - * Determines whether or not Leaked Credential Checks are enabled. - */ - enabled?: boolean; -} - -/** - * Defines the overall status for Leaked Credential Checks. - */ -export interface LeakedCredentialCheckGetResponse { - /** - * Determines whether or not Leaked Credential Checks are enabled. - */ - enabled?: boolean; -} - -export interface LeakedCredentialCheckCreateParams { - /** - * Path param: Defines an identifier. - */ - zone_id: string; - - /** - * Body param: Determines whether or not Leaked Credential Checks are enabled. - */ - enabled?: boolean; -} - -export interface LeakedCredentialCheckGetParams { - /** - * Defines an identifier. - */ - zone_id: string; } LeakedCredentialChecks.Detections = Detections; -LeakedCredentialChecks.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; export declare namespace LeakedCredentialChecks { - export { - type LeakedCredentialCheckCreateResponse as LeakedCredentialCheckCreateResponse, - type LeakedCredentialCheckGetResponse as LeakedCredentialCheckGetResponse, - type LeakedCredentialCheckCreateParams as LeakedCredentialCheckCreateParams, - type LeakedCredentialCheckGetParams as LeakedCredentialCheckGetParams, - }; - - export { - Detections as Detections, - type DetectionCreateResponse as DetectionCreateResponse, - type DetectionUpdateResponse as DetectionUpdateResponse, - type DetectionListResponse as DetectionListResponse, - type DetectionDeleteResponse as DetectionDeleteResponse, - DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, - type DetectionCreateParams as DetectionCreateParams, - type DetectionUpdateParams as DetectionUpdateParams, - type DetectionListParams as DetectionListParams, - type DetectionDeleteParams as DetectionDeleteParams, - }; + export { Detections as Detections }; } 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 6e40d6cfa9..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 5e289166d6..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 6f0ab3dbaa..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/connectors/snapshots/latest.ts b/src/resources/magic-transit/connectors/snapshots/latest.ts index c51d9f1abe..16d9eaff01 100644 --- a/src/resources/magic-transit/connectors/snapshots/latest.ts +++ b/src/resources/magic-transit/connectors/snapshots/latest.ts @@ -72,8 +72,6 @@ export namespace LatestListResponse { */ v: string; - bonds?: Array; - /** * Count of processors/cores */ @@ -878,21 +876,6 @@ export namespace LatestListResponse { } export namespace Item { - /** - * Snapshot Bond - */ - export interface Bond { - /** - * Name of the network interface - */ - name: string; - - /** - * Current status of the network interface - */ - status: string; - } - /** * Snapshot DHCP lease */ @@ -1296,11 +1279,6 @@ export namespace LatestListResponse { * Connector identifier */ connector_id?: string; - - /** - * MTU as measured between the two ends of the tunnel - */ - probed_mtu?: number; } } } diff --git a/src/resources/magic-transit/connectors/snapshots/snapshots.ts b/src/resources/magic-transit/connectors/snapshots/snapshots.ts index a7d1e0d815..69b5c098e5 100644 --- a/src/resources/magic-transit/connectors/snapshots/snapshots.ts +++ b/src/resources/magic-transit/connectors/snapshots/snapshots.ts @@ -123,8 +123,6 @@ export interface SnapshotGetResponse { */ v: string; - bonds?: Array; - /** * Count of processors/cores */ @@ -929,21 +927,6 @@ export interface SnapshotGetResponse { } export namespace SnapshotGetResponse { - /** - * Snapshot Bond - */ - export interface Bond { - /** - * Name of the network interface - */ - name: string; - - /** - * Current status of the network interface - */ - status: string; - } - /** * Snapshot DHCP lease */ @@ -1347,11 +1330,6 @@ export namespace SnapshotGetResponse { * Connector identifier */ connector_id?: string; - - /** - * MTU as measured between the two ends of the tunnel - */ - probed_mtu?: number; } } diff --git a/src/resources/organizations/organizations.ts b/src/resources/organizations/organizations.ts index aa9aafb4b4..edc39aac94 100644 --- a/src/resources/organizations/organizations.ts +++ b/src/resources/organizations/organizations.ts @@ -61,12 +61,11 @@ export class Organizations extends APIResource { * Delete an organization. The organization MUST be empty before deleting. It must * not contain any sub-organizations, accounts, members or users. */ - delete(organizationId: string, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.delete(`/organizations/${organizationId}`, options) as Core.APIPromise<{ - result: OrganizationDeleteResponse; - }> - )._thenUnwrap((obj) => obj.result); + delete(organizationId: string, options?: Core.RequestOptions): Core.APIPromise { + return this._client.delete(`/organizations/${organizationId}`, { + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); } /** @@ -148,10 +147,6 @@ export namespace Organization { } } -export interface OrganizationDeleteResponse { - id: string; -} - export interface OrganizationCreateParams { name: string; @@ -295,7 +290,6 @@ Organizations.OrganizationProfileResource = OrganizationProfileResource; export declare namespace Organizations { export { type Organization as Organization, - type OrganizationDeleteResponse as OrganizationDeleteResponse, OrganizationsSinglePage as OrganizationsSinglePage, type OrganizationCreateParams as OrganizationCreateParams, type OrganizationUpdateParams as OrganizationUpdateParams, diff --git a/src/resources/queues/consumers.ts b/src/resources/queues/consumers.ts index 43eae71410..93596e00ee 100644 --- a/src/resources/queues/consumers.ts +++ b/src/resources/queues/consumers.ts @@ -106,33 +106,6 @@ export class Consumers extends APIResource { const { account_id } = params; return this._client.delete(`/accounts/${account_id}/queues/${queueId}/consumers/${consumerId}`, options); } - - /** - * Fetches the consumer for a queue by consumer id - * - * @example - * ```ts - * const consumer = await client.queues.consumers.get( - * '023e105f4ecef8ad9ca31a8372d0c353', - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - get( - queueId: string, - consumerId: string, - params: ConsumerGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - 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); - } } export class ConsumersSinglePage extends SinglePage {} @@ -491,13 +464,6 @@ export interface ConsumerDeleteParams { account_id: string; } -export interface ConsumerGetParams { - /** - * A Resource identifier. - */ - account_id: string; -} - Consumers.ConsumersSinglePage = ConsumersSinglePage; export declare namespace Consumers { @@ -509,6 +475,5 @@ export declare namespace Consumers { 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 ab15d31aa7..32568cd469 100644 --- a/src/resources/queues/index.ts +++ b/src/resources/queues/index.ts @@ -9,32 +9,15 @@ export { type ConsumerUpdateParams, type ConsumerListParams, type ConsumerDeleteParams, - 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'; -export { - SubscriptionListResponsesV4PagePaginationArray, - Subscriptions, - type SubscriptionCreateResponse, - type SubscriptionUpdateResponse, - type SubscriptionListResponse, - type SubscriptionDeleteResponse, - type SubscriptionGetResponse, - type SubscriptionCreateParams, - type SubscriptionUpdateParams, - type SubscriptionListParams, - type SubscriptionDeleteParams, - type SubscriptionGetParams, -} from './subscriptions'; +export { Subscriptions } from './subscriptions'; 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 836f42bd41..15d1651711 100644 --- a/src/resources/queues/queues.ts +++ b/src/resources/queues/queues.ts @@ -9,7 +9,6 @@ import { ConsumerCreateParams, ConsumerDeleteParams, ConsumerDeleteResponse, - ConsumerGetParams, ConsumerListParams, ConsumerUpdateParams, Consumers, @@ -19,31 +18,15 @@ import * as MessagesAPI from './messages'; import { MessageAckParams, MessageAckResponse, - MessageBulkPushParams, - MessageBulkPushResponse, MessagePullParams, MessagePullResponse, - MessagePushParams, - MessagePushResponse, + MessagePullResponsesSinglePage, Messages, } from './messages'; import * as PurgeAPI from './purge'; import { Purge, PurgeStartParams, PurgeStatusParams, PurgeStatusResponse } from './purge'; import * as SubscriptionsAPI from './subscriptions'; -import { - SubscriptionCreateParams, - SubscriptionCreateResponse, - SubscriptionDeleteParams, - SubscriptionDeleteResponse, - SubscriptionGetParams, - SubscriptionGetResponse, - SubscriptionListParams, - SubscriptionListResponse, - SubscriptionListResponsesV4PagePaginationArray, - SubscriptionUpdateParams, - SubscriptionUpdateResponse, - Subscriptions, -} from './subscriptions'; +import { Subscriptions } from './subscriptions'; import { SinglePage } from '../../pagination'; export class Queues extends APIResource { @@ -345,11 +328,11 @@ export interface QueueGetParams { Queues.QueuesSinglePage = QueuesSinglePage; Queues.Messages = Messages; +Queues.MessagePullResponsesSinglePage = MessagePullResponsesSinglePage; Queues.Purge = Purge; Queues.Consumers = Consumers; Queues.ConsumersSinglePage = ConsumersSinglePage; Queues.Subscriptions = Subscriptions; -Queues.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; export declare namespace Queues { export { @@ -367,13 +350,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 { @@ -392,21 +372,7 @@ export declare namespace Queues { type ConsumerUpdateParams as ConsumerUpdateParams, type ConsumerListParams as ConsumerListParams, type ConsumerDeleteParams as ConsumerDeleteParams, - type ConsumerGetParams as ConsumerGetParams, }; - export { - Subscriptions as Subscriptions, - type SubscriptionCreateResponse as SubscriptionCreateResponse, - type SubscriptionUpdateResponse as SubscriptionUpdateResponse, - type SubscriptionListResponse as SubscriptionListResponse, - type SubscriptionDeleteResponse as SubscriptionDeleteResponse, - type SubscriptionGetResponse as SubscriptionGetResponse, - SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, - type SubscriptionCreateParams as SubscriptionCreateParams, - type SubscriptionUpdateParams as SubscriptionUpdateParams, - type SubscriptionListParams as SubscriptionListParams, - type SubscriptionDeleteParams as SubscriptionDeleteParams, - type SubscriptionGetParams as SubscriptionGetParams, - }; + export { Subscriptions as Subscriptions }; } diff --git a/src/resources/queues/subscriptions.ts b/src/resources/queues/subscriptions.ts index 74c9b0e81f..42d6ea9ea6 100644 --- a/src/resources/queues/subscriptions.ts +++ b/src/resources/queues/subscriptions.ts @@ -1,1046 +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 Subscriptions extends APIResource { - /** - * Create a new event subscription for a queue - * - * @example - * ```ts - * const subscription = - * await client.queues.subscriptions.create({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - create( - params: SubscriptionCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/event_subscriptions/subscriptions`, { - body, - ...options, - }) as Core.APIPromise<{ result: SubscriptionCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Update an existing event subscription - * - * @example - * ```ts - * const subscription = - * await client.queues.subscriptions.update( - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - update( - subscriptionId: string, - params: SubscriptionUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.patch(`/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: SubscriptionUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Get a paginated list of event subscriptions with optional sorting and filtering - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const subscriptionListResponse of client.queues.subscriptions.list( - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` - */ - list( - params: SubscriptionListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id, ...query } = params; - return this._client.getAPIList( - `/accounts/${account_id}/event_subscriptions/subscriptions`, - SubscriptionListResponsesV4PagePaginationArray, - { query, ...options }, - ); - } - - /** - * Delete an existing event subscription - * - * @example - * ```ts - * const subscription = - * await client.queues.subscriptions.delete( - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - delete( - subscriptionId: string, - params: SubscriptionDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.delete( - `/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, - options, - ) as Core.APIPromise<{ result: SubscriptionDeleteResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Get details about an existing event subscription - * - * @example - * ```ts - * const subscription = await client.queues.subscriptions.get( - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - get( - subscriptionId: string, - params: SubscriptionGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, - options, - ) as Core.APIPromise<{ result: SubscriptionGetResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export class SubscriptionListResponsesV4PagePaginationArray extends V4PagePaginationArray {} - -export interface SubscriptionCreateResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionCreateResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionCreateResponse.MqEventSourceImages - | SubscriptionCreateResponse.MqEventSourceKV - | SubscriptionCreateResponse.MqEventSourceR2 - | SubscriptionCreateResponse.MqEventSourceSuperSlurper - | SubscriptionCreateResponse.MqEventSourceVectorize - | SubscriptionCreateResponse.MqEventSourceWorkersAIModel - | SubscriptionCreateResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionCreateResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionCreateResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionUpdateResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionUpdateResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionUpdateResponse.MqEventSourceImages - | SubscriptionUpdateResponse.MqEventSourceKV - | SubscriptionUpdateResponse.MqEventSourceR2 - | SubscriptionUpdateResponse.MqEventSourceSuperSlurper - | SubscriptionUpdateResponse.MqEventSourceVectorize - | SubscriptionUpdateResponse.MqEventSourceWorkersAIModel - | SubscriptionUpdateResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionUpdateResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionUpdateResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionListResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionListResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionListResponse.MqEventSourceImages - | SubscriptionListResponse.MqEventSourceKV - | SubscriptionListResponse.MqEventSourceR2 - | SubscriptionListResponse.MqEventSourceSuperSlurper - | SubscriptionListResponse.MqEventSourceVectorize - | SubscriptionListResponse.MqEventSourceWorkersAIModel - | SubscriptionListResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionListResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionListResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionDeleteResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionDeleteResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionDeleteResponse.MqEventSourceImages - | SubscriptionDeleteResponse.MqEventSourceKV - | SubscriptionDeleteResponse.MqEventSourceR2 - | SubscriptionDeleteResponse.MqEventSourceSuperSlurper - | SubscriptionDeleteResponse.MqEventSourceVectorize - | SubscriptionDeleteResponse.MqEventSourceWorkersAIModel - | SubscriptionDeleteResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionDeleteResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionDeleteResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionGetResponse { - /** - * Unique identifier for the subscription - */ - id: string; - - /** - * When the subscription was created - */ - created_at: string; - - /** - * Destination configuration for the subscription - */ - destination: SubscriptionGetResponse.Destination; - - /** - * Whether the subscription is active - */ - enabled: boolean; - - /** - * List of event types this subscription handles - */ - events: Array; - - /** - * When the subscription was last modified - */ - modified_at: string; - - /** - * Name of the subscription - */ - name: string; - - /** - * Source configuration for the subscription - */ - source: - | SubscriptionGetResponse.MqEventSourceImages - | SubscriptionGetResponse.MqEventSourceKV - | SubscriptionGetResponse.MqEventSourceR2 - | SubscriptionGetResponse.MqEventSourceSuperSlurper - | SubscriptionGetResponse.MqEventSourceVectorize - | SubscriptionGetResponse.MqEventSourceWorkersAIModel - | SubscriptionGetResponse.MqEventSourceWorkersBuildsWorker - | SubscriptionGetResponse.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionGetResponse { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionCreateParams { - /** - * Path param: A Resource identifier. - */ - account_id: string; - - /** - * Body param: Destination configuration for the subscription - */ - destination?: SubscriptionCreateParams.Destination; - - /** - * Body param: Whether the subscription is active - */ - enabled?: boolean; - - /** - * Body param: List of event types this subscription handles - */ - events?: Array; - - /** - * Body param: Name of the subscription - */ - name?: string; - - /** - * Body param: Source configuration for the subscription - */ - source?: - | SubscriptionCreateParams.MqEventSourceImages - | SubscriptionCreateParams.MqEventSourceKV - | SubscriptionCreateParams.MqEventSourceR2 - | SubscriptionCreateParams.MqEventSourceSuperSlurper - | SubscriptionCreateParams.MqEventSourceVectorize - | SubscriptionCreateParams.MqEventSourceWorkersAIModel - | SubscriptionCreateParams.MqEventSourceWorkersBuildsWorker - | SubscriptionCreateParams.MqEventSourceWorkflowsWorkflow; -} - -export namespace SubscriptionCreateParams { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } - - export interface MqEventSourceImages { - /** - * Type of source - */ - type?: 'images'; - } - - export interface MqEventSourceKV { - /** - * Type of source - */ - type?: 'kv'; - } - - export interface MqEventSourceR2 { - /** - * Type of source - */ - type?: 'r2'; - } - - export interface MqEventSourceSuperSlurper { - /** - * Type of source - */ - type?: 'superSlurper'; - } - - export interface MqEventSourceVectorize { - /** - * Type of source - */ - type?: 'vectorize'; - } - - export interface MqEventSourceWorkersAIModel { - /** - * Name of the Workers AI model - */ - model_name?: string; - - /** - * Type of source - */ - type?: 'workersAi.model'; - } - - export interface MqEventSourceWorkersBuildsWorker { - /** - * Type of source - */ - type?: 'workersBuilds.worker'; - - /** - * Name of the worker - */ - worker_name?: string; - } - - export interface MqEventSourceWorkflowsWorkflow { - /** - * Type of source - */ - type?: 'workflows.workflow'; - - /** - * Name of the workflow - */ - workflow_name?: string; - } -} - -export interface SubscriptionUpdateParams { - /** - * Path param: A Resource identifier. - */ - account_id: string; - - /** - * Body param: Destination configuration for the subscription - */ - destination?: SubscriptionUpdateParams.Destination; - - /** - * Body param: Whether the subscription is active - */ - enabled?: boolean; - - /** - * Body param: List of event types this subscription handles - */ - events?: Array; - - /** - * Body param: Name of the subscription - */ - name?: string; -} - -export namespace SubscriptionUpdateParams { - /** - * Destination configuration for the subscription - */ - export interface Destination { - /** - * ID of the target queue - */ - queue_id: string; - - /** - * Type of destination - */ - type: 'queues.queue'; - } -} - -export interface SubscriptionListParams extends V4PagePaginationArrayParams { - /** - * Path param: A Resource identifier. - */ - account_id: string; - - /** - * Query param: Sort direction - */ - direction?: 'asc' | 'desc'; - - /** - * Query param: Field to sort by - */ - order?: 'created_at' | 'name' | 'enabled' | 'source'; -} - -export interface SubscriptionDeleteParams { - /** - * A Resource identifier. - */ - account_id: string; -} - -export interface SubscriptionGetParams { - /** - * A Resource identifier. - */ - account_id: string; -} - -Subscriptions.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; - -export declare namespace Subscriptions { - export { - type SubscriptionCreateResponse as SubscriptionCreateResponse, - type SubscriptionUpdateResponse as SubscriptionUpdateResponse, - type SubscriptionListResponse as SubscriptionListResponse, - type SubscriptionDeleteResponse as SubscriptionDeleteResponse, - type SubscriptionGetResponse as SubscriptionGetResponse, - SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, - type SubscriptionCreateParams as SubscriptionCreateParams, - type SubscriptionUpdateParams as SubscriptionUpdateParams, - type SubscriptionListParams as SubscriptionListParams, - type SubscriptionDeleteParams as SubscriptionDeleteParams, - type SubscriptionGetParams as SubscriptionGetParams, - }; -} +export class Subscriptions extends APIResource {} diff --git a/src/resources/r2/buckets/event-notifications.ts b/src/resources/r2/buckets/event-notifications.ts index b3f163f204..cb0ba791f0 100644 --- a/src/resources/r2/buckets/event-notifications.ts +++ b/src/resources/r2/buckets/event-notifications.ts @@ -13,10 +13,7 @@ export class EventNotifications extends APIResource { * await client.r2.buckets.eventNotifications.update( * 'example-bucket', * 'queue_id', - * { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * rules: [{ actions: ['PutObject', 'CopyObject'] }], - * }, + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ @@ -278,7 +275,7 @@ export interface EventNotificationUpdateParams { /** * Body param: Array of rules to drive notifications. */ - rules: Array; + rules?: Array; /** * Header param: Jurisdiction where objects in this bucket are guaranteed to be diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts index c9e77e1896..75c99603d5 100644 --- a/src/resources/radar/ai/bots/summary.ts +++ b/src/resources/radar/ai/bots/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of traffic by AI user agent. * - * @deprecated Use [Radar AI Bots Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/summary_v2/) instead. + * @deprecated */ userAgent( query?: SummaryUserAgentParams, diff --git a/src/resources/radar/ai/inference/summary.ts b/src/resources/radar/ai/inference/summary.ts index 4b9b871ddc..a22b6f10e9 100644 --- a/src/resources/radar/ai/inference/summary.ts +++ b/src/resources/radar/ai/inference/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by model. * - * @deprecated Use [Radar AI Inference Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/summary_v2/) instead. + * @deprecated */ model(query?: SummaryModelParams, options?: Core.RequestOptions): Core.APIPromise; model(options?: Core.RequestOptions): Core.APIPromise; @@ -29,7 +29,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by task. * - * @deprecated Use [Radar AI Inference Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/summary_v2/) instead. + * @deprecated */ task(query?: SummaryTaskParams, options?: Core.RequestOptions): Core.APIPromise; task(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/ai/inference/timeseries-groups/summary.ts b/src/resources/radar/ai/inference/timeseries-groups/summary.ts index 43edd89a6c..bf808d1b21 100644 --- a/src/resources/radar/ai/inference/timeseries-groups/summary.ts +++ b/src/resources/radar/ai/inference/timeseries-groups/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by model over time. * - * @deprecated Use [Radar AI Inference Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/timeseries_groups_v2/) instead. + * @deprecated */ model(query?: SummaryModelParams, options?: Core.RequestOptions): Core.APIPromise; model(options?: Core.RequestOptions): Core.APIPromise; @@ -30,7 +30,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by task over time. * - * @deprecated Use [Radar AI Inference Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/timeseries_groups_v2/) instead. + * @deprecated */ task(query?: SummaryTaskParams, options?: Core.RequestOptions): Core.APIPromise; task(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index c516b5d812..b5b307bf8b 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -93,7 +93,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of traffic by AI user agent over time. * - * @deprecated Use [Radar AI Bots Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/timeseries_groups/) instead. + * @deprecated */ userAgent( query?: TimeseriesGroupUserAgentParams, diff --git a/src/resources/radar/as112/summary.ts b/src/resources/radar/as112/summary.ts index c83056b982..d6034b19c4 100644 --- a/src/resources/radar/as112/summary.ts +++ b/src/resources/radar/as112/summary.ts @@ -9,7 +9,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by DNSSEC (DNS Security * Extensions) support. * - * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. + * @deprecated */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -31,7 +31,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by EDNS (Extension Mechanisms * for DNS) support. * - * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. + * @deprecated */ edns(query?: SummaryEdnsParams, options?: Core.RequestOptions): Core.APIPromise; edns(options?: Core.RequestOptions): Core.APIPromise; @@ -52,7 +52,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by IP version. * - * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -76,7 +76,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by protocol. * - * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. + * @deprecated */ protocol( query?: SummaryProtocolParams, @@ -100,7 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by type. * - * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. + * @deprecated */ queryType( query?: SummaryQueryTypeParams, @@ -124,7 +124,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of AS112 DNS requests classified by response code. * - * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. + * @deprecated */ responseCodes( query?: SummaryResponseCodesParams, diff --git a/src/resources/radar/as112/timeseries-groups.ts b/src/resources/radar/as112/timeseries-groups.ts index fd564e8245..e5593df35c 100644 --- a/src/resources/radar/as112/timeseries-groups.ts +++ b/src/resources/radar/as112/timeseries-groups.ts @@ -9,7 +9,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by DNSSEC (DNS Security * Extensions) support over time. * - * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. + * @deprecated */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -34,7 +34,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by EDNS (Extension Mechanisms * for DNS) support over time. * - * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. + * @deprecated */ edns( query?: TimeseriesGroupEdnsParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by IP version over time. * - * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -84,7 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by protocol over * time. * - * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. + * @deprecated */ protocol( query?: TimeseriesGroupProtocolParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by type over time. * - * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. + * @deprecated */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -134,7 +134,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by response code * over time. * - * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. + * @deprecated */ responseCodes( query?: TimeseriesGroupResponseCodesParams, diff --git a/src/resources/radar/attacks/layer3/summary.ts b/src/resources/radar/attacks/layer3/summary.ts index 869dd46727..bc4ccc4c81 100644 --- a/src/resources/radar/attacks/layer3/summary.ts +++ b/src/resources/radar/attacks/layer3/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate. * - * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. + * @deprecated */ bitrate( query?: SummaryBitrateParams, @@ -32,7 +32,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration. * - * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. + * @deprecated */ duration( query?: SummaryDurationParams, @@ -56,7 +56,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry. * - * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. + * @deprecated */ industry( query?: SummaryIndustryParams, @@ -80,7 +80,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version. * - * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -104,7 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol. * - * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. + * @deprecated */ protocol( query?: SummaryProtocolParams, @@ -128,7 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector. * - * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. + * @deprecated */ vector(query?: SummaryVectorParams, options?: Core.RequestOptions): Core.APIPromise; vector(options?: Core.RequestOptions): Core.APIPromise; @@ -149,7 +149,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical. * - * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. + * @deprecated */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer3/timeseries-groups.ts b/src/resources/radar/attacks/layer3/timeseries-groups.ts index 622eb83d71..9f8d171a40 100644 --- a/src/resources/radar/attacks/layer3/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer3/timeseries-groups.ts @@ -8,7 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate over time. * - * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. + * @deprecated */ bitrate( query?: TimeseriesGroupBitrateParams, @@ -33,7 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration over time. * - * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. + * @deprecated */ duration( query?: TimeseriesGroupDurationParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry over time. * - * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. + * @deprecated */ industry( query?: TimeseriesGroupIndustryParams, @@ -83,7 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version over time. * - * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol over time. * - * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. + * @deprecated */ protocol( query?: TimeseriesGroupProtocolParams, @@ -133,7 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector over time. * - * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. + * @deprecated */ vector( query?: TimeseriesGroupVectorParams, @@ -158,7 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical over time. * - * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. + * @deprecated */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer3/top/top.ts b/src/resources/radar/attacks/layer3/top/top.ts index e8e5c6b5b8..2da56402ce 100644 --- a/src/resources/radar/attacks/layer3/top/top.ts +++ b/src/resources/radar/attacks/layer3/top/top.ts @@ -47,7 +47,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by industry endpoint. * - * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. + * @deprecated */ industry(query?: TopIndustryParams, options?: Core.RequestOptions): Core.APIPromise; industry(options?: Core.RequestOptions): Core.APIPromise; @@ -69,7 +69,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by vertical endpoint. * - * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. + * @deprecated */ vertical(query?: TopVerticalParams, options?: Core.RequestOptions): Core.APIPromise; vertical(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/attacks/layer7/summary.ts b/src/resources/radar/attacks/layer7/summary.ts index 3d4b27fb58..160eb24dd8 100644 --- a/src/resources/radar/attacks/layer7/summary.ts +++ b/src/resources/radar/attacks/layer7/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method. * - * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. + * @deprecated */ httpMethod( query?: SummaryHTTPMethodParams, @@ -33,7 +33,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version. * - * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. + * @deprecated */ httpVersion( query?: SummaryHTTPVersionParams, @@ -58,7 +58,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry. * - * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. + * @deprecated */ industry( query?: SummaryIndustryParams, @@ -82,7 +82,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version. * - * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -106,7 +106,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules. * - * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. + * @deprecated */ managedRules( query?: SummaryManagedRulesParams, @@ -131,7 +131,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product. * - * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. + * @deprecated */ mitigationProduct( query?: SummaryMitigationProductParams, @@ -156,7 +156,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical. * - * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. + * @deprecated */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer7/timeseries-groups.ts b/src/resources/radar/attacks/layer7/timeseries-groups.ts index ab5076ef90..ce7c62ce1e 100644 --- a/src/resources/radar/attacks/layer7/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer7/timeseries-groups.ts @@ -8,7 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method over time. * - * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. + * @deprecated */ httpMethod( query?: TimeseriesGroupHTTPMethodParams, @@ -33,7 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version over time. * - * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. + * @deprecated */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry over time. * - * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. + * @deprecated */ industry( query?: TimeseriesGroupIndustryParams, @@ -83,7 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version used over time. * - * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules over time. * - * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. + * @deprecated */ managedRules( query?: TimeseriesGroupManagedRulesParams, @@ -133,7 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product over time. * - * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. + * @deprecated */ mitigationProduct( query?: TimeseriesGroupMitigationProductParams, @@ -158,7 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical over time. * - * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. + * @deprecated */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer7/top/top.ts b/src/resources/radar/attacks/layer7/top/top.ts index 1fa4d17fff..74086112c2 100644 --- a/src/resources/radar/attacks/layer7/top/top.ts +++ b/src/resources/radar/attacks/layer7/top/top.ts @@ -51,7 +51,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by industry endpoint. * - * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. + * @deprecated */ industry(query?: TopIndustryParams, options?: Core.RequestOptions): Core.APIPromise; industry(options?: Core.RequestOptions): Core.APIPromise; @@ -73,7 +73,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by vertical endpoint. * - * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. + * @deprecated */ vertical(query?: TopVerticalParams, options?: Core.RequestOptions): Core.APIPromise; vertical(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts index 829a017a4b..4ba71c4acf 100644 --- a/src/resources/radar/ct/logs.ts +++ b/src/resources/radar/ct/logs.ts @@ -121,12 +121,6 @@ export namespace LogGetResponse { */ api: 'RFC6962' | 'STATIC'; - /** - * The average throughput of the CT log, measured in certificates per hour - * (certs/hour). - */ - avgThroughput: number; - /** * A brief description of the certificate log. */ @@ -137,11 +131,6 @@ export namespace LogGetResponse { */ endExclusive: string; - /** - * Timestamp of the most recent update to the CT log. - */ - lastUpdate: string; - /** * The organization responsible for operating the certificate log. */ @@ -179,18 +168,6 @@ export namespace LogGetResponse { */ stateTimestamp: string; - /** - * Number of certificates that are eligible for inclusion to this log but have not - * been included yet. Based on certificates signed by trusted root CAs within the - * log's accepted date range. - */ - submittableCertCount: string | null; - - /** - * Number of certificates already included in this CT log. - */ - submittedCertCount: string | null; - /** * The URL for the certificate log. */ diff --git a/src/resources/radar/dns/summary.ts b/src/resources/radar/dns/summary.ts index bea2bcf785..575afc929b 100644 --- a/src/resources/radar/dns/summary.ts +++ b/src/resources/radar/dns/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by cache status. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ cacheHit( query?: SummaryCacheHitParams, @@ -33,7 +33,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -55,7 +55,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ dnssecAware( query?: SummaryDNSSECAwareParams, @@ -80,7 +80,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ dnssecE2E( query?: SummaryDNSSECE2EParams, @@ -104,7 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by IP version. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -128,7 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ matchingAnswer( query?: SummaryMatchingAnswerParams, @@ -152,7 +152,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ protocol( query?: SummaryProtocolParams, @@ -176,7 +176,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by type. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ queryType( query?: SummaryQueryTypeParams, @@ -200,7 +200,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by response code. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ responseCode( query?: SummaryResponseCodeParams, @@ -224,7 +224,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by minimum response TTL. * - * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. + * @deprecated */ responseTTL( query?: SummaryResponseTTLParams, diff --git a/src/resources/radar/dns/timeseries-groups.ts b/src/resources/radar/dns/timeseries-groups.ts index b2120478af..5e1ea8a4e1 100644 --- a/src/resources/radar/dns/timeseries-groups.ts +++ b/src/resources/radar/dns/timeseries-groups.ts @@ -8,7 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by cache status over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ cacheHit( query?: TimeseriesGroupCacheHitParams, @@ -33,7 +33,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ dnssecAware( query?: TimeseriesGroupDNSSECAwareParams, @@ -84,7 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ dnssecE2E( query?: TimeseriesGroupDNSSECE2EParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by IP version over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -132,7 +132,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ matchingAnswer( query?: TimeseriesGroupMatchingAnswerParams, @@ -157,7 +157,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ protocol( query?: TimeseriesGroupProtocolParams, @@ -181,7 +181,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by type over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -205,7 +205,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by response code over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ responseCode( query?: TimeseriesGroupResponseCodeParams, @@ -230,7 +230,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by minimum answer TTL over time. * - * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. + * @deprecated */ responseTTL( query?: TimeseriesGroupResponseTTLParams, diff --git a/src/resources/radar/email/routing/summary.ts b/src/resources/radar/email/routing/summary.ts index 3d29f93974..00defd2b84 100644 --- a/src/resources/radar/email/routing/summary.ts +++ b/src/resources/radar/email/routing/summary.ts @@ -10,7 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. + * @deprecated */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -32,7 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. + * @deprecated */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -54,7 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. + * @deprecated */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -76,7 +76,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted). * - * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. + * @deprecated */ encrypted( query?: SummaryEncryptedParams, @@ -100,7 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by IP version. * - * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -125,7 +125,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. + * @deprecated */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/email/routing/timeseries-groups.ts b/src/resources/radar/email/routing/timeseries-groups.ts index 4d12509309..3a9801b143 100644 --- a/src/resources/radar/email/routing/timeseries-groups.ts +++ b/src/resources/radar/email/routing/timeseries-groups.ts @@ -10,7 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. + * @deprecated */ arc( query?: TimeseriesGroupARCParams, @@ -36,7 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. + * @deprecated */ dkim( query?: TimeseriesGroupDKIMParams, @@ -62,7 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. + * @deprecated */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -88,7 +88,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted) over time. * - * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. + * @deprecated */ encrypted( query?: TimeseriesGroupEncryptedParams, @@ -113,7 +113,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by IP version over time. * - * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -139,7 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. + * @deprecated */ spf( query?: TimeseriesGroupSPFParams, diff --git a/src/resources/radar/email/security/summary.ts b/src/resources/radar/email/security/summary.ts index c3432f9f36..5136a742ff 100644 --- a/src/resources/radar/email/security/summary.ts +++ b/src/resources/radar/email/security/summary.ts @@ -10,7 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. + * @deprecated */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -32,7 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. + * @deprecated */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -54,7 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. + * @deprecated */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -75,7 +75,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by malicious classification. * - * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. + * @deprecated */ malicious( query?: SummaryMaliciousParams, @@ -99,7 +99,7 @@ export class Summary extends APIResource { /** * Retrieves the proportion of emails by spam classification (spam vs. non-spam). * - * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. + * @deprecated */ spam(query?: SummarySpamParams, options?: Core.RequestOptions): Core.APIPromise; spam(options?: Core.RequestOptions): Core.APIPromise; @@ -121,7 +121,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. + * @deprecated */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; @@ -143,7 +143,7 @@ export class Summary extends APIResource { * Retrieves the proportion of emails by spoof classification (spoof vs. * non-spoof). * - * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. + * @deprecated */ spoof(query?: SummarySpoofParams, options?: Core.RequestOptions): Core.APIPromise; spoof(options?: Core.RequestOptions): Core.APIPromise; @@ -164,7 +164,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by threat categories. * - * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. + * @deprecated */ threatCategory( query?: SummaryThreatCategoryParams, @@ -189,7 +189,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by TLS version. * - * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. + * @deprecated */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/email/security/timeseries-groups.ts b/src/resources/radar/email/security/timeseries-groups.ts index 9b33cf953e..aa620088a0 100644 --- a/src/resources/radar/email/security/timeseries-groups.ts +++ b/src/resources/radar/email/security/timeseries-groups.ts @@ -10,7 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. + * @deprecated */ arc( query?: TimeseriesGroupARCParams, @@ -36,7 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. + * @deprecated */ dkim( query?: TimeseriesGroupDKIMParams, @@ -62,7 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. + * @deprecated */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -87,7 +87,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by malicious classification over time. * - * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. + * @deprecated */ malicious( query?: TimeseriesGroupMaliciousParams, @@ -113,7 +113,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spam classification (spam vs. non-spam) * over time. * - * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. + * @deprecated */ spam( query?: TimeseriesGroupSpamParams, @@ -139,7 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. + * @deprecated */ spf( query?: TimeseriesGroupSPFParams, @@ -165,7 +165,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spoof classification (spoof vs. * non-spoof) over time. * - * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. + * @deprecated */ spoof( query?: TimeseriesGroupSpoofParams, @@ -190,7 +190,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by threat category over time. * - * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. + * @deprecated */ threatCategory( query?: TimeseriesGroupThreatCategoryParams, @@ -215,7 +215,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by TLS version over time. * - * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. + * @deprecated */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/http/summary.ts b/src/resources/radar/http/summary.ts index 5c5792f467..9f7f84b12e 100644 --- a/src/resources/radar/http/summary.ts +++ b/src/resources/radar/http/summary.ts @@ -11,7 +11,7 @@ export class Summary extends APIResource { * https://developers.cloudflare.com/radar/concepts/bot-classes/ for more * information. * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @deprecated */ botClass( query?: SummaryBotClassParams, @@ -36,7 +36,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP requests generated by mobile, desktop, and * other types of devices. * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @deprecated */ deviceType( query?: SummaryDeviceTypeParams, @@ -60,7 +60,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. HTTPS). * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @deprecated */ httpProtocol( query?: SummaryHTTPProtocolParams, @@ -84,7 +84,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP version. * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @deprecated */ httpVersion( query?: SummaryHTTPVersionParams, @@ -108,7 +108,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by IP version. * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -133,7 +133,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP requests by operating system (Windows, macOS, * Android, iOS, and others). * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @deprecated */ os(query?: SummaryOSParams, options?: Core.RequestOptions): Core.APIPromise; os(options?: Core.RequestOptions): Core.APIPromise; @@ -154,7 +154,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by post-quantum support. * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @deprecated */ postQuantum( query?: SummaryPostQuantumParams, @@ -178,7 +178,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by TLS version. * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @deprecated */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/http/timeseries-groups.ts b/src/resources/radar/http/timeseries-groups.ts index 6e44b45b29..a22fdb7774 100644 --- a/src/resources/radar/http/timeseries-groups.ts +++ b/src/resources/radar/http/timeseries-groups.ts @@ -10,7 +10,7 @@ export class TimeseriesGroups extends APIResource { * over time. Visit https://developers.cloudflare.com/radar/concepts/bot-classes/ * for more information. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ botClass( query?: TimeseriesGroupBotClassParams, @@ -34,7 +34,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by user agent over time. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ browser( query?: TimeseriesGroupBrowserParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by user agent family over time. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ browserFamily( query?: TimeseriesGroupBrowserFamilyParams, @@ -83,7 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by device type over time. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ deviceType( query?: TimeseriesGroupDeviceTypeParams, @@ -109,7 +109,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. HTTPS) * over time. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ httpProtocol( query?: TimeseriesGroupHTTPProtocolParams, @@ -134,7 +134,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP version over time. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -159,7 +159,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by IP version over time. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -183,7 +183,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by operating system over time. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ os( query?: TimeseriesGroupOSParams, @@ -207,7 +207,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by post-quantum support over time. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ postQuantum( query?: TimeseriesGroupPostQuantumParams, @@ -232,7 +232,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by TLS version over time. * - * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. + * @deprecated */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/http/top.ts b/src/resources/radar/http/top.ts index 8419bea370..01ee05806f 100644 --- a/src/resources/radar/http/top.ts +++ b/src/resources/radar/http/top.ts @@ -8,7 +8,10 @@ export class Top extends APIResource { /** * Retrieves the top user agents by HTTP requests. * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @example + * ```ts + * const response = await client.radar.http.top.browser(); + * ``` */ browser(query?: TopBrowserParams, options?: Core.RequestOptions): Core.APIPromise; browser(options?: Core.RequestOptions): Core.APIPromise; @@ -29,7 +32,11 @@ export class Top extends APIResource { /** * Retrieves the top user agents, aggregated in families, by HTTP requests. * - * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. + * @example + * ```ts + * const response = + * await client.radar.http.top.browserFamily(); + * ``` */ browserFamily( query?: TopBrowserFamilyParams, diff --git a/src/resources/radar/leaked-credentials/summary.ts b/src/resources/radar/leaked-credentials/summary.ts index 970fde6b56..917ce13982 100644 --- a/src/resources/radar/leaked-credentials/summary.ts +++ b/src/resources/radar/leaked-credentials/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP authentication requests by bot class. * - * @deprecated Use [Radar Leaked Credentials Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/summary_v2/) instead. + * @deprecated */ botClass( query?: SummaryBotClassParams, @@ -34,7 +34,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP authentication requests by compromised * credential status. * - * @deprecated Use [Radar Leaked Credentials Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/summary_v2/) instead. + * @deprecated */ compromised( query?: SummaryCompromisedParams, diff --git a/src/resources/radar/leaked-credentials/timeseries-groups.ts b/src/resources/radar/leaked-credentials/timeseries-groups.ts index 859a012a8c..83aa48d077 100644 --- a/src/resources/radar/leaked-credentials/timeseries-groups.ts +++ b/src/resources/radar/leaked-credentials/timeseries-groups.ts @@ -9,7 +9,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP authentication requests by bot class over * time. * - * @deprecated Use [Radar Leaked Credentials Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/timeseries_groups_v2/) instead. + * @deprecated */ botClass( query?: TimeseriesGroupBotClassParams, @@ -35,7 +35,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP authentication requests by compromised * credential status over time. * - * @deprecated Use [Radar Leaked Credentials Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/timeseries_groups_v2/) instead. + * @deprecated */ compromised( query?: TimeseriesGroupCompromisedParams, diff --git a/src/resources/rulesets/rules.ts b/src/resources/rulesets/rules.ts index 3cca8dc4a5..ee0495559c 100644 --- a/src/resources/rulesets/rules.ts +++ b/src/resources/rulesets/rules.ts @@ -5850,7 +5850,7 @@ export namespace SetConfigRule { bic?: boolean; /** - * @deprecated Cloudflare Apps are deprected. + * Whether to disable Cloudflare Apps. */ disable_apps?: true; @@ -5885,8 +5885,7 @@ export namespace SetConfigRule { hotlink_protection?: boolean; /** - * @deprecated Mirage is deprecated. More information at - * https://developers.cloudflare.com/speed/optimization/images/mirage/. + * Whether to enable Mirage. */ mirage?: boolean; @@ -6088,7 +6087,7 @@ export namespace SetConfigRuleParam { bic?: boolean; /** - * @deprecated Cloudflare Apps are deprected. + * Whether to disable Cloudflare Apps. */ disable_apps?: true; @@ -6123,8 +6122,7 @@ export namespace SetConfigRuleParam { hotlink_protection?: boolean; /** - * @deprecated Mirage is deprecated. More information at - * https://developers.cloudflare.com/speed/optimization/images/mirage/. + * Whether to enable Mirage. */ mirage?: boolean; @@ -11370,7 +11368,7 @@ export declare namespace RuleCreateParams { bic?: boolean; /** - * @deprecated Cloudflare Apps are deprected. + * Whether to disable Cloudflare Apps. */ disable_apps?: true; @@ -11405,8 +11403,7 @@ export declare namespace RuleCreateParams { hotlink_protection?: boolean; /** - * @deprecated Mirage is deprecated. More information at - * https://developers.cloudflare.com/speed/optimization/images/mirage/. + * Whether to enable Mirage. */ mirage?: boolean; @@ -15563,7 +15560,7 @@ export declare namespace RuleEditParams { bic?: boolean; /** - * @deprecated Cloudflare Apps are deprected. + * Whether to disable Cloudflare Apps. */ disable_apps?: true; @@ -15598,8 +15595,7 @@ export declare namespace RuleEditParams { hotlink_protection?: boolean; /** - * @deprecated Mirage is deprecated. More information at - * https://developers.cloudflare.com/speed/optimization/images/mirage/. + * Whether to enable Mirage. */ mirage?: boolean; diff --git a/src/resources/secrets-store/stores/secrets.ts b/src/resources/secrets-store/stores/secrets.ts index ec0ca694ed..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', 'ai_gateway', 'dex', 'access'], + * scopes: ['workers', 'ai_gateway'], * value: 'api-token-secret-123', * }, * ], @@ -135,7 +135,7 @@ export class Secrets extends APIResource { * { * account_id: '985e105f4ecef8ad9ca31a8372d0c353', * name: 'MY_API_KEY', - * scopes: ['workers', 'ai_gateway', 'dex', 'access'], + * scopes: ['workers', 'ai_gateway'], * }, * ); * ``` diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts index d2cb382d90..4af2451c88 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts @@ -63,6 +63,7 @@ export type BindingGetResponse = | BindingGetResponse.WorkersBindingKindSecretText | BindingGetResponse.WorkersBindingKindSendEmail | BindingGetResponse.WorkersBindingKindService + | BindingGetResponse.WorkersBindingKindTailConsumer | BindingGetResponse.WorkersBindingKindTextBlob | BindingGetResponse.WorkersBindingKindVectorize | BindingGetResponse.WorkersBindingKindVersionMetadata @@ -492,6 +493,23 @@ export namespace BindingGetResponse { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. 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 554313f4d3..78e5e95423 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -372,6 +372,7 @@ export namespace ScriptUpdateParams { | Metadata.WorkersBindingKindSecretText | Metadata.WorkersBindingKindSendEmail | Metadata.WorkersBindingKindService + | Metadata.WorkersBindingKindTailConsumer | Metadata.WorkersBindingKindTextBlob | Metadata.WorkersBindingKindVectorize | Metadata.WorkersBindingKindVersionMetadata @@ -945,6 +946,23 @@ export namespace ScriptUpdateParams { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. 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 fb897aea3f..216456a041 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -91,6 +91,7 @@ export interface SettingEditResponse { | SettingEditResponse.WorkersBindingKindSecretText | SettingEditResponse.WorkersBindingKindSendEmail | SettingEditResponse.WorkersBindingKindService + | SettingEditResponse.WorkersBindingKindTailConsumer | SettingEditResponse.WorkersBindingKindTextBlob | SettingEditResponse.WorkersBindingKindVectorize | SettingEditResponse.WorkersBindingKindVersionMetadata @@ -571,6 +572,23 @@ export namespace SettingEditResponse { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -825,6 +843,7 @@ export interface SettingGetResponse { | SettingGetResponse.WorkersBindingKindSecretText | SettingGetResponse.WorkersBindingKindSendEmail | SettingGetResponse.WorkersBindingKindService + | SettingGetResponse.WorkersBindingKindTailConsumer | SettingGetResponse.WorkersBindingKindTextBlob | SettingGetResponse.WorkersBindingKindVectorize | SettingGetResponse.WorkersBindingKindVersionMetadata @@ -1305,6 +1324,23 @@ export namespace SettingGetResponse { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1572,6 +1608,7 @@ export namespace SettingEditParams { | Settings.WorkersBindingKindSecretText | Settings.WorkersBindingKindSendEmail | Settings.WorkersBindingKindService + | Settings.WorkersBindingKindTailConsumer | Settings.WorkersBindingKindTextBlob | Settings.WorkersBindingKindVectorize | Settings.WorkersBindingKindVersionMetadata @@ -2062,6 +2099,23 @@ export namespace SettingEditParams { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers/beta/workers/versions.ts b/src/resources/workers/beta/workers/versions.ts index 66bebbd506..185cea7033 100644 --- a/src/resources/workers/beta/workers/versions.ts +++ b/src/resources/workers/beta/workers/versions.ts @@ -176,6 +176,7 @@ export interface Version { | Version.WorkersBindingKindSecretText | Version.WorkersBindingKindSendEmail | Version.WorkersBindingKindService + | Version.WorkersBindingKindTailConsumer | Version.WorkersBindingKindTextBlob | Version.WorkersBindingKindVectorize | Version.WorkersBindingKindVersionMetadata @@ -733,6 +734,23 @@ export namespace Version { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1021,6 +1039,7 @@ export interface VersionCreateParams { | VersionCreateParams.WorkersBindingKindSecretText | VersionCreateParams.WorkersBindingKindSendEmail | VersionCreateParams.WorkersBindingKindService + | VersionCreateParams.WorkersBindingKindTailConsumer | VersionCreateParams.WorkersBindingKindTextBlob | VersionCreateParams.WorkersBindingKindVectorize | VersionCreateParams.WorkersBindingKindVersionMetadata @@ -1574,6 +1593,23 @@ export namespace VersionCreateParams { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. 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/workers/scripts/script-and-version-settings.ts b/src/resources/workers/scripts/script-and-version-settings.ts index 54237b4091..d6ef7552ca 100644 --- a/src/resources/workers/scripts/script-and-version-settings.ts +++ b/src/resources/workers/scripts/script-and-version-settings.ts @@ -87,6 +87,7 @@ export interface ScriptAndVersionSettingEditResponse { | ScriptAndVersionSettingEditResponse.WorkersBindingKindSecretText | ScriptAndVersionSettingEditResponse.WorkersBindingKindSendEmail | ScriptAndVersionSettingEditResponse.WorkersBindingKindService + | ScriptAndVersionSettingEditResponse.WorkersBindingKindTailConsumer | ScriptAndVersionSettingEditResponse.WorkersBindingKindTextBlob | ScriptAndVersionSettingEditResponse.WorkersBindingKindVectorize | ScriptAndVersionSettingEditResponse.WorkersBindingKindVersionMetadata @@ -567,6 +568,23 @@ export namespace ScriptAndVersionSettingEditResponse { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -821,6 +839,7 @@ export interface ScriptAndVersionSettingGetResponse { | ScriptAndVersionSettingGetResponse.WorkersBindingKindSecretText | ScriptAndVersionSettingGetResponse.WorkersBindingKindSendEmail | ScriptAndVersionSettingGetResponse.WorkersBindingKindService + | ScriptAndVersionSettingGetResponse.WorkersBindingKindTailConsumer | ScriptAndVersionSettingGetResponse.WorkersBindingKindTextBlob | ScriptAndVersionSettingGetResponse.WorkersBindingKindVectorize | ScriptAndVersionSettingGetResponse.WorkersBindingKindVersionMetadata @@ -1301,6 +1320,23 @@ export namespace ScriptAndVersionSettingGetResponse { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1568,6 +1604,7 @@ export namespace ScriptAndVersionSettingEditParams { | Settings.WorkersBindingKindSecretText | Settings.WorkersBindingKindSendEmail | Settings.WorkersBindingKindService + | Settings.WorkersBindingKindTailConsumer | Settings.WorkersBindingKindTextBlob | Settings.WorkersBindingKindVectorize | Settings.WorkersBindingKindVersionMetadata @@ -2058,6 +2095,23 @@ export namespace ScriptAndVersionSettingEditParams { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index a52d8a4ad2..70546d5580 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -681,6 +681,7 @@ export namespace ScriptUpdateParams { | Metadata.WorkersBindingKindSecretText | Metadata.WorkersBindingKindSendEmail | Metadata.WorkersBindingKindService + | Metadata.WorkersBindingKindTailConsumer | Metadata.WorkersBindingKindTextBlob | Metadata.WorkersBindingKindVectorize | Metadata.WorkersBindingKindVersionMetadata @@ -1254,6 +1255,23 @@ export namespace ScriptUpdateParams { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers/scripts/versions.ts b/src/resources/workers/scripts/versions.ts index 67d82e7c99..c9027b6f0c 100644 --- a/src/resources/workers/scripts/versions.ts +++ b/src/resources/workers/scripts/versions.ts @@ -134,6 +134,7 @@ export namespace VersionCreateResponse { | Resources.WorkersBindingKindSecretText | Resources.WorkersBindingKindSendEmail | Resources.WorkersBindingKindService + | Resources.WorkersBindingKindTailConsumer | Resources.WorkersBindingKindTextBlob | Resources.WorkersBindingKindVectorize | Resources.WorkersBindingKindVersionMetadata @@ -569,6 +570,23 @@ export namespace VersionCreateResponse { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -852,6 +870,7 @@ export namespace VersionGetResponse { | Resources.WorkersBindingKindSecretText | Resources.WorkersBindingKindSendEmail | Resources.WorkersBindingKindService + | Resources.WorkersBindingKindTailConsumer | Resources.WorkersBindingKindTextBlob | Resources.WorkersBindingKindVectorize | Resources.WorkersBindingKindVersionMetadata @@ -1287,6 +1306,23 @@ export namespace VersionGetResponse { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1562,6 +1598,7 @@ export namespace VersionCreateParams { | Metadata.WorkersBindingKindSecretText | Metadata.WorkersBindingKindSendEmail | Metadata.WorkersBindingKindService + | Metadata.WorkersBindingKindTailConsumer | Metadata.WorkersBindingKindTextBlob | Metadata.WorkersBindingKindVectorize | Metadata.WorkersBindingKindVersionMetadata @@ -2038,6 +2075,23 @@ export namespace VersionCreateParams { environment?: string; } + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * Name of Tail Worker to bind to. + */ + service: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } + export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. 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 2740494438..8ab49d5567 100644 --- a/src/resources/workflows/instances/instances.ts +++ b/src/resources/workflows/instances/instances.ts @@ -1,429 +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: `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. - */ - date_end?: string; - - /** - * Query param: Accepts ISO 8601 with no timezone offsets and in UTC. - */ - date_start?: string; - - /** - * Query param: should only be used when `cursor` is used, defines a new direction - * for the cursor - */ - direction?: 'asc' | 'desc'; - - /** - * 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/access/applications/applications.ts b/src/resources/zero-trust/access/applications/applications.ts index 7e7402cd82..1c6afd035f 100644 --- a/src/resources/zero-trust/access/applications/applications.ts +++ b/src/resources/zero-trust/access/applications/applications.ts @@ -1667,9 +1667,7 @@ export type ApplicationType = | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * The application type. @@ -1685,9 +1683,7 @@ export type ApplicationTypeParam = | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; export interface CORSHeaders { /** @@ -2674,11 +2670,7 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | SelfHostedApplication.PublicDestination - | SelfHostedApplication.PrivateDestination - | SelfHostedApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -2787,6 +2779,10 @@ export namespace ApplicationCreateResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -2818,19 +2814,6 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -3280,9 +3263,7 @@ export namespace ApplicationCreateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -3354,11 +3335,7 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserSSHApplication.PublicDestination - | BrowserSSHApplication.PrivateDestination - | BrowserSSHApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -3467,6 +3444,10 @@ export namespace ApplicationCreateResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -3498,19 +3479,6 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -3713,9 +3681,7 @@ export namespace ApplicationCreateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -3787,11 +3753,7 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserVNCApplication.PublicDestination - | BrowserVNCApplication.PrivateDestination - | BrowserVNCApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -3900,6 +3862,10 @@ export namespace ApplicationCreateResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -3931,19 +3897,6 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -4140,9 +4093,7 @@ export namespace ApplicationCreateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -4908,11 +4859,7 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserRdpApplication.PublicDestination - | BrowserRdpApplication.PrivateDestination - | BrowserRdpApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -5039,6 +4986,10 @@ export namespace ApplicationCreateResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -5070,19 +5021,6 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -5360,11 +5298,7 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | SelfHostedApplication.PublicDestination - | SelfHostedApplication.PrivateDestination - | SelfHostedApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -5473,6 +5407,10 @@ export namespace ApplicationUpdateResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -5504,19 +5442,6 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -5966,9 +5891,7 @@ export namespace ApplicationUpdateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -6040,11 +5963,7 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserSSHApplication.PublicDestination - | BrowserSSHApplication.PrivateDestination - | BrowserSSHApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -6153,6 +6072,10 @@ export namespace ApplicationUpdateResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -6184,19 +6107,6 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -6399,9 +6309,7 @@ export namespace ApplicationUpdateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -6473,11 +6381,7 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserVNCApplication.PublicDestination - | BrowserVNCApplication.PrivateDestination - | BrowserVNCApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -6586,6 +6490,10 @@ export namespace ApplicationUpdateResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -6617,19 +6525,6 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -6826,9 +6721,7 @@ export namespace ApplicationUpdateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -7594,11 +7487,7 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserRdpApplication.PublicDestination - | BrowserRdpApplication.PrivateDestination - | BrowserRdpApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -7725,6 +7614,10 @@ export namespace ApplicationUpdateResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -7756,19 +7649,6 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -8046,11 +7926,7 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | SelfHostedApplication.PublicDestination - | SelfHostedApplication.PrivateDestination - | SelfHostedApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -8159,6 +8035,10 @@ export namespace ApplicationListResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -8190,19 +8070,6 @@ export namespace ApplicationListResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -8652,9 +8519,7 @@ export namespace ApplicationListResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -8726,11 +8591,7 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserSSHApplication.PublicDestination - | BrowserSSHApplication.PrivateDestination - | BrowserSSHApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -8839,6 +8700,10 @@ export namespace ApplicationListResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -8870,19 +8735,6 @@ export namespace ApplicationListResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -9085,9 +8937,7 @@ export namespace ApplicationListResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -9159,11 +9009,7 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserVNCApplication.PublicDestination - | BrowserVNCApplication.PrivateDestination - | BrowserVNCApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -9272,6 +9118,10 @@ export namespace ApplicationListResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -9303,19 +9153,6 @@ export namespace ApplicationListResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -9512,9 +9349,7 @@ export namespace ApplicationListResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -10280,11 +10115,7 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserRdpApplication.PublicDestination - | BrowserRdpApplication.PrivateDestination - | BrowserRdpApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -10411,6 +10242,10 @@ export namespace ApplicationListResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -10442,19 +10277,6 @@ export namespace ApplicationListResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -10739,11 +10561,7 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | SelfHostedApplication.PublicDestination - | SelfHostedApplication.PrivateDestination - | SelfHostedApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -10852,6 +10670,10 @@ export namespace ApplicationGetResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -10883,19 +10705,6 @@ export namespace ApplicationGetResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -11345,9 +11154,7 @@ export namespace ApplicationGetResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -11419,11 +11226,7 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserSSHApplication.PublicDestination - | BrowserSSHApplication.PrivateDestination - | BrowserSSHApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -11532,6 +11335,10 @@ export namespace ApplicationGetResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -11563,19 +11370,6 @@ export namespace ApplicationGetResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -11778,9 +11572,7 @@ export namespace ApplicationGetResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -11852,11 +11644,7 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserVNCApplication.PublicDestination - | BrowserVNCApplication.PrivateDestination - | BrowserVNCApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -11965,6 +11753,10 @@ export namespace ApplicationGetResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -11996,19 +11788,6 @@ export namespace ApplicationGetResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -12205,9 +11984,7 @@ export namespace ApplicationGetResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * UUID. @@ -12973,11 +12750,7 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array< - | BrowserRdpApplication.PublicDestination - | BrowserRdpApplication.PrivateDestination - | BrowserRdpApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Enables the binding cookie, which increases security against compromised @@ -13104,6 +12877,10 @@ export namespace ApplicationGetResponse { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -13135,19 +12912,6 @@ export namespace ApplicationGetResponse { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - export interface Policy { /** * The UUID of the policy @@ -13434,11 +13198,7 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array< - | SelfHostedApplication.PublicDestination - | SelfHostedApplication.PrivateDestination - | SelfHostedApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Body param: Enables the binding cookie, which increases security against @@ -13553,6 +13313,10 @@ export declare namespace ApplicationCreateParams { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -13584,19 +13348,6 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - /** * A JSON that links a reusable policy to an application. */ @@ -14023,9 +13774,7 @@ export declare namespace ApplicationCreateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -14104,11 +13853,7 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array< - | BrowserSSHApplication.PublicDestination - | BrowserSSHApplication.PrivateDestination - | BrowserSSHApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Body param: Enables the binding cookie, which increases security against @@ -14223,6 +13968,10 @@ export declare namespace ApplicationCreateParams { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -14254,19 +14003,6 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - /** * A JSON that links a reusable policy to an application. */ @@ -14452,9 +14188,7 @@ export declare namespace ApplicationCreateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -14533,11 +14267,7 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array< - | BrowserVNCApplication.PublicDestination - | BrowserVNCApplication.PrivateDestination - | BrowserVNCApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Body param: Enables the binding cookie, which increases security against @@ -14652,6 +14382,10 @@ export declare namespace ApplicationCreateParams { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -14683,19 +14417,6 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - /** * A JSON that links a reusable policy to an application. */ @@ -14875,9 +14596,7 @@ export declare namespace ApplicationCreateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -15605,11 +15324,7 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array< - | BrowserRdpApplication.PublicDestination - | BrowserRdpApplication.PrivateDestination - | BrowserRdpApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Body param: Enables the binding cookie, which increases security against @@ -15742,6 +15457,10 @@ export declare namespace ApplicationCreateParams { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -15773,19 +15492,6 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - /** * A JSON that links a reusable policy to an application. */ @@ -16053,11 +15759,7 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array< - | SelfHostedApplication.PublicDestination - | SelfHostedApplication.PrivateDestination - | SelfHostedApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Body param: Enables the binding cookie, which increases security against @@ -16172,6 +15874,10 @@ export declare namespace ApplicationUpdateParams { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -16203,19 +15909,6 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - /** * A JSON that links a reusable policy to an application. */ @@ -16642,9 +16335,7 @@ export declare namespace ApplicationUpdateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -16723,11 +16414,7 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array< - | BrowserSSHApplication.PublicDestination - | BrowserSSHApplication.PrivateDestination - | BrowserSSHApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Body param: Enables the binding cookie, which increases security against @@ -16842,6 +16529,10 @@ export declare namespace ApplicationUpdateParams { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -16873,19 +16564,6 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - /** * A JSON that links a reusable policy to an application. */ @@ -17071,9 +16749,7 @@ export declare namespace ApplicationUpdateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -17152,11 +16828,7 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array< - | BrowserVNCApplication.PublicDestination - | BrowserVNCApplication.PrivateDestination - | BrowserVNCApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Body param: Enables the binding cookie, which increases security against @@ -17271,6 +16943,10 @@ export declare namespace ApplicationUpdateParams { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -17302,19 +16978,6 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - /** * A JSON that links a reusable policy to an application. */ @@ -17494,9 +17157,7 @@ export declare namespace ApplicationUpdateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp' - | 'mcp' - | 'mcp_portal'; + | 'rdp'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -18224,11 +17885,7 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array< - | BrowserRdpApplication.PublicDestination - | BrowserRdpApplication.PrivateDestination - | BrowserRdpApplication.ViaMcpServerPortalDestination - >; + destinations?: Array; /** * Body param: Enables the binding cookie, which increases security against @@ -18361,6 +18018,10 @@ export declare namespace ApplicationUpdateParams { uri?: string; } + /** + * Private destinations are an early access feature and gated behind a feature + * flag. + */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -18392,19 +18053,6 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } - /** - * A MCP server id configured in ai-controls. Access will secure the MCP server if - * accessed through a MCP portal. - */ - export interface ViaMcpServerPortalDestination { - /** - * The MCP server id configured in ai-controls. - */ - mcp_server_id?: string; - - type?: 'via_mcp_server_portal'; - } - /** * A JSON that links a reusable policy to an application. */ @@ -18608,11 +18256,6 @@ export interface ApplicationListParams extends V4PagePaginationArrayParams { * Query param: Search for apps by other listed query parameters. */ search?: string; - - /** - * Query param: Target Criteria attributes in key=value format. - */ - target_attributes?: string; } export interface ApplicationDeleteParams { diff --git a/src/resources/zero-trust/access/logs/access-requests.ts b/src/resources/zero-trust/access/logs/access-requests.ts index 4905779655..eb75000b09 100644 --- a/src/resources/zero-trust/access/logs/access-requests.ts +++ b/src/resources/zero-trust/access/logs/access-requests.ts @@ -43,20 +43,6 @@ export interface AccessRequestListParams { */ direction?: 'desc' | 'asc'; - /** - * Query param: Filter by user email. Defaults to substring matching. To force - * exact matching, set `email_exact=true`. Example (default): `email=@example.com` - * returns all events with that domain. Example (exact): - * `email=user@example.com&email_exact=true` returns only that user. - */ - email?: string; - - /** - * Query param: When true, `email` is matched exactly instead of substring - * matching. - */ - email_exact?: boolean; - /** * Query param: The maximum number of log entries to retrieve. */ @@ -81,11 +67,6 @@ export interface AccessRequestListParams { * Query param: The latest event timestamp to query. */ until?: string; - - /** - * Query param: Filter by user UUID. - */ - user_id?: string; } export declare namespace AccessRequests { diff --git a/src/resources/zero-trust/connectivity/directory/directory.ts b/src/resources/zero-trust/connectivity/directory/directory.ts index 8d0ed0ede1..0c979324a6 100644 --- a/src/resources/zero-trust/connectivity/directory/directory.ts +++ b/src/resources/zero-trust/connectivity/directory/directory.ts @@ -4,15 +4,10 @@ import { APIResource } from '../../../../resource'; import * as ServicesAPI from './services'; import { ServiceCreateParams, - ServiceCreateResponse, ServiceDeleteParams, ServiceGetParams, - ServiceGetResponse, ServiceListParams, - ServiceListResponse, - ServiceListResponsesV4PagePaginationArray, ServiceUpdateParams, - ServiceUpdateResponse, Services, } from './services'; @@ -21,16 +16,10 @@ export class Directory extends APIResource { } Directory.Services = Services; -Directory.ServiceListResponsesV4PagePaginationArray = ServiceListResponsesV4PagePaginationArray; export declare namespace Directory { export { Services as Services, - type ServiceCreateResponse as ServiceCreateResponse, - type ServiceUpdateResponse as ServiceUpdateResponse, - type ServiceListResponse as ServiceListResponse, - type ServiceGetResponse as ServiceGetResponse, - ServiceListResponsesV4PagePaginationArray as ServiceListResponsesV4PagePaginationArray, type ServiceCreateParams as ServiceCreateParams, type ServiceUpdateParams as ServiceUpdateParams, type ServiceListParams as ServiceListParams, diff --git a/src/resources/zero-trust/connectivity/directory/index.ts b/src/resources/zero-trust/connectivity/directory/index.ts index 2d94b5e566..78f208d56a 100644 --- a/src/resources/zero-trust/connectivity/directory/index.ts +++ b/src/resources/zero-trust/connectivity/directory/index.ts @@ -2,12 +2,7 @@ export { Directory } from './directory'; export { - ServiceListResponsesV4PagePaginationArray, Services, - type ServiceCreateResponse, - type ServiceUpdateResponse, - type ServiceListResponse, - type ServiceGetResponse, type ServiceCreateParams, type ServiceUpdateParams, type ServiceListParams, diff --git a/src/resources/zero-trust/connectivity/directory/services.ts b/src/resources/zero-trust/connectivity/directory/services.ts index 8942da54ff..74516c9f4d 100644 --- a/src/resources/zero-trust/connectivity/directory/services.ts +++ b/src/resources/zero-trust/connectivity/directory/services.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../../resource'; import * as Core from '../../../../core'; -import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../../pagination'; export class Services extends APIResource { /** @@ -10,30 +9,23 @@ export class Services extends APIResource { * * @example * ```ts - * const service = - * await client.zeroTrust.connectivity.directory.services.create( - * { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * host: { - * hostname: 'api.example.com', - * resolver_network: { - * tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da', - * }, - * }, - * name: 'web-server', - * type: 'http', - * }, - * ); + * await client.zeroTrust.connectivity.directory.services.create( + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * host: {}, + * name: 'name', + * type: 'http', + * }, + * ); * ``` */ - create(params: ServiceCreateParams, options?: Core.RequestOptions): Core.APIPromise { + create(params: ServiceCreateParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/connectivity/directory/services`, { - body, - ...options, - }) as Core.APIPromise<{ result: ServiceCreateResponse }> - )._thenUnwrap((obj) => obj.result); + return this._client.post(`/accounts/${account_id}/connectivity/directory/services`, { + body, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); } /** @@ -41,35 +33,28 @@ export class Services extends APIResource { * * @example * ```ts - * const service = - * await client.zeroTrust.connectivity.directory.services.update( - * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * { - * account_id: 'account_id', - * host: { - * ipv4: '10.0.0.1', - * network: { - * tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da', - * }, - * }, - * name: 'web-app', - * type: 'http', - * }, - * ); + * await client.zeroTrust.connectivity.directory.services.update( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { + * account_id: 'account_id', + * host: {}, + * name: 'name', + * type: 'http', + * }, + * ); * ``` */ update( serviceId: string, params: ServiceUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, ...body } = params; - return ( - this._client.put(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: ServiceUpdateResponse }> - )._thenUnwrap((obj) => obj.result); + return this._client.put(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { + body, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); } /** @@ -77,24 +62,18 @@ export class Services extends APIResource { * * @example * ```ts - * // Automatically fetches more pages as needed. - * for await (const serviceListResponse of client.zeroTrust.connectivity.directory.services.list( + * await client.zeroTrust.connectivity.directory.services.list( * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } + * ); * ``` */ - list( - params: ServiceListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { + list(params: ServiceListParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...query } = params; - return this._client.getAPIList( - `/accounts/${account_id}/connectivity/directory/services`, - ServiceListResponsesV4PagePaginationArray, - { query, ...options }, - ); + return this._client.get(`/accounts/${account_id}/connectivity/directory/services`, { + query, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); } /** @@ -125,331 +104,18 @@ export class Services extends APIResource { * * @example * ```ts - * const service = - * await client.zeroTrust.connectivity.directory.services.get( - * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * { account_id: 'account_id' }, - * ); + * await client.zeroTrust.connectivity.directory.services.get( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'account_id' }, + * ); * ``` */ - get( - serviceId: string, - params: ServiceGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + get(serviceId: string, params: ServiceGetParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/connectivity/directory/services/${serviceId}`, - options, - ) as Core.APIPromise<{ result: ServiceGetResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export class ServiceListResponsesV4PagePaginationArray extends V4PagePaginationArray {} - -export interface ServiceCreateResponse { - host: - | ServiceCreateResponse.InfraIPv4Host - | ServiceCreateResponse.InfraIPv6Host - | ServiceCreateResponse.InfraDualStackHost - | ServiceCreateResponse.InfraHostnameHost; - - name: string; - - type: 'http'; - - created_at?: string; - - http_port?: number | null; - - https_port?: number | null; - - service_id?: string; - - updated_at?: string; -} - -export namespace ServiceCreateResponse { - export interface InfraIPv4Host { - ipv4: string; - - network: InfraIPv4Host.Network; - } - - export namespace InfraIPv4Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraIPv6Host { - ipv6: string; - - network: InfraIPv6Host.Network; - } - - export namespace InfraIPv6Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraDualStackHost { - ipv4: string; - - ipv6: string; - - network: InfraDualStackHost.Network; - } - - export namespace InfraDualStackHost { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraHostnameHost { - hostname: string; - - resolver_network: InfraHostnameHost.ResolverNetwork; - } - - export namespace InfraHostnameHost { - export interface ResolverNetwork { - tunnel_id: string; - - resolver_ips?: Array | null; - } - } -} - -export interface ServiceUpdateResponse { - host: - | ServiceUpdateResponse.InfraIPv4Host - | ServiceUpdateResponse.InfraIPv6Host - | ServiceUpdateResponse.InfraDualStackHost - | ServiceUpdateResponse.InfraHostnameHost; - - name: string; - - type: 'http'; - - created_at?: string; - - http_port?: number | null; - - https_port?: number | null; - - service_id?: string; - - updated_at?: string; -} - -export namespace ServiceUpdateResponse { - export interface InfraIPv4Host { - ipv4: string; - - network: InfraIPv4Host.Network; - } - - export namespace InfraIPv4Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraIPv6Host { - ipv6: string; - - network: InfraIPv6Host.Network; - } - - export namespace InfraIPv6Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraDualStackHost { - ipv4: string; - - ipv6: string; - - network: InfraDualStackHost.Network; - } - - export namespace InfraDualStackHost { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraHostnameHost { - hostname: string; - - resolver_network: InfraHostnameHost.ResolverNetwork; - } - - export namespace InfraHostnameHost { - export interface ResolverNetwork { - tunnel_id: string; - - resolver_ips?: Array | null; - } - } -} - -export interface ServiceListResponse { - host: - | ServiceListResponse.InfraIPv4Host - | ServiceListResponse.InfraIPv6Host - | ServiceListResponse.InfraDualStackHost - | ServiceListResponse.InfraHostnameHost; - - name: string; - - type: 'http'; - - created_at?: string; - - http_port?: number | null; - - https_port?: number | null; - - service_id?: string; - - updated_at?: string; -} - -export namespace ServiceListResponse { - export interface InfraIPv4Host { - ipv4: string; - - network: InfraIPv4Host.Network; - } - - export namespace InfraIPv4Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraIPv6Host { - ipv6: string; - - network: InfraIPv6Host.Network; - } - - export namespace InfraIPv6Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraDualStackHost { - ipv4: string; - - ipv6: string; - - network: InfraDualStackHost.Network; - } - - export namespace InfraDualStackHost { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraHostnameHost { - hostname: string; - - resolver_network: InfraHostnameHost.ResolverNetwork; - } - - export namespace InfraHostnameHost { - export interface ResolverNetwork { - tunnel_id: string; - - resolver_ips?: Array | null; - } - } -} - -export interface ServiceGetResponse { - host: - | ServiceGetResponse.InfraIPv4Host - | ServiceGetResponse.InfraIPv6Host - | ServiceGetResponse.InfraDualStackHost - | ServiceGetResponse.InfraHostnameHost; - - name: string; - - type: 'http'; - - created_at?: string; - - http_port?: number | null; - - https_port?: number | null; - - service_id?: string; - - updated_at?: string; -} - -export namespace ServiceGetResponse { - export interface InfraIPv4Host { - ipv4: string; - - network: InfraIPv4Host.Network; - } - - export namespace InfraIPv4Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraIPv6Host { - ipv6: string; - - network: InfraIPv6Host.Network; - } - - export namespace InfraIPv6Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraDualStackHost { - ipv4: string; - - ipv6: string; - - network: InfraDualStackHost.Network; - } - - export namespace InfraDualStackHost { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraHostnameHost { - hostname: string; - - resolver_network: InfraHostnameHost.ResolverNetwork; - } - - export namespace InfraHostnameHost { - export interface ResolverNetwork { - tunnel_id: string; - - resolver_ips?: Array | null; - } + return this._client.get(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); } } @@ -462,11 +128,7 @@ export interface ServiceCreateParams { /** * Body param: */ - host: - | ServiceCreateParams.InfraIPv4Host - | ServiceCreateParams.InfraIPv6Host - | ServiceCreateParams.InfraDualStackHost - | ServiceCreateParams.InfraHostnameHost; + host: ServiceCreateParams.Host; /** * Body param: @@ -490,56 +152,16 @@ export interface ServiceCreateParams { } export namespace ServiceCreateParams { - export interface InfraIPv4Host { - ipv4: string; - - network: InfraIPv4Host.Network; - } - - export namespace InfraIPv4Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraIPv6Host { - ipv6: string; + export interface Host { + hostname?: string | null; - network: InfraIPv6Host.Network; - } - - export namespace InfraIPv6Host { - export interface Network { - tunnel_id: string; - } - } + ipv4?: string; - export interface InfraDualStackHost { - ipv4: string; + ipv6?: string; - ipv6: string; + network?: unknown; - network: InfraDualStackHost.Network; - } - - export namespace InfraDualStackHost { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraHostnameHost { - hostname: string; - - resolver_network: InfraHostnameHost.ResolverNetwork; - } - - export namespace InfraHostnameHost { - export interface ResolverNetwork { - tunnel_id: string; - - resolver_ips?: Array | null; - } + resolver_network?: unknown; } } @@ -552,11 +174,7 @@ export interface ServiceUpdateParams { /** * Body param: */ - host: - | ServiceUpdateParams.InfraIPv4Host - | ServiceUpdateParams.InfraIPv6Host - | ServiceUpdateParams.InfraDualStackHost - | ServiceUpdateParams.InfraHostnameHost; + host: ServiceUpdateParams.Host; /** * Body param: @@ -580,65 +198,35 @@ export interface ServiceUpdateParams { } export namespace ServiceUpdateParams { - export interface InfraIPv4Host { - ipv4: string; + export interface Host { + hostname?: string | null; - network: InfraIPv4Host.Network; - } + ipv4?: string; - export namespace InfraIPv4Host { - export interface Network { - tunnel_id: string; - } - } + ipv6?: string; - export interface InfraIPv6Host { - ipv6: string; + network?: unknown; - network: InfraIPv6Host.Network; - } - - export namespace InfraIPv6Host { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraDualStackHost { - ipv4: string; - - ipv6: string; - - network: InfraDualStackHost.Network; - } - - export namespace InfraDualStackHost { - export interface Network { - tunnel_id: string; - } - } - - export interface InfraHostnameHost { - hostname: string; - - resolver_network: InfraHostnameHost.ResolverNetwork; - } - - export namespace InfraHostnameHost { - export interface ResolverNetwork { - tunnel_id: string; - - resolver_ips?: Array | null; - } + resolver_network?: unknown; } } -export interface ServiceListParams extends V4PagePaginationArrayParams { +export interface ServiceListParams { /** * Path param: Account identifier */ account_id: string; + /** + * Query param: Current page in the response + */ + page?: number; + + /** + * Query param: Max amount of entries returned per page + */ + per_page?: number; + /** * Query param: */ @@ -653,15 +241,8 @@ export interface ServiceGetParams { account_id: string; } -Services.ServiceListResponsesV4PagePaginationArray = ServiceListResponsesV4PagePaginationArray; - export declare namespace Services { export { - type ServiceCreateResponse as ServiceCreateResponse, - type ServiceUpdateResponse as ServiceUpdateResponse, - type ServiceListResponse as ServiceListResponse, - type ServiceGetResponse as ServiceGetResponse, - ServiceListResponsesV4PagePaginationArray as ServiceListResponsesV4PagePaginationArray, type ServiceCreateParams as ServiceCreateParams, type ServiceUpdateParams as ServiceUpdateParams, type ServiceListParams as ServiceListParams, diff --git a/src/resources/zero-trust/devices/dex-tests.ts b/src/resources/zero-trust/devices/dex-tests.ts index 4446969263..024ac99cae 100644 --- a/src/resources/zero-trust/devices/dex-tests.ts +++ b/src/resources/zero-trust/devices/dex-tests.ts @@ -13,7 +13,10 @@ export class DEXTests extends APIResource { * const dexTest = * await client.zeroTrust.devices.dexTests.create({ * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: {}, + * data: { + * host: 'https://dash.cloudflare.com', + * kind: 'http', + * }, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -40,7 +43,10 @@ export class DEXTests extends APIResource { * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: {}, + * data: { + * host: 'https://dash.cloudflare.com', + * kind: 'http', + * }, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -271,24 +277,24 @@ export namespace DEXTestCreateResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -351,24 +357,24 @@ export namespace DEXTestUpdateResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -431,24 +437,24 @@ export namespace DEXTestListResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -516,24 +522,24 @@ export namespace DEXTestDeleteResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -597,24 +603,24 @@ export namespace DEXTestGetResponse { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -680,24 +686,24 @@ export namespace DEXTestCreateParams { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default @@ -763,24 +769,24 @@ export namespace DEXTestUpdateParams { /** * The desired endpoint to test. */ - host?: string; + host: string; /** * The type of test. */ - kind?: string; + kind: 'http' | 'traceroute'; /** * The HTTP request method type. */ - method?: string; + method?: 'GET'; } export interface TargetPolicy { /** - * The id of the DEX rule + * API Resource UUID tag. */ - id?: string; + id: string; /** * Whether the DEX rule is the account default diff --git a/src/resources/zero-trust/devices/posture/posture.ts b/src/resources/zero-trust/devices/posture/posture.ts index 54f186eca7..3b2bd2a898 100644 --- a/src/resources/zero-trust/devices/posture/posture.ts +++ b/src/resources/zero-trust/devices/posture/posture.ts @@ -850,7 +850,7 @@ export interface OSVersionInput { /** * Additional version data. For Mac or iOS, the Product Version Extra. For Linux, - * the distribution name and version. (Mac, iOS, and Linux only). + * the kernel release version. (Mac, iOS, and Linux only). */ os_version_extra?: string; } @@ -883,7 +883,7 @@ export interface OSVersionInputParam { /** * Additional version data. For Mac or iOS, the Product Version Extra. For Linux, - * the distribution name and version. (Mac, iOS, and Linux only). + * the kernel release version. (Mac, iOS, and Linux only). */ os_version_extra?: string; } 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/zero-trust/dex/dex.ts b/src/resources/zero-trust/dex/dex.ts index f12a3ad01f..a500404035 100644 --- a/src/resources/zero-trust/dex/dex.ts +++ b/src/resources/zero-trust/dex/dex.ts @@ -29,6 +29,7 @@ import { FleetStatusLiveParams, FleetStatusLiveResponse, FleetStatusOverTimeParams, + FleetStatusOverTimeResponse, LiveStat, } from './fleet-status/fleet-status'; import * as HTTPTestsAPI from './http-tests/http-tests'; @@ -53,6 +54,9 @@ export class DEX extends APIResource { } export interface DigitalExperienceMonitor { + /** + * API Resource UUID tag. + */ id: string; /** @@ -208,6 +212,7 @@ export declare namespace DEX { FleetStatus as FleetStatus, type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, + type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts index a64c26da75..43f7978b75 100644 --- a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts +++ b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts @@ -44,20 +44,25 @@ export class FleetStatus extends APIResource { * * @example * ```ts - * await client.zeroTrust.dex.fleetStatus.overTime({ - * account_id: '01a7362d577a6c3019a474fd6f485823', - * from: '2023-10-11T00:00:00Z', - * to: '2023-10-11T00:00:00Z', - * }); + * const response = + * await client.zeroTrust.dex.fleetStatus.overTime({ + * account_id: '01a7362d577a6c3019a474fd6f485823', + * from: '2023-10-11T00:00:00Z', + * to: '2023-10-11T00:00:00Z', + * }); * ``` */ - overTime(params: FleetStatusOverTimeParams, options?: Core.RequestOptions): Core.APIPromise { + overTime( + params: FleetStatusOverTimeParams, + options?: Core.RequestOptions, + ): Core.APIPromise { const { account_id, ...query } = params; - return this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { - query, - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + return ( + this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { + query, + ...options, + }) as Core.APIPromise<{ result: FleetStatusOverTimeResponse }> + )._thenUnwrap((obj) => obj.result); } } @@ -93,6 +98,53 @@ export namespace FleetStatusLiveResponse { } } +export interface FleetStatusOverTimeResponse { + deviceStats?: FleetStatusOverTimeResponse.DeviceStats; +} + +export namespace FleetStatusOverTimeResponse { + export interface DeviceStats { + byMode?: Array; + + byStatus?: Array; + + /** + * Number of unique devices + */ + uniqueDevicesTotal?: number; + } + + export namespace DeviceStats { + export interface ByMode { + /** + * Timestamp in ISO format + */ + timestamp?: string; + + /** + * Number of unique devices + */ + uniqueDevicesTotal?: number; + + value?: string; + } + + export interface ByStatus { + /** + * Timestamp in ISO format + */ + timestamp?: string; + + /** + * Number of unique devices + */ + uniqueDevicesTotal?: number; + + value?: string; + } + } +} + export interface FleetStatusLiveParams { /** * Path param: Unique identifier for account @@ -139,6 +191,7 @@ export declare namespace FleetStatus { export { type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, + type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/index.ts b/src/resources/zero-trust/dex/fleet-status/index.ts index 31cdb34bb8..8bf3ee7730 100644 --- a/src/resources/zero-trust/dex/fleet-status/index.ts +++ b/src/resources/zero-trust/dex/fleet-status/index.ts @@ -10,6 +10,7 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, + type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status'; diff --git a/src/resources/zero-trust/dex/index.ts b/src/resources/zero-trust/dex/index.ts index f97aa02d43..d0f4eae54c 100644 --- a/src/resources/zero-trust/dex/index.ts +++ b/src/resources/zero-trust/dex/index.ts @@ -20,6 +20,7 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, + type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status/index'; diff --git a/src/resources/zero-trust/dlp/entries/custom.ts b/src/resources/zero-trust/dlp/entries/custom.ts index 15d6ea9d8c..dcd4d0928f 100644 --- a/src/resources/zero-trust/dlp/entries/custom.ts +++ b/src/resources/zero-trust/dlp/entries/custom.ts @@ -17,6 +17,7 @@ export class Custom extends APIResource { * enabled: true, * name: 'name', * pattern: { regex: 'regex' }, + * profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * }); * ``` */ @@ -470,7 +471,7 @@ export interface CustomCreateParams { /** * Body param: */ - profile_id?: string; + profile_id: string; } export interface CustomUpdateParams { diff --git a/src/resources/zero-trust/dlp/entries/entries.ts b/src/resources/zero-trust/dlp/entries/entries.ts index de1cb6ba36..31eb68b9ee 100644 --- a/src/resources/zero-trust/dlp/entries/entries.ts +++ b/src/resources/zero-trust/dlp/entries/entries.ts @@ -65,6 +65,7 @@ export class Entries extends APIResource { * enabled: true, * name: 'name', * pattern: { regex: 'regex' }, + * profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * }); * ``` */ @@ -636,7 +637,7 @@ export interface EntryCreateParams { /** * Body param: */ - profile_id?: string; + profile_id: string; } export type EntryUpdateParams = diff --git a/src/resources/zero-trust/gateway/configurations/configurations.ts b/src/resources/zero-trust/gateway/configurations/configurations.ts index fb9a035b50..9f7a1aacb5 100755 --- a/src/resources/zero-trust/gateway/configurations/configurations.ts +++ b/src/resources/zero-trust/gateway/configurations/configurations.ts @@ -406,11 +406,12 @@ export interface CustomCertificateSettingsParam { } /** - * Configures user email settings for firewall policies. When you enable this, the - * system standardizes email addresses in the identity portion of the rule to match - * extended email variants in firewall policies. When you disable this setting, the - * system matches email addresses exactly as you provide them. Enable this setting - * if your email uses `.` or `+` modifiers. + * Specify user email settings for the firewall policies. When this is enabled, we + * standardize the email addresses in the identity part of the rule, so that they + * match the extended email variants in the firewall policies. When this setting is + * turned off, the email addresses in the identity part of the rule will be matched + * exactly as provided. If your email has `.` or `+` modifiers, you should enable + * this setting. */ export interface ExtendedEmailMatching { /** @@ -437,11 +438,12 @@ export interface ExtendedEmailMatching { } /** - * Configures user email settings for firewall policies. When you enable this, the - * system standardizes email addresses in the identity portion of the rule to match - * extended email variants in firewall policies. When you disable this setting, the - * system matches email addresses exactly as you provide them. Enable this setting - * if your email uses `.` or `+` modifiers. + * Specify user email settings for the firewall policies. When this is enabled, we + * standardize the email addresses in the identity part of the rule, so that they + * match the extended email variants in the firewall policies. When this setting is + * turned off, the email addresses in the identity part of the rule will be matched + * exactly as provided. If your email has `.` or `+` modifiers, you should enable + * this setting. */ export interface ExtendedEmailMatchingParam { /** @@ -513,11 +515,12 @@ export interface GatewayConfigurationSettings { custom_certificate?: CustomCertificateSettings | null; /** - * Configures user email settings for firewall policies. When you enable this, the - * system standardizes email addresses in the identity portion of the rule to match - * extended email variants in firewall policies. When you disable this setting, the - * system matches email addresses exactly as you provide them. Enable this setting - * if your email uses `.` or `+` modifiers. + * Specify user email settings for the firewall policies. When this is enabled, we + * standardize the email addresses in the identity part of the rule, so that they + * match the extended email variants in the firewall policies. When this setting is + * turned off, the email addresses in the identity part of the rule will be matched + * exactly as provided. If your email has `.` or `+` modifiers, you should enable + * this setting. */ extended_email_matching?: ExtendedEmailMatching | null; @@ -648,11 +651,12 @@ export interface GatewayConfigurationSettingsParam { custom_certificate?: CustomCertificateSettingsParam | null; /** - * Configures user email settings for firewall policies. When you enable this, the - * system standardizes email addresses in the identity portion of the rule to match - * extended email variants in firewall policies. When you disable this setting, the - * system matches email addresses exactly as you provide them. Enable this setting - * if your email uses `.` or `+` modifiers. + * Specify user email settings for the firewall policies. When this is enabled, we + * standardize the email addresses in the identity part of the rule, so that they + * match the extended email variants in the firewall policies. When this setting is + * turned off, the email addresses in the identity part of the rule will be matched + * exactly as provided. If your email has `.` or `+` modifiers, you should enable + * this setting. */ extended_email_matching?: ExtendedEmailMatchingParam | null; diff --git a/src/resources/zero-trust/gateway/rules.ts b/src/resources/zero-trust/gateway/rules.ts index 845f44fd1f..3187b1c5d2 100644 --- a/src/resources/zero-trust/gateway/rules.ts +++ b/src/resources/zero-trust/gateway/rules.ts @@ -321,7 +321,7 @@ export interface GatewayRule { /** * Specify the protocol or layer to evaluate the traffic, identity, and device - * posture expressions. Can only contain a single value. + * posture expressions. */ filters: Array; @@ -393,10 +393,12 @@ export interface GatewayRule { read_only?: boolean; /** - * Defines settings for this rule. Settings apply only to specific rule types and - * must use compatible selectors. If Terraform detects drift, confirm the setting - * supports your rule type and check whether the API modifies the value. Use - * API-returned values in your configuration to prevent drift. + * Set settings related to this rule. Each setting is only valid for specific rule + * types and can only be used with the appropriate selectors. If Terraform drift is + * observed in these setting values, verify that the setting is supported for the + * given rule type and that the API response reflects the requested value. If the + * API response returns sanitized or modified values that differ from the request, + * use the API-provided values in Terraform to ensure consistency. */ rule_settings?: RuleSetting; @@ -459,10 +461,12 @@ export namespace GatewayRule { } /** - * Defines settings for this rule. Settings apply only to specific rule types and - * must use compatible selectors. If Terraform detects drift, confirm the setting - * supports your rule type and check whether the API modifies the value. Use - * API-returned values in your configuration to prevent drift. + * Set settings related to this rule. Each setting is only valid for specific rule + * types and can only be used with the appropriate selectors. If Terraform drift is + * observed in these setting values, verify that the setting is supported for the + * given rule type and that the API response reflects the requested value. If the + * API response returns sanitized or modified values that differ from the request, + * use the API-provided values in Terraform to ensure consistency. */ export interface RuleSetting { /** @@ -916,10 +920,12 @@ export namespace RuleSetting { } /** - * Defines settings for this rule. Settings apply only to specific rule types and - * must use compatible selectors. If Terraform detects drift, confirm the setting - * supports your rule type and check whether the API modifies the value. Use - * API-returned values in your configuration to prevent drift. + * Set settings related to this rule. Each setting is only valid for specific rule + * types and can only be used with the appropriate selectors. If Terraform drift is + * observed in these setting values, verify that the setting is supported for the + * given rule type and that the API response reflects the requested value. If the + * API response returns sanitized or modified values that differ from the request, + * use the API-provided values in Terraform to ensure consistency. */ export interface RuleSettingParam { /** @@ -1578,7 +1584,7 @@ export interface RuleCreateParams { /** * Body param: Specify the protocol or layer to evaluate the traffic, identity, and - * device posture expressions. Can only contain a single value. + * device posture expressions. */ filters?: Array; @@ -1600,10 +1606,13 @@ export interface RuleCreateParams { precedence?: number; /** - * Body param: Defines settings for this rule. Settings apply only to specific rule - * types and must use compatible selectors. If Terraform detects drift, confirm the - * setting supports your rule type and check whether the API modifies the value. - * Use API-returned values in your configuration to prevent drift. + * Body param: Set settings related to this rule. Each setting is only valid for + * specific rule types and can only be used with the appropriate selectors. If + * Terraform drift is observed in these setting values, verify that the setting is + * supported for the given rule type and that the API response reflects the + * requested value. If the API response returns sanitized or modified values that + * differ from the request, use the API-provided values in Terraform to ensure + * consistency. */ rule_settings?: RuleSettingParam; @@ -1706,7 +1715,7 @@ export interface RuleUpdateParams { /** * Body param: Specify the protocol or layer to evaluate the traffic, identity, and - * device posture expressions. Can only contain a single value. + * device posture expressions. */ filters?: Array; @@ -1728,10 +1737,13 @@ export interface RuleUpdateParams { precedence?: number; /** - * Body param: Defines settings for this rule. Settings apply only to specific rule - * types and must use compatible selectors. If Terraform detects drift, confirm the - * setting supports your rule type and check whether the API modifies the value. - * Use API-returned values in your configuration to prevent drift. + * Body param: Set settings related to this rule. Each setting is only valid for + * specific rule types and can only be used with the appropriate selectors. If + * Terraform drift is observed in these setting values, verify that the setting is + * supported for the given rule type and that the API response reflects the + * requested value. If the API response returns sanitized or modified values that + * differ from the request, use the API-provided values in Terraform to ensure + * consistency. */ rule_settings?: RuleSettingParam; diff --git a/tests/api-resources/abuse-reports.test.ts b/tests/api-resources/abuse-reports.test.ts deleted file mode 100644 index 4b1fb3b55a..0000000000 --- a/tests/api-resources/abuse-reports.test.ts +++ /dev/null @@ -1,69 +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 abuseReports', () => { - // TODO: investigate unauthorized HTTP response - test.skip('create: only required params', async () => { - const responsePromise = client.abuseReports.create('report_param', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - 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(); - 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 unauthorized HTTP response - test.skip('create: required and optional params', async () => { - const response = await client.abuseReports.create('report_param', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - 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', - comments: 'x', - company: 'x', - reported_country: 'xx', - reported_user_agent: 'x', - tele: 'x', - title: 'x', - }); - }); -}); diff --git a/tests/api-resources/accounts/accounts.test.ts b/tests/api-resources/accounts/accounts.test.ts index c3e50bb520..562c65986b 100644 --- a/tests/api-resources/accounts/accounts.test.ts +++ b/tests/api-resources/accounts/accounts.test.ts @@ -51,7 +51,6 @@ describe('resource accounts', () => { id: '023e105f4ecef8ad9ca31a8372d0c353', name: 'Demo Account', type: 'standard', - managed_by: {}, settings: { abuse_contact_email: 'abuse_contact_email', enforce_twofactor: true }, }); }); diff --git a/tests/api-resources/api-gateway/configurations.test.ts b/tests/api-resources/api-gateway/configurations.test.ts index 40818b7ce6..307fcd648e 100644 --- a/tests/api-resources/api-gateway/configurations.test.ts +++ b/tests/api-resources/api-gateway/configurations.test.ts @@ -47,6 +47,7 @@ describe('resource configurations', () => { test('get: required and optional params', async () => { const response = await client.apiGateway.configurations.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + properties: ['auth_id_characteristics'], }); }); }); diff --git a/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts b/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts deleted file mode 100644 index 9bd29bee68..0000000000 --- a/tests/api-resources/cloudforce-one/threat-events/indicator-types.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 indicatorTypes', () => { - // TODO: HTTP 401 from prism - test.skip('list: only required params', async () => { - const responsePromise = client.cloudforceOne.threatEvents.indicatorTypes.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); - }); - - // TODO: HTTP 401 from prism - test.skip('list: required and optional params', async () => { - const response = await client.cloudforceOne.threatEvents.indicatorTypes.list({ - account_id: 'account_id', - }); - }); -}); 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 a543062bc0..d69492f799 100644 --- a/tests/api-resources/kv/namespaces/namespaces.test.ts +++ b/tests/api-resources/kv/namespaces/namespaces.test.ts @@ -69,7 +69,7 @@ describe('resource namespaces', () => { direction: 'asc', order: 'id', page: 1, - per_page: 1, + per_page: 5, }); }); @@ -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 03fbaa4b52..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: {}, }); }); diff --git a/tests/api-resources/leaked-credential-checks/detections.test.ts b/tests/api-resources/leaked-credential-checks/detections.test.ts deleted file mode 100644 index f9a1af0b8e..0000000000 --- a/tests/api-resources/leaked-credential-checks/detections.test.ts +++ /dev/null @@ -1,98 +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 detections', () => { - test('create: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.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.leakedCredentialChecks.detections.create({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - password: 'lookup_json_string(http.request.body.raw, "secret")', - username: 'lookup_json_string(http.request.body.raw, "user")', - }); - }); - - test('update: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.update( - '18a14bafaa8eb1df04ce683ec18c765e', - { 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('update: required and optional params', async () => { - const response = await client.leakedCredentialChecks.detections.update( - '18a14bafaa8eb1df04ce683ec18c765e', - { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - password: 'lookup_json_string(http.request.body.raw, "secret")', - username: 'lookup_json_string(http.request.body.raw, "user")', - }, - ); - }); - - test('list: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.list({ - 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('list: required and optional params', async () => { - const response = await client.leakedCredentialChecks.detections.list({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - }); - - test('delete: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.detections.delete( - '18a14bafaa8eb1df04ce683ec18c765e', - { 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('delete: required and optional params', async () => { - const response = await client.leakedCredentialChecks.detections.delete( - '18a14bafaa8eb1df04ce683ec18c765e', - { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); - }); -}); diff --git a/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts b/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts deleted file mode 100644 index c7c208f9ed..0000000000 --- a/tests/api-resources/leaked-credential-checks/leaked-credential-checks.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 leakedCredentialChecks', () => { - test('create: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.create({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - enabled: true, - }); - }); - - test('get: only required params', async () => { - const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); - }); -}); 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/consumers.test.ts b/tests/api-resources/queues/consumers.test.ts index e4275cc8e0..9cff12967c 100644 --- a/tests/api-resources/queues/consumers.test.ts +++ b/tests/api-resources/queues/consumers.test.ts @@ -115,27 +115,4 @@ describe('resource consumers', () => { { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); }); - - test('get: only required params', async () => { - const responsePromise = client.queues.consumers.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '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('get: required and optional params', async () => { - const response = await client.queues.consumers.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); - }); }); 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/queues/subscriptions.test.ts b/tests/api-resources/queues/subscriptions.test.ts deleted file mode 100644 index cefb7a8db1..0000000000 --- a/tests/api-resources/queues/subscriptions.test.ts +++ /dev/null @@ -1,120 +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 subscriptions', () => { - test('create: only required params', async () => { - const responsePromise = client.queues.subscriptions.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.queues.subscriptions.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - destination: { queue_id: 'queue_id', type: 'queues.queue' }, - enabled: true, - events: ['string'], - name: 'name', - source: { type: 'images' }, - }); - }); - - test('update: only required params', async () => { - const responsePromise = client.queues.subscriptions.update('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('update: required and optional params', async () => { - const response = await client.queues.subscriptions.update('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - destination: { queue_id: 'queue_id', type: 'queues.queue' }, - enabled: true, - events: ['string'], - name: 'name', - }); - }); - - test('list: only required params', async () => { - const responsePromise = client.queues.subscriptions.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.queues.subscriptions.list({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - direction: 'asc', - order: 'created_at', - page: 1, - per_page: 1, - }); - }); - - test('delete: only required params', async () => { - const responsePromise = client.queues.subscriptions.delete('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('delete: required and optional params', async () => { - const response = await client.queues.subscriptions.delete('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - }); - - test('get: only required params', async () => { - const responsePromise = client.queues.subscriptions.get('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('get: required and optional params', async () => { - const response = await client.queues.subscriptions.get('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - }); -}); diff --git a/tests/api-resources/r2/buckets/event-notifications.test.ts b/tests/api-resources/r2/buckets/event-notifications.test.ts index 07d3d03635..120dc9ff67 100644 --- a/tests/api-resources/r2/buckets/event-notifications.test.ts +++ b/tests/api-resources/r2/buckets/event-notifications.test.ts @@ -14,7 +14,6 @@ describe('resource eventNotifications', () => { test.skip('update: only required params', async () => { const responsePromise = client.r2.buckets.eventNotifications.update('example-bucket', 'queue_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - rules: [{ actions: ['PutObject', 'CopyObject'] }], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); diff --git a/tests/api-resources/secrets-store/stores/secrets.test.ts b/tests/api-resources/secrets-store/stores/secrets.test.ts index 51d39096f9..afb8337e61 100644 --- a/tests/api-resources/secrets-store/stores/secrets.test.ts +++ b/tests/api-resources/secrets-store/stores/secrets.test.ts @@ -13,13 +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', 'ai_gateway', 'dex', 'access'], - 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); @@ -36,7 +30,7 @@ describe('resource secrets', () => { body: [ { name: 'MY_API_KEY', - scopes: ['workers', 'ai_gateway', 'dex', 'access'], + scopes: ['workers', 'ai_gateway'], value: 'api-token-secret-123', comment: 'info about my secret', }, @@ -66,7 +60,7 @@ describe('resource secrets', () => { order: 'name', page: 2, per_page: 20, - scopes: [['workers', 'ai_gateway', 'dex', 'access']], + scopes: [['workers', 'ai_gateway']], search: 'search', }); }); @@ -122,7 +116,7 @@ describe('resource secrets', () => { { account_id: '985e105f4ecef8ad9ca31a8372d0c353', name: 'MY_API_KEY', - scopes: ['workers', 'ai_gateway', 'dex', 'access'], + scopes: ['workers', 'ai_gateway'], }, ); const rawResponse = await responsePromise.asResponse(); @@ -142,7 +136,7 @@ describe('resource secrets', () => { { account_id: '985e105f4ecef8ad9ca31a8372d0c353', name: 'MY_API_KEY', - scopes: ['workers', 'ai_gateway', 'dex', 'access'], + scopes: ['workers', 'ai_gateway'], comment: 'info about my secret', }, ); @@ -172,7 +166,7 @@ describe('resource secrets', () => { { account_id: '985e105f4ecef8ad9ca31a8372d0c353', comment: 'info about my secret', - scopes: ['workers', 'ai_gateway', 'dex', 'access'], + scopes: ['workers', 'ai_gateway'], }, ); }); 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 cdad8d0e4b..0000000000 --- a/tests/api-resources/workflows/instances/instances.test.ts +++ /dev/null @@ -1,89 +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', - cursor: 'cursor', - date_end: '2019-12-27T18:11:19.117Z', - date_start: '2019-12-27T18:11:19.117Z', - direction: 'asc', - 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' }); - }); -}); diff --git a/tests/api-resources/zero-trust/access/applications/applications.test.ts b/tests/api-resources/zero-trust/access/applications/applications.test.ts index e4607eeda4..225d81744d 100644 --- a/tests/api-resources/zero-trust/access/applications/applications.test.ts +++ b/tests/api-resources/zero-trust/access/applications/applications.test.ts @@ -78,7 +78,6 @@ describe('resource applications', () => { type: 'private', vnet_id: 'vnet_id', }, - { mcp_server_id: 'mcp-server-1', type: 'via_mcp_server_portal' }, ], enable_binding_cookie: true, http_only_cookie_attribute: true, @@ -183,7 +182,6 @@ describe('resource applications', () => { type: 'private', vnet_id: 'vnet_id', }, - { mcp_server_id: 'mcp-server-1', type: 'via_mcp_server_portal' }, ], enable_binding_cookie: true, http_only_cookie_attribute: true, 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 50ec6a1d24..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 @@ -27,14 +27,11 @@ describe('resource accessRequests', () => { const response = await client.zeroTrust.access.logs.accessRequests.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', direction: 'desc', - email: 'user@example.com', - email_exact: true, limit: 0, page: 0, per_page: 0, since: '2020-07-01T05:20:00Z', until: '2020-10-01T05:20:00Z', - user_id: 'f757c5c3-c1b2-50f7-9126-150a099b6f7e', }); }); }); diff --git a/tests/api-resources/zero-trust/connectivity/directory/services.test.ts b/tests/api-resources/zero-trust/connectivity/directory/services.test.ts index 735afe06c3..4e6440e25c 100644 --- a/tests/api-resources/zero-trust/connectivity/directory/services.test.ts +++ b/tests/api-resources/zero-trust/connectivity/directory/services.test.ts @@ -13,11 +13,8 @@ describe('resource services', () => { test('create: only required params', async () => { const responsePromise = client.zeroTrust.connectivity.directory.services.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', - host: { - hostname: 'api.example.com', - resolver_network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da' }, - }, - name: 'web-server', + host: {}, + name: 'name', type: 'http', }); const rawResponse = await responsePromise.asResponse(); @@ -32,26 +29,18 @@ describe('resource services', () => { test('create: required and optional params', async () => { const response = await client.zeroTrust.connectivity.directory.services.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', - host: { - hostname: 'api.example.com', - resolver_network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da', resolver_ips: ['string'] }, - }, - name: 'web-server', + host: { hostname: 'hostname', ipv4: 'ipv4', ipv6: 'ipv6', network: {}, resolver_network: {} }, + name: 'name', type: 'http', - http_port: 8080, - https_port: 8443, + http_port: 1, + https_port: 1, }); }); test('update: only required params', async () => { const responsePromise = client.zeroTrust.connectivity.directory.services.update( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - { - account_id: 'account_id', - host: { ipv4: '10.0.0.1', network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da' } }, - name: 'web-app', - type: 'http', - }, + { account_id: 'account_id', host: {}, name: 'name', type: 'http' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -67,11 +56,11 @@ describe('resource services', () => { '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: 'account_id', - host: { ipv4: '10.0.0.1', network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da' } }, - name: 'web-app', + host: { hostname: 'hostname', ipv4: 'ipv4', ipv6: 'ipv6', network: {}, resolver_network: {} }, + name: 'name', type: 'http', - http_port: 8080, - https_port: 8443, + http_port: 1, + https_port: 1, }, ); }); diff --git a/tests/api-resources/zero-trust/devices/dex-tests.test.ts b/tests/api-resources/zero-trust/devices/dex-tests.test.ts index 246e9b7961..0669d5569c 100644 --- a/tests/api-resources/zero-trust/devices/dex-tests.test.ts +++ b/tests/api-resources/zero-trust/devices/dex-tests.test.ts @@ -13,7 +13,7 @@ describe('resource dexTests', () => { test('create: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.create({ account_id: '01a7362d577a6c3019a474fd6f485823', - data: {}, + data: { host: 'https://dash.cloudflare.com', kind: 'http' }, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -35,7 +35,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'id', default: true, name: 'name' }], + target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], targeted: true, }); }); @@ -43,7 +43,7 @@ describe('resource dexTests', () => { test('update: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', - data: {}, + data: { host: 'https://dash.cloudflare.com', kind: 'http' }, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -65,7 +65,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'id', default: true, name: 'name' }], + target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], targeted: true, }); }); diff --git a/tests/api-resources/zero-trust/dlp/entries/custom.test.ts b/tests/api-resources/zero-trust/dlp/entries/custom.test.ts index a07726b8c7..fa0b9659df 100644 --- a/tests/api-resources/zero-trust/dlp/entries/custom.test.ts +++ b/tests/api-resources/zero-trust/dlp/entries/custom.test.ts @@ -16,6 +16,7 @@ describe('resource custom', () => { enabled: true, name: 'name', pattern: { regex: 'regex' }, + profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); diff --git a/tests/api-resources/zero-trust/dlp/entries/entries.test.ts b/tests/api-resources/zero-trust/dlp/entries/entries.test.ts index aaeb9ac8db..0758392e54 100644 --- a/tests/api-resources/zero-trust/dlp/entries/entries.test.ts +++ b/tests/api-resources/zero-trust/dlp/entries/entries.test.ts @@ -16,6 +16,7 @@ describe('resource entries', () => { enabled: true, name: 'name', pattern: { regex: 'regex' }, + profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); From 9ca404941e20d7c353377264a46582ceb9c0b5bf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Oct 2025 19:48:29 +0000 Subject: [PATCH 290/451] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 205 ++- scripts/detect-breaking-changes | 20 + src/resources/abuse-reports.ts | 886 +++++++++- src/resources/accounts/accounts.ts | 30 + src/resources/api-gateway/api-gateway.ts | 2 - src/resources/api-gateway/configurations.ts | 43 +- src/resources/api-gateway/index.ts | 1 - .../cloudforce-one/threat-events/index.ts | 6 +- .../threat-events/indicator-types.ts | 43 +- .../threat-events/threat-events.ts | 19 +- src/resources/custom-pages.ts | 48 +- src/resources/dns/records.ts | 88 +- 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 | 139 +- src/resources/kv/namespaces/metadata.ts | 4 +- src/resources/kv/namespaces/namespaces.ts | 164 +- src/resources/kv/namespaces/values.ts | 33 +- .../leaked-credential-checks/detections.ts | 240 ++- .../leaked-credential-checks/index.ts | 13 +- .../leaked-credential-checks.ts | 121 +- 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 +- .../magic-transit/connectors/connectors.ts | 37 +- .../connectors/snapshots/latest.ts | 22 + .../connectors/snapshots/snapshots.ts | 22 + src/resources/organizations/organizations.ts | 16 +- src/resources/queues/consumers.ts | 35 + src/resources/queues/index.ts | 21 +- src/resources/queues/messages.ts | 217 ++- src/resources/queues/queues.ts | 44 +- src/resources/queues/subscriptions.ts | 1043 ++++++++++- .../r2/buckets/event-notifications.ts | 7 +- src/resources/radar/ai/bots/summary.ts | 2 +- src/resources/radar/ai/inference/summary.ts | 4 +- .../ai/inference/timeseries-groups/summary.ts | 4 +- src/resources/radar/ai/timeseries-groups.ts | 2 +- src/resources/radar/as112/summary.ts | 12 +- .../radar/as112/timeseries-groups.ts | 12 +- src/resources/radar/attacks/layer3/summary.ts | 14 +- .../radar/attacks/layer3/timeseries-groups.ts | 14 +- src/resources/radar/attacks/layer3/top/top.ts | 4 +- src/resources/radar/attacks/layer7/summary.ts | 14 +- .../radar/attacks/layer7/timeseries-groups.ts | 14 +- src/resources/radar/attacks/layer7/top/top.ts | 4 +- src/resources/radar/ct/logs.ts | 23 + src/resources/radar/dns/summary.ts | 20 +- src/resources/radar/dns/timeseries-groups.ts | 20 +- src/resources/radar/email/routing/summary.ts | 12 +- .../radar/email/routing/timeseries-groups.ts | 12 +- src/resources/radar/email/security/summary.ts | 18 +- .../radar/email/security/timeseries-groups.ts | 18 +- src/resources/radar/http/summary.ts | 16 +- src/resources/radar/http/timeseries-groups.ts | 20 +- src/resources/radar/http/top.ts | 11 +- .../radar/leaked-credentials/summary.ts | 4 +- .../leaked-credentials/timeseries-groups.ts | 4 +- src/resources/rulesets/rules.ts | 20 +- src/resources/secrets-store/stores/secrets.ts | 4 +- .../dispatch/namespaces/scripts/bindings.ts | 18 - .../dispatch/namespaces/scripts/scripts.ts | 18 - .../dispatch/namespaces/scripts/settings.ts | 54 - .../workers/beta/workers/versions.ts | 36 - src/resources/workers/observability/index.ts | 12 +- .../workers/observability/observability.ts | 26 +- .../workers/observability/telemetry.ts | 1538 ++++++++++++++++- .../scripts/script-and-version-settings.ts | 54 - src/resources/workers/scripts/scripts.ts | 18 - src/resources/workers/scripts/versions.ts | 54 - src/resources/workflows/index.ts | 23 +- src/resources/workflows/instances/events.ts | 40 +- src/resources/workflows/instances/index.ts | 18 +- .../workflows/instances/instances.ts | 416 ++++- src/resources/workflows/instances/status.ts | 54 +- src/resources/workflows/versions.ts | 87 +- src/resources/workflows/workflows.ts | 274 ++- .../access/applications/applications.ts | 637 +++++-- .../zero-trust/access/logs/access-requests.ts | 19 + .../connectivity/directory/directory.ts | 11 + .../connectivity/directory/index.ts | 5 + .../connectivity/directory/services.ts | 561 +++++- src/resources/zero-trust/devices/devices_.ts | 6 +- src/resources/zero-trust/devices/dex-tests.ts | 80 +- .../zero-trust/devices/posture/posture.ts | 4 +- src/resources/zero-trust/dex/colos.ts | 17 +- src/resources/zero-trust/dex/dex.ts | 5 - .../dex/fleet-status/fleet-status.ts | 75 +- .../zero-trust/dex/fleet-status/index.ts | 1 - src/resources/zero-trust/dex/index.ts | 1 - .../zero-trust/dlp/entries/custom.ts | 3 +- .../zero-trust/dlp/entries/entries.ts | 3 +- .../gateway/configurations/configurations.ts | 44 +- src/resources/zero-trust/gateway/rules.ts | 58 +- tests/api-resources/abuse-reports.test.ts | 69 + tests/api-resources/accounts/accounts.test.ts | 1 + .../api-gateway/configurations.test.ts | 1 - .../threat-events/indicator-types.test.ts | 33 + .../api-resources/kv/namespaces/keys.test.ts | 31 +- .../kv/namespaces/namespaces.test.ts | 33 +- .../kv/namespaces/values.test.ts | 3 +- .../detections.test.ts | 98 ++ .../leaked-credential-checks.test.ts | 49 + .../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 + .../connectors/connectors.test.ts | 4 +- tests/api-resources/queues/consumers.test.ts | 23 + tests/api-resources/queues/messages.test.ts | 43 + .../queues/subscriptions.test.ts | 120 ++ .../r2/buckets/event-notifications.test.ts | 1 + .../secrets-store/stores/secrets.test.ts | 18 +- .../workers/observability/telemetry.test.ts | 110 ++ .../workflows/instances/events.test.ts | 32 + .../workflows/instances/instances.test.ts | 89 + .../workflows/instances/status.test.ts | 33 + .../api-resources/workflows/versions.test.ts | 50 + .../api-resources/workflows/workflows.test.ts | 85 + .../access/applications/applications.test.ts | 2 + .../access/logs/access-requests.test.ts | 3 + .../connectivity/directory/services.test.ts | 33 +- .../zero-trust/devices/dex-tests.test.ts | 8 +- .../zero-trust/dlp/entries/custom.test.ts | 1 - .../zero-trust/dlp/entries/entries.test.ts | 1 - 137 files changed, 8688 insertions(+), 1146 deletions(-) create mode 100644 tests/api-resources/abuse-reports.test.ts create mode 100644 tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts create mode 100644 tests/api-resources/leaked-credential-checks/detections.test.ts create mode 100644 tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts 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/queues/subscriptions.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 0e8705a64d..f0e94718e8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1819 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cceecd20dfd89884f795e75b433848994bed610b79802c65104f0c70d3ada54e.yml -openapi_spec_hash: c33c0e26e48c004c1781a36748d0144c +configured_endpoints: 1859 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-70a848d790d5901965bb6bcb22e9344f3e1d851b42546532fbb5398c94cbd970.yml +openapi_spec_hash: c44c3de40c720efe1bdf46e239e94fcb config_hash: e16fca6aff930b2279d586d92022f7d1 diff --git a/api.md b/api.md index 21fa3e261f..112ba46fbe 100644 --- a/api.md +++ b/api.md @@ -129,13 +129,14 @@ Methods: Types: - Organization +- OrganizationDeleteResponse Methods: - client.organizations.create({ ...params }) -> Organization - client.organizations.update(organizationId, { ...params }) -> Organization - client.organizations.list({ ...params }) -> OrganizationsSinglePage -- client.organizations.delete(organizationId) -> void +- client.organizations.delete(organizationId) -> OrganizationDeleteResponse - client.organizations.get(organizationId) -> Organization ## OrganizationProfile @@ -1740,16 +1741,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: @@ -2239,6 +2285,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 @@ -2246,18 +2304,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 @@ -2267,12 +2326,14 @@ Types: - Key - KeyBulkDeleteResponse +- KeyBulkGetResponse - KeyBulkUpdateResponse Methods: - 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 ### Metadata @@ -2341,12 +2402,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 @@ -2372,9 +2437,26 @@ Methods: - 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 ## Subscriptions +Types: + +- SubscriptionCreateResponse +- SubscriptionUpdateResponse +- SubscriptionListResponse +- SubscriptionDeleteResponse +- SubscriptionGetResponse + +Methods: + +- client.queues.subscriptions.create({ ...params }) -> SubscriptionCreateResponse +- client.queues.subscriptions.update(subscriptionId, { ...params }) -> SubscriptionUpdateResponse +- client.queues.subscriptions.list({ ...params }) -> SubscriptionListResponsesV4PagePaginationArray +- client.queues.subscriptions.delete(subscriptionId, { ...params }) -> SubscriptionDeleteResponse +- client.queues.subscriptions.get(subscriptionId, { ...params }) -> SubscriptionGetResponse + # APIGateway ## Configurations @@ -2382,11 +2464,10 @@ Methods: Types: - Configuration -- ConfigurationUpdateResponse Methods: -- client.apiGateway.configurations.update({ ...params }) -> ConfigurationUpdateResponse +- client.apiGateway.configurations.update({ ...params }) -> Configuration - client.apiGateway.configurations.get({ ...params }) -> Configuration ## Discovery @@ -5432,12 +5513,11 @@ Types: - LiveStat - FleetStatusLiveResponse -- FleetStatusOverTimeResponse Methods: - client.zeroTrust.dex.fleetStatus.live({ ...params }) -> FleetStatusLiveResponse -- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> FleetStatusOverTimeResponse +- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> void #### Devices @@ -5641,13 +5721,20 @@ Methods: #### Services +Types: + +- ServiceCreateResponse +- ServiceUpdateResponse +- ServiceListResponse +- ServiceGetResponse + Methods: -- client.zeroTrust.connectivity.directory.services.create({ ...params }) -> void -- client.zeroTrust.connectivity.directory.services.update(serviceId, { ...params }) -> void -- client.zeroTrust.connectivity.directory.services.list({ ...params }) -> void +- client.zeroTrust.connectivity.directory.services.create({ ...params }) -> ServiceCreateResponse +- client.zeroTrust.connectivity.directory.services.update(serviceId, { ...params }) -> ServiceUpdateResponse +- client.zeroTrust.connectivity.directory.services.list({ ...params }) -> ServiceListResponsesV4PagePaginationArray - client.zeroTrust.connectivity.directory.services.delete(serviceId, { ...params }) -> void -- client.zeroTrust.connectivity.directory.services.get(serviceId, { ...params }) -> void +- client.zeroTrust.connectivity.directory.services.get(serviceId, { ...params }) -> ServiceGetResponse ## DLP @@ -8137,6 +8224,14 @@ Methods: ### IndicatorTypes +Types: + +- IndicatorTypeListResponse + +Methods: + +- client.cloudforceOne.threatEvents.indicatorTypes.list({ ...params }) -> IndicatorTypeListResponse + ### Raw Types: @@ -8409,14 +8504,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: @@ -8471,8 +8620,32 @@ Methods: # LeakedCredentialChecks +Types: + +- LeakedCredentialCheckCreateResponse +- LeakedCredentialCheckGetResponse + +Methods: + +- client.leakedCredentialChecks.create({ ...params }) -> LeakedCredentialCheckCreateResponse +- client.leakedCredentialChecks.get({ ...params }) -> LeakedCredentialCheckGetResponse + ## Detections +Types: + +- DetectionCreateResponse +- DetectionUpdateResponse +- DetectionListResponse +- DetectionDeleteResponse + +Methods: + +- client.leakedCredentialChecks.detections.create({ ...params }) -> DetectionCreateResponse +- client.leakedCredentialChecks.detections.update(detectionId, { ...params }) -> DetectionUpdateResponse +- client.leakedCredentialChecks.detections.list({ ...params }) -> DetectionListResponsesSinglePage +- client.leakedCredentialChecks.detections.delete(detectionId, { ...params }) -> DetectionDeleteResponse + # ContentScanning Types: @@ -8517,6 +8690,14 @@ Methods: # AbuseReports +Types: + +- AbuseReportCreateResponse + +Methods: + +- client.abuseReports.create(reportParam, { ...params }) -> AbuseReportCreateResponse + # AI Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 4a26d167be..93ee379c25 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -145,6 +145,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 @@ -185,6 +193,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 @@ -197,6 +207,7 @@ TEST_PATHS=( tests/api-resources/queues/messages.test.ts tests/api-resources/queues/purge.test.ts tests/api-resources/queues/consumers.test.ts + tests/api-resources/queues/subscriptions.test.ts tests/api-resources/api-gateway/api-gateway.test.ts tests/api-resources/api-gateway/configurations.test.ts tests/api-resources/api-gateway/discovery/discovery.test.ts @@ -679,6 +690,7 @@ TEST_PATHS=( tests/api-resources/cloudforce-one/threat-events/categories.test.ts tests/api-resources/cloudforce-one/threat-events/countries.test.ts tests/api-resources/cloudforce-one/threat-events/datasets/datasets.test.ts + tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts tests/api-resources/cloudforce-one/threat-events/raw.test.ts tests/api-resources/cloudforce-one/threat-events/relate.test.ts tests/api-resources/cloudforce-one/threat-events/tags.test.ts @@ -702,12 +714,20 @@ 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 + tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts + tests/api-resources/leaked-credential-checks/detections.test.ts tests/api-resources/content-scanning/content-scanning.test.ts tests/api-resources/content-scanning/payloads.test.ts tests/api-resources/content-scanning/settings.test.ts + tests/api-resources/abuse-reports.test.ts tests/api-resources/ai/ai.test.ts tests/api-resources/ai/finetunes/finetunes.test.ts tests/api-resources/ai/finetunes/assets.test.ts diff --git a/src/resources/abuse-reports.ts b/src/resources/abuse-reports.ts index 2a55a7e639..16775672c3 100644 --- a/src/resources/abuse-reports.ts +++ b/src/resources/abuse-reports.ts @@ -1,5 +1,889 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../resource'; +import * as Core from '../core'; -export class AbuseReports extends APIResource {} +export class AbuseReports extends APIResource { + /** + * Submit the Abuse Report of a particular type + */ + create( + reportParam: string, + params: AbuseReportCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/abuse-reports/${reportParam}`, { + body, + ...options, + }) as Core.APIPromise<{ result: AbuseReportCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +/** + * The result should be 'success' for successful response + */ +export type AbuseReportCreateResponse = string; + +export type AbuseReportCreateParams = + | AbuseReportCreateParams.AbuseReportsDmcaReport + | AbuseReportCreateParams.AbuseReportsTrademarkReport + | AbuseReportCreateParams.AbuseReportsGeneralReport + | AbuseReportCreateParams.AbuseReportsPhishingReport + | AbuseReportCreateParams.AbuseReportsCsamReport + | AbuseReportCreateParams.AbuseReportsThreatReport + | AbuseReportCreateParams.AbuseReportsRegistrarWhoisReport + | AbuseReportCreateParams.AbuseReportsNcseiReport; + +export declare namespace AbuseReportCreateParams { + export interface AbuseReportsDmcaReport { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_dmca'; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + address1: string; + + /** + * Body param: The name of the copyright holder. Text not exceeding 60 characters. + * This field may be released by Cloudflare to third parties such as the Lumen + * Database (https://lumendatabase.org/). + */ + agent_name: string; + + /** + * Body param: Can be `0` for false or `1` for true. Must be value: 1 for DMCA + * reports + */ + agree: 1; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + city: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + country: string; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send'; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + original_work: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send'; + + /** + * Body param: Required for DMCA reports, should be same as Name. An affirmation + * that all information in the report is true and accurate while agreeing to the + * policies of Cloudflare's abuse reports + */ + signature: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + state: string; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsTrademarkReport { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_trademark'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send'; + + /** + * Body param: Text not exceeding 1000 characters + */ + trademark_number: string; + + /** + * Body param: Text not exceeding 1000 characters + */ + trademark_office: string; + + /** + * Body param: Text not exceeding 1000 characters + */ + trademark_symbol: string; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsGeneralReport { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_general'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon' | 'none'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: A list of IP addresses separated by ‘\n’ (new line character). The + * list of destination IPs should not exceed 30 IP addresses. Each one of the IP + * addresses ought to be unique. + */ + destination_ips?: string; + + /** + * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. + * The total size of the field should not exceed 2000 characters. Each individual + * port/protocol should not exceed 100 characters. The list should not have more + * than 30 unique ports and protocols. + */ + ports_protocols?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: A list of IP addresses separated by ‘\n’ (new line character). The + * list of source IPs should not exceed 30 IP addresses. Each one of the IP + * addresses ought to be unique. + */ + source_ips?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsPhishingReport { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_phishing'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + original_work?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsCsamReport { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_children'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + ncmec_notification: 'send' | 'send-anon'; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon' | 'none'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + country?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsThreatReport { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_threat'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsRegistrarWhoisReport { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_registrar_whois'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon' | 'none'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsNcseiReport { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_ncsei'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: If the submitter is the target of NCSEI in the URLs of the abuse + * report. + */ + ncsei_subject_representation: boolean; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon' | 'none'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + country?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } +} + +export declare namespace AbuseReports { + export { + type AbuseReportCreateResponse as AbuseReportCreateResponse, + type AbuseReportCreateParams as AbuseReportCreateParams, + }; +} diff --git a/src/resources/accounts/accounts.ts b/src/resources/accounts/accounts.ts index 1f17f46efb..332d3d488d 100644 --- a/src/resources/accounts/accounts.ts +++ b/src/resources/accounts/accounts.ts @@ -175,6 +175,11 @@ export interface Account { */ created_on?: string; + /** + * Parent container details + */ + managed_by?: Account.ManagedBy; + /** * Account settings */ @@ -182,6 +187,21 @@ export interface Account { } export namespace Account { + /** + * Parent container details + */ + export interface ManagedBy { + /** + * ID of the parent Organization, if one exists + */ + parent_org_id?: string; + + /** + * Name of the parent Organization, if one exists + */ + parent_org_name?: string; + } + /** * Account settings */ @@ -257,6 +277,11 @@ export interface AccountUpdateParams { */ type: 'standard' | 'enterprise'; + /** + * Body param: Parent container details + */ + managed_by?: AccountUpdateParams.ManagedBy; + /** * Body param: Account settings */ @@ -264,6 +289,11 @@ export interface AccountUpdateParams { } export namespace AccountUpdateParams { + /** + * Parent container details + */ + export interface ManagedBy {} + /** * Account settings */ diff --git a/src/resources/api-gateway/api-gateway.ts b/src/resources/api-gateway/api-gateway.ts index 1f9fb727e9..701ac67835 100644 --- a/src/resources/api-gateway/api-gateway.ts +++ b/src/resources/api-gateway/api-gateway.ts @@ -6,7 +6,6 @@ import { Configuration, ConfigurationGetParams, ConfigurationUpdateParams, - ConfigurationUpdateResponse, Configurations, } from './configurations'; import * as SchemasAPI from './schemas'; @@ -82,7 +81,6 @@ export declare namespace APIGateway { export { Configurations as Configurations, type Configuration as Configuration, - type ConfigurationUpdateResponse as ConfigurationUpdateResponse, type ConfigurationUpdateParams as ConfigurationUpdateParams, type ConfigurationGetParams as ConfigurationGetParams, }; diff --git a/src/resources/api-gateway/configurations.ts b/src/resources/api-gateway/configurations.ts index 5659e51452..5082ea818a 100644 --- a/src/resources/api-gateway/configurations.ts +++ b/src/resources/api-gateway/configurations.ts @@ -2,11 +2,10 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as UserSchemasAPI from './user-schemas/user-schemas'; export class Configurations extends APIResource { /** - * Set configuration properties + * Update configuration properties * * @example * ```ts @@ -19,12 +18,14 @@ export class Configurations extends APIResource { * }); * ``` */ - update( - params: ConfigurationUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + update(params: ConfigurationUpdateParams, options?: Core.RequestOptions): Core.APIPromise { const { zone_id, ...body } = params; - return this._client.put(`/zones/${zone_id}/api_gateway/configuration`, { body, ...options }); + return ( + this._client.put(`/zones/${zone_id}/api_gateway/configuration`, { + body, + ...options, + }) as Core.APIPromise<{ result: Configuration }> + )._thenUnwrap((obj) => obj.result); } /** @@ -39,12 +40,11 @@ export class Configurations extends APIResource { * ``` */ get(params: ConfigurationGetParams, options?: Core.RequestOptions): Core.APIPromise { - const { zone_id, ...query } = params; + const { zone_id } = params; return ( - this._client.get(`/zones/${zone_id}/api_gateway/configuration`, { - query, - ...options, - }) as Core.APIPromise<{ result: Configuration }> + this._client.get(`/zones/${zone_id}/api_gateway/configuration`, options) as Core.APIPromise<{ + result: Configuration; + }> )._thenUnwrap((obj) => obj.result); } } @@ -93,17 +93,6 @@ export namespace Configuration { } } -export interface ConfigurationUpdateResponse { - errors: UserSchemasAPI.Message; - - messages: UserSchemasAPI.Message; - - /** - * Whether the API call was successful. - */ - success: true; -} - export interface ConfigurationUpdateParams { /** * Path param: Identifier. @@ -159,20 +148,14 @@ export namespace ConfigurationUpdateParams { export interface ConfigurationGetParams { /** - * Path param: Identifier. + * Identifier. */ zone_id: string; - - /** - * Query param: Requests information about certain properties. - */ - properties?: Array<'auth_id_characteristics'>; } export declare namespace Configurations { export { type Configuration as Configuration, - type ConfigurationUpdateResponse as ConfigurationUpdateResponse, type ConfigurationUpdateParams as ConfigurationUpdateParams, type ConfigurationGetParams as ConfigurationGetParams, }; diff --git a/src/resources/api-gateway/index.ts b/src/resources/api-gateway/index.ts index 5941af87f3..485f8290f8 100644 --- a/src/resources/api-gateway/index.ts +++ b/src/resources/api-gateway/index.ts @@ -4,7 +4,6 @@ export { APIGateway } from './api-gateway'; export { Configurations, type Configuration, - type ConfigurationUpdateResponse, type ConfigurationUpdateParams, type ConfigurationGetParams, } from './configurations'; diff --git a/src/resources/cloudforce-one/threat-events/index.ts b/src/resources/cloudforce-one/threat-events/index.ts index d797682ddd..02c8bab160 100644 --- a/src/resources/cloudforce-one/threat-events/index.ts +++ b/src/resources/cloudforce-one/threat-events/index.ts @@ -36,7 +36,11 @@ export { type EventTagCreateParams, type EventTagDeleteParams, } from './event-tags'; -export { IndicatorTypes } from './indicator-types'; +export { + IndicatorTypes, + type IndicatorTypeListResponse, + type IndicatorTypeListParams, +} from './indicator-types'; export { Insights } from './insights'; export { Raw, type RawEditResponse, type RawGetResponse, type RawEditParams, type RawGetParams } from './raw'; export { Relate, type RelateDeleteResponse, type RelateDeleteParams } from './relate'; diff --git a/src/resources/cloudforce-one/threat-events/indicator-types.ts b/src/resources/cloudforce-one/threat-events/indicator-types.ts index 99e5ccc453..030839110f 100644 --- a/src/resources/cloudforce-one/threat-events/indicator-types.ts +++ b/src/resources/cloudforce-one/threat-events/indicator-types.ts @@ -1,5 +1,46 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; -export class IndicatorTypes extends APIResource {} +export class IndicatorTypes extends APIResource { + /** + * This Method is deprecated. Please use /events/dataset/:dataset_id/indicatorTypes + * instead. + * + * @deprecated + */ + list( + params: IndicatorTypeListParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.get(`/accounts/${account_id}/cloudforce-one/events/indicatorTypes`, options); + } +} + +export interface IndicatorTypeListResponse { + items: IndicatorTypeListResponse.Items; + + type: string; +} + +export namespace IndicatorTypeListResponse { + export interface Items { + type: string; + } +} + +export interface IndicatorTypeListParams { + /** + * Account ID. + */ + account_id: string; +} + +export declare namespace IndicatorTypes { + export { + type IndicatorTypeListResponse as IndicatorTypeListResponse, + type IndicatorTypeListParams as IndicatorTypeListParams, + }; +} diff --git a/src/resources/cloudforce-one/threat-events/threat-events.ts b/src/resources/cloudforce-one/threat-events/threat-events.ts index d23c37b5db..8ad50fe4a8 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -31,7 +31,7 @@ import { EventTags, } from './event-tags'; import * as IndicatorTypesAPI from './indicator-types'; -import { IndicatorTypes } from './indicator-types'; +import { IndicatorTypeListParams, IndicatorTypeListResponse, IndicatorTypes } from './indicator-types'; import * as InsightsAPI from './insights'; import { Insights } from './insights'; import * as RawAPI from './raw'; @@ -209,15 +209,10 @@ export class ThreatEvents extends APIResource { } /** - * Reads an event + * This Method is deprecated. Please use + * /events/dataset/:dataset_id/events/:event_id instead. * - * @example - * ```ts - * const threatEvent = - * await client.cloudforceOne.threatEvents.get('event_id', { - * account_id: 'account_id', - * }); - * ``` + * @deprecated */ get( eventId: string, @@ -821,7 +816,11 @@ export declare namespace ThreatEvents { type DatasetRawParams as DatasetRawParams, }; - export { IndicatorTypes as IndicatorTypes }; + export { + IndicatorTypes as IndicatorTypes, + type IndicatorTypeListResponse as IndicatorTypeListResponse, + type IndicatorTypeListParams as IndicatorTypeListParams, + }; export { RawAPIRaw as Raw, diff --git a/src/resources/custom-pages.ts b/src/resources/custom-pages.ts index 4c861b1e41..6bd1b13cf7 100644 --- a/src/resources/custom-pages.ts +++ b/src/resources/custom-pages.ts @@ -24,15 +24,13 @@ export class CustomPages extends APIResource { */ update( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', params: CustomPageUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { @@ -125,42 +123,36 @@ export class CustomPages extends APIResource { */ get( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', params?: CustomPageGetParams, options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | '1000_errors' - | '500_errors' - | 'basic_challenge' - | 'country_challenge' + | 'waf_block' | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' | 'managed_challenge' - | 'ratelimit_block' - | 'under_attack' - | 'waf_block', + | 'ratelimit_block', params: CustomPageGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { diff --git a/src/resources/dns/records.ts b/src/resources/dns/records.ts index 0a09cf3cb4..b3eb5c6bb2 100644 --- a/src/resources/dns/records.ts +++ b/src/resources/dns/records.ts @@ -3701,30 +3701,30 @@ export namespace Record { } export type RecordResponse = - | RecordResponse.ARecord - | RecordResponse.AAAARecord - | RecordResponse.CNAMERecord - | RecordResponse.MXRecord - | RecordResponse.NSRecord - | RecordResponse.OpenpgpkeyRecord - | RecordResponse.PTRRecord - | RecordResponse.TXTRecord - | RecordResponse.CAARecord - | RecordResponse.CERTRecord - | RecordResponse.DNSKEYRecord - | RecordResponse.DSRecord - | RecordResponse.HTTPSRecord - | RecordResponse.LOCRecord - | RecordResponse.NAPTRRecord - | RecordResponse.SMIMEARecord - | RecordResponse.SRVRecord - | RecordResponse.SSHFPRecord - | RecordResponse.SVCBRecord - | RecordResponse.TLSARecord - | RecordResponse.URIRecord; + | RecordResponse.A + | RecordResponse.AAAA + | RecordResponse.CNAME + | RecordResponse.MX + | RecordResponse.NS + | RecordResponse.Openpgpkey + | RecordResponse.PTR + | RecordResponse.TXT + | RecordResponse.CAA + | RecordResponse.CERT + | RecordResponse.DNSKEY + | RecordResponse.DS + | RecordResponse.HTTPS + | RecordResponse.LOC + | RecordResponse.NAPTR + | RecordResponse.SMIMEA + | RecordResponse.SRV + | RecordResponse.SSHFP + | RecordResponse.SVCB + | RecordResponse.TLSA + | RecordResponse.URI; export namespace RecordResponse { - export interface ARecord extends RecordsAPI.ARecord { + export interface A extends RecordsAPI.ARecord { /** * Identifier. */ @@ -3761,7 +3761,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface AAAARecord extends RecordsAPI.AAAARecord { + export interface AAAA extends RecordsAPI.AAAARecord { /** * Identifier. */ @@ -3798,7 +3798,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface CNAMERecord extends RecordsAPI.CNAMERecord { + export interface CNAME extends RecordsAPI.CNAMERecord { /** * Identifier. */ @@ -3835,7 +3835,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface MXRecord extends RecordsAPI.MXRecord { + export interface MX extends RecordsAPI.MXRecord { /** * Identifier. */ @@ -3872,7 +3872,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface NSRecord extends RecordsAPI.NSRecord { + export interface NS extends RecordsAPI.NSRecord { /** * Identifier. */ @@ -3909,7 +3909,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface OpenpgpkeyRecord { + export interface Openpgpkey { /** * Identifier. */ @@ -3960,7 +3960,7 @@ export namespace RecordResponse { /** * Settings for the DNS record. */ - settings: OpenpgpkeyRecord.Settings; + settings: Openpgpkey.Settings; /** * Custom tags for the DNS record. This field has no effect on DNS responses. @@ -3990,7 +3990,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export namespace OpenpgpkeyRecord { + export namespace Openpgpkey { /** * Settings for the DNS record. */ @@ -4013,7 +4013,7 @@ export namespace RecordResponse { } } - export interface PTRRecord extends RecordsAPI.PTRRecord { + export interface PTR extends RecordsAPI.PTRRecord { /** * Identifier. */ @@ -4050,7 +4050,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface TXTRecord extends RecordsAPI.TXTRecord { + export interface TXT extends RecordsAPI.TXTRecord { /** * Identifier. */ @@ -4087,7 +4087,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface CAARecord extends RecordsAPI.CAARecord { + export interface CAA extends RecordsAPI.CAARecord { /** * Identifier. */ @@ -4124,7 +4124,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface CERTRecord extends RecordsAPI.CERTRecord { + export interface CERT extends RecordsAPI.CERTRecord { /** * Identifier. */ @@ -4161,7 +4161,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface DNSKEYRecord extends RecordsAPI.DNSKEYRecord { + export interface DNSKEY extends RecordsAPI.DNSKEYRecord { /** * Identifier. */ @@ -4198,7 +4198,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface DSRecord extends RecordsAPI.DSRecord { + export interface DS extends RecordsAPI.DSRecord { /** * Identifier. */ @@ -4235,7 +4235,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface HTTPSRecord extends RecordsAPI.HTTPSRecord { + export interface HTTPS extends RecordsAPI.HTTPSRecord { /** * Identifier. */ @@ -4272,7 +4272,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface LOCRecord extends RecordsAPI.LOCRecord { + export interface LOC extends RecordsAPI.LOCRecord { /** * Identifier. */ @@ -4309,7 +4309,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface NAPTRRecord extends RecordsAPI.NAPTRRecord { + export interface NAPTR extends RecordsAPI.NAPTRRecord { /** * Identifier. */ @@ -4346,7 +4346,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SMIMEARecord extends RecordsAPI.SMIMEARecord { + export interface SMIMEA extends RecordsAPI.SMIMEARecord { /** * Identifier. */ @@ -4383,7 +4383,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SRVRecord extends RecordsAPI.SRVRecord { + export interface SRV extends RecordsAPI.SRVRecord { /** * Identifier. */ @@ -4420,7 +4420,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SSHFPRecord extends RecordsAPI.SSHFPRecord { + export interface SSHFP extends RecordsAPI.SSHFPRecord { /** * Identifier. */ @@ -4457,7 +4457,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SVCBRecord extends RecordsAPI.SVCBRecord { + export interface SVCB extends RecordsAPI.SVCBRecord { /** * Identifier. */ @@ -4494,7 +4494,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface TLSARecord extends RecordsAPI.TLSARecord { + export interface TLSA extends RecordsAPI.TLSARecord { /** * Identifier. */ @@ -4531,7 +4531,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface URIRecord extends RecordsAPI.URIRecord { + export interface URI extends RecordsAPI.URIRecord { /** * Identifier. */ 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 f8b3034d84..c581632a76 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 a4db89243d..138942ad57 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. @@ -99,12 +120,12 @@ export interface Key { /** * 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 +135,49 @@ 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 { + /** + * The metadata associated with the key. + */ + metadata: unknown; + + /** + * The value associated with the key. + */ + 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,26 +189,27 @@ export interface KeyBulkUpdateResponse { export interface KeyListParams extends CursorPaginationAfterParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; /** - * Query param: The number of keys to return. The cursor attribute may be used to - * iterate over the next batch of keys if there are more than the limit. + * 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: 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; @@ -157,9 +219,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; @@ -172,39 +256,38 @@ 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. + * Arbitrary JSON that is associated with a key. */ - value?: string; + metadata?: unknown; } } @@ -214,10 +297,12 @@ export declare namespace Keys { export { type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, + type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorPaginationAfter as KeysCursorPaginationAfter, 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..927ba8a17d 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -37,11 +37,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 3ec43aa7c5..df179e53bb 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' }], * }, * ); * ``` @@ -240,13 +272,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 +286,49 @@ 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 { + /** + * The metadata associated with the key. + */ + metadata: unknown; + + /** + * The value associated with the key. + */ + 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 +340,7 @@ export interface NamespaceBulkUpdateResponse { export interface NamespaceCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -282,7 +352,7 @@ export interface NamespaceCreateParams { export interface NamespaceUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -294,7 +364,7 @@ export interface NamespaceUpdateParams { export interface NamespaceListParams extends V4PagePaginationArrayParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -311,14 +381,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 +398,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 +435,44 @@ 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. + * Arbitrary JSON that is associated with a key. */ - value?: string; + metadata?: unknown; } } export interface NamespaceGetParams { /** - * Identifier + * Identifier. */ account_id: string; } @@ -390,14 +481,14 @@ Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; Namespaces.Keys = Keys; Namespaces.KeysCursorPaginationAfter = KeysCursorPaginationAfter; 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 +496,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 +505,12 @@ export declare namespace Namespaces { Keys as Keys, type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, + type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorPaginationAfter as KeysCursorPaginationAfter, type KeyListParams as KeyListParams, type KeyBulkDeleteParams as KeyBulkDeleteParams, + type KeyBulkGetParams as KeyBulkGetParams, type KeyBulkUpdateParams as KeyBulkUpdateParams, }; @@ -427,7 +521,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 1fa5ff39ed..49566f425a 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,13 +37,8 @@ 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, - __multipartSyntax: 'json', - ...options, - headers: { 'Content-Type': '*/*', ...options?.headers }, - }), + Core.multipartFormRequestOptions({ query: { expiration, expiration_ttl }, body, + __multipartSyntax: 'json', ...options }), ) as Core.APIPromise<{ result: ValueUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } @@ -120,43 +114,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: Associates arbitrary JSON data with a key/value pair. + */ + metadata?: unknown; } export interface ValueDeleteParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface ValueGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/leaked-credential-checks/detections.ts b/src/resources/leaked-credential-checks/detections.ts index 2a6de390ad..ca2e008bd9 100644 --- a/src/resources/leaked-credential-checks/detections.ts +++ b/src/resources/leaked-credential-checks/detections.ts @@ -1,5 +1,243 @@ // 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 Detections extends APIResource {} +export class Detections extends APIResource { + /** + * Create user-defined detection pattern for Leaked Credential Checks. + * + * @example + * ```ts + * const detection = + * await client.leakedCredentialChecks.detections.create({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create( + params: DetectionCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/leaked-credential-checks/detections`, { + body, + ...options, + }) as Core.APIPromise<{ result: DetectionCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update user-defined detection pattern for Leaked Credential Checks. + * + * @example + * ```ts + * const detection = + * await client.leakedCredentialChecks.detections.update( + * '18a14bafaa8eb1df04ce683ec18c765e', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + update( + detectionId: string, + params: DetectionUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.put(`/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: DetectionUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List user-defined detection patterns for Leaked Credential Checks. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const detectionListResponse of client.leakedCredentialChecks.detections.list( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: DetectionListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { zone_id } = params; + return this._client.getAPIList( + `/zones/${zone_id}/leaked-credential-checks/detections`, + DetectionListResponsesSinglePage, + options, + ); + } + + /** + * Remove user-defined detection pattern for Leaked Credential Checks. + * + * @example + * ```ts + * const detection = + * await client.leakedCredentialChecks.detections.delete( + * '18a14bafaa8eb1df04ce683ec18c765e', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + detectionId: string, + params: DetectionDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.delete( + `/zones/${zone_id}/leaked-credential-checks/detections/${detectionId}`, + options, + ) as Core.APIPromise<{ result: DetectionDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class DetectionListResponsesSinglePage extends SinglePage {} + +/** + * Defines a custom set of username/password expressions to match Leaked Credential + * Checks on. + */ +export interface DetectionCreateResponse { + /** + * Defines the unique ID for this custom detection. + */ + id?: string; + + /** + * Defines ehe ruleset expression to use in matching the password in a request. + */ + password?: string; + + /** + * Defines the ruleset expression to use in matching the username in a request. + */ + username?: string; +} + +/** + * Defines a custom set of username/password expressions to match Leaked Credential + * Checks on. + */ +export interface DetectionUpdateResponse { + /** + * Defines the unique ID for this custom detection. + */ + id?: string; + + /** + * Defines ehe ruleset expression to use in matching the password in a request. + */ + password?: string; + + /** + * Defines the ruleset expression to use in matching the username in a request. + */ + username?: string; +} + +/** + * Defines a custom set of username/password expressions to match Leaked Credential + * Checks on. + */ +export interface DetectionListResponse { + /** + * Defines the unique ID for this custom detection. + */ + id?: string; + + /** + * Defines ehe ruleset expression to use in matching the password in a request. + */ + password?: string; + + /** + * Defines the ruleset expression to use in matching the username in a request. + */ + username?: string; +} + +export type DetectionDeleteResponse = unknown; + +export interface DetectionCreateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: Defines ehe ruleset expression to use in matching the password in a + * request. + */ + password?: string; + + /** + * Body param: Defines the ruleset expression to use in matching the username in a + * request. + */ + username?: string; +} + +export interface DetectionUpdateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: Defines ehe ruleset expression to use in matching the password in a + * request. + */ + password?: string; + + /** + * Body param: Defines the ruleset expression to use in matching the username in a + * request. + */ + username?: string; +} + +export interface DetectionListParams { + /** + * Defines an identifier. + */ + zone_id: string; +} + +export interface DetectionDeleteParams { + /** + * Defines an identifier. + */ + zone_id: string; +} + +Detections.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; + +export declare namespace Detections { + export { + type DetectionCreateResponse as DetectionCreateResponse, + type DetectionUpdateResponse as DetectionUpdateResponse, + type DetectionListResponse as DetectionListResponse, + type DetectionDeleteResponse as DetectionDeleteResponse, + DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, + type DetectionCreateParams as DetectionCreateParams, + type DetectionUpdateParams as DetectionUpdateParams, + type DetectionListParams as DetectionListParams, + type DetectionDeleteParams as DetectionDeleteParams, + }; +} diff --git a/src/resources/leaked-credential-checks/index.ts b/src/resources/leaked-credential-checks/index.ts index 7e3e1a0dd7..1844848bf2 100644 --- a/src/resources/leaked-credential-checks/index.ts +++ b/src/resources/leaked-credential-checks/index.ts @@ -1,4 +1,15 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Detections } from './detections'; +export { + DetectionListResponsesSinglePage, + Detections, + type DetectionCreateResponse, + type DetectionUpdateResponse, + type DetectionListResponse, + type DetectionDeleteResponse, + type DetectionCreateParams, + type DetectionUpdateParams, + type DetectionListParams, + type DetectionDeleteParams, +} from './detections'; export { LeakedCredentialChecks } from './leaked-credential-checks'; diff --git a/src/resources/leaked-credential-checks/leaked-credential-checks.ts b/src/resources/leaked-credential-checks/leaked-credential-checks.ts index c89821160c..d8d8de90c1 100644 --- a/src/resources/leaked-credential-checks/leaked-credential-checks.ts +++ b/src/resources/leaked-credential-checks/leaked-credential-checks.ts @@ -1,15 +1,132 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; +import * as Core from '../../core'; import * as DetectionsAPI from './detections'; -import { Detections } from './detections'; +import { + DetectionCreateParams, + DetectionCreateResponse, + DetectionDeleteParams, + DetectionDeleteResponse, + DetectionListParams, + DetectionListResponse, + DetectionListResponsesSinglePage, + DetectionUpdateParams, + DetectionUpdateResponse, + Detections, +} from './detections'; export class LeakedCredentialChecks extends APIResource { detections: DetectionsAPI.Detections = new DetectionsAPI.Detections(this._client); + + /** + * Updates the current status of Leaked Credential Checks. + * + * @example + * ```ts + * const leakedCredentialCheck = + * await client.leakedCredentialChecks.create({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create( + params: LeakedCredentialCheckCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/leaked-credential-checks`, { + body, + ...options, + }) as Core.APIPromise<{ result: LeakedCredentialCheckCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the current status of Leaked Credential Checks. + * + * @example + * ```ts + * const leakedCredentialCheck = + * await client.leakedCredentialChecks.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + get( + params: LeakedCredentialCheckGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.get(`/zones/${zone_id}/leaked-credential-checks`, options) as Core.APIPromise<{ + result: LeakedCredentialCheckGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +/** + * Defines the overall status for Leaked Credential Checks. + */ +export interface LeakedCredentialCheckCreateResponse { + /** + * Determines whether or not Leaked Credential Checks are enabled. + */ + enabled?: boolean; +} + +/** + * Defines the overall status for Leaked Credential Checks. + */ +export interface LeakedCredentialCheckGetResponse { + /** + * Determines whether or not Leaked Credential Checks are enabled. + */ + enabled?: boolean; +} + +export interface LeakedCredentialCheckCreateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: Determines whether or not Leaked Credential Checks are enabled. + */ + enabled?: boolean; +} + +export interface LeakedCredentialCheckGetParams { + /** + * Defines an identifier. + */ + zone_id: string; } LeakedCredentialChecks.Detections = Detections; +LeakedCredentialChecks.DetectionListResponsesSinglePage = DetectionListResponsesSinglePage; export declare namespace LeakedCredentialChecks { - export { Detections as Detections }; + export { + type LeakedCredentialCheckCreateResponse as LeakedCredentialCheckCreateResponse, + type LeakedCredentialCheckGetResponse as LeakedCredentialCheckGetResponse, + type LeakedCredentialCheckCreateParams as LeakedCredentialCheckCreateParams, + type LeakedCredentialCheckGetParams as LeakedCredentialCheckGetParams, + }; + + export { + Detections as Detections, + type DetectionCreateResponse as DetectionCreateResponse, + type DetectionUpdateResponse as DetectionUpdateResponse, + type DetectionListResponse as DetectionListResponse, + type DetectionDeleteResponse as DetectionDeleteResponse, + DetectionListResponsesSinglePage as DetectionListResponsesSinglePage, + type DetectionCreateParams as DetectionCreateParams, + type DetectionUpdateParams as DetectionUpdateParams, + type DetectionListParams as DetectionListParams, + type DetectionDeleteParams as DetectionDeleteParams, + }; } 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..6e40d6cfa9 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..5e289166d6 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..6f0ab3dbaa 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/connectors/connectors.ts b/src/resources/magic-transit/connectors/connectors.ts index c7f3bde0de..368ca729b7 100644 --- a/src/resources/magic-transit/connectors/connectors.ts +++ b/src/resources/magic-transit/connectors/connectors.ts @@ -49,7 +49,7 @@ export class Connectors extends APIResource { } /** - * Replace Connector + * Replace Connector or Re-provision License Key * * @example * ```ts @@ -126,7 +126,7 @@ export class Connectors extends APIResource { } /** - * Edit Connector to update specific properties + * Edit Connector to update specific properties or Re-provision License Key * * @example * ```ts @@ -198,6 +198,8 @@ export interface ConnectorCreateResponse { last_heartbeat?: string; last_seen_version?: string; + + license_key?: string; } export namespace ConnectorCreateResponse { @@ -228,6 +230,8 @@ export interface ConnectorUpdateResponse { last_heartbeat?: string; last_seen_version?: string; + + license_key?: string; } export namespace ConnectorUpdateResponse { @@ -258,6 +262,8 @@ export interface ConnectorListResponse { last_heartbeat?: string; last_seen_version?: string; + + license_key?: string; } export namespace ConnectorListResponse { @@ -288,6 +294,8 @@ export interface ConnectorDeleteResponse { last_heartbeat?: string; last_seen_version?: string; + + license_key?: string; } export namespace ConnectorDeleteResponse { @@ -318,6 +326,8 @@ export interface ConnectorEditResponse { last_heartbeat?: string; last_seen_version?: string; + + license_key?: string; } export namespace ConnectorEditResponse { @@ -348,6 +358,8 @@ export interface ConnectorGetResponse { last_heartbeat?: string; last_seen_version?: string; + + license_key?: string; } export namespace ConnectorGetResponse { @@ -365,7 +377,8 @@ export interface ConnectorCreateParams { account_id: string; /** - * Body param: + * Body param: Exactly one of id, serial_number, or provision_license must be + * provided. */ device: ConnectorCreateParams.Device; @@ -396,9 +409,17 @@ export interface ConnectorCreateParams { } export namespace ConnectorCreateParams { + /** + * Exactly one of id, serial_number, or provision_license must be provided. + */ export interface Device { id?: string; + /** + * When true, create and provision a new licence key for the connector. + */ + provision_license?: boolean; + serial_number?: string; } } @@ -429,6 +450,11 @@ export interface ConnectorUpdateParams { */ notes?: string; + /** + * Body param: When true, regenerate license key for the connector. + */ + provision_license?: boolean; + /** * Body param: */ @@ -475,6 +501,11 @@ export interface ConnectorEditParams { */ notes?: string; + /** + * Body param: When true, regenerate license key for the connector. + */ + provision_license?: boolean; + /** * Body param: */ diff --git a/src/resources/magic-transit/connectors/snapshots/latest.ts b/src/resources/magic-transit/connectors/snapshots/latest.ts index 16d9eaff01..c51d9f1abe 100644 --- a/src/resources/magic-transit/connectors/snapshots/latest.ts +++ b/src/resources/magic-transit/connectors/snapshots/latest.ts @@ -72,6 +72,8 @@ export namespace LatestListResponse { */ v: string; + bonds?: Array; + /** * Count of processors/cores */ @@ -876,6 +878,21 @@ export namespace LatestListResponse { } export namespace Item { + /** + * Snapshot Bond + */ + export interface Bond { + /** + * Name of the network interface + */ + name: string; + + /** + * Current status of the network interface + */ + status: string; + } + /** * Snapshot DHCP lease */ @@ -1279,6 +1296,11 @@ export namespace LatestListResponse { * Connector identifier */ connector_id?: string; + + /** + * MTU as measured between the two ends of the tunnel + */ + probed_mtu?: number; } } } diff --git a/src/resources/magic-transit/connectors/snapshots/snapshots.ts b/src/resources/magic-transit/connectors/snapshots/snapshots.ts index 69b5c098e5..a7d1e0d815 100644 --- a/src/resources/magic-transit/connectors/snapshots/snapshots.ts +++ b/src/resources/magic-transit/connectors/snapshots/snapshots.ts @@ -123,6 +123,8 @@ export interface SnapshotGetResponse { */ v: string; + bonds?: Array; + /** * Count of processors/cores */ @@ -927,6 +929,21 @@ export interface SnapshotGetResponse { } export namespace SnapshotGetResponse { + /** + * Snapshot Bond + */ + export interface Bond { + /** + * Name of the network interface + */ + name: string; + + /** + * Current status of the network interface + */ + status: string; + } + /** * Snapshot DHCP lease */ @@ -1330,6 +1347,11 @@ export namespace SnapshotGetResponse { * Connector identifier */ connector_id?: string; + + /** + * MTU as measured between the two ends of the tunnel + */ + probed_mtu?: number; } } diff --git a/src/resources/organizations/organizations.ts b/src/resources/organizations/organizations.ts index edc39aac94..aa9aafb4b4 100644 --- a/src/resources/organizations/organizations.ts +++ b/src/resources/organizations/organizations.ts @@ -61,11 +61,12 @@ export class Organizations extends APIResource { * Delete an organization. The organization MUST be empty before deleting. It must * not contain any sub-organizations, accounts, members or users. */ - delete(organizationId: string, options?: Core.RequestOptions): Core.APIPromise { - return this._client.delete(`/organizations/${organizationId}`, { - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + delete(organizationId: string, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.delete(`/organizations/${organizationId}`, options) as Core.APIPromise<{ + result: OrganizationDeleteResponse; + }> + )._thenUnwrap((obj) => obj.result); } /** @@ -147,6 +148,10 @@ export namespace Organization { } } +export interface OrganizationDeleteResponse { + id: string; +} + export interface OrganizationCreateParams { name: string; @@ -290,6 +295,7 @@ Organizations.OrganizationProfileResource = OrganizationProfileResource; export declare namespace Organizations { export { type Organization as Organization, + type OrganizationDeleteResponse as OrganizationDeleteResponse, OrganizationsSinglePage as OrganizationsSinglePage, type OrganizationCreateParams as OrganizationCreateParams, type OrganizationUpdateParams as OrganizationUpdateParams, diff --git a/src/resources/queues/consumers.ts b/src/resources/queues/consumers.ts index 93596e00ee..43eae71410 100644 --- a/src/resources/queues/consumers.ts +++ b/src/resources/queues/consumers.ts @@ -106,6 +106,33 @@ export class Consumers extends APIResource { const { account_id } = params; return this._client.delete(`/accounts/${account_id}/queues/${queueId}/consumers/${consumerId}`, options); } + + /** + * Fetches the consumer for a queue by consumer id + * + * @example + * ```ts + * const consumer = await client.queues.consumers.get( + * '023e105f4ecef8ad9ca31a8372d0c353', + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + queueId: string, + consumerId: string, + params: ConsumerGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + 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); + } } export class ConsumersSinglePage extends SinglePage {} @@ -464,6 +491,13 @@ export interface ConsumerDeleteParams { account_id: string; } +export interface ConsumerGetParams { + /** + * A Resource identifier. + */ + account_id: string; +} + Consumers.ConsumersSinglePage = ConsumersSinglePage; export declare namespace Consumers { @@ -475,5 +509,6 @@ export declare namespace Consumers { 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 32568cd469..ab15d31aa7 100644 --- a/src/resources/queues/index.ts +++ b/src/resources/queues/index.ts @@ -9,15 +9,32 @@ export { type ConsumerUpdateParams, type ConsumerListParams, type ConsumerDeleteParams, + 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'; -export { Subscriptions } from './subscriptions'; +export { + SubscriptionListResponsesV4PagePaginationArray, + Subscriptions, + type SubscriptionCreateResponse, + type SubscriptionUpdateResponse, + type SubscriptionListResponse, + type SubscriptionDeleteResponse, + type SubscriptionGetResponse, + type SubscriptionCreateParams, + type SubscriptionUpdateParams, + type SubscriptionListParams, + type SubscriptionDeleteParams, + type SubscriptionGetParams, +} from './subscriptions'; 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 15d1651711..836f42bd41 100644 --- a/src/resources/queues/queues.ts +++ b/src/resources/queues/queues.ts @@ -9,6 +9,7 @@ import { ConsumerCreateParams, ConsumerDeleteParams, ConsumerDeleteResponse, + ConsumerGetParams, ConsumerListParams, ConsumerUpdateParams, Consumers, @@ -18,15 +19,31 @@ import * as MessagesAPI from './messages'; import { MessageAckParams, MessageAckResponse, + MessageBulkPushParams, + MessageBulkPushResponse, MessagePullParams, MessagePullResponse, - MessagePullResponsesSinglePage, + MessagePushParams, + MessagePushResponse, Messages, } from './messages'; import * as PurgeAPI from './purge'; import { Purge, PurgeStartParams, PurgeStatusParams, PurgeStatusResponse } from './purge'; import * as SubscriptionsAPI from './subscriptions'; -import { Subscriptions } from './subscriptions'; +import { + SubscriptionCreateParams, + SubscriptionCreateResponse, + SubscriptionDeleteParams, + SubscriptionDeleteResponse, + SubscriptionGetParams, + SubscriptionGetResponse, + SubscriptionListParams, + SubscriptionListResponse, + SubscriptionListResponsesV4PagePaginationArray, + SubscriptionUpdateParams, + SubscriptionUpdateResponse, + Subscriptions, +} from './subscriptions'; import { SinglePage } from '../../pagination'; export class Queues extends APIResource { @@ -328,11 +345,11 @@ export interface QueueGetParams { Queues.QueuesSinglePage = QueuesSinglePage; Queues.Messages = Messages; -Queues.MessagePullResponsesSinglePage = MessagePullResponsesSinglePage; Queues.Purge = Purge; Queues.Consumers = Consumers; Queues.ConsumersSinglePage = ConsumersSinglePage; Queues.Subscriptions = Subscriptions; +Queues.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; export declare namespace Queues { export { @@ -350,10 +367,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 { @@ -372,7 +392,21 @@ export declare namespace Queues { type ConsumerUpdateParams as ConsumerUpdateParams, type ConsumerListParams as ConsumerListParams, type ConsumerDeleteParams as ConsumerDeleteParams, + type ConsumerGetParams as ConsumerGetParams, }; - export { Subscriptions as Subscriptions }; + export { + Subscriptions as Subscriptions, + type SubscriptionCreateResponse as SubscriptionCreateResponse, + type SubscriptionUpdateResponse as SubscriptionUpdateResponse, + type SubscriptionListResponse as SubscriptionListResponse, + type SubscriptionDeleteResponse as SubscriptionDeleteResponse, + type SubscriptionGetResponse as SubscriptionGetResponse, + SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, + type SubscriptionCreateParams as SubscriptionCreateParams, + type SubscriptionUpdateParams as SubscriptionUpdateParams, + type SubscriptionListParams as SubscriptionListParams, + type SubscriptionDeleteParams as SubscriptionDeleteParams, + type SubscriptionGetParams as SubscriptionGetParams, + }; } diff --git a/src/resources/queues/subscriptions.ts b/src/resources/queues/subscriptions.ts index 42d6ea9ea6..74c9b0e81f 100644 --- a/src/resources/queues/subscriptions.ts +++ b/src/resources/queues/subscriptions.ts @@ -1,5 +1,1046 @@ // 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 Subscriptions extends APIResource {} +export class Subscriptions extends APIResource { + /** + * Create a new event subscription for a queue + * + * @example + * ```ts + * const subscription = + * await client.queues.subscriptions.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create( + params: SubscriptionCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/event_subscriptions/subscriptions`, { + body, + ...options, + }) as Core.APIPromise<{ result: SubscriptionCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update an existing event subscription + * + * @example + * ```ts + * const subscription = + * await client.queues.subscriptions.update( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + update( + subscriptionId: string, + params: SubscriptionUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.patch(`/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: SubscriptionUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a paginated list of event subscriptions with optional sorting and filtering + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const subscriptionListResponse of client.queues.subscriptions.list( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: SubscriptionListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/event_subscriptions/subscriptions`, + SubscriptionListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Delete an existing event subscription + * + * @example + * ```ts + * const subscription = + * await client.queues.subscriptions.delete( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + subscriptionId: string, + params: SubscriptionDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete( + `/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, + options, + ) as Core.APIPromise<{ result: SubscriptionDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get details about an existing event subscription + * + * @example + * ```ts + * const subscription = await client.queues.subscriptions.get( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + subscriptionId: string, + params: SubscriptionGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, + options, + ) as Core.APIPromise<{ result: SubscriptionGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class SubscriptionListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface SubscriptionCreateResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionCreateResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionCreateResponse.MqEventSourceImages + | SubscriptionCreateResponse.MqEventSourceKV + | SubscriptionCreateResponse.MqEventSourceR2 + | SubscriptionCreateResponse.MqEventSourceSuperSlurper + | SubscriptionCreateResponse.MqEventSourceVectorize + | SubscriptionCreateResponse.MqEventSourceWorkersAIModel + | SubscriptionCreateResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionCreateResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionCreateResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionUpdateResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionUpdateResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionUpdateResponse.MqEventSourceImages + | SubscriptionUpdateResponse.MqEventSourceKV + | SubscriptionUpdateResponse.MqEventSourceR2 + | SubscriptionUpdateResponse.MqEventSourceSuperSlurper + | SubscriptionUpdateResponse.MqEventSourceVectorize + | SubscriptionUpdateResponse.MqEventSourceWorkersAIModel + | SubscriptionUpdateResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionUpdateResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionUpdateResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionListResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionListResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionListResponse.MqEventSourceImages + | SubscriptionListResponse.MqEventSourceKV + | SubscriptionListResponse.MqEventSourceR2 + | SubscriptionListResponse.MqEventSourceSuperSlurper + | SubscriptionListResponse.MqEventSourceVectorize + | SubscriptionListResponse.MqEventSourceWorkersAIModel + | SubscriptionListResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionListResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionListResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionDeleteResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionDeleteResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionDeleteResponse.MqEventSourceImages + | SubscriptionDeleteResponse.MqEventSourceKV + | SubscriptionDeleteResponse.MqEventSourceR2 + | SubscriptionDeleteResponse.MqEventSourceSuperSlurper + | SubscriptionDeleteResponse.MqEventSourceVectorize + | SubscriptionDeleteResponse.MqEventSourceWorkersAIModel + | SubscriptionDeleteResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionDeleteResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionDeleteResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionGetResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionGetResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionGetResponse.MqEventSourceImages + | SubscriptionGetResponse.MqEventSourceKV + | SubscriptionGetResponse.MqEventSourceR2 + | SubscriptionGetResponse.MqEventSourceSuperSlurper + | SubscriptionGetResponse.MqEventSourceVectorize + | SubscriptionGetResponse.MqEventSourceWorkersAIModel + | SubscriptionGetResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionGetResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionGetResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionCreateParams { + /** + * Path param: A Resource identifier. + */ + account_id: string; + + /** + * Body param: Destination configuration for the subscription + */ + destination?: SubscriptionCreateParams.Destination; + + /** + * Body param: Whether the subscription is active + */ + enabled?: boolean; + + /** + * Body param: List of event types this subscription handles + */ + events?: Array; + + /** + * Body param: Name of the subscription + */ + name?: string; + + /** + * Body param: Source configuration for the subscription + */ + source?: + | SubscriptionCreateParams.MqEventSourceImages + | SubscriptionCreateParams.MqEventSourceKV + | SubscriptionCreateParams.MqEventSourceR2 + | SubscriptionCreateParams.MqEventSourceSuperSlurper + | SubscriptionCreateParams.MqEventSourceVectorize + | SubscriptionCreateParams.MqEventSourceWorkersAIModel + | SubscriptionCreateParams.MqEventSourceWorkersBuildsWorker + | SubscriptionCreateParams.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionCreateParams { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + +export interface SubscriptionUpdateParams { + /** + * Path param: A Resource identifier. + */ + account_id: string; + + /** + * Body param: Destination configuration for the subscription + */ + destination?: SubscriptionUpdateParams.Destination; + + /** + * Body param: Whether the subscription is active + */ + enabled?: boolean; + + /** + * Body param: List of event types this subscription handles + */ + events?: Array; + + /** + * Body param: Name of the subscription + */ + name?: string; +} + +export namespace SubscriptionUpdateParams { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } +} + +export interface SubscriptionListParams extends V4PagePaginationArrayParams { + /** + * Path param: A Resource identifier. + */ + account_id: string; + + /** + * Query param: Sort direction + */ + direction?: 'asc' | 'desc'; + + /** + * Query param: Field to sort by + */ + order?: 'created_at' | 'name' | 'enabled' | 'source'; +} + +export interface SubscriptionDeleteParams { + /** + * A Resource identifier. + */ + account_id: string; +} + +export interface SubscriptionGetParams { + /** + * A Resource identifier. + */ + account_id: string; +} + +Subscriptions.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; + +export declare namespace Subscriptions { + export { + type SubscriptionCreateResponse as SubscriptionCreateResponse, + type SubscriptionUpdateResponse as SubscriptionUpdateResponse, + type SubscriptionListResponse as SubscriptionListResponse, + type SubscriptionDeleteResponse as SubscriptionDeleteResponse, + type SubscriptionGetResponse as SubscriptionGetResponse, + SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, + type SubscriptionCreateParams as SubscriptionCreateParams, + type SubscriptionUpdateParams as SubscriptionUpdateParams, + type SubscriptionListParams as SubscriptionListParams, + type SubscriptionDeleteParams as SubscriptionDeleteParams, + type SubscriptionGetParams as SubscriptionGetParams, + }; +} diff --git a/src/resources/r2/buckets/event-notifications.ts b/src/resources/r2/buckets/event-notifications.ts index cb0ba791f0..b3f163f204 100644 --- a/src/resources/r2/buckets/event-notifications.ts +++ b/src/resources/r2/buckets/event-notifications.ts @@ -13,7 +13,10 @@ export class EventNotifications extends APIResource { * await client.r2.buckets.eventNotifications.update( * 'example-bucket', * 'queue_id', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * rules: [{ actions: ['PutObject', 'CopyObject'] }], + * }, * ); * ``` */ @@ -275,7 +278,7 @@ export interface EventNotificationUpdateParams { /** * Body param: Array of rules to drive notifications. */ - rules?: Array; + rules: Array; /** * Header param: Jurisdiction where objects in this bucket are guaranteed to be diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts index 75c99603d5..c9e77e1896 100644 --- a/src/resources/radar/ai/bots/summary.ts +++ b/src/resources/radar/ai/bots/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of traffic by AI user agent. * - * @deprecated + * @deprecated Use [Radar AI Bots Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/summary_v2/) instead. */ userAgent( query?: SummaryUserAgentParams, diff --git a/src/resources/radar/ai/inference/summary.ts b/src/resources/radar/ai/inference/summary.ts index a22b6f10e9..4b9b871ddc 100644 --- a/src/resources/radar/ai/inference/summary.ts +++ b/src/resources/radar/ai/inference/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by model. * - * @deprecated + * @deprecated Use [Radar AI Inference Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/summary_v2/) instead. */ model(query?: SummaryModelParams, options?: Core.RequestOptions): Core.APIPromise; model(options?: Core.RequestOptions): Core.APIPromise; @@ -29,7 +29,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by task. * - * @deprecated + * @deprecated Use [Radar AI Inference Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/summary_v2/) instead. */ task(query?: SummaryTaskParams, options?: Core.RequestOptions): Core.APIPromise; task(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/ai/inference/timeseries-groups/summary.ts b/src/resources/radar/ai/inference/timeseries-groups/summary.ts index bf808d1b21..43edd89a6c 100644 --- a/src/resources/radar/ai/inference/timeseries-groups/summary.ts +++ b/src/resources/radar/ai/inference/timeseries-groups/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by model over time. * - * @deprecated + * @deprecated Use [Radar AI Inference Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/timeseries_groups_v2/) instead. */ model(query?: SummaryModelParams, options?: Core.RequestOptions): Core.APIPromise; model(options?: Core.RequestOptions): Core.APIPromise; @@ -30,7 +30,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by task over time. * - * @deprecated + * @deprecated Use [Radar AI Inference Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/timeseries_groups_v2/) instead. */ task(query?: SummaryTaskParams, options?: Core.RequestOptions): Core.APIPromise; task(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index b5b307bf8b..c516b5d812 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -93,7 +93,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of traffic by AI user agent over time. * - * @deprecated + * @deprecated Use [Radar AI Bots Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/timeseries_groups/) instead. */ userAgent( query?: TimeseriesGroupUserAgentParams, diff --git a/src/resources/radar/as112/summary.ts b/src/resources/radar/as112/summary.ts index d6034b19c4..c83056b982 100644 --- a/src/resources/radar/as112/summary.ts +++ b/src/resources/radar/as112/summary.ts @@ -9,7 +9,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by DNSSEC (DNS Security * Extensions) support. * - * @deprecated + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -31,7 +31,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by EDNS (Extension Mechanisms * for DNS) support. * - * @deprecated + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ edns(query?: SummaryEdnsParams, options?: Core.RequestOptions): Core.APIPromise; edns(options?: Core.RequestOptions): Core.APIPromise; @@ -52,7 +52,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by IP version. * - * @deprecated + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -76,7 +76,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by protocol. * - * @deprecated + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ protocol( query?: SummaryProtocolParams, @@ -100,7 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by type. * - * @deprecated + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ queryType( query?: SummaryQueryTypeParams, @@ -124,7 +124,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of AS112 DNS requests classified by response code. * - * @deprecated + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ responseCodes( query?: SummaryResponseCodesParams, diff --git a/src/resources/radar/as112/timeseries-groups.ts b/src/resources/radar/as112/timeseries-groups.ts index e5593df35c..fd564e8245 100644 --- a/src/resources/radar/as112/timeseries-groups.ts +++ b/src/resources/radar/as112/timeseries-groups.ts @@ -9,7 +9,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by DNSSEC (DNS Security * Extensions) support over time. * - * @deprecated + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -34,7 +34,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by EDNS (Extension Mechanisms * for DNS) support over time. * - * @deprecated + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ edns( query?: TimeseriesGroupEdnsParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by IP version over time. * - * @deprecated + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -84,7 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by protocol over * time. * - * @deprecated + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ protocol( query?: TimeseriesGroupProtocolParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by type over time. * - * @deprecated + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -134,7 +134,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by response code * over time. * - * @deprecated + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ responseCodes( query?: TimeseriesGroupResponseCodesParams, diff --git a/src/resources/radar/attacks/layer3/summary.ts b/src/resources/radar/attacks/layer3/summary.ts index bc4ccc4c81..869dd46727 100644 --- a/src/resources/radar/attacks/layer3/summary.ts +++ b/src/resources/radar/attacks/layer3/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ bitrate( query?: SummaryBitrateParams, @@ -32,7 +32,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ duration( query?: SummaryDurationParams, @@ -56,7 +56,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ industry( query?: SummaryIndustryParams, @@ -80,7 +80,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -104,7 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ protocol( query?: SummaryProtocolParams, @@ -128,7 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ vector(query?: SummaryVectorParams, options?: Core.RequestOptions): Core.APIPromise; vector(options?: Core.RequestOptions): Core.APIPromise; @@ -149,7 +149,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer3/timeseries-groups.ts b/src/resources/radar/attacks/layer3/timeseries-groups.ts index 9f8d171a40..622eb83d71 100644 --- a/src/resources/radar/attacks/layer3/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer3/timeseries-groups.ts @@ -8,7 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ bitrate( query?: TimeseriesGroupBitrateParams, @@ -33,7 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ duration( query?: TimeseriesGroupDurationParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ industry( query?: TimeseriesGroupIndustryParams, @@ -83,7 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ protocol( query?: TimeseriesGroupProtocolParams, @@ -133,7 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ vector( query?: TimeseriesGroupVectorParams, @@ -158,7 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer3/top/top.ts b/src/resources/radar/attacks/layer3/top/top.ts index 2da56402ce..e8e5c6b5b8 100644 --- a/src/resources/radar/attacks/layer3/top/top.ts +++ b/src/resources/radar/attacks/layer3/top/top.ts @@ -47,7 +47,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by industry endpoint. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ industry(query?: TopIndustryParams, options?: Core.RequestOptions): Core.APIPromise; industry(options?: Core.RequestOptions): Core.APIPromise; @@ -69,7 +69,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by vertical endpoint. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ vertical(query?: TopVerticalParams, options?: Core.RequestOptions): Core.APIPromise; vertical(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/attacks/layer7/summary.ts b/src/resources/radar/attacks/layer7/summary.ts index 160eb24dd8..3d4b27fb58 100644 --- a/src/resources/radar/attacks/layer7/summary.ts +++ b/src/resources/radar/attacks/layer7/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ httpMethod( query?: SummaryHTTPMethodParams, @@ -33,7 +33,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ httpVersion( query?: SummaryHTTPVersionParams, @@ -58,7 +58,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ industry( query?: SummaryIndustryParams, @@ -82,7 +82,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -106,7 +106,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ managedRules( query?: SummaryManagedRulesParams, @@ -131,7 +131,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ mitigationProduct( query?: SummaryMitigationProductParams, @@ -156,7 +156,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer7/timeseries-groups.ts b/src/resources/radar/attacks/layer7/timeseries-groups.ts index ce7c62ce1e..ab5076ef90 100644 --- a/src/resources/radar/attacks/layer7/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer7/timeseries-groups.ts @@ -8,7 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ httpMethod( query?: TimeseriesGroupHTTPMethodParams, @@ -33,7 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ industry( query?: TimeseriesGroupIndustryParams, @@ -83,7 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version used over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ managedRules( query?: TimeseriesGroupManagedRulesParams, @@ -133,7 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ mitigationProduct( query?: TimeseriesGroupMitigationProductParams, @@ -158,7 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical over time. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer7/top/top.ts b/src/resources/radar/attacks/layer7/top/top.ts index 74086112c2..1fa4d17fff 100644 --- a/src/resources/radar/attacks/layer7/top/top.ts +++ b/src/resources/radar/attacks/layer7/top/top.ts @@ -51,7 +51,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by industry endpoint. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ industry(query?: TopIndustryParams, options?: Core.RequestOptions): Core.APIPromise; industry(options?: Core.RequestOptions): Core.APIPromise; @@ -73,7 +73,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by vertical endpoint. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ vertical(query?: TopVerticalParams, options?: Core.RequestOptions): Core.APIPromise; vertical(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts index 4ba71c4acf..829a017a4b 100644 --- a/src/resources/radar/ct/logs.ts +++ b/src/resources/radar/ct/logs.ts @@ -121,6 +121,12 @@ export namespace LogGetResponse { */ api: 'RFC6962' | 'STATIC'; + /** + * The average throughput of the CT log, measured in certificates per hour + * (certs/hour). + */ + avgThroughput: number; + /** * A brief description of the certificate log. */ @@ -131,6 +137,11 @@ export namespace LogGetResponse { */ endExclusive: string; + /** + * Timestamp of the most recent update to the CT log. + */ + lastUpdate: string; + /** * The organization responsible for operating the certificate log. */ @@ -168,6 +179,18 @@ export namespace LogGetResponse { */ stateTimestamp: string; + /** + * Number of certificates that are eligible for inclusion to this log but have not + * been included yet. Based on certificates signed by trusted root CAs within the + * log's accepted date range. + */ + submittableCertCount: string | null; + + /** + * Number of certificates already included in this CT log. + */ + submittedCertCount: string | null; + /** * The URL for the certificate log. */ diff --git a/src/resources/radar/dns/summary.ts b/src/resources/radar/dns/summary.ts index 575afc929b..bea2bcf785 100644 --- a/src/resources/radar/dns/summary.ts +++ b/src/resources/radar/dns/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by cache status. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ cacheHit( query?: SummaryCacheHitParams, @@ -33,7 +33,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -55,7 +55,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ dnssecAware( query?: SummaryDNSSECAwareParams, @@ -80,7 +80,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ dnssecE2E( query?: SummaryDNSSECE2EParams, @@ -104,7 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by IP version. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -128,7 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ matchingAnswer( query?: SummaryMatchingAnswerParams, @@ -152,7 +152,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ protocol( query?: SummaryProtocolParams, @@ -176,7 +176,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by type. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ queryType( query?: SummaryQueryTypeParams, @@ -200,7 +200,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by response code. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ responseCode( query?: SummaryResponseCodeParams, @@ -224,7 +224,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by minimum response TTL. * - * @deprecated + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ responseTTL( query?: SummaryResponseTTLParams, diff --git a/src/resources/radar/dns/timeseries-groups.ts b/src/resources/radar/dns/timeseries-groups.ts index 5e1ea8a4e1..b2120478af 100644 --- a/src/resources/radar/dns/timeseries-groups.ts +++ b/src/resources/radar/dns/timeseries-groups.ts @@ -8,7 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by cache status over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ cacheHit( query?: TimeseriesGroupCacheHitParams, @@ -33,7 +33,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ dnssecAware( query?: TimeseriesGroupDNSSECAwareParams, @@ -84,7 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ dnssecE2E( query?: TimeseriesGroupDNSSECE2EParams, @@ -108,7 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by IP version over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -132,7 +132,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ matchingAnswer( query?: TimeseriesGroupMatchingAnswerParams, @@ -157,7 +157,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ protocol( query?: TimeseriesGroupProtocolParams, @@ -181,7 +181,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by type over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -205,7 +205,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by response code over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ responseCode( query?: TimeseriesGroupResponseCodeParams, @@ -230,7 +230,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by minimum answer TTL over time. * - * @deprecated + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ responseTTL( query?: TimeseriesGroupResponseTTLParams, diff --git a/src/resources/radar/email/routing/summary.ts b/src/resources/radar/email/routing/summary.ts index 00defd2b84..3d29f93974 100644 --- a/src/resources/radar/email/routing/summary.ts +++ b/src/resources/radar/email/routing/summary.ts @@ -10,7 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @deprecated + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -32,7 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @deprecated + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -54,7 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @deprecated + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -76,7 +76,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted). * - * @deprecated + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ encrypted( query?: SummaryEncryptedParams, @@ -100,7 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by IP version. * - * @deprecated + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -125,7 +125,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @deprecated + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/email/routing/timeseries-groups.ts b/src/resources/radar/email/routing/timeseries-groups.ts index 3a9801b143..4d12509309 100644 --- a/src/resources/radar/email/routing/timeseries-groups.ts +++ b/src/resources/radar/email/routing/timeseries-groups.ts @@ -10,7 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @deprecated + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ arc( query?: TimeseriesGroupARCParams, @@ -36,7 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @deprecated + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ dkim( query?: TimeseriesGroupDKIMParams, @@ -62,7 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @deprecated + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -88,7 +88,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted) over time. * - * @deprecated + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ encrypted( query?: TimeseriesGroupEncryptedParams, @@ -113,7 +113,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by IP version over time. * - * @deprecated + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -139,7 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @deprecated + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ spf( query?: TimeseriesGroupSPFParams, diff --git a/src/resources/radar/email/security/summary.ts b/src/resources/radar/email/security/summary.ts index 5136a742ff..c3432f9f36 100644 --- a/src/resources/radar/email/security/summary.ts +++ b/src/resources/radar/email/security/summary.ts @@ -10,7 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -32,7 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -54,7 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -75,7 +75,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by malicious classification. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ malicious( query?: SummaryMaliciousParams, @@ -99,7 +99,7 @@ export class Summary extends APIResource { /** * Retrieves the proportion of emails by spam classification (spam vs. non-spam). * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ spam(query?: SummarySpamParams, options?: Core.RequestOptions): Core.APIPromise; spam(options?: Core.RequestOptions): Core.APIPromise; @@ -121,7 +121,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; @@ -143,7 +143,7 @@ export class Summary extends APIResource { * Retrieves the proportion of emails by spoof classification (spoof vs. * non-spoof). * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ spoof(query?: SummarySpoofParams, options?: Core.RequestOptions): Core.APIPromise; spoof(options?: Core.RequestOptions): Core.APIPromise; @@ -164,7 +164,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by threat categories. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ threatCategory( query?: SummaryThreatCategoryParams, @@ -189,7 +189,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by TLS version. * - * @deprecated + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/email/security/timeseries-groups.ts b/src/resources/radar/email/security/timeseries-groups.ts index aa620088a0..9b33cf953e 100644 --- a/src/resources/radar/email/security/timeseries-groups.ts +++ b/src/resources/radar/email/security/timeseries-groups.ts @@ -10,7 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ arc( query?: TimeseriesGroupARCParams, @@ -36,7 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ dkim( query?: TimeseriesGroupDKIMParams, @@ -62,7 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -87,7 +87,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by malicious classification over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ malicious( query?: TimeseriesGroupMaliciousParams, @@ -113,7 +113,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spam classification (spam vs. non-spam) * over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ spam( query?: TimeseriesGroupSpamParams, @@ -139,7 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ spf( query?: TimeseriesGroupSPFParams, @@ -165,7 +165,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spoof classification (spoof vs. * non-spoof) over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ spoof( query?: TimeseriesGroupSpoofParams, @@ -190,7 +190,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by threat category over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ threatCategory( query?: TimeseriesGroupThreatCategoryParams, @@ -215,7 +215,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by TLS version over time. * - * @deprecated + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/http/summary.ts b/src/resources/radar/http/summary.ts index 9f7f84b12e..5c5792f467 100644 --- a/src/resources/radar/http/summary.ts +++ b/src/resources/radar/http/summary.ts @@ -11,7 +11,7 @@ export class Summary extends APIResource { * https://developers.cloudflare.com/radar/concepts/bot-classes/ for more * information. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ botClass( query?: SummaryBotClassParams, @@ -36,7 +36,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP requests generated by mobile, desktop, and * other types of devices. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ deviceType( query?: SummaryDeviceTypeParams, @@ -60,7 +60,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. HTTPS). * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ httpProtocol( query?: SummaryHTTPProtocolParams, @@ -84,7 +84,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP version. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ httpVersion( query?: SummaryHTTPVersionParams, @@ -108,7 +108,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by IP version. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -133,7 +133,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP requests by operating system (Windows, macOS, * Android, iOS, and others). * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ os(query?: SummaryOSParams, options?: Core.RequestOptions): Core.APIPromise; os(options?: Core.RequestOptions): Core.APIPromise; @@ -154,7 +154,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by post-quantum support. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ postQuantum( query?: SummaryPostQuantumParams, @@ -178,7 +178,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by TLS version. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/http/timeseries-groups.ts b/src/resources/radar/http/timeseries-groups.ts index a22fdb7774..6e44b45b29 100644 --- a/src/resources/radar/http/timeseries-groups.ts +++ b/src/resources/radar/http/timeseries-groups.ts @@ -10,7 +10,7 @@ export class TimeseriesGroups extends APIResource { * over time. Visit https://developers.cloudflare.com/radar/concepts/bot-classes/ * for more information. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ botClass( query?: TimeseriesGroupBotClassParams, @@ -34,7 +34,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by user agent over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ browser( query?: TimeseriesGroupBrowserParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by user agent family over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ browserFamily( query?: TimeseriesGroupBrowserFamilyParams, @@ -83,7 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by device type over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ deviceType( query?: TimeseriesGroupDeviceTypeParams, @@ -109,7 +109,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. HTTPS) * over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ httpProtocol( query?: TimeseriesGroupHTTPProtocolParams, @@ -134,7 +134,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP version over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -159,7 +159,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by IP version over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -183,7 +183,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by operating system over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ os( query?: TimeseriesGroupOSParams, @@ -207,7 +207,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by post-quantum support over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ postQuantum( query?: TimeseriesGroupPostQuantumParams, @@ -232,7 +232,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by TLS version over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/http/top.ts b/src/resources/radar/http/top.ts index 01ee05806f..8419bea370 100644 --- a/src/resources/radar/http/top.ts +++ b/src/resources/radar/http/top.ts @@ -8,10 +8,7 @@ export class Top extends APIResource { /** * Retrieves the top user agents by HTTP requests. * - * @example - * ```ts - * const response = await client.radar.http.top.browser(); - * ``` + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ browser(query?: TopBrowserParams, options?: Core.RequestOptions): Core.APIPromise; browser(options?: Core.RequestOptions): Core.APIPromise; @@ -32,11 +29,7 @@ export class Top extends APIResource { /** * Retrieves the top user agents, aggregated in families, by HTTP requests. * - * @example - * ```ts - * const response = - * await client.radar.http.top.browserFamily(); - * ``` + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ browserFamily( query?: TopBrowserFamilyParams, diff --git a/src/resources/radar/leaked-credentials/summary.ts b/src/resources/radar/leaked-credentials/summary.ts index 917ce13982..970fde6b56 100644 --- a/src/resources/radar/leaked-credentials/summary.ts +++ b/src/resources/radar/leaked-credentials/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP authentication requests by bot class. * - * @deprecated + * @deprecated Use [Radar Leaked Credentials Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/summary_v2/) instead. */ botClass( query?: SummaryBotClassParams, @@ -34,7 +34,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP authentication requests by compromised * credential status. * - * @deprecated + * @deprecated Use [Radar Leaked Credentials Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/summary_v2/) instead. */ compromised( query?: SummaryCompromisedParams, diff --git a/src/resources/radar/leaked-credentials/timeseries-groups.ts b/src/resources/radar/leaked-credentials/timeseries-groups.ts index 83aa48d077..859a012a8c 100644 --- a/src/resources/radar/leaked-credentials/timeseries-groups.ts +++ b/src/resources/radar/leaked-credentials/timeseries-groups.ts @@ -9,7 +9,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP authentication requests by bot class over * time. * - * @deprecated + * @deprecated Use [Radar Leaked Credentials Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/timeseries_groups_v2/) instead. */ botClass( query?: TimeseriesGroupBotClassParams, @@ -35,7 +35,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP authentication requests by compromised * credential status over time. * - * @deprecated + * @deprecated Use [Radar Leaked Credentials Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/timeseries_groups_v2/) instead. */ compromised( query?: TimeseriesGroupCompromisedParams, diff --git a/src/resources/rulesets/rules.ts b/src/resources/rulesets/rules.ts index ee0495559c..3cca8dc4a5 100644 --- a/src/resources/rulesets/rules.ts +++ b/src/resources/rulesets/rules.ts @@ -5850,7 +5850,7 @@ export namespace SetConfigRule { bic?: boolean; /** - * Whether to disable Cloudflare Apps. + * @deprecated Cloudflare Apps are deprected. */ disable_apps?: true; @@ -5885,7 +5885,8 @@ export namespace SetConfigRule { hotlink_protection?: boolean; /** - * Whether to enable Mirage. + * @deprecated Mirage is deprecated. More information at + * https://developers.cloudflare.com/speed/optimization/images/mirage/. */ mirage?: boolean; @@ -6087,7 +6088,7 @@ export namespace SetConfigRuleParam { bic?: boolean; /** - * Whether to disable Cloudflare Apps. + * @deprecated Cloudflare Apps are deprected. */ disable_apps?: true; @@ -6122,7 +6123,8 @@ export namespace SetConfigRuleParam { hotlink_protection?: boolean; /** - * Whether to enable Mirage. + * @deprecated Mirage is deprecated. More information at + * https://developers.cloudflare.com/speed/optimization/images/mirage/. */ mirage?: boolean; @@ -11368,7 +11370,7 @@ export declare namespace RuleCreateParams { bic?: boolean; /** - * Whether to disable Cloudflare Apps. + * @deprecated Cloudflare Apps are deprected. */ disable_apps?: true; @@ -11403,7 +11405,8 @@ export declare namespace RuleCreateParams { hotlink_protection?: boolean; /** - * Whether to enable Mirage. + * @deprecated Mirage is deprecated. More information at + * https://developers.cloudflare.com/speed/optimization/images/mirage/. */ mirage?: boolean; @@ -15560,7 +15563,7 @@ export declare namespace RuleEditParams { bic?: boolean; /** - * Whether to disable Cloudflare Apps. + * @deprecated Cloudflare Apps are deprected. */ disable_apps?: true; @@ -15595,7 +15598,8 @@ export declare namespace RuleEditParams { hotlink_protection?: boolean; /** - * Whether to enable Mirage. + * @deprecated Mirage is deprecated. More information at + * https://developers.cloudflare.com/speed/optimization/images/mirage/. */ mirage?: boolean; diff --git a/src/resources/secrets-store/stores/secrets.ts b/src/resources/secrets-store/stores/secrets.ts index 1ab72e50dc..ec0ca694ed 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', 'ai_gateway'], + * scopes: ['workers', 'ai_gateway', 'dex', 'access'], * value: 'api-token-secret-123', * }, * ], @@ -135,7 +135,7 @@ export class Secrets extends APIResource { * { * account_id: '985e105f4ecef8ad9ca31a8372d0c353', * name: 'MY_API_KEY', - * scopes: ['workers', 'ai_gateway'], + * scopes: ['workers', 'ai_gateway', 'dex', 'access'], * }, * ); * ``` diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts index 4af2451c88..d2cb382d90 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts @@ -63,7 +63,6 @@ export type BindingGetResponse = | BindingGetResponse.WorkersBindingKindSecretText | BindingGetResponse.WorkersBindingKindSendEmail | BindingGetResponse.WorkersBindingKindService - | BindingGetResponse.WorkersBindingKindTailConsumer | BindingGetResponse.WorkersBindingKindTextBlob | BindingGetResponse.WorkersBindingKindVectorize | BindingGetResponse.WorkersBindingKindVersionMetadata @@ -493,23 +492,6 @@ export namespace BindingGetResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. 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 78e5e95423..554313f4d3 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -372,7 +372,6 @@ export namespace ScriptUpdateParams { | Metadata.WorkersBindingKindSecretText | Metadata.WorkersBindingKindSendEmail | Metadata.WorkersBindingKindService - | Metadata.WorkersBindingKindTailConsumer | Metadata.WorkersBindingKindTextBlob | Metadata.WorkersBindingKindVectorize | Metadata.WorkersBindingKindVersionMetadata @@ -946,23 +945,6 @@ export namespace ScriptUpdateParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. 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 216456a041..fb897aea3f 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -91,7 +91,6 @@ export interface SettingEditResponse { | SettingEditResponse.WorkersBindingKindSecretText | SettingEditResponse.WorkersBindingKindSendEmail | SettingEditResponse.WorkersBindingKindService - | SettingEditResponse.WorkersBindingKindTailConsumer | SettingEditResponse.WorkersBindingKindTextBlob | SettingEditResponse.WorkersBindingKindVectorize | SettingEditResponse.WorkersBindingKindVersionMetadata @@ -572,23 +571,6 @@ export namespace SettingEditResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -843,7 +825,6 @@ export interface SettingGetResponse { | SettingGetResponse.WorkersBindingKindSecretText | SettingGetResponse.WorkersBindingKindSendEmail | SettingGetResponse.WorkersBindingKindService - | SettingGetResponse.WorkersBindingKindTailConsumer | SettingGetResponse.WorkersBindingKindTextBlob | SettingGetResponse.WorkersBindingKindVectorize | SettingGetResponse.WorkersBindingKindVersionMetadata @@ -1324,23 +1305,6 @@ export namespace SettingGetResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1608,7 +1572,6 @@ export namespace SettingEditParams { | Settings.WorkersBindingKindSecretText | Settings.WorkersBindingKindSendEmail | Settings.WorkersBindingKindService - | Settings.WorkersBindingKindTailConsumer | Settings.WorkersBindingKindTextBlob | Settings.WorkersBindingKindVectorize | Settings.WorkersBindingKindVersionMetadata @@ -2099,23 +2062,6 @@ export namespace SettingEditParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers/beta/workers/versions.ts b/src/resources/workers/beta/workers/versions.ts index 185cea7033..66bebbd506 100644 --- a/src/resources/workers/beta/workers/versions.ts +++ b/src/resources/workers/beta/workers/versions.ts @@ -176,7 +176,6 @@ export interface Version { | Version.WorkersBindingKindSecretText | Version.WorkersBindingKindSendEmail | Version.WorkersBindingKindService - | Version.WorkersBindingKindTailConsumer | Version.WorkersBindingKindTextBlob | Version.WorkersBindingKindVectorize | Version.WorkersBindingKindVersionMetadata @@ -734,23 +733,6 @@ export namespace Version { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1039,7 +1021,6 @@ export interface VersionCreateParams { | VersionCreateParams.WorkersBindingKindSecretText | VersionCreateParams.WorkersBindingKindSendEmail | VersionCreateParams.WorkersBindingKindService - | VersionCreateParams.WorkersBindingKindTailConsumer | VersionCreateParams.WorkersBindingKindTextBlob | VersionCreateParams.WorkersBindingKindVectorize | VersionCreateParams.WorkersBindingKindVersionMetadata @@ -1593,23 +1574,6 @@ export namespace VersionCreateParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. 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/workers/scripts/script-and-version-settings.ts b/src/resources/workers/scripts/script-and-version-settings.ts index d6ef7552ca..54237b4091 100644 --- a/src/resources/workers/scripts/script-and-version-settings.ts +++ b/src/resources/workers/scripts/script-and-version-settings.ts @@ -87,7 +87,6 @@ export interface ScriptAndVersionSettingEditResponse { | ScriptAndVersionSettingEditResponse.WorkersBindingKindSecretText | ScriptAndVersionSettingEditResponse.WorkersBindingKindSendEmail | ScriptAndVersionSettingEditResponse.WorkersBindingKindService - | ScriptAndVersionSettingEditResponse.WorkersBindingKindTailConsumer | ScriptAndVersionSettingEditResponse.WorkersBindingKindTextBlob | ScriptAndVersionSettingEditResponse.WorkersBindingKindVectorize | ScriptAndVersionSettingEditResponse.WorkersBindingKindVersionMetadata @@ -568,23 +567,6 @@ export namespace ScriptAndVersionSettingEditResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -839,7 +821,6 @@ export interface ScriptAndVersionSettingGetResponse { | ScriptAndVersionSettingGetResponse.WorkersBindingKindSecretText | ScriptAndVersionSettingGetResponse.WorkersBindingKindSendEmail | ScriptAndVersionSettingGetResponse.WorkersBindingKindService - | ScriptAndVersionSettingGetResponse.WorkersBindingKindTailConsumer | ScriptAndVersionSettingGetResponse.WorkersBindingKindTextBlob | ScriptAndVersionSettingGetResponse.WorkersBindingKindVectorize | ScriptAndVersionSettingGetResponse.WorkersBindingKindVersionMetadata @@ -1320,23 +1301,6 @@ export namespace ScriptAndVersionSettingGetResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1604,7 +1568,6 @@ export namespace ScriptAndVersionSettingEditParams { | Settings.WorkersBindingKindSecretText | Settings.WorkersBindingKindSendEmail | Settings.WorkersBindingKindService - | Settings.WorkersBindingKindTailConsumer | Settings.WorkersBindingKindTextBlob | Settings.WorkersBindingKindVectorize | Settings.WorkersBindingKindVersionMetadata @@ -2095,23 +2058,6 @@ export namespace ScriptAndVersionSettingEditParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index 70546d5580..a52d8a4ad2 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -681,7 +681,6 @@ export namespace ScriptUpdateParams { | Metadata.WorkersBindingKindSecretText | Metadata.WorkersBindingKindSendEmail | Metadata.WorkersBindingKindService - | Metadata.WorkersBindingKindTailConsumer | Metadata.WorkersBindingKindTextBlob | Metadata.WorkersBindingKindVectorize | Metadata.WorkersBindingKindVersionMetadata @@ -1255,23 +1254,6 @@ export namespace ScriptUpdateParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers/scripts/versions.ts b/src/resources/workers/scripts/versions.ts index c9027b6f0c..67d82e7c99 100644 --- a/src/resources/workers/scripts/versions.ts +++ b/src/resources/workers/scripts/versions.ts @@ -134,7 +134,6 @@ export namespace VersionCreateResponse { | Resources.WorkersBindingKindSecretText | Resources.WorkersBindingKindSendEmail | Resources.WorkersBindingKindService - | Resources.WorkersBindingKindTailConsumer | Resources.WorkersBindingKindTextBlob | Resources.WorkersBindingKindVectorize | Resources.WorkersBindingKindVersionMetadata @@ -570,23 +569,6 @@ export namespace VersionCreateResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -870,7 +852,6 @@ export namespace VersionGetResponse { | Resources.WorkersBindingKindSecretText | Resources.WorkersBindingKindSendEmail | Resources.WorkersBindingKindService - | Resources.WorkersBindingKindTailConsumer | Resources.WorkersBindingKindTextBlob | Resources.WorkersBindingKindVectorize | Resources.WorkersBindingKindVersionMetadata @@ -1306,23 +1287,6 @@ export namespace VersionGetResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1598,7 +1562,6 @@ export namespace VersionCreateParams { | Metadata.WorkersBindingKindSecretText | Metadata.WorkersBindingKindSendEmail | Metadata.WorkersBindingKindService - | Metadata.WorkersBindingKindTailConsumer | Metadata.WorkersBindingKindTextBlob | Metadata.WorkersBindingKindVectorize | Metadata.WorkersBindingKindVersionMetadata @@ -2075,23 +2038,6 @@ export namespace VersionCreateParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. 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..2740494438 100644 --- a/src/resources/workflows/instances/instances.ts +++ b/src/resources/workflows/instances/instances.ts @@ -1,21 +1,429 @@ // 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: `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. + */ + date_end?: string; + + /** + * Query param: Accepts ISO 8601 with no timezone offsets and in UTC. + */ + date_start?: string; + + /** + * Query param: should only be used when `cursor` is used, defines a new direction + * for the cursor + */ + direction?: 'asc' | 'desc'; + + /** + * 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/access/applications/applications.ts b/src/resources/zero-trust/access/applications/applications.ts index 1c6afd035f..7e7402cd82 100644 --- a/src/resources/zero-trust/access/applications/applications.ts +++ b/src/resources/zero-trust/access/applications/applications.ts @@ -1667,7 +1667,9 @@ export type ApplicationType = | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * The application type. @@ -1683,7 +1685,9 @@ export type ApplicationTypeParam = | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; export interface CORSHeaders { /** @@ -2670,7 +2674,11 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | SelfHostedApplication.PublicDestination + | SelfHostedApplication.PrivateDestination + | SelfHostedApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -2779,10 +2787,6 @@ export namespace ApplicationCreateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -2814,6 +2818,19 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -3263,7 +3280,9 @@ export namespace ApplicationCreateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -3335,7 +3354,11 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserSSHApplication.PublicDestination + | BrowserSSHApplication.PrivateDestination + | BrowserSSHApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -3444,10 +3467,6 @@ export namespace ApplicationCreateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -3479,6 +3498,19 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -3681,7 +3713,9 @@ export namespace ApplicationCreateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -3753,7 +3787,11 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserVNCApplication.PublicDestination + | BrowserVNCApplication.PrivateDestination + | BrowserVNCApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -3862,10 +3900,6 @@ export namespace ApplicationCreateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -3897,6 +3931,19 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -4093,7 +4140,9 @@ export namespace ApplicationCreateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -4859,7 +4908,11 @@ export namespace ApplicationCreateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserRdpApplication.PublicDestination + | BrowserRdpApplication.PrivateDestination + | BrowserRdpApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -4986,10 +5039,6 @@ export namespace ApplicationCreateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -5021,6 +5070,19 @@ export namespace ApplicationCreateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -5298,7 +5360,11 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | SelfHostedApplication.PublicDestination + | SelfHostedApplication.PrivateDestination + | SelfHostedApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -5407,10 +5473,6 @@ export namespace ApplicationUpdateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -5442,6 +5504,19 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -5891,7 +5966,9 @@ export namespace ApplicationUpdateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -5963,7 +6040,11 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserSSHApplication.PublicDestination + | BrowserSSHApplication.PrivateDestination + | BrowserSSHApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -6072,10 +6153,6 @@ export namespace ApplicationUpdateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -6107,6 +6184,19 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -6309,7 +6399,9 @@ export namespace ApplicationUpdateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -6381,7 +6473,11 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserVNCApplication.PublicDestination + | BrowserVNCApplication.PrivateDestination + | BrowserVNCApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -6490,10 +6586,6 @@ export namespace ApplicationUpdateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -6525,6 +6617,19 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -6721,7 +6826,9 @@ export namespace ApplicationUpdateResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -7487,7 +7594,11 @@ export namespace ApplicationUpdateResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserRdpApplication.PublicDestination + | BrowserRdpApplication.PrivateDestination + | BrowserRdpApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -7614,10 +7725,6 @@ export namespace ApplicationUpdateResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -7649,6 +7756,19 @@ export namespace ApplicationUpdateResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -7926,7 +8046,11 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | SelfHostedApplication.PublicDestination + | SelfHostedApplication.PrivateDestination + | SelfHostedApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -8035,10 +8159,6 @@ export namespace ApplicationListResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -8070,6 +8190,19 @@ export namespace ApplicationListResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -8519,7 +8652,9 @@ export namespace ApplicationListResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -8591,7 +8726,11 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserSSHApplication.PublicDestination + | BrowserSSHApplication.PrivateDestination + | BrowserSSHApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -8700,10 +8839,6 @@ export namespace ApplicationListResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -8735,6 +8870,19 @@ export namespace ApplicationListResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -8937,7 +9085,9 @@ export namespace ApplicationListResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -9009,7 +9159,11 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserVNCApplication.PublicDestination + | BrowserVNCApplication.PrivateDestination + | BrowserVNCApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -9118,10 +9272,6 @@ export namespace ApplicationListResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -9153,6 +9303,19 @@ export namespace ApplicationListResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -9349,7 +9512,9 @@ export namespace ApplicationListResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -10115,7 +10280,11 @@ export namespace ApplicationListResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserRdpApplication.PublicDestination + | BrowserRdpApplication.PrivateDestination + | BrowserRdpApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -10242,10 +10411,6 @@ export namespace ApplicationListResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -10277,6 +10442,19 @@ export namespace ApplicationListResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -10561,7 +10739,11 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | SelfHostedApplication.PublicDestination + | SelfHostedApplication.PrivateDestination + | SelfHostedApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -10670,10 +10852,6 @@ export namespace ApplicationGetResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -10705,6 +10883,19 @@ export namespace ApplicationGetResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -11154,7 +11345,9 @@ export namespace ApplicationGetResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -11226,7 +11419,11 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserSSHApplication.PublicDestination + | BrowserSSHApplication.PrivateDestination + | BrowserSSHApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -11335,10 +11532,6 @@ export namespace ApplicationGetResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -11370,6 +11563,19 @@ export namespace ApplicationGetResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -11572,7 +11778,9 @@ export namespace ApplicationGetResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -11644,7 +11852,11 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserVNCApplication.PublicDestination + | BrowserVNCApplication.PrivateDestination + | BrowserVNCApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -11753,10 +11965,6 @@ export namespace ApplicationGetResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -11788,6 +11996,19 @@ export namespace ApplicationGetResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -11984,7 +12205,9 @@ export namespace ApplicationGetResponse { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * UUID. @@ -12750,7 +12973,11 @@ export namespace ApplicationGetResponse { * allow for more flexibility in defining different types of domains. If * `destinations` are provided, then `self_hosted_domains` will be ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserRdpApplication.PublicDestination + | BrowserRdpApplication.PrivateDestination + | BrowserRdpApplication.ViaMcpServerPortalDestination + >; /** * Enables the binding cookie, which increases security against compromised @@ -12877,10 +13104,6 @@ export namespace ApplicationGetResponse { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -12912,6 +13135,19 @@ export namespace ApplicationGetResponse { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + export interface Policy { /** * The UUID of the policy @@ -13198,7 +13434,11 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | SelfHostedApplication.PublicDestination + | SelfHostedApplication.PrivateDestination + | SelfHostedApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -13313,10 +13553,6 @@ export declare namespace ApplicationCreateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -13348,6 +13584,19 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -13774,7 +14023,9 @@ export declare namespace ApplicationCreateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -13853,7 +14104,11 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserSSHApplication.PublicDestination + | BrowserSSHApplication.PrivateDestination + | BrowserSSHApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -13968,10 +14223,6 @@ export declare namespace ApplicationCreateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -14003,6 +14254,19 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -14188,7 +14452,9 @@ export declare namespace ApplicationCreateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -14267,7 +14533,11 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserVNCApplication.PublicDestination + | BrowserVNCApplication.PrivateDestination + | BrowserVNCApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -14382,10 +14652,6 @@ export declare namespace ApplicationCreateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -14417,6 +14683,19 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -14596,7 +14875,9 @@ export declare namespace ApplicationCreateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -15324,7 +15605,11 @@ export declare namespace ApplicationCreateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserRdpApplication.PublicDestination + | BrowserRdpApplication.PrivateDestination + | BrowserRdpApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -15457,10 +15742,6 @@ export declare namespace ApplicationCreateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -15492,6 +15773,19 @@ export declare namespace ApplicationCreateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -15759,7 +16053,11 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | SelfHostedApplication.PublicDestination + | SelfHostedApplication.PrivateDestination + | SelfHostedApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -15874,10 +16172,6 @@ export declare namespace ApplicationUpdateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -15909,6 +16203,19 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -16335,7 +16642,9 @@ export declare namespace ApplicationUpdateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -16414,7 +16723,11 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserSSHApplication.PublicDestination + | BrowserSSHApplication.PrivateDestination + | BrowserSSHApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -16529,10 +16842,6 @@ export declare namespace ApplicationUpdateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -16564,6 +16873,19 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -16749,7 +17071,9 @@ export declare namespace ApplicationUpdateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -16828,7 +17152,11 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserVNCApplication.PublicDestination + | BrowserVNCApplication.PrivateDestination + | BrowserVNCApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -16943,10 +17271,6 @@ export declare namespace ApplicationUpdateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -16978,6 +17302,19 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -17157,7 +17494,9 @@ export declare namespace ApplicationUpdateParams { | 'bookmark' | 'dash_sso' | 'infrastructure' - | 'rdp'; + | 'rdp' + | 'mcp' + | 'mcp_portal'; /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the @@ -17885,7 +18224,11 @@ export declare namespace ApplicationUpdateParams { * of domains. If `destinations` are provided, then `self_hosted_domains` will be * ignored. */ - destinations?: Array; + destinations?: Array< + | BrowserRdpApplication.PublicDestination + | BrowserRdpApplication.PrivateDestination + | BrowserRdpApplication.ViaMcpServerPortalDestination + >; /** * Body param: Enables the binding cookie, which increases security against @@ -18018,10 +18361,6 @@ export declare namespace ApplicationUpdateParams { uri?: string; } - /** - * Private destinations are an early access feature and gated behind a feature - * flag. - */ export interface PrivateDestination { /** * The CIDR range of the destination. Single IPs will be computed as /32. @@ -18053,6 +18392,19 @@ export declare namespace ApplicationUpdateParams { vnet_id?: string; } + /** + * A MCP server id configured in ai-controls. Access will secure the MCP server if + * accessed through a MCP portal. + */ + export interface ViaMcpServerPortalDestination { + /** + * The MCP server id configured in ai-controls. + */ + mcp_server_id?: string; + + type?: 'via_mcp_server_portal'; + } + /** * A JSON that links a reusable policy to an application. */ @@ -18256,6 +18608,11 @@ export interface ApplicationListParams extends V4PagePaginationArrayParams { * Query param: Search for apps by other listed query parameters. */ search?: string; + + /** + * Query param: Target Criteria attributes in key=value format. + */ + target_attributes?: string; } export interface ApplicationDeleteParams { diff --git a/src/resources/zero-trust/access/logs/access-requests.ts b/src/resources/zero-trust/access/logs/access-requests.ts index eb75000b09..4905779655 100644 --- a/src/resources/zero-trust/access/logs/access-requests.ts +++ b/src/resources/zero-trust/access/logs/access-requests.ts @@ -43,6 +43,20 @@ export interface AccessRequestListParams { */ direction?: 'desc' | 'asc'; + /** + * Query param: Filter by user email. Defaults to substring matching. To force + * exact matching, set `email_exact=true`. Example (default): `email=@example.com` + * returns all events with that domain. Example (exact): + * `email=user@example.com&email_exact=true` returns only that user. + */ + email?: string; + + /** + * Query param: When true, `email` is matched exactly instead of substring + * matching. + */ + email_exact?: boolean; + /** * Query param: The maximum number of log entries to retrieve. */ @@ -67,6 +81,11 @@ export interface AccessRequestListParams { * Query param: The latest event timestamp to query. */ until?: string; + + /** + * Query param: Filter by user UUID. + */ + user_id?: string; } export declare namespace AccessRequests { diff --git a/src/resources/zero-trust/connectivity/directory/directory.ts b/src/resources/zero-trust/connectivity/directory/directory.ts index 0c979324a6..8d0ed0ede1 100644 --- a/src/resources/zero-trust/connectivity/directory/directory.ts +++ b/src/resources/zero-trust/connectivity/directory/directory.ts @@ -4,10 +4,15 @@ import { APIResource } from '../../../../resource'; import * as ServicesAPI from './services'; import { ServiceCreateParams, + ServiceCreateResponse, ServiceDeleteParams, ServiceGetParams, + ServiceGetResponse, ServiceListParams, + ServiceListResponse, + ServiceListResponsesV4PagePaginationArray, ServiceUpdateParams, + ServiceUpdateResponse, Services, } from './services'; @@ -16,10 +21,16 @@ export class Directory extends APIResource { } Directory.Services = Services; +Directory.ServiceListResponsesV4PagePaginationArray = ServiceListResponsesV4PagePaginationArray; export declare namespace Directory { export { Services as Services, + type ServiceCreateResponse as ServiceCreateResponse, + type ServiceUpdateResponse as ServiceUpdateResponse, + type ServiceListResponse as ServiceListResponse, + type ServiceGetResponse as ServiceGetResponse, + ServiceListResponsesV4PagePaginationArray as ServiceListResponsesV4PagePaginationArray, type ServiceCreateParams as ServiceCreateParams, type ServiceUpdateParams as ServiceUpdateParams, type ServiceListParams as ServiceListParams, diff --git a/src/resources/zero-trust/connectivity/directory/index.ts b/src/resources/zero-trust/connectivity/directory/index.ts index 78f208d56a..2d94b5e566 100644 --- a/src/resources/zero-trust/connectivity/directory/index.ts +++ b/src/resources/zero-trust/connectivity/directory/index.ts @@ -2,7 +2,12 @@ export { Directory } from './directory'; export { + ServiceListResponsesV4PagePaginationArray, Services, + type ServiceCreateResponse, + type ServiceUpdateResponse, + type ServiceListResponse, + type ServiceGetResponse, type ServiceCreateParams, type ServiceUpdateParams, type ServiceListParams, diff --git a/src/resources/zero-trust/connectivity/directory/services.ts b/src/resources/zero-trust/connectivity/directory/services.ts index 74516c9f4d..8942da54ff 100644 --- a/src/resources/zero-trust/connectivity/directory/services.ts +++ b/src/resources/zero-trust/connectivity/directory/services.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../../resource'; import * as Core from '../../../../core'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../../pagination'; export class Services extends APIResource { /** @@ -9,23 +10,30 @@ export class Services extends APIResource { * * @example * ```ts - * await client.zeroTrust.connectivity.directory.services.create( - * { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * host: {}, - * name: 'name', - * type: 'http', - * }, - * ); + * const service = + * await client.zeroTrust.connectivity.directory.services.create( + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * host: { + * hostname: 'api.example.com', + * resolver_network: { + * tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da', + * }, + * }, + * name: 'web-server', + * type: 'http', + * }, + * ); * ``` */ - create(params: ServiceCreateParams, options?: Core.RequestOptions): Core.APIPromise { + create(params: ServiceCreateParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; - return this._client.post(`/accounts/${account_id}/connectivity/directory/services`, { - body, - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + return ( + this._client.post(`/accounts/${account_id}/connectivity/directory/services`, { + body, + ...options, + }) as Core.APIPromise<{ result: ServiceCreateResponse }> + )._thenUnwrap((obj) => obj.result); } /** @@ -33,28 +41,35 @@ export class Services extends APIResource { * * @example * ```ts - * await client.zeroTrust.connectivity.directory.services.update( - * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * { - * account_id: 'account_id', - * host: {}, - * name: 'name', - * type: 'http', - * }, - * ); + * const service = + * await client.zeroTrust.connectivity.directory.services.update( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { + * account_id: 'account_id', + * host: { + * ipv4: '10.0.0.1', + * network: { + * tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da', + * }, + * }, + * name: 'web-app', + * type: 'http', + * }, + * ); * ``` */ update( serviceId: string, params: ServiceUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, ...body } = params; - return this._client.put(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { - body, - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + return ( + this._client.put(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: ServiceUpdateResponse }> + )._thenUnwrap((obj) => obj.result); } /** @@ -62,18 +77,24 @@ export class Services extends APIResource { * * @example * ```ts - * await client.zeroTrust.connectivity.directory.services.list( + * // Automatically fetches more pages as needed. + * for await (const serviceListResponse of client.zeroTrust.connectivity.directory.services.list( * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); + * )) { + * // ... + * } * ``` */ - list(params: ServiceListParams, options?: Core.RequestOptions): Core.APIPromise { + list( + params: ServiceListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { const { account_id, ...query } = params; - return this._client.get(`/accounts/${account_id}/connectivity/directory/services`, { - query, - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + return this._client.getAPIList( + `/accounts/${account_id}/connectivity/directory/services`, + ServiceListResponsesV4PagePaginationArray, + { query, ...options }, + ); } /** @@ -104,18 +125,331 @@ export class Services extends APIResource { * * @example * ```ts - * await client.zeroTrust.connectivity.directory.services.get( - * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * { account_id: 'account_id' }, - * ); + * const service = + * await client.zeroTrust.connectivity.directory.services.get( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'account_id' }, + * ); * ``` */ - get(serviceId: string, params: ServiceGetParams, options?: Core.RequestOptions): Core.APIPromise { + get( + serviceId: string, + params: ServiceGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { const { account_id } = params; - return this._client.get(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); + return ( + this._client.get( + `/accounts/${account_id}/connectivity/directory/services/${serviceId}`, + options, + ) as Core.APIPromise<{ result: ServiceGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class ServiceListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface ServiceCreateResponse { + host: + | ServiceCreateResponse.InfraIPv4Host + | ServiceCreateResponse.InfraIPv6Host + | ServiceCreateResponse.InfraDualStackHost + | ServiceCreateResponse.InfraHostnameHost; + + name: string; + + type: 'http'; + + created_at?: string; + + http_port?: number | null; + + https_port?: number | null; + + service_id?: string; + + updated_at?: string; +} + +export namespace ServiceCreateResponse { + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; + + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } + } +} + +export interface ServiceUpdateResponse { + host: + | ServiceUpdateResponse.InfraIPv4Host + | ServiceUpdateResponse.InfraIPv6Host + | ServiceUpdateResponse.InfraDualStackHost + | ServiceUpdateResponse.InfraHostnameHost; + + name: string; + + type: 'http'; + + created_at?: string; + + http_port?: number | null; + + https_port?: number | null; + + service_id?: string; + + updated_at?: string; +} + +export namespace ServiceUpdateResponse { + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; + + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } + } +} + +export interface ServiceListResponse { + host: + | ServiceListResponse.InfraIPv4Host + | ServiceListResponse.InfraIPv6Host + | ServiceListResponse.InfraDualStackHost + | ServiceListResponse.InfraHostnameHost; + + name: string; + + type: 'http'; + + created_at?: string; + + http_port?: number | null; + + https_port?: number | null; + + service_id?: string; + + updated_at?: string; +} + +export namespace ServiceListResponse { + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; + + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } + } +} + +export interface ServiceGetResponse { + host: + | ServiceGetResponse.InfraIPv4Host + | ServiceGetResponse.InfraIPv6Host + | ServiceGetResponse.InfraDualStackHost + | ServiceGetResponse.InfraHostnameHost; + + name: string; + + type: 'http'; + + created_at?: string; + + http_port?: number | null; + + https_port?: number | null; + + service_id?: string; + + updated_at?: string; +} + +export namespace ServiceGetResponse { + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; + + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } } } @@ -128,7 +462,11 @@ export interface ServiceCreateParams { /** * Body param: */ - host: ServiceCreateParams.Host; + host: + | ServiceCreateParams.InfraIPv4Host + | ServiceCreateParams.InfraIPv6Host + | ServiceCreateParams.InfraDualStackHost + | ServiceCreateParams.InfraHostnameHost; /** * Body param: @@ -152,16 +490,56 @@ export interface ServiceCreateParams { } export namespace ServiceCreateParams { - export interface Host { - hostname?: string | null; + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; - ipv4?: string; + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } - ipv6?: string; + export interface InfraDualStackHost { + ipv4: string; - network?: unknown; + ipv6: string; - resolver_network?: unknown; + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } } } @@ -174,7 +552,11 @@ export interface ServiceUpdateParams { /** * Body param: */ - host: ServiceUpdateParams.Host; + host: + | ServiceUpdateParams.InfraIPv4Host + | ServiceUpdateParams.InfraIPv6Host + | ServiceUpdateParams.InfraDualStackHost + | ServiceUpdateParams.InfraHostnameHost; /** * Body param: @@ -198,35 +580,65 @@ export interface ServiceUpdateParams { } export namespace ServiceUpdateParams { - export interface Host { - hostname?: string | null; + export interface InfraIPv4Host { + ipv4: string; - ipv4?: string; + network: InfraIPv4Host.Network; + } - ipv6?: string; + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } - network?: unknown; + export interface InfraIPv6Host { + ipv6: string; - resolver_network?: unknown; + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } } } -export interface ServiceListParams { +export interface ServiceListParams extends V4PagePaginationArrayParams { /** * Path param: Account identifier */ account_id: string; - /** - * Query param: Current page in the response - */ - page?: number; - - /** - * Query param: Max amount of entries returned per page - */ - per_page?: number; - /** * Query param: */ @@ -241,8 +653,15 @@ export interface ServiceGetParams { account_id: string; } +Services.ServiceListResponsesV4PagePaginationArray = ServiceListResponsesV4PagePaginationArray; + export declare namespace Services { export { + type ServiceCreateResponse as ServiceCreateResponse, + type ServiceUpdateResponse as ServiceUpdateResponse, + type ServiceListResponse as ServiceListResponse, + type ServiceGetResponse as ServiceGetResponse, + ServiceListResponsesV4PagePaginationArray as ServiceListResponsesV4PagePaginationArray, type ServiceCreateParams as ServiceCreateParams, type ServiceUpdateParams as ServiceUpdateParams, type ServiceListParams as ServiceListParams, diff --git a/src/resources/zero-trust/devices/devices_.ts b/src/resources/zero-trust/devices/devices_.ts index c80ad3c322..997d0b4335 100644 --- a/src/resources/zero-trust/devices/devices_.ts +++ b/src/resources/zero-trust/devices/devices_.ts @@ -202,7 +202,8 @@ export interface DeviceListResponse { os_version_extra?: string | null; /** - * The public IP address of the WARP client. + * @deprecated **Deprecated**: IP information is provided by DEX - see + * https://developers.cloudflare.com/api/resources/zero_trust/subresources/dex/subresources/fleet_status/subresources/devices/methods/list/ */ public_ip?: string | null; @@ -371,7 +372,8 @@ export interface DeviceGetResponse { os_version_extra?: string | null; /** - * The public IP address of the WARP client. + * @deprecated **Deprecated**: IP information is provided by DEX - see + * https://developers.cloudflare.com/api/resources/zero_trust/subresources/dex/subresources/fleet_status/subresources/devices/methods/list/ */ public_ip?: string | null; diff --git a/src/resources/zero-trust/devices/dex-tests.ts b/src/resources/zero-trust/devices/dex-tests.ts index 024ac99cae..4446969263 100644 --- a/src/resources/zero-trust/devices/dex-tests.ts +++ b/src/resources/zero-trust/devices/dex-tests.ts @@ -13,10 +13,7 @@ export class DEXTests extends APIResource { * const dexTest = * await client.zeroTrust.devices.dexTests.create({ * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: { - * host: 'https://dash.cloudflare.com', - * kind: 'http', - * }, + * data: {}, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -43,10 +40,7 @@ export class DEXTests extends APIResource { * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { * account_id: '01a7362d577a6c3019a474fd6f485823', - * data: { - * host: 'https://dash.cloudflare.com', - * kind: 'http', - * }, + * data: {}, * enabled: true, * interval: '30m', * name: 'HTTP dash health check', @@ -277,24 +271,24 @@ export namespace DEXTestCreateResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -357,24 +351,24 @@ export namespace DEXTestUpdateResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -437,24 +431,24 @@ export namespace DEXTestListResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -522,24 +516,24 @@ export namespace DEXTestDeleteResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -603,24 +597,24 @@ export namespace DEXTestGetResponse { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -686,24 +680,24 @@ export namespace DEXTestCreateParams { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default @@ -769,24 +763,24 @@ export namespace DEXTestUpdateParams { /** * The desired endpoint to test. */ - host: string; + host?: string; /** * The type of test. */ - kind: 'http' | 'traceroute'; + kind?: string; /** * The HTTP request method type. */ - method?: 'GET'; + method?: string; } export interface TargetPolicy { /** - * API Resource UUID tag. + * The id of the DEX rule */ - id: string; + id?: string; /** * Whether the DEX rule is the account default diff --git a/src/resources/zero-trust/devices/posture/posture.ts b/src/resources/zero-trust/devices/posture/posture.ts index 3b2bd2a898..54f186eca7 100644 --- a/src/resources/zero-trust/devices/posture/posture.ts +++ b/src/resources/zero-trust/devices/posture/posture.ts @@ -850,7 +850,7 @@ export interface OSVersionInput { /** * Additional version data. For Mac or iOS, the Product Version Extra. For Linux, - * the kernel release version. (Mac, iOS, and Linux only). + * the distribution name and version. (Mac, iOS, and Linux only). */ os_version_extra?: string; } @@ -883,7 +883,7 @@ export interface OSVersionInputParam { /** * Additional version data. For Mac or iOS, the Product Version Extra. For Linux, - * the kernel release version. (Mac, iOS, and Linux only). + * the distribution name and version. (Mac, iOS, and Linux only). */ os_version_extra?: string; } 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/zero-trust/dex/dex.ts b/src/resources/zero-trust/dex/dex.ts index a500404035..f12a3ad01f 100644 --- a/src/resources/zero-trust/dex/dex.ts +++ b/src/resources/zero-trust/dex/dex.ts @@ -29,7 +29,6 @@ import { FleetStatusLiveParams, FleetStatusLiveResponse, FleetStatusOverTimeParams, - FleetStatusOverTimeResponse, LiveStat, } from './fleet-status/fleet-status'; import * as HTTPTestsAPI from './http-tests/http-tests'; @@ -54,9 +53,6 @@ export class DEX extends APIResource { } export interface DigitalExperienceMonitor { - /** - * API Resource UUID tag. - */ id: string; /** @@ -212,7 +208,6 @@ export declare namespace DEX { FleetStatus as FleetStatus, type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, - type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts index 43f7978b75..a64c26da75 100644 --- a/src/resources/zero-trust/dex/fleet-status/fleet-status.ts +++ b/src/resources/zero-trust/dex/fleet-status/fleet-status.ts @@ -44,25 +44,20 @@ export class FleetStatus extends APIResource { * * @example * ```ts - * const response = - * await client.zeroTrust.dex.fleetStatus.overTime({ - * account_id: '01a7362d577a6c3019a474fd6f485823', - * from: '2023-10-11T00:00:00Z', - * to: '2023-10-11T00:00:00Z', - * }); + * await client.zeroTrust.dex.fleetStatus.overTime({ + * account_id: '01a7362d577a6c3019a474fd6f485823', + * from: '2023-10-11T00:00:00Z', + * to: '2023-10-11T00:00:00Z', + * }); * ``` */ - overTime( - params: FleetStatusOverTimeParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + overTime(params: FleetStatusOverTimeParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...query } = params; - return ( - this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { - query, - ...options, - }) as Core.APIPromise<{ result: FleetStatusOverTimeResponse }> - )._thenUnwrap((obj) => obj.result); + return this._client.get(`/accounts/${account_id}/dex/fleet-status/over-time`, { + query, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); } } @@ -98,53 +93,6 @@ export namespace FleetStatusLiveResponse { } } -export interface FleetStatusOverTimeResponse { - deviceStats?: FleetStatusOverTimeResponse.DeviceStats; -} - -export namespace FleetStatusOverTimeResponse { - export interface DeviceStats { - byMode?: Array; - - byStatus?: Array; - - /** - * Number of unique devices - */ - uniqueDevicesTotal?: number; - } - - export namespace DeviceStats { - export interface ByMode { - /** - * Timestamp in ISO format - */ - timestamp?: string; - - /** - * Number of unique devices - */ - uniqueDevicesTotal?: number; - - value?: string; - } - - export interface ByStatus { - /** - * Timestamp in ISO format - */ - timestamp?: string; - - /** - * Number of unique devices - */ - uniqueDevicesTotal?: number; - - value?: string; - } - } -} - export interface FleetStatusLiveParams { /** * Path param: Unique identifier for account @@ -191,7 +139,6 @@ export declare namespace FleetStatus { export { type LiveStat as LiveStat, type FleetStatusLiveResponse as FleetStatusLiveResponse, - type FleetStatusOverTimeResponse as FleetStatusOverTimeResponse, type FleetStatusLiveParams as FleetStatusLiveParams, type FleetStatusOverTimeParams as FleetStatusOverTimeParams, }; diff --git a/src/resources/zero-trust/dex/fleet-status/index.ts b/src/resources/zero-trust/dex/fleet-status/index.ts index 8bf3ee7730..31cdb34bb8 100644 --- a/src/resources/zero-trust/dex/fleet-status/index.ts +++ b/src/resources/zero-trust/dex/fleet-status/index.ts @@ -10,7 +10,6 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, - type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status'; diff --git a/src/resources/zero-trust/dex/index.ts b/src/resources/zero-trust/dex/index.ts index d0f4eae54c..f97aa02d43 100644 --- a/src/resources/zero-trust/dex/index.ts +++ b/src/resources/zero-trust/dex/index.ts @@ -20,7 +20,6 @@ export { FleetStatus, type LiveStat, type FleetStatusLiveResponse, - type FleetStatusOverTimeResponse, type FleetStatusLiveParams, type FleetStatusOverTimeParams, } from './fleet-status/index'; diff --git a/src/resources/zero-trust/dlp/entries/custom.ts b/src/resources/zero-trust/dlp/entries/custom.ts index dcd4d0928f..15d6ea9d8c 100644 --- a/src/resources/zero-trust/dlp/entries/custom.ts +++ b/src/resources/zero-trust/dlp/entries/custom.ts @@ -17,7 +17,6 @@ export class Custom extends APIResource { * enabled: true, * name: 'name', * pattern: { regex: 'regex' }, - * profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * }); * ``` */ @@ -471,7 +470,7 @@ export interface CustomCreateParams { /** * Body param: */ - profile_id: string; + profile_id?: string; } export interface CustomUpdateParams { diff --git a/src/resources/zero-trust/dlp/entries/entries.ts b/src/resources/zero-trust/dlp/entries/entries.ts index 31eb68b9ee..de1cb6ba36 100644 --- a/src/resources/zero-trust/dlp/entries/entries.ts +++ b/src/resources/zero-trust/dlp/entries/entries.ts @@ -65,7 +65,6 @@ export class Entries extends APIResource { * enabled: true, * name: 'name', * pattern: { regex: 'regex' }, - * profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * }); * ``` */ @@ -637,7 +636,7 @@ export interface EntryCreateParams { /** * Body param: */ - profile_id: string; + profile_id?: string; } export type EntryUpdateParams = diff --git a/src/resources/zero-trust/gateway/configurations/configurations.ts b/src/resources/zero-trust/gateway/configurations/configurations.ts index 9f7a1aacb5..fb9a035b50 100755 --- a/src/resources/zero-trust/gateway/configurations/configurations.ts +++ b/src/resources/zero-trust/gateway/configurations/configurations.ts @@ -406,12 +406,11 @@ export interface CustomCertificateSettingsParam { } /** - * Specify user email settings for the firewall policies. When this is enabled, we - * standardize the email addresses in the identity part of the rule, so that they - * match the extended email variants in the firewall policies. When this setting is - * turned off, the email addresses in the identity part of the rule will be matched - * exactly as provided. If your email has `.` or `+` modifiers, you should enable - * this setting. + * Configures user email settings for firewall policies. When you enable this, the + * system standardizes email addresses in the identity portion of the rule to match + * extended email variants in firewall policies. When you disable this setting, the + * system matches email addresses exactly as you provide them. Enable this setting + * if your email uses `.` or `+` modifiers. */ export interface ExtendedEmailMatching { /** @@ -438,12 +437,11 @@ export interface ExtendedEmailMatching { } /** - * Specify user email settings for the firewall policies. When this is enabled, we - * standardize the email addresses in the identity part of the rule, so that they - * match the extended email variants in the firewall policies. When this setting is - * turned off, the email addresses in the identity part of the rule will be matched - * exactly as provided. If your email has `.` or `+` modifiers, you should enable - * this setting. + * Configures user email settings for firewall policies. When you enable this, the + * system standardizes email addresses in the identity portion of the rule to match + * extended email variants in firewall policies. When you disable this setting, the + * system matches email addresses exactly as you provide them. Enable this setting + * if your email uses `.` or `+` modifiers. */ export interface ExtendedEmailMatchingParam { /** @@ -515,12 +513,11 @@ export interface GatewayConfigurationSettings { custom_certificate?: CustomCertificateSettings | null; /** - * Specify user email settings for the firewall policies. When this is enabled, we - * standardize the email addresses in the identity part of the rule, so that they - * match the extended email variants in the firewall policies. When this setting is - * turned off, the email addresses in the identity part of the rule will be matched - * exactly as provided. If your email has `.` or `+` modifiers, you should enable - * this setting. + * Configures user email settings for firewall policies. When you enable this, the + * system standardizes email addresses in the identity portion of the rule to match + * extended email variants in firewall policies. When you disable this setting, the + * system matches email addresses exactly as you provide them. Enable this setting + * if your email uses `.` or `+` modifiers. */ extended_email_matching?: ExtendedEmailMatching | null; @@ -651,12 +648,11 @@ export interface GatewayConfigurationSettingsParam { custom_certificate?: CustomCertificateSettingsParam | null; /** - * Specify user email settings for the firewall policies. When this is enabled, we - * standardize the email addresses in the identity part of the rule, so that they - * match the extended email variants in the firewall policies. When this setting is - * turned off, the email addresses in the identity part of the rule will be matched - * exactly as provided. If your email has `.` or `+` modifiers, you should enable - * this setting. + * Configures user email settings for firewall policies. When you enable this, the + * system standardizes email addresses in the identity portion of the rule to match + * extended email variants in firewall policies. When you disable this setting, the + * system matches email addresses exactly as you provide them. Enable this setting + * if your email uses `.` or `+` modifiers. */ extended_email_matching?: ExtendedEmailMatchingParam | null; diff --git a/src/resources/zero-trust/gateway/rules.ts b/src/resources/zero-trust/gateway/rules.ts index 3187b1c5d2..845f44fd1f 100644 --- a/src/resources/zero-trust/gateway/rules.ts +++ b/src/resources/zero-trust/gateway/rules.ts @@ -321,7 +321,7 @@ export interface GatewayRule { /** * Specify the protocol or layer to evaluate the traffic, identity, and device - * posture expressions. + * posture expressions. Can only contain a single value. */ filters: Array; @@ -393,12 +393,10 @@ export interface GatewayRule { read_only?: boolean; /** - * Set settings related to this rule. Each setting is only valid for specific rule - * types and can only be used with the appropriate selectors. If Terraform drift is - * observed in these setting values, verify that the setting is supported for the - * given rule type and that the API response reflects the requested value. If the - * API response returns sanitized or modified values that differ from the request, - * use the API-provided values in Terraform to ensure consistency. + * Defines settings for this rule. Settings apply only to specific rule types and + * must use compatible selectors. If Terraform detects drift, confirm the setting + * supports your rule type and check whether the API modifies the value. Use + * API-returned values in your configuration to prevent drift. */ rule_settings?: RuleSetting; @@ -461,12 +459,10 @@ export namespace GatewayRule { } /** - * Set settings related to this rule. Each setting is only valid for specific rule - * types and can only be used with the appropriate selectors. If Terraform drift is - * observed in these setting values, verify that the setting is supported for the - * given rule type and that the API response reflects the requested value. If the - * API response returns sanitized or modified values that differ from the request, - * use the API-provided values in Terraform to ensure consistency. + * Defines settings for this rule. Settings apply only to specific rule types and + * must use compatible selectors. If Terraform detects drift, confirm the setting + * supports your rule type and check whether the API modifies the value. Use + * API-returned values in your configuration to prevent drift. */ export interface RuleSetting { /** @@ -920,12 +916,10 @@ export namespace RuleSetting { } /** - * Set settings related to this rule. Each setting is only valid for specific rule - * types and can only be used with the appropriate selectors. If Terraform drift is - * observed in these setting values, verify that the setting is supported for the - * given rule type and that the API response reflects the requested value. If the - * API response returns sanitized or modified values that differ from the request, - * use the API-provided values in Terraform to ensure consistency. + * Defines settings for this rule. Settings apply only to specific rule types and + * must use compatible selectors. If Terraform detects drift, confirm the setting + * supports your rule type and check whether the API modifies the value. Use + * API-returned values in your configuration to prevent drift. */ export interface RuleSettingParam { /** @@ -1584,7 +1578,7 @@ export interface RuleCreateParams { /** * Body param: Specify the protocol or layer to evaluate the traffic, identity, and - * device posture expressions. + * device posture expressions. Can only contain a single value. */ filters?: Array; @@ -1606,13 +1600,10 @@ export interface RuleCreateParams { precedence?: number; /** - * Body param: Set settings related to this rule. Each setting is only valid for - * specific rule types and can only be used with the appropriate selectors. If - * Terraform drift is observed in these setting values, verify that the setting is - * supported for the given rule type and that the API response reflects the - * requested value. If the API response returns sanitized or modified values that - * differ from the request, use the API-provided values in Terraform to ensure - * consistency. + * Body param: Defines settings for this rule. Settings apply only to specific rule + * types and must use compatible selectors. If Terraform detects drift, confirm the + * setting supports your rule type and check whether the API modifies the value. + * Use API-returned values in your configuration to prevent drift. */ rule_settings?: RuleSettingParam; @@ -1715,7 +1706,7 @@ export interface RuleUpdateParams { /** * Body param: Specify the protocol or layer to evaluate the traffic, identity, and - * device posture expressions. + * device posture expressions. Can only contain a single value. */ filters?: Array; @@ -1737,13 +1728,10 @@ export interface RuleUpdateParams { precedence?: number; /** - * Body param: Set settings related to this rule. Each setting is only valid for - * specific rule types and can only be used with the appropriate selectors. If - * Terraform drift is observed in these setting values, verify that the setting is - * supported for the given rule type and that the API response reflects the - * requested value. If the API response returns sanitized or modified values that - * differ from the request, use the API-provided values in Terraform to ensure - * consistency. + * Body param: Defines settings for this rule. Settings apply only to specific rule + * types and must use compatible selectors. If Terraform detects drift, confirm the + * setting supports your rule type and check whether the API modifies the value. + * Use API-returned values in your configuration to prevent drift. */ rule_settings?: RuleSettingParam; diff --git a/tests/api-resources/abuse-reports.test.ts b/tests/api-resources/abuse-reports.test.ts new file mode 100644 index 0000000000..4b1fb3b55a --- /dev/null +++ b/tests/api-resources/abuse-reports.test.ts @@ -0,0 +1,69 @@ +// 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 abuseReports', () => { + // TODO: investigate unauthorized HTTP response + test.skip('create: only required params', async () => { + const responsePromise = client.abuseReports.create('report_param', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + 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(); + 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 unauthorized HTTP response + test.skip('create: required and optional params', async () => { + const response = await client.abuseReports.create('report_param', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + 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', + comments: 'x', + company: 'x', + reported_country: 'xx', + reported_user_agent: 'x', + tele: 'x', + title: 'x', + }); + }); +}); diff --git a/tests/api-resources/accounts/accounts.test.ts b/tests/api-resources/accounts/accounts.test.ts index 562c65986b..c3e50bb520 100644 --- a/tests/api-resources/accounts/accounts.test.ts +++ b/tests/api-resources/accounts/accounts.test.ts @@ -51,6 +51,7 @@ describe('resource accounts', () => { id: '023e105f4ecef8ad9ca31a8372d0c353', name: 'Demo Account', type: 'standard', + managed_by: {}, settings: { abuse_contact_email: 'abuse_contact_email', enforce_twofactor: true }, }); }); diff --git a/tests/api-resources/api-gateway/configurations.test.ts b/tests/api-resources/api-gateway/configurations.test.ts index 307fcd648e..40818b7ce6 100644 --- a/tests/api-resources/api-gateway/configurations.test.ts +++ b/tests/api-resources/api-gateway/configurations.test.ts @@ -47,7 +47,6 @@ describe('resource configurations', () => { test('get: required and optional params', async () => { const response = await client.apiGateway.configurations.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - properties: ['auth_id_characteristics'], }); }); }); diff --git a/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts b/tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts new file mode 100644 index 0000000000..9bd29bee68 --- /dev/null +++ b/tests/api-resources/cloudforce-one/threat-events/indicator-types.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 indicatorTypes', () => { + // TODO: HTTP 401 from prism + test.skip('list: only required params', async () => { + const responsePromise = client.cloudforceOne.threatEvents.indicatorTypes.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); + }); + + // TODO: HTTP 401 from prism + test.skip('list: required and optional params', async () => { + const response = await client.cloudforceOne.threatEvents.indicatorTypes.list({ + account_id: 'account_id', + }); + }); +}); 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..a543062bc0 100644 --- a/tests/api-resources/kv/namespaces/namespaces.test.ts +++ b/tests/api-resources/kv/namespaces/namespaces.test.ts @@ -69,7 +69,7 @@ describe('resource namespaces', () => { direction: 'asc', order: 'id', page: 1, - per_page: 5, + per_page: 1, }); }); @@ -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..03fbaa4b52 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: {}, }); }); diff --git a/tests/api-resources/leaked-credential-checks/detections.test.ts b/tests/api-resources/leaked-credential-checks/detections.test.ts new file mode 100644 index 0000000000..f9a1af0b8e --- /dev/null +++ b/tests/api-resources/leaked-credential-checks/detections.test.ts @@ -0,0 +1,98 @@ +// 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 detections', () => { + test('create: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.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.leakedCredentialChecks.detections.create({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + password: 'lookup_json_string(http.request.body.raw, "secret")', + username: 'lookup_json_string(http.request.body.raw, "user")', + }); + }); + + test('update: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.update( + '18a14bafaa8eb1df04ce683ec18c765e', + { 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('update: required and optional params', async () => { + const response = await client.leakedCredentialChecks.detections.update( + '18a14bafaa8eb1df04ce683ec18c765e', + { + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + password: 'lookup_json_string(http.request.body.raw, "secret")', + username: 'lookup_json_string(http.request.body.raw, "user")', + }, + ); + }); + + test('list: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.list({ + 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('list: required and optional params', async () => { + const response = await client.leakedCredentialChecks.detections.list({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); + + test('delete: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.detections.delete( + '18a14bafaa8eb1df04ce683ec18c765e', + { 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('delete: required and optional params', async () => { + const response = await client.leakedCredentialChecks.detections.delete( + '18a14bafaa8eb1df04ce683ec18c765e', + { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + }); +}); diff --git a/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts b/tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts new file mode 100644 index 0000000000..c7c208f9ed --- /dev/null +++ b/tests/api-resources/leaked-credential-checks/leaked-credential-checks.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 leakedCredentialChecks', () => { + test('create: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.create({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + enabled: true, + }); + }); + + test('get: only required params', async () => { + const responsePromise = client.leakedCredentialChecks.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.leakedCredentialChecks.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + }); +}); 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/magic-transit/connectors/connectors.test.ts b/tests/api-resources/magic-transit/connectors/connectors.test.ts index 4c00bff6e0..83051604e2 100644 --- a/tests/api-resources/magic-transit/connectors/connectors.test.ts +++ b/tests/api-resources/magic-transit/connectors/connectors.test.ts @@ -29,7 +29,7 @@ describe('resource connectors', () => { test.skip('create: required and optional params', async () => { const response = await client.magicTransit.connectors.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', - device: { id: 'id', serial_number: 'serial_number' }, + device: { id: 'id', provision_license: true, serial_number: 'serial_number' }, activated: true, interrupt_window_duration_hours: 0, interrupt_window_hour_of_day: 0, @@ -58,6 +58,7 @@ describe('resource connectors', () => { interrupt_window_duration_hours: 0, interrupt_window_hour_of_day: 0, notes: 'notes', + provision_license: true, timezone: 'timezone', }); }); @@ -120,6 +121,7 @@ describe('resource connectors', () => { interrupt_window_duration_hours: 0, interrupt_window_hour_of_day: 0, notes: 'notes', + provision_license: true, timezone: 'timezone', }); }); diff --git a/tests/api-resources/queues/consumers.test.ts b/tests/api-resources/queues/consumers.test.ts index 9cff12967c..e4275cc8e0 100644 --- a/tests/api-resources/queues/consumers.test.ts +++ b/tests/api-resources/queues/consumers.test.ts @@ -115,4 +115,27 @@ describe('resource consumers', () => { { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); }); + + test('get: only required params', async () => { + const responsePromise = client.queues.consumers.get( + '023e105f4ecef8ad9ca31a8372d0c353', + '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('get: required and optional params', async () => { + const response = await client.queues.consumers.get( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + }); }); 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/queues/subscriptions.test.ts b/tests/api-resources/queues/subscriptions.test.ts new file mode 100644 index 0000000000..cefb7a8db1 --- /dev/null +++ b/tests/api-resources/queues/subscriptions.test.ts @@ -0,0 +1,120 @@ +// 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 subscriptions', () => { + test('create: only required params', async () => { + const responsePromise = client.queues.subscriptions.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.queues.subscriptions.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + destination: { queue_id: 'queue_id', type: 'queues.queue' }, + enabled: true, + events: ['string'], + name: 'name', + source: { type: 'images' }, + }); + }); + + test('update: only required params', async () => { + const responsePromise = client.queues.subscriptions.update('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('update: required and optional params', async () => { + const response = await client.queues.subscriptions.update('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + destination: { queue_id: 'queue_id', type: 'queues.queue' }, + enabled: true, + events: ['string'], + name: 'name', + }); + }); + + test('list: only required params', async () => { + const responsePromise = client.queues.subscriptions.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.queues.subscriptions.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + direction: 'asc', + order: 'created_at', + page: 1, + per_page: 1, + }); + }); + + test('delete: only required params', async () => { + const responsePromise = client.queues.subscriptions.delete('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('delete: required and optional params', async () => { + const response = await client.queues.subscriptions.delete('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); + + test('get: only required params', async () => { + const responsePromise = client.queues.subscriptions.get('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('get: required and optional params', async () => { + const response = await client.queues.subscriptions.get('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); +}); diff --git a/tests/api-resources/r2/buckets/event-notifications.test.ts b/tests/api-resources/r2/buckets/event-notifications.test.ts index 120dc9ff67..07d3d03635 100644 --- a/tests/api-resources/r2/buckets/event-notifications.test.ts +++ b/tests/api-resources/r2/buckets/event-notifications.test.ts @@ -14,6 +14,7 @@ describe('resource eventNotifications', () => { test.skip('update: only required params', async () => { const responsePromise = client.r2.buckets.eventNotifications.update('example-bucket', 'queue_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + rules: [{ actions: ['PutObject', 'CopyObject'] }], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); diff --git a/tests/api-resources/secrets-store/stores/secrets.test.ts b/tests/api-resources/secrets-store/stores/secrets.test.ts index afb8337e61..51d39096f9 100644 --- a/tests/api-resources/secrets-store/stores/secrets.test.ts +++ b/tests/api-resources/secrets-store/stores/secrets.test.ts @@ -13,7 +13,13 @@ 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', 'ai_gateway'], value: 'api-token-secret-123' }], + body: [ + { + name: 'MY_API_KEY', + scopes: ['workers', 'ai_gateway', 'dex', 'access'], + value: 'api-token-secret-123', + }, + ], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -30,7 +36,7 @@ describe('resource secrets', () => { body: [ { name: 'MY_API_KEY', - scopes: ['workers', 'ai_gateway'], + scopes: ['workers', 'ai_gateway', 'dex', 'access'], value: 'api-token-secret-123', comment: 'info about my secret', }, @@ -60,7 +66,7 @@ describe('resource secrets', () => { order: 'name', page: 2, per_page: 20, - scopes: [['workers', 'ai_gateway']], + scopes: [['workers', 'ai_gateway', 'dex', 'access']], search: 'search', }); }); @@ -116,7 +122,7 @@ describe('resource secrets', () => { { account_id: '985e105f4ecef8ad9ca31a8372d0c353', name: 'MY_API_KEY', - scopes: ['workers', 'ai_gateway'], + scopes: ['workers', 'ai_gateway', 'dex', 'access'], }, ); const rawResponse = await responsePromise.asResponse(); @@ -136,7 +142,7 @@ describe('resource secrets', () => { { account_id: '985e105f4ecef8ad9ca31a8372d0c353', name: 'MY_API_KEY', - scopes: ['workers', 'ai_gateway'], + scopes: ['workers', 'ai_gateway', 'dex', 'access'], comment: 'info about my secret', }, ); @@ -166,7 +172,7 @@ describe('resource secrets', () => { { account_id: '985e105f4ecef8ad9ca31a8372d0c353', comment: 'info about my secret', - scopes: ['workers', 'ai_gateway'], + scopes: ['workers', 'ai_gateway', 'dex', 'access'], }, ); }); 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..cdad8d0e4b --- /dev/null +++ b/tests/api-resources/workflows/instances/instances.test.ts @@ -0,0 +1,89 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource 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', + cursor: 'cursor', + date_end: '2019-12-27T18:11:19.117Z', + date_start: '2019-12-27T18:11:19.117Z', + direction: 'asc', + 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' }); + }); +}); diff --git a/tests/api-resources/zero-trust/access/applications/applications.test.ts b/tests/api-resources/zero-trust/access/applications/applications.test.ts index 225d81744d..e4607eeda4 100644 --- a/tests/api-resources/zero-trust/access/applications/applications.test.ts +++ b/tests/api-resources/zero-trust/access/applications/applications.test.ts @@ -78,6 +78,7 @@ describe('resource applications', () => { type: 'private', vnet_id: 'vnet_id', }, + { mcp_server_id: 'mcp-server-1', type: 'via_mcp_server_portal' }, ], enable_binding_cookie: true, http_only_cookie_attribute: true, @@ -182,6 +183,7 @@ describe('resource applications', () => { type: 'private', vnet_id: 'vnet_id', }, + { mcp_server_id: 'mcp-server-1', type: 'via_mcp_server_portal' }, ], enable_binding_cookie: true, http_only_cookie_attribute: true, 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 e939ee60e6..50ec6a1d24 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 @@ -27,11 +27,14 @@ describe('resource accessRequests', () => { const response = await client.zeroTrust.access.logs.accessRequests.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', direction: 'desc', + email: 'user@example.com', + email_exact: true, limit: 0, page: 0, per_page: 0, since: '2020-07-01T05:20:00Z', until: '2020-10-01T05:20:00Z', + user_id: 'f757c5c3-c1b2-50f7-9126-150a099b6f7e', }); }); }); diff --git a/tests/api-resources/zero-trust/connectivity/directory/services.test.ts b/tests/api-resources/zero-trust/connectivity/directory/services.test.ts index 4e6440e25c..735afe06c3 100644 --- a/tests/api-resources/zero-trust/connectivity/directory/services.test.ts +++ b/tests/api-resources/zero-trust/connectivity/directory/services.test.ts @@ -13,8 +13,11 @@ describe('resource services', () => { test('create: only required params', async () => { const responsePromise = client.zeroTrust.connectivity.directory.services.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', - host: {}, - name: 'name', + host: { + hostname: 'api.example.com', + resolver_network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da' }, + }, + name: 'web-server', type: 'http', }); const rawResponse = await responsePromise.asResponse(); @@ -29,18 +32,26 @@ describe('resource services', () => { test('create: required and optional params', async () => { const response = await client.zeroTrust.connectivity.directory.services.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', - host: { hostname: 'hostname', ipv4: 'ipv4', ipv6: 'ipv6', network: {}, resolver_network: {} }, - name: 'name', + host: { + hostname: 'api.example.com', + resolver_network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da', resolver_ips: ['string'] }, + }, + name: 'web-server', type: 'http', - http_port: 1, - https_port: 1, + http_port: 8080, + https_port: 8443, }); }); test('update: only required params', async () => { const responsePromise = client.zeroTrust.connectivity.directory.services.update( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - { account_id: 'account_id', host: {}, name: 'name', type: 'http' }, + { + account_id: 'account_id', + host: { ipv4: '10.0.0.1', network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da' } }, + name: 'web-app', + type: 'http', + }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -56,11 +67,11 @@ describe('resource services', () => { '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: 'account_id', - host: { hostname: 'hostname', ipv4: 'ipv4', ipv6: 'ipv6', network: {}, resolver_network: {} }, - name: 'name', + host: { ipv4: '10.0.0.1', network: { tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da' } }, + name: 'web-app', type: 'http', - http_port: 1, - https_port: 1, + http_port: 8080, + https_port: 8443, }, ); }); diff --git a/tests/api-resources/zero-trust/devices/dex-tests.test.ts b/tests/api-resources/zero-trust/devices/dex-tests.test.ts index 0669d5569c..246e9b7961 100644 --- a/tests/api-resources/zero-trust/devices/dex-tests.test.ts +++ b/tests/api-resources/zero-trust/devices/dex-tests.test.ts @@ -13,7 +13,7 @@ describe('resource dexTests', () => { test('create: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.create({ account_id: '01a7362d577a6c3019a474fd6f485823', - data: { host: 'https://dash.cloudflare.com', kind: 'http' }, + data: {}, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -35,7 +35,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], + target_policies: [{ id: 'id', default: true, name: 'name' }], targeted: true, }); }); @@ -43,7 +43,7 @@ describe('resource dexTests', () => { test('update: only required params', async () => { const responsePromise = client.zeroTrust.devices.dexTests.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', - data: { host: 'https://dash.cloudflare.com', kind: 'http' }, + data: {}, enabled: true, interval: '30m', name: 'HTTP dash health check', @@ -65,7 +65,7 @@ describe('resource dexTests', () => { interval: '30m', name: 'HTTP dash health check', description: 'Checks the dash endpoint every 30 minutes', - target_policies: [{ id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', default: true, name: 'name' }], + target_policies: [{ id: 'id', default: true, name: 'name' }], targeted: true, }); }); diff --git a/tests/api-resources/zero-trust/dlp/entries/custom.test.ts b/tests/api-resources/zero-trust/dlp/entries/custom.test.ts index fa0b9659df..a07726b8c7 100644 --- a/tests/api-resources/zero-trust/dlp/entries/custom.test.ts +++ b/tests/api-resources/zero-trust/dlp/entries/custom.test.ts @@ -16,7 +16,6 @@ describe('resource custom', () => { enabled: true, name: 'name', pattern: { regex: 'regex' }, - profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); diff --git a/tests/api-resources/zero-trust/dlp/entries/entries.test.ts b/tests/api-resources/zero-trust/dlp/entries/entries.test.ts index 0758392e54..aaeb9ac8db 100644 --- a/tests/api-resources/zero-trust/dlp/entries/entries.test.ts +++ b/tests/api-resources/zero-trust/dlp/entries/entries.test.ts @@ -16,7 +16,6 @@ describe('resource entries', () => { enabled: true, name: 'name', pattern: { regex: 'regex' }, - profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); From 5e4db34a61b63f2261c021b98061201a4dfadf91 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Oct 2025 19:50:28 +0000 Subject: [PATCH 291/451] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f0e94718e8..294f0bd049 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1859 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-70a848d790d5901965bb6bcb22e9344f3e1d851b42546532fbb5398c94cbd970.yml -openapi_spec_hash: c44c3de40c720efe1bdf46e239e94fcb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7c981c72c3b84f1b39c664311bcc286c0965bf2833955853107bc1988cc5ff25.yml +openapi_spec_hash: d4b77a5657c299c78a79bb3e5b326fef config_hash: e16fca6aff930b2279d586d92022f7d1 From 69f0a040cb7e39406f81c1f5cb519bf8c6d4d862 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Oct 2025 20:09:59 +0000 Subject: [PATCH 292/451] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 294f0bd049..3cbe618382 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1859 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7c981c72c3b84f1b39c664311bcc286c0965bf2833955853107bc1988cc5ff25.yml openapi_spec_hash: d4b77a5657c299c78a79bb3e5b326fef -config_hash: e16fca6aff930b2279d586d92022f7d1 +config_hash: 8255527f164e4993d48cc97c8e0b3afb From 666ad06c956e3f1114b70e74cc9700aa98390dee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 21:57:34 +0000 Subject: [PATCH 293/451] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 3cbe618382..d00f9eef11 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1859 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7c981c72c3b84f1b39c664311bcc286c0965bf2833955853107bc1988cc5ff25.yml openapi_spec_hash: d4b77a5657c299c78a79bb3e5b326fef -config_hash: 8255527f164e4993d48cc97c8e0b3afb +config_hash: b005a07fe728e7a9d190900f93eaa41f From ec38fec79f59dba36fbdaf1fd7d15927b524fb93 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 14:36:04 +0000 Subject: [PATCH 294/451] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 28 +- src/resources/addressing/addressing.ts | 14 +- src/resources/addressing/index.ts | 7 +- src/resources/addressing/loa-documents.ts | 77 +- .../addressing/prefixes/bgp-prefixes.ts | 9 +- src/resources/addressing/prefixes/prefixes.ts | 67 +- .../addressing/prefixes/service-bindings.ts | 19 +- src/resources/custom-pages.ts | 48 +- src/resources/d1/database.ts | 118 ++- .../email-security/investigate/investigate.ts | 5 + .../intel/attack-surface-report/issues.ts | 19 +- src/resources/logpush/datasets/fields.ts | 15 + src/resources/logpush/datasets/jobs.ts | 15 + src/resources/logpush/jobs.ts | 10 + src/resources/pages/index.ts | 1 - .../pages/projects/deployments/deployments.ts | 11 +- src/resources/pages/projects/index.ts | 1 - src/resources/pages/projects/projects.ts | 4 +- src/resources/radar/as112/as112.ts | 36 +- src/resources/radar/as112/summary.ts | 60 +- .../radar/as112/timeseries-groups.ts | 60 +- src/resources/radar/bgp/hijacks/events.ts | 3 - src/resources/radar/bgp/routes.ts | 9 - src/resources/radar/dns/dns.ts | 186 +++- src/resources/radar/dns/summary.ts | 148 +-- src/resources/radar/dns/timeseries-groups.ts | 148 +-- src/resources/radar/dns/top.ts | 339 +++++++ .../security-center/insights/insights.ts | 13 +- src/resources/shared.ts | 2 + .../dispatch/namespaces/scripts/scripts.ts | 81 +- .../dispatch/namespaces/scripts/settings.ts | 12 +- .../dispatch/namespaces/scripts/tags.ts | 2 +- src/resources/workers/index.ts | 3 +- src/resources/workers/scripts/index.ts | 3 +- .../scripts/script-and-version-settings.ts | 12 +- src/resources/workers/scripts/scripts.ts | 406 ++++++++- src/resources/workers/scripts/settings.ts | 2 +- src/resources/workers/workers.ts | 8 +- .../tunnels/cloudflared/cloudflared.ts | 664 +------------- .../tunnels/cloudflared/configurations.ts | 30 + .../zero-trust/tunnels/cloudflared/index.ts | 6 - src/resources/zero-trust/tunnels/index.ts | 6 - src/resources/zero-trust/tunnels/tunnels.ts | 13 - .../tunnels/warp-connector/warp-connector.ts | 856 +++++++++--------- .../addressing/loa-documents.test.ts | 24 - .../addressing/prefixes/bgp-prefixes.test.ts | 2 +- .../addressing/prefixes/prefixes.test.ts | 8 +- .../prefixes/service-bindings.test.ts | 6 +- .../investigate/investigate.test.ts | 1 + .../projects/deployments/deployments.test.ts | 2 + .../radar/annotations/annotations.test.ts | 2 +- .../radar/annotations/outages.test.ts | 4 +- tests/api-resources/radar/as112/as112.test.ts | 18 +- .../api-resources/radar/as112/summary.test.ts | 30 +- .../radar/as112/timeseries-groups.test.ts | 30 +- tests/api-resources/radar/as112/top.test.ts | 8 +- .../attacks/layer3/top/locations.test.ts | 4 +- .../radar/attacks/layer3/top/top.test.ts | 8 +- .../radar/attacks/layer7/top/ases.test.ts | 2 +- .../attacks/layer7/top/locations.test.ts | 4 +- .../radar/attacks/layer7/top/top.test.ts | 8 +- tests/api-resources/radar/bgp/bgp.test.ts | 2 +- .../radar/bgp/hijacks/events.test.ts | 4 +- .../radar/bgp/leaks/events.test.ts | 4 +- tests/api-resources/radar/bgp/routes.test.ts | 2 +- .../api-resources/radar/bgp/top/ases.test.ts | 4 +- tests/api-resources/radar/bgp/top/top.test.ts | 2 +- tests/api-resources/radar/bots/bots.test.ts | 2 +- .../radar/ct/authorities.test.ts | 2 +- tests/api-resources/radar/ct/ct.test.ts | 6 +- tests/api-resources/radar/ct/logs.test.ts | 2 +- tests/api-resources/radar/datasets.test.ts | 2 +- tests/api-resources/radar/dns/dns.test.ts | 52 +- tests/api-resources/radar/dns/summary.test.ts | 94 +- .../radar/dns/timeseries-groups.test.ts | 94 +- tests/api-resources/radar/dns/top.test.ts | 31 +- .../email/security/top/tlds/malicious.test.ts | 2 +- .../email/security/top/tlds/spam.test.ts | 2 +- .../email/security/top/tlds/spoof.test.ts | 2 +- .../email/security/top/tlds/tlds.test.ts | 2 +- .../api-resources/radar/entities/asns.test.ts | 2 +- .../radar/entities/locations.test.ts | 2 +- .../api-resources/radar/geolocations.test.ts | 2 +- .../radar/http/ases/ases.test.ts | 2 +- .../radar/http/ases/bot-class.test.ts | 2 +- .../radar/http/ases/browser-family.test.ts | 2 +- .../radar/http/ases/device-type.test.ts | 2 +- .../radar/http/ases/http-method.test.ts | 2 +- .../radar/http/ases/http-protocol.test.ts | 2 +- .../radar/http/ases/ip-version.test.ts | 2 +- .../api-resources/radar/http/ases/os.test.ts | 2 +- .../radar/http/ases/tls-version.test.ts | 2 +- .../radar/http/locations/bot-class.test.ts | 2 +- .../http/locations/browser-family.test.ts | 2 +- .../radar/http/locations/device-type.test.ts | 2 +- .../radar/http/locations/http-method.test.ts | 2 +- .../http/locations/http-protocol.test.ts | 2 +- .../radar/http/locations/ip-version.test.ts | 2 +- .../radar/http/locations/locations.test.ts | 2 +- .../radar/http/locations/os.test.ts | 2 +- .../radar/http/locations/tls-version.test.ts | 2 +- tests/api-resources/radar/http/top.test.ts | 4 +- .../api-resources/radar/netflows/top.test.ts | 4 +- .../radar/quality/speed/top.test.ts | 4 +- .../radar/ranking/domain.test.ts | 2 +- .../radar/ranking/internet-services.test.ts | 2 +- .../radar/ranking/ranking.test.ts | 4 +- .../radar/robots-txt/top/top.test.ts | 2 +- .../radar/robots-txt/top/user-agents.test.ts | 2 +- tests/api-resources/radar/search.test.ts | 2 +- .../radar/traffic-anomalies/locations.test.ts | 2 +- .../traffic-anomalies.test.ts | 2 +- .../radar/verified-bots/top.test.ts | 4 +- .../cloudflared/configurations.test.ts | 2 + 115 files changed, 2262 insertions(+), 1870 deletions(-) diff --git a/.stats.yml b/.stats.yml index d00f9eef11..a96fd35e9f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1859 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7c981c72c3b84f1b39c664311bcc286c0965bf2833955853107bc1988cc5ff25.yml -openapi_spec_hash: d4b77a5657c299c78a79bb3e5b326fef +configured_endpoints: 1858 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-30a19b0d3813d162ef87b7f4b9b29582d83afbab5291c85bf2522516fd1264c5.yml +openapi_spec_hash: 2f89047322a2f7a306150dd6c7afdcfa config_hash: b005a07fe728e7a9d190900f93eaa41f diff --git a/api.md b/api.md index 112ba46fbe..95af248a52 100644 --- a/api.md +++ b/api.md @@ -2108,6 +2108,7 @@ Types: - Script - ScriptSetting - ScriptUpdateResponse +- ScriptListResponse - ScriptDeleteResponse - ScriptGetResponse - ScriptSearchResponse @@ -2115,7 +2116,7 @@ Types: Methods: - client.workers.scripts.update(scriptName, { ...params }) -> ScriptUpdateResponse -- client.workers.scripts.list({ ...params }) -> ScriptsSinglePage +- client.workers.scripts.list({ ...params }) -> ScriptListResponsesSinglePage - client.workers.scripts.delete(scriptName, { ...params }) -> ScriptDeleteResponse | null - client.workers.scripts.get(scriptName, { ...params }) -> string - client.workers.scripts.search({ ...params }) -> ScriptSearchResponse @@ -2945,13 +2946,8 @@ Methods: ## LOADocuments -Types: - -- LOADocumentCreateResponse - Methods: -- client.addressing.loaDocuments.create({ ...params }) -> LOADocumentCreateResponse - client.addressing.loaDocuments.get(loaDocumentId, { ...params }) -> Response ## Prefixes @@ -3967,7 +3963,7 @@ Types: Methods: - client.pages.projects.deployments.create(projectName, { ...params }) -> Deployment -- client.pages.projects.deployments.list(projectName, { ...params }) -> DeploymentsSinglePage +- client.pages.projects.deployments.list(projectName, { ...params }) -> DeploymentsV4PagePaginationArray - client.pages.projects.deployments.delete(projectName, deploymentId, { ...params }) -> DeploymentDeleteResponse | null - client.pages.projects.deployments.get(projectName, deploymentId, { ...params }) -> Deployment - client.pages.projects.deployments.retry(projectName, deploymentId, { ...params }) -> Deployment @@ -5609,21 +5605,13 @@ Methods: ### Cloudflared -Types: - -- CloudflaredCreateResponse -- CloudflaredListResponse -- CloudflaredDeleteResponse -- CloudflaredEditResponse -- CloudflaredGetResponse - Methods: -- client.zeroTrust.tunnels.cloudflared.create({ ...params }) -> CloudflaredCreateResponse -- client.zeroTrust.tunnels.cloudflared.list({ ...params }) -> CloudflaredListResponsesV4PagePaginationArray -- client.zeroTrust.tunnels.cloudflared.delete(tunnelId, { ...params }) -> CloudflaredDeleteResponse -- client.zeroTrust.tunnels.cloudflared.edit(tunnelId, { ...params }) -> CloudflaredEditResponse -- client.zeroTrust.tunnels.cloudflared.get(tunnelId, { ...params }) -> CloudflaredGetResponse +- client.zeroTrust.tunnels.cloudflared.create({ ...params }) -> CloudflareTunnel +- client.zeroTrust.tunnels.cloudflared.list({ ...params }) -> CloudflareTunnelsV4PagePaginationArray +- client.zeroTrust.tunnels.cloudflared.delete(tunnelId, { ...params }) -> CloudflareTunnel +- client.zeroTrust.tunnels.cloudflared.edit(tunnelId, { ...params }) -> CloudflareTunnel +- client.zeroTrust.tunnels.cloudflared.get(tunnelId, { ...params }) -> CloudflareTunnel #### Configurations diff --git a/src/resources/addressing/addressing.ts b/src/resources/addressing/addressing.ts index 06599a8421..d38bac8b1f 100644 --- a/src/resources/addressing/addressing.ts +++ b/src/resources/addressing/addressing.ts @@ -2,12 +2,7 @@ import { APIResource } from '../../resource'; import * as LOADocumentsAPI from './loa-documents'; -import { - LOADocumentCreateParams, - LOADocumentCreateResponse, - LOADocumentGetParams, - LOADocuments, -} from './loa-documents'; +import { LOADocumentGetParams, LOADocuments } from './loa-documents'; import * as ServicesAPI from './services'; import { ServiceListParams, ServiceListResponse, ServiceListResponsesSinglePage, Services } from './services'; import * as AddressMapsAPI from './address-maps/address-maps'; @@ -111,12 +106,7 @@ export declare namespace Addressing { type AddressMapGetParams as AddressMapGetParams, }; - export { - LOADocuments as LOADocuments, - type LOADocumentCreateResponse as LOADocumentCreateResponse, - type LOADocumentCreateParams as LOADocumentCreateParams, - type LOADocumentGetParams as LOADocumentGetParams, - }; + export { LOADocuments as LOADocuments, type LOADocumentGetParams as LOADocumentGetParams }; export { Prefixes as Prefixes, diff --git a/src/resources/addressing/index.ts b/src/resources/addressing/index.ts index 6b64a96cdf..53a85afcca 100644 --- a/src/resources/addressing/index.ts +++ b/src/resources/addressing/index.ts @@ -15,12 +15,7 @@ export { type AddressMapGetParams, } from './address-maps/index'; export { Addressing } from './addressing'; -export { - LOADocuments, - type LOADocumentCreateResponse, - type LOADocumentCreateParams, - type LOADocumentGetParams, -} from './loa-documents'; +export { LOADocuments, type LOADocumentGetParams } from './loa-documents'; export { PrefixesSinglePage, Prefixes, diff --git a/src/resources/addressing/loa-documents.ts b/src/resources/addressing/loa-documents.ts index dafacf0abb..b93c60afc5 100644 --- a/src/resources/addressing/loa-documents.ts +++ b/src/resources/addressing/loa-documents.ts @@ -5,31 +5,6 @@ import * as Core from '../../core'; import { type Response } from '../../_shims/index'; export class LOADocuments extends APIResource { - /** - * Submit LOA document (pdf format) under the account. - * - * @example - * ```ts - * const loaDocument = - * await client.addressing.loaDocuments.create({ - * account_id: '258def64c72dae45f3e4c8516e2111f2', - * loa_document: '@document.pdf', - * }); - * ``` - */ - create( - params: LOADocumentCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post( - `/accounts/${account_id}/addressing/loa_documents`, - Core.multipartFormRequestOptions({ body, ...options }), - ) as Core.APIPromise<{ result: LOADocumentCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * Download specified LOA document under the account. * @@ -59,52 +34,6 @@ export class LOADocuments extends APIResource { } } -export interface LOADocumentCreateResponse { - /** - * Identifier for the uploaded LOA document. - */ - id?: string | null; - - /** - * Identifier of a Cloudflare account. - */ - account_id?: string; - - created?: string; - - /** - * Name of LOA document. Max file size 10MB, and supported filetype is pdf. - */ - filename?: string; - - /** - * File size of the uploaded LOA document. - */ - size_bytes?: number; - - /** - * Whether the LOA has been verified by Cloudflare staff. - */ - verified?: boolean; - - /** - * Timestamp of the moment the LOA was marked as validated. - */ - verified_at?: string | null; -} - -export interface LOADocumentCreateParams { - /** - * Path param: Identifier of a Cloudflare account. - */ - account_id: string; - - /** - * Body param: LOA document to upload. - */ - loa_document: string; -} - export interface LOADocumentGetParams { /** * Identifier of a Cloudflare account. @@ -113,9 +42,5 @@ export interface LOADocumentGetParams { } export declare namespace LOADocuments { - export { - type LOADocumentCreateResponse as LOADocumentCreateResponse, - type LOADocumentCreateParams as LOADocumentCreateParams, - type LOADocumentGetParams as LOADocumentGetParams, - }; + export { type LOADocumentGetParams as LOADocumentGetParams }; } diff --git a/src/resources/addressing/prefixes/bgp-prefixes.ts b/src/resources/addressing/prefixes/bgp-prefixes.ts index 1945d1a5b1..f8cd80f52e 100644 --- a/src/resources/addressing/prefixes/bgp-prefixes.ts +++ b/src/resources/addressing/prefixes/bgp-prefixes.ts @@ -15,7 +15,10 @@ export class BGPPrefixes extends APIResource { * const bgpPrefix = * await client.addressing.prefixes.bgpPrefixes.create( * '2af39739cc4e3b5910c918468bb89828', - * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * { + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * cidr: '192.0.2.0/24', + * }, * ); * ``` */ @@ -196,7 +199,7 @@ export namespace BGPPrefix { on_demand_enabled?: boolean; /** - * Whether advertisement status of the prefix is locked, meaning it cannot be + * Whether the advertisement status of the prefix is locked, meaning it cannot be * changed. */ on_demand_locked?: boolean; @@ -212,7 +215,7 @@ export interface BGPPrefixCreateParams { /** * Body param: IP Prefix in Classless Inter-Domain Routing format. */ - cidr?: string; + cidr: string; } export interface BGPPrefixListParams { diff --git a/src/resources/addressing/prefixes/prefixes.ts b/src/resources/addressing/prefixes/prefixes.ts index a965d93b86..51124a3677 100644 --- a/src/resources/addressing/prefixes/prefixes.ts +++ b/src/resources/addressing/prefixes/prefixes.ts @@ -56,9 +56,8 @@ export class Prefixes extends APIResource { * ```ts * const prefix = await client.addressing.prefixes.create({ * account_id: '258def64c72dae45f3e4c8516e2111f2', - * asn: 209242, + * asn: 13335, * cidr: '192.0.2.0/24', - * loa_document_id: 'd933b1530bc56c9953cf8ce166da8004', * }); * ``` */ @@ -200,7 +199,7 @@ export interface Prefix { /** * Autonomous System Number (ASN) the prefix will be advertised under. */ - asn?: number | null; + asn?: number; /** * IP Prefix in Classless Inter-Domain Routing format. @@ -209,11 +208,22 @@ export interface Prefix { created_at?: string; + /** + * Whether Cloudflare is allowed to generate the LOA document on behalf of the + * prefix owner. + */ + delegate_loa_creation?: boolean; + /** * Description of the prefix. */ description?: string; + /** + * State of one kind of validation for an IP prefix. + */ + irr_validation_state?: string; + /** * Identifier for the uploaded LOA document. */ @@ -236,6 +246,21 @@ export interface Prefix { * Prefix. */ on_demand_locked?: boolean; + + /** + * State of one kind of validation for an IP prefix. + */ + ownership_validation_state?: string; + + /** + * Token provided to demonstrate ownership of the prefix. + */ + ownership_validation_token?: string; + + /** + * State of one kind of validation for an IP prefix. + */ + rpki_validation_state?: string; } export interface PrefixDeleteResponse { @@ -247,8 +272,6 @@ export interface PrefixDeleteResponse { * Whether the API call was successful. */ success: true; - - result_info?: PrefixDeleteResponse.ResultInfo; } export namespace PrefixDeleteResponse { @@ -283,28 +306,6 @@ export namespace PrefixDeleteResponse { pointer?: string; } } - - export interface ResultInfo { - /** - * Total number of results for the requested service. - */ - count?: number; - - /** - * Current page within paginated list of results. - */ - page?: number; - - /** - * Number of results per page of results. - */ - per_page?: number; - - /** - * Total results available without any search parameters. - */ - total_count?: number; - } } export interface PrefixCreateParams { @@ -316,7 +317,7 @@ export interface PrefixCreateParams { /** * Body param: Autonomous System Number (ASN) the prefix will be advertised under. */ - asn: number | null; + asn: number; /** * Body param: IP Prefix in Classless Inter-Domain Routing format. @@ -324,9 +325,15 @@ export interface PrefixCreateParams { cidr: string; /** - * Body param: Identifier for the uploaded LOA document. + * Body param: Whether Cloudflare is allowed to generate the LOA document on behalf + * of the prefix owner. */ - loa_document_id: string | null; + delegate_loa_creation?: boolean; + + /** + * Body param: Description of the prefix. + */ + description?: string; } export interface PrefixListParams { diff --git a/src/resources/addressing/prefixes/service-bindings.ts b/src/resources/addressing/prefixes/service-bindings.ts index 5ef9365d41..a12783f519 100644 --- a/src/resources/addressing/prefixes/service-bindings.ts +++ b/src/resources/addressing/prefixes/service-bindings.ts @@ -7,17 +7,22 @@ import { SinglePage } from '../../../pagination'; export class ServiceBindings extends APIResource { /** * Creates a new Service Binding, routing traffic to IPs within the given CIDR to a - * service running on Cloudflare's network. **Note:** This API may only be used on - * prefixes currently configured with a Magic Transit/Cloudflare CDN/Cloudflare - * Spectrum service binding, and only allows creating upgrade service bindings for - * the Cloudflare CDN or Cloudflare Spectrum. + * service running on Cloudflare's network. **NOTE:** The first Service Binding + * created for an IP Prefix must exactly match the IP Prefix's CIDR. Subsequent + * Service Bindings may be created with a more-specific CIDR. Refer to the + * [Service Bindings Documentation](https://developers.cloudflare.com/byoip/service-bindings/) + * for compatibility details. * * @example * ```ts * const serviceBinding = * await client.addressing.prefixes.serviceBindings.create( * '2af39739cc4e3b5910c918468bb89828', - * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * { + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * cidr: '192.0.2.0/24', + * service_id: '2db684ee7ca04e159946fd05b99e1bcd', + * }, * ); * ``` */ @@ -219,13 +224,13 @@ export interface ServiceBindingCreateParams { /** * Body param: IP Prefix in Classless Inter-Domain Routing format. */ - cidr?: string; + cidr: string; /** * Body param: Identifier of a Service on the Cloudflare network. Available * services and their IDs may be found in the **List Services** endpoint. */ - service_id?: string; + service_id: string; } export interface ServiceBindingListParams { diff --git a/src/resources/custom-pages.ts b/src/resources/custom-pages.ts index 6bd1b13cf7..4c861b1e41 100644 --- a/src/resources/custom-pages.ts +++ b/src/resources/custom-pages.ts @@ -24,13 +24,15 @@ export class CustomPages extends APIResource { */ update( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params: CustomPageUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { @@ -123,36 +125,42 @@ export class CustomPages extends APIResource { */ get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params?: CustomPageGetParams, options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params: CustomPageGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { diff --git a/src/resources/d1/database.ts b/src/resources/d1/database.ts index 905848c187..9564314c83 100644 --- a/src/resources/d1/database.ts +++ b/src/resources/d1/database.ts @@ -856,40 +856,102 @@ export declare namespace DatabaseImportParams { } } -export interface DatabaseQueryParams { - /** - * Path param: Account identifier tag. - */ - account_id: string; +export type DatabaseQueryParams = DatabaseQueryParams.D1Query | DatabaseQueryParams.MultipleQueries; - /** - * Body param: Your SQL query. Supports multiple statements, joined by semicolons, - * which will be executed as a batch. - */ - sql: string; +export declare namespace DatabaseQueryParams { + export interface D1Query { + /** + * Path param: Account identifier tag. + */ + account_id: string; - /** - * Body param: - */ - params?: Array; + /** + * Body param: Your SQL query. Supports multiple statements, joined by semicolons, + * which will be executed as a batch. + */ + sql: string; + + /** + * Body param: + */ + params?: Array; + } + + export interface MultipleQueries { + /** + * Path param: Account identifier tag. + */ + account_id: string; + + /** + * Body param: + */ + body: Array; + } + + export namespace MultipleQueries { + /** + * A single query with or without parameters + */ + export interface Body { + /** + * Your SQL query. Supports multiple statements, joined by semicolons, which will + * be executed as a batch. + */ + sql: string; + + params?: Array; + } + } } -export interface DatabaseRawParams { - /** - * Path param: Account identifier tag. - */ - account_id: string; +export type DatabaseRawParams = DatabaseRawParams.D1Query | DatabaseRawParams.MultipleQueries; - /** - * Body param: Your SQL query. Supports multiple statements, joined by semicolons, - * which will be executed as a batch. - */ - sql: string; +export declare namespace DatabaseRawParams { + export interface D1Query { + /** + * Path param: Account identifier tag. + */ + account_id: string; - /** - * Body param: - */ - params?: Array; + /** + * Body param: Your SQL query. Supports multiple statements, joined by semicolons, + * which will be executed as a batch. + */ + sql: string; + + /** + * Body param: + */ + params?: Array; + } + + export interface MultipleQueries { + /** + * Path param: Account identifier tag. + */ + account_id: string; + + /** + * Body param: + */ + body: Array; + } + + export namespace MultipleQueries { + /** + * A single query with or without parameters + */ + export interface Body { + /** + * Your SQL query. Supports multiple statements, joined by semicolons, which will + * be executed as a batch. + */ + sql: string; + + params?: Array; + } + } } Database.DatabaseListResponsesV4PagePaginationArray = DatabaseListResponsesV4PagePaginationArray; diff --git a/src/resources/email-security/investigate/investigate.ts b/src/resources/email-security/investigate/investigate.ts index 7093627a0f..b7f32c860e 100644 --- a/src/resources/email-security/investigate/investigate.ts +++ b/src/resources/email-security/investigate/investigate.ts @@ -401,6 +401,11 @@ export interface InvestigateListParams extends V4PagePaginationArrayParams { */ alert_id?: string; + /** + * Query param: + */ + cursor?: string; + /** * Query param: Determines if the search results will include detections or not. */ diff --git a/src/resources/intel/attack-surface-report/issues.ts b/src/resources/intel/attack-surface-report/issues.ts index 3e41e46003..a10956bec3 100644 --- a/src/resources/intel/attack-surface-report/issues.ts +++ b/src/resources/intel/attack-surface-report/issues.ts @@ -96,14 +96,16 @@ export type IssueType = | 'email_security' | 'exposed_infrastructure' | 'insecure_configuration' - | 'weak_authentication'; + | 'weak_authentication' + | 'configuration_suggestion'; export type IssueTypeParam = | 'compliance_violation' | 'email_security' | 'exposed_infrastructure' | 'insecure_configuration' - | 'weak_authentication'; + | 'weak_authentication' + | 'configuration_suggestion'; export type SeverityQueryParam = 'low' | 'moderate' | 'critical'; @@ -138,7 +140,7 @@ export namespace IssueListResponse { issue_type?: IssuesAPI.IssueType; - payload?: unknown; + payload?: Issue.Payload; resolve_link?: string; @@ -152,6 +154,17 @@ export namespace IssueListResponse { timestamp?: string; } + + export namespace Issue { + export interface Payload { + /** + * Method used to detect insight + */ + detection_method?: string; + + zone_tag?: string; + } + } } export type IssueClassResponse = Array; diff --git a/src/resources/logpush/datasets/fields.ts b/src/resources/logpush/datasets/fields.ts index 3ba1f069f7..f0a2086930 100644 --- a/src/resources/logpush/datasets/fields.ts +++ b/src/resources/logpush/datasets/fields.ts @@ -26,6 +26,8 @@ export class Fields extends APIResource { | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' + | 'dex_application_tests' + | 'dex_device_state_events' | 'dlp_forensic_copies' | 'dns_firewall_logs' | 'dns_logs' @@ -35,6 +37,7 @@ export class Fields extends APIResource { | 'gateway_http' | 'gateway_network' | 'http_requests' + | 'ipsec_logs' | 'magic_ids_detections' | 'nel_reports' | 'network_analytics_logs' @@ -42,6 +45,8 @@ export class Fields extends APIResource { | 'sinkhole_http_logs' | 'spectrum_events' | 'ssh_logs' + | 'warp_config_changes' + | 'warp_toggle_changes' | 'workers_trace_events' | 'zaraz_events' | 'zero_trust_network_sessions' @@ -57,6 +62,8 @@ export class Fields extends APIResource { | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' + | 'dex_application_tests' + | 'dex_device_state_events' | 'dlp_forensic_copies' | 'dns_firewall_logs' | 'dns_logs' @@ -66,6 +73,7 @@ export class Fields extends APIResource { | 'gateway_http' | 'gateway_network' | 'http_requests' + | 'ipsec_logs' | 'magic_ids_detections' | 'nel_reports' | 'network_analytics_logs' @@ -73,6 +81,8 @@ export class Fields extends APIResource { | 'sinkhole_http_logs' | 'spectrum_events' | 'ssh_logs' + | 'warp_config_changes' + | 'warp_toggle_changes' | 'workers_trace_events' | 'zaraz_events' | 'zero_trust_network_sessions' @@ -87,6 +97,8 @@ export class Fields extends APIResource { | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' + | 'dex_application_tests' + | 'dex_device_state_events' | 'dlp_forensic_copies' | 'dns_firewall_logs' | 'dns_logs' @@ -96,6 +108,7 @@ export class Fields extends APIResource { | 'gateway_http' | 'gateway_network' | 'http_requests' + | 'ipsec_logs' | 'magic_ids_detections' | 'nel_reports' | 'network_analytics_logs' @@ -103,6 +116,8 @@ export class Fields extends APIResource { | 'sinkhole_http_logs' | 'spectrum_events' | 'ssh_logs' + | 'warp_config_changes' + | 'warp_toggle_changes' | 'workers_trace_events' | 'zaraz_events' | 'zero_trust_network_sessions' diff --git a/src/resources/logpush/datasets/jobs.ts b/src/resources/logpush/datasets/jobs.ts index 90c7438608..e4a3921516 100644 --- a/src/resources/logpush/datasets/jobs.ts +++ b/src/resources/logpush/datasets/jobs.ts @@ -30,6 +30,8 @@ export class Jobs extends APIResource { | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' + | 'dex_application_tests' + | 'dex_device_state_events' | 'dlp_forensic_copies' | 'dns_firewall_logs' | 'dns_logs' @@ -39,6 +41,7 @@ export class Jobs extends APIResource { | 'gateway_http' | 'gateway_network' | 'http_requests' + | 'ipsec_logs' | 'magic_ids_detections' | 'nel_reports' | 'network_analytics_logs' @@ -46,6 +49,8 @@ export class Jobs extends APIResource { | 'sinkhole_http_logs' | 'spectrum_events' | 'ssh_logs' + | 'warp_config_changes' + | 'warp_toggle_changes' | 'workers_trace_events' | 'zaraz_events' | 'zero_trust_network_sessions' @@ -61,6 +66,8 @@ export class Jobs extends APIResource { | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' + | 'dex_application_tests' + | 'dex_device_state_events' | 'dlp_forensic_copies' | 'dns_firewall_logs' | 'dns_logs' @@ -70,6 +77,7 @@ export class Jobs extends APIResource { | 'gateway_http' | 'gateway_network' | 'http_requests' + | 'ipsec_logs' | 'magic_ids_detections' | 'nel_reports' | 'network_analytics_logs' @@ -77,6 +85,8 @@ export class Jobs extends APIResource { | 'sinkhole_http_logs' | 'spectrum_events' | 'ssh_logs' + | 'warp_config_changes' + | 'warp_toggle_changes' | 'workers_trace_events' | 'zaraz_events' | 'zero_trust_network_sessions' @@ -91,6 +101,8 @@ export class Jobs extends APIResource { | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' + | 'dex_application_tests' + | 'dex_device_state_events' | 'dlp_forensic_copies' | 'dns_firewall_logs' | 'dns_logs' @@ -100,6 +112,7 @@ export class Jobs extends APIResource { | 'gateway_http' | 'gateway_network' | 'http_requests' + | 'ipsec_logs' | 'magic_ids_detections' | 'nel_reports' | 'network_analytics_logs' @@ -107,6 +120,8 @@ export class Jobs extends APIResource { | 'sinkhole_http_logs' | 'spectrum_events' | 'ssh_logs' + | 'warp_config_changes' + | 'warp_toggle_changes' | 'workers_trace_events' | 'zaraz_events' | 'zero_trust_network_sessions' diff --git a/src/resources/logpush/jobs.ts b/src/resources/logpush/jobs.ts index 4b6fba4fa1..7a267dce43 100644 --- a/src/resources/logpush/jobs.ts +++ b/src/resources/logpush/jobs.ts @@ -292,6 +292,8 @@ export interface LogpushJob { | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' + | 'dex_application_tests' + | 'dex_device_state_events' | 'dlp_forensic_copies' | 'dns_firewall_logs' | 'dns_logs' @@ -301,6 +303,7 @@ export interface LogpushJob { | 'gateway_http' | 'gateway_network' | 'http_requests' + | 'ipsec_logs' | 'magic_ids_detections' | 'nel_reports' | 'network_analytics_logs' @@ -308,6 +311,8 @@ export interface LogpushJob { | 'sinkhole_http_logs' | 'spectrum_events' | 'ssh_logs' + | 'warp_config_changes' + | 'warp_toggle_changes' | 'workers_trace_events' | 'zaraz_events' | 'zero_trust_network_sessions' @@ -601,6 +606,8 @@ export interface JobCreateParams { | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' + | 'dex_application_tests' + | 'dex_device_state_events' | 'dlp_forensic_copies' | 'dns_firewall_logs' | 'dns_logs' @@ -610,6 +617,7 @@ export interface JobCreateParams { | 'gateway_http' | 'gateway_network' | 'http_requests' + | 'ipsec_logs' | 'magic_ids_detections' | 'nel_reports' | 'network_analytics_logs' @@ -617,6 +625,8 @@ export interface JobCreateParams { | 'sinkhole_http_logs' | 'spectrum_events' | 'ssh_logs' + | 'warp_config_changes' + | 'warp_toggle_changes' | 'workers_trace_events' | 'zaraz_events' | 'zero_trust_network_sessions' diff --git a/src/resources/pages/index.ts b/src/resources/pages/index.ts index ede14daf73..94a789fe04 100644 --- a/src/resources/pages/index.ts +++ b/src/resources/pages/index.ts @@ -1,7 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - DeploymentsSinglePage, DeploymentsV4PagePaginationArray, Projects, type Deployment, diff --git a/src/resources/pages/projects/deployments/deployments.ts b/src/resources/pages/projects/deployments/deployments.ts index e1a307e7bf..f45cd3edd4 100644 --- a/src/resources/pages/projects/deployments/deployments.ts +++ b/src/resources/pages/projects/deployments/deployments.ts @@ -3,9 +3,10 @@ import { APIResource } from '../../../../resource'; import * as Core from '../../../../core'; import * as ProjectsAPI from '../projects'; -import { DeploymentsSinglePage } from '../projects'; +import { DeploymentsV4PagePaginationArray } from '../projects'; import * as HistoryAPI from './history/history'; import { History } from './history/history'; +import { type V4PagePaginationArrayParams } from '../../../../pagination'; export class Deployments extends APIResource { history: HistoryAPI.History = new HistoryAPI.History(this._client); @@ -55,11 +56,11 @@ export class Deployments extends APIResource { projectName: string, params: DeploymentListParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { const { account_id, ...query } = params; return this._client.getAPIList( `/accounts/${account_id}/pages/projects/${projectName}/deployments`, - DeploymentsSinglePage, + DeploymentsV4PagePaginationArray, { query, ...options }, ); } @@ -265,7 +266,7 @@ export interface DeploymentCreateParams { wrangler_config_hash?: string; } -export interface DeploymentListParams { +export interface DeploymentListParams extends V4PagePaginationArrayParams { /** * Path param: Identifier */ @@ -331,4 +332,4 @@ export declare namespace Deployments { export { History as History }; } -export { DeploymentsSinglePage }; +export { DeploymentsV4PagePaginationArray }; diff --git a/src/resources/pages/projects/index.ts b/src/resources/pages/projects/index.ts index 867a3f7b6b..35949ce346 100644 --- a/src/resources/pages/projects/index.ts +++ b/src/resources/pages/projects/index.ts @@ -11,7 +11,6 @@ export { type DeploymentRollbackParams, } from './deployments/index'; export { - DeploymentsSinglePage, DeploymentsV4PagePaginationArray, Projects, type Deployment, diff --git a/src/resources/pages/projects/projects.ts b/src/resources/pages/projects/projects.ts index f14c2e99bf..d889e19765 100644 --- a/src/resources/pages/projects/projects.ts +++ b/src/resources/pages/projects/projects.ts @@ -28,7 +28,7 @@ import { DeploymentRollbackParams, Deployments, } from './deployments/deployments'; -import { SinglePage, V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; export class Projects extends APIResource { deployments: DeploymentsAPI.Deployments = new DeploymentsAPI.Deployments(this._client); @@ -188,8 +188,6 @@ export class Projects extends APIResource { export class DeploymentsV4PagePaginationArray extends V4PagePaginationArray {} -export class DeploymentsSinglePage extends SinglePage {} - export interface Deployment { /** * Id of the deployment. diff --git a/src/resources/radar/as112/as112.ts b/src/resources/radar/as112/as112.ts index a617daa990..31b487f018 100644 --- a/src/resources/radar/as112/as112.ts +++ b/src/resources/radar/as112/as112.ts @@ -523,12 +523,12 @@ export interface AS112SummaryV2Params { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -617,12 +617,13 @@ export interface AS112SummaryV2Params { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -641,7 +642,8 @@ export interface AS112SummaryV2Params { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface AS112TimeseriesParams { @@ -696,12 +698,12 @@ export interface AS112TimeseriesParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -790,12 +792,13 @@ export interface AS112TimeseriesParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -814,7 +817,8 @@ export interface AS112TimeseriesParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface AS112TimeseriesGroupsV2Params { @@ -876,12 +880,12 @@ export interface AS112TimeseriesGroupsV2Params { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -970,12 +974,13 @@ export interface AS112TimeseriesGroupsV2Params { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -994,7 +999,8 @@ export interface AS112TimeseriesGroupsV2Params { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } AS112.Summary = Summary; diff --git a/src/resources/radar/as112/summary.ts b/src/resources/radar/as112/summary.ts index c83056b982..d839219855 100644 --- a/src/resources/radar/as112/summary.ts +++ b/src/resources/radar/as112/summary.ts @@ -831,12 +831,12 @@ export interface SummaryDNSSECParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -925,12 +925,13 @@ export interface SummaryDNSSECParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -949,7 +950,8 @@ export interface SummaryDNSSECParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface SummaryEdnsParams { @@ -997,12 +999,12 @@ export interface SummaryEdnsParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1091,12 +1093,13 @@ export interface SummaryEdnsParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1115,7 +1118,8 @@ export interface SummaryEdnsParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface SummaryIPVersionParams { @@ -1163,12 +1167,12 @@ export interface SummaryIPVersionParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1257,12 +1261,13 @@ export interface SummaryIPVersionParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1281,7 +1286,8 @@ export interface SummaryIPVersionParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface SummaryProtocolParams { @@ -1329,7 +1335,7 @@ export interface SummaryProtocolParams { /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1418,12 +1424,13 @@ export interface SummaryProtocolParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1442,7 +1449,8 @@ export interface SummaryProtocolParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface SummaryQueryTypeParams { @@ -1497,12 +1505,12 @@ export interface SummaryQueryTypeParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1521,7 +1529,8 @@ export interface SummaryQueryTypeParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface SummaryResponseCodesParams { @@ -1576,12 +1585,12 @@ export interface SummaryResponseCodesParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1670,7 +1679,8 @@ export interface SummaryResponseCodesParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; } export declare namespace Summary { diff --git a/src/resources/radar/as112/timeseries-groups.ts b/src/resources/radar/as112/timeseries-groups.ts index fd564e8245..c55ebcbca7 100644 --- a/src/resources/radar/as112/timeseries-groups.ts +++ b/src/resources/radar/as112/timeseries-groups.ts @@ -873,12 +873,12 @@ export interface TimeseriesGroupDNSSECParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -967,12 +967,13 @@ export interface TimeseriesGroupDNSSECParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -991,7 +992,8 @@ export interface TimeseriesGroupDNSSECParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface TimeseriesGroupEdnsParams { @@ -1046,12 +1048,12 @@ export interface TimeseriesGroupEdnsParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1140,12 +1142,13 @@ export interface TimeseriesGroupEdnsParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1164,7 +1167,8 @@ export interface TimeseriesGroupEdnsParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface TimeseriesGroupIPVersionParams { @@ -1219,12 +1223,12 @@ export interface TimeseriesGroupIPVersionParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1313,12 +1317,13 @@ export interface TimeseriesGroupIPVersionParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1337,7 +1342,8 @@ export interface TimeseriesGroupIPVersionParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface TimeseriesGroupProtocolParams { @@ -1392,7 +1398,7 @@ export interface TimeseriesGroupProtocolParams { /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1481,12 +1487,13 @@ export interface TimeseriesGroupProtocolParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1505,7 +1512,8 @@ export interface TimeseriesGroupProtocolParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface TimeseriesGroupQueryTypeParams { @@ -1567,12 +1575,12 @@ export interface TimeseriesGroupQueryTypeParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1591,7 +1599,8 @@ export interface TimeseriesGroupQueryTypeParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface TimeseriesGroupResponseCodesParams { @@ -1653,12 +1662,12 @@ export interface TimeseriesGroupResponseCodesParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1747,7 +1756,8 @@ export interface TimeseriesGroupResponseCodesParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; } export declare namespace TimeseriesGroups { diff --git a/src/resources/radar/bgp/hijacks/events.ts b/src/resources/radar/bgp/hijacks/events.ts index 10e427a591..d1f81f790b 100644 --- a/src/resources/radar/bgp/hijacks/events.ts +++ b/src/resources/radar/bgp/hijacks/events.ts @@ -155,9 +155,6 @@ export interface EventListParams extends V4PagePaginationParams { */ minConfidence?: number; - /** - * Network prefix, IPv4 or IPv6. - */ prefix?: string; /** diff --git a/src/resources/radar/bgp/routes.ts b/src/resources/radar/bgp/routes.ts index 6a67caeff7..4fd17648af 100644 --- a/src/resources/radar/bgp/routes.ts +++ b/src/resources/radar/bgp/routes.ts @@ -510,9 +510,6 @@ export interface RouteMoasParams { */ origin?: number; - /** - * Network prefix, IPv4 or IPv6. - */ prefix?: string; } @@ -533,9 +530,6 @@ export interface RoutePfx2asParams { */ origin?: number; - /** - * Network prefix, IPv4 or IPv6. - */ prefix?: string; /** @@ -550,9 +544,6 @@ export interface RouteRealtimeParams { */ format?: 'JSON' | 'CSV'; - /** - * Network prefix, IPv4 or IPv6. - */ prefix?: string; } diff --git a/src/resources/radar/dns/dns.ts b/src/resources/radar/dns/dns.ts index f5210942fb..c5aab5eee2 100644 --- a/src/resources/radar/dns/dns.ts +++ b/src/resources/radar/dns/dns.ts @@ -82,7 +82,9 @@ export class DNS extends APIResource { | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE' - | 'RESPONSE_TTL', + | 'RESPONSE_TTL' + | 'TLD' + | 'TLD_DNS_MAGNITUDE', query?: DNSSummaryV2Params, options?: Core.RequestOptions, ): Core.APIPromise; @@ -97,7 +99,9 @@ export class DNS extends APIResource { | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE' - | 'RESPONSE_TTL', + | 'RESPONSE_TTL' + | 'TLD' + | 'TLD_DNS_MAGNITUDE', options?: Core.RequestOptions, ): Core.APIPromise; summaryV2( @@ -111,7 +115,9 @@ export class DNS extends APIResource { | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE' - | 'RESPONSE_TTL', + | 'RESPONSE_TTL' + | 'TLD' + | 'TLD_DNS_MAGNITUDE', query: DNSSummaryV2Params | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { @@ -173,7 +179,8 @@ export class DNS extends APIResource { | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE' - | 'RESPONSE_TTL', + | 'RESPONSE_TTL' + | 'TLD', query?: DNSTimeseriesGroupsV2Params, options?: Core.RequestOptions, ): Core.APIPromise; @@ -188,7 +195,8 @@ export class DNS extends APIResource { | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE' - | 'RESPONSE_TTL', + | 'RESPONSE_TTL' + | 'TLD', options?: Core.RequestOptions, ): Core.APIPromise; timeseriesGroupsV2( @@ -202,7 +210,8 @@ export class DNS extends APIResource { | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE' - | 'RESPONSE_TTL', + | 'RESPONSE_TTL' + | 'TLD', query: DNSTimeseriesGroupsV2Params | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { @@ -547,6 +556,11 @@ export interface DNSSummaryV2Params { */ asn?: Array; + /** + * Filters results based on cache status. + */ + cacheHit?: 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` @@ -571,11 +585,31 @@ export interface DNSSummaryV2Params { */ dateStart?: Array; + /** + * Filters results based on DNSSEC (DNS Security Extensions) support. + */ + dnssec?: Array<'INVALID' | 'INSECURE' | 'SECURE' | 'OTHER'>; + + /** + * Filters results based on DNSSEC (DNS Security Extensions) client awareness. + */ + dnssecAware?: Array<'SUPPORTED' | 'NOT_SUPPORTED'>; + + /** + * Filters results based on DNSSEC-validated answers by end-to-end security status. + */ + dnssecE2e?: Array; + /** * Format in which results will be returned. */ format?: 'JSON' | 'CSV'; + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + /** * 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 @@ -590,6 +624,11 @@ export interface DNSSummaryV2Params { */ location?: Array; + /** + * Filters results based on whether the queries have a matching answer. + */ + matchingAnswer?: Array; + /** * Array of names used to label the series in the response. */ @@ -598,17 +637,17 @@ export interface DNSSummaryV2Params { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -697,12 +736,13 @@ export interface DNSSummaryV2Params { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -721,10 +761,18 @@ export interface DNSSummaryV2Params { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; + + /** + * Filters results by DNS response TTL. + */ + responseTtl?: Array< + 'LTE_1M' | 'GT_1M_LTE_5M' | 'GT_5M_LTE_15M' | 'GT_15M_LTE_1H' | 'GT_1H_LTE_1D' | 'GT_1D_LTE_1W' | 'GT_1W' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -745,6 +793,11 @@ export interface DNSTimeseriesParams { */ asn?: Array; + /** + * Filters results based on cache status. + */ + cacheHit?: 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` @@ -769,11 +822,31 @@ export interface DNSTimeseriesParams { */ dateStart?: Array; + /** + * Filters results based on DNSSEC (DNS Security Extensions) support. + */ + dnssec?: Array<'INVALID' | 'INSECURE' | 'SECURE' | 'OTHER'>; + + /** + * Filters results based on DNSSEC (DNS Security Extensions) client awareness. + */ + dnssecAware?: Array<'SUPPORTED' | 'NOT_SUPPORTED'>; + + /** + * Filters results based on DNSSEC-validated answers by end-to-end security status. + */ + dnssecE2e?: Array; + /** * Format in which results will be returned. */ format?: 'JSON' | 'CSV'; + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + /** * Filters results by location. Specify a comma-separated list of alpha-2 codes. * Prefix with `-` to exclude locations from results. For example, `-US,PT` @@ -781,6 +854,11 @@ export interface DNSTimeseriesParams { */ location?: Array; + /** + * Filters results based on whether the queries have a matching answer. + */ + matchingAnswer?: Array; + /** * Array of names used to label the series in the response. */ @@ -789,17 +867,17 @@ export interface DNSTimeseriesParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -888,12 +966,13 @@ export interface DNSTimeseriesParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -912,10 +991,18 @@ export interface DNSTimeseriesParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; + + /** + * Filters results by DNS response TTL. + */ + responseTtl?: Array< + 'LTE_1M' | 'GT_1M_LTE_5M' | 'GT_5M_LTE_15M' | 'GT_15M_LTE_1H' | 'GT_1H_LTE_1D' | 'GT_1D_LTE_1W' | 'GT_1W' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -936,6 +1023,11 @@ export interface DNSTimeseriesGroupsV2Params { */ asn?: Array; + /** + * Filters results based on cache status. + */ + cacheHit?: 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` @@ -960,11 +1052,31 @@ export interface DNSTimeseriesGroupsV2Params { */ dateStart?: Array; + /** + * Filters results based on DNSSEC (DNS Security Extensions) support. + */ + dnssec?: Array<'INVALID' | 'INSECURE' | 'SECURE' | 'OTHER'>; + + /** + * Filters results based on DNSSEC (DNS Security Extensions) client awareness. + */ + dnssecAware?: Array<'SUPPORTED' | 'NOT_SUPPORTED'>; + + /** + * Filters results based on DNSSEC-validated answers by end-to-end security status. + */ + dnssecE2e?: Array; + /** * Format in which results will be returned. */ format?: 'JSON' | 'CSV'; + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + /** * 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 @@ -979,6 +1091,11 @@ export interface DNSTimeseriesGroupsV2Params { */ location?: Array; + /** + * Filters results based on whether the queries have a matching answer. + */ + matchingAnswer?: Array; + /** * Array of names used to label the series in the response. */ @@ -987,17 +1104,23 @@ export interface DNSTimeseriesGroupsV2Params { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1086,12 +1209,13 @@ export interface DNSTimeseriesGroupsV2Params { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1110,10 +1234,18 @@ export interface DNSTimeseriesGroupsV2Params { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; + + /** + * Filters results by DNS response TTL. + */ + responseTtl?: Array< + 'LTE_1M' | 'GT_1M_LTE_5M' | 'GT_5M_LTE_15M' | 'GT_15M_LTE_1H' | 'GT_1H_LTE_1D' | 'GT_1D_LTE_1W' | 'GT_1W' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } diff --git a/src/resources/radar/dns/summary.ts b/src/resources/radar/dns/summary.ts index bea2bcf785..e0bfffe069 100644 --- a/src/resources/radar/dns/summary.ts +++ b/src/resources/radar/dns/summary.ts @@ -1410,17 +1410,17 @@ export interface SummaryCacheHitParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1509,12 +1509,13 @@ export interface SummaryCacheHitParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1533,10 +1534,11 @@ export interface SummaryCacheHitParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -1594,17 +1596,17 @@ export interface SummaryDNSSECParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1693,12 +1695,13 @@ export interface SummaryDNSSECParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1717,10 +1720,11 @@ export interface SummaryDNSSECParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -1778,17 +1782,17 @@ export interface SummaryDNSSECAwareParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1877,12 +1881,13 @@ export interface SummaryDNSSECAwareParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1901,10 +1906,11 @@ export interface SummaryDNSSECAwareParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -1962,17 +1968,17 @@ export interface SummaryDNSSECE2EParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2061,12 +2067,13 @@ export interface SummaryDNSSECE2EParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2085,10 +2092,11 @@ export interface SummaryDNSSECE2EParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2146,17 +2154,17 @@ export interface SummaryIPVersionParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2245,12 +2253,13 @@ export interface SummaryIPVersionParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2269,10 +2278,11 @@ export interface SummaryIPVersionParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2330,17 +2340,17 @@ export interface SummaryMatchingAnswerParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2429,12 +2439,13 @@ export interface SummaryMatchingAnswerParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2453,10 +2464,11 @@ export interface SummaryMatchingAnswerParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2514,12 +2526,12 @@ export interface SummaryProtocolParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2608,12 +2620,13 @@ export interface SummaryProtocolParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2632,10 +2645,11 @@ export interface SummaryProtocolParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2700,17 +2714,17 @@ export interface SummaryQueryTypeParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2729,10 +2743,11 @@ export interface SummaryQueryTypeParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2797,17 +2812,17 @@ export interface SummaryResponseCodeParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2896,10 +2911,11 @@ export interface SummaryResponseCodeParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2957,17 +2973,17 @@ export interface SummaryResponseTTLParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -3056,12 +3072,13 @@ export interface SummaryResponseTTLParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -3080,10 +3097,11 @@ export interface SummaryResponseTTLParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } diff --git a/src/resources/radar/dns/timeseries-groups.ts b/src/resources/radar/dns/timeseries-groups.ts index b2120478af..e6e96ec514 100644 --- a/src/resources/radar/dns/timeseries-groups.ts +++ b/src/resources/radar/dns/timeseries-groups.ts @@ -1431,17 +1431,17 @@ export interface TimeseriesGroupCacheHitParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1530,12 +1530,13 @@ export interface TimeseriesGroupCacheHitParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1554,10 +1555,11 @@ export interface TimeseriesGroupCacheHitParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -1622,17 +1624,17 @@ export interface TimeseriesGroupDNSSECParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1721,12 +1723,13 @@ export interface TimeseriesGroupDNSSECParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1745,10 +1748,11 @@ export interface TimeseriesGroupDNSSECParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -1813,17 +1817,17 @@ export interface TimeseriesGroupDNSSECAwareParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1912,12 +1916,13 @@ export interface TimeseriesGroupDNSSECAwareParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1936,10 +1941,11 @@ export interface TimeseriesGroupDNSSECAwareParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2004,17 +2010,17 @@ export interface TimeseriesGroupDNSSECE2EParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2103,12 +2109,13 @@ export interface TimeseriesGroupDNSSECE2EParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2127,10 +2134,11 @@ export interface TimeseriesGroupDNSSECE2EParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2195,17 +2203,17 @@ export interface TimeseriesGroupIPVersionParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2294,12 +2302,13 @@ export interface TimeseriesGroupIPVersionParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2318,10 +2327,11 @@ export interface TimeseriesGroupIPVersionParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2386,17 +2396,17 @@ export interface TimeseriesGroupMatchingAnswerParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2485,12 +2495,13 @@ export interface TimeseriesGroupMatchingAnswerParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2509,10 +2520,11 @@ export interface TimeseriesGroupMatchingAnswerParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2577,12 +2589,12 @@ export interface TimeseriesGroupProtocolParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2671,12 +2683,13 @@ export interface TimeseriesGroupProtocolParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2695,10 +2708,11 @@ export interface TimeseriesGroupProtocolParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2770,17 +2784,17 @@ export interface TimeseriesGroupQueryTypeParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2799,10 +2813,11 @@ export interface TimeseriesGroupQueryTypeParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2874,17 +2889,17 @@ export interface TimeseriesGroupResponseCodeParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2973,10 +2988,11 @@ export interface TimeseriesGroupResponseCodeParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -3041,17 +3057,17 @@ export interface TimeseriesGroupResponseTTLParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -3140,12 +3156,13 @@ export interface TimeseriesGroupResponseTTLParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -3164,10 +3181,11 @@ export interface TimeseriesGroupResponseTTLParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } diff --git a/src/resources/radar/dns/top.ts b/src/resources/radar/dns/top.ts index fe0bd763d1..e3e8493770 100644 --- a/src/resources/radar/dns/top.ts +++ b/src/resources/radar/dns/top.ts @@ -280,6 +280,11 @@ export interface TopAsesParams { */ asn?: Array; + /** + * Filters results based on cache status. + */ + cacheHit?: 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` @@ -304,6 +309,21 @@ export interface TopAsesParams { */ dateStart?: Array; + /** + * Filters results based on DNSSEC (DNS Security Extensions) support. + */ + dnssec?: Array<'INVALID' | 'INSECURE' | 'SECURE' | 'OTHER'>; + + /** + * Filters results based on DNSSEC (DNS Security Extensions) client awareness. + */ + dnssecAware?: Array<'SUPPORTED' | 'NOT_SUPPORTED'>; + + /** + * Filters results based on DNSSEC-validated answers by end-to-end security status. + */ + dnssecE2e?: Array; + /** * Filters results by domain name. */ @@ -314,6 +334,11 @@ export interface TopAsesParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + /** * Limits the number of objects returned in the response. */ @@ -326,10 +351,152 @@ export interface TopAsesParams { */ location?: Array; + /** + * Filters results based on whether the queries have a matching answer. + */ + matchingAnswer?: Array; + /** * Array of names used to label the series in the response. */ name?: Array; + + /** + * Specifies whether the response includes empty DNS responses (NODATA). + */ + nodata?: Array; + + /** + * Filters results by DNS transport protocol. + */ + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; + + /** + * Filters results by DNS query type. + */ + queryType?: Array< + | 'A' + | 'AAAA' + | 'A6' + | 'AFSDB' + | 'ANY' + | 'APL' + | 'ATMA' + | 'AXFR' + | 'CAA' + | 'CDNSKEY' + | 'CDS' + | 'CERT' + | 'CNAME' + | 'CSYNC' + | 'DHCID' + | 'DLV' + | 'DNAME' + | 'DNSKEY' + | 'DOA' + | 'DS' + | 'EID' + | 'EUI48' + | 'EUI64' + | 'GPOS' + | 'GID' + | 'HINFO' + | 'HIP' + | 'HTTPS' + | 'IPSECKEY' + | 'ISDN' + | 'IXFR' + | 'KEY' + | 'KX' + | 'L32' + | 'L64' + | 'LOC' + | 'LP' + | 'MAILA' + | 'MAILB' + | 'MB' + | 'MD' + | 'MF' + | 'MG' + | 'MINFO' + | 'MR' + | 'MX' + | 'NAPTR' + | 'NB' + | 'NBSTAT' + | 'NID' + | 'NIMLOC' + | 'NINFO' + | 'NS' + | 'NSAP' + | 'NSEC' + | 'NSEC3' + | 'NSEC3PARAM' + | 'NULL' + | 'NXT' + | 'OPENPGPKEY' + | 'OPT' + | 'PTR' + | 'PX' + | 'RKEY' + | 'RP' + | 'RRSIG' + | 'RT' + | 'SIG' + | 'SINK' + | 'SMIMEA' + | 'SOA' + | 'SPF' + | 'SRV' + | 'SSHFP' + | 'SVCB' + | 'TA' + | 'TALINK' + | 'TKEY' + | 'TLSA' + | 'TSIG' + | 'TXT' + | 'UINFO' + | 'UID' + | 'UNSPEC' + | 'URI' + | 'WKS' + | 'X25' + | 'ZONEMD' + | null + >; + + /** + * Filters results by DNS response code. + */ + responseCode?: Array< + | 'NOERROR' + | 'FORMERR' + | 'SERVFAIL' + | 'NXDOMAIN' + | 'NOTIMP' + | 'REFUSED' + | 'YXDOMAIN' + | 'YXRRSET' + | 'NXRRSET' + | 'NOTAUTH' + | 'NOTZONE' + | 'BADSIG' + | 'BADKEY' + | 'BADTIME' + | 'BADMODE' + | 'BADNAME' + | 'BADALG' + | 'BADTRUNC' + | 'BADCOOKIE' + >; + + /** + * Filters results by DNS response TTL. + */ + responseTtl?: Array< + 'LTE_1M' | 'GT_1M_LTE_5M' | 'GT_5M_LTE_15M' | 'GT_15M_LTE_1H' | 'GT_1H_LTE_1D' | 'GT_1D_LTE_1W' | 'GT_1W' + >; } export interface TopLocationsParams { @@ -341,6 +508,11 @@ export interface TopLocationsParams { */ asn?: Array; + /** + * Filters results based on cache status. + */ + cacheHit?: 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` @@ -365,6 +537,21 @@ export interface TopLocationsParams { */ dateStart?: Array; + /** + * Filters results based on DNSSEC (DNS Security Extensions) support. + */ + dnssec?: Array<'INVALID' | 'INSECURE' | 'SECURE' | 'OTHER'>; + + /** + * Filters results based on DNSSEC (DNS Security Extensions) client awareness. + */ + dnssecAware?: Array<'SUPPORTED' | 'NOT_SUPPORTED'>; + + /** + * Filters results based on DNSSEC-validated answers by end-to-end security status. + */ + dnssecE2e?: Array; + /** * Filters results by domain name. */ @@ -375,6 +562,11 @@ export interface TopLocationsParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + /** * Limits the number of objects returned in the response. */ @@ -387,10 +579,157 @@ export interface TopLocationsParams { */ location?: Array; + /** + * Filters results based on whether the queries have a matching answer. + */ + matchingAnswer?: Array; + /** * Array of names used to label the series in the response. */ name?: Array; + + /** + * Specifies whether the response includes empty DNS responses (NODATA). + */ + nodata?: Array; + + /** + * Filters results by DNS transport protocol. + */ + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; + + /** + * Filters results by DNS query type. + */ + queryType?: Array< + | 'A' + | 'AAAA' + | 'A6' + | 'AFSDB' + | 'ANY' + | 'APL' + | 'ATMA' + | 'AXFR' + | 'CAA' + | 'CDNSKEY' + | 'CDS' + | 'CERT' + | 'CNAME' + | 'CSYNC' + | 'DHCID' + | 'DLV' + | 'DNAME' + | 'DNSKEY' + | 'DOA' + | 'DS' + | 'EID' + | 'EUI48' + | 'EUI64' + | 'GPOS' + | 'GID' + | 'HINFO' + | 'HIP' + | 'HTTPS' + | 'IPSECKEY' + | 'ISDN' + | 'IXFR' + | 'KEY' + | 'KX' + | 'L32' + | 'L64' + | 'LOC' + | 'LP' + | 'MAILA' + | 'MAILB' + | 'MB' + | 'MD' + | 'MF' + | 'MG' + | 'MINFO' + | 'MR' + | 'MX' + | 'NAPTR' + | 'NB' + | 'NBSTAT' + | 'NID' + | 'NIMLOC' + | 'NINFO' + | 'NS' + | 'NSAP' + | 'NSEC' + | 'NSEC3' + | 'NSEC3PARAM' + | 'NULL' + | 'NXT' + | 'OPENPGPKEY' + | 'OPT' + | 'PTR' + | 'PX' + | 'RKEY' + | 'RP' + | 'RRSIG' + | 'RT' + | 'SIG' + | 'SINK' + | 'SMIMEA' + | 'SOA' + | 'SPF' + | 'SRV' + | 'SSHFP' + | 'SVCB' + | 'TA' + | 'TALINK' + | 'TKEY' + | 'TLSA' + | 'TSIG' + | 'TXT' + | 'UINFO' + | 'UID' + | 'UNSPEC' + | 'URI' + | 'WKS' + | 'X25' + | 'ZONEMD' + | null + >; + + /** + * Filters results by DNS response code. + */ + responseCode?: Array< + | 'NOERROR' + | 'FORMERR' + | 'SERVFAIL' + | 'NXDOMAIN' + | 'NOTIMP' + | 'REFUSED' + | 'YXDOMAIN' + | 'YXRRSET' + | 'NXRRSET' + | 'NOTAUTH' + | 'NOTZONE' + | 'BADSIG' + | 'BADKEY' + | 'BADTIME' + | 'BADMODE' + | 'BADNAME' + | 'BADALG' + | 'BADTRUNC' + | 'BADCOOKIE' + >; + + /** + * Filters results by DNS response TTL. + */ + responseTtl?: Array< + 'LTE_1M' | 'GT_1M_LTE_5M' | 'GT_5M_LTE_15M' | 'GT_15M_LTE_1H' | 'GT_1H_LTE_1D' | 'GT_1D_LTE_1W' | 'GT_1W' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; } export declare namespace Top { diff --git a/src/resources/security-center/insights/insights.ts b/src/resources/security-center/insights/insights.ts index 1006bfe3bd..42ba05277e 100644 --- a/src/resources/security-center/insights/insights.ts +++ b/src/resources/security-center/insights/insights.ts @@ -122,7 +122,7 @@ export namespace InsightListResponse { issue_type?: IssuesAPI.IssueType; - payload?: unknown; + payload?: Issue.Payload; resolve_link?: string; @@ -136,6 +136,17 @@ export namespace InsightListResponse { timestamp?: string; } + + export namespace Issue { + export interface Payload { + /** + * Method used to detect insight + */ + detection_method?: string; + + zone_tag?: string; + } + } } export interface InsightDismissResponse { diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 9f1502f6d4..0ccf097746 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -998,3 +998,5 @@ export class SubscriptionsSinglePage extends SinglePage {} export class TokensV4PagePaginationArray extends V4PagePaginationArray {} export class AuditLogsV4PagePaginationArray extends V4PagePaginationArray {} + +export class CloudflareTunnelsV4PagePaginationArray extends V4PagePaginationArray {} 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 554313f4d3..8536843291 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -175,7 +175,7 @@ export interface ScriptUpdateResponse { startup_time_ms: number; /** - * The id of the script in the Workers system. Usually the script name. + * The name used to identify the script. */ id?: string; @@ -197,6 +197,11 @@ export interface ScriptUpdateResponse { */ created_on?: string; + /** + * The entry point for the script. + */ + entry_point?: string; + /** * Hashed script content, can be used in a If-None-Match header when updating. */ @@ -244,6 +249,11 @@ export interface ScriptUpdateResponse { */ named_handlers?: Array; + /** + * Observability settings for the Worker. + */ + observability?: ScriptUpdateResponse.Observability; + /** * Configuration for * [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). @@ -260,10 +270,20 @@ export interface ScriptUpdateResponse { */ placement_status?: 'SUCCESS' | 'UNSUPPORTED_APPLICATION' | 'INSUFFICIENT_INVOCATIONS'; + /** + * The immutable ID of the script. + */ + tag?: string; + + /** + * Tags associated with the Worker. + */ + tags?: Array | null; + /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array | null; /** * Usage model for the Worker invocations. @@ -284,6 +304,61 @@ export namespace ScriptUpdateResponse { name?: string; } + /** + * Observability settings for the Worker. + */ + export interface Observability { + /** + * Whether observability is enabled for the Worker. + */ + enabled: boolean; + + /** + * The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). + * Default is 1. + */ + head_sampling_rate?: number | null; + + /** + * Log settings for the Worker. + */ + logs?: Observability.Logs | null; + } + + export namespace Observability { + /** + * Log settings for the Worker. + */ + export interface Logs { + /** + * Whether logs are enabled for the Worker. + */ + enabled: boolean; + + /** + * Whether + * [invocation logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/#invocation-logs) + * are enabled for the Worker. + */ + invocation_logs: boolean; + + /** + * A list of destinations where logs will be exported to. + */ + destinations?: Array; + + /** + * The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1. + */ + head_sampling_rate?: number | null; + + /** + * Whether log persistence is enabled for the Worker. + */ + persist?: boolean; + } + } + /** * Configuration for * [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). @@ -451,7 +526,7 @@ export namespace ScriptUpdateParams { /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array | null; /** * Usage model for the Worker invocations. 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 fb897aea3f..436d10f14e 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -137,12 +137,12 @@ export interface SettingEditResponse { /** * Tags associated with the Worker. */ - tags?: Array; + tags?: Array | null; /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array | null; /** * Usage model for the Worker invocations. @@ -871,12 +871,12 @@ export interface SettingGetResponse { /** * Tags associated with the Worker. */ - tags?: Array; + tags?: Array | null; /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array | null; /** * Usage model for the Worker invocations. @@ -1623,12 +1623,12 @@ export namespace SettingEditParams { /** * Tags associated with the Worker. */ - tags?: Array; + tags?: Array | null; /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array | null; /** * Usage model for the Worker invocations. diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/tags.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/tags.ts index 73ea9f79b9..b1a6bd94be 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/tags.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/tags.ts @@ -116,7 +116,7 @@ export interface TagUpdateParams { /** * Body param: Tags associated with the Worker. */ - body: Array; + body: Array | null; } export interface TagListParams { diff --git a/src/resources/workers/index.ts b/src/resources/workers/index.ts index 08d046d2c3..bfb8c0f779 100644 --- a/src/resources/workers/index.ts +++ b/src/resources/workers/index.ts @@ -34,11 +34,12 @@ export { type RouteGetParams, } from './routes'; export { - ScriptsSinglePage, + ScriptListResponsesSinglePage, Scripts, type Script, type ScriptSetting, type ScriptUpdateResponse, + type ScriptListResponse, type ScriptDeleteResponse, type ScriptGetResponse, type ScriptSearchResponse, diff --git a/src/resources/workers/scripts/index.ts b/src/resources/workers/scripts/index.ts index 4bbd0bb198..6fe0155b7b 100644 --- a/src/resources/workers/scripts/index.ts +++ b/src/resources/workers/scripts/index.ts @@ -27,11 +27,12 @@ export { type ScriptAndVersionSettingGetParams, } from './script-and-version-settings'; export { - ScriptsSinglePage, + ScriptListResponsesSinglePage, Scripts, type Script, type ScriptSetting, type ScriptUpdateResponse, + type ScriptListResponse, type ScriptDeleteResponse, type ScriptGetResponse, type ScriptSearchResponse, diff --git a/src/resources/workers/scripts/script-and-version-settings.ts b/src/resources/workers/scripts/script-and-version-settings.ts index 54237b4091..ea56961922 100644 --- a/src/resources/workers/scripts/script-and-version-settings.ts +++ b/src/resources/workers/scripts/script-and-version-settings.ts @@ -133,12 +133,12 @@ export interface ScriptAndVersionSettingEditResponse { /** * Tags associated with the Worker. */ - tags?: Array; + tags?: Array | null; /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array | null; /** * Usage model for the Worker invocations. @@ -867,12 +867,12 @@ export interface ScriptAndVersionSettingGetResponse { /** * Tags associated with the Worker. */ - tags?: Array; + tags?: Array | null; /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array | null; /** * Usage model for the Worker invocations. @@ -1619,12 +1619,12 @@ export namespace ScriptAndVersionSettingEditParams { /** * Tags associated with the Worker. */ - tags?: Array; + tags?: Array | null; /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array | null; /** * Usage model for the Worker invocations. diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index a52d8a4ad2..e3f4f45945 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -137,16 +137,19 @@ export class Scripts extends APIResource { * @example * ```ts * // Automatically fetches more pages as needed. - * for await (const script of client.workers.scripts.list({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * })) { + * for await (const scriptListResponse of client.workers.scripts.list( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { * // ... * } * ``` */ - list(params: ScriptListParams, options?: Core.RequestOptions): Core.PagePromise { + list( + params: ScriptListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { const { account_id, ...query } = params; - return this._client.getAPIList(`/accounts/${account_id}/workers/scripts`, ScriptsSinglePage, { + return this._client.getAPIList(`/accounts/${account_id}/workers/scripts`, ScriptListResponsesSinglePage, { query, ...options, }); @@ -218,11 +221,11 @@ export class Scripts extends APIResource { } } -export class ScriptsSinglePage extends SinglePage