diff --git a/.stats.yml b/.stats.yml index 344c370f93..f7f2efb3b8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2280 +configured_endpoints: 2295 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml -openapi_spec_hash: 26772c26b37d468fb9752aa22ea815b9 -config_hash: 873a029df6d61c21b0ec8b6da9e67ce4 +openapi_spec_hash: f88a1f57da1f979400b58e284e8a8191 +config_hash: 7e407a4f70c2a3fa69bc9fd8e097f790 diff --git a/api.md b/api.md index 834fb30949..bf9a19e1ae 100644 --- a/api.md +++ b/api.md @@ -57,6 +57,8 @@ Types: # [CustomCertificates](src/resources/custom-certificates/api.md) +# [CustomCsrs](src/resources/custom-csrs/api.md) + # [CustomHostnames](src/resources/custom-hostnames/api.md) # [CustomNameservers](src/resources/custom-nameservers/api.md) @@ -229,6 +231,8 @@ Types: # [AI](src/resources/ai/api.md) +# [AIAudit](src/resources/ai-audit/api.md) + # [AISearch](src/resources/aisearch/api.md) # [SecurityCenter](src/resources/security-center/api.md) diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index c23faf6f2f..f4513bf47f 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -82,6 +82,7 @@ TEST_PATHS=( tests/api-resources/client-certificates.test.ts tests/api-resources/custom-certificates/custom-certificates.test.ts tests/api-resources/custom-certificates/prioritize.test.ts + tests/api-resources/custom-csrs.test.ts tests/api-resources/custom-hostnames/custom-hostnames.test.ts tests/api-resources/custom-hostnames/fallback-origin.test.ts tests/api-resources/custom-hostnames/certificate-pack/certificate-pack.test.ts @@ -126,7 +127,9 @@ TEST_PATHS=( tests/api-resources/email-security/settings/block-senders.test.ts tests/api-resources/email-security/settings/domains.test.ts tests/api-resources/email-security/settings/impersonation-registry.test.ts + tests/api-resources/email-security/settings/sending-domain-restrictions.test.ts tests/api-resources/email-security/settings/trusted-domains.test.ts + tests/api-resources/email-security/settings/url-ignore-patterns.test.ts tests/api-resources/email-security/submissions.test.ts tests/api-resources/email-routing/email-routing.test.ts tests/api-resources/email-routing/dns.test.ts @@ -211,6 +214,7 @@ TEST_PATHS=( tests/api-resources/workers/observability/telemetry.test.ts tests/api-resources/workers/observability/destinations.test.ts tests/api-resources/workers/observability/queries.test.ts + tests/api-resources/workers/observability/shared-queries.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 diff --git a/src/index.ts b/src/index.ts index 6fb863d77c..5645c6fa9d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -24,6 +24,7 @@ import { AbuseReports } from './resources/abuse-reports/abuse-reports'; import { Accounts } from './resources/accounts/accounts'; import { ACM } from './resources/acm/acm'; import { Addressing } from './resources/addressing/addressing'; +import { AIAudit } from './resources/ai-audit/ai-audit'; import { AIGateway } from './resources/ai-gateway/ai-gateway'; import { AISecurity } from './resources/ai-security/ai-security'; import { AI } from './resources/ai/ai'; @@ -46,6 +47,7 @@ import { CloudforceOne } from './resources/cloudforce-one/cloudforce-one'; import { Connectivity } from './resources/connectivity/connectivity'; import { ContentScanning } from './resources/content-scanning/content-scanning'; import { CustomCertificates } from './resources/custom-certificates/custom-certificates'; +import { CustomCsrs } from './resources/custom-csrs/custom-csrs'; import { CustomHostnames } from './resources/custom-hostnames/custom-hostnames'; import { CustomNameservers } from './resources/custom-nameservers/custom-nameservers'; import { CustomPages } from './resources/custom-pages/custom-pages'; @@ -294,6 +296,7 @@ export class Cloudflare extends Core.APIClient { certificateAuthorities: API.CertificateAuthorities = new API.CertificateAuthorities(this); clientCertificates: API.ClientCertificates = new API.ClientCertificates(this); customCertificates: API.CustomCertificates = new API.CustomCertificates(this); + customCsrs: API.CustomCsrs = new API.CustomCsrs(this); customHostnames: API.CustomHostnames = new API.CustomHostnames(this); customNameservers: API.CustomNameservers = new API.CustomNameservers(this); dnsFirewall: API.DNSFirewall = new API.DNSFirewall(this); @@ -380,6 +383,7 @@ export class Cloudflare extends Core.APIClient { aiSecurity: API.AISecurity = new API.AISecurity(this); abuseReports: API.AbuseReports = new API.AbuseReports(this); ai: API.AI = new API.AI(this); + aiAudit: API.AIAudit = new API.AIAudit(this); aiSearch: API.AISearch = new API.AISearch(this); securityCenter: API.SecurityCenter = new API.SecurityCenter(this); browserRendering: API.BrowserRendering = new API.BrowserRendering(this); @@ -545,6 +549,7 @@ Cloudflare.Argo = Argo; Cloudflare.CertificateAuthorities = CertificateAuthorities; Cloudflare.ClientCertificates = ClientCertificates; Cloudflare.CustomCertificates = CustomCertificates; +Cloudflare.CustomCsrs = CustomCsrs; Cloudflare.CustomHostnames = CustomHostnames; Cloudflare.CustomNameservers = CustomNameservers; Cloudflare.DNSFirewall = DNSFirewall; @@ -631,6 +636,7 @@ Cloudflare.ContentScanning = ContentScanning; Cloudflare.AISecurity = AISecurity; Cloudflare.AbuseReports = AbuseReports; Cloudflare.AI = AI; +Cloudflare.AIAudit = AIAudit; Cloudflare.AISearch = AISearch; Cloudflare.SecurityCenter = SecurityCenter; Cloudflare.BrowserRendering = BrowserRendering; @@ -706,6 +712,8 @@ export declare namespace Cloudflare { export { CustomCertificates as CustomCertificates }; + export { CustomCsrs as CustomCsrs }; + export { CustomHostnames as CustomHostnames }; export { CustomNameservers as CustomNameservers }; @@ -878,6 +886,8 @@ export declare namespace Cloudflare { export { AI as AI }; + export { AIAudit as AIAudit }; + export { AISearch as AISearch }; export { SecurityCenter as SecurityCenter }; diff --git a/src/resources/acm/custom-trust-store.ts b/src/resources/acm/custom-trust-store.ts index 1e25285e0b..ffcf7f56e9 100644 --- a/src/resources/acm/custom-trust-store.ts +++ b/src/resources/acm/custom-trust-store.ts @@ -188,7 +188,7 @@ export interface CustomTrustStoreListParams extends V4PagePaginationArrayParams limit?: number; /** - * Query param: Offset the results + * Query param: Offset the results. */ offset?: number; } diff --git a/src/resources/addressing/addressing.ts b/src/resources/addressing/addressing.ts index 06599a8421..e82b9b32ec 100644 --- a/src/resources/addressing/addressing.ts +++ b/src/resources/addressing/addressing.ts @@ -38,20 +38,7 @@ import { PrefixesSinglePage, } from './prefixes/prefixes'; import * as RegionalHostnamesAPI from './regional-hostnames/regional-hostnames'; -import { - RegionalHostnameCreateParams, - RegionalHostnameCreateResponse, - RegionalHostnameDeleteParams, - RegionalHostnameDeleteResponse, - RegionalHostnameEditParams, - RegionalHostnameEditResponse, - RegionalHostnameGetParams, - RegionalHostnameGetResponse, - RegionalHostnameListParams, - RegionalHostnameListResponse, - RegionalHostnameListResponsesSinglePage, - RegionalHostnames, -} from './regional-hostnames/regional-hostnames'; +import { RegionalHostnames } from './regional-hostnames/regional-hostnames'; export class Addressing extends APIResource { regionalHostnames: RegionalHostnamesAPI.RegionalHostnames = new RegionalHostnamesAPI.RegionalHostnames( @@ -64,7 +51,6 @@ export class Addressing extends APIResource { } Addressing.RegionalHostnames = RegionalHostnames; -Addressing.RegionalHostnameListResponsesSinglePage = RegionalHostnameListResponsesSinglePage; Addressing.Services = Services; Addressing.ServiceListResponsesSinglePage = ServiceListResponsesSinglePage; Addressing.AddressMaps = AddressMaps; @@ -74,20 +60,7 @@ Addressing.Prefixes = Prefixes; Addressing.PrefixesSinglePage = PrefixesSinglePage; export declare namespace Addressing { - export { - RegionalHostnames as RegionalHostnames, - type RegionalHostnameCreateResponse as RegionalHostnameCreateResponse, - type RegionalHostnameListResponse as RegionalHostnameListResponse, - type RegionalHostnameDeleteResponse as RegionalHostnameDeleteResponse, - type RegionalHostnameEditResponse as RegionalHostnameEditResponse, - type RegionalHostnameGetResponse as RegionalHostnameGetResponse, - RegionalHostnameListResponsesSinglePage as RegionalHostnameListResponsesSinglePage, - type RegionalHostnameCreateParams as RegionalHostnameCreateParams, - type RegionalHostnameListParams as RegionalHostnameListParams, - type RegionalHostnameDeleteParams as RegionalHostnameDeleteParams, - type RegionalHostnameEditParams as RegionalHostnameEditParams, - type RegionalHostnameGetParams as RegionalHostnameGetParams, - }; + export { RegionalHostnames as RegionalHostnames }; export { Services as Services, diff --git a/src/resources/addressing/api.md b/src/resources/addressing/api.md index 8d08b3052a..eb7d668dfa 100644 --- a/src/resources/addressing/api.md +++ b/src/resources/addressing/api.md @@ -2,32 +2,8 @@ ## RegionalHostnames -Types: - -- RegionalHostnameCreateResponse -- RegionalHostnameListResponse -- RegionalHostnameDeleteResponse -- RegionalHostnameEditResponse -- RegionalHostnameGetResponse - -Methods: - -- client.addressing.regionalHostnames.create({ ...params }) -> RegionalHostnameCreateResponse -- client.addressing.regionalHostnames.list({ ...params }) -> RegionalHostnameListResponsesSinglePage -- client.addressing.regionalHostnames.delete(hostname, { ...params }) -> RegionalHostnameDeleteResponse -- client.addressing.regionalHostnames.edit(hostname, { ...params }) -> RegionalHostnameEditResponse -- client.addressing.regionalHostnames.get(hostname, { ...params }) -> RegionalHostnameGetResponse - ### Regions -Types: - -- RegionListResponse - -Methods: - -- client.addressing.regionalHostnames.regions.list({ ...params }) -> RegionListResponsesSinglePage - ## Services Types: diff --git a/src/resources/addressing/index.ts b/src/resources/addressing/index.ts index 6b64a96cdf..81716dd30e 100644 --- a/src/resources/addressing/index.ts +++ b/src/resources/addressing/index.ts @@ -32,20 +32,7 @@ export { type PrefixEditParams, type PrefixGetParams, } from './prefixes/index'; -export { - RegionalHostnameListResponsesSinglePage, - RegionalHostnames, - type RegionalHostnameCreateResponse, - type RegionalHostnameListResponse, - type RegionalHostnameDeleteResponse, - type RegionalHostnameEditResponse, - type RegionalHostnameGetResponse, - type RegionalHostnameCreateParams, - type RegionalHostnameListParams, - type RegionalHostnameDeleteParams, - type RegionalHostnameEditParams, - type RegionalHostnameGetParams, -} from './regional-hostnames/index'; +export { RegionalHostnames } from './regional-hostnames/index'; export { ServiceListResponsesSinglePage, Services, diff --git a/src/resources/addressing/regional-hostnames/index.ts b/src/resources/addressing/regional-hostnames/index.ts index 527ec41ccf..5dc0b83fec 100644 --- a/src/resources/addressing/regional-hostnames/index.ts +++ b/src/resources/addressing/regional-hostnames/index.ts @@ -1,22 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { - RegionListResponsesSinglePage, - Regions, - type RegionListResponse, - type RegionListParams, -} from './regions'; -export { - RegionalHostnameListResponsesSinglePage, - RegionalHostnames, - type RegionalHostnameCreateResponse, - type RegionalHostnameListResponse, - type RegionalHostnameDeleteResponse, - type RegionalHostnameEditResponse, - type RegionalHostnameGetResponse, - type RegionalHostnameCreateParams, - type RegionalHostnameListParams, - type RegionalHostnameDeleteParams, - type RegionalHostnameEditParams, - type RegionalHostnameGetParams, -} from './regional-hostnames'; +export { RegionalHostnames } from './regional-hostnames'; +export { Regions } from './regions'; diff --git a/src/resources/addressing/regional-hostnames/regional-hostnames.ts b/src/resources/addressing/regional-hostnames/regional-hostnames.ts index 53c5c9a505..ed99a75232 100644 --- a/src/resources/addressing/regional-hostnames/regional-hostnames.ts +++ b/src/resources/addressing/regional-hostnames/regional-hostnames.ts @@ -1,364 +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 RegionsAPI from './regions'; -import { RegionListParams, RegionListResponse, RegionListResponsesSinglePage, Regions } from './regions'; -import { SinglePage } from '../../../pagination'; +import { Regions } from './regions'; export class RegionalHostnames extends APIResource { regions: RegionsAPI.Regions = new RegionsAPI.Regions(this._client); - - /** - * Create a new Regional Hostname entry. Cloudflare will only use data centers that - * are physically located within the chosen region to decrypt and service HTTPS - * traffic. Learn more about - * [Regional Services](https://developers.cloudflare.com/data-localization/regional-services/get-started/). - * - * @example - * ```ts - * const regionalHostname = - * await client.addressing.regionalHostnames.create({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * hostname: 'foo.example.com', - * region_key: 'ca', - * }); - * ``` - */ - create( - params: RegionalHostnameCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.post(`/zones/${zone_id}/addressing/regional_hostnames`, { - body, - ...options, - }) as Core.APIPromise<{ result: RegionalHostnameCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * List all Regional Hostnames within a zone. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const regionalHostnameListResponse of client.addressing.regionalHostnames.list( - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` - */ - list( - params: RegionalHostnameListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { zone_id } = params; - return this._client.getAPIList( - `/zones/${zone_id}/addressing/regional_hostnames`, - RegionalHostnameListResponsesSinglePage, - options, - ); - } - - /** - * Delete the region configuration for a specific Regional Hostname. - * - * @example - * ```ts - * const regionalHostname = - * await client.addressing.regionalHostnames.delete( - * 'foo.example.com', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - delete( - hostname: string, - params: RegionalHostnameDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id } = params; - return this._client.delete(`/zones/${zone_id}/addressing/regional_hostnames/${hostname}`, options); - } - - /** - * Update the configuration for a specific Regional Hostname. Only the region_key - * of a hostname is mutable. - * - * @example - * ```ts - * const response = - * await client.addressing.regionalHostnames.edit( - * 'foo.example.com', - * { - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * region_key: 'ca', - * }, - * ); - * ``` - */ - edit( - hostname: string, - params: RegionalHostnameEditParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.patch(`/zones/${zone_id}/addressing/regional_hostnames/${hostname}`, { - body, - ...options, - }) as Core.APIPromise<{ result: RegionalHostnameEditResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Fetch the configuration for a specific Regional Hostname, within a zone. - * - * @example - * ```ts - * const regionalHostname = - * await client.addressing.regionalHostnames.get( - * 'foo.example.com', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - get( - hostname: string, - params: RegionalHostnameGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id } = params; - return ( - this._client.get( - `/zones/${zone_id}/addressing/regional_hostnames/${hostname}`, - options, - ) as Core.APIPromise<{ result: RegionalHostnameGetResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export class RegionalHostnameListResponsesSinglePage extends SinglePage {} - -export interface RegionalHostnameCreateResponse { - /** - * When the regional hostname was created - */ - created_on: string; - - /** - * DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are - * supported for one level, e.g `*.example.com` - */ - hostname: string; - - /** - * Identifying key for the region - */ - region_key: string; - - /** - * Configure which routing method to use for the regional hostname - */ - routing?: string; -} - -export interface RegionalHostnameListResponse { - /** - * When the regional hostname was created - */ - created_on: string; - - /** - * DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are - * supported for one level, e.g `*.example.com` - */ - hostname: string; - - /** - * Identifying key for the region - */ - region_key: string; - - /** - * Configure which routing method to use for the regional hostname - */ - routing?: string; -} - -export interface RegionalHostnameDeleteResponse { - errors: Array; - - messages: Array; - - /** - * Whether the API call was successful. - */ - success: true; -} - -export namespace RegionalHostnameDeleteResponse { - export interface Error { - code: number; - - message: string; - - documentation_url?: string; - - source?: Error.Source; - } - - export namespace Error { - export interface Source { - pointer?: string; - } - } - - export interface Message { - code: number; - - message: string; - - documentation_url?: string; - - source?: Message.Source; - } - - export namespace Message { - export interface Source { - pointer?: string; - } - } -} - -export interface RegionalHostnameEditResponse { - /** - * When the regional hostname was created - */ - created_on: string; - - /** - * DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are - * supported for one level, e.g `*.example.com` - */ - hostname: string; - - /** - * Identifying key for the region - */ - region_key: string; - - /** - * Configure which routing method to use for the regional hostname - */ - routing?: string; -} - -export interface RegionalHostnameGetResponse { - /** - * When the regional hostname was created - */ - created_on: string; - - /** - * DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are - * supported for one level, e.g `*.example.com` - */ - hostname: string; - - /** - * Identifying key for the region - */ - region_key: string; - - /** - * Configure which routing method to use for the regional hostname - */ - routing?: string; -} - -export interface RegionalHostnameCreateParams { - /** - * Path param: Identifier. - */ - zone_id: string; - - /** - * Body param: DNS hostname to be regionalized, must be a subdomain of the zone. - * Wildcards are supported for one level, e.g `*.example.com` - */ - hostname: string; - - /** - * Body param: Identifying key for the region - */ - region_key: string; - - /** - * Body param: Configure which routing method to use for the regional hostname - */ - routing?: string; -} - -export interface RegionalHostnameListParams { - /** - * Identifier. - */ - zone_id: string; -} - -export interface RegionalHostnameDeleteParams { - /** - * Identifier. - */ - zone_id: string; -} - -export interface RegionalHostnameEditParams { - /** - * Path param: Identifier. - */ - zone_id: string; - - /** - * Body param: Identifying key for the region - */ - region_key: string; } -export interface RegionalHostnameGetParams { - /** - * Identifier. - */ - zone_id: string; -} - -RegionalHostnames.RegionalHostnameListResponsesSinglePage = RegionalHostnameListResponsesSinglePage; RegionalHostnames.Regions = Regions; -RegionalHostnames.RegionListResponsesSinglePage = RegionListResponsesSinglePage; export declare namespace RegionalHostnames { - export { - type RegionalHostnameCreateResponse as RegionalHostnameCreateResponse, - type RegionalHostnameListResponse as RegionalHostnameListResponse, - type RegionalHostnameDeleteResponse as RegionalHostnameDeleteResponse, - type RegionalHostnameEditResponse as RegionalHostnameEditResponse, - type RegionalHostnameGetResponse as RegionalHostnameGetResponse, - RegionalHostnameListResponsesSinglePage as RegionalHostnameListResponsesSinglePage, - type RegionalHostnameCreateParams as RegionalHostnameCreateParams, - type RegionalHostnameListParams as RegionalHostnameListParams, - type RegionalHostnameDeleteParams as RegionalHostnameDeleteParams, - type RegionalHostnameEditParams as RegionalHostnameEditParams, - type RegionalHostnameGetParams as RegionalHostnameGetParams, - }; - - export { - Regions as Regions, - type RegionListResponse as RegionListResponse, - RegionListResponsesSinglePage as RegionListResponsesSinglePage, - type RegionListParams as RegionListParams, - }; + export { Regions as Regions }; } diff --git a/src/resources/addressing/regional-hostnames/regions.ts b/src/resources/addressing/regional-hostnames/regions.ts index 0f11942e41..6fc7e68865 100644 --- a/src/resources/addressing/regional-hostnames/regions.ts +++ b/src/resources/addressing/regional-hostnames/regions.ts @@ -1,63 +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 Regions extends APIResource { - /** - * List all Regional Services regions available for use by this account. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const regionListResponse of client.addressing.regionalHostnames.regions.list( - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` - */ - list( - params: RegionListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id } = params; - return this._client.getAPIList( - `/accounts/${account_id}/addressing/regional_hostnames/regions`, - RegionListResponsesSinglePage, - options, - ); - } -} - -export class RegionListResponsesSinglePage extends SinglePage {} - -export interface RegionListResponse { - /** - * Identifying key for the region - */ - key?: string; - - /** - * Human-readable text label for the region - */ - label?: string; -} - -export interface RegionListParams { - /** - * Identifier. - */ - account_id: string; -} - -Regions.RegionListResponsesSinglePage = RegionListResponsesSinglePage; - -export declare namespace Regions { - export { - type RegionListResponse as RegionListResponse, - RegionListResponsesSinglePage as RegionListResponsesSinglePage, - type RegionListParams as RegionListParams, - }; -} +export class Regions extends APIResource {} diff --git a/src/resources/ai-audit.ts b/src/resources/ai-audit.ts new file mode 100644 index 0000000000..66fd7be4b9 --- /dev/null +++ b/src/resources/ai-audit.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './ai-audit/index'; diff --git a/src/resources/ai-audit/ai-audit.ts b/src/resources/ai-audit/ai-audit.ts new file mode 100644 index 0000000000..6c35494f32 --- /dev/null +++ b/src/resources/ai-audit/ai-audit.ts @@ -0,0 +1,15 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as RobotsAPI from './robots'; +import { Robots } from './robots'; + +export class AIAudit extends APIResource { + robots: RobotsAPI.Robots = new RobotsAPI.Robots(this._client); +} + +AIAudit.Robots = Robots; + +export declare namespace AIAudit { + export { Robots as Robots }; +} diff --git a/src/resources/ai-audit/api.md b/src/resources/ai-audit/api.md new file mode 100644 index 0000000000..c1cadf8eda --- /dev/null +++ b/src/resources/ai-audit/api.md @@ -0,0 +1,3 @@ +# AIAudit + +## Robots diff --git a/src/resources/ai-audit/index.ts b/src/resources/ai-audit/index.ts new file mode 100644 index 0000000000..dcf715b31d --- /dev/null +++ b/src/resources/ai-audit/index.ts @@ -0,0 +1,4 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { AIAudit } from './ai-audit'; +export { Robots } from './robots'; diff --git a/src/resources/ai-audit/robots.ts b/src/resources/ai-audit/robots.ts new file mode 100644 index 0000000000..a76433283b --- /dev/null +++ b/src/resources/ai-audit/robots.ts @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; + +export class Robots extends APIResource {} diff --git a/src/resources/aisearch/instances/instances.ts b/src/resources/aisearch/instances/instances.ts index 1f418b14a6..fca290e527 100644 --- a/src/resources/aisearch/instances/instances.ts +++ b/src/resources/aisearch/instances/instances.ts @@ -485,9 +485,9 @@ export namespace InstanceCreateResponse { export interface RetrievalOptions { /** * Metadata fields to boost search results by. Each entry specifies a metadata - * field and an optional direction. Direction defaults to 'asc' for numeric fields - * and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined - * custom_metadata field. + * field and an optional direction. Direction defaults to 'asc' for + * numeric/datetime fields and 'exists' for text/boolean fields. Fields must match + * 'timestamp' or a defined custom_metadata field. */ boost_by?: Array; @@ -503,15 +503,16 @@ export namespace InstanceCreateResponse { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; @@ -879,9 +880,9 @@ export namespace InstanceUpdateResponse { export interface RetrievalOptions { /** * Metadata fields to boost search results by. Each entry specifies a metadata - * field and an optional direction. Direction defaults to 'asc' for numeric fields - * and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined - * custom_metadata field. + * field and an optional direction. Direction defaults to 'asc' for + * numeric/datetime fields and 'exists' for text/boolean fields. Fields must match + * 'timestamp' or a defined custom_metadata field. */ boost_by?: Array; @@ -897,15 +898,16 @@ export namespace InstanceUpdateResponse { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; @@ -1273,9 +1275,9 @@ export namespace InstanceListResponse { export interface RetrievalOptions { /** * Metadata fields to boost search results by. Each entry specifies a metadata - * field and an optional direction. Direction defaults to 'asc' for numeric fields - * and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined - * custom_metadata field. + * field and an optional direction. Direction defaults to 'asc' for + * numeric/datetime fields and 'exists' for text/boolean fields. Fields must match + * 'timestamp' or a defined custom_metadata field. */ boost_by?: Array; @@ -1291,15 +1293,16 @@ export namespace InstanceListResponse { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; @@ -1667,9 +1670,9 @@ export namespace InstanceDeleteResponse { export interface RetrievalOptions { /** * Metadata fields to boost search results by. Each entry specifies a metadata - * field and an optional direction. Direction defaults to 'asc' for numeric fields - * and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined - * custom_metadata field. + * field and an optional direction. Direction defaults to 'asc' for + * numeric/datetime fields and 'exists' for text/boolean fields. Fields must match + * 'timestamp' or a defined custom_metadata field. */ boost_by?: Array; @@ -1685,15 +1688,16 @@ export namespace InstanceDeleteResponse { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; @@ -2131,9 +2135,9 @@ export namespace InstanceReadResponse { export interface RetrievalOptions { /** * Metadata fields to boost search results by. Each entry specifies a metadata - * field and an optional direction. Direction defaults to 'asc' for numeric fields - * and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined - * custom_metadata field. + * field and an optional direction. Direction defaults to 'asc' for + * numeric/datetime fields and 'exists' for text/boolean fields. Fields must match + * 'timestamp' or a defined custom_metadata field. */ boost_by?: Array; @@ -2149,15 +2153,16 @@ export namespace InstanceReadResponse { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; @@ -2700,9 +2705,9 @@ export namespace InstanceCreateParams { export interface RetrievalOptions { /** * Metadata fields to boost search results by. Each entry specifies a metadata - * field and an optional direction. Direction defaults to 'asc' for numeric fields - * and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined - * custom_metadata field. + * field and an optional direction. Direction defaults to 'asc' for + * numeric/datetime fields and 'exists' for text/boolean fields. Fields must match + * 'timestamp' or a defined custom_metadata field. */ boost_by?: Array; @@ -2718,15 +2723,16 @@ export namespace InstanceCreateParams { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; @@ -3193,9 +3199,9 @@ export namespace InstanceUpdateParams { export interface RetrievalOptions { /** * Metadata fields to boost search results by. Each entry specifies a metadata - * field and an optional direction. Direction defaults to 'asc' for numeric fields - * and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined - * custom_metadata field. + * field and an optional direction. Direction defaults to 'asc' for + * numeric/datetime fields and 'exists' for text/boolean fields. Fields must match + * 'timestamp' or a defined custom_metadata field. */ boost_by?: Array; @@ -3211,15 +3217,16 @@ export namespace InstanceUpdateParams { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; @@ -3524,15 +3531,16 @@ export namespace InstanceChatCompletionsParams { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; @@ -3667,15 +3675,16 @@ export namespace InstanceSearchParams { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; diff --git a/src/resources/aisearch/namespaces/instances/instances.ts b/src/resources/aisearch/namespaces/instances/instances.ts index 3379ac6c1f..b840d1d35a 100644 --- a/src/resources/aisearch/namespaces/instances/instances.ts +++ b/src/resources/aisearch/namespaces/instances/instances.ts @@ -536,9 +536,9 @@ export namespace InstanceCreateResponse { export interface RetrievalOptions { /** * Metadata fields to boost search results by. Each entry specifies a metadata - * field and an optional direction. Direction defaults to 'asc' for numeric fields - * and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined - * custom_metadata field. + * field and an optional direction. Direction defaults to 'asc' for + * numeric/datetime fields and 'exists' for text/boolean fields. Fields must match + * 'timestamp' or a defined custom_metadata field. */ boost_by?: Array; @@ -554,15 +554,16 @@ export namespace InstanceCreateResponse { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; @@ -930,9 +931,9 @@ export namespace InstanceUpdateResponse { export interface RetrievalOptions { /** * Metadata fields to boost search results by. Each entry specifies a metadata - * field and an optional direction. Direction defaults to 'asc' for numeric fields - * and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined - * custom_metadata field. + * field and an optional direction. Direction defaults to 'asc' for + * numeric/datetime fields and 'exists' for text/boolean fields. Fields must match + * 'timestamp' or a defined custom_metadata field. */ boost_by?: Array; @@ -948,15 +949,16 @@ export namespace InstanceUpdateResponse { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; @@ -1324,9 +1326,9 @@ export namespace InstanceListResponse { export interface RetrievalOptions { /** * Metadata fields to boost search results by. Each entry specifies a metadata - * field and an optional direction. Direction defaults to 'asc' for numeric fields - * and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined - * custom_metadata field. + * field and an optional direction. Direction defaults to 'asc' for + * numeric/datetime fields and 'exists' for text/boolean fields. Fields must match + * 'timestamp' or a defined custom_metadata field. */ boost_by?: Array; @@ -1342,15 +1344,16 @@ export namespace InstanceListResponse { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; @@ -1718,9 +1721,9 @@ export namespace InstanceDeleteResponse { export interface RetrievalOptions { /** * Metadata fields to boost search results by. Each entry specifies a metadata - * field and an optional direction. Direction defaults to 'asc' for numeric fields - * and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined - * custom_metadata field. + * field and an optional direction. Direction defaults to 'asc' for + * numeric/datetime fields and 'exists' for text/boolean fields. Fields must match + * 'timestamp' or a defined custom_metadata field. */ boost_by?: Array; @@ -1736,15 +1739,16 @@ export namespace InstanceDeleteResponse { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; @@ -2182,9 +2186,9 @@ export namespace InstanceReadResponse { export interface RetrievalOptions { /** * Metadata fields to boost search results by. Each entry specifies a metadata - * field and an optional direction. Direction defaults to 'asc' for numeric fields - * and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined - * custom_metadata field. + * field and an optional direction. Direction defaults to 'asc' for + * numeric/datetime fields and 'exists' for text/boolean fields. Fields must match + * 'timestamp' or a defined custom_metadata field. */ boost_by?: Array; @@ -2200,15 +2204,16 @@ export namespace InstanceReadResponse { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; @@ -2751,9 +2756,9 @@ export namespace InstanceCreateParams { export interface RetrievalOptions { /** * Metadata fields to boost search results by. Each entry specifies a metadata - * field and an optional direction. Direction defaults to 'asc' for numeric fields - * and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined - * custom_metadata field. + * field and an optional direction. Direction defaults to 'asc' for + * numeric/datetime fields and 'exists' for text/boolean fields. Fields must match + * 'timestamp' or a defined custom_metadata field. */ boost_by?: Array; @@ -2769,15 +2774,16 @@ export namespace InstanceCreateParams { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; @@ -3244,9 +3250,9 @@ export namespace InstanceUpdateParams { export interface RetrievalOptions { /** * Metadata fields to boost search results by. Each entry specifies a metadata - * field and an optional direction. Direction defaults to 'asc' for numeric fields - * and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined - * custom_metadata field. + * field and an optional direction. Direction defaults to 'asc' for + * numeric/datetime fields and 'exists' for text/boolean fields. Fields must match + * 'timestamp' or a defined custom_metadata field. */ boost_by?: Array; @@ -3262,15 +3268,16 @@ export namespace InstanceUpdateParams { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; @@ -3575,15 +3582,16 @@ export namespace InstanceChatCompletionsParams { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; @@ -3718,15 +3726,16 @@ export namespace InstanceSearchParams { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; diff --git a/src/resources/aisearch/namespaces/namespaces.ts b/src/resources/aisearch/namespaces/namespaces.ts index 1a59c3a35d..f3491a55dc 100644 --- a/src/resources/aisearch/namespaces/namespaces.ts +++ b/src/resources/aisearch/namespaces/namespaces.ts @@ -599,15 +599,16 @@ export namespace NamespaceChatCompletionsParams { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; @@ -752,15 +753,16 @@ export namespace NamespaceSearchParams { export interface BoostBy { /** * Metadata field name to boost by. Use 'timestamp' for document freshness, or any - * custom_metadata field. Numeric and datetime fields support asc/desc directions; - * text/boolean fields support exists/not_exists. + * custom_metadata field. Numeric and datetime fields support all four directions + * (asc, desc, exists, not_exists); text/boolean fields only support + * exists/not_exists. */ field: string; /** * Boost direction. 'desc' = higher values rank higher (e.g. newer timestamps). * 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. - * 'not_exists' = boost chunks that lack the field. Optional ��� defaults to 'asc' + * 'not_exists' = boost chunks that lack the field. Optional — defaults to 'asc' * for numeric/datetime fields, 'exists' for text/boolean fields. */ direction?: 'asc' | 'desc' | 'exists' | 'not_exists'; diff --git a/src/resources/api-gateway/api.md b/src/resources/api-gateway/api.md index ff702913f6..a0bb15556e 100644 --- a/src/resources/api-gateway/api.md +++ b/src/resources/api-gateway/api.md @@ -27,13 +27,11 @@ Methods: Types: - OperationBulkEditResponse -- OperationEditResponse Methods: - client.apiGateway.discovery.operations.list({ ...params }) -> DiscoveryOperationsV4PagePaginationArray - client.apiGateway.discovery.operations.bulkEdit({ ...params }) -> OperationBulkEditResponse -- client.apiGateway.discovery.operations.edit(operationId, { ...params }) -> OperationEditResponse ## Labels diff --git a/src/resources/api-gateway/discovery/discovery.ts b/src/resources/api-gateway/discovery/discovery.ts index dc9185efdb..207bb9724b 100644 --- a/src/resources/api-gateway/discovery/discovery.ts +++ b/src/resources/api-gateway/discovery/discovery.ts @@ -6,8 +6,6 @@ import * as OperationsAPI from './operations'; import { OperationBulkEditParams, OperationBulkEditResponse, - OperationEditParams, - OperationEditResponse, OperationListParams, Operations, } from './operations'; @@ -129,9 +127,7 @@ export declare namespace Discovery { export { Operations as Operations, type OperationBulkEditResponse as OperationBulkEditResponse, - type OperationEditResponse as OperationEditResponse, type OperationListParams as OperationListParams, type OperationBulkEditParams as OperationBulkEditParams, - type OperationEditParams as OperationEditParams, }; } diff --git a/src/resources/api-gateway/discovery/index.ts b/src/resources/api-gateway/discovery/index.ts index a2a9fd29a6..43c900321b 100644 --- a/src/resources/api-gateway/discovery/index.ts +++ b/src/resources/api-gateway/discovery/index.ts @@ -10,8 +10,6 @@ export { export { Operations, type OperationBulkEditResponse, - type OperationEditResponse, type OperationListParams, type OperationBulkEditParams, - type OperationEditParams, } from './operations'; diff --git a/src/resources/api-gateway/discovery/operations.ts b/src/resources/api-gateway/discovery/operations.ts index f7b4a5fd74..f8802bbaf0 100644 --- a/src/resources/api-gateway/discovery/operations.ts +++ b/src/resources/api-gateway/discovery/operations.ts @@ -59,32 +59,6 @@ export class Operations extends APIResource { }) as Core.APIPromise<{ result: OperationBulkEditResponse }> )._thenUnwrap((obj) => obj.result); } - - /** - * Update the `state` on a discovered operation - * - * @example - * ```ts - * const response = - * await client.apiGateway.discovery.operations.edit( - * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - edit( - operationId: string, - params: OperationEditParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.patch(`/zones/${zone_id}/api_gateway/discovery/operations/${operationId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: OperationEditResponse }> - )._thenUnwrap((obj) => obj.result); - } } export type OperationBulkEditResponse = { [key: string]: OperationBulkEditResponse.item }; @@ -104,17 +78,6 @@ export namespace OperationBulkEditResponse { } } -export interface OperationEditResponse { - /** - * State of operation in API Discovery - * - * - `review` - Operation is not saved into API Shield Endpoint Management - * - `saved` - Operation is saved into API Shield Endpoint Management - * - `ignored` - Operation is marked as ignored - */ - state?: 'review' | 'saved' | 'ignored'; -} - export interface OperationListParams extends V4PagePaginationArrayParams { /** * Path param: Identifier. @@ -202,28 +165,11 @@ export namespace OperationBulkEditParams { } } -export interface OperationEditParams { - /** - * Path param: Identifier. - */ - zone_id: string; - - /** - * Body param: Mark state of operation in API Discovery - * - * - `review` - Mark operation as for review - * - `ignored` - Mark operation as ignored - */ - state?: 'review' | 'ignored'; -} - export declare namespace Operations { export { type OperationBulkEditResponse as OperationBulkEditResponse, - type OperationEditResponse as OperationEditResponse, type OperationListParams as OperationListParams, type OperationBulkEditParams as OperationBulkEditParams, - type OperationEditParams as OperationEditParams, }; } diff --git a/src/resources/cache/api.md b/src/resources/cache/api.md index e732450dc3..a6caf9ba23 100644 --- a/src/resources/cache/api.md +++ b/src/resources/cache/api.md @@ -3,10 +3,12 @@ Types: - CachePurgeResponse +- CachePurgeEnvironmentResponse Methods: - client.cache.purge({ ...params }) -> CachePurgeResponse | null +- client.cache.purgeEnvironment(environmentId, { ...params }) -> CachePurgeEnvironmentResponse | null ## CacheReserve @@ -31,12 +33,14 @@ Methods: Types: +- SmartTieredCacheCreateResponse - SmartTieredCacheDeleteResponse - SmartTieredCacheEditResponse - SmartTieredCacheGetResponse Methods: +- client.cache.smartTieredCache.create({ ...params }) -> SmartTieredCacheCreateResponse - client.cache.smartTieredCache.delete({ ...params }) -> SmartTieredCacheDeleteResponse - client.cache.smartTieredCache.edit({ ...params }) -> SmartTieredCacheEditResponse - client.cache.smartTieredCache.get({ ...params }) -> SmartTieredCacheGetResponse @@ -74,22 +78,17 @@ Methods: Types: - OriginCloudRegion -- OriginCloudRegionCreateResponse -- OriginCloudRegionListResponse - OriginCloudRegionDeleteResponse - OriginCloudRegionBulkDeleteResponse -- OriginCloudRegionBulkEditResponse -- OriginCloudRegionEditResponse -- OriginCloudRegionGetResponse +- OriginCloudRegionBulkUpdateResponse - OriginCloudRegionSupportedRegionsResponse Methods: -- client.cache.originCloudRegions.create({ ...params }) -> OriginCloudRegionCreateResponse -- client.cache.originCloudRegions.list({ ...params }) -> OriginCloudRegionListResponse -- client.cache.originCloudRegions.delete(originIP, { ...params }) -> OriginCloudRegionDeleteResponse -- client.cache.originCloudRegions.bulkDelete({ ...params }) -> OriginCloudRegionBulkDeleteResponse -- client.cache.originCloudRegions.bulkEdit([ ...body ]) -> OriginCloudRegionBulkEditResponse -- client.cache.originCloudRegions.edit({ ...params }) -> OriginCloudRegionEditResponse -- client.cache.originCloudRegions.get(originIP, { ...params }) -> OriginCloudRegionGetResponse -- client.cache.originCloudRegions.supportedRegions({ ...params }) -> OriginCloudRegionSupportedRegionsResponse +- client.cache.originCloudRegions.update(originIP, { ...params }) -> OriginCloudRegion +- client.cache.originCloudRegions.list({ ...params }) -> OriginCloudRegionsV4PagePaginationArray +- client.cache.originCloudRegions.delete(originIP, { ...params }) -> OriginCloudRegionDeleteResponse +- client.cache.originCloudRegions.bulkDelete({ ...params }) -> OriginCloudRegionBulkDeleteResponse +- client.cache.originCloudRegions.bulkUpdate([ ...body ]) -> OriginCloudRegionBulkUpdateResponse +- client.cache.originCloudRegions.get(originIP, { ...params }) -> OriginCloudRegion +- client.cache.originCloudRegions.supportedRegions({ ...params }) -> OriginCloudRegionSupportedRegionsResponse diff --git a/src/resources/cache/cache.ts b/src/resources/cache/cache.ts index b88a2e31d5..4e9ece1acf 100644 --- a/src/resources/cache/cache.ts +++ b/src/resources/cache/cache.ts @@ -22,21 +22,17 @@ import { OriginCloudRegion, OriginCloudRegionBulkDeleteParams, OriginCloudRegionBulkDeleteResponse, - OriginCloudRegionBulkEditParams, - OriginCloudRegionBulkEditResponse, - OriginCloudRegionCreateParams, - OriginCloudRegionCreateResponse, + OriginCloudRegionBulkUpdateParams, + OriginCloudRegionBulkUpdateResponse, OriginCloudRegionDeleteParams, OriginCloudRegionDeleteResponse, - OriginCloudRegionEditParams, - OriginCloudRegionEditResponse, OriginCloudRegionGetParams, - OriginCloudRegionGetResponse, OriginCloudRegionListParams, - OriginCloudRegionListResponse, OriginCloudRegionSupportedRegionsParams, OriginCloudRegionSupportedRegionsResponse, + OriginCloudRegionUpdateParams, OriginCloudRegions, + OriginCloudRegionsV4PagePaginationArray, } from './origin-cloud-regions'; import * as RegionalTieredCacheAPI from './regional-tiered-cache'; import { @@ -50,6 +46,8 @@ import { import * as SmartTieredCacheAPI from './smart-tiered-cache'; import { SmartTieredCache, + SmartTieredCacheCreateParams, + SmartTieredCacheCreateResponse, SmartTieredCacheDeleteParams, SmartTieredCacheDeleteResponse, SmartTieredCacheEditParams, @@ -113,7 +111,7 @@ export class Cache extends APIResource { * Single file purge example with url and header pairs: * * ``` - * {"files": [{url: "http://www.example.com/cat_picture.jpg", headers: { "CF-IPCountry": "US", "CF-Device-Type": "desktop", "Accept-Language": "zh-CN" }}, {url: "http://www.example.com/dog_picture.jpg", headers: { "CF-IPCountry": "EU", "CF-Device-Type": "mobile", "Accept-Language": "en-US" }}]} + * {"files": [{"url": "http://www.example.com/cat_picture.jpg", "headers": {"CF-IPCountry": "US", "CF-Device-Type": "desktop", "Accept-Language": "zh-CN"}}, {"url": "http://www.example.com/dog_picture.jpg", "headers": {"CF-IPCountry": "EU", "CF-Device-Type": "mobile", "Accept-Language": "en-US"}}]} * ``` * * ### Purge Cached Content by Tag, Host or Prefix @@ -141,7 +139,7 @@ export class Cache extends APIResource { * * ### Availability and limits * - * please refer to + * Please refer to * [purge cache availability and limits documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits). * * @example @@ -159,12 +157,48 @@ export class Cache extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Purge cached content scoped to a specific environment. Supports the same purge + * types as the zone-level endpoint (purge everything, by URL, by tag, host, or + * prefix). + * + * ### Availability and limits + * + * Please refer to + * [purge cache availability and limits documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits). + * + * @example + * ```ts + * const response = await client.cache.purgeEnvironment( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + purgeEnvironment( + environmentId: string, + params: CachePurgeEnvironmentParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/environments/${environmentId}/purge_cache`, { + body, + ...options, + }) as Core.APIPromise<{ result: CachePurgeEnvironmentResponse | null }> + )._thenUnwrap((obj) => obj.result); + } } export interface CachePurgeResponse { id: string; } +export interface CachePurgeEnvironmentResponse { + id: string; +} + export type CachePurgeParams = | CachePurgeParams.CachePurgeFlexPurgeByTags | CachePurgeParams.CachePurgeFlexPurgeByHostnames @@ -263,14 +297,118 @@ export declare namespace CachePurgeParams { } } +export type CachePurgeEnvironmentParams = + | CachePurgeEnvironmentParams.CachePurgeFlexPurgeByTags + | CachePurgeEnvironmentParams.CachePurgeFlexPurgeByHostnames + | CachePurgeEnvironmentParams.CachePurgeFlexPurgeByPrefixes + | CachePurgeEnvironmentParams.CachePurgeEverything + | CachePurgeEnvironmentParams.CachePurgeSingleFile + | CachePurgeEnvironmentParams.CachePurgeSingleFileWithURLAndHeaders; + +export declare namespace CachePurgeEnvironmentParams { + export interface CachePurgeFlexPurgeByTags { + /** + * Path param + */ + zone_id: string; + + /** + * Body param: For more information on cache tags and purging by tags, please refer + * to + * [purge by cache-tags documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-tags/). + */ + tags?: Array; + } + + export interface CachePurgeFlexPurgeByHostnames { + /** + * Path param + */ + zone_id: string; + + /** + * Body param: For more information purging by hostnames, please refer to + * [purge by hostname documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-hostname/). + */ + hosts?: Array; + } + + export interface CachePurgeFlexPurgeByPrefixes { + /** + * Path param + */ + zone_id: string; + + /** + * Body param: For more information on purging by prefixes, please refer to + * [purge by prefix documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/purge_by_prefix/). + */ + prefixes?: Array; + } + + export interface CachePurgeEverything { + /** + * Path param + */ + zone_id: string; + + /** + * Body param: For more information, please refer to + * [purge everything documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/purge-everything/). + */ + purge_everything?: boolean; + } + + export interface CachePurgeSingleFile { + /** + * Path param + */ + zone_id: string; + + /** + * Body param: For more information on purging files, please refer to + * [purge by single-file documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-single-file/). + */ + files?: Array; + } + + export interface CachePurgeSingleFileWithURLAndHeaders { + /** + * Path param + */ + zone_id: string; + + /** + * Body param: For more information on purging files with URL and headers, please + * refer to + * [purge by single-file documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-single-file/). + */ + files?: Array; + } + + export namespace CachePurgeSingleFileWithURLAndHeaders { + export interface File { + headers?: { [key: string]: string }; + + url?: string; + } + } +} + Cache.CacheReserveResource = CacheReserveResource; Cache.SmartTieredCache = SmartTieredCache; Cache.Variants = Variants; Cache.RegionalTieredCacheResource = RegionalTieredCacheResource; Cache.OriginCloudRegions = OriginCloudRegions; +Cache.OriginCloudRegionsV4PagePaginationArray = OriginCloudRegionsV4PagePaginationArray; export declare namespace Cache { - export { type CachePurgeResponse as CachePurgeResponse, type CachePurgeParams as CachePurgeParams }; + export { + type CachePurgeResponse as CachePurgeResponse, + type CachePurgeEnvironmentResponse as CachePurgeEnvironmentResponse, + type CachePurgeParams as CachePurgeParams, + type CachePurgeEnvironmentParams as CachePurgeEnvironmentParams, + }; export { CacheReserveResource as CacheReserveResource, @@ -289,9 +427,11 @@ export declare namespace Cache { export { SmartTieredCache as SmartTieredCache, + type SmartTieredCacheCreateResponse as SmartTieredCacheCreateResponse, type SmartTieredCacheDeleteResponse as SmartTieredCacheDeleteResponse, type SmartTieredCacheEditResponse as SmartTieredCacheEditResponse, type SmartTieredCacheGetResponse as SmartTieredCacheGetResponse, + type SmartTieredCacheCreateParams as SmartTieredCacheCreateParams, type SmartTieredCacheDeleteParams as SmartTieredCacheDeleteParams, type SmartTieredCacheEditParams as SmartTieredCacheEditParams, type SmartTieredCacheGetParams as SmartTieredCacheGetParams, @@ -320,20 +460,16 @@ export declare namespace Cache { export { OriginCloudRegions as OriginCloudRegions, type OriginCloudRegion as OriginCloudRegion, - type OriginCloudRegionCreateResponse as OriginCloudRegionCreateResponse, - type OriginCloudRegionListResponse as OriginCloudRegionListResponse, type OriginCloudRegionDeleteResponse as OriginCloudRegionDeleteResponse, type OriginCloudRegionBulkDeleteResponse as OriginCloudRegionBulkDeleteResponse, - type OriginCloudRegionBulkEditResponse as OriginCloudRegionBulkEditResponse, - type OriginCloudRegionEditResponse as OriginCloudRegionEditResponse, - type OriginCloudRegionGetResponse as OriginCloudRegionGetResponse, + type OriginCloudRegionBulkUpdateResponse as OriginCloudRegionBulkUpdateResponse, type OriginCloudRegionSupportedRegionsResponse as OriginCloudRegionSupportedRegionsResponse, - type OriginCloudRegionCreateParams as OriginCloudRegionCreateParams, + OriginCloudRegionsV4PagePaginationArray as OriginCloudRegionsV4PagePaginationArray, + type OriginCloudRegionUpdateParams as OriginCloudRegionUpdateParams, type OriginCloudRegionListParams as OriginCloudRegionListParams, type OriginCloudRegionDeleteParams as OriginCloudRegionDeleteParams, type OriginCloudRegionBulkDeleteParams as OriginCloudRegionBulkDeleteParams, - type OriginCloudRegionBulkEditParams as OriginCloudRegionBulkEditParams, - type OriginCloudRegionEditParams as OriginCloudRegionEditParams, + type OriginCloudRegionBulkUpdateParams as OriginCloudRegionBulkUpdateParams, type OriginCloudRegionGetParams as OriginCloudRegionGetParams, type OriginCloudRegionSupportedRegionsParams as OriginCloudRegionSupportedRegionsParams, }; diff --git a/src/resources/cache/index.ts b/src/resources/cache/index.ts index 33310961fc..adb610c246 100644 --- a/src/resources/cache/index.ts +++ b/src/resources/cache/index.ts @@ -16,22 +16,18 @@ export { type CacheReserveStatusParams, } from './cache-reserve'; export { + OriginCloudRegionsV4PagePaginationArray, OriginCloudRegions, type OriginCloudRegion, - type OriginCloudRegionCreateResponse, - type OriginCloudRegionListResponse, type OriginCloudRegionDeleteResponse, type OriginCloudRegionBulkDeleteResponse, - type OriginCloudRegionBulkEditResponse, - type OriginCloudRegionEditResponse, - type OriginCloudRegionGetResponse, + type OriginCloudRegionBulkUpdateResponse, type OriginCloudRegionSupportedRegionsResponse, - type OriginCloudRegionCreateParams, + type OriginCloudRegionUpdateParams, type OriginCloudRegionListParams, type OriginCloudRegionDeleteParams, type OriginCloudRegionBulkDeleteParams, - type OriginCloudRegionBulkEditParams, - type OriginCloudRegionEditParams, + type OriginCloudRegionBulkUpdateParams, type OriginCloudRegionGetParams, type OriginCloudRegionSupportedRegionsParams, } from './origin-cloud-regions'; @@ -45,9 +41,11 @@ export { } from './regional-tiered-cache'; export { SmartTieredCache, + type SmartTieredCacheCreateResponse, type SmartTieredCacheDeleteResponse, type SmartTieredCacheEditResponse, type SmartTieredCacheGetResponse, + type SmartTieredCacheCreateParams, type SmartTieredCacheDeleteParams, type SmartTieredCacheEditParams, type SmartTieredCacheGetParams, diff --git a/src/resources/cache/origin-cloud-regions.ts b/src/resources/cache/origin-cloud-regions.ts index afa70055ab..284eb69404 100644 --- a/src/resources/cache/origin-cloud-regions.ts +++ b/src/resources/cache/origin-cloud-regions.ts @@ -2,71 +2,81 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; export class OriginCloudRegions extends APIResource { /** - * Adds a single IP-to-cloud-region mapping for the zone. The IP must be a valid - * IPv4 or IPv6 address and is normalized to canonical form before storage (RFC - * 5952 for IPv6). Returns 400 (code 1145) if a mapping for that IP already exists - * — use PATCH to update an existing entry. The vendor and region are validated - * against the list from - * `GET /zones/{zone_id}/cache/origin_cloud_regions/supported_regions`. + * Creates a new IP-to-cloud-region mapping or replaces the existing mapping for + * the specified IP. PUT is idempotent — calling it repeatedly with the same body + * produces the same result. The IP path parameter is normalized to canonical form + * (RFC 5952 for IPv6) before storage. The vendor and region are validated against + * the list from `GET /zones/{zone_id}/origin/cloud_regions/supported_regions`. + * Returns 400 if the `origin_ip` in the body does not match the URL path + * parameter. Returns 403 (code 1164) when the zone has reached the limit of 3,500 + * IP mappings. * * @example * ```ts * const originCloudRegion = - * await client.cache.originCloudRegions.create({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * ip: '192.0.2.1', - * region: 'us-east-1', - * vendor: 'aws', - * }); + * await client.cache.originCloudRegions.update( + * '192.0.2.1', + * { + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * origin_ip: '192.0.2.1', + * region: 'us-east-1', + * vendor: 'aws', + * }, + * ); * ``` */ - create( - params: OriginCloudRegionCreateParams, + update( + originIP: string, + params: OriginCloudRegionUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { zone_id, ...body } = params; return ( - this._client.post(`/zones/${zone_id}/cache/origin_cloud_regions`, { + this._client.put(`/zones/${zone_id}/origin/cloud_regions/${originIP}`, { body, ...options, - }) as Core.APIPromise<{ result: OriginCloudRegionCreateResponse }> + }) as Core.APIPromise<{ result: OriginCloudRegion }> )._thenUnwrap((obj) => obj.result); } /** - * Returns all IP-to-cloud-region mappings configured for the zone. Each mapping - * tells Cloudflare which cloud vendor and region hosts the origin at that IP, - * enabling the edge to route via the nearest Tiered Cache upper-tier co-located - * with that cloud provider. Returns an empty array when no mappings exist. + * Returns all IP-to-cloud-region mappings configured for the zone with pagination + * support. Each mapping tells Cloudflare which cloud vendor and region hosts the + * origin at that IP, enabling the edge to route via the nearest Tiered Cache + * upper-tier co-located with that cloud provider. Returns an empty array when no + * mappings exist. * * @example * ```ts - * const originCloudRegions = - * await client.cache.originCloudRegions.list({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); + * // Automatically fetches more pages as needed. + * for await (const originCloudRegion of client.cache.originCloudRegions.list( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } * ``` */ list( params: OriginCloudRegionListParams, options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id } = params; - return ( - this._client.get(`/zones/${zone_id}/cache/origin_cloud_regions`, options) as Core.APIPromise<{ - result: OriginCloudRegionListResponse; - }> - )._thenUnwrap((obj) => obj.result); + ): Core.PagePromise { + const { zone_id, ...query } = params; + return this._client.getAPIList( + `/zones/${zone_id}/origin/cloud_regions`, + OriginCloudRegionsV4PagePaginationArray, + { query, ...options }, + ); } /** * Removes the cloud region mapping for a single origin IP address. The IP path - * parameter is normalized before lookup. Returns the deleted entry on success. - * Returns 404 (code 1163) if no mapping exists for the specified IP. When the last - * mapping for the zone is removed the underlying rule record is also deleted. + * parameter is normalized before lookup. Returns the deleted IP on success. + * Returns 404 if no mapping exists for the specified IP. When the last mapping for + * the zone is removed the underlying rule record is also deleted. * * @example * ```ts @@ -84,10 +94,9 @@ export class OriginCloudRegions extends APIResource { ): Core.APIPromise { const { zone_id } = params; return ( - this._client.delete( - `/zones/${zone_id}/cache/origin_cloud_regions/${originIP}`, - options, - ) as Core.APIPromise<{ result: OriginCloudRegionDeleteResponse }> + this._client.delete(`/zones/${zone_id}/origin/cloud_regions/${originIP}`, options) as Core.APIPromise<{ + result: OriginCloudRegionDeleteResponse; + }> )._thenUnwrap((obj) => obj.result); } @@ -111,32 +120,34 @@ export class OriginCloudRegions extends APIResource { ): Core.APIPromise { const { zone_id } = params; return ( - this._client.delete(`/zones/${zone_id}/cache/origin_cloud_regions/batch`, options) as Core.APIPromise<{ + this._client.delete(`/zones/${zone_id}/origin/cloud_regions/batch`, options) as Core.APIPromise<{ result: OriginCloudRegionBulkDeleteResponse; }> )._thenUnwrap((obj) => obj.result); } /** - * Adds or updates up to 100 IP-to-cloud-region mappings in a single request. Each - * item is validated independently — valid items are applied and invalid items are - * returned in the `failed` array. The vendor and region for every item are - * validated against the list from - * `GET /zones/{zone_id}/cache/origin_cloud_regions/supported_regions`. + * Upserts up to 100 IP-to-cloud-region mappings in a single request. Items in the + * request body are created or replaced; mappings not included in the request body + * are preserved unchanged (this is a merge operation, not a full collection + * replacement). Each item is validated independently — valid items are applied and + * invalid items are returned in the `failed` array. The vendor and region for + * every item are validated against the list from + * `GET /zones/{zone_id}/origin/cloud_regions/supported_regions`. * * @example * ```ts * const response = - * await client.cache.originCloudRegions.bulkEdit({ + * await client.cache.originCloudRegions.bulkUpdate({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * body: [ * { - * ip: '192.0.2.1', + * origin_ip: '192.0.2.1', * region: 'us-east-1', * vendor: 'aws', * }, * { - * ip: '2001:db8::1', + * origin_ip: '2001:db8::1', * region: 'us-central1', * vendor: 'gcp', * }, @@ -144,55 +155,23 @@ export class OriginCloudRegions extends APIResource { * }); * ``` */ - bulkEdit( - params: OriginCloudRegionBulkEditParams, + bulkUpdate( + params: OriginCloudRegionBulkUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { zone_id, body } = params; return ( - this._client.patch(`/zones/${zone_id}/cache/origin_cloud_regions/batch`, { + this._client.put(`/zones/${zone_id}/origin/cloud_regions/batch`, { body: body, ...options, - }) as Core.APIPromise<{ result: OriginCloudRegionBulkEditResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Adds or updates a single IP-to-cloud-region mapping for the zone. Unlike POST, - * this operation is idempotent — if a mapping for the IP already exists it is - * overwritten. Returns the complete updated list of all mappings for the zone. - * Returns 403 (code 1164) when the zone has reached the limit of 3,500 IP - * mappings. - * - * @example - * ```ts - * const response = await client.cache.originCloudRegions.edit( - * { - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * ip: '2001:db8::1', - * region: 'us-central1', - * vendor: 'gcp', - * }, - * ); - * ``` - */ - edit( - params: OriginCloudRegionEditParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.patch(`/zones/${zone_id}/cache/origin_cloud_regions`, { - body, - ...options, - }) as Core.APIPromise<{ result: OriginCloudRegionEditResponse }> + }) as Core.APIPromise<{ result: OriginCloudRegionBulkUpdateResponse }> )._thenUnwrap((obj) => obj.result); } /** * Returns the cloud region mapping for a single origin IP address. The IP path - * parameter is normalized before lookup (RFC 5952 for IPv6). Returns 404 - * (code 1142) if the zone has no mappings or if the specified IP has no mapping. + * parameter is normalized before lookup (RFC 5952 for IPv6). Returns 404 if the + * zone has no mappings or if the specified IP has no mapping. * * @example * ```ts @@ -206,13 +185,12 @@ export class OriginCloudRegions extends APIResource { originIP: string, params: OriginCloudRegionGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { zone_id } = params; return ( - this._client.get( - `/zones/${zone_id}/cache/origin_cloud_regions/${originIP}`, - options, - ) as Core.APIPromise<{ result: OriginCloudRegionGetResponse }> + this._client.get(`/zones/${zone_id}/origin/cloud_regions/${originIP}`, options) as Core.APIPromise<{ + result: OriginCloudRegion; + }> )._thenUnwrap((obj) => obj.result); } @@ -237,21 +215,24 @@ export class OriginCloudRegions extends APIResource { const { zone_id } = params; return ( this._client.get( - `/zones/${zone_id}/cache/origin_cloud_regions/supported_regions`, + `/zones/${zone_id}/origin/cloud_regions/supported_regions`, options, ) as Core.APIPromise<{ result: OriginCloudRegionSupportedRegionsResponse }> )._thenUnwrap((obj) => obj.result); } } +export class OriginCloudRegionsV4PagePaginationArray extends V4PagePaginationArray {} + /** * A single origin IP-to-cloud-region mapping. */ export interface OriginCloudRegion { /** - * The origin IP address (IPv4 or IPv6, canonicalized). + * The origin IP address (IPv4 or IPv6). Normalized to canonical form (RFC 5952 for + * IPv6). */ - 'origin-ip': string; + origin_ip: string; /** * Cloud vendor region identifier. @@ -270,279 +251,155 @@ export interface OriginCloudRegion { } /** - * Response result for a single origin cloud region mapping. + * Response result for a delete operation. Identifies the deleted mapping. */ -export interface OriginCloudRegionCreateResponse { - id: 'origin_public_cloud_region'; - - /** - * Whether the setting can be modified by the current user. - */ - editable: boolean; - - /** - * A single origin IP-to-cloud-region mapping. - */ - value: OriginCloudRegion; - +export interface OriginCloudRegionDeleteResponse { /** - * Time the mapping was last modified. + * The origin IP address whose mapping was deleted. */ - modified_on?: string; + origin_ip: string; } /** - * Response result for a list of origin cloud region mappings. + * Response result for a batch origin cloud region operation. */ -export interface OriginCloudRegionListResponse { - id: 'origin_public_cloud_region'; - +export interface OriginCloudRegionBulkDeleteResponse { /** - * Whether the setting can be modified by the current user. + * Items that could not be applied, with error details. */ - editable: boolean; - - value: Array; + failed: Array; /** - * Time the mapping set was last modified. Null when no mappings exist. + * Items that were successfully applied. */ - modified_on?: string | null; + succeeded: Array; } -/** - * Response result for a single origin cloud region mapping. - */ -export interface OriginCloudRegionDeleteResponse { - id: 'origin_public_cloud_region'; - - /** - * Whether the setting can be modified by the current user. - */ - editable: boolean; - - /** - * A single origin IP-to-cloud-region mapping. - */ - value: OriginCloudRegion; - +export namespace OriginCloudRegionBulkDeleteResponse { /** - * Time the mapping was last modified. + * Result for a single item in a batch operation. */ - modified_on?: string; -} + export interface Failed { + /** + * The origin IP address for this item. + */ + origin_ip: string; -/** - * Response result for a batch origin cloud region operation. - */ -export interface OriginCloudRegionBulkDeleteResponse { - id: 'origin_public_cloud_region'; + /** + * Error message explaining why the item failed. Present only on failed items. + */ + error?: string; - /** - * Whether the setting can be modified by the current user. - */ - editable: boolean; + /** + * Cloud vendor region identifier. Present on succeeded items (the new value for + * upsert, the deleted value for delete). + */ + region?: string; - value: OriginCloudRegionBulkDeleteResponse.Value; + /** + * Cloud vendor identifier. Present on succeeded items (the new value for upsert, + * the deleted value for delete). + */ + vendor?: string; + } /** - * Time the mapping set was last modified. Null when no items were successfully - * applied. + * Result for a single item in a batch operation. */ - modified_on?: string | null; -} - -export namespace OriginCloudRegionBulkDeleteResponse { - export interface Value { + export interface Succeeded { /** - * Items that could not be applied, with error details. + * The origin IP address for this item. */ - failed: Array; + origin_ip: string; /** - * Items that were successfully applied. + * Error message explaining why the item failed. Present only on failed items. */ - succeeded: Array; - } + error?: string; - export namespace Value { /** - * Result for a single item in a batch operation. + * Cloud vendor region identifier. Present on succeeded items (the new value for + * upsert, the deleted value for delete). */ - export interface Failed { - /** - * The origin IP address for this item. - */ - 'origin-ip': string; - - /** - * Error message explaining why the item failed. Present only on failed items. - */ - error?: string; - - /** - * Cloud vendor region identifier. Present on succeeded items for patch operations. - */ - region?: string; - - /** - * Cloud vendor identifier. Present on succeeded items for patch operations. - */ - vendor?: string; - } + region?: string; /** - * Result for a single item in a batch operation. + * Cloud vendor identifier. Present on succeeded items (the new value for upsert, + * the deleted value for delete). */ - export interface Succeeded { - /** - * The origin IP address for this item. - */ - 'origin-ip': string; - - /** - * Error message explaining why the item failed. Present only on failed items. - */ - error?: string; - - /** - * Cloud vendor region identifier. Present on succeeded items for patch operations. - */ - region?: string; - - /** - * Cloud vendor identifier. Present on succeeded items for patch operations. - */ - vendor?: string; - } + vendor?: string; } } /** * Response result for a batch origin cloud region operation. */ -export interface OriginCloudRegionBulkEditResponse { - id: 'origin_public_cloud_region'; - +export interface OriginCloudRegionBulkUpdateResponse { /** - * Whether the setting can be modified by the current user. + * Items that could not be applied, with error details. */ - editable: boolean; - - value: OriginCloudRegionBulkEditResponse.Value; + failed: Array; /** - * Time the mapping set was last modified. Null when no items were successfully - * applied. + * Items that were successfully applied. */ - modified_on?: string | null; + succeeded: Array; } -export namespace OriginCloudRegionBulkEditResponse { - export interface Value { +export namespace OriginCloudRegionBulkUpdateResponse { + /** + * Result for a single item in a batch operation. + */ + export interface Failed { /** - * Items that could not be applied, with error details. + * The origin IP address for this item. */ - failed: Array; + origin_ip: string; /** - * Items that were successfully applied. + * Error message explaining why the item failed. Present only on failed items. */ - succeeded: Array; - } + error?: string; - export namespace Value { /** - * Result for a single item in a batch operation. + * Cloud vendor region identifier. Present on succeeded items (the new value for + * upsert, the deleted value for delete). */ - export interface Failed { - /** - * The origin IP address for this item. - */ - 'origin-ip': string; - - /** - * Error message explaining why the item failed. Present only on failed items. - */ - error?: string; - - /** - * Cloud vendor region identifier. Present on succeeded items for patch operations. - */ - region?: string; - - /** - * Cloud vendor identifier. Present on succeeded items for patch operations. - */ - vendor?: string; - } + region?: string; /** - * Result for a single item in a batch operation. + * Cloud vendor identifier. Present on succeeded items (the new value for upsert, + * the deleted value for delete). */ - export interface Succeeded { - /** - * The origin IP address for this item. - */ - 'origin-ip': string; - - /** - * Error message explaining why the item failed. Present only on failed items. - */ - error?: string; - - /** - * Cloud vendor region identifier. Present on succeeded items for patch operations. - */ - region?: string; - - /** - * Cloud vendor identifier. Present on succeeded items for patch operations. - */ - vendor?: string; - } + vendor?: string; } -} - -/** - * Response result for a list of origin cloud region mappings. - */ -export interface OriginCloudRegionEditResponse { - id: 'origin_public_cloud_region'; /** - * Whether the setting can be modified by the current user. + * Result for a single item in a batch operation. */ - editable: boolean; - - value: Array; - - /** - * Time the mapping set was last modified. Null when no mappings exist. - */ - modified_on?: string | null; -} - -/** - * Response result for a single origin cloud region mapping. - */ -export interface OriginCloudRegionGetResponse { - id: 'origin_public_cloud_region'; + export interface Succeeded { + /** + * The origin IP address for this item. + */ + origin_ip: string; - /** - * Whether the setting can be modified by the current user. - */ - editable: boolean; + /** + * Error message explaining why the item failed. Present only on failed items. + */ + error?: string; - /** - * A single origin IP-to-cloud-region mapping. - */ - value: OriginCloudRegion; + /** + * Cloud vendor region identifier. Present on succeeded items (the new value for + * upsert, the deleted value for delete). + */ + region?: string; - /** - * Time the mapping was last modified. - */ - modified_on?: string; + /** + * Cloud vendor identifier. Present on succeeded items (the new value for upsert, + * the deleted value for delete). + */ + vendor?: string; + } } /** @@ -582,17 +439,19 @@ export namespace OriginCloudRegionSupportedRegionsResponse { } } -export interface OriginCloudRegionCreateParams { +export interface OriginCloudRegionUpdateParams { /** * Path param: Identifier. */ zone_id: string; /** - * Body param: Origin IP address (IPv4 or IPv6). Normalized to canonical form - * before storage (RFC 5952 for IPv6). + * Body param: Origin IP address (IPv4 or IPv6). For the single PUT endpoint + * (`PUT /origin/cloud_regions/{origin_ip}`), this field must match the path + * parameter or the request will be rejected with a 400 error. For the batch PUT + * endpoint, this field identifies which mapping to upsert. */ - ip: string; + origin_ip: string; /** * Body param: Cloud vendor region identifier. Must be a valid region for the @@ -607,9 +466,9 @@ export interface OriginCloudRegionCreateParams { vendor: 'aws' | 'azure' | 'gcp' | 'oci'; } -export interface OriginCloudRegionListParams { +export interface OriginCloudRegionListParams extends V4PagePaginationArrayParams { /** - * Identifier. + * Path param: Identifier. */ zone_id: string; } @@ -628,7 +487,7 @@ export interface OriginCloudRegionBulkDeleteParams { zone_id: string; } -export interface OriginCloudRegionBulkEditParams { +export interface OriginCloudRegionBulkUpdateParams { /** * Path param: Identifier. */ @@ -637,19 +496,21 @@ export interface OriginCloudRegionBulkEditParams { /** * Body param */ - body: Array; + body: Array; } -export namespace OriginCloudRegionBulkEditParams { +export namespace OriginCloudRegionBulkUpdateParams { /** - * Request body for creating or updating an origin cloud region mapping. + * Request body for creating or replacing an origin cloud region mapping. */ export interface Body { /** - * Origin IP address (IPv4 or IPv6). Normalized to canonical form before storage - * (RFC 5952 for IPv6). + * Origin IP address (IPv4 or IPv6). For the single PUT endpoint + * (`PUT /origin/cloud_regions/{origin_ip}`), this field must match the path + * parameter or the request will be rejected with a 400 error. For the batch PUT + * endpoint, this field identifies which mapping to upsert. */ - ip: string; + origin_ip: string; /** * Cloud vendor region identifier. Must be a valid region for the specified vendor @@ -664,31 +525,6 @@ export namespace OriginCloudRegionBulkEditParams { } } -export interface OriginCloudRegionEditParams { - /** - * Path param: Identifier. - */ - zone_id: string; - - /** - * Body param: Origin IP address (IPv4 or IPv6). Normalized to canonical form - * before storage (RFC 5952 for IPv6). - */ - ip: string; - - /** - * Body param: Cloud vendor region identifier. Must be a valid region for the - * specified vendor as returned by the supported_regions endpoint. - */ - region: string; - - /** - * Body param: Cloud vendor hosting the origin. Must be one of the supported - * vendors. - */ - vendor: 'aws' | 'azure' | 'gcp' | 'oci'; -} - export interface OriginCloudRegionGetParams { /** * Identifier. @@ -703,23 +539,21 @@ export interface OriginCloudRegionSupportedRegionsParams { zone_id: string; } +OriginCloudRegions.OriginCloudRegionsV4PagePaginationArray = OriginCloudRegionsV4PagePaginationArray; + export declare namespace OriginCloudRegions { export { type OriginCloudRegion as OriginCloudRegion, - type OriginCloudRegionCreateResponse as OriginCloudRegionCreateResponse, - type OriginCloudRegionListResponse as OriginCloudRegionListResponse, type OriginCloudRegionDeleteResponse as OriginCloudRegionDeleteResponse, type OriginCloudRegionBulkDeleteResponse as OriginCloudRegionBulkDeleteResponse, - type OriginCloudRegionBulkEditResponse as OriginCloudRegionBulkEditResponse, - type OriginCloudRegionEditResponse as OriginCloudRegionEditResponse, - type OriginCloudRegionGetResponse as OriginCloudRegionGetResponse, + type OriginCloudRegionBulkUpdateResponse as OriginCloudRegionBulkUpdateResponse, type OriginCloudRegionSupportedRegionsResponse as OriginCloudRegionSupportedRegionsResponse, - type OriginCloudRegionCreateParams as OriginCloudRegionCreateParams, + OriginCloudRegionsV4PagePaginationArray as OriginCloudRegionsV4PagePaginationArray, + type OriginCloudRegionUpdateParams as OriginCloudRegionUpdateParams, type OriginCloudRegionListParams as OriginCloudRegionListParams, type OriginCloudRegionDeleteParams as OriginCloudRegionDeleteParams, type OriginCloudRegionBulkDeleteParams as OriginCloudRegionBulkDeleteParams, - type OriginCloudRegionBulkEditParams as OriginCloudRegionBulkEditParams, - type OriginCloudRegionEditParams as OriginCloudRegionEditParams, + type OriginCloudRegionBulkUpdateParams as OriginCloudRegionBulkUpdateParams, type OriginCloudRegionGetParams as OriginCloudRegionGetParams, type OriginCloudRegionSupportedRegionsParams as OriginCloudRegionSupportedRegionsParams, }; diff --git a/src/resources/cache/smart-tiered-cache.ts b/src/resources/cache/smart-tiered-cache.ts index 0acc9f466a..b445aaad66 100644 --- a/src/resources/cache/smart-tiered-cache.ts +++ b/src/resources/cache/smart-tiered-cache.ts @@ -4,6 +4,36 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; export class SmartTieredCache extends APIResource { + /** + * Smart Tiered Cache dynamically selects the single closest upper tier for each of + * your website's origins with no configuration required, using our in-house + * performance and routing data. Cloudflare collects latency data for each request + * to an origin, and uses the latency data to determine how well any upper-tier + * data center is connected with an origin. As a result, Cloudflare can select the + * data center with the lowest latency to be the upper-tier for an origin. + * + * @example + * ```ts + * const smartTieredCache = + * await client.cache.smartTieredCache.create({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * value: 'on', + * }); + * ``` + */ + create( + params: SmartTieredCacheCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/cache/tiered_cache_smart_topology_enable`, { + body, + ...options, + }) as Core.APIPromise<{ result: SmartTieredCacheCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Smart Tiered Cache dynamically selects the single closest upper tier for each of * your website’s origins with no configuration required, using our in-house @@ -92,6 +122,28 @@ export class SmartTieredCache extends APIResource { } } +export interface SmartTieredCacheCreateResponse { + /** + * The identifier of the caching setting. + */ + id: 'tiered_cache_smart_topology_enable'; + + /** + * Whether the setting is editable. + */ + editable: boolean; + + /** + * Value of the Smart Tiered Cache zone setting. + */ + value: 'on' | 'off'; + + /** + * Last time this setting was modified. + */ + modified_on?: string | null; +} + export interface SmartTieredCacheDeleteResponse { /** * The identifier of the caching setting. @@ -153,6 +205,18 @@ export interface SmartTieredCacheGetResponse { modified_on?: string | null; } +export interface SmartTieredCacheCreateParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: Enable or disable the Smart Tiered Cache. + */ + value: 'on' | 'off'; +} + export interface SmartTieredCacheDeleteParams { /** * Identifier. @@ -181,9 +245,11 @@ export interface SmartTieredCacheGetParams { export declare namespace SmartTieredCache { export { + type SmartTieredCacheCreateResponse as SmartTieredCacheCreateResponse, type SmartTieredCacheDeleteResponse as SmartTieredCacheDeleteResponse, type SmartTieredCacheEditResponse as SmartTieredCacheEditResponse, type SmartTieredCacheGetResponse as SmartTieredCacheGetResponse, + type SmartTieredCacheCreateParams as SmartTieredCacheCreateParams, type SmartTieredCacheDeleteParams as SmartTieredCacheDeleteParams, type SmartTieredCacheEditParams as SmartTieredCacheEditParams, type SmartTieredCacheGetParams as SmartTieredCacheGetParams, diff --git a/src/resources/certificate-authorities/hostname-associations.ts b/src/resources/certificate-authorities/hostname-associations.ts index e4a320a684..b605397459 100644 --- a/src/resources/certificate-authorities/hostname-associations.ts +++ b/src/resources/certificate-authorities/hostname-associations.ts @@ -5,7 +5,7 @@ import * as Core from '../../core'; export class HostnameAssociations extends APIResource { /** - * Replace Hostname Associations + * Replace Hostname Associations. */ update( params: HostnameAssociationUpdateParams, @@ -21,7 +21,7 @@ export class HostnameAssociations extends APIResource { } /** - * List Hostname Associations + * List Hostname Associations. */ get( params: HostnameAssociationGetParams, diff --git a/src/resources/client-certificates/client-certificates.ts b/src/resources/client-certificates/client-certificates.ts index 0eff92ba97..d170335638 100644 --- a/src/resources/client-certificates/client-certificates.ts +++ b/src/resources/client-certificates/client-certificates.ts @@ -7,7 +7,7 @@ import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../p export class ClientCertificates extends APIResource { /** - * Create a new API Shield mTLS Client Certificate + * Create a new API Shield mTLS Client Certificate. * * @example * ```ts @@ -33,7 +33,7 @@ export class ClientCertificates extends APIResource { /** * List all of your Zone's API Shield mTLS Client Certificates by Status and/or - * using Pagination + * using Pagination. * * @example * ```ts @@ -112,7 +112,7 @@ export class ClientCertificates extends APIResource { } /** - * Get Details for a single mTLS API Shield Client Certificate + * Get Details for a single mTLS API Shield Client Certificate. * * @example * ```ts @@ -147,22 +147,22 @@ export interface ClientCertificate { id?: string; /** - * The Client Certificate PEM + * The Client Certificate PEM. */ certificate?: string; /** - * Certificate Authority used to issue the Client Certificate + * Certificate Authority used to issue the Client Certificate. */ certificate_authority?: ClientCertificate.CertificateAuthority; /** - * Common Name of the Client Certificate + * Common Name of the Client Certificate. */ common_name?: string; /** - * Country, provided by the CSR + * Country, provided by the CSR. */ country?: string; @@ -172,32 +172,32 @@ export interface ClientCertificate { csr?: string; /** - * Date that the Client Certificate expires + * Date that the Client Certificate expires. */ expires_on?: string; /** - * Unique identifier of the Client Certificate + * Unique identifier of the Client Certificate. */ fingerprint_sha256?: string; /** - * Date that the Client Certificate was issued by the Certificate Authority + * Date that the Client Certificate was issued by the Certificate Authority. */ issued_on?: string; /** - * Location, provided by the CSR + * Location, provided by the CSR. */ location?: string; /** - * Organization, provided by the CSR + * Organization, provided by the CSR. */ organization?: string; /** - * Organizational Unit, provided by the CSR + * Organizational Unit, provided by the CSR. */ organizational_unit?: string; @@ -212,30 +212,31 @@ export interface ClientCertificate { signature?: string; /** - * Subject Key Identifier + * Subject Key Identifier. */ ski?: string; /** - * State, provided by the CSR + * State, provided by the CSR. */ state?: string; /** * Client Certificates may be active or revoked, and the pending_reactivation or - * pending_revocation represent in-progress asynchronous transitions + * pending_revocation represent in-progress asynchronous transitions. */ status?: CustomCertificatesAPI.Status; /** - * The number of days the Client Certificate will be valid after the issued_on date + * The number of days the Client Certificate will be valid after the issued_on + * date. */ validity_days?: number; } export namespace ClientCertificate { /** - * Certificate Authority used to issue the Client Certificate + * Certificate Authority used to issue the Client Certificate. */ export interface CertificateAuthority { id?: string; @@ -257,7 +258,7 @@ export interface ClientCertificateCreateParams { /** * Body param: The number of days the Client Certificate will be valid after the - * issued_on date + * issued_on date. */ validity_days: number; } @@ -274,7 +275,7 @@ export interface ClientCertificateListParams extends V4PagePaginationArrayParams limit?: number; /** - * Query param: Offset the results + * Query param: Offset the results. */ offset?: number; diff --git a/src/resources/custom-certificates/custom-certificates.ts b/src/resources/custom-certificates/custom-certificates.ts index da07b19164..b492922d00 100644 --- a/src/resources/custom-certificates/custom-certificates.ts +++ b/src/resources/custom-certificates/custom-certificates.ts @@ -267,7 +267,7 @@ export interface GeoRestrictionsParam { /** * Client Certificates may be active or revoked, and the pending_reactivation or - * pending_revocation represent in-progress asynchronous transitions + * pending_revocation represent in-progress asynchronous transitions. */ export type Status = 'active' | 'pending_reactivation' | 'pending_revocation' | 'revoked'; @@ -303,7 +303,8 @@ export interface CustomCertificateCreateParams { custom_csr_id?: string; /** - * Body param: The environment to deploy the certificate to, defaults to production + * Body param: The environment to deploy the certificate to, defaults to + * production. */ deploy?: 'staging' | 'production'; @@ -396,7 +397,8 @@ export interface CustomCertificateEditParams { custom_csr_id?: string; /** - * Body param: The environment to deploy the certificate to, defaults to production + * Body param: The environment to deploy the certificate to, defaults to + * production. */ deploy?: 'staging' | 'production'; diff --git a/src/resources/custom-csrs.ts b/src/resources/custom-csrs.ts new file mode 100644 index 0000000000..08f649824d --- /dev/null +++ b/src/resources/custom-csrs.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './custom-csrs/index'; diff --git a/src/resources/custom-csrs/api.md b/src/resources/custom-csrs/api.md new file mode 100644 index 0000000000..7564b18006 --- /dev/null +++ b/src/resources/custom-csrs/api.md @@ -0,0 +1,16 @@ +# CustomCsrs + +Types: + +- CustomCsr +- CustomCsrCreateResponse +- CustomCsrListResponse +- CustomCsrDeleteResponse +- CustomCsrGetResponse + +Methods: + +- client.customCsrs.create({ ...params }) -> CustomCsrCreateResponse +- client.customCsrs.list({ ...params }) -> CustomCsrListResponsesV4PagePaginationArray +- client.customCsrs.delete(customCsrId, { ...params }) -> CustomCsrDeleteResponse +- client.customCsrs.get(customCsrId, { ...params }) -> CustomCsrGetResponse diff --git a/src/resources/custom-csrs/custom-csrs.ts b/src/resources/custom-csrs/custom-csrs.ts new file mode 100644 index 0000000000..6e42ce9a7e --- /dev/null +++ b/src/resources/custom-csrs/custom-csrs.ts @@ -0,0 +1,622 @@ +// 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 { CloudflareError } from '../../error'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; + +export class CustomCsrs extends APIResource { + /** + * Generate a new custom Certificate Signing Request (CSR) for an account or zone. + * Cloudflare generates and securely stores the private key associated with the + * CSR. + * + * @example + * ```ts + * const customCsr = await client.customCsrs.create({ + * common_name: 'example.com', + * country: 'US', + * locality: 'San Francisco', + * organization: 'Cloudflare, Inc.', + * sans: ['example.com', 'www.example.com'], + * state: 'California', + * account_id: 'account_id', + * }); + * ``` + */ + create( + params: CustomCsrCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; + if (!account_id && !zone_id) { + throw new CloudflareError('You must provide either account_id or zone_id.'); + } + if (account_id && zone_id) { + throw new CloudflareError('You cannot provide both account_id and zone_id.'); + } + const { accountOrZone, accountOrZoneId } = + account_id ? + { + accountOrZone: 'accounts', + accountOrZoneId: account_id, + } + : { + accountOrZone: 'zones', + accountOrZoneId: zone_id, + }; + return ( + this._client.post(`/${accountOrZone}/${accountOrZoneId}/custom_csrs`, { + body, + ...options, + }) as Core.APIPromise<{ result: CustomCsrCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List all custom Certificate Signing Requests (CSRs) for an account or zone. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const customCsrListResponse of client.customCsrs.list( + * { account_id: 'account_id' }, + * )) { + * // ... + * } + * ``` + */ + list( + params?: CustomCsrListParams, + options?: Core.RequestOptions, + ): Core.PagePromise; + list( + options?: Core.RequestOptions, + ): Core.PagePromise; + list( + params: CustomCsrListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.PagePromise { + if (isRequestOptions(params)) { + return this.list({}, params); + } + const { account_id, zone_id, ...query } = params; + if (!account_id && !zone_id) { + throw new CloudflareError('You must provide either account_id or zone_id.'); + } + if (account_id && zone_id) { + throw new CloudflareError('You cannot provide both account_id and zone_id.'); + } + const { accountOrZone, accountOrZoneId } = + account_id ? + { + accountOrZone: 'accounts', + accountOrZoneId: account_id, + } + : { + accountOrZone: 'zones', + accountOrZoneId: zone_id, + }; + return this._client.getAPIList( + `/${accountOrZone}/${accountOrZoneId}/custom_csrs`, + CustomCsrListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Delete a custom Certificate Signing Request (CSR) and its associated private + * key. + * + * @example + * ```ts + * const customCsr = await client.customCsrs.delete( + * '7b163417-1d2b-4c84-a38a-2fb7a0cd7752', + * { account_id: 'account_id' }, + * ); + * ``` + */ + delete( + customCsrId: string, + params?: CustomCsrDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + delete(customCsrId: string, options?: Core.RequestOptions): Core.APIPromise; + delete( + customCsrId: string, + params: CustomCsrDeleteParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(params)) { + return this.delete(customCsrId, {}, params); + } + const { account_id, zone_id } = params; + if (!account_id && !zone_id) { + throw new CloudflareError('You must provide either account_id or zone_id.'); + } + if (account_id && zone_id) { + throw new CloudflareError('You cannot provide both account_id and zone_id.'); + } + const { accountOrZone, accountOrZoneId } = + account_id ? + { + accountOrZone: 'accounts', + accountOrZoneId: account_id, + } + : { + accountOrZone: 'zones', + accountOrZoneId: zone_id, + }; + return ( + this._client.delete( + `/${accountOrZone}/${accountOrZoneId}/custom_csrs/${customCsrId}`, + options, + ) as Core.APIPromise<{ result: CustomCsrDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieve details for a specific custom Certificate Signing Request (CSR). + * + * @example + * ```ts + * const customCsr = await client.customCsrs.get( + * '7b163417-1d2b-4c84-a38a-2fb7a0cd7752', + * { account_id: 'account_id' }, + * ); + * ``` + */ + get( + customCsrId: string, + params?: CustomCsrGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(customCsrId: string, options?: Core.RequestOptions): Core.APIPromise; + get( + customCsrId: string, + params: CustomCsrGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(params)) { + return this.get(customCsrId, {}, params); + } + const { account_id, zone_id } = params; + if (!account_id && !zone_id) { + throw new CloudflareError('You must provide either account_id or zone_id.'); + } + if (account_id && zone_id) { + throw new CloudflareError('You cannot provide both account_id and zone_id.'); + } + const { accountOrZone, accountOrZoneId } = + account_id ? + { + accountOrZone: 'accounts', + accountOrZoneId: account_id, + } + : { + accountOrZone: 'zones', + accountOrZoneId: zone_id, + }; + return ( + this._client.get( + `/${accountOrZone}/${accountOrZoneId}/custom_csrs/${customCsrId}`, + options, + ) as Core.APIPromise<{ result: CustomCsrGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class CustomCsrListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +/** + * A custom Certificate Signing Request (CSR). + */ +export interface CustomCsr { + /** + * Custom CSR identifier tag. + */ + id: string; + + /** + * When the CSR was created. + */ + created_at: string; + + /** + * The key algorithm used to generate the CSR. + */ + key_type: 'rsa2048' | 'p256v1'; + + /** + * The common name (domain) for the CSR. + */ + common_name?: string; + + /** + * Two-letter ISO 3166-1 alpha-2 country code. + */ + country?: string; + + /** + * The PEM-encoded Certificate Signing Request. + */ + csr?: string; + + /** + * City or locality name. + */ + locality?: string; + + /** + * Organization name. + */ + organization?: string; + + /** + * Organizational unit for the CSR subject. + */ + organizational_unit?: string; + + /** + * Subject Alternative Names included in the CSR. + */ + sans?: Array; + + /** + * State or province name. + */ + state?: string; +} + +/** + * A custom Certificate Signing Request (CSR). + */ +export interface CustomCsrCreateResponse { + /** + * Custom CSR identifier tag. + */ + id: string; + + /** + * When the CSR was created. + */ + created_at: string; + + /** + * The key algorithm used to generate the CSR. + */ + key_type: 'rsa2048' | 'p256v1'; + + /** + * Account identifier associated with this CSR. + */ + account_tag?: string; + + /** + * The common name (domain) for the CSR. + */ + common_name?: string; + + /** + * Two-letter ISO 3166-1 alpha-2 country code. + */ + country?: string; + + /** + * The PEM-encoded Certificate Signing Request. + */ + csr?: string; + + /** + * Optional description for the CSR. + */ + description?: string; + + /** + * City or locality name. + */ + locality?: string; + + /** + * Human-readable name for the CSR. + */ + name?: string; + + /** + * Organization name. + */ + organization?: string; + + /** + * Organizational unit name. + */ + organizational_unit?: string; + + /** + * Subject Alternative Names included in the CSR. + */ + sans?: Array; + + /** + * State or province name. + */ + state?: string; +} + +/** + * A custom Certificate Signing Request (CSR). + */ +export interface CustomCsrListResponse { + /** + * Custom CSR identifier tag. + */ + id: string; + + /** + * When the CSR was created. + */ + created_at: string; + + /** + * The key algorithm used to generate the CSR. + */ + key_type: 'rsa2048' | 'p256v1'; + + /** + * Account identifier associated with this CSR. + */ + account_tag?: string; + + /** + * The common name (domain) for the CSR. + */ + common_name?: string; + + /** + * Two-letter ISO 3166-1 alpha-2 country code. + */ + country?: string; + + /** + * The PEM-encoded Certificate Signing Request. + */ + csr?: string; + + /** + * Optional description for the CSR. + */ + description?: string; + + /** + * City or locality name. + */ + locality?: string; + + /** + * Human-readable name for the CSR. + */ + name?: string; + + /** + * Organization name. + */ + organization?: string; + + /** + * Organizational unit name. + */ + organizational_unit?: string; + + /** + * Subject Alternative Names included in the CSR. + */ + sans?: Array; + + /** + * State or province name. + */ + state?: string; +} + +export interface CustomCsrDeleteResponse { + /** + * Custom CSR identifier tag. + */ + id?: string; +} + +/** + * A custom Certificate Signing Request (CSR). + */ +export interface CustomCsrGetResponse { + /** + * Custom CSR identifier tag. + */ + id: string; + + /** + * When the CSR was created. + */ + created_at: string; + + /** + * The key algorithm used to generate the CSR. + */ + key_type: 'rsa2048' | 'p256v1'; + + /** + * Account identifier associated with this CSR. + */ + account_tag?: string; + + /** + * The common name (domain) for the CSR. + */ + common_name?: string; + + /** + * Two-letter ISO 3166-1 alpha-2 country code. + */ + country?: string; + + /** + * The PEM-encoded Certificate Signing Request. + */ + csr?: string; + + /** + * Optional description for the CSR. + */ + description?: string; + + /** + * City or locality name. + */ + locality?: string; + + /** + * Human-readable name for the CSR. + */ + name?: string; + + /** + * Organization name. + */ + organization?: string; + + /** + * Organizational unit name. + */ + organizational_unit?: string; + + /** + * Subject Alternative Names included in the CSR. + */ + sans?: Array; + + /** + * State or province name. + */ + state?: string; +} + +export interface CustomCsrCreateParams { + /** + * Body param: The common name (domain) for the CSR. Must be at most 64 characters. + */ + common_name: string; + + /** + * Body param: Two-letter ISO 3166-1 alpha-2 country code. + */ + country: string; + + /** + * Body param: City or locality name. + */ + locality: string; + + /** + * Body param: Organization name. + */ + organization: string; + + /** + * Body param: Subject Alternative Names for the CSR. At least one SAN is required. + */ + sans: Array; + + /** + * Body param: State or province name. + */ + state: string; + + /** + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id?: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id?: string; + + /** + * Body param: Optional description for the CSR. + */ + description?: string; + + /** + * Body param: Key algorithm to use for the CSR. Defaults to rsa2048 if not + * specified. + */ + key_type?: 'rsa2048' | 'p256v1'; + + /** + * Body param: Human-readable name for the CSR. + */ + name?: string; + + /** + * Body param: Organizational unit name. + */ + organizational_unit?: string; +} + +export interface CustomCsrListParams extends V4PagePaginationArrayParams { + /** + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id?: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id?: string; +} + +export interface CustomCsrDeleteParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id?: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id?: string; +} + +export interface CustomCsrGetParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id?: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id?: string; +} + +CustomCsrs.CustomCsrListResponsesV4PagePaginationArray = CustomCsrListResponsesV4PagePaginationArray; + +export declare namespace CustomCsrs { + export { + type CustomCsr as CustomCsr, + type CustomCsrCreateResponse as CustomCsrCreateResponse, + type CustomCsrListResponse as CustomCsrListResponse, + type CustomCsrDeleteResponse as CustomCsrDeleteResponse, + type CustomCsrGetResponse as CustomCsrGetResponse, + CustomCsrListResponsesV4PagePaginationArray as CustomCsrListResponsesV4PagePaginationArray, + type CustomCsrCreateParams as CustomCsrCreateParams, + type CustomCsrListParams as CustomCsrListParams, + type CustomCsrDeleteParams as CustomCsrDeleteParams, + type CustomCsrGetParams as CustomCsrGetParams, + }; +} diff --git a/src/resources/custom-csrs/index.ts b/src/resources/custom-csrs/index.ts new file mode 100644 index 0000000000..05ea71aa8b --- /dev/null +++ b/src/resources/custom-csrs/index.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { CustomCsrs } from './custom-csrs'; diff --git a/src/resources/custom-hostnames/certificate-pack/certificates.ts b/src/resources/custom-hostnames/certificate-pack/certificates.ts index d53ac3a94f..82b6138769 100644 --- a/src/resources/custom-hostnames/certificate-pack/certificates.ts +++ b/src/resources/custom-hostnames/certificate-pack/certificates.ts @@ -207,7 +207,7 @@ export namespace CertificateUpdateResponse { bundle_method?: CustomHostnamesAPI.BundleMethod; /** - * The Certificate Authority that will issue the certificate + * The Certificate Authority that will issue the certificate. */ certificate_authority?: Shared.CertificateCA; diff --git a/src/resources/custom-hostnames/custom-hostnames.ts b/src/resources/custom-hostnames/custom-hostnames.ts index e9d212a262..a4f6d81db5 100644 --- a/src/resources/custom-hostnames/custom-hostnames.ts +++ b/src/resources/custom-hostnames/custom-hostnames.ts @@ -305,7 +305,7 @@ export namespace CustomHostname { bundle_method?: CustomHostnamesAPI.BundleMethod; /** - * The Certificate Authority that will issue the certificate + * The Certificate Authority that will issue the certificate. */ certificate_authority?: Shared.CertificateCA; @@ -694,7 +694,7 @@ export namespace CustomHostnameCreateResponse { bundle_method?: CustomHostnamesAPI.BundleMethod; /** - * The Certificate Authority that will issue the certificate + * The Certificate Authority that will issue the certificate. */ certificate_authority?: Shared.CertificateCA; @@ -1061,7 +1061,7 @@ export namespace CustomHostnameListResponse { bundle_method?: CustomHostnamesAPI.BundleMethod; /** - * The Certificate Authority that will issue the certificate + * The Certificate Authority that will issue the certificate. */ certificate_authority?: Shared.CertificateCA; @@ -1435,7 +1435,7 @@ export namespace CustomHostnameEditResponse { bundle_method?: CustomHostnamesAPI.BundleMethod; /** - * The Certificate Authority that will issue the certificate + * The Certificate Authority that will issue the certificate. */ certificate_authority?: Shared.CertificateCA; @@ -1802,7 +1802,7 @@ export namespace CustomHostnameGetResponse { bundle_method?: CustomHostnamesAPI.BundleMethod; /** - * The Certificate Authority that will issue the certificate + * The Certificate Authority that will issue the certificate. */ certificate_authority?: Shared.CertificateCA; @@ -2076,18 +2076,18 @@ export namespace CustomHostnameCreateParams { bundle_method?: CustomHostnamesAPI.BundleMethodParam; /** - * The Certificate Authority that will issue the certificate + * The Certificate Authority that will issue the certificate. */ certificate_authority?: Shared.CertificateCAParam; /** * Whether or not to add Cloudflare Branding for the order. This will add a - * subdomain of sni.cloudflaressl.com as the Common Name if set to true + * subdomain of sni.cloudflaressl.com as the Common Name if set to true. */ cloudflare_branding?: boolean; /** - * Array of custom certificate and key pairs (1 or 2 pairs allowed) + * Array of custom certificate and key pairs (1 or 2 pairs allowed). */ custom_cert_bundle?: Array; @@ -2335,18 +2335,18 @@ export namespace CustomHostnameEditParams { bundle_method?: CustomHostnamesAPI.BundleMethodParam; /** - * The Certificate Authority that will issue the certificate + * The Certificate Authority that will issue the certificate. */ certificate_authority?: Shared.CertificateCAParam; /** * Whether or not to add Cloudflare Branding for the order. This will add a - * subdomain of sni.cloudflaressl.com as the Common Name if set to true + * subdomain of sni.cloudflaressl.com as the Common Name if set to true. */ cloudflare_branding?: boolean; /** - * Array of custom certificate and key pairs (1 or 2 pairs allowed) + * Array of custom certificate and key pairs (1 or 2 pairs allowed). */ custom_cert_bundle?: Array; diff --git a/src/resources/dls/regional-services/prefix-bindings.ts b/src/resources/dls/regional-services/prefix-bindings.ts index 4b2b3335fb..1fee2c2539 100644 --- a/src/resources/dls/regional-services/prefix-bindings.ts +++ b/src/resources/dls/regional-services/prefix-bindings.ts @@ -13,7 +13,7 @@ export class PrefixBindings extends APIResource { * ```ts * const prefixBinding = * await client.dls.regionalServices.prefixBindings.create({ - * account_id: 0, + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * cidr: '10.0.1.0/24', * prefix_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', * region_key: 'eu', @@ -40,7 +40,7 @@ export class PrefixBindings extends APIResource { * ```ts * // Automatically fetches more pages as needed. * for await (const prefixBindingListResponse of client.dls.regionalServices.prefixBindings.list( - * { account_id: 0 }, + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * )) { * // ... * } @@ -66,7 +66,7 @@ export class PrefixBindings extends APIResource { * const prefixBinding = * await client.dls.regionalServices.prefixBindings.delete( * 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', - * { account_id: 0 }, + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ @@ -90,7 +90,10 @@ export class PrefixBindings extends APIResource { * const response = * await client.dls.regionalServices.prefixBindings.edit( * 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', - * { account_id: 0, region_key: 'eu' }, + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * region_key: 'eu', + * }, * ); * ``` */ @@ -116,7 +119,7 @@ export class PrefixBindings extends APIResource { * const prefixBinding = * await client.dls.regionalServices.prefixBindings.get( * 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', - * { account_id: 0 }, + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ @@ -235,9 +238,9 @@ export interface PrefixBindingGetResponse { export interface PrefixBindingCreateParams { /** - * Path param + * Path param: Identifier of a Cloudflare account. */ - account_id: number; + account_id: string; /** * Body param: IP prefix in CIDR notation to bind. @@ -257,20 +260,23 @@ export interface PrefixBindingCreateParams { export interface PrefixBindingListParams extends CursorPaginationParams { /** - * Path param + * Path param: Identifier of a Cloudflare account. */ - account_id: number; + account_id: string; } export interface PrefixBindingDeleteParams { - account_id: number; + /** + * Identifier of a Cloudflare account. + */ + account_id: string; } export interface PrefixBindingEditParams { /** - * Path param + * Path param: Identifier of a Cloudflare account. */ - account_id: number; + account_id: string; /** * Body param: New region key to assign (e.g., "us", "eu", "cfcanary"). @@ -279,7 +285,10 @@ export interface PrefixBindingEditParams { } export interface PrefixBindingGetParams { - account_id: number; + /** + * Identifier of a Cloudflare account. + */ + account_id: string; } PrefixBindings.PrefixBindingListResponsesCursorPagination = PrefixBindingListResponsesCursorPagination; diff --git a/src/resources/dls/regions.ts b/src/resources/dls/regions.ts index 75568c47cc..4c51973a9f 100644 --- a/src/resources/dls/regions.ts +++ b/src/resources/dls/regions.ts @@ -12,7 +12,7 @@ export class Regions extends APIResource { * ```ts * // Automatically fetches more pages as needed. * for await (const regionListResponse of client.dls.regions.list( - * { account_id: 0 }, + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * )) { * // ... * } @@ -37,7 +37,7 @@ export class Regions extends APIResource { * ```ts * const region = await client.dls.regions.get( * 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', - * { account_id: 0 }, + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ @@ -91,9 +91,9 @@ export interface RegionGetResponse { export interface RegionListParams extends CursorPaginationParams { /** - * Path param + * Path param: Identifier of a Cloudflare account. */ - account_id: number; + account_id: string; /** * Query param: Filter regions by type. Omit to return all regions. @@ -102,7 +102,10 @@ export interface RegionListParams extends CursorPaginationParams { } export interface RegionGetParams { - account_id: number; + /** + * Identifier of a Cloudflare account. + */ + account_id: string; } Regions.RegionListResponsesCursorPagination = RegionListResponsesCursorPagination; diff --git a/src/resources/email-security/api.md b/src/resources/email-security/api.md index a4b64fb1ab..a881cbbbfd 100644 --- a/src/resources/email-security/api.md +++ b/src/resources/email-security/api.md @@ -170,6 +170,24 @@ Methods: - client.emailSecurity.settings.impersonationRegistry.edit(impersonationRegistryId, { ...params }) -> ImpersonationRegistryEditResponse - client.emailSecurity.settings.impersonationRegistry.get(impersonationRegistryId, { ...params }) -> ImpersonationRegistryGetResponse +### SendingDomainRestrictions + +Types: + +- SendingDomainRestrictionCreateResponse +- SendingDomainRestrictionListResponse +- SendingDomainRestrictionDeleteResponse +- SendingDomainRestrictionEditResponse +- SendingDomainRestrictionGetResponse + +Methods: + +- client.emailSecurity.settings.sendingDomainRestrictions.create({ ...params }) -> SendingDomainRestrictionCreateResponse +- client.emailSecurity.settings.sendingDomainRestrictions.list({ ...params }) -> SendingDomainRestrictionListResponsesV4PagePaginationArray +- client.emailSecurity.settings.sendingDomainRestrictions.delete(sendingDomainRestrictionId, { ...params }) -> SendingDomainRestrictionDeleteResponse +- client.emailSecurity.settings.sendingDomainRestrictions.edit(sendingDomainRestrictionId, { ...params }) -> SendingDomainRestrictionEditResponse +- client.emailSecurity.settings.sendingDomainRestrictions.get(sendingDomainRestrictionId, { ...params }) -> SendingDomainRestrictionGetResponse + ### TrustedDomains Types: @@ -188,6 +206,24 @@ Methods: - client.emailSecurity.settings.trustedDomains.edit(trustedDomainId, { ...params }) -> TrustedDomainEditResponse - client.emailSecurity.settings.trustedDomains.get(trustedDomainId, { ...params }) -> TrustedDomainGetResponse +### URLIgnorePatterns + +Types: + +- URLIgnorePatternCreateResponse +- URLIgnorePatternListResponse +- URLIgnorePatternDeleteResponse +- URLIgnorePatternEditResponse +- URLIgnorePatternGetResponse + +Methods: + +- client.emailSecurity.settings.urlIgnorePatterns.create({ ...params }) -> URLIgnorePatternCreateResponse +- client.emailSecurity.settings.urlIgnorePatterns.list({ ...params }) -> URLIgnorePatternListResponsesV4PagePaginationArray +- client.emailSecurity.settings.urlIgnorePatterns.delete(patternId, { ...params }) -> URLIgnorePatternDeleteResponse +- client.emailSecurity.settings.urlIgnorePatterns.edit(patternId, { ...params }) -> URLIgnorePatternEditResponse +- client.emailSecurity.settings.urlIgnorePatterns.get(patternId, { ...params }) -> URLIgnorePatternGetResponse + ## Submissions Types: diff --git a/src/resources/email-security/investigate/investigate.ts b/src/resources/email-security/investigate/investigate.ts index ed8cf1df14..0360022d24 100644 --- a/src/resources/email-security/investigate/investigate.ts +++ b/src/resources/email-security/investigate/investigate.ts @@ -623,11 +623,6 @@ export interface InvestigateListParams extends V4PagePaginationArrayParams { */ account_id: string; - /** - * Query param: Whether to include the message action log in the response. - */ - action_log?: boolean; - /** * Query param */ diff --git a/src/resources/email-security/settings/index.ts b/src/resources/email-security/settings/index.ts index dd2b2b15e5..39106c7e79 100644 --- a/src/resources/email-security/settings/index.ts +++ b/src/resources/email-security/settings/index.ts @@ -54,6 +54,20 @@ export { type ImpersonationRegistryEditParams, type ImpersonationRegistryGetParams, } from './impersonation-registry'; +export { + SendingDomainRestrictionListResponsesV4PagePaginationArray, + SendingDomainRestrictions, + type SendingDomainRestrictionCreateResponse, + type SendingDomainRestrictionListResponse, + type SendingDomainRestrictionDeleteResponse, + type SendingDomainRestrictionEditResponse, + type SendingDomainRestrictionGetResponse, + type SendingDomainRestrictionCreateParams, + type SendingDomainRestrictionListParams, + type SendingDomainRestrictionDeleteParams, + type SendingDomainRestrictionEditParams, + type SendingDomainRestrictionGetParams, +} from './sending-domain-restrictions'; export { Settings } from './settings'; export { TrustedDomainListResponsesV4PagePaginationArray, @@ -69,3 +83,17 @@ export { type TrustedDomainEditParams, type TrustedDomainGetParams, } from './trusted-domains'; +export { + URLIgnorePatternListResponsesV4PagePaginationArray, + URLIgnorePatterns, + type URLIgnorePatternCreateResponse, + type URLIgnorePatternListResponse, + type URLIgnorePatternDeleteResponse, + type URLIgnorePatternEditResponse, + type URLIgnorePatternGetResponse, + type URLIgnorePatternCreateParams, + type URLIgnorePatternListParams, + type URLIgnorePatternDeleteParams, + type URLIgnorePatternEditParams, + type URLIgnorePatternGetParams, +} from './url-ignore-patterns'; diff --git a/src/resources/email-security/settings/sending-domain-restrictions.ts b/src/resources/email-security/settings/sending-domain-restrictions.ts new file mode 100644 index 0000000000..edf70f7804 --- /dev/null +++ b/src/resources/email-security/settings/sending-domain-restrictions.ts @@ -0,0 +1,394 @@ +// 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 SendingDomainRestrictions extends APIResource { + /** + * Creates a new sending domain restriction to enforce TLS requirements for a + * domain. Emails without TLS from this domain will be dropped unless the subdomain + * is in the exclude list. + * + * @example + * ```ts + * const sendingDomainRestriction = + * await client.emailSecurity.settings.sendingDomainRestrictions.create( + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * domain: 'example.com', + * exclude: ['subdomain.example.com'], + * }, + * ); + * ``` + */ + create( + params: SendingDomainRestrictionCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/email-security/settings/sending_domain_restrictions`, { + body, + ...options, + }) as Core.APIPromise<{ result: SendingDomainRestrictionCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Returns a paginated list of sending domain restrictions. These restrictions + * enforce TLS requirements for emails from specific domains. Mail without TLS from + * restricted domains will be dropped unless the subdomain is in the exclude list. + * Supports sorting and searching. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const sendingDomainRestrictionListResponse of client.emailSecurity.settings.sendingDomainRestrictions.list( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: SendingDomainRestrictionListParams, + options?: Core.RequestOptions, + ): Core.PagePromise< + SendingDomainRestrictionListResponsesV4PagePaginationArray, + SendingDomainRestrictionListResponse + > { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/email-security/settings/sending_domain_restrictions`, + SendingDomainRestrictionListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Removes a sending domain restriction. After deletion, TLS will no longer be + * enforced for emails from this domain. + * + * @example + * ```ts + * const sendingDomainRestriction = + * await client.emailSecurity.settings.sendingDomainRestrictions.delete( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + sendingDomainRestrictionId: string, + params: SendingDomainRestrictionDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete( + `/accounts/${account_id}/email-security/settings/sending_domain_restrictions/${sendingDomainRestrictionId}`, + options, + ) as Core.APIPromise<{ result: SendingDomainRestrictionDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Updates an existing sending domain restriction. Only provided fields will be + * modified. Changes affect which domains require TLS and which subdomains are + * excluded. + * + * @example + * ```ts + * const response = + * await client.emailSecurity.settings.sendingDomainRestrictions.edit( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + edit( + sendingDomainRestrictionId: string, + params: SendingDomainRestrictionEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.patch( + `/accounts/${account_id}/email-security/settings/sending_domain_restrictions/${sendingDomainRestrictionId}`, + { body, ...options }, + ) as Core.APIPromise<{ result: SendingDomainRestrictionEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves details for a specific sending domain restriction including the domain + * requiring TLS and any excluded subdomains exempt from the TLS requirement. + * + * @example + * ```ts + * const sendingDomainRestriction = + * await client.emailSecurity.settings.sendingDomainRestrictions.get( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + sendingDomainRestrictionId: string, + params: SendingDomainRestrictionGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/email-security/settings/sending_domain_restrictions/${sendingDomainRestrictionId}`, + options, + ) as Core.APIPromise<{ result: SendingDomainRestrictionGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class SendingDomainRestrictionListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +/** + * A sending domain restriction that enforces TLS (Transport Layer Security) + * requirements for emails from specific domains. If TLS is required, mail without + * TLS from the specified domain will be dropped. + */ +export interface SendingDomainRestrictionCreateResponse { + /** + * Sending domain restriction identifier. + */ + id?: string; + + comments?: string | null; + + created_at?: string; + + /** + * Domain that requires TLS enforcement. + */ + domain?: string; + + /** + * Excluded subdomains that are exempt from TLS requirements. + */ + exclude?: Array; + + /** + * @deprecated Deprecated, use `modified_at` instead. End of life: November + * 1, 2026. + */ + last_modified?: string; + + modified_at?: string; +} + +/** + * A sending domain restriction that enforces TLS (Transport Layer Security) + * requirements for emails from specific domains. If TLS is required, mail without + * TLS from the specified domain will be dropped. + */ +export interface SendingDomainRestrictionListResponse { + /** + * Sending domain restriction identifier. + */ + id?: string; + + comments?: string | null; + + created_at?: string; + + /** + * Domain that requires TLS enforcement. + */ + domain?: string; + + /** + * Excluded subdomains that are exempt from TLS requirements. + */ + exclude?: Array; + + /** + * @deprecated Deprecated, use `modified_at` instead. End of life: November + * 1, 2026. + */ + last_modified?: string; + + modified_at?: string; +} + +export interface SendingDomainRestrictionDeleteResponse { + /** + * Sending domain restriction identifier. + */ + id: string; +} + +/** + * A sending domain restriction that enforces TLS (Transport Layer Security) + * requirements for emails from specific domains. If TLS is required, mail without + * TLS from the specified domain will be dropped. + */ +export interface SendingDomainRestrictionEditResponse { + /** + * Sending domain restriction identifier. + */ + id?: string; + + comments?: string | null; + + created_at?: string; + + /** + * Domain that requires TLS enforcement. + */ + domain?: string; + + /** + * Excluded subdomains that are exempt from TLS requirements. + */ + exclude?: Array; + + /** + * @deprecated Deprecated, use `modified_at` instead. End of life: November + * 1, 2026. + */ + last_modified?: string; + + modified_at?: string; +} + +/** + * A sending domain restriction that enforces TLS (Transport Layer Security) + * requirements for emails from specific domains. If TLS is required, mail without + * TLS from the specified domain will be dropped. + */ +export interface SendingDomainRestrictionGetResponse { + /** + * Sending domain restriction identifier. + */ + id?: string; + + comments?: string | null; + + created_at?: string; + + /** + * Domain that requires TLS enforcement. + */ + domain?: string; + + /** + * Excluded subdomains that are exempt from TLS requirements. + */ + exclude?: Array; + + /** + * @deprecated Deprecated, use `modified_at` instead. End of life: November + * 1, 2026. + */ + last_modified?: string; + + modified_at?: string; +} + +export interface SendingDomainRestrictionCreateParams { + /** + * Path param: Identifier. + */ + account_id: string; + + /** + * Body param: Domain that requires TLS enforcement. + */ + domain: string; + + /** + * Body param: Excluded subdomains that are exempt from TLS requirements. + */ + exclude: Array; + + /** + * Body param + */ + comments?: string | null; +} + +export interface SendingDomainRestrictionListParams extends V4PagePaginationArrayParams { + /** + * Path param: Identifier. + */ + account_id: string; + + /** + * Query param: The sorting direction. + */ + direction?: 'asc' | 'desc'; + + /** + * Query param: Field to sort by. + */ + order?: 'domain' | 'created_at'; + + /** + * Query param: Search term for filtering records. Behavior may change. + */ + search?: string; +} + +export interface SendingDomainRestrictionDeleteParams { + /** + * Identifier. + */ + account_id: string; +} + +export interface SendingDomainRestrictionEditParams { + /** + * Path param: Identifier. + */ + account_id: string; + + /** + * Body param + */ + comments?: string | null; + + /** + * Body param: Domain that requires TLS enforcement. + */ + domain?: string; + + /** + * Body param: Excluded subdomains that are exempt from TLS requirements. + */ + exclude?: Array; +} + +export interface SendingDomainRestrictionGetParams { + /** + * Identifier. + */ + account_id: string; +} + +SendingDomainRestrictions.SendingDomainRestrictionListResponsesV4PagePaginationArray = + SendingDomainRestrictionListResponsesV4PagePaginationArray; + +export declare namespace SendingDomainRestrictions { + export { + type SendingDomainRestrictionCreateResponse as SendingDomainRestrictionCreateResponse, + type SendingDomainRestrictionListResponse as SendingDomainRestrictionListResponse, + type SendingDomainRestrictionDeleteResponse as SendingDomainRestrictionDeleteResponse, + type SendingDomainRestrictionEditResponse as SendingDomainRestrictionEditResponse, + type SendingDomainRestrictionGetResponse as SendingDomainRestrictionGetResponse, + SendingDomainRestrictionListResponsesV4PagePaginationArray as SendingDomainRestrictionListResponsesV4PagePaginationArray, + type SendingDomainRestrictionCreateParams as SendingDomainRestrictionCreateParams, + type SendingDomainRestrictionListParams as SendingDomainRestrictionListParams, + type SendingDomainRestrictionDeleteParams as SendingDomainRestrictionDeleteParams, + type SendingDomainRestrictionEditParams as SendingDomainRestrictionEditParams, + type SendingDomainRestrictionGetParams as SendingDomainRestrictionGetParams, + }; +} diff --git a/src/resources/email-security/settings/settings.ts b/src/resources/email-security/settings/settings.ts index 636c111b0b..7ea3cc4123 100644 --- a/src/resources/email-security/settings/settings.ts +++ b/src/resources/email-security/settings/settings.ts @@ -59,6 +59,21 @@ import { ImpersonationRegistryListResponse, ImpersonationRegistryListResponsesV4PagePaginationArray, } from './impersonation-registry'; +import * as SendingDomainRestrictionsAPI from './sending-domain-restrictions'; +import { + SendingDomainRestrictionCreateParams, + SendingDomainRestrictionCreateResponse, + SendingDomainRestrictionDeleteParams, + SendingDomainRestrictionDeleteResponse, + SendingDomainRestrictionEditParams, + SendingDomainRestrictionEditResponse, + SendingDomainRestrictionGetParams, + SendingDomainRestrictionGetResponse, + SendingDomainRestrictionListParams, + SendingDomainRestrictionListResponse, + SendingDomainRestrictionListResponsesV4PagePaginationArray, + SendingDomainRestrictions, +} from './sending-domain-restrictions'; import * as TrustedDomainsAPI from './trusted-domains'; import { TrustedDomainCreateParams, @@ -74,6 +89,21 @@ import { TrustedDomainListResponsesV4PagePaginationArray, TrustedDomains, } from './trusted-domains'; +import * as URLIgnorePatternsAPI from './url-ignore-patterns'; +import { + URLIgnorePatternCreateParams, + URLIgnorePatternCreateResponse, + URLIgnorePatternDeleteParams, + URLIgnorePatternDeleteResponse, + URLIgnorePatternEditParams, + URLIgnorePatternEditResponse, + URLIgnorePatternGetParams, + URLIgnorePatternGetResponse, + URLIgnorePatternListParams, + URLIgnorePatternListResponse, + URLIgnorePatternListResponsesV4PagePaginationArray, + URLIgnorePatterns, +} from './url-ignore-patterns'; export class Settings extends APIResource { allowPolicies: AllowPoliciesAPI.AllowPolicies = new AllowPoliciesAPI.AllowPolicies(this._client); @@ -81,7 +111,12 @@ export class Settings extends APIResource { domains: DomainsAPI.Domains = new DomainsAPI.Domains(this._client); impersonationRegistry: ImpersonationRegistryAPI.ImpersonationRegistry = new ImpersonationRegistryAPI.ImpersonationRegistry(this._client); + sendingDomainRestrictions: SendingDomainRestrictionsAPI.SendingDomainRestrictions = + new SendingDomainRestrictionsAPI.SendingDomainRestrictions(this._client); trustedDomains: TrustedDomainsAPI.TrustedDomains = new TrustedDomainsAPI.TrustedDomains(this._client); + urlIgnorePatterns: URLIgnorePatternsAPI.URLIgnorePatterns = new URLIgnorePatternsAPI.URLIgnorePatterns( + this._client, + ); } Settings.AllowPolicies = AllowPolicies; @@ -93,8 +128,14 @@ Settings.DomainListResponsesV4PagePaginationArray = DomainListResponsesV4PagePag Settings.ImpersonationRegistry = ImpersonationRegistry; Settings.ImpersonationRegistryListResponsesV4PagePaginationArray = ImpersonationRegistryListResponsesV4PagePaginationArray; +Settings.SendingDomainRestrictions = SendingDomainRestrictions; +Settings.SendingDomainRestrictionListResponsesV4PagePaginationArray = + SendingDomainRestrictionListResponsesV4PagePaginationArray; Settings.TrustedDomains = TrustedDomains; Settings.TrustedDomainListResponsesV4PagePaginationArray = TrustedDomainListResponsesV4PagePaginationArray; +Settings.URLIgnorePatterns = URLIgnorePatterns; +Settings.URLIgnorePatternListResponsesV4PagePaginationArray = + URLIgnorePatternListResponsesV4PagePaginationArray; export declare namespace Settings { export { @@ -155,6 +196,21 @@ export declare namespace Settings { type ImpersonationRegistryGetParams as ImpersonationRegistryGetParams, }; + export { + SendingDomainRestrictions as SendingDomainRestrictions, + type SendingDomainRestrictionCreateResponse as SendingDomainRestrictionCreateResponse, + type SendingDomainRestrictionListResponse as SendingDomainRestrictionListResponse, + type SendingDomainRestrictionDeleteResponse as SendingDomainRestrictionDeleteResponse, + type SendingDomainRestrictionEditResponse as SendingDomainRestrictionEditResponse, + type SendingDomainRestrictionGetResponse as SendingDomainRestrictionGetResponse, + SendingDomainRestrictionListResponsesV4PagePaginationArray as SendingDomainRestrictionListResponsesV4PagePaginationArray, + type SendingDomainRestrictionCreateParams as SendingDomainRestrictionCreateParams, + type SendingDomainRestrictionListParams as SendingDomainRestrictionListParams, + type SendingDomainRestrictionDeleteParams as SendingDomainRestrictionDeleteParams, + type SendingDomainRestrictionEditParams as SendingDomainRestrictionEditParams, + type SendingDomainRestrictionGetParams as SendingDomainRestrictionGetParams, + }; + export { TrustedDomains as TrustedDomains, type TrustedDomainCreateResponse as TrustedDomainCreateResponse, @@ -169,4 +225,19 @@ export declare namespace Settings { type TrustedDomainEditParams as TrustedDomainEditParams, type TrustedDomainGetParams as TrustedDomainGetParams, }; + + export { + URLIgnorePatterns as URLIgnorePatterns, + type URLIgnorePatternCreateResponse as URLIgnorePatternCreateResponse, + type URLIgnorePatternListResponse as URLIgnorePatternListResponse, + type URLIgnorePatternDeleteResponse as URLIgnorePatternDeleteResponse, + type URLIgnorePatternEditResponse as URLIgnorePatternEditResponse, + type URLIgnorePatternGetResponse as URLIgnorePatternGetResponse, + URLIgnorePatternListResponsesV4PagePaginationArray as URLIgnorePatternListResponsesV4PagePaginationArray, + type URLIgnorePatternCreateParams as URLIgnorePatternCreateParams, + type URLIgnorePatternListParams as URLIgnorePatternListParams, + type URLIgnorePatternDeleteParams as URLIgnorePatternDeleteParams, + type URLIgnorePatternEditParams as URLIgnorePatternEditParams, + type URLIgnorePatternGetParams as URLIgnorePatternGetParams, + }; } diff --git a/src/resources/email-security/settings/url-ignore-patterns.ts b/src/resources/email-security/settings/url-ignore-patterns.ts new file mode 100644 index 0000000000..867f18e54d --- /dev/null +++ b/src/resources/email-security/settings/url-ignore-patterns.ts @@ -0,0 +1,348 @@ +// 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 URLIgnorePatterns extends APIResource { + /** + * Creates a new URL rewrite ignore pattern. URLs matching this pattern will not be + * rewritten. + * + * @example + * ```ts + * const urlIgnorePattern = + * await client.emailSecurity.settings.urlIgnorePatterns.create( + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * pattern: 'https://example\\.com/.*', + * }, + * ); + * ``` + */ + create( + params: URLIgnorePatternCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/email-security/settings/url_ignore_patterns`, { + body, + ...options, + }) as Core.APIPromise<{ result: URLIgnorePatternCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Returns a paginated list of URL rewrite ignore patterns for the account. URLs + * matching these patterns will not be rewritten. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const urlIgnorePatternListResponse of client.emailSecurity.settings.urlIgnorePatterns.list( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: URLIgnorePatternListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/email-security/settings/url_ignore_patterns`, + URLIgnorePatternListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Removes a URL rewrite ignore pattern. After deletion, URLs matching this pattern + * will be rewritten again. + * + * @example + * ```ts + * const urlIgnorePattern = + * await client.emailSecurity.settings.urlIgnorePatterns.delete( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + patternId: string, + params: URLIgnorePatternDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete( + `/accounts/${account_id}/email-security/settings/url_ignore_patterns/${patternId}`, + options, + ) as Core.APIPromise<{ result: URLIgnorePatternDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Updates an existing URL rewrite ignore pattern. Only provided fields will be + * modified. + * + * @example + * ```ts + * const response = + * await client.emailSecurity.settings.urlIgnorePatterns.edit( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + edit( + patternId: string, + params: URLIgnorePatternEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.patch(`/accounts/${account_id}/email-security/settings/url_ignore_patterns/${patternId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: URLIgnorePatternEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Returns a single URL rewrite ignore pattern by its identifier. + * + * @example + * ```ts + * const urlIgnorePattern = + * await client.emailSecurity.settings.urlIgnorePatterns.get( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + patternId: string, + params: URLIgnorePatternGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/email-security/settings/url_ignore_patterns/${patternId}`, + options, + ) as Core.APIPromise<{ result: URLIgnorePatternGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class URLIgnorePatternListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +/** + * A URL ignore pattern that exempts matching URLs from being rewritten by Email + * Security. + */ +export interface URLIgnorePatternCreateResponse { + /** + * URL ignore pattern identifier + */ + id: string; + + created_at: string; + + /** + * Regular expression matching URLs that should not be rewritten. + */ + pattern: string; + + /** + * Optional note describing the reason for the ignore pattern. + */ + comments?: string | null; + + /** + * @deprecated Deprecated, use `modified_at` instead. End of life: November + * 1, 2026. + */ + last_modified?: string; + + modified_at?: string; +} + +/** + * A URL ignore pattern that exempts matching URLs from being rewritten by Email + * Security. + */ +export interface URLIgnorePatternListResponse { + /** + * URL ignore pattern identifier + */ + id: string; + + created_at: string; + + /** + * Regular expression matching URLs that should not be rewritten. + */ + pattern: string; + + /** + * Optional note describing the reason for the ignore pattern. + */ + comments?: string | null; + + /** + * @deprecated Deprecated, use `modified_at` instead. End of life: November + * 1, 2026. + */ + last_modified?: string; + + modified_at?: string; +} + +export interface URLIgnorePatternDeleteResponse { + /** + * URL ignore pattern identifier + */ + id: string; +} + +/** + * A URL ignore pattern that exempts matching URLs from being rewritten by Email + * Security. + */ +export interface URLIgnorePatternEditResponse { + /** + * URL ignore pattern identifier + */ + id: string; + + created_at: string; + + /** + * Regular expression matching URLs that should not be rewritten. + */ + pattern: string; + + /** + * Optional note describing the reason for the ignore pattern. + */ + comments?: string | null; + + /** + * @deprecated Deprecated, use `modified_at` instead. End of life: November + * 1, 2026. + */ + last_modified?: string; + + modified_at?: string; +} + +/** + * A URL ignore pattern that exempts matching URLs from being rewritten by Email + * Security. + */ +export interface URLIgnorePatternGetResponse { + /** + * URL ignore pattern identifier + */ + id: string; + + created_at: string; + + /** + * Regular expression matching URLs that should not be rewritten. + */ + pattern: string; + + /** + * Optional note describing the reason for the ignore pattern. + */ + comments?: string | null; + + /** + * @deprecated Deprecated, use `modified_at` instead. End of life: November + * 1, 2026. + */ + last_modified?: string; + + modified_at?: string; +} + +export interface URLIgnorePatternCreateParams { + /** + * Path param: Identifier. + */ + account_id: string; + + /** + * Body param: Regular expression matching URLs that should not be rewritten. + */ + pattern: string; + + /** + * Body param: Optional note describing the reason for the ignore pattern. + */ + comments?: string | null; +} + +export interface URLIgnorePatternListParams extends V4PagePaginationArrayParams { + /** + * Path param: Identifier. + */ + account_id: string; +} + +export interface URLIgnorePatternDeleteParams { + /** + * Identifier. + */ + account_id: string; +} + +export interface URLIgnorePatternEditParams { + /** + * Path param: Identifier. + */ + account_id: string; + + /** + * Body param: Optional note describing the reason for the ignore pattern. + */ + comments?: string | null; + + /** + * Body param: Regular expression matching URLs that should not be rewritten. + */ + pattern?: string; +} + +export interface URLIgnorePatternGetParams { + /** + * Identifier. + */ + account_id: string; +} + +URLIgnorePatterns.URLIgnorePatternListResponsesV4PagePaginationArray = + URLIgnorePatternListResponsesV4PagePaginationArray; + +export declare namespace URLIgnorePatterns { + export { + type URLIgnorePatternCreateResponse as URLIgnorePatternCreateResponse, + type URLIgnorePatternListResponse as URLIgnorePatternListResponse, + type URLIgnorePatternDeleteResponse as URLIgnorePatternDeleteResponse, + type URLIgnorePatternEditResponse as URLIgnorePatternEditResponse, + type URLIgnorePatternGetResponse as URLIgnorePatternGetResponse, + URLIgnorePatternListResponsesV4PagePaginationArray as URLIgnorePatternListResponsesV4PagePaginationArray, + type URLIgnorePatternCreateParams as URLIgnorePatternCreateParams, + type URLIgnorePatternListParams as URLIgnorePatternListParams, + type URLIgnorePatternDeleteParams as URLIgnorePatternDeleteParams, + type URLIgnorePatternEditParams as URLIgnorePatternEditParams, + type URLIgnorePatternGetParams as URLIgnorePatternGetParams, + }; +} diff --git a/src/resources/hostnames/settings/tls.ts b/src/resources/hostnames/settings/tls.ts index 5be4fb5c9f..69390e4815 100644 --- a/src/resources/hostnames/settings/tls.ts +++ b/src/resources/hostnames/settings/tls.ts @@ -86,11 +86,11 @@ export interface Setting { * path: * * - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., - * `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + * `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`). * - `min_tls_version`: a string indicating the minimum TLS version — one of - * `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) + * `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`). * - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` - * (e.g., `"on"`) + * (e.g., `"on"`). */ value?: SettingValue; } @@ -100,11 +100,11 @@ export interface Setting { * path: * * - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., - * `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + * `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`). * - `min_tls_version`: a string indicating the minimum TLS version — one of - * `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) + * `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`). * - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` - * (e.g., `"on"`) + * (e.g., `"on"`). */ export type SettingValue = '1.0' | '1.1' | '1.2' | '1.3' | 'on' | 'off' | Array; @@ -113,11 +113,11 @@ export type SettingValue = '1.0' | '1.1' | '1.2' | '1.3' | 'on' | 'off' | Array< * path: * * - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., - * `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + * `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`). * - `min_tls_version`: a string indicating the minimum TLS version — one of - * `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) + * `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`). * - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` - * (e.g., `"on"`) + * (e.g., `"on"`). */ export type SettingValueParam = '1.0' | '1.1' | '1.2' | '1.3' | 'on' | 'off' | Array; @@ -147,11 +147,11 @@ export interface TLSDeleteResponse { * path: * * - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., - * `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + * `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`). * - `min_tls_version`: a string indicating the minimum TLS version — one of - * `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) + * `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`). * - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` - * (e.g., `"on"`) + * (e.g., `"on"`). */ value?: SettingValue; } @@ -182,11 +182,11 @@ export interface TLSGetResponse { * path: * * - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., - * `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + * `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`). * - `min_tls_version`: a string indicating the minimum TLS version — one of - * `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) + * `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`). * - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` - * (e.g., `"on"`) + * (e.g., `"on"`). */ value?: SettingValue; } @@ -202,11 +202,11 @@ export interface TLSUpdateParams { * the request path: * * - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., - * `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + * `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`). * - `min_tls_version`: a string indicating the minimum TLS version — one of - * `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) + * `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`). * - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` - * (e.g., `"on"`) + * (e.g., `"on"`). */ value: SettingValueParam; } diff --git a/src/resources/index.ts b/src/resources/index.ts index 3725086f4e..869ab727a3 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -3,6 +3,7 @@ export * from './shared'; export { ACM } from './acm/acm'; export { AI } from './ai/ai'; +export { AIAudit } from './ai-audit/ai-audit'; export { AIGateway } from './ai-gateway/ai-gateway'; export { AISearch } from './aisearch/aisearch'; export { AISecurity } from './ai-security/ai-security'; @@ -27,6 +28,7 @@ export { CloudforceOne } from './cloudforce-one/cloudforce-one'; export { Connectivity } from './connectivity/connectivity'; export { ContentScanning } from './content-scanning/content-scanning'; export { CustomCertificates } from './custom-certificates/custom-certificates'; +export { CustomCsrs } from './custom-csrs'; export { CustomHostnames } from './custom-hostnames/custom-hostnames'; export { CustomNameservers } from './custom-nameservers'; export { CustomPages } from './custom-pages/custom-pages'; diff --git a/src/resources/keyless-certificates/keyless-certificates.ts b/src/resources/keyless-certificates/keyless-certificates.ts index 7cd19c0977..9f3722d046 100644 --- a/src/resources/keyless-certificates/keyless-certificates.ts +++ b/src/resources/keyless-certificates/keyless-certificates.ts @@ -191,37 +191,37 @@ export interface KeylessCertificate { status: 'active' | 'deleted'; /** - * Configuration for using Keyless SSL through a Cloudflare Tunnel + * Configuration for using Keyless SSL through a Cloudflare Tunnel. */ tunnel?: Tunnel; } /** - * Configuration for using Keyless SSL through a Cloudflare Tunnel + * Configuration for using Keyless SSL through a Cloudflare Tunnel. */ export interface Tunnel { /** - * Private IP of the Key Server Host + * Private IP of the Key Server Host. */ private_ip: string; /** - * Cloudflare Tunnel Virtual Network ID + * Cloudflare Tunnel Virtual Network ID. */ vnet_id: string; } /** - * Configuration for using Keyless SSL through a Cloudflare Tunnel + * Configuration for using Keyless SSL through a Cloudflare Tunnel. */ export interface TunnelParam { /** - * Private IP of the Key Server Host + * Private IP of the Key Server Host. */ private_ip: string; /** - * Cloudflare Tunnel Virtual Network ID + * Cloudflare Tunnel Virtual Network ID. */ vnet_id: string; } @@ -269,7 +269,7 @@ export interface KeylessCertificateCreateParams { name?: string; /** - * Body param: Configuration for using Keyless SSL through a Cloudflare Tunnel + * Body param: Configuration for using Keyless SSL through a Cloudflare Tunnel. */ tunnel?: TunnelParam; } @@ -316,7 +316,7 @@ export interface KeylessCertificateEditParams { port?: number; /** - * Body param: Configuration for using Keyless SSL through a Cloudflare Tunnel + * Body param: Configuration for using Keyless SSL through a Cloudflare Tunnel. */ tunnel?: TunnelParam; } diff --git a/src/resources/organizations/organizations.ts b/src/resources/organizations/organizations.ts index 05631945fe..99cc65299f 100644 --- a/src/resources/organizations/organizations.ts +++ b/src/resources/organizations/organizations.ts @@ -70,6 +70,9 @@ 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. (Currently in * Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) + * + * **Access Control:** Restricted to enterprise organizations. Non-admin callers + * also require the `account_deletion` tenant flag. */ delete(organizationId: string, options?: Core.RequestOptions): Core.APIPromise { return ( diff --git a/src/resources/origin-ca-certificates/origin-ca-certificates.ts b/src/resources/origin-ca-certificates/origin-ca-certificates.ts index 71eb188ebf..298ce1fd9c 100644 --- a/src/resources/origin-ca-certificates/origin-ca-certificates.ts +++ b/src/resources/origin-ca-certificates/origin-ca-certificates.ts @@ -208,7 +208,7 @@ export interface OriginCACertificateListParams extends V4PagePaginationArrayPara limit?: number; /** - * Offset the results + * Offset the results. */ offset?: number; } diff --git a/src/resources/pipelines/pipelines.ts b/src/resources/pipelines/pipelines.ts index 6374a3a96f..a8f361f89b 100644 --- a/src/resources/pipelines/pipelines.ts +++ b/src/resources/pipelines/pipelines.ts @@ -1406,6 +1406,11 @@ export interface PipelineListV1Params extends V4PagePaginationArrayParams { * Path param: Specifies the public ID of the account. */ account_id: string; + + /** + * Query param: Filters pipelines by name (case-insensitive substring). + */ + name?: string; } export interface PipelineValidateSqlParams { diff --git a/src/resources/pipelines/sinks.ts b/src/resources/pipelines/sinks.ts index 050a0c3c43..88c77bc1f0 100644 --- a/src/resources/pipelines/sinks.ts +++ b/src/resources/pipelines/sinks.ts @@ -1546,6 +1546,11 @@ export interface SinkListParams extends V4PagePaginationArrayParams { */ account_id: string; + /** + * Query param: Filters sinks by name (case-insensitive substring). + */ + name?: string; + /** * Query param */ diff --git a/src/resources/pipelines/streams.ts b/src/resources/pipelines/streams.ts index 103d441b67..d95c60c797 100644 --- a/src/resources/pipelines/streams.ts +++ b/src/resources/pipelines/streams.ts @@ -1236,6 +1236,11 @@ export interface StreamListParams extends V4PagePaginationArrayParams { */ account_id: string; + /** + * Query param: Filters streams by name (case-insensitive substring). + */ + name?: string; + /** * Query param: Specifies the public ID of the pipeline. */ diff --git a/src/resources/radar/ai/bots/bots.ts b/src/resources/radar/ai/bots/bots.ts index c6da31ba6b..b93459ff72 100644 --- a/src/resources/radar/ai/bots/bots.ts +++ b/src/resources/radar/ai/bots/bots.ts @@ -897,7 +897,7 @@ export interface BotTimeseriesGroupsParams { * Normalization method applied to the results. Refer to * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). */ - normalization?: 'PERCENTAGE' | 'MIN0_MAX'; + normalization?: 'PERCENTAGE' | 'MIN0_MAX' | 'PERCENTAGE_CHANGE'; /** * Filters results by HTTP response status code (e.g. 200, 403, 404). Only diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index b60d1c462e..d0e041c43a 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -1047,7 +1047,7 @@ export interface TimeseriesGroupTimeseriesGroupsParams { * Normalization method applied to the results. Refer to * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). */ - normalization?: 'PERCENTAGE' | 'MIN0_MAX'; + normalization?: 'PERCENTAGE' | 'MIN0_MAX' | 'PERCENTAGE_CHANGE'; /** * Filters results by HTTP response status code (e.g. 200, 403, 404). Only diff --git a/src/resources/radar/bots/web-crawlers.ts b/src/resources/radar/bots/web-crawlers.ts index ac8b5ee168..8a2bd9c1d5 100644 --- a/src/resources/radar/bots/web-crawlers.ts +++ b/src/resources/radar/bots/web-crawlers.ts @@ -524,6 +524,12 @@ export interface WebCrawlerTimeseriesGroupsParams { */ name?: Array; + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX' | 'PERCENTAGE_CHANGE'; + /** * Filters results by HTTP response status code (e.g. 200, 403, 404). Only * [IANA-registered codes](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml) diff --git a/src/resources/radar/netflows/netflows.ts b/src/resources/radar/netflows/netflows.ts index f2a8a3b57c..e5eb4c3236 100644 --- a/src/resources/radar/netflows/netflows.ts +++ b/src/resources/radar/netflows/netflows.ts @@ -965,7 +965,7 @@ export interface NetFlowsTimeseriesGroupsParams { * Normalization method applied to the results. Refer to * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). */ - normalization?: 'PERCENTAGE' | 'MIN0_MAX'; + normalization?: 'PERCENTAGE' | 'MIN0_MAX' | 'PERCENTAGE_CHANGE'; /** * Filters the results by network traffic product types. diff --git a/src/resources/realtime-kit/api.md b/src/resources/realtime-kit/api.md index 5e51d31c58..27b40f1c6e 100644 --- a/src/resources/realtime-kit/api.md +++ b/src/resources/realtime-kit/api.md @@ -148,6 +148,7 @@ Types: - LivestreamGetActiveLivestreamsForLivestreamIDResponse - LivestreamGetAllLivestreamsResponse - LivestreamGetLivestreamAnalyticsCompleteResponse +- LivestreamGetLivestreamAnalyticsDaywiseResponse - LivestreamGetLivestreamSessionDetailsForSessionIDResponse - LivestreamGetLivestreamSessionForLivestreamIDResponse - LivestreamGetMeetingActiveLivestreamsResponse @@ -161,6 +162,7 @@ Methods: - client.realtimeKit.livestreams.getActiveLivestreamsForLivestreamId(appId, livestreamId, { ...params }) -> LivestreamGetActiveLivestreamsForLivestreamIDResponse - client.realtimeKit.livestreams.getAllLivestreams(appId, { ...params }) -> LivestreamGetAllLivestreamsResponse - client.realtimeKit.livestreams.getLivestreamAnalyticsComplete(appId, { ...params }) -> LivestreamGetLivestreamAnalyticsCompleteResponse +- client.realtimeKit.livestreams.getLivestreamAnalyticsDaywise(appId, { ...params }) -> LivestreamGetLivestreamAnalyticsDaywiseResponse - client.realtimeKit.livestreams.getLivestreamSessionDetailsForSessionId(appId, livestreamSessionId, { ...params }) -> LivestreamGetLivestreamSessionDetailsForSessionIDResponse - client.realtimeKit.livestreams.getLivestreamSessionForLivestreamId(appId, livestreamId, { ...params }) -> LivestreamGetLivestreamSessionForLivestreamIDResponse - client.realtimeKit.livestreams.getMeetingActiveLivestreams(appId, meetingId, { ...params }) -> LivestreamGetMeetingActiveLivestreamsResponse diff --git a/src/resources/realtime-kit/apps.ts b/src/resources/realtime-kit/apps.ts index 322180ca80..7b6caa7f8c 100644 --- a/src/resources/realtime-kit/apps.ts +++ b/src/resources/realtime-kit/apps.ts @@ -15,8 +15,8 @@ export class Apps extends APIResource { * ``` */ get(params: AppGetParams, options?: Core.RequestOptions): Core.APIPromise { - const { account_id } = params; - return this._client.get(`/accounts/${account_id}/realtime/kit/apps`, options); + const { account_id, ...query } = params; + return this._client.get(`/accounts/${account_id}/realtime/kit/apps`, { query, ...options }); } /** @@ -25,8 +25,8 @@ export class Apps extends APIResource { * @example * ```ts * const response = await client.realtimeKit.apps.post({ - * account_id: 'account_id', - * name: 'name', + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * name: 'x', * }); * ``` */ @@ -39,6 +39,8 @@ export class Apps extends APIResource { export interface AppGetResponse { data?: Array; + paging?: AppGetResponse.Paging; + success?: boolean; } @@ -50,6 +52,14 @@ export namespace AppGetResponse { name?: string; } + + export interface Paging { + end_offset?: number; + + start_offset?: number; + + total_count?: number; + } } export interface AppPostResponse { @@ -76,14 +86,35 @@ export namespace AppPostResponse { export interface AppGetParams { /** - * The account identifier tag. + * Path param: The account identifier tag. */ account_id: string; + + /** + * Query param: The page number from which you want your page search results to be + * displayed. + */ + page_no?: number; + + /** + * Query param: Number of results per page. + */ + per_page?: number; + + /** + * Query param: Search string that matches apps by name. + */ + search?: string; + + /** + * Query param: Sort order for apps by creation time. + */ + sort_order?: 'ASC' | 'DESC'; } export interface AppPostParams { /** - * Path param + * Path param: The account identifier tag. */ account_id: string; diff --git a/src/resources/realtime-kit/index.ts b/src/resources/realtime-kit/index.ts index 424b69ca5a..f8728acc85 100644 --- a/src/resources/realtime-kit/index.ts +++ b/src/resources/realtime-kit/index.ts @@ -29,6 +29,7 @@ export { type LivestreamGetActiveLivestreamsForLivestreamIDResponse, type LivestreamGetAllLivestreamsResponse, type LivestreamGetLivestreamAnalyticsCompleteResponse, + type LivestreamGetLivestreamAnalyticsDaywiseResponse, type LivestreamGetLivestreamSessionDetailsForSessionIDResponse, type LivestreamGetLivestreamSessionForLivestreamIDResponse, type LivestreamGetMeetingActiveLivestreamsResponse, @@ -39,6 +40,7 @@ export { type LivestreamGetActiveLivestreamsForLivestreamIDParams, type LivestreamGetAllLivestreamsParams, type LivestreamGetLivestreamAnalyticsCompleteParams, + type LivestreamGetLivestreamAnalyticsDaywiseParams, type LivestreamGetLivestreamSessionDetailsForSessionIDParams, type LivestreamGetLivestreamSessionForLivestreamIDParams, type LivestreamGetMeetingActiveLivestreamsParams, diff --git a/src/resources/realtime-kit/livestreams.ts b/src/resources/realtime-kit/livestreams.ts index fd95452447..06b0d5416f 100644 --- a/src/resources/realtime-kit/livestreams.ts +++ b/src/resources/realtime-kit/livestreams.ts @@ -112,6 +112,30 @@ export class Livestreams extends APIResource { }); } + /** + * Returns day-wise livestream analytics for the specified time range. + * + * @example + * ```ts + * const response = + * await client.realtimeKit.livestreams.getLivestreamAnalyticsDaywise( + * 'app_id', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + getLivestreamAnalyticsDaywise( + appId: string, + params: LivestreamGetLivestreamAnalyticsDaywiseParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...query } = params; + return this._client.get(`/accounts/${account_id}/realtime/kit/${appId}/analytics/livestreams/daywise`, { + query, + ...options, + }); + } + /** * Returns livestream session details for the given livestream session ID. Retrieve * the `livestream_session_id`using the @@ -517,6 +541,36 @@ export namespace LivestreamGetLivestreamAnalyticsCompleteResponse { } } +export interface LivestreamGetLivestreamAnalyticsDaywiseResponse { + data?: Array; + + success?: boolean; +} + +export namespace LivestreamGetLivestreamAnalyticsDaywiseResponse { + export interface Data { + /** + * Count of total livestream sessions. + */ + count?: number; + + /** + * Analytics date. + */ + date?: string | null; + + /** + * Total time duration for which the input was given or the meeting was streamed. + */ + total_ingest_seconds?: number; + + /** + * Total view time for which the viewers watched the stream. + */ + total_viewer_seconds?: number; + } +} + export interface LivestreamGetLivestreamSessionDetailsForSessionIDResponse { data?: LivestreamGetLivestreamSessionDetailsForSessionIDResponse.Data; @@ -952,16 +1006,45 @@ export interface LivestreamGetLivestreamAnalyticsCompleteParams { account_id: string; /** - * Query param: Specify the end time range in ISO format to access the livestream - * analytics. + * Query param: Specify the end time as a Unix timestamp in seconds to access the + * livestream analytics. */ - end_time?: string; + end_time?: number; /** - * Query param: Specify the start time range in ISO format to access the livestream - * analytics. + * Query param: Optional filters for livestream analytics. */ - start_time?: string; + filters?: string; + + /** + * Query param: Specify the start time as a Unix timestamp in seconds to access the + * livestream analytics. + */ + start_time?: number; +} + +export interface LivestreamGetLivestreamAnalyticsDaywiseParams { + /** + * Path param: The account identifier tag. + */ + account_id: string; + + /** + * Query param: Specify the end time as a Unix timestamp in seconds to access the + * livestream analytics. + */ + end_time?: number; + + /** + * Query param: Optional filters for livestream analytics. + */ + filters?: string; + + /** + * Query param: Specify the start time as a Unix timestamp in seconds to access the + * livestream analytics. + */ + start_time?: number; } export interface LivestreamGetLivestreamSessionDetailsForSessionIDParams { @@ -1057,6 +1140,7 @@ export declare namespace Livestreams { type LivestreamGetActiveLivestreamsForLivestreamIDResponse as LivestreamGetActiveLivestreamsForLivestreamIDResponse, type LivestreamGetAllLivestreamsResponse as LivestreamGetAllLivestreamsResponse, type LivestreamGetLivestreamAnalyticsCompleteResponse as LivestreamGetLivestreamAnalyticsCompleteResponse, + type LivestreamGetLivestreamAnalyticsDaywiseResponse as LivestreamGetLivestreamAnalyticsDaywiseResponse, type LivestreamGetLivestreamSessionDetailsForSessionIDResponse as LivestreamGetLivestreamSessionDetailsForSessionIDResponse, type LivestreamGetLivestreamSessionForLivestreamIDResponse as LivestreamGetLivestreamSessionForLivestreamIDResponse, type LivestreamGetMeetingActiveLivestreamsResponse as LivestreamGetMeetingActiveLivestreamsResponse, @@ -1067,6 +1151,7 @@ export declare namespace Livestreams { type LivestreamGetActiveLivestreamsForLivestreamIDParams as LivestreamGetActiveLivestreamsForLivestreamIDParams, type LivestreamGetAllLivestreamsParams as LivestreamGetAllLivestreamsParams, type LivestreamGetLivestreamAnalyticsCompleteParams as LivestreamGetLivestreamAnalyticsCompleteParams, + type LivestreamGetLivestreamAnalyticsDaywiseParams as LivestreamGetLivestreamAnalyticsDaywiseParams, type LivestreamGetLivestreamSessionDetailsForSessionIDParams as LivestreamGetLivestreamSessionDetailsForSessionIDParams, type LivestreamGetLivestreamSessionForLivestreamIDParams as LivestreamGetLivestreamSessionForLivestreamIDParams, type LivestreamGetMeetingActiveLivestreamsParams as LivestreamGetMeetingActiveLivestreamsParams, diff --git a/src/resources/realtime-kit/meetings.ts b/src/resources/realtime-kit/meetings.ts index 94ed2e1700..5971988a31 100644 --- a/src/resources/realtime-kit/meetings.ts +++ b/src/resources/realtime-kit/meetings.ts @@ -375,6 +375,11 @@ export namespace MeetingCreateResponse { * Title of the meeting. */ title?: string; + + /** + * Automatically generate transcripts when the meeting ends. + */ + transcribe_on_end?: boolean; } export namespace Data { @@ -845,6 +850,13 @@ export namespace MeetingGetResponse { */ record_on_start?: boolean; + /** + * Recording Configurations to be used for this meeting. This level of configs + * takes higher preference over App level configs on the RealtimeKit developer + * portal. + */ + recording_config?: Data.RecordingConfig; + /** * Time in seconds, for which a session remains active, after the last participant * has left the meeting. @@ -867,6 +879,211 @@ export namespace MeetingGetResponse { * Title of the meeting. */ title?: string; + + /** + * Automatically generate transcripts when the meeting ends. + */ + transcribe_on_end?: boolean; + } + + export namespace Data { + /** + * Recording Configurations to be used for this meeting. This level of configs + * takes higher preference over App level configs on the RealtimeKit developer + * portal. + */ + export interface RecordingConfig { + /** + * Object containing configuration regarding the audio that is being recorded. + */ + audio_config?: RecordingConfig.AudioConfig; + + /** + * Adds a prefix to the beginning of the file name of the recording. + */ + file_name_prefix?: string; + + live_streaming_config?: RecordingConfig.LiveStreamingConfig; + + /** + * Specifies the maximum duration for recording in seconds, ranging from a minimum + * of 60 seconds to a maximum of 24 hours. + */ + max_seconds?: number; + + realtimekit_bucket_config?: RecordingConfig.RealtimekitBucketConfig; + + storage_config?: RecordingConfig.StorageConfig | null; + + video_config?: RecordingConfig.VideoConfig; + } + + export namespace RecordingConfig { + /** + * Object containing configuration regarding the audio that is being recorded. + */ + export interface AudioConfig { + /** + * Audio signal pathway within an audio file that carries a specific sound source. + */ + channel?: 'mono' | 'stereo'; + + /** + * Codec using which the recording will be encoded. If VP8/VP9 is selected for + * videoConfig, changing audioConfig is not allowed. In this case, the codec in the + * audioConfig is automatically set to vorbis. + */ + codec?: 'MP3' | 'AAC'; + + /** + * Controls whether to export audio file seperately + */ + export_file?: boolean; + } + + export interface LiveStreamingConfig { + /** + * RTMP URL to stream to + */ + rtmp_url?: string; + } + + export interface RealtimekitBucketConfig { + /** + * Controls whether recordings are uploaded to RealtimeKit's bucket. If set to + * false, `download_url`, `audio_download_url`, `download_url_expiry` won't be + * generated for a recording. + */ + enabled: boolean; + } + + export interface StorageConfig { + /** + * Type of storage media. + */ + type: 'aws' | 'azure' | 'digitalocean' | 'gcs' | 'sftp'; + + /** + * Authentication method used for "sftp" type storage medium + */ + auth_method?: 'KEY' | 'PASSWORD'; + + /** + * Name of the storage medium's bucket. + */ + bucket?: string; + + /** + * SSH destination server host for SFTP type storage medium + */ + host?: string; + + /** + * SSH destination server password for SFTP type storage medium when auth_method is + * "PASSWORD". If auth_method is "KEY", this specifies the password for the ssh + * private key. + */ + password?: string; + + /** + * Path relative to the bucket root at which the recording will be placed. + */ + path?: string; + + /** + * SSH destination server port for SFTP type storage medium + */ + port?: number; + + /** + * Private key used to login to destination SSH server for SFTP type storage + * medium, when auth_method used is "KEY" + */ + private_key?: string; + + /** + * Region of the storage medium. + */ + region?: string; + + /** + * Secret key of the storage medium. Similar to `access_key`, it is only writeable + * by clients, not readable. + */ + secret?: string; + + /** + * SSH destination server username for SFTP type storage medium + */ + username?: string; + } + + export interface VideoConfig { + /** + * Codec using which the recording will be encoded. + */ + codec?: 'H264' | 'VP8'; + + /** + * Controls whether to export video file seperately + */ + export_file?: boolean; + + /** + * Height of the recording video in pixels + */ + height?: number; + + /** + * Watermark to be added to the recording + */ + watermark?: VideoConfig.Watermark; + + /** + * Width of the recording video in pixels + */ + width?: number; + } + + export namespace VideoConfig { + /** + * Watermark to be added to the recording + */ + export interface Watermark { + /** + * Position of the watermark + */ + position?: 'left top' | 'right top' | 'left bottom' | 'right bottom'; + + /** + * Size of the watermark + */ + size?: Watermark.Size; + + /** + * URL of the watermark image + */ + url?: string; + } + + export namespace Watermark { + /** + * Size of the watermark + */ + export interface Size { + /** + * Height of the watermark in px + */ + height?: number; + + /** + * Width of the watermark in px + */ + width?: number; + } + } + } + } } export interface Paging { @@ -961,6 +1178,11 @@ export namespace MeetingGetMeetingByIDResponse { * Title of the meeting. */ title?: string; + + /** + * Automatically generate transcripts when the meeting ends. + */ + transcribe_on_end?: boolean; } export namespace Data { @@ -1450,6 +1672,11 @@ export namespace MeetingReplaceMeetingByIDResponse { * Title of the meeting. */ title?: string; + + /** + * Automatically generate transcripts when the meeting ends. + */ + transcribe_on_end?: boolean; } export namespace Data { @@ -1803,6 +2030,11 @@ export namespace MeetingUpdateMeetingByIDResponse { * Title of the meeting. */ title?: string; + + /** + * Automatically generate transcripts when the meeting ends. + */ + transcribe_on_end?: boolean; } export namespace Data { @@ -2126,6 +2358,11 @@ export interface MeetingCreateParams { * Body param: Title of the meeting */ title?: string | null; + + /** + * Body param: Automatically generate transcripts when the meeting ends. + */ + transcribe_on_end?: boolean; } export namespace MeetingCreateParams { @@ -2494,6 +2731,11 @@ export interface MeetingGetParams { * The time must be specified in ISO format. */ start_time?: string; + + /** + * Query param: Filter meetings by status. + */ + status?: 'ACTIVE' | 'INACTIVE'; } export interface MeetingGetMeetingByIDParams { @@ -2593,6 +2835,11 @@ export interface MeetingReplaceMeetingByIDParams { * Body param: Title of the meeting */ title?: string | null; + + /** + * Body param: Automatically generate transcripts when the meeting ends. + */ + transcribe_on_end?: boolean; } export namespace MeetingReplaceMeetingByIDParams { @@ -2899,6 +3146,13 @@ export interface MeetingUpdateMeetingByIDParams { */ record_on_start?: boolean; + /** + * Body param: Recording Configurations to be used for this meeting. This level of + * configs takes higher preference over App level configs on the RealtimeKit + * developer portal. + */ + recording_config?: MeetingUpdateMeetingByIDParams.RecordingConfig; + /** * Body param: Time in seconds, for which a session remains active, after the last * participant has left the meeting. @@ -2922,6 +3176,11 @@ export interface MeetingUpdateMeetingByIDParams { * Body param: Title of the meeting */ title?: string; + + /** + * Body param: Automatically generate transcripts when the meeting ends. + */ + transcribe_on_end?: boolean; } export namespace MeetingUpdateMeetingByIDParams { @@ -2991,6 +3250,212 @@ export namespace MeetingUpdateMeetingByIDParams { profanity_filter?: boolean; } } + + /** + * Recording Configurations to be used for this meeting. This level of configs + * takes higher preference over App level configs on the RealtimeKit developer + * portal. + */ + export interface RecordingConfig { + /** + * Object containing configuration regarding the audio that is being recorded. + */ + audio_config?: RecordingConfig.AudioConfig; + + /** + * Adds a prefix to the beginning of the file name of the recording. + */ + file_name_prefix?: string; + + live_streaming_config?: RecordingConfig.LiveStreamingConfig; + + /** + * Specifies the maximum duration for recording in seconds, ranging from a minimum + * of 60 seconds to a maximum of 24 hours. + */ + max_seconds?: number; + + realtimekit_bucket_config?: RecordingConfig.RealtimekitBucketConfig; + + storage_config?: RecordingConfig.StorageConfig | null; + + video_config?: RecordingConfig.VideoConfig; + } + + export namespace RecordingConfig { + /** + * Object containing configuration regarding the audio that is being recorded. + */ + export interface AudioConfig { + /** + * Audio signal pathway within an audio file that carries a specific sound source. + */ + channel?: 'mono' | 'stereo'; + + /** + * Codec using which the recording will be encoded. If VP8/VP9 is selected for + * videoConfig, changing audioConfig is not allowed. In this case, the codec in the + * audioConfig is automatically set to vorbis. + */ + codec?: 'MP3' | 'AAC'; + + /** + * Controls whether to export audio file seperately + */ + export_file?: boolean; + } + + export interface LiveStreamingConfig { + /** + * RTMP URL to stream to + */ + rtmp_url?: string; + } + + export interface RealtimekitBucketConfig { + /** + * Controls whether recordings are uploaded to RealtimeKit's bucket. If set to + * false, `download_url`, `audio_download_url`, `download_url_expiry` won't be + * generated for a recording. + */ + enabled: boolean; + } + + export interface StorageConfig { + /** + * Type of storage media. + */ + type: 'aws' | 'azure' | 'digitalocean' | 'gcs' | 'sftp'; + + /** + * Access key of the storage medium. Access key is not required for the `gcs` + * storage media type. + * + * Note that this field is not readable by clients, only writeable. + */ + access_key?: string; + + /** + * Authentication method used for "sftp" type storage medium + */ + auth_method?: 'KEY' | 'PASSWORD'; + + /** + * Name of the storage medium's bucket. + */ + bucket?: string; + + /** + * SSH destination server host for SFTP type storage medium + */ + host?: string; + + /** + * SSH destination server password for SFTP type storage medium when auth_method is + * "PASSWORD". If auth_method is "KEY", this specifies the password for the ssh + * private key. + */ + password?: string; + + /** + * Path relative to the bucket root at which the recording will be placed. + */ + path?: string; + + /** + * SSH destination server port for SFTP type storage medium + */ + port?: number; + + /** + * Private key used to login to destination SSH server for SFTP type storage + * medium, when auth_method used is "KEY" + */ + private_key?: string; + + /** + * Region of the storage medium. + */ + region?: string; + + /** + * Secret key of the storage medium. Similar to `access_key`, it is only writeable + * by clients, not readable. + */ + secret?: string; + + /** + * SSH destination server username for SFTP type storage medium + */ + username?: string; + } + + export interface VideoConfig { + /** + * Codec using which the recording will be encoded. + */ + codec?: 'H264' | 'VP8'; + + /** + * Controls whether to export video file seperately + */ + export_file?: boolean; + + /** + * Height of the recording video in pixels + */ + height?: number; + + /** + * Watermark to be added to the recording + */ + watermark?: VideoConfig.Watermark; + + /** + * Width of the recording video in pixels + */ + width?: number; + } + + export namespace VideoConfig { + /** + * Watermark to be added to the recording + */ + export interface Watermark { + /** + * Position of the watermark + */ + position?: 'left top' | 'right top' | 'left bottom' | 'right bottom'; + + /** + * Size of the watermark + */ + size?: Watermark.Size; + + /** + * URL of the watermark image + */ + url?: string; + } + + export namespace Watermark { + /** + * Size of the watermark + */ + export interface Size { + /** + * Height of the watermark in px + */ + height?: number; + + /** + * Width of the watermark in px + */ + width?: number; + } + } + } + } } export declare namespace Meetings { diff --git a/src/resources/realtime-kit/realtime-kit.ts b/src/resources/realtime-kit/realtime-kit.ts index 1023be36b9..a4f5f6d67c 100644 --- a/src/resources/realtime-kit/realtime-kit.ts +++ b/src/resources/realtime-kit/realtime-kit.ts @@ -27,6 +27,8 @@ import { LivestreamGetAllLivestreamsResponse, LivestreamGetLivestreamAnalyticsCompleteParams, LivestreamGetLivestreamAnalyticsCompleteResponse, + LivestreamGetLivestreamAnalyticsDaywiseParams, + LivestreamGetLivestreamAnalyticsDaywiseResponse, LivestreamGetLivestreamSessionDetailsForSessionIDParams, LivestreamGetLivestreamSessionDetailsForSessionIDResponse, LivestreamGetLivestreamSessionForLivestreamIDParams, @@ -275,6 +277,7 @@ export declare namespace RealtimeKit { type LivestreamGetActiveLivestreamsForLivestreamIDResponse as LivestreamGetActiveLivestreamsForLivestreamIDResponse, type LivestreamGetAllLivestreamsResponse as LivestreamGetAllLivestreamsResponse, type LivestreamGetLivestreamAnalyticsCompleteResponse as LivestreamGetLivestreamAnalyticsCompleteResponse, + type LivestreamGetLivestreamAnalyticsDaywiseResponse as LivestreamGetLivestreamAnalyticsDaywiseResponse, type LivestreamGetLivestreamSessionDetailsForSessionIDResponse as LivestreamGetLivestreamSessionDetailsForSessionIDResponse, type LivestreamGetLivestreamSessionForLivestreamIDResponse as LivestreamGetLivestreamSessionForLivestreamIDResponse, type LivestreamGetMeetingActiveLivestreamsResponse as LivestreamGetMeetingActiveLivestreamsResponse, @@ -285,6 +288,7 @@ export declare namespace RealtimeKit { type LivestreamGetActiveLivestreamsForLivestreamIDParams as LivestreamGetActiveLivestreamsForLivestreamIDParams, type LivestreamGetAllLivestreamsParams as LivestreamGetAllLivestreamsParams, type LivestreamGetLivestreamAnalyticsCompleteParams as LivestreamGetLivestreamAnalyticsCompleteParams, + type LivestreamGetLivestreamAnalyticsDaywiseParams as LivestreamGetLivestreamAnalyticsDaywiseParams, type LivestreamGetLivestreamSessionDetailsForSessionIDParams as LivestreamGetLivestreamSessionDetailsForSessionIDParams, type LivestreamGetLivestreamSessionForLivestreamIDParams as LivestreamGetLivestreamSessionForLivestreamIDParams, type LivestreamGetMeetingActiveLivestreamsParams as LivestreamGetMeetingActiveLivestreamsParams, diff --git a/src/resources/realtime-kit/recordings.ts b/src/resources/realtime-kit/recordings.ts index 6f7e6cc1c7..f404a70ca0 100644 --- a/src/resources/realtime-kit/recordings.ts +++ b/src/resources/realtime-kit/recordings.ts @@ -607,6 +607,13 @@ export namespace RecordingGetRecordingsResponse { */ record_on_start?: boolean; + /** + * Recording Configurations to be used for this meeting. This level of configs + * takes higher preference over App level configs on the RealtimeKit developer + * portal. + */ + recording_config?: Meeting.RecordingConfig; + /** * Time in seconds, for which a session remains active, after the last participant * has left the meeting. @@ -629,6 +636,211 @@ export namespace RecordingGetRecordingsResponse { * Title of the meeting. */ title?: string; + + /** + * Automatically generate transcripts when the meeting ends. + */ + transcribe_on_end?: boolean; + } + + export namespace Meeting { + /** + * Recording Configurations to be used for this meeting. This level of configs + * takes higher preference over App level configs on the RealtimeKit developer + * portal. + */ + export interface RecordingConfig { + /** + * Object containing configuration regarding the audio that is being recorded. + */ + audio_config?: RecordingConfig.AudioConfig; + + /** + * Adds a prefix to the beginning of the file name of the recording. + */ + file_name_prefix?: string; + + live_streaming_config?: RecordingConfig.LiveStreamingConfig; + + /** + * Specifies the maximum duration for recording in seconds, ranging from a minimum + * of 60 seconds to a maximum of 24 hours. + */ + max_seconds?: number; + + realtimekit_bucket_config?: RecordingConfig.RealtimekitBucketConfig; + + storage_config?: RecordingConfig.StorageConfig | null; + + video_config?: RecordingConfig.VideoConfig; + } + + export namespace RecordingConfig { + /** + * Object containing configuration regarding the audio that is being recorded. + */ + export interface AudioConfig { + /** + * Audio signal pathway within an audio file that carries a specific sound source. + */ + channel?: 'mono' | 'stereo'; + + /** + * Codec using which the recording will be encoded. If VP8/VP9 is selected for + * videoConfig, changing audioConfig is not allowed. In this case, the codec in the + * audioConfig is automatically set to vorbis. + */ + codec?: 'MP3' | 'AAC'; + + /** + * Controls whether to export audio file seperately + */ + export_file?: boolean; + } + + export interface LiveStreamingConfig { + /** + * RTMP URL to stream to + */ + rtmp_url?: string; + } + + export interface RealtimekitBucketConfig { + /** + * Controls whether recordings are uploaded to RealtimeKit's bucket. If set to + * false, `download_url`, `audio_download_url`, `download_url_expiry` won't be + * generated for a recording. + */ + enabled: boolean; + } + + export interface StorageConfig { + /** + * Type of storage media. + */ + type: 'aws' | 'azure' | 'digitalocean' | 'gcs' | 'sftp'; + + /** + * Authentication method used for "sftp" type storage medium + */ + auth_method?: 'KEY' | 'PASSWORD'; + + /** + * Name of the storage medium's bucket. + */ + bucket?: string; + + /** + * SSH destination server host for SFTP type storage medium + */ + host?: string; + + /** + * SSH destination server password for SFTP type storage medium when auth_method is + * "PASSWORD". If auth_method is "KEY", this specifies the password for the ssh + * private key. + */ + password?: string; + + /** + * Path relative to the bucket root at which the recording will be placed. + */ + path?: string; + + /** + * SSH destination server port for SFTP type storage medium + */ + port?: number; + + /** + * Private key used to login to destination SSH server for SFTP type storage + * medium, when auth_method used is "KEY" + */ + private_key?: string; + + /** + * Region of the storage medium. + */ + region?: string; + + /** + * Secret key of the storage medium. Similar to `access_key`, it is only writeable + * by clients, not readable. + */ + secret?: string; + + /** + * SSH destination server username for SFTP type storage medium + */ + username?: string; + } + + export interface VideoConfig { + /** + * Codec using which the recording will be encoded. + */ + codec?: 'H264' | 'VP8'; + + /** + * Controls whether to export video file seperately + */ + export_file?: boolean; + + /** + * Height of the recording video in pixels + */ + height?: number; + + /** + * Watermark to be added to the recording + */ + watermark?: VideoConfig.Watermark; + + /** + * Width of the recording video in pixels + */ + width?: number; + } + + export namespace VideoConfig { + /** + * Watermark to be added to the recording + */ + export interface Watermark { + /** + * Position of the watermark + */ + position?: 'left top' | 'right top' | 'left bottom' | 'right bottom'; + + /** + * Size of the watermark + */ + size?: Watermark.Size; + + /** + * URL of the watermark image + */ + url?: string; + } + + export namespace Watermark { + /** + * Size of the watermark + */ + export interface Size { + /** + * Height of the watermark in px + */ + height?: number; + + /** + * Width of the watermark in px + */ + width?: number; + } + } + } + } } export interface StorageConfig { diff --git a/src/resources/realtime-kit/sessions.ts b/src/resources/realtime-kit/sessions.ts index a89a1bd01b..801959dba4 100644 --- a/src/resources/realtime-kit/sessions.ts +++ b/src/resources/realtime-kit/sessions.ts @@ -11,7 +11,7 @@ export class Sessions extends APIResource { * ```ts * await client.realtimeKit.sessions.generateSummaryOfTranscripts( * 'app_id', - * 'session_id', + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -38,7 +38,7 @@ export class Sessions extends APIResource { * const response = * await client.realtimeKit.sessions.getParticipantDataFromPeerId( * 'app_id', - * 'peer_id', + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -64,7 +64,7 @@ export class Sessions extends APIResource { * const response = * await client.realtimeKit.sessions.getSessionChat( * 'app_id', - * 'session_id', + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -90,7 +90,7 @@ export class Sessions extends APIResource { * const response = * await client.realtimeKit.sessions.getSessionDetails( * 'app_id', - * 'session_id', + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -117,8 +117,8 @@ export class Sessions extends APIResource { * const response = * await client.realtimeKit.sessions.getSessionParticipantDetails( * 'app_id', - * 'session_id', - * 'participant_id', + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -145,7 +145,7 @@ export class Sessions extends APIResource { * const response = * await client.realtimeKit.sessions.getSessionParticipants( * 'app_id', - * 'session_id', + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -172,7 +172,7 @@ export class Sessions extends APIResource { * const response = * await client.realtimeKit.sessions.getSessionSummary( * 'app_id', - * 'session_id', + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -198,7 +198,7 @@ export class Sessions extends APIResource { * const response = * await client.realtimeKit.sessions.getSessionTranscripts( * 'app_id', - * 'session_id', + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -245,494 +245,76 @@ export interface SessionGetParticipantDataFromPeerIDResponse { export namespace SessionGetParticipantDataFromPeerIDResponse { export interface Data { - participant?: Data.Participant; - } - - export namespace Data { - export interface Participant { - id?: string; - - created_at?: string; - - custom_participant_id?: string; - - display_name?: string; - - duration?: number; - - joined_at?: string; - - left_at?: string; - - peer_report?: Participant.PeerReport; - - peer_stats?: Participant.PeerStats; - - quality_stats?: Participant.QualityStats; - - role?: string; - - updated_at?: string; - - user_id?: string; - } - - export namespace Participant { - export interface PeerReport { - metadata?: PeerReport.Metadata; - - quality?: PeerReport.Quality; - } - - export namespace PeerReport { - export interface Metadata { - audio_devices_updates?: Array; - - browser_metadata?: Metadata.BrowserMetadata; - - candidate_pairs?: Metadata.CandidatePairs; - - device_info?: Metadata.DeviceInfo; - - events?: Array; - - ip_information?: Metadata.IPInformation; - - pc_metadata?: Array; - - room_view_type?: string; - - sdk_name?: string; - - sdk_version?: string; - - selected_device_updates?: Array; - - speaker_devices_updates?: Array; - - video_devices_updates?: Array; - } - - export namespace Metadata { - export interface BrowserMetadata { - browser?: string; - - browser_version?: string; - - engine?: string; - - user_agent?: string; - - webgl_support?: string; - } - - export interface CandidatePairs { - consuming_transport?: Array; - - producing_transport?: Array; - } - - export namespace CandidatePairs { - export interface ProducingTransport { - available_outgoing_bitrate?: number; - - bytes_discarded_on_send?: number; - - bytes_received?: number; - - bytes_sent?: number; - - current_round_trip_time?: number; - - last_packet_received_timestamp?: number; - - last_packet_sent_timestamp?: number; - - local_candidate_address?: string; - - local_candidate_id?: string; - - local_candidate_network_type?: string; - - local_candidate_port?: number; - - local_candidate_protocol?: string; - - local_candidate_related_address?: string; - - local_candidate_related_port?: number; - - local_candidate_type?: string; - - nominated?: boolean; - - packets_discarded_on_send?: number; - - packets_received?: number; - - packets_sent?: number; - - remote_candidate_address?: string; - - remote_candidate_id?: string; - - remote_candidate_port?: number; - - remote_candidate_protocol?: string; - - remote_candidate_type?: string; - - total_round_trip_time?: number; - } - } - - export interface DeviceInfo { - cpus?: number; - - is_mobile?: boolean; - - os?: string; - - os_version?: string; - } - - export interface Event { - name?: string; - - timestamp?: string; - } - - export interface IPInformation { - asn?: IPInformation.ASN; - - city?: string; - - country?: string; - - ipv4?: string; - - region?: string; - - timezone?: string; - } - - export namespace IPInformation { - export interface ASN { - asn?: string; - } - } - - export interface PcMetadata { - effective_network_type?: string; - - reflexive_connectivity?: boolean; - - relay_connectivity?: boolean; - - timestamp?: string; - - turn_connectivity?: boolean; - } - } - - export interface Quality { - audio_consumer?: Array; - - audio_consumer_cumulative?: unknown; - - audio_producer?: Array; - - audio_producer_cumulative?: Quality.AudioProducerCumulative; - - screenshare_audio_consumer?: Array; - - screenshare_audio_consumer_cumulative?: unknown; - - screenshare_audio_producer?: Array; - - screenshare_audio_producer_cumulative?: unknown; - - screenshare_video_consumer?: Array; - - screenshare_video_consumer_cumulative?: unknown; - - screenshare_video_producer?: Array; - - screenshare_video_producer_cumulative?: unknown; - - video_consumer?: Array; - - video_consumer_cumulative?: unknown; - - video_producer?: Array; - - video_producer_cumulative?: unknown; - } - - export namespace Quality { - export interface AudioProducer { - bytes_sent?: number; - - jitter?: number; - - mid?: string; - - mos_quality?: number; - - packets_lost?: number; - - packets_sent?: number; - - producer_id?: string; - - rtt?: number; - - ssrc?: number; - - timestamp?: string; - } - - export interface AudioProducerCumulative { - packet_loss?: AudioProducerCumulative.PacketLoss; - - quality_mos?: AudioProducerCumulative.QualityMos; - - rtt?: AudioProducerCumulative.RTT; - } - - export namespace AudioProducerCumulative { - export interface PacketLoss { - '10_or_greater_event_fraction'?: number; - - '25_or_greater_event_fraction'?: number; - - '5_or_greater_event_fraction'?: number; - - '50_or_greater_event_fraction'?: number; - - avg?: number; - } - - export interface QualityMos { - avg?: number; - - p50?: number; - - p75?: number; - - p90?: number; - } - - export interface RTT { - '100ms_or_greater_event_fraction'?: number; - - '250ms_or_greater_event_fraction'?: number; - - '500ms_or_greater_event_fraction'?: number; - - avg?: number; - } - } - } - } - - export interface PeerStats { - device_info?: PeerStats.DeviceInfo; - - events?: Array; - - ip_information?: PeerStats.IPInformation; - - precall_network_information?: PeerStats.PrecallNetworkInformation; - } - - export namespace PeerStats { - export interface DeviceInfo { - browser?: string; - - browser_version?: string; - - cpus?: number; - - engine?: string; - - is_mobile?: boolean; - - os?: string; - - os_version?: string; - - sdk_name?: string; - - sdk_version?: string; - - user_agent?: string; - - webgl_support?: string; - } - - export interface Event { - metadata?: Event.Metadata; - - timestamp?: string; - - type?: string; - } - - export namespace Event { - export interface Metadata { - connection_info?: Metadata.ConnectionInfo; - } - - export namespace Metadata { - export interface ConnectionInfo { - backend_r_t_t?: number; - - connectivity?: ConnectionInfo.Connectivity; - - effective_network_type?: string; - - fractional_loss?: number; - - ip_details?: ConnectionInfo.IPDetails; - - jitter?: number; - - location?: ConnectionInfo.Location; - - r_t_t?: number; - - throughput?: number; - - turn_connectivity?: boolean; - } - - export namespace ConnectionInfo { - export interface Connectivity { - host?: boolean; - - reflexive?: boolean; - - relay?: boolean; - } - - export interface IPDetails { - asn?: IPDetails.ASN; - - city?: string; - - country?: string; - - ip?: string; - - loc?: string; - - postal?: string; - - region?: string; - - timezone?: string; - } - - export namespace IPDetails { - export interface ASN { - asn?: string; - } - } - - export interface Location { - coords?: Location.Coords; - } - - export namespace Location { - export interface Coords { - latitude?: number; - - longitude?: number; - } - } - } - } - } - - export interface IPInformation { - asn?: IPInformation.ASN; - - city?: string; - - country?: string; - - ip_location?: string; - - ipv4?: string; - - org?: string; - - region?: string; - - timezone?: string; - } - - export namespace IPInformation { - export interface ASN { - asn?: string; - } - } - - export interface PrecallNetworkInformation { - backend_rtt?: number; - - effective_networktype?: string; - - fractional_loss?: number; - - jitter?: number; - - reflexive_connectivity?: boolean; - - relay_connectivity?: boolean; - - rtt?: number; - - throughput?: number; - - turn_connectivity?: boolean; - } - } - - export interface QualityStats { - audio_bandwidth?: number; + /** + * Participant ID. This maps to the corresponding peerId. + */ + id?: string; - audio_stats?: Array; + /** + * timestamp when this participant was created. + */ + created_at?: string; - average_quality?: number; + /** + * ID passed by client to create this participant. + */ + custom_participant_id?: string; - end?: string | null; + /** + * Display name of participant when joining the session. + */ + display_name?: string; - first_audio_packet_received?: string; + /** + * number of minutes for which the participant was in the session. + */ + duration?: number; - first_video_packet_received?: string; + /** + * timestamp at which participant joined the session. + */ + joined_at?: string; - last_audio_packet_received?: string; + /** + * timestamp at which participant left the session. + */ + left_at?: string; - last_video_packet_received?: string; + peer_events?: Array<{ [key: string]: unknown }>; - peer_ids?: Array; + /** + * Peer call statistics report. + */ + peer_report?: Data.PeerReport; - start?: string | null; + /** + * Name of the preset associated with the participant. + */ + preset_name?: string; - total_audio_packets?: number; + session_id?: string; - total_audio_packets_lost?: number; + /** + * timestamp when this participant's data was last updated. + */ + updated_at?: string; - total_video_packets?: number; + /** + * User id for this participant. + */ + user_id?: string; + } - total_video_packets_lost?: number; + export namespace Data { + /** + * Peer call statistics report. + */ + export interface PeerReport { + metadata?: { [key: string]: unknown }; - video_bandwidth?: number; + quality?: { [key: string]: unknown }; - video_stats?: Array; - } + [k: string]: unknown; } } } @@ -765,85 +347,79 @@ export interface SessionGetSessionDetailsResponse { export namespace SessionGetSessionDetailsResponse { export interface Data { - session?: Data.Session; - } - - export namespace Data { - export interface Session { - /** - * ID of the session - */ - id: string; + /** + * ID of the session + */ + id: string; - /** - * ID of the meeting this session is associated with. In the case of V2 meetings, - * it is always a UUID. In V1 meetings, it is a room name of the form - * `abcdef-ghijkl` - */ - associated_id: string; + /** + * ID of the meeting this session is associated with. In the case of V2 meetings, + * it is always a UUID. In V1 meetings, it is a room name of the form + * `abcdef-ghijkl` + */ + associated_id: string; - /** - * timestamp when session created - */ - created_at: string; + /** + * timestamp when session created + */ + created_at: string; - /** - * number of participants currently in the session - */ - live_participants: number; + /** + * number of participants currently in the session + */ + live_participants: number; - /** - * number of maximum participants that were in the session - */ - max_concurrent_participants: number; + /** + * number of maximum participants that were in the session + */ + max_concurrent_participants: number; - /** - * Title of the meeting this session belongs to - */ - meeting_display_name: string; + /** + * Title of the meeting this session belongs to + */ + meeting_display_name: string; - /** - * number of minutes consumed since the session started - */ - minutes_consumed: number; + /** + * number of minutes consumed since the session started + */ + minutes_consumed: number; - /** - * App id that hosted this session - */ - organization_id: string; + /** + * App id that hosted this session + */ + organization_id: string; - /** - * timestamp when session started - */ - started_at: string; + /** + * timestamp when session started + */ + started_at: string; - /** - * current status of session - */ - status: 'LIVE' | 'ENDED'; + /** + * current status of session + */ + status: 'LIVE' | 'ENDED'; - /** - * type of session - */ - type: 'meeting' | 'livestream' | 'participant'; + /** + * type of session + */ + type: 'meeting' | 'livestream' | 'participant'; - /** - * timestamp when session was last updated - */ - updated_at: string; + /** + * timestamp when session was last updated + */ + updated_at: string; - breakout_rooms?: Array; + breakout_rooms?: Array; - /** - * timestamp when session ended - */ - ended_at?: string; + /** + * timestamp when session ended + */ + ended_at?: string; - /** - * Any meta data about session. - */ - meta?: unknown; - } + /** + * Any meta data about session. + */ + meta?: unknown; } } @@ -895,15 +471,11 @@ export namespace SessionGetSessionParticipantDetailsResponse { */ left_at?: string; - peer_stats?: Participant.PeerStats; - /** * Name of the preset associated with the participant. */ preset_name?: string; - quality_stats?: Array; - /** * timestamp when this participant's data was last updated. */ @@ -914,148 +486,6 @@ export namespace SessionGetSessionParticipantDetailsResponse { */ user_id?: string; } - - export namespace Participant { - export interface PeerStats { - config?: string; - - device_info?: PeerStats.DeviceInfo; - - events?: Array; - - ip_information?: PeerStats.IPInformation; - - precall_network_information?: PeerStats.PrecallNetworkInformation; - - status?: string; - } - - export namespace PeerStats { - export interface DeviceInfo { - browser?: string; - - browser_version?: string; - - cpus?: number; - - engine?: string; - - is_mobile?: boolean; - - memory?: number; - - os?: string; - - os_version?: string; - - sdk_name?: string; - - sdk_version?: string; - - user_agent?: string; - - webgl_support?: string; - } - - export interface Event { - timestamp?: string; - - type?: string; - } - - export interface IPInformation { - city?: string; - - country?: string; - - ip_location?: string; - - ipv4?: string; - - org?: string; - - portal?: string; - - region?: string; - - timezone?: string; - } - - export interface PrecallNetworkInformation { - backend_rtt?: number; - - effective_networktype?: string; - - fractional_loss?: number; - - jitter?: number; - - reflexive_connectivity?: boolean; - - relay_connectivity?: boolean; - - rtt?: number; - - throughtput?: number; - - turn_connectivity?: boolean; - } - } - - export interface QualityStat { - audio_bandwidth?: number; - - audio_packet_loss?: number; - - audio_stats?: Array; - - average_quality?: number; - - end?: string; - - peer_id?: string; - - start?: string; - - video_bandwidth?: number; - - video_packet_loss?: number; - - video_stats?: Array; - } - - export namespace QualityStat { - export interface AudioStat { - concealment_events?: number; - - jitter?: number; - - packets_lost?: number; - - quality?: number; - - timestamp?: string; - } - - export interface VideoStat { - frame_height?: number; - - frame_width?: number; - - frames_dropped?: number; - - frames_per_second?: number; - - jitter?: number; - - packets_lost?: number; - - quality?: number; - - timestamp?: string; - } - } - } } } @@ -1172,6 +602,8 @@ export namespace SessionGetSessionTranscriptsResponse { export interface SessionGetSessionsResponse { data?: SessionGetSessionsResponse.Data; + paging?: SessionGetSessionsResponse.Paging; + success?: boolean; } @@ -1257,6 +689,14 @@ export namespace SessionGetSessionsResponse { meta?: unknown; } } + + export interface Paging { + end_offset?: number; + + start_offset?: number; + + total_count?: number; + } } export interface SessionGenerateSummaryOfTranscriptsParams { diff --git a/src/resources/resource-sharing/api.md b/src/resources/resource-sharing/api.md index 9a9590e80d..8dcf2b3241 100644 --- a/src/resources/resource-sharing/api.md +++ b/src/resources/resource-sharing/api.md @@ -37,15 +37,9 @@ Methods: Types: - ResourceCreateResponse -- ResourceUpdateResponse - ResourceListResponse -- ResourceDeleteResponse -- ResourceGetResponse Methods: - client.resourceSharing.resources.create(shareId, { ...params }) -> ResourceCreateResponse -- client.resourceSharing.resources.update(shareId, resourceId, { ...params }) -> ResourceUpdateResponse - client.resourceSharing.resources.list(shareId, { ...params }) -> ResourceListResponsesV4PagePaginationArray -- client.resourceSharing.resources.delete(shareId, resourceId, { ...params }) -> ResourceDeleteResponse -- client.resourceSharing.resources.get(shareId, resourceId, { ...params }) -> ResourceGetResponse diff --git a/src/resources/resource-sharing/index.ts b/src/resources/resource-sharing/index.ts index dc65044d98..826104e6ef 100644 --- a/src/resources/resource-sharing/index.ts +++ b/src/resources/resource-sharing/index.ts @@ -16,14 +16,8 @@ export { ResourceListResponsesV4PagePaginationArray, Resources, type ResourceCreateResponse, - type ResourceUpdateResponse, type ResourceListResponse, - type ResourceDeleteResponse, - type ResourceGetResponse, type ResourceCreateParams, - type ResourceUpdateParams, type ResourceListParams, - type ResourceDeleteParams, - type ResourceGetParams, } from './resources'; export { ResourceSharing } from './resource-sharing'; diff --git a/src/resources/resource-sharing/recipients.ts b/src/resources/resource-sharing/recipients.ts index 3a0492d4e2..8b5fd5cce1 100644 --- a/src/resources/resource-sharing/recipients.ts +++ b/src/resources/resource-sharing/recipients.ts @@ -338,7 +338,8 @@ export interface RecipientCreateParams { path_account_id: string; /** - * Body param: Account identifier. + * @deprecated This field has been renamed to `recipient_account_id`. Both names + * are accepted during the deprecation period. */ body_account_id?: string; @@ -346,6 +347,11 @@ export interface RecipientCreateParams { * Body param: Organization identifier. */ organization_id?: string; + + /** + * Body param: The account that will receive the share. + */ + recipient_account_id?: string; } export interface RecipientListParams extends V4PagePaginationArrayParams { diff --git a/src/resources/resource-sharing/resource-sharing.ts b/src/resources/resource-sharing/resource-sharing.ts index 419f3b97b5..cbab9ce2f5 100644 --- a/src/resources/resource-sharing/resource-sharing.ts +++ b/src/resources/resource-sharing/resource-sharing.ts @@ -19,15 +19,9 @@ import * as ResourcesAPI from './resources'; import { ResourceCreateParams, ResourceCreateResponse, - ResourceDeleteParams, - ResourceDeleteResponse, - ResourceGetParams, - ResourceGetResponse, ResourceListParams, ResourceListResponse, ResourceListResponsesV4PagePaginationArray, - ResourceUpdateParams, - ResourceUpdateResponse, Resources, } from './resources'; import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; @@ -842,11 +836,16 @@ export interface ResourceSharingCreateParams { export namespace ResourceSharingCreateParams { /** - * Account or organization ID must be provided. + * Optionally specify `recipient_account_id` to target a specific account, or + * `organization_id` to target the caller's whole organization. If neither is + * provided, the caller's organization is used. The legacy field `account_id` is + * accepted as a synonym for `recipient_account_id` during the deprecation period + * (see `x-sunset` on that field). */ export interface Recipient { /** - * Account identifier. + * @deprecated This field has been renamed to `recipient_account_id`. Both names + * are accepted during the deprecation period. */ account_id?: string; @@ -854,6 +853,11 @@ export namespace ResourceSharingCreateParams { * Organization identifier. */ organization_id?: string; + + /** + * The account that will receive the share. + */ + recipient_account_id?: string; } export interface Resource { @@ -1021,15 +1025,9 @@ export declare namespace ResourceSharing { export { Resources as Resources, type ResourceCreateResponse as ResourceCreateResponse, - type ResourceUpdateResponse as ResourceUpdateResponse, type ResourceListResponse as ResourceListResponse, - type ResourceDeleteResponse as ResourceDeleteResponse, - type ResourceGetResponse as ResourceGetResponse, ResourceListResponsesV4PagePaginationArray as ResourceListResponsesV4PagePaginationArray, type ResourceCreateParams as ResourceCreateParams, - type ResourceUpdateParams as ResourceUpdateParams, type ResourceListParams as ResourceListParams, - type ResourceDeleteParams as ResourceDeleteParams, - type ResourceGetParams as ResourceGetParams, }; } diff --git a/src/resources/resource-sharing/resources.ts b/src/resources/resource-sharing/resources.ts index 22b54abff7..72b92117a5 100644 --- a/src/resources/resource-sharing/resources.ts +++ b/src/resources/resource-sharing/resources.ts @@ -38,38 +38,6 @@ export class Resources extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Update is not immediate, an updated share resource object with a new status will - * be returned. - * - * @example - * ```ts - * const resource = - * await client.resourceSharing.resources.update( - * '3fd85f74b32742f1bff64a85009dda07', - * '023e105f4ecef8ad9ca31a8372d0c353', - * { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * meta: {}, - * }, - * ); - * ``` - */ - update( - shareId: string, - resourceId: string, - params: ResourceUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.put(`/accounts/${account_id}/shares/${shareId}/resources/${resourceId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: ResourceUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * List share resources by share ID. * @@ -96,62 +64,6 @@ export class Resources extends APIResource { { query, ...options }, ); } - - /** - * Deletion is not immediate, an updated share resource object with a new status - * will be returned. - * - * @example - * ```ts - * const resource = - * await client.resourceSharing.resources.delete( - * '3fd85f74b32742f1bff64a85009dda07', - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - delete( - shareId: string, - resourceId: string, - params: ResourceDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.delete( - `/accounts/${account_id}/shares/${shareId}/resources/${resourceId}`, - options, - ) as Core.APIPromise<{ result: ResourceDeleteResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Get share resource by ID. - * - * @example - * ```ts - * const resource = await client.resourceSharing.resources.get( - * '3fd85f74b32742f1bff64a85009dda07', - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - get( - shareId: string, - resourceId: string, - params: ResourceGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/shares/${shareId}/resources/${resourceId}`, - options, - ) as Core.APIPromise<{ result: ResourceGetResponse }> - )._thenUnwrap((obj) => obj.result); - } } export class ResourceListResponsesV4PagePaginationArray extends V4PagePaginationArray {} @@ -209,59 +121,6 @@ export interface ResourceCreateResponse { status: 'active' | 'deleting' | 'deleted'; } -export interface ResourceUpdateResponse { - /** - * Share Resource identifier. - */ - id: string; - - /** - * When the share was created. - */ - created: string; - - /** - * Resource Metadata. - */ - meta: unknown; - - /** - * When the share was modified. - */ - modified: string; - - /** - * Account identifier. - */ - resource_account_id: string; - - /** - * Share Resource identifier. - */ - resource_id: string; - - /** - * Resource Type. - */ - resource_type: - | 'custom-ruleset' - | 'gateway-policy' - | 'gateway-destination-ip' - | 'gateway-block-page-settings' - | 'gateway-extended-email-matching' - | 'idp-federation-grant'; - - /** - * Resource Version. - */ - resource_version: number; - - /** - * Resource Status. - */ - status: 'active' | 'deleting' | 'deleted'; -} - export interface ResourceListResponse { /** * Share Resource identifier. @@ -315,112 +174,6 @@ export interface ResourceListResponse { status: 'active' | 'deleting' | 'deleted'; } -export interface ResourceDeleteResponse { - /** - * Share Resource identifier. - */ - id: string; - - /** - * When the share was created. - */ - created: string; - - /** - * Resource Metadata. - */ - meta: unknown; - - /** - * When the share was modified. - */ - modified: string; - - /** - * Account identifier. - */ - resource_account_id: string; - - /** - * Share Resource identifier. - */ - resource_id: string; - - /** - * Resource Type. - */ - resource_type: - | 'custom-ruleset' - | 'gateway-policy' - | 'gateway-destination-ip' - | 'gateway-block-page-settings' - | 'gateway-extended-email-matching' - | 'idp-federation-grant'; - - /** - * Resource Version. - */ - resource_version: number; - - /** - * Resource Status. - */ - status: 'active' | 'deleting' | 'deleted'; -} - -export interface ResourceGetResponse { - /** - * Share Resource identifier. - */ - id: string; - - /** - * When the share was created. - */ - created: string; - - /** - * Resource Metadata. - */ - meta: unknown; - - /** - * When the share was modified. - */ - modified: string; - - /** - * Account identifier. - */ - resource_account_id: string; - - /** - * Share Resource identifier. - */ - resource_id: string; - - /** - * Resource Type. - */ - resource_type: - | 'custom-ruleset' - | 'gateway-policy' - | 'gateway-destination-ip' - | 'gateway-block-page-settings' - | 'gateway-extended-email-matching' - | 'idp-federation-grant'; - - /** - * Resource Version. - */ - resource_version: number; - - /** - * Resource Status. - */ - status: 'active' | 'deleting' | 'deleted'; -} - export interface ResourceCreateParams { /** * Path param: Account identifier. @@ -454,18 +207,6 @@ export interface ResourceCreateParams { | 'idp-federation-grant'; } -export interface ResourceUpdateParams { - /** - * Path param: Account identifier. - */ - account_id: string; - - /** - * Body param: Resource Metadata. - */ - meta: unknown; -} - export interface ResourceListParams extends V4PagePaginationArrayParams { /** * Path param: Account identifier. @@ -489,34 +230,14 @@ export interface ResourceListParams extends V4PagePaginationArrayParams { status?: 'active' | 'deleting' | 'deleted'; } -export interface ResourceDeleteParams { - /** - * Account identifier. - */ - account_id: string; -} - -export interface ResourceGetParams { - /** - * Account identifier. - */ - account_id: string; -} - Resources.ResourceListResponsesV4PagePaginationArray = ResourceListResponsesV4PagePaginationArray; export declare namespace Resources { export { type ResourceCreateResponse as ResourceCreateResponse, - type ResourceUpdateResponse as ResourceUpdateResponse, type ResourceListResponse as ResourceListResponse, - type ResourceDeleteResponse as ResourceDeleteResponse, - type ResourceGetResponse as ResourceGetResponse, ResourceListResponsesV4PagePaginationArray as ResourceListResponsesV4PagePaginationArray, type ResourceCreateParams as ResourceCreateParams, - type ResourceUpdateParams as ResourceUpdateParams, type ResourceListParams as ResourceListParams, - type ResourceDeleteParams as ResourceDeleteParams, - type ResourceGetParams as ResourceGetParams, }; } diff --git a/src/resources/shared.ts b/src/resources/shared.ts index d6400024fa..93e42a10fe 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -105,12 +105,12 @@ export namespace AuditLog { } /** - * The Certificate Authority that will issue the certificate + * The Certificate Authority that will issue the certificate. */ export type CertificateCA = 'digicert' | 'google' | 'lets_encrypt' | 'ssl_com'; /** - * The Certificate Authority that will issue the certificate + * The Certificate Authority that will issue the certificate. */ export type CertificateCAParam = 'digicert' | 'google' | 'lets_encrypt' | 'ssl_com'; diff --git a/src/resources/snippets/api.md b/src/resources/snippets/api.md index dd61f2a4ba..91a26d802d 100644 --- a/src/resources/snippets/api.md +++ b/src/resources/snippets/api.md @@ -27,9 +27,11 @@ Types: - RuleUpdateResponse - RuleListResponse - RuleDeleteResponse +- RuleGetResponse Methods: - client.snippets.rules.update({ ...params }) -> RuleUpdateResponse - client.snippets.rules.list({ ...params }) -> RuleListResponse - client.snippets.rules.delete({ ...params }) -> RuleDeleteResponse +- client.snippets.rules.get({ ...params }) -> RuleGetResponse diff --git a/src/resources/snippets/index.ts b/src/resources/snippets/index.ts index cee6af4eb2..479b8e17f7 100644 --- a/src/resources/snippets/index.ts +++ b/src/resources/snippets/index.ts @@ -6,8 +6,10 @@ export { type RuleUpdateResponse, type RuleListResponse, type RuleDeleteResponse, + type RuleGetResponse, type RuleUpdateParams, type RuleListParams, type RuleDeleteParams, + type RuleGetParams, } from './rules'; export { Snippets } from './snippets'; diff --git a/src/resources/snippets/rules.ts b/src/resources/snippets/rules.ts index 7f5bc962c4..ebc737807e 100644 --- a/src/resources/snippets/rules.ts +++ b/src/resources/snippets/rules.ts @@ -39,6 +39,18 @@ export class Rules extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Fetches all snippet rules belonging to the zone. + */ + get(params: RuleGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.get(`/zones/${zone_id}/snippets/snippet_rules`, options) as Core.APIPromise<{ + result: RuleGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } } /** @@ -56,6 +68,11 @@ export type RuleListResponse = unknown; */ export type RuleDeleteResponse = unknown; +/** + * Contain the response result. + */ +export type RuleGetResponse = unknown; + export interface RuleUpdateParams { /** * Path param: Use this field to specify the unique ID of the zone. @@ -109,13 +126,22 @@ export interface RuleDeleteParams { zone_id: string; } +export interface RuleGetParams { + /** + * Use this field to specify the unique ID of the zone. + */ + zone_id: string; +} + export declare namespace Rules { export { type RuleUpdateResponse as RuleUpdateResponse, type RuleListResponse as RuleListResponse, type RuleDeleteResponse as RuleDeleteResponse, + type RuleGetResponse as RuleGetResponse, type RuleUpdateParams as RuleUpdateParams, type RuleListParams as RuleListParams, type RuleDeleteParams as RuleDeleteParams, + type RuleGetParams as RuleGetParams, }; } diff --git a/src/resources/snippets/snippets.ts b/src/resources/snippets/snippets.ts index ec3ffce08d..e7c1ebbadc 100644 --- a/src/resources/snippets/snippets.ts +++ b/src/resources/snippets/snippets.ts @@ -8,6 +8,8 @@ import * as RulesAPI from './rules'; import { RuleDeleteParams, RuleDeleteResponse, + RuleGetParams, + RuleGetResponse, RuleListParams, RuleListResponse, RuleUpdateParams, @@ -222,8 +224,10 @@ export declare namespace Snippets { type RuleUpdateResponse as RuleUpdateResponse, type RuleListResponse as RuleListResponse, type RuleDeleteResponse as RuleDeleteResponse, + type RuleGetResponse as RuleGetResponse, type RuleUpdateParams as RuleUpdateParams, type RuleListParams as RuleListParams, type RuleDeleteParams as RuleDeleteParams, + type RuleGetParams as RuleGetParams, }; } diff --git a/src/resources/ssl/certificate-packs/certificate-packs.ts b/src/resources/ssl/certificate-packs/certificate-packs.ts index 06bd4a5d4b..1b51a17007 100644 --- a/src/resources/ssl/certificate-packs/certificate-packs.ts +++ b/src/resources/ssl/certificate-packs/certificate-packs.ts @@ -235,7 +235,7 @@ export interface CertificatePackCreateResponse { /** * Certificate Authority selected for the order. For information on any certificate * authority specific details or restrictions - * [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities) + * [see this page for more details](https://developers.cloudflare.com/ssl/reference/certificate-authorities). */ certificate_authority?: 'google' | 'lets_encrypt' | 'ssl_com'; @@ -499,7 +499,7 @@ export interface CertificatePackListResponse { /** * Certificate Authority selected for the order. For information on any certificate * authority specific details or restrictions - * [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities) + * [see this page for more details](https://developers.cloudflare.com/ssl/reference/certificate-authorities). */ certificate_authority?: 'google' | 'lets_encrypt' | 'ssl_com'; @@ -770,7 +770,7 @@ export interface CertificatePackEditResponse { /** * Certificate Authority selected for the order. For information on any certificate * authority specific details or restrictions - * [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities) + * [see this page for more details](https://developers.cloudflare.com/ssl/reference/certificate-authorities). */ certificate_authority?: 'google' | 'lets_encrypt' | 'ssl_com'; @@ -1034,7 +1034,7 @@ export interface CertificatePackGetResponse { /** * Certificate Authority selected for the order. For information on any certificate * authority specific details or restrictions - * [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities) + * [see this page for more details](https://developers.cloudflare.com/ssl/reference/certificate-authorities). */ certificate_authority?: 'google' | 'lets_encrypt' | 'ssl_com'; @@ -1266,7 +1266,7 @@ export interface CertificatePackCreateParams { /** * Body param: Certificate Authority selected for the order. For information on any * certificate authority specific details or restrictions - * [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities) + * [see this page for more details](https://developers.cloudflare.com/ssl/reference/certificate-authorities). */ certificate_authority: 'google' | 'lets_encrypt' | 'ssl_com'; diff --git a/src/resources/workers/api.md b/src/resources/workers/api.md index 3d3d269fcb..089788b8ee 100644 --- a/src/resources/workers/api.md +++ b/src/resources/workers/api.md @@ -262,12 +262,16 @@ Methods: Types: - TelemetryKeysResponse +- TelemetryLiveTailResponse +- TelemetryLiveTailHeartbeatResponse - TelemetryQueryResponse - TelemetryValuesResponse Methods: - client.workers.observability.telemetry.keys({ ...params }) -> TelemetryKeysResponsesSinglePage +- client.workers.observability.telemetry.liveTail({ ...params }) -> TelemetryLiveTailResponse +- client.workers.observability.telemetry.liveTailHeartbeat({ ...params }) -> TelemetryLiveTailHeartbeatResponse - client.workers.observability.telemetry.query({ ...params }) -> TelemetryQueryResponse - client.workers.observability.telemetry.values({ ...params }) -> TelemetryValuesResponsesSinglePage @@ -298,3 +302,15 @@ Methods: - client.workers.observability.queries.create({ ...params }) -> QueryCreateResponse - client.workers.observability.queries.list({ ...params }) -> QueryListResponsesSinglePage + +### SharedQueries + +Types: + +- SharedQueryCreateResponse +- SharedQueryGetResponse + +Methods: + +- client.workers.observability.sharedQueries.create({ ...params }) -> SharedQueryCreateResponse +- client.workers.observability.sharedQueries.get(id, { ...params }) -> SharedQueryGetResponse diff --git a/src/resources/workers/observability/index.ts b/src/resources/workers/observability/index.ts index bf6b2f2066..447341bfc9 100644 --- a/src/resources/workers/observability/index.ts +++ b/src/resources/workers/observability/index.ts @@ -21,14 +21,25 @@ export { type QueryCreateParams, type QueryListParams, } from './queries'; +export { + SharedQueries, + type SharedQueryCreateResponse, + type SharedQueryGetResponse, + type SharedQueryCreateParams, + type SharedQueryGetParams, +} from './shared-queries'; export { TelemetryKeysResponsesSinglePage, TelemetryValuesResponsesSinglePage, Telemetry, type TelemetryKeysResponse, + type TelemetryLiveTailResponse, + type TelemetryLiveTailHeartbeatResponse, type TelemetryQueryResponse, type TelemetryValuesResponse, type TelemetryKeysParams, + type TelemetryLiveTailParams, + type TelemetryLiveTailHeartbeatParams, type TelemetryQueryParams, type TelemetryValuesParams, } from './telemetry'; diff --git a/src/resources/workers/observability/observability.ts b/src/resources/workers/observability/observability.ts index 434b53083b..478e7ed015 100644 --- a/src/resources/workers/observability/observability.ts +++ b/src/resources/workers/observability/observability.ts @@ -23,12 +23,24 @@ import { QueryListResponse, QueryListResponsesSinglePage, } from './queries'; +import * as SharedQueriesAPI from './shared-queries'; +import { + SharedQueries, + SharedQueryCreateParams, + SharedQueryCreateResponse, + SharedQueryGetParams, + SharedQueryGetResponse, +} from './shared-queries'; import * as TelemetryAPI from './telemetry'; import { Telemetry, TelemetryKeysParams, TelemetryKeysResponse, TelemetryKeysResponsesSinglePage, + TelemetryLiveTailHeartbeatParams, + TelemetryLiveTailHeartbeatResponse, + TelemetryLiveTailParams, + TelemetryLiveTailResponse, TelemetryQueryParams, TelemetryQueryResponse, TelemetryValuesParams, @@ -40,6 +52,7 @@ export class Observability extends APIResource { telemetry: TelemetryAPI.Telemetry = new TelemetryAPI.Telemetry(this._client); destinations: DestinationsAPI.Destinations = new DestinationsAPI.Destinations(this._client); queries: QueriesAPI.Queries = new QueriesAPI.Queries(this._client); + sharedQueries: SharedQueriesAPI.SharedQueries = new SharedQueriesAPI.SharedQueries(this._client); } Observability.Telemetry = Telemetry; @@ -49,16 +62,21 @@ Observability.Destinations = Destinations; Observability.DestinationListResponsesSinglePage = DestinationListResponsesSinglePage; Observability.Queries = Queries; Observability.QueryListResponsesSinglePage = QueryListResponsesSinglePage; +Observability.SharedQueries = SharedQueries; export declare namespace Observability { export { Telemetry as Telemetry, type TelemetryKeysResponse as TelemetryKeysResponse, + type TelemetryLiveTailResponse as TelemetryLiveTailResponse, + type TelemetryLiveTailHeartbeatResponse as TelemetryLiveTailHeartbeatResponse, type TelemetryQueryResponse as TelemetryQueryResponse, type TelemetryValuesResponse as TelemetryValuesResponse, TelemetryKeysResponsesSinglePage as TelemetryKeysResponsesSinglePage, TelemetryValuesResponsesSinglePage as TelemetryValuesResponsesSinglePage, type TelemetryKeysParams as TelemetryKeysParams, + type TelemetryLiveTailParams as TelemetryLiveTailParams, + type TelemetryLiveTailHeartbeatParams as TelemetryLiveTailHeartbeatParams, type TelemetryQueryParams as TelemetryQueryParams, type TelemetryValuesParams as TelemetryValuesParams, }; @@ -84,4 +102,12 @@ export declare namespace Observability { type QueryCreateParams as QueryCreateParams, type QueryListParams as QueryListParams, }; + + export { + SharedQueries as SharedQueries, + type SharedQueryCreateResponse as SharedQueryCreateResponse, + type SharedQueryGetResponse as SharedQueryGetResponse, + type SharedQueryCreateParams as SharedQueryCreateParams, + type SharedQueryGetParams as SharedQueryGetParams, + }; } diff --git a/src/resources/workers/observability/shared-queries.ts b/src/resources/workers/observability/shared-queries.ts new file mode 100644 index 0000000000..63c1be86e2 --- /dev/null +++ b/src/resources/workers/observability/shared-queries.ts @@ -0,0 +1,1969 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; + +export class SharedQueries extends APIResource { + /** + * Shared queries store the results of a previously run query, allowing you to + * share the results with others. + * + * @example + * ```ts + * const sharedQuery = + * await client.workers.observability.sharedQueries.create({ + * account_id: 'account_id', + * queryId: 'queryId', + * timeframe: { from: 0, to: 0 }, + * }); + * ``` + */ + create( + params: SharedQueryCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/workers/observability/shared/query`, { + body, + ...options, + }) as Core.APIPromise<{ result: SharedQueryCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Shared queries store the results of a previously run query, allowing you to + * share the results with others. + * + * @example + * ```ts + * const sharedQuery = + * await client.workers.observability.sharedQueries.get( + * 'id', + * { account_id: 'account_id' }, + * ); + * ``` + */ + get( + id: string, + params: SharedQueryGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...query } = params; + return ( + this._client.get(`/accounts/${account_id}/workers/observability/shared/query/${id}`, { + query, + ...options, + }) as Core.APIPromise<{ result: SharedQueryGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SharedQueryCreateResponse { + /** + * Specify the ID of the shared query. + */ + id: string; +} + +/** + * Complete results of a query run. The populated fields depend on the requested + * view type (events, calculations, invocations, traces, or agents). + */ +export interface SharedQueryGetResponse { + /** + * Represents a single execution of a query against Workers Observability data, + * including the query definition, execution status, and performance statistics. + */ + run: SharedQueryGetResponse.Run; + + /** + * Query performance statistics from the database. Includes execution time, rows + * scanned, and bytes read. Does not include network latency. + */ + statistics: SharedQueryGetResponse.Statistics; + + /** + * Durable Object agent summaries. Present when the query view is 'agents'. Each + * entry represents an agent with its event counts and status. + */ + agents?: Array; + + /** + * Aggregated calculation results. Present when the query view is 'calculations'. + * Contains computed metrics (count, avg, p99, etc.) with optional group-by + * breakdowns and time-series data. + */ + calculations?: Array; + + /** + * Comparison calculation results from the previous time period. Present when the + * compare option is enabled. Same structure as calculations. + */ + compare?: Array; + + /** + * Individual event results. Present when the query view is 'events'. Contains the + * matching log lines and their metadata. + */ + events?: SharedQueryGetResponse.Events; + + /** + * Events grouped by invocation (request ID). Present when the query view is + * 'invocations'. Each key is a request ID mapping to all events from that + * invocation. + */ + invocations?: { [key: string]: Array }; + + /** + * Trace summaries matching the query. Present when the query view is 'traces'. + * Each entry represents a distributed trace with its spans, duration, and services + * involved. + */ + traces?: Array; +} + +export namespace SharedQueryGetResponse { + /** + * Represents a single execution of a query against Workers Observability data, + * including the query definition, execution status, and performance statistics. + */ + export interface Run { + /** + * Unique identifier for this query run. + */ + id: string; + + /** + * Cloudflare account ID that owns this query run. + */ + accountId: string; + + /** + * Whether this was a dry run (results not persisted). + */ + dry: boolean; + + /** + * Number of time-series buckets used for the query. Higher values produce more + * detailed series data. + */ + granularity: number; + + /** + * A saved query definition with its parameters, metadata, and ownership + * information. + */ + query: Run.Query; + + /** + * Current execution status of the query run. + */ + status: 'STARTED' | 'COMPLETED'; + + /** + * Time range for the query execution + */ + timeframe: Run.Timeframe; + + /** + * ID of the user who initiated the query run. + */ + userId: string; + + /** + * ISO-8601 timestamp when the query run was created. + */ + created?: string; + + /** + * Query performance statistics from the database (does not include network + * latency). + */ + statistics?: Run.Statistics; + + /** + * ISO-8601 timestamp when the query run was last updated. + */ + updated?: string; + } + + export namespace Run { + /** + * A saved query definition with its parameters, metadata, and ownership + * information. + */ + export interface Query { + id: string; + + /** + * If the query wasn't explcitly saved + */ + adhoc: boolean; + + created: string; + + createdBy: string; + + description: string | null; + + /** + * Query name + */ + name: string; + + parameters: Query.Parameters; + + updated: string; + + updatedBy: 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. Supports nested groups via kind: + * 'group'. + */ + 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 UnionMember0 { + filterCombination: 'and' | 'or' | 'AND' | 'OR'; + + filters: Array; + + kind: 'group'; + } + + /** + * A filter condition applied to query results. Use the keys and values endpoints + * to discover available fields and their values before constructing filters. + */ + export interface WorkersObservabilityFilterLeaf { + /** + * Filter field name. Use verified keys from previous query results or the keys + * endpoint. Common keys include $metadata.service, $metadata.origin, + * $metadata.trigger, $metadata.message, and $metadata.error. + */ + key: string; + + /** + * Comparison operator. String operators: includes, not_includes, starts_with, + * ends_with, regex. Existence: exists, is_null. Set membership: in, not_in + * (comma-separated values). Numeric: eq, neq, gt, gte, lt, lte. + */ + operation: + | 'includes' + | 'not_includes' + | 'starts_with' + | 'ends_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' + | 'ENDS_WITH'; + + /** + * Data type of the filter field. Must match the actual type of the key being + * filtered. + */ + type: 'string' | 'number' | 'boolean'; + + /** + * Discriminator for leaf filter nodes. Always 'filter' when present; may be + * omitted. + */ + kind?: 'filter'; + + /** + * Comparison value. Must match actual values in your data — verify with the values + * endpoint. Ensure the value type (string/number/boolean) matches the field type. + * String comparisons are case-sensitive. Regex uses RE2 syntax (no + * lookaheads/lookbehinds). + */ + 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: Needle.Value; + + isRegex?: boolean; + + matchCase?: boolean; + } + + export namespace Needle { + export interface Value {} + } + + /** + * 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'; + } + } + } + + /** + * Time range for the query execution + */ + export interface Timeframe { + /** + * Start timestamp for the query timeframe (Unix timestamp in milliseconds) + */ + from: number; + + /** + * End timestamp for the query timeframe (Unix timestamp in milliseconds) + */ + to: number; + } + + /** + * Query performance statistics from the database (does not include 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; + + /** + * The level of Adaptive Bit Rate (ABR) sampling used for the query. If empty the + * ABR level is 1 + */ + abr_level?: number; + } + } + + /** + * Query performance statistics from the database. Includes execution time, rows + * scanned, and bytes read. Does not include 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; + + /** + * The level of Adaptive Bit Rate (ABR) sampling used for the query. If empty the + * ABR level is 1 + */ + abr_level?: number; + } + + export interface Agent { + /** + * Class name of the Durable Object agent. + */ + agentClass: string; + + /** + * Breakdown of event counts by event type. + */ + eventTypeCounts: { [key: string]: number }; + + /** + * Timestamp of the earliest event from this agent in the queried window (Unix + * epoch ms). + */ + firstEventMs: number; + + /** + * Whether the agent emitted any error events in the queried window. + */ + hasErrors: boolean; + + /** + * Timestamp of the most recent event from this agent (Unix epoch ms). + */ + lastEventMs: number; + + /** + * Durable Object namespace the agent belongs to. + */ + namespace: string; + + /** + * Worker service name that hosts this agent. + */ + service: string; + + /** + * Total number of events emitted by this agent in the queried window. + */ + totalEvents: 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; + + interval: number; + + sampleInterval: number; + + value: number; + + firstSeen?: string; + + groups?: Array; + + lastSeen?: string; + } + + 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; + + interval: number; + + sampleInterval: number; + + value: number; + + firstSeen?: string; + + groups?: Array; + + lastSeen?: string; + } + + export namespace Data { + export interface Group { + key: string; + + value: string | number | boolean; + } + } + } + } + + /** + * Individual event results. Present when the query view is 'events'. Contains the + * matching log lines and their metadata. + */ + export interface Events { + /** + * Total number of events matching the query (may exceed the number returned due to + * limits). + */ + count?: number; + + /** + * List of individual telemetry events matching the query. + */ + events?: Array; + + /** + * List of fields discovered in the matched events. Useful for building dynamic + * UIs. + */ + fields?: Array; + + /** + * Time-series data for the matched events, bucketed by the query granularity. + */ + series?: Array; + } + + export namespace Events { + /** + * A single telemetry event representing a log line, span, or metric data point + * emitted by a Worker. + */ + export interface Event { + /** + * Structured metadata extracted from the event. These fields are indexed and + * available for filtering and aggregation. + */ + $metadata: Event.Metadata; + + /** + * The dataset this event belongs to (e.g. cloudflare-workers). + */ + dataset: string; + + /** + * Raw log payload. May be a string or a structured object depending on how the log + * was emitted. + */ + source: string | { [key: string]: unknown }; + + /** + * Event timestamp as a Unix epoch in milliseconds. + */ + timestamp: number; + + /** + * Cloudflare Containers event information that enriches your logs for identifying + * and debugging issues. + */ + $containers?: { [key: string]: unknown }; + + /** + * Cloudflare Workers event information that enriches your logs for identifying and + * debugging issues. + */ + $workers?: Event.UnionMember0 | Event.UnionMember1; + } + + export namespace Event { + /** + * Structured metadata extracted from the event. These fields are indexed and + * available for filtering and aggregation. + */ + export interface Metadata { + /** + * Unique event ID. Use as the cursor value for offset-based pagination. + */ + id: string; + + /** + * Cloudflare account identifier. + */ + account?: string; + + /** + * Cloudflare product that generated this event (e.g. workers, pages). + */ + cloudService?: string; + + coldStart?: number; + + /** + * Estimated cost units for this invocation. + */ + cost?: number; + + /** + * Span duration in milliseconds. + */ + duration?: number; + + /** + * Span end time as a Unix epoch in milliseconds. + */ + endTime?: number; + + /** + * Error message, present when the log represents an error. + */ + error?: string; + + /** + * Templatized version of the error message used for grouping similar errors. + */ + errorTemplate?: string; + + /** + * Content-based fingerprint used to group similar events. + */ + fingerprint?: string; + + /** + * Log level (e.g. log, debug, info, warn, error). + */ + level?: string; + + /** + * Log message text. + */ + message?: string; + + /** + * Templatized version of the log message used for grouping similar messages. + */ + messageTemplate?: string; + + /** + * Metric name when the event represents a metric data point. + */ + metricName?: string; + + /** + * Origin of the event (e.g. fetch, scheduled, queue). + */ + origin?: string; + + /** + * Span ID of the parent span in the trace hierarchy. + */ + parentSpanId?: string; + + /** + * Infrastructure provider identifier. + */ + provider?: string; + + /** + * Cloudflare data center / region that handled the request. + */ + region?: string; + + /** + * Cloudflare request ID that ties all logs from a single invocation together. + */ + requestId?: string; + + /** + * Worker script name that produced this event. + */ + service?: string; + + /** + * Span ID for this individual unit of work within a trace. + */ + spanId?: string; + + /** + * Human-readable name for this span. + */ + spanName?: string; + + /** + * Stack / deployment identifier. + */ + stackId?: string; + + /** + * Span start time as a Unix epoch in milliseconds. + */ + startTime?: number; + + /** + * HTTP response status code returned by the Worker. + */ + statusCode?: number; + + /** + * Total duration of the entire trace in milliseconds. + */ + traceDuration?: number; + + /** + * Distributed trace ID linking spans across services. + */ + traceId?: string; + + /** + * Logical transaction name for this request. + */ + transactionName?: string; + + /** + * What triggered the invocation (e.g. GET /users, POST /orders, queue message). + */ + trigger?: string; + + /** + * Event type classifier (e.g. cf-worker-event, cf-worker-log). + */ + type?: string; + + /** + * Request URL that triggered the Worker invocation. + */ + url?: string; + } + + export interface UnionMember0 { + eventType: + | 'fetch' + | 'scheduled' + | 'alarm' + | 'cron' + | 'queue' + | 'email' + | 'tail' + | 'rpc' + | 'websocket' + | 'workflow' + | 'unknown'; + + requestId: string; + + scriptName: string; + + durableObjectId?: string; + + entrypoint?: string; + + event?: { [key: string]: unknown }; + + executionModel?: 'durableObject' | 'stateless'; + + outcome?: string; + + preview?: UnionMember0.Preview; + + scriptVersion?: UnionMember0.ScriptVersion; + + spanId?: string; + + traceId?: string; + + truncated?: boolean; + } + + export namespace UnionMember0 { + export interface Preview { + id?: string; + + name?: string; + + slug?: string; + } + + export interface ScriptVersion { + id?: string; + + message?: string; + + tag?: string; + } + } + + export interface UnionMember1 { + cpuTimeMs: number; + + eventType: + | 'fetch' + | 'scheduled' + | 'alarm' + | 'cron' + | 'queue' + | 'email' + | 'tail' + | 'rpc' + | 'websocket' + | 'workflow' + | 'unknown'; + + outcome: string; + + requestId: string; + + scriptName: string; + + wallTimeMs: number; + + diagnosticsChannelEvents?: Array; + + dispatchNamespace?: string; + + durableObjectId?: string; + + entrypoint?: string; + + event?: { [key: string]: unknown }; + + executionModel?: 'durableObject' | 'stateless'; + + preview?: UnionMember1.Preview; + + scriptVersion?: UnionMember1.ScriptVersion; + + spanId?: string; + + traceId?: string; + + truncated?: boolean; + } + + export namespace UnionMember1 { + export interface DiagnosticsChannelEvent { + channel: string; + + message: string; + + timestamp: number; + } + + export interface Preview { + id?: string; + + name?: string; + + slug?: string; + } + + export interface ScriptVersion { + id?: string; + + message?: string; + + tag?: string; + } + } + } + + export interface Field { + /** + * Field name present in the matched events. + */ + key: string; + + /** + * Data type of the field (string, number, or boolean). + */ + 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 + */ + _interval: number; + + /** + * @deprecated + */ + _firstSeen?: string; + + /** + * @deprecated + */ + _lastSeen?: string; + + /** + * @deprecated + */ + bin?: unknown; + } + } + } + } + + /** + * A single telemetry event representing a log line, span, or metric data point + * emitted by a Worker. + */ + export interface Invocation { + /** + * Structured metadata extracted from the event. These fields are indexed and + * available for filtering and aggregation. + */ + $metadata: Invocation.Metadata; + + /** + * The dataset this event belongs to (e.g. cloudflare-workers). + */ + dataset: string; + + /** + * Raw log payload. May be a string or a structured object depending on how the log + * was emitted. + */ + source: string | { [key: string]: unknown }; + + /** + * Event timestamp as a Unix epoch in milliseconds. + */ + timestamp: number; + + /** + * Cloudflare Containers event information that enriches your logs for identifying + * and debugging issues. + */ + $containers?: { [key: string]: unknown }; + + /** + * Cloudflare Workers event information that enriches your logs for identifying and + * debugging issues. + */ + $workers?: Invocation.UnionMember0 | Invocation.UnionMember1; + } + + export namespace Invocation { + /** + * Structured metadata extracted from the event. These fields are indexed and + * available for filtering and aggregation. + */ + export interface Metadata { + /** + * Unique event ID. Use as the cursor value for offset-based pagination. + */ + id: string; + + /** + * Cloudflare account identifier. + */ + account?: string; + + /** + * Cloudflare product that generated this event (e.g. workers, pages). + */ + cloudService?: string; + + coldStart?: number; + + /** + * Estimated cost units for this invocation. + */ + cost?: number; + + /** + * Span duration in milliseconds. + */ + duration?: number; + + /** + * Span end time as a Unix epoch in milliseconds. + */ + endTime?: number; + + /** + * Error message, present when the log represents an error. + */ + error?: string; + + /** + * Templatized version of the error message used for grouping similar errors. + */ + errorTemplate?: string; + + /** + * Content-based fingerprint used to group similar events. + */ + fingerprint?: string; + + /** + * Log level (e.g. log, debug, info, warn, error). + */ + level?: string; + + /** + * Log message text. + */ + message?: string; + + /** + * Templatized version of the log message used for grouping similar messages. + */ + messageTemplate?: string; + + /** + * Metric name when the event represents a metric data point. + */ + metricName?: string; + + /** + * Origin of the event (e.g. fetch, scheduled, queue). + */ + origin?: string; + + /** + * Span ID of the parent span in the trace hierarchy. + */ + parentSpanId?: string; + + /** + * Infrastructure provider identifier. + */ + provider?: string; + + /** + * Cloudflare data center / region that handled the request. + */ + region?: string; + + /** + * Cloudflare request ID that ties all logs from a single invocation together. + */ + requestId?: string; + + /** + * Worker script name that produced this event. + */ + service?: string; + + /** + * Span ID for this individual unit of work within a trace. + */ + spanId?: string; + + /** + * Human-readable name for this span. + */ + spanName?: string; + + /** + * Stack / deployment identifier. + */ + stackId?: string; + + /** + * Span start time as a Unix epoch in milliseconds. + */ + startTime?: number; + + /** + * HTTP response status code returned by the Worker. + */ + statusCode?: number; + + /** + * Total duration of the entire trace in milliseconds. + */ + traceDuration?: number; + + /** + * Distributed trace ID linking spans across services. + */ + traceId?: string; + + /** + * Logical transaction name for this request. + */ + transactionName?: string; + + /** + * What triggered the invocation (e.g. GET /users, POST /orders, queue message). + */ + trigger?: string; + + /** + * Event type classifier (e.g. cf-worker-event, cf-worker-log). + */ + type?: string; + + /** + * Request URL that triggered the Worker invocation. + */ + url?: string; + } + + export interface UnionMember0 { + eventType: + | 'fetch' + | 'scheduled' + | 'alarm' + | 'cron' + | 'queue' + | 'email' + | 'tail' + | 'rpc' + | 'websocket' + | 'workflow' + | 'unknown'; + + requestId: string; + + scriptName: string; + + durableObjectId?: string; + + entrypoint?: string; + + event?: { [key: string]: unknown }; + + executionModel?: 'durableObject' | 'stateless'; + + outcome?: string; + + preview?: UnionMember0.Preview; + + scriptVersion?: UnionMember0.ScriptVersion; + + spanId?: string; + + traceId?: string; + + truncated?: boolean; + } + + export namespace UnionMember0 { + export interface Preview { + id?: string; + + name?: string; + + slug?: string; + } + + export interface ScriptVersion { + id?: string; + + message?: string; + + tag?: string; + } + } + + export interface UnionMember1 { + cpuTimeMs: number; + + eventType: + | 'fetch' + | 'scheduled' + | 'alarm' + | 'cron' + | 'queue' + | 'email' + | 'tail' + | 'rpc' + | 'websocket' + | 'workflow' + | 'unknown'; + + outcome: string; + + requestId: string; + + scriptName: string; + + wallTimeMs: number; + + diagnosticsChannelEvents?: Array; + + dispatchNamespace?: string; + + durableObjectId?: string; + + entrypoint?: string; + + event?: { [key: string]: unknown }; + + executionModel?: 'durableObject' | 'stateless'; + + preview?: UnionMember1.Preview; + + scriptVersion?: UnionMember1.ScriptVersion; + + spanId?: string; + + traceId?: string; + + truncated?: boolean; + } + + export namespace UnionMember1 { + export interface DiagnosticsChannelEvent { + channel: string; + + message: string; + + timestamp: number; + } + + export interface Preview { + id?: string; + + name?: string; + + slug?: string; + } + + export interface ScriptVersion { + id?: string; + + message?: string; + + tag?: string; + } + } + } + + export interface Trace { + /** + * Name of the root span that initiated the trace. + */ + rootSpanName: string; + + /** + * Logical transaction name for the root span. + */ + rootTransactionName: string; + + /** + * List of Worker services involved in the trace. + */ + service: Array; + + /** + * Total number of spans in the trace. + */ + spans: number; + + /** + * Total duration of the trace in milliseconds. + */ + traceDurationMs: number; + + /** + * Trace end time as a Unix epoch in milliseconds. + */ + traceEndMs: number; + + /** + * Unique identifier for the distributed trace. + */ + traceId: string; + + /** + * Trace start time as a Unix epoch in milliseconds. + */ + traceStartMs: number; + + /** + * Error messages encountered during the trace, if any. + */ + errors?: Array; + } +} + +export interface SharedQueryCreateParams { + /** + * Path param: Your Cloudflare account ID. + */ + account_id: string; + + /** + * Body param: Identifier for the query. When parameters are omitted, this ID is + * used to load a previously saved query's parameters. When providing parameters + * inline, pass any identifier (e.g. an ad-hoc ID). + */ + queryId: string; + + /** + * Body param: Timeframe for the query using Unix timestamps in milliseconds. + * Narrower timeframes produce faster responses and more specific results. + */ + timeframe: SharedQueryCreateParams.Timeframe; + + /** + * Body param: When true, includes time-series data in the response. + */ + chart?: boolean; + + /** + * Body param: When true, includes a comparison dataset from the previous time + * period of equal length. + */ + compare?: boolean; + + /** + * Body param: When true, executes the query without persisting the results. Useful + * for validation or previewing. + */ + dry?: boolean; + + /** + * Body param: Number of time-series buckets. Only used when view is + * 'calculations'. Omit to let the system auto-detect an appropriate granularity. + */ + granularity?: number; + + /** + * Body param: When true, omits time-series data from the response and returns only + * aggregated values. Reduces response size when series are not needed. + */ + ignoreSeries?: boolean; + + /** + * Body param: Maximum number of events to return when view is 'events'. Also + * controls the number of group-by rows when view is 'calculations'. + */ + limit?: number; + + /** + * Body param: Cursor for pagination in event, trace, and invocation views. Pass + * the $metadata.id of the last returned item to fetch the next page. + */ + offset?: string; + + /** + * Body param: Numeric offset for paginating grouped/pattern results (top-N lists). + * Use together with limit. Not used by cursor-based pagination. + */ + offsetBy?: number; + + /** + * Body param: Pagination direction: 'next' for forward, 'prev' for backward. + */ + offsetDirection?: string; + + /** + * Body param: Query parameters defining what data to retrieve — filters, + * calculations, group-bys, and ordering. In practice this should always be + * provided for ad-hoc queries. Only omit when executing a previously saved query + * by queryId. Use the keys and values endpoints to discover available fields + * before building filters. + */ + parameters?: SharedQueryCreateParams.Parameters; + + /** + * Body param: Controls the shape of the response. 'events': individual log lines + * matching the query. 'calculations': aggregated metrics (count, avg, p99, etc.) + * with optional group-by breakdowns and time-series. 'invocations': events grouped + * by request ID. 'traces': distributed trace summaries. 'agents': Durable Object + * agent summaries. + */ + view?: 'traces' | 'events' | 'calculations' | 'invocations' | 'requests' | 'agents'; +} + +export namespace SharedQueryCreateParams { + /** + * Timeframe for the query using Unix timestamps in milliseconds. Narrower + * timeframes produce faster responses and more specific results. + */ + export interface Timeframe { + /** + * Start timestamp for the query timeframe (Unix timestamp in milliseconds) + */ + from: number; + + /** + * End timestamp for the query timeframe (Unix timestamp in milliseconds) + */ + to: number; + } + + /** + * Query parameters defining what data to retrieve — filters, calculations, + * group-bys, and ordering. In practice this should always be provided for ad-hoc + * queries. Only omit when executing a previously saved query by queryId. Use the + * keys and values endpoints to discover available fields before building filters. + */ + export interface Parameters { + /** + * Aggregation calculations to compute (e.g. count, avg, p99). Each calculation + * produces aggregate values and optional time-series data. + */ + calculations?: Array; + + /** + * Datasets to query. Leave empty to query all available datasets. + */ + datasets?: Array; + + /** + * Logical operator for combining top-level filters: 'and' (all must match) or 'or' + * (any must match). Defaults to 'and'. + */ + filterCombination?: 'and' | 'or' | 'AND' | 'OR'; + + /** + * Filters to narrow query results. Use the keys and values endpoints to discover + * available fields before building filters. Supports nested groups via kind: + * 'group'. Maximum nesting depth is 4. + */ + filters?: Array; + + /** + * Fields to group calculation results by. Only applicable when the query view is + * 'calculations'. Produces per-group aggregate values. + */ + groupBys?: Array; + + /** + * Post-aggregation filters applied to calculation results. Use to filter groups + * after aggregation (e.g. only groups where count > 100). + */ + havings?: Array; + + /** + * Maximum number of group-by rows to return in calculation results. A value of 10 + * is a sensible default for most use cases. + */ + limit?: number; + + /** + * Full-text search expression applied across all event fields. Matches events + * containing the specified text. + */ + needle?: Parameters.Needle; + + /** + * Ordering for grouped calculation results. Only effective when a group-by is + * present. + */ + orderBy?: Parameters.OrderBy; + } + + export namespace Parameters { + export interface Calculation { + /** + * Aggregation operator to apply. Examples: count, avg, sum, min, max, median, p90, + * p95, p99, uniq, stddev, variance. + */ + 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'; + + /** + * Custom label for this calculation in the results. Useful for distinguishing + * multiple calculations. + */ + alias?: string; + + /** + * Field name to calculate over. Must exist in the data — verify with the keys + * endpoint. Omit for operators that don't require a key (e.g. count). + */ + key?: string; + + /** + * Data type of the key. Required when key is provided to ensure correct + * aggregation. + */ + keyType?: 'string' | 'number' | 'boolean'; + } + + export interface UnionMember0 { + filterCombination: 'and' | 'or' | 'AND' | 'OR'; + + filters: Array; + + kind: 'group'; + } + + export namespace UnionMember0 { + export interface UnionMember0 { + filterCombination: 'and' | 'or' | 'AND' | 'OR'; + + filters: Array; + + kind: 'group'; + } + + /** + * A filter condition applied to query results. Use the keys and values endpoints + * to discover available fields and their values before constructing filters. + */ + export interface WorkersObservabilityFilterLeaf { + /** + * Filter field name. Use verified keys from previous query results or the keys + * endpoint. Common keys include $metadata.service, $metadata.origin, + * $metadata.trigger, $metadata.message, and $metadata.error. + */ + key: string; + + /** + * Comparison operator. String operators: includes, not_includes, starts_with, + * ends_with, regex. Existence: exists, is_null. Set membership: in, not_in + * (comma-separated values). Numeric: eq, neq, gt, gte, lt, lte. + */ + operation: + | 'includes' + | 'not_includes' + | 'starts_with' + | 'ends_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' + | 'ENDS_WITH'; + + /** + * Data type of the filter field. Must match the actual type of the key being + * filtered. + */ + type: 'string' | 'number' | 'boolean'; + + /** + * Discriminator for leaf filter nodes. Always 'filter' when present; may be + * omitted. + */ + kind?: 'filter'; + + /** + * Comparison value. Must match actual values in your data — verify with the values + * endpoint. Ensure the value type (string/number/boolean) matches the field type. + * String comparisons are case-sensitive. Regex uses RE2 syntax (no + * lookaheads/lookbehinds). + */ + value?: string | number | boolean; + } + } + + /** + * A filter condition applied to query results. Use the keys and values endpoints + * to discover available fields and their values before constructing filters. + */ + export interface WorkersObservabilityFilterLeaf { + /** + * Filter field name. Use verified keys from previous query results or the keys + * endpoint. Common keys include $metadata.service, $metadata.origin, + * $metadata.trigger, $metadata.message, and $metadata.error. + */ + key: string; + + /** + * Comparison operator. String operators: includes, not_includes, starts_with, + * ends_with, regex. Existence: exists, is_null. Set membership: in, not_in + * (comma-separated values). Numeric: eq, neq, gt, gte, lt, lte. + */ + operation: + | 'includes' + | 'not_includes' + | 'starts_with' + | 'ends_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' + | 'ENDS_WITH'; + + /** + * Data type of the filter field. Must match the actual type of the key being + * filtered. + */ + type: 'string' | 'number' | 'boolean'; + + /** + * Discriminator for leaf filter nodes. Always 'filter' when present; may be + * omitted. + */ + kind?: 'filter'; + + /** + * Comparison value. Must match actual values in your data — verify with the values + * endpoint. Ensure the value type (string/number/boolean) matches the field type. + * String comparisons are case-sensitive. Regex uses RE2 syntax (no + * lookaheads/lookbehinds). + */ + value?: string | number | boolean; + } + + export interface GroupBy { + /** + * Data type of the group-by field. + */ + type: 'string' | 'number' | 'boolean'; + + /** + * Field name to group results by (e.g. $metadata.service, $metadata.statusCode). + */ + value: string; + } + + export interface Having { + /** + * Calculation alias or operator to filter on after aggregation. + */ + key: string; + + /** + * Numeric comparison operator: eq, neq, gt, gte, lt, lte. + */ + operation: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte'; + + /** + * Threshold value to compare the calculation result against. + */ + value: number; + } + + /** + * Full-text search expression applied across all event fields. Matches events + * containing the specified text. + */ + export interface Needle { + /** + * The text or pattern to search for. + */ + value: string | number | boolean; + + /** + * When true, treats the value as a regular expression (RE2 syntax). + */ + isRegex?: boolean; + + /** + * When true, performs a case-sensitive search. Defaults to case-insensitive. + */ + matchCase?: boolean; + } + + /** + * Ordering for grouped calculation results. Only effective when a group-by is + * present. + */ + export interface OrderBy { + /** + * Alias of the calculation to order results by. Must match the alias (or operator) + * of a calculation in the query. + */ + value: string; + + /** + * Sort direction: 'asc' for ascending, 'desc' for descending. + */ + order?: 'asc' | 'desc'; + } + } +} + +export interface SharedQueryGetParams { + /** + * Path param: Your Cloudflare account ID. + */ + account_id: string; + + /** + * Query param: Select the view of the query result to return, defaults to events. + */ + view?: 'events' | 'invocations' | 'calculations'; +} + +export declare namespace SharedQueries { + export { + type SharedQueryCreateResponse as SharedQueryCreateResponse, + type SharedQueryGetResponse as SharedQueryGetResponse, + type SharedQueryCreateParams as SharedQueryCreateParams, + type SharedQueryGetParams as SharedQueryGetParams, + }; +} diff --git a/src/resources/workers/observability/telemetry.ts b/src/resources/workers/observability/telemetry.ts index 91a342f6dc..04bea322ab 100644 --- a/src/resources/workers/observability/telemetry.ts +++ b/src/resources/workers/observability/telemetry.ts @@ -30,6 +30,54 @@ export class Telemetry extends APIResource { ); } + /** + * Prepare websocket server for live tail. + * + * @example + * ```ts + * const response = + * await client.workers.observability.telemetry.liveTail({ + * account_id: 'account_id', + * }); + * ``` + */ + liveTail( + params: TelemetryLiveTailParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/workers/observability/telemetry/live-tail`, { + body, + ...options, + }) as Core.APIPromise<{ result: TelemetryLiveTailResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Notify live tail that user is still eligible to receive live events. + * + * @example + * ```ts + * const response = + * await client.workers.observability.telemetry.liveTailHeartbeat( + * { account_id: 'account_id' }, + * ); + * ``` + */ + liveTailHeartbeat( + params: TelemetryLiveTailHeartbeatParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/workers/observability/telemetry/live-tail/heartbeat`, { + body, + ...options, + }) as Core.APIPromise<{ result: TelemetryLiveTailHeartbeatResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Run a temporary or saved query. * @@ -100,6 +148,15 @@ export interface TelemetryKeysResponse { type: 'string' | 'boolean' | 'number'; } +export interface TelemetryLiveTailResponse { + /** + * WebSocket URL clients connect to in order to stream live tail events. + */ + wsUrl: string; +} + +export type TelemetryLiveTailHeartbeatResponse = unknown; + /** * Complete results of a query run. The populated fields depend on the requested * view type (events, calculations, invocations, traces, or agents). @@ -1776,6 +1833,203 @@ export namespace TelemetryKeysParams { } } +export interface TelemetryLiveTailParams { + /** + * Path param: Your Cloudflare account ID. + */ + account_id: string; + + /** + * Body param: Set a flag to describe how to combine the filters on the query. + */ + filterCombination?: 'and' | 'or' | 'AND' | 'OR'; + + /** + * Body param: Apply filters to the query. Supports nested groups via kind: + * 'group'. + */ + filters?: Array< + TelemetryLiveTailParams.UnionMember0 | TelemetryLiveTailParams.WorkersObservabilityFilterLeaf + >; + + /** + * Body param + */ + scriptId?: string; +} + +export namespace TelemetryLiveTailParams { + export interface UnionMember0 { + filterCombination: 'and' | 'or' | 'AND' | 'OR'; + + filters: Array; + + kind: 'group'; + } + + export namespace UnionMember0 { + export interface UnionMember0 { + filterCombination: 'and' | 'or' | 'AND' | 'OR'; + + filters: Array; + + kind: 'group'; + } + + /** + * A filter condition applied to query results. Use the keys and values endpoints + * to discover available fields and their values before constructing filters. + */ + export interface WorkersObservabilityFilterLeaf { + /** + * Filter field name. Use verified keys from previous query results or the keys + * endpoint. Common keys include $metadata.service, $metadata.origin, + * $metadata.trigger, $metadata.message, and $metadata.error. + */ + key: string; + + /** + * Comparison operator. String operators: includes, not_includes, starts_with, + * ends_with, regex. Existence: exists, is_null. Set membership: in, not_in + * (comma-separated values). Numeric: eq, neq, gt, gte, lt, lte. + */ + operation: + | 'includes' + | 'not_includes' + | 'starts_with' + | 'ends_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' + | 'ENDS_WITH'; + + /** + * Data type of the filter field. Must match the actual type of the key being + * filtered. + */ + type: 'string' | 'number' | 'boolean'; + + /** + * Discriminator for leaf filter nodes. Always 'filter' when present; may be + * omitted. + */ + kind?: 'filter'; + + /** + * Comparison value. Must match actual values in your data — verify with the values + * endpoint. Ensure the value type (string/number/boolean) matches the field type. + * String comparisons are case-sensitive. Regex uses RE2 syntax (no + * lookaheads/lookbehinds). + */ + value?: string | number | boolean; + } + } + + /** + * A filter condition applied to query results. Use the keys and values endpoints + * to discover available fields and their values before constructing filters. + */ + export interface WorkersObservabilityFilterLeaf { + /** + * Filter field name. Use verified keys from previous query results or the keys + * endpoint. Common keys include $metadata.service, $metadata.origin, + * $metadata.trigger, $metadata.message, and $metadata.error. + */ + key: string; + + /** + * Comparison operator. String operators: includes, not_includes, starts_with, + * ends_with, regex. Existence: exists, is_null. Set membership: in, not_in + * (comma-separated values). Numeric: eq, neq, gt, gte, lt, lte. + */ + operation: + | 'includes' + | 'not_includes' + | 'starts_with' + | 'ends_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' + | 'ENDS_WITH'; + + /** + * Data type of the filter field. Must match the actual type of the key being + * filtered. + */ + type: 'string' | 'number' | 'boolean'; + + /** + * Discriminator for leaf filter nodes. Always 'filter' when present; may be + * omitted. + */ + kind?: 'filter'; + + /** + * Comparison value. Must match actual values in your data — verify with the values + * endpoint. Ensure the value type (string/number/boolean) matches the field type. + * String comparisons are case-sensitive. Regex uses RE2 syntax (no + * lookaheads/lookbehinds). + */ + value?: string | number | boolean; + } +} + +export interface TelemetryLiveTailHeartbeatParams { + /** + * Path param: Your Cloudflare account ID. + */ + account_id: string; + + /** + * Body param + */ + scriptId?: string; +} + export interface TelemetryQueryParams { /** * Path param: Your Cloudflare account ID. @@ -2474,11 +2728,15 @@ Telemetry.TelemetryValuesResponsesSinglePage = TelemetryValuesResponsesSinglePag export declare namespace Telemetry { export { type TelemetryKeysResponse as TelemetryKeysResponse, + type TelemetryLiveTailResponse as TelemetryLiveTailResponse, + type TelemetryLiveTailHeartbeatResponse as TelemetryLiveTailHeartbeatResponse, type TelemetryQueryResponse as TelemetryQueryResponse, type TelemetryValuesResponse as TelemetryValuesResponse, TelemetryKeysResponsesSinglePage as TelemetryKeysResponsesSinglePage, TelemetryValuesResponsesSinglePage as TelemetryValuesResponsesSinglePage, type TelemetryKeysParams as TelemetryKeysParams, + type TelemetryLiveTailParams as TelemetryLiveTailParams, + type TelemetryLiveTailHeartbeatParams as TelemetryLiveTailHeartbeatParams, type TelemetryQueryParams as TelemetryQueryParams, type TelemetryValuesParams as TelemetryValuesParams, }; diff --git a/src/resources/workflows/instances/instances.ts b/src/resources/workflows/instances/instances.ts index 0400bfb87c..5be29bcc4f 100644 --- a/src/resources/workflows/instances/instances.ts +++ b/src/resources/workflows/instances/instances.ts @@ -207,7 +207,7 @@ export namespace InstanceGetResponse { success: boolean | null; - type: 'step'; + type: 'step' | 'rollback'; } export namespace UnionMember0 { diff --git a/src/resources/zero-trust/access/ai-controls/mcp/portals.ts b/src/resources/zero-trust/access/ai-controls/mcp/portals.ts index 92081eed35..b83f016a04 100644 --- a/src/resources/zero-trust/access/ai-controls/mcp/portals.ts +++ b/src/resources/zero-trust/access/ai-controls/mcp/portals.ts @@ -256,14 +256,6 @@ export namespace PortalCreateResponse { export interface UpdatedPrompt { name: string; - /** - * @deprecated Deprecated: use `portal_description` or `server_description` - * instead. Populated for backward compatibility — portal-level wins when present, - * otherwise falls back to server-level. Will be removed after the deprecation - * window. - */ - description?: string; - enabled?: boolean; portal_alias?: string; @@ -278,14 +270,6 @@ export namespace PortalCreateResponse { export interface UpdatedTool { name: string; - /** - * @deprecated Deprecated: use `portal_description` or `server_description` - * instead. Populated for backward compatibility — portal-level wins when present, - * otherwise falls back to server-level. Will be removed after the deprecation - * window. - */ - description?: string; - enabled?: boolean; portal_alias?: string; @@ -418,14 +402,6 @@ export namespace PortalUpdateResponse { export interface UpdatedPrompt { name: string; - /** - * @deprecated Deprecated: use `portal_description` or `server_description` - * instead. Populated for backward compatibility — portal-level wins when present, - * otherwise falls back to server-level. Will be removed after the deprecation - * window. - */ - description?: string; - enabled?: boolean; portal_alias?: string; @@ -440,14 +416,6 @@ export namespace PortalUpdateResponse { export interface UpdatedTool { name: string; - /** - * @deprecated Deprecated: use `portal_description` or `server_description` - * instead. Populated for backward compatibility — portal-level wins when present, - * otherwise falls back to server-level. Will be removed after the deprecation - * window. - */ - description?: string; - enabled?: boolean; portal_alias?: string; @@ -580,14 +548,6 @@ export namespace PortalListResponse { export interface UpdatedPrompt { name: string; - /** - * @deprecated Deprecated: use `portal_description` or `server_description` - * instead. Populated for backward compatibility — portal-level wins when present, - * otherwise falls back to server-level. Will be removed after the deprecation - * window. - */ - description?: string; - enabled?: boolean; portal_alias?: string; @@ -602,14 +562,6 @@ export namespace PortalListResponse { export interface UpdatedTool { name: string; - /** - * @deprecated Deprecated: use `portal_description` or `server_description` - * instead. Populated for backward compatibility — portal-level wins when present, - * otherwise falls back to server-level. Will be removed after the deprecation - * window. - */ - description?: string; - enabled?: boolean; portal_alias?: string; @@ -773,14 +725,6 @@ export namespace PortalReadResponse { export interface UpdatedPrompt { name: string; - /** - * @deprecated Deprecated: use `portal_description` or `server_description` - * instead. Populated for backward compatibility — portal-level wins when present, - * otherwise falls back to server-level. Will be removed after the deprecation - * window. - */ - description?: string; - enabled?: boolean; portal_alias?: string; @@ -795,14 +739,6 @@ export namespace PortalReadResponse { export interface UpdatedTool { name: string; - /** - * @deprecated Deprecated: use `portal_description` or `server_description` - * instead. Populated for backward compatibility — portal-level wins when present, - * otherwise falls back to server-level. Will be removed after the deprecation - * window. - */ - description?: string; - enabled?: boolean; portal_alias?: string; diff --git a/src/resources/zero-trust/api.md b/src/resources/zero-trust/api.md index 51b142f951..27f2ee2ab6 100644 --- a/src/resources/zero-trust/api.md +++ b/src/resources/zero-trust/api.md @@ -1499,13 +1499,9 @@ Methods: #### Items -Types: - -- ItemListResponse - Methods: -- client.zeroTrust.gateway.lists.items.list(listId, { ...params }) -> ItemListResponsesSinglePage +- client.zeroTrust.gateway.lists.items.list(listId, { ...params }) -> GatewayItemsSinglePage ### Locations diff --git a/src/resources/zero-trust/devices/policies/custom/custom.ts b/src/resources/zero-trust/devices/policies/custom/custom.ts index 46843293ee..8216cb40e1 100644 --- a/src/resources/zero-trust/devices/policies/custom/custom.ts +++ b/src/resources/zero-trust/devices/policies/custom/custom.ts @@ -212,6 +212,12 @@ export interface CustomCreateParams { */ disable_auto_fallback?: boolean; + /** + * Body param: List of DNS search suffixes to apply to clients. Suffixes are + * evaluated in order. Use an empty array to clear. + */ + dns_search_suffixes?: Array; + /** * Body param: Whether the policy will be applied to matching devices. */ @@ -288,6 +294,18 @@ export interface CustomCreateParams { } export namespace CustomCreateParams { + export interface DNSSearchSuffix { + /** + * The DNS search suffix to append when resolving short hostnames. + */ + suffix: string; + + /** + * A description of the DNS search suffix. + */ + description?: string; + } + export interface ServiceModeV2 { /** * The mode to run the WARP client under. @@ -370,6 +388,12 @@ export interface CustomEditParams { */ disable_auto_fallback?: boolean; + /** + * Body param: List of DNS search suffixes to apply to clients. Suffixes are + * evaluated in order. Use an empty array to clear. + */ + dns_search_suffixes?: Array; + /** * Body param: Whether the policy will be applied to matching devices. */ @@ -465,6 +489,18 @@ export interface CustomEditParams { } export namespace CustomEditParams { + export interface DNSSearchSuffix { + /** + * The DNS search suffix to append when resolving short hostnames. + */ + suffix: string; + + /** + * A description of the DNS search suffix. + */ + description?: string; + } + export interface ServiceModeV2 { /** * The mode to run the WARP client under. diff --git a/src/resources/zero-trust/devices/policies/default/default.ts b/src/resources/zero-trust/devices/policies/default/default.ts index bb7a0868bd..8d6b7148c5 100644 --- a/src/resources/zero-trust/devices/policies/default/default.ts +++ b/src/resources/zero-trust/devices/policies/default/default.ts @@ -101,6 +101,12 @@ export interface DefaultEditResponse { */ disable_auto_fallback?: boolean; + /** + * List of DNS search suffixes to apply to clients. Suffixes are evaluated in + * order. Use an empty array to clear. + */ + dns_search_suffixes?: Array; + /** * Whether the policy will be applied to matching devices. */ @@ -163,6 +169,18 @@ export interface DefaultEditResponse { } export namespace DefaultEditResponse { + export interface DNSSearchSuffix { + /** + * The DNS search suffix to append when resolving short hostnames. + */ + suffix: string; + + /** + * A description of the DNS search suffix. + */ + description?: string; + } + export interface ServiceModeV2 { /** * The mode to run the WARP client under. @@ -231,6 +249,12 @@ export interface DefaultGetResponse { */ disable_auto_fallback?: boolean; + /** + * List of DNS search suffixes to apply to clients. Suffixes are evaluated in + * order. Use an empty array to clear. + */ + dns_search_suffixes?: Array; + /** * Whether the policy will be applied to matching devices. */ @@ -293,6 +317,18 @@ export interface DefaultGetResponse { } export namespace DefaultGetResponse { + export interface DNSSearchSuffix { + /** + * The DNS search suffix to append when resolving short hostnames. + */ + suffix: string; + + /** + * A description of the DNS search suffix. + */ + description?: string; + } + export interface ServiceModeV2 { /** * The mode to run the WARP client under. @@ -362,6 +398,12 @@ export interface DefaultEditParams { */ disable_auto_fallback?: boolean; + /** + * Body param: List of DNS search suffixes to apply to clients. Suffixes are + * evaluated in order. Use an empty array to clear. + */ + dns_search_suffixes?: Array; + /** * Body param: List of routes excluded in the WARP client's tunnel. Both 'exclude' * and 'include' cannot be set in the same request. @@ -433,6 +475,18 @@ export interface DefaultEditParams { } export namespace DefaultEditParams { + export interface DNSSearchSuffix { + /** + * The DNS search suffix to append when resolving short hostnames. + */ + suffix: string; + + /** + * A description of the DNS search suffix. + */ + description?: string; + } + export interface ServiceModeV2 { /** * The mode to run the WARP client under. diff --git a/src/resources/zero-trust/devices/policies/policies.ts b/src/resources/zero-trust/devices/policies/policies.ts index afe64c7de2..c5740fcbf3 100644 --- a/src/resources/zero-trust/devices/policies/policies.ts +++ b/src/resources/zero-trust/devices/policies/policies.ts @@ -121,6 +121,12 @@ export interface SettingsPolicy { */ disable_auto_fallback?: boolean; + /** + * List of DNS search suffixes to apply to clients. Suffixes are evaluated in + * order. Use an empty array to clear. + */ + dns_search_suffixes?: Array; + /** * Whether the policy will be applied to matching devices. */ @@ -218,6 +224,18 @@ export interface SettingsPolicy { } export namespace SettingsPolicy { + export interface DNSSearchSuffix { + /** + * The DNS search suffix to append when resolving short hostnames. + */ + suffix: string; + + /** + * A description of the DNS search suffix. + */ + description?: string; + } + export interface ServiceModeV2 { /** * The mode to run the WARP client under. diff --git a/src/resources/zero-trust/gateway/index.ts b/src/resources/zero-trust/gateway/index.ts index a734fa953a..4f258210ac 100644 --- a/src/resources/zero-trust/gateway/index.ts +++ b/src/resources/zero-trust/gateway/index.ts @@ -54,6 +54,7 @@ export { type GatewayListParams, } from './gateway'; export { + GatewayItemsSinglePage, GatewayListsSinglePage, Lists, type GatewayItem, diff --git a/src/resources/zero-trust/gateway/lists/index.ts b/src/resources/zero-trust/gateway/lists/index.ts index 8dd8e93750..1c0a817e58 100644 --- a/src/resources/zero-trust/gateway/lists/index.ts +++ b/src/resources/zero-trust/gateway/lists/index.ts @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { + GatewayItemsSinglePage, GatewayListsSinglePage, Lists, type GatewayItem, @@ -14,4 +15,4 @@ export { type ListEditParams, type ListGetParams, } from './lists'; -export { ItemListResponsesSinglePage, Items, type ItemListResponse, type ItemListParams } from './items'; +export { Items, type ItemListParams } from './items'; diff --git a/src/resources/zero-trust/gateway/lists/items.ts b/src/resources/zero-trust/gateway/lists/items.ts index e50a4c554c..030cf38550 100644 --- a/src/resources/zero-trust/gateway/lists/items.ts +++ b/src/resources/zero-trust/gateway/lists/items.ts @@ -3,7 +3,7 @@ import { APIResource } from '../../../../resource'; import * as Core from '../../../../core'; import * as ListsAPI from './lists'; -import { SinglePage } from '../../../../pagination'; +import { GatewayItemsSinglePage } from './lists'; export class Items extends APIResource { /** @@ -12,7 +12,7 @@ export class Items extends APIResource { * @example * ```ts * // Automatically fetches more pages as needed. - * for await (const itemListResponse of client.zeroTrust.gateway.lists.items.list( + * for await (const gatewayItem of client.zeroTrust.gateway.lists.items.list( * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { account_id: '699d98642c564d2e855e9661899b7252' }, * )) { @@ -24,33 +24,22 @@ export class Items extends APIResource { listId: string, params: ItemListParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { const { account_id } = params; return this._client.getAPIList( `/accounts/${account_id}/gateway/lists/${listId}/items`, - ItemListResponsesSinglePage, + GatewayItemsSinglePage, options, ); } } -export class ItemListResponsesSinglePage extends SinglePage {} - -/** - * Provide the list items. - */ -export type ItemListResponse = Array; - export interface ItemListParams { account_id: string; } -Items.ItemListResponsesSinglePage = ItemListResponsesSinglePage; - export declare namespace Items { - export { - type ItemListResponse as ItemListResponse, - ItemListResponsesSinglePage as ItemListResponsesSinglePage, - type ItemListParams as ItemListParams, - }; + export { type ItemListParams as ItemListParams }; } + +export { GatewayItemsSinglePage }; diff --git a/src/resources/zero-trust/gateway/lists/lists.ts b/src/resources/zero-trust/gateway/lists/lists.ts index 7762c1d1ae..411f50b91c 100644 --- a/src/resources/zero-trust/gateway/lists/lists.ts +++ b/src/resources/zero-trust/gateway/lists/lists.ts @@ -3,7 +3,7 @@ import { APIResource } from '../../../../resource'; import * as Core from '../../../../core'; import * as ItemsAPI from './items'; -import { ItemListParams, ItemListResponse, ItemListResponsesSinglePage, Items } from './items'; +import { ItemListParams, Items } from './items'; import { SinglePage } from '../../../../pagination'; export class Lists extends APIResource { @@ -154,6 +154,8 @@ export class Lists extends APIResource { export class GatewayListsSinglePage extends SinglePage {} +export class GatewayItemsSinglePage extends SinglePage {} + export interface GatewayItem { created_at?: string; @@ -367,7 +369,6 @@ export interface ListGetParams { Lists.GatewayListsSinglePage = GatewayListsSinglePage; Lists.Items = Items; -Lists.ItemListResponsesSinglePage = ItemListResponsesSinglePage; export declare namespace Lists { export { @@ -384,10 +385,5 @@ export declare namespace Lists { type ListGetParams as ListGetParams, }; - export { - Items as Items, - type ItemListResponse as ItemListResponse, - ItemListResponsesSinglePage as ItemListResponsesSinglePage, - type ItemListParams as ItemListParams, - }; + export { Items as Items, type ItemListParams as ItemListParams }; } diff --git a/src/resources/zero-trust/gateway/locations.ts b/src/resources/zero-trust/gateway/locations.ts index 6f68070983..8ffaf9c15b 100644 --- a/src/resources/zero-trust/gateway/locations.ts +++ b/src/resources/zero-trust/gateway/locations.ts @@ -351,6 +351,13 @@ export interface Location { */ ipv4_destination_backup?: string; + /** + * Specify the maximum TTL, in seconds, applied to DNS response records. Records + * whose upstream TTL exceeds this value are served with the capped value. When + * null or absent, no cap is applied at this tier. + */ + max_ttl_secs?: number | null; + /** * Specify the location name. */ @@ -412,6 +419,13 @@ export interface LocationCreateParams { */ endpoints?: EndpointParam | null; + /** + * Body param: Specify the maximum TTL, in seconds, applied to DNS response + * records. Records whose upstream TTL exceeds this value are served with the + * capped value. When null or absent, no cap is applied at this tier. + */ + max_ttl_secs?: number | null; + /** * Body param: Specify the list of network ranges from which requests at this * location originate. The list takes effect only if it is non-empty and the IPv4 @@ -464,6 +478,13 @@ export interface LocationUpdateParams { */ endpoints?: EndpointParam | null; + /** + * Body param: Specify the maximum TTL, in seconds, applied to DNS response + * records. Records whose upstream TTL exceeds this value are served with the + * capped value. When null or absent, no cap is applied at this tier. + */ + max_ttl_secs?: number | null; + /** * Body param: Specify the list of network ranges from which requests at this * location originate. The list takes effect only if it is non-empty and the IPv4 diff --git a/src/resources/zones/holds.ts b/src/resources/zones/holds.ts index 236bbad679..fd8fd2f9ed 100644 --- a/src/resources/zones/holds.ts +++ b/src/resources/zones/holds.ts @@ -6,7 +6,7 @@ import * as Core from '../../core'; export class Holds extends APIResource { /** * Enforce a zone hold on the zone, blocking the creation and activation of zones - * with this zone's hostname. + * with this zone's hostname. Zone holds cannot be enabled on CDN-only zones. * * @example * ```ts @@ -28,6 +28,9 @@ export class Holds extends APIResource { /** * Stop enforcement of a zone hold on the zone, permanently or temporarily, * allowing the creation and activation of zones with this zone's hostname. + * Existing zone holds can be removed from CDN-only zones when `hold_after` is not + * provided. Active holds are automatically disabled when a zone transitions to + * CDN-only mode. * * @example * ```ts @@ -49,6 +52,9 @@ export class Holds extends APIResource { /** * Update the `hold_after` and/or `include_subdomains` values on an existing zone * hold. The hold is enabled if the `hold_after` date-time value is in the past. + * Existing zone holds can be removed from CDN-only zones by setting `hold_after` + * to `null`. Other zone hold updates cannot be made on CDN-only zones. Active + * holds are automatically disabled when a zone transitions to CDN-only mode. * * @example * ```ts @@ -118,6 +124,7 @@ export interface HoldDeleteParams { * Query param: If `hold_after` is provided, the hold will be temporarily disabled, * then automatically re-enabled by the system at the time specified in this * RFC3339-formatted timestamp. Otherwise, the hold will be disabled indefinitely. + * `hold_after` cannot be provided for CDN-only zones. */ hold_after?: string; } @@ -133,9 +140,10 @@ export interface HoldEditParams { * temporarily disabled, then automatically re-enabled by the system at the time * specified in this RFC3339-formatted timestamp. A past-dated `hold_after` value * will have no effect on an existing, enabled hold. Providing an empty string will - * set its value to the current time. + * set its value to the current time. Providing `null` will disable the hold + * indefinitely. */ - hold_after?: string; + hold_after?: string | null; /** * Body param: If `true`, the zone hold will extend to block any subdomain of the diff --git a/tests/api-resources/addressing/regional-hostnames/regions.test.ts b/tests/api-resources/addressing/regional-hostnames/regions.test.ts deleted file mode 100644 index 4eb06fad02..0000000000 --- a/tests/api-resources/addressing/regional-hostnames/regions.test.ts +++ /dev/null @@ -1,31 +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 regions', () => { - test('list: only required params', async () => { - const responsePromise = client.addressing.regionalHostnames.regions.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.addressing.regionalHostnames.regions.list({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - }); -}); diff --git a/tests/api-resources/api-gateway/discovery/operations.test.ts b/tests/api-resources/api-gateway/discovery/operations.test.ts index f1de475ff3..2c591aed66 100644 --- a/tests/api-resources/api-gateway/discovery/operations.test.ts +++ b/tests/api-resources/api-gateway/discovery/operations.test.ts @@ -65,25 +65,4 @@ describe('resource operations', () => { }, }); }); - - test('edit: only required params', async () => { - const responsePromise = client.apiGateway.discovery.operations.edit( - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { 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('edit: required and optional params', async () => { - const response = await client.apiGateway.discovery.operations.edit( - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', state: 'review' }, - ); - }); }); diff --git a/tests/api-resources/cache/cache.test.ts b/tests/api-resources/cache/cache.test.ts index 5604143ce9..894a545938 100644 --- a/tests/api-resources/cache/cache.test.ts +++ b/tests/api-resources/cache/cache.test.ts @@ -27,4 +27,26 @@ describe('resource cache', () => { tags: ['a-cache-tag', 'another-cache-tag'], }); }); + + // HTTP 404 error from prism + test.skip('purgeEnvironment: only required params', async () => { + const responsePromise = client.cache.purgeEnvironment('023e105f4ecef8ad9ca31a8372d0c353', { + 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); + }); + + // HTTP 404 error from prism + test.skip('purgeEnvironment: required and optional params', async () => { + const response = await client.cache.purgeEnvironment('023e105f4ecef8ad9ca31a8372d0c353', { + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + tags: ['a-cache-tag', 'another-cache-tag'], + }); + }); }); diff --git a/tests/api-resources/cache/origin-cloud-regions.test.ts b/tests/api-resources/cache/origin-cloud-regions.test.ts index b6fdffa650..3123b24639 100644 --- a/tests/api-resources/cache/origin-cloud-regions.test.ts +++ b/tests/api-resources/cache/origin-cloud-regions.test.ts @@ -10,10 +10,11 @@ const client = new Cloudflare({ }); describe('resource originCloudRegions', () => { - test('create: only required params', async () => { - const responsePromise = client.cache.originCloudRegions.create({ + // HTTP 404 error from prism -- route not in spec + test.skip('update: only required params', async () => { + const responsePromise = client.cache.originCloudRegions.update('192.0.2.1', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - ip: '192.0.2.1', + origin_ip: '192.0.2.1', region: 'us-east-1', vendor: 'aws', }); @@ -26,16 +27,18 @@ describe('resource originCloudRegions', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('create: required and optional params', async () => { - const response = await client.cache.originCloudRegions.create({ + // HTTP 404 error from prism -- route not in spec + test.skip('update: required and optional params', async () => { + const response = await client.cache.originCloudRegions.update('192.0.2.1', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - ip: '192.0.2.1', + origin_ip: '192.0.2.1', region: 'us-east-1', vendor: 'aws', }); }); - test('list: only required params', async () => { + // HTTP 404 error from prism + test.skip('list: only required params', async () => { const responsePromise = client.cache.originCloudRegions.list({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); @@ -48,13 +51,17 @@ describe('resource originCloudRegions', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('list: required and optional params', async () => { + // HTTP 404 error from prism + test.skip('list: required and optional params', async () => { const response = await client.cache.originCloudRegions.list({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + page: 1, + per_page: 1, }); }); - test('delete: only required params', async () => { + // HTTP 404 error from prism + test.skip('delete: only required params', async () => { const responsePromise = client.cache.originCloudRegions.delete('192.0.2.1', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); @@ -67,13 +74,15 @@ describe('resource originCloudRegions', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('delete: required and optional params', async () => { + // HTTP 404 error from prism + test.skip('delete: required and optional params', async () => { const response = await client.cache.originCloudRegions.delete('192.0.2.1', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); - test('bulkDelete: only required params', async () => { + // HTTP 404 error from prism + test.skip('bulkDelete: only required params', async () => { const responsePromise = client.cache.originCloudRegions.bulkDelete({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); @@ -86,23 +95,25 @@ describe('resource originCloudRegions', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('bulkDelete: required and optional params', async () => { + // HTTP 404 error from prism + test.skip('bulkDelete: required and optional params', async () => { const response = await client.cache.originCloudRegions.bulkDelete({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); - test('bulkEdit: only required params', async () => { - const responsePromise = client.cache.originCloudRegions.bulkEdit({ + // HTTP 404 error from prism + test.skip('bulkUpdate: only required params', async () => { + const responsePromise = client.cache.originCloudRegions.bulkUpdate({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', body: [ { - ip: '192.0.2.1', + origin_ip: '192.0.2.1', region: 'us-east-1', vendor: 'aws', }, { - ip: '2001:db8::1', + origin_ip: '2001:db8::1', region: 'us-central1', vendor: 'gcp', }, @@ -117,17 +128,18 @@ describe('resource originCloudRegions', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('bulkEdit: required and optional params', async () => { - const response = await client.cache.originCloudRegions.bulkEdit({ + // HTTP 404 error from prism + test.skip('bulkUpdate: required and optional params', async () => { + const response = await client.cache.originCloudRegions.bulkUpdate({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', body: [ { - ip: '192.0.2.1', + origin_ip: '192.0.2.1', region: 'us-east-1', vendor: 'aws', }, { - ip: '2001:db8::1', + origin_ip: '2001:db8::1', region: 'us-central1', vendor: 'gcp', }, @@ -135,32 +147,8 @@ describe('resource originCloudRegions', () => { }); }); - test('edit: only required params', async () => { - const responsePromise = client.cache.originCloudRegions.edit({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - ip: '2001:db8::1', - region: 'us-central1', - vendor: 'gcp', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const 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.cache.originCloudRegions.edit({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - ip: '2001:db8::1', - region: 'us-central1', - vendor: 'gcp', - }); - }); - - test('get: only required params', async () => { + // HTTP 404 error from prism + test.skip('get: only required params', async () => { const responsePromise = client.cache.originCloudRegions.get('192.0.2.1', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); @@ -173,13 +161,15 @@ describe('resource originCloudRegions', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('get: required and optional params', async () => { + // HTTP 404 error from prism + test.skip('get: required and optional params', async () => { const response = await client.cache.originCloudRegions.get('192.0.2.1', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); - test('supportedRegions: only required params', async () => { + // HTTP 404 error from prism + test.skip('supportedRegions: only required params', async () => { const responsePromise = client.cache.originCloudRegions.supportedRegions({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); @@ -192,7 +182,8 @@ describe('resource originCloudRegions', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('supportedRegions: required and optional params', async () => { + // HTTP 404 error from prism + test.skip('supportedRegions: required and optional params', async () => { const response = await client.cache.originCloudRegions.supportedRegions({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); diff --git a/tests/api-resources/cache/smart-tiered-cache.test.ts b/tests/api-resources/cache/smart-tiered-cache.test.ts index b1409dc28a..9df7852687 100644 --- a/tests/api-resources/cache/smart-tiered-cache.test.ts +++ b/tests/api-resources/cache/smart-tiered-cache.test.ts @@ -10,6 +10,29 @@ const client = new Cloudflare({ }); describe('resource smartTieredCache', () => { + // HTTP 405 error from prism + test.skip('create: only required params', async () => { + const responsePromise = client.cache.smartTieredCache.create({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + value: 'on', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // HTTP 405 error from prism + test.skip('create: required and optional params', async () => { + const response = await client.cache.smartTieredCache.create({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + value: 'on', + }); + }); + test('delete: only required params', async () => { const responsePromise = client.cache.smartTieredCache.delete({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', diff --git a/tests/api-resources/custom-csrs.test.ts b/tests/api-resources/custom-csrs.test.ts new file mode 100644 index 0000000000..011ae680e6 --- /dev/null +++ b/tests/api-resources/custom-csrs.test.ts @@ -0,0 +1,84 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource customCsrs', () => { + test('create: only required params', async () => { + const responsePromise = client.customCsrs.create({ + common_name: 'example.com', + country: 'US', + locality: 'San Francisco', + organization: 'Cloudflare, Inc.', + sans: ['example.com', 'www.example.com'], + state: 'California', + 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.customCsrs.create({ + common_name: 'example.com', + country: 'US', + locality: 'San Francisco', + organization: 'Cloudflare, Inc.', + sans: ['example.com', 'www.example.com'], + state: 'California', + account_id: 'account_id', + description: 'CSR for example.com wildcard', + key_type: 'rsa2048', + name: 'My Custom CSR', + organizational_unit: 'Engineering', + }); + }); + + test('list', async () => { + const responsePromise = client.customCsrs.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('delete', async () => { + const responsePromise = client.customCsrs.delete('7b163417-1d2b-4c84-a38a-2fb7a0cd7752', { + 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', async () => { + const responsePromise = client.customCsrs.get('7b163417-1d2b-4c84-a38a-2fb7a0cd7752', { + 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); + }); +}); diff --git a/tests/api-resources/dls/regional-services/prefix-bindings.test.ts b/tests/api-resources/dls/regional-services/prefix-bindings.test.ts index 0b94a283ad..0fca5961d7 100644 --- a/tests/api-resources/dls/regional-services/prefix-bindings.test.ts +++ b/tests/api-resources/dls/regional-services/prefix-bindings.test.ts @@ -12,7 +12,7 @@ const client = new Cloudflare({ describe('resource prefixBindings', () => { test('create: only required params', async () => { const responsePromise = client.dls.regionalServices.prefixBindings.create({ - account_id: 0, + account_id: '023e105f4ecef8ad9ca31a8372d0c353', cidr: '10.0.1.0/24', prefix_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', region_key: 'eu', @@ -28,7 +28,7 @@ describe('resource prefixBindings', () => { test('create: required and optional params', async () => { const response = await client.dls.regionalServices.prefixBindings.create({ - account_id: 0, + account_id: '023e105f4ecef8ad9ca31a8372d0c353', cidr: '10.0.1.0/24', prefix_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', region_key: 'eu', @@ -36,7 +36,9 @@ describe('resource prefixBindings', () => { }); test('list: only required params', async () => { - const responsePromise = client.dls.regionalServices.prefixBindings.list({ account_id: 0 }); + const responsePromise = client.dls.regionalServices.prefixBindings.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -48,7 +50,7 @@ describe('resource prefixBindings', () => { test('list: required and optional params', async () => { const response = await client.dls.regionalServices.prefixBindings.list({ - account_id: 0, + account_id: '023e105f4ecef8ad9ca31a8372d0c353', cursor: 'cursor', per_page: 1, }); @@ -57,7 +59,7 @@ describe('resource prefixBindings', () => { test('delete: only required params', async () => { const responsePromise = client.dls.regionalServices.prefixBindings.delete( 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', - { account_id: 0 }, + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -71,14 +73,14 @@ describe('resource prefixBindings', () => { test('delete: required and optional params', async () => { const response = await client.dls.regionalServices.prefixBindings.delete( 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', - { account_id: 0 }, + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); }); test('edit: only required params', async () => { const responsePromise = client.dls.regionalServices.prefixBindings.edit( 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', - { account_id: 0, region_key: 'eu' }, + { account_id: '023e105f4ecef8ad9ca31a8372d0c353', region_key: 'eu' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -92,14 +94,14 @@ describe('resource prefixBindings', () => { test('edit: required and optional params', async () => { const response = await client.dls.regionalServices.prefixBindings.edit( 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', - { account_id: 0, region_key: 'eu' }, + { account_id: '023e105f4ecef8ad9ca31a8372d0c353', region_key: 'eu' }, ); }); test('get: only required params', async () => { const responsePromise = client.dls.regionalServices.prefixBindings.get( 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', - { account_id: 0 }, + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -113,7 +115,7 @@ describe('resource prefixBindings', () => { test('get: required and optional params', async () => { const response = await client.dls.regionalServices.prefixBindings.get( 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', - { account_id: 0 }, + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); }); }); diff --git a/tests/api-resources/dls/regions.test.ts b/tests/api-resources/dls/regions.test.ts index 5cb8f2515e..616637e195 100644 --- a/tests/api-resources/dls/regions.test.ts +++ b/tests/api-resources/dls/regions.test.ts @@ -11,7 +11,7 @@ const client = new Cloudflare({ describe('resource regions', () => { test('list: only required params', async () => { - const responsePromise = client.dls.regions.list({ account_id: 0 }); + const responsePromise = client.dls.regions.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -23,7 +23,7 @@ describe('resource regions', () => { test('list: required and optional params', async () => { const response = await client.dls.regions.list({ - account_id: 0, + account_id: '023e105f4ecef8ad9ca31a8372d0c353', cursor: 'cursor', per_page: 1, type: 'managed', @@ -31,7 +31,9 @@ describe('resource regions', () => { }); test('get: only required params', async () => { - const responsePromise = client.dls.regions.get('a1b2c3d4-e5f6-7890-abcd-ef1234567890', { account_id: 0 }); + const responsePromise = client.dls.regions.get('a1b2c3d4-e5f6-7890-abcd-ef1234567890', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -42,6 +44,8 @@ describe('resource regions', () => { }); test('get: required and optional params', async () => { - const response = await client.dls.regions.get('a1b2c3d4-e5f6-7890-abcd-ef1234567890', { account_id: 0 }); + const response = await client.dls.regions.get('a1b2c3d4-e5f6-7890-abcd-ef1234567890', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); }); diff --git a/tests/api-resources/email-security/investigate/investigate.test.ts b/tests/api-resources/email-security/investigate/investigate.test.ts index f650dcfe6e..39983d6c37 100644 --- a/tests/api-resources/email-security/investigate/investigate.test.ts +++ b/tests/api-resources/email-security/investigate/investigate.test.ts @@ -26,7 +26,6 @@ describe('resource investigate', () => { test('list: required and optional params', async () => { const response = await client.emailSecurity.investigate.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', - action_log: true, alert_id: 'alert_id', cursor: 'cursor', delivery_status: 'delivered', diff --git a/tests/api-resources/email-security/settings/sending-domain-restrictions.test.ts b/tests/api-resources/email-security/settings/sending-domain-restrictions.test.ts new file mode 100644 index 0000000000..6404b5a1c6 --- /dev/null +++ b/tests/api-resources/email-security/settings/sending-domain-restrictions.test.ts @@ -0,0 +1,128 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource sendingDomainRestrictions', () => { + test('create: only required params', async () => { + const responsePromise = client.emailSecurity.settings.sendingDomainRestrictions.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + domain: 'example.com', + exclude: ['subdomain.example.com'], + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const 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.emailSecurity.settings.sendingDomainRestrictions.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + domain: 'example.com', + exclude: ['subdomain.example.com'], + comments: 'Enforce TLS for all mail from this domain', + }); + }); + + test('list: only required params', async () => { + const responsePromise = client.emailSecurity.settings.sendingDomainRestrictions.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.emailSecurity.settings.sendingDomainRestrictions.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + direction: 'asc', + order: 'domain', + page: 1, + per_page: 20, + search: 'search', + }); + }); + + test('delete: only required params', async () => { + const responsePromise = client.emailSecurity.settings.sendingDomainRestrictions.delete( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('delete: required and optional params', async () => { + const response = await client.emailSecurity.settings.sendingDomainRestrictions.delete( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + }); + + test('edit: only required params', async () => { + const responsePromise = client.emailSecurity.settings.sendingDomainRestrictions.edit( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('edit: required and optional params', async () => { + const response = await client.emailSecurity.settings.sendingDomainRestrictions.edit( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + comments: 'Enforce TLS for all mail from this domain', + domain: 'example.com', + exclude: ['subdomain.example.com'], + }, + ); + }); + + test('get: only required params', async () => { + const responsePromise = client.emailSecurity.settings.sendingDomainRestrictions.get( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: required and optional params', async () => { + const response = await client.emailSecurity.settings.sendingDomainRestrictions.get( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + }); +}); diff --git a/tests/api-resources/addressing/regional-hostnames/regional-hostnames.test.ts b/tests/api-resources/email-security/settings/url-ignore-patterns.test.ts similarity index 58% rename from tests/api-resources/addressing/regional-hostnames/regional-hostnames.test.ts rename to tests/api-resources/email-security/settings/url-ignore-patterns.test.ts index 0652d2bfad..c75f239271 100644 --- a/tests/api-resources/addressing/regional-hostnames/regional-hostnames.test.ts +++ b/tests/api-resources/email-security/settings/url-ignore-patterns.test.ts @@ -9,12 +9,11 @@ const client = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource regionalHostnames', () => { +describe('resource urlIgnorePatterns', () => { test('create: only required params', async () => { - const responsePromise = client.addressing.regionalHostnames.create({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - hostname: 'foo.example.com', - region_key: 'ca', + const responsePromise = client.emailSecurity.settings.urlIgnorePatterns.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + pattern: 'https://example\\.com/.*', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -26,17 +25,16 @@ describe('resource regionalHostnames', () => { }); test('create: required and optional params', async () => { - const response = await client.addressing.regionalHostnames.create({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - hostname: 'foo.example.com', - region_key: 'ca', - routing: 'dns', + const response = await client.emailSecurity.settings.urlIgnorePatterns.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + pattern: 'https://example\\.com/.*', + comments: 'Trusted internal redirect service', }); }); test('list: only required params', async () => { - const responsePromise = client.addressing.regionalHostnames.list({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + const responsePromise = client.emailSecurity.settings.urlIgnorePatterns.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -48,15 +46,18 @@ describe('resource regionalHostnames', () => { }); test('list: required and optional params', async () => { - const response = await client.addressing.regionalHostnames.list({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + const response = await client.emailSecurity.settings.urlIgnorePatterns.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + page: 1, + per_page: 20, }); }); test('delete: only required params', async () => { - const responsePromise = client.addressing.regionalHostnames.delete('foo.example.com', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.emailSecurity.settings.urlIgnorePatterns.delete( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -67,16 +68,17 @@ describe('resource regionalHostnames', () => { }); test('delete: required and optional params', async () => { - const response = await client.addressing.regionalHostnames.delete('foo.example.com', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const response = await client.emailSecurity.settings.urlIgnorePatterns.delete( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); }); test('edit: only required params', async () => { - const responsePromise = client.addressing.regionalHostnames.edit('foo.example.com', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - region_key: 'ca', - }); + const responsePromise = client.emailSecurity.settings.urlIgnorePatterns.edit( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -87,16 +89,21 @@ describe('resource regionalHostnames', () => { }); test('edit: required and optional params', async () => { - const response = await client.addressing.regionalHostnames.edit('foo.example.com', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - region_key: 'ca', - }); + const response = await client.emailSecurity.settings.urlIgnorePatterns.edit( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + comments: 'Trusted internal redirect service', + pattern: 'https://example\\.com/.*', + }, + ); }); test('get: only required params', async () => { - const responsePromise = client.addressing.regionalHostnames.get('foo.example.com', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.emailSecurity.settings.urlIgnorePatterns.get( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -107,8 +114,9 @@ describe('resource regionalHostnames', () => { }); test('get: required and optional params', async () => { - const response = await client.addressing.regionalHostnames.get('foo.example.com', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const response = await client.emailSecurity.settings.urlIgnorePatterns.get( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); }); }); diff --git a/tests/api-resources/pipelines/pipelines.test.ts b/tests/api-resources/pipelines/pipelines.test.ts index e64028f183..98c6880468 100644 --- a/tests/api-resources/pipelines/pipelines.test.ts +++ b/tests/api-resources/pipelines/pipelines.test.ts @@ -264,6 +264,7 @@ describe('resource pipelines', () => { test('listV1: required and optional params', async () => { const response = await client.pipelines.listV1({ account_id: '0123105f4ecef8ad9ca31a8372d0c353', + name: 'x', page: 0, per_page: 0, }); diff --git a/tests/api-resources/pipelines/sinks.test.ts b/tests/api-resources/pipelines/sinks.test.ts index 05a79057ec..49068652fc 100644 --- a/tests/api-resources/pipelines/sinks.test.ts +++ b/tests/api-resources/pipelines/sinks.test.ts @@ -89,6 +89,7 @@ describe('resource sinks', () => { test('list: required and optional params', async () => { const response = await client.pipelines.sinks.list({ account_id: '0123105f4ecef8ad9ca31a8372d0c353', + name: 'x', page: 0, per_page: 0, pipeline_id: 'pipeline_id', diff --git a/tests/api-resources/pipelines/streams.test.ts b/tests/api-resources/pipelines/streams.test.ts index a344416ed2..235a7c3879 100644 --- a/tests/api-resources/pipelines/streams.test.ts +++ b/tests/api-resources/pipelines/streams.test.ts @@ -100,6 +100,7 @@ describe('resource streams', () => { test('list: required and optional params', async () => { const response = await client.pipelines.streams.list({ account_id: '0123105f4ecef8ad9ca31a8372d0c353', + name: 'x', page: 0, per_page: 0, pipeline_id: '043e105f4ecef8ad9ca31a8372d0c353', diff --git a/tests/api-resources/radar/bgp/ips.test.ts b/tests/api-resources/radar/bgp/ips.test.ts deleted file mode 100644 index 0e237a11db..0000000000 --- a/tests/api-resources/radar/bgp/ips.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 ips', () => { - test('timeseries', async () => { - const responsePromise = client.radar.bgp.ips.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.bgp.ips.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.bgp.ips.timeseries( - { - asn: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - includeDelay: true, - ipVersion: ['IPv4'], - location: ['string'], - name: ['main_series'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/bots/web-crawlers.test.ts b/tests/api-resources/radar/bots/web-crawlers.test.ts index ea8d497351..0ba24321ca 100644 --- a/tests/api-resources/radar/bots/web-crawlers.test.ts +++ b/tests/api-resources/radar/bots/web-crawlers.test.ts @@ -86,6 +86,7 @@ describe('resource webCrawlers', () => { industry: ['string'], limitPerGroup: 10, name: ['main_series'], + normalization: 'PERCENTAGE', responseStatus: ['string'], responseStatusCategory: ['INFORMATIONAL'], vertical: ['string'], diff --git a/tests/api-resources/realtime-kit/apps.test.ts b/tests/api-resources/realtime-kit/apps.test.ts index 6514479849..54784d2ada 100644 --- a/tests/api-resources/realtime-kit/apps.test.ts +++ b/tests/api-resources/realtime-kit/apps.test.ts @@ -24,12 +24,21 @@ describe('resource apps', () => { // TODO: HTTP 401 from prism, support api tokens test.skip('get: required and optional params', async () => { - const response = await client.realtimeKit.apps.get({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const response = await client.realtimeKit.apps.get({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + page_no: 1, + per_page: 1, + search: 'search', + sort_order: 'ASC', + }); }); // TODO: HTTP 401 from prism, support api tokens test.skip('post: only required params', async () => { - const responsePromise = client.realtimeKit.apps.post({ account_id: 'account_id', name: 'name' }); + const responsePromise = client.realtimeKit.apps.post({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'x', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -41,6 +50,9 @@ describe('resource apps', () => { // TODO: HTTP 401 from prism, support api tokens test.skip('post: required and optional params', async () => { - const response = await client.realtimeKit.apps.post({ account_id: 'account_id', name: 'name' }); + const response = await client.realtimeKit.apps.post({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'x', + }); }); }); diff --git a/tests/api-resources/realtime-kit/livestreams.test.ts b/tests/api-resources/realtime-kit/livestreams.test.ts index 1605152c0c..25f6b895ce 100644 --- a/tests/api-resources/realtime-kit/livestreams.test.ts +++ b/tests/api-resources/realtime-kit/livestreams.test.ts @@ -103,8 +103,33 @@ describe('resource livestreams', () => { test.skip('getLivestreamAnalyticsComplete: required and optional params', async () => { const response = await client.realtimeKit.livestreams.getLivestreamAnalyticsComplete('app_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - end_time: '2019-12-27T18:11:19.117Z', - start_time: '2019-12-27T18:11:19.117Z', + end_time: 0, + filters: 'filters', + start_time: 0, + }); + }); + + // TODO: HTTP 401 from prism, support api tokens + test.skip('getLivestreamAnalyticsDaywise: only required params', async () => { + const responsePromise = client.realtimeKit.livestreams.getLivestreamAnalyticsDaywise('app_id', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // TODO: HTTP 401 from prism, support api tokens + test.skip('getLivestreamAnalyticsDaywise: required and optional params', async () => { + const response = await client.realtimeKit.livestreams.getLivestreamAnalyticsDaywise('app_id', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + end_time: 0, + filters: 'filters', + start_time: 0, }); }); diff --git a/tests/api-resources/realtime-kit/meetings.test.ts b/tests/api-resources/realtime-kit/meetings.test.ts index b1622a2911..9fdbffd9c7 100644 --- a/tests/api-resources/realtime-kit/meetings.test.ts +++ b/tests/api-resources/realtime-kit/meetings.test.ts @@ -82,6 +82,7 @@ describe('resource meetings', () => { session_keep_alive_time_in_secs: 60, summarize_on_end: true, title: 'title', + transcribe_on_end: true, }); }); @@ -202,6 +203,7 @@ describe('resource meetings', () => { per_page: 0, search: 'search', start_time: '2019-12-27T18:11:19.117Z', + status: 'ACTIVE', }); }); @@ -390,6 +392,7 @@ describe('resource meetings', () => { session_keep_alive_time_in_secs: 60, summarize_on_end: true, title: 'title', + transcribe_on_end: true, }, ); }); @@ -432,10 +435,47 @@ describe('resource meetings', () => { live_stream_on_start: true, persist_chat: true, record_on_start: true, + recording_config: { + audio_config: { + channel: 'mono', + codec: 'MP3', + export_file: true, + }, + file_name_prefix: 'file_name_prefix', + live_streaming_config: { rtmp_url: 'rtmp://a.rtmp.youtube.com/live2' }, + max_seconds: 60, + realtimekit_bucket_config: { enabled: true }, + storage_config: { + type: 'aws', + access_key: 'access_key', + auth_method: 'KEY', + bucket: 'bucket', + host: 'host', + password: 'password', + path: 'path', + port: 0, + private_key: 'private_key', + region: 'us-east-1', + secret: 'secret', + username: 'username', + }, + video_config: { + codec: 'H264', + export_file: true, + height: 720, + watermark: { + position: 'left top', + size: { height: 1, width: 1 }, + url: 'https://example.com', + }, + width: 1280, + }, + }, session_keep_alive_time_in_secs: 60, status: 'INACTIVE', summarize_on_end: true, title: 'title', + transcribe_on_end: true, }, ); }); diff --git a/tests/api-resources/realtime-kit/sessions.test.ts b/tests/api-resources/realtime-kit/sessions.test.ts index 5362ed8754..b1a2ee2a29 100644 --- a/tests/api-resources/realtime-kit/sessions.test.ts +++ b/tests/api-resources/realtime-kit/sessions.test.ts @@ -12,9 +12,11 @@ const client = new Cloudflare({ describe('resource sessions', () => { // TODO: HTTP 401 from prism, support api tokens test.skip('generateSummaryOfTranscripts: only required params', async () => { - const responsePromise = client.realtimeKit.sessions.generateSummaryOfTranscripts('app_id', 'session_id', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.realtimeKit.sessions.generateSummaryOfTranscripts( + 'app_id', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -26,16 +28,20 @@ describe('resource sessions', () => { // TODO: HTTP 401 from prism, support api tokens test.skip('generateSummaryOfTranscripts: required and optional params', async () => { - const response = await client.realtimeKit.sessions.generateSummaryOfTranscripts('app_id', 'session_id', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const response = await client.realtimeKit.sessions.generateSummaryOfTranscripts( + 'app_id', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); }); // TODO: HTTP 401 from prism, support api tokens test.skip('getParticipantDataFromPeerId: only required params', async () => { - const responsePromise = client.realtimeKit.sessions.getParticipantDataFromPeerId('app_id', 'peer_id', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.realtimeKit.sessions.getParticipantDataFromPeerId( + 'app_id', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -47,17 +53,20 @@ describe('resource sessions', () => { // TODO: HTTP 401 from prism, support api tokens test.skip('getParticipantDataFromPeerId: required and optional params', async () => { - const response = await client.realtimeKit.sessions.getParticipantDataFromPeerId('app_id', 'peer_id', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - filters: 'device_info', - }); + const response = await client.realtimeKit.sessions.getParticipantDataFromPeerId( + 'app_id', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353', filters: 'device_info' }, + ); }); // TODO: HTTP 401 from prism, support api tokens test.skip('getSessionChat: only required params', async () => { - const responsePromise = client.realtimeKit.sessions.getSessionChat('app_id', 'session_id', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.realtimeKit.sessions.getSessionChat( + 'app_id', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -69,16 +78,20 @@ describe('resource sessions', () => { // TODO: HTTP 401 from prism, support api tokens test.skip('getSessionChat: required and optional params', async () => { - const response = await client.realtimeKit.sessions.getSessionChat('app_id', 'session_id', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const response = await client.realtimeKit.sessions.getSessionChat( + 'app_id', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); }); // TODO: HTTP 401 from prism, support api tokens test.skip('getSessionDetails: only required params', async () => { - const responsePromise = client.realtimeKit.sessions.getSessionDetails('app_id', 'session_id', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.realtimeKit.sessions.getSessionDetails( + 'app_id', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -90,18 +103,19 @@ describe('resource sessions', () => { // TODO: HTTP 401 from prism, support api tokens test.skip('getSessionDetails: required and optional params', async () => { - const response = await client.realtimeKit.sessions.getSessionDetails('app_id', 'session_id', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - include_breakout_rooms: true, - }); + const response = await client.realtimeKit.sessions.getSessionDetails( + 'app_id', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353', include_breakout_rooms: true }, + ); }); // TODO: HTTP 401 from prism, support api tokens test.skip('getSessionParticipantDetails: only required params', async () => { const responsePromise = client.realtimeKit.sessions.getSessionParticipantDetails( 'app_id', - 'session_id', - 'participant_id', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); const rawResponse = await responsePromise.asResponse(); @@ -117,8 +131,8 @@ describe('resource sessions', () => { test.skip('getSessionParticipantDetails: required and optional params', async () => { const response = await client.realtimeKit.sessions.getSessionParticipantDetails( 'app_id', - 'session_id', - 'participant_id', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', filters: 'device_info', @@ -129,9 +143,11 @@ describe('resource sessions', () => { // TODO: HTTP 401 from prism, support api tokens test.skip('getSessionParticipants: only required params', async () => { - const responsePromise = client.realtimeKit.sessions.getSessionParticipants('app_id', 'session_id', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.realtimeKit.sessions.getSessionParticipants( + 'app_id', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -143,23 +159,29 @@ describe('resource sessions', () => { // TODO: HTTP 401 from prism, support api tokens test.skip('getSessionParticipants: required and optional params', async () => { - const response = await client.realtimeKit.sessions.getSessionParticipants('app_id', 'session_id', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - include_peer_events: true, - page_no: 0, - per_page: 0, - search: 'search', - sort_by: 'joinedAt', - sort_order: 'ASC', - view: 'raw', - }); + const response = await client.realtimeKit.sessions.getSessionParticipants( + 'app_id', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + include_peer_events: true, + page_no: 0, + per_page: 0, + search: 'search', + sort_by: 'joinedAt', + sort_order: 'ASC', + view: 'raw', + }, + ); }); // TODO: HTTP 401 from prism, support api tokens test.skip('getSessionSummary: only required params', async () => { - const responsePromise = client.realtimeKit.sessions.getSessionSummary('app_id', 'session_id', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.realtimeKit.sessions.getSessionSummary( + 'app_id', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -171,16 +193,20 @@ describe('resource sessions', () => { // TODO: HTTP 401 from prism, support api tokens test.skip('getSessionSummary: required and optional params', async () => { - const response = await client.realtimeKit.sessions.getSessionSummary('app_id', 'session_id', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const response = await client.realtimeKit.sessions.getSessionSummary( + 'app_id', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); }); // TODO: HTTP 401 from prism, support api tokens test.skip('getSessionTranscripts: only required params', async () => { - const responsePromise = client.realtimeKit.sessions.getSessionTranscripts('app_id', 'session_id', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.realtimeKit.sessions.getSessionTranscripts( + 'app_id', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -192,9 +218,11 @@ describe('resource sessions', () => { // TODO: HTTP 401 from prism, support api tokens test.skip('getSessionTranscripts: required and optional params', async () => { - const response = await client.realtimeKit.sessions.getSessionTranscripts('app_id', 'session_id', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const response = await client.realtimeKit.sessions.getSessionTranscripts( + 'app_id', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); }); // TODO: HTTP 401 from prism, support api tokens @@ -215,7 +243,7 @@ describe('resource sessions', () => { test.skip('getSessions: required and optional params', async () => { const response = await client.realtimeKit.sessions.getSessions('app_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - associated_id: 'associated_id', + associated_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', end_time: '2019-12-27T18:11:19.117Z', page_no: 0, participants: '1:10', diff --git a/tests/api-resources/resource-sharing/recipients.test.ts b/tests/api-resources/resource-sharing/recipients.test.ts index 68dd845add..dc8e6dd473 100644 --- a/tests/api-resources/resource-sharing/recipients.test.ts +++ b/tests/api-resources/resource-sharing/recipients.test.ts @@ -28,6 +28,7 @@ describe('resource recipients', () => { path_account_id: '023e105f4ecef8ad9ca31a8372d0c353', body_account_id: '023e105f4ecef8ad9ca31a8372d0c353', organization_id: '023e105f4ecef8ad9ca31a8372d0c353', + recipient_account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/resource-sharing/resource-sharing.test.ts b/tests/api-resources/resource-sharing/resource-sharing.test.ts index 79d0cc8d72..1c4914c367 100644 --- a/tests/api-resources/resource-sharing/resource-sharing.test.ts +++ b/tests/api-resources/resource-sharing/resource-sharing.test.ts @@ -41,6 +41,7 @@ describe('resource resourceSharing', () => { { account_id: '023e105f4ecef8ad9ca31a8372d0c353', organization_id: '023e105f4ecef8ad9ca31a8372d0c353', + recipient_account_id: '023e105f4ecef8ad9ca31a8372d0c353', }, ], resources: [ diff --git a/tests/api-resources/resource-sharing/resources.test.ts b/tests/api-resources/resource-sharing/resources.test.ts index 1cd6e092f9..d2ec75dfe1 100644 --- a/tests/api-resources/resource-sharing/resources.test.ts +++ b/tests/api-resources/resource-sharing/resources.test.ts @@ -37,35 +37,6 @@ describe('resource resources', () => { }); }); - test('update: only required params', async () => { - const responsePromise = client.resourceSharing.resources.update( - '3fd85f74b32742f1bff64a85009dda07', - '023e105f4ecef8ad9ca31a8372d0c353', - { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - meta: {}, - }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const 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.resourceSharing.resources.update( - '3fd85f74b32742f1bff64a85009dda07', - '023e105f4ecef8ad9ca31a8372d0c353', - { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - meta: {}, - }, - ); - }); - test('list: only required params', async () => { const responsePromise = client.resourceSharing.resources.list('3fd85f74b32742f1bff64a85009dda07', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', @@ -88,50 +59,4 @@ describe('resource resources', () => { status: 'active', }); }); - - test('delete: only required params', async () => { - const responsePromise = client.resourceSharing.resources.delete( - '3fd85f74b32742f1bff64a85009dda07', - '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.resourceSharing.resources.delete( - '3fd85f74b32742f1bff64a85009dda07', - '023e105f4ecef8ad9ca31a8372d0c353', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); - }); - - test('get: only required params', async () => { - const responsePromise = client.resourceSharing.resources.get( - '3fd85f74b32742f1bff64a85009dda07', - '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.resourceSharing.resources.get( - '3fd85f74b32742f1bff64a85009dda07', - '023e105f4ecef8ad9ca31a8372d0c353', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); - }); }); diff --git a/tests/api-resources/snippets/rules.test.ts b/tests/api-resources/snippets/rules.test.ts index 5f329ac748..506f48276d 100644 --- a/tests/api-resources/snippets/rules.test.ts +++ b/tests/api-resources/snippets/rules.test.ts @@ -67,4 +67,19 @@ describe('resource rules', () => { test('delete: required and optional params', async () => { const response = await client.snippets.rules.delete({ zone_id: '9f1839b6152d298aca64c4e906b6d074' }); }); + + test('get: only required params', async () => { + const responsePromise = client.snippets.rules.get({ zone_id: '9f1839b6152d298aca64c4e906b6d074' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const 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.snippets.rules.get({ zone_id: '9f1839b6152d298aca64c4e906b6d074' }); + }); }); diff --git a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/secrets.test.ts b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/secrets.test.ts index 36a3f1ede0..852c24ec6a 100644 --- a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/secrets.test.ts +++ b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/secrets.test.ts @@ -91,7 +91,8 @@ describe('resource secrets', () => { ); }); - test('bulkUpdate: only required params', async () => { + // prism returns HTTP 422 for bulk secret update request shape + test.skip('bulkUpdate: only required params', async () => { const responsePromise = client.workersForPlatforms.dispatch.namespaces.scripts.secrets.bulkUpdate( 'my-dispatch-namespace', 'this-is_my_script-01', @@ -106,7 +107,8 @@ describe('resource secrets', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('bulkUpdate: required and optional params', async () => { + // prism returns HTTP 422 for bulk secret update request shape + test.skip('bulkUpdate: required and optional params', async () => { const response = await client.workersForPlatforms.dispatch.namespaces.scripts.secrets.bulkUpdate( 'my-dispatch-namespace', 'this-is_my_script-01', diff --git a/tests/api-resources/workers/observability/shared-queries.test.ts b/tests/api-resources/workers/observability/shared-queries.test.ts new file mode 100644 index 0000000000..23a712a1f8 --- /dev/null +++ b/tests/api-resources/workers/observability/shared-queries.test.ts @@ -0,0 +1,105 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource sharedQueries', () => { + test('create: only required params', async () => { + const responsePromise = client.workers.observability.sharedQueries.create({ + 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('create: required and optional params', async () => { + const response = await client.workers.observability.sharedQueries.create({ + account_id: 'account_id', + queryId: 'queryId', + timeframe: { from: 0, to: 0 }, + chart: true, + compare: true, + dry: true, + granularity: 0, + ignoreSeries: true, + limit: 2000, + offset: 'offset', + offsetBy: 0, + offsetDirection: 'offsetDirection', + parameters: { + calculations: [ + { + operator: 'uniq', + alias: 'alias', + key: 'key', + keyType: 'string', + }, + ], + datasets: ['string'], + filterCombination: 'and', + filters: [ + { + filterCombination: 'and', + filters: [ + { + filterCombination: 'and', + filters: [{}], + kind: 'group', + }, + ], + kind: 'group', + }, + ], + 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' }, + }, + view: 'traces', + }); + }); + + test('get: only required params', async () => { + const responsePromise = client.workers.observability.sharedQueries.get('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); + }); + + test('get: required and optional params', async () => { + const response = await client.workers.observability.sharedQueries.get('id', { + account_id: 'account_id', + view: 'events', + }); + }); +}); diff --git a/tests/api-resources/workers/observability/telemetry.test.ts b/tests/api-resources/workers/observability/telemetry.test.ts index 8277241633..69ee5e46c4 100644 --- a/tests/api-resources/workers/observability/telemetry.test.ts +++ b/tests/api-resources/workers/observability/telemetry.test.ts @@ -56,6 +56,62 @@ describe('resource telemetry', () => { }); }); + // HTTP 400 error from prism + test.skip('liveTail: only required params', async () => { + const responsePromise = client.workers.observability.telemetry.liveTail({ 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); + }); + + // HTTP 400 error from prism + test.skip('liveTail: required and optional params', async () => { + const response = await client.workers.observability.telemetry.liveTail({ + account_id: 'account_id', + filterCombination: 'and', + filters: [ + { + filterCombination: 'and', + filters: [ + { + filterCombination: 'and', + filters: [{}], + kind: 'group', + }, + ], + kind: 'group', + }, + ], + scriptId: 'scriptId', + }); + }); + + // HTTP 400 error from prism + test.skip('liveTailHeartbeat: only required params', async () => { + const responsePromise = client.workers.observability.telemetry.liveTailHeartbeat({ + 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); + }); + + // HTTP 400 error from prism + test.skip('liveTailHeartbeat: required and optional params', async () => { + const response = await client.workers.observability.telemetry.liveTailHeartbeat({ + account_id: 'account_id', + scriptId: 'scriptId', + }); + }); + // HTTP 400 error from prism test.skip('query: only required params', async () => { const responsePromise = client.workers.observability.telemetry.query({ diff --git a/tests/api-resources/workers/scripts/secrets.test.ts b/tests/api-resources/workers/scripts/secrets.test.ts index f3cceadfe1..f62a6e1494 100644 --- a/tests/api-resources/workers/scripts/secrets.test.ts +++ b/tests/api-resources/workers/scripts/secrets.test.ts @@ -74,7 +74,8 @@ describe('resource secrets', () => { }); }); - test('bulkUpdate: only required params', async () => { + // prism returns HTTP 422 for bulk secret update request shape + test.skip('bulkUpdate: only required params', async () => { const responsePromise = client.workers.scripts.secrets.bulkUpdate('this-is_my_script-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); @@ -87,7 +88,8 @@ describe('resource secrets', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('bulkUpdate: required and optional params', async () => { + // prism returns HTTP 422 for bulk secret update request shape + test.skip('bulkUpdate: required and optional params', async () => { const response = await client.workers.scripts.secrets.bulkUpdate('this-is_my_script-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', secrets: { diff --git a/tests/api-resources/zero-trust/devices/policies/custom/custom.test.ts b/tests/api-resources/zero-trust/devices/policies/custom/custom.test.ts index e2014a7903..afbb3f321f 100644 --- a/tests/api-resources/zero-trust/devices/policies/custom/custom.test.ts +++ b/tests/api-resources/zero-trust/devices/policies/custom/custom.test.ts @@ -41,6 +41,7 @@ describe('resource custom', () => { captive_portal: 180, description: 'Policy for test teams.', disable_auto_fallback: true, + dns_search_suffixes: [{ suffix: 'internal.corp', description: 'Example internal domains' }], enabled: true, exclude: [{ address: '192.0.2.0/24', description: 'Exclude testing domains from the tunnel' }], exclude_office_ips: true, @@ -128,6 +129,7 @@ describe('resource custom', () => { captive_portal: 180, description: 'Policy for test teams.', disable_auto_fallback: true, + dns_search_suffixes: [{ suffix: 'internal.corp', description: 'Example internal domains' }], enabled: true, exclude: [{ address: '192.0.2.0/24', description: 'Exclude testing domains from the tunnel' }], exclude_office_ips: true, diff --git a/tests/api-resources/zero-trust/devices/policies/default/default.test.ts b/tests/api-resources/zero-trust/devices/policies/default/default.test.ts index 77cf68a815..832c4033b4 100644 --- a/tests/api-resources/zero-trust/devices/policies/default/default.test.ts +++ b/tests/api-resources/zero-trust/devices/policies/default/default.test.ts @@ -32,6 +32,7 @@ describe('resource default', () => { auto_connect: 0, captive_portal: 180, disable_auto_fallback: true, + dns_search_suffixes: [{ suffix: 'internal.corp', description: 'Example internal domains' }], exclude: [{ address: '192.0.2.0/24', description: 'Exclude testing domains from the tunnel' }], exclude_office_ips: true, include: [{ address: '192.0.2.0/24', description: 'Include testing domains in the tunnel' }], diff --git a/tests/api-resources/zero-trust/gateway/locations.test.ts b/tests/api-resources/zero-trust/gateway/locations.test.ts index 8ba8c5380d..f00bd3bd9b 100644 --- a/tests/api-resources/zero-trust/gateway/locations.test.ts +++ b/tests/api-resources/zero-trust/gateway/locations.test.ts @@ -41,6 +41,7 @@ describe('resource locations', () => { ipv4: { enabled: true }, ipv6: { enabled: true, networks: [{ network: '2001:85a3::/64' }] }, }, + max_ttl_secs: 3600, networks: [{ network: '192.0.2.1/32' }], }); }); @@ -76,6 +77,7 @@ describe('resource locations', () => { ipv4: { enabled: true }, ipv6: { enabled: true, networks: [{ network: '2001:85a3::/64' }] }, }, + max_ttl_secs: 3600, networks: [{ network: '192.0.2.1/32' }], }); });