diff --git a/.stats.yml b/.stats.yml index 344c370f93..d3e46d00ff 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2280 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: 9fa1bf5d59398da9212855e06ad932b3 +config_hash: 3504379ebb14928a9890a391899a2e10 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/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/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/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/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/tests/api-resources/addressing/regional-hostnames/regional-hostnames.test.ts b/tests/api-resources/addressing/regional-hostnames/regional-hostnames.test.ts deleted file mode 100644 index 0652d2bfad..0000000000 --- a/tests/api-resources/addressing/regional-hostnames/regional-hostnames.test.ts +++ /dev/null @@ -1,114 +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 regionalHostnames', () => { - test('create: only required params', async () => { - const responsePromise = client.addressing.regionalHostnames.create({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - hostname: 'foo.example.com', - region_key: 'ca', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('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', - }); - }); - - test('list: only required params', async () => { - const responsePromise = client.addressing.regionalHostnames.list({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('list: required and optional params', async () => { - const response = await client.addressing.regionalHostnames.list({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - }); - - test('delete: only required params', async () => { - const responsePromise = client.addressing.regionalHostnames.delete('foo.example.com', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('delete: required and optional params', async () => { - const response = await client.addressing.regionalHostnames.delete('foo.example.com', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - }); - - test('edit: only required params', async () => { - const responsePromise = client.addressing.regionalHostnames.edit('foo.example.com', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - region_key: 'ca', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('edit: required and optional params', async () => { - const response = await client.addressing.regionalHostnames.edit('foo.example.com', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - region_key: 'ca', - }); - }); - - test('get: only required params', async () => { - const responsePromise = client.addressing.regionalHostnames.get('foo.example.com', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: required and optional params', async () => { - const response = await client.addressing.regionalHostnames.get('foo.example.com', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - }); -}); 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/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/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/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/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' }); + }); });