diff --git a/.eslintcache b/.eslintcache deleted file mode 100644 index cd44813307..0000000000 --- a/.eslintcache +++ /dev/null @@ -1 +0,0 @@ -[{"/home/tempuser-z687wq/run/codegen-output/cloudflare/cloudflare-node/src/resources/ai/to-markdown.ts":"1"},{"size":1733,"mtime":1759266822909}] \ No newline at end of file diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b5e9157309..ce65b73e4d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "5.2.0" + ".": "5.3.0" } diff --git a/.stats.yml b/.stats.yml index 5637fc3e0e..9bee3557de 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1822 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ca8fbfa82d19dca400ec61b8c93392de1acd157860e435419f9a5e9ec8c586e0.yml -openapi_spec_hash: 77d55c70bc3824ac61bd056e2319ee18 -config_hash: 107e0f1f8a98b007260b319226b88b3c +configured_endpoints: 1891 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7e4d0f06a14e00e1fded122c6e363b955753c19f529887d691584630b9625544.yml +openapi_spec_hash: f04905b36443a3e136496c9dc28ea51d +config_hash: f8ad41a1e87119e46c6452f8f1ea0440 diff --git a/CHANGELOG.md b/CHANGELOG.md index aa438cce21..d704742854 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,80 @@ # Changelog +## 5.3.0 (2025-11-07) + +Full Changelog: [v5.2.0...v5.3.0](https://github.com/cloudflare/cloudflare-typescript/compare/v5.2.0...v5.3.0) + +### Features + +* chore(abuse): rename path parameter ([d38b204](https://github.com/cloudflare/cloudflare-typescript/commit/d38b204b917199ea795e27fc9a86bd71d930cf03)) +* docs: WC-4152 Expose subdomain delete for workers ([0b67525](https://github.com/cloudflare/cloudflare-typescript/commit/0b67525400e702029492048b6916d1ed3844030d)) +* docs(zero_trust_gateway_policy): add /rules/tenants endpoint to Gateway API docs ([32e5a34](https://github.com/cloudflare/cloudflare-typescript/commit/32e5a342f56237f866f4b5570550f12f90a3f451)) +* feat: add connectivity directory service APIs to openapi.stainless.yml ([9cd117b](https://github.com/cloudflare/cloudflare-typescript/commit/9cd117b4aae7940f892ef798f5936e4720e0d7c5)) +* feat: Add token validation to stainless config ([a991204](https://github.com/cloudflare/cloudflare-typescript/commit/a991204a2834034fd42df2d19a4af2e28f4dff3a)) +* feat: SDKs for Organizations and OrganizationsProfile ([f7c1373](https://github.com/cloudflare/cloudflare-typescript/commit/f7c13739fbbba7b9d9ff9c259b37bea92ac6688a)) +* feat(abuse_reports): Expose new abuse report endpoints. GET and LIST. ([454ad3d](https://github.com/cloudflare/cloudflare-typescript/commit/454ad3d717070dbb84a38b3a702e2f1ab1cb1ffd)) +* feat(api): add mcp portals endpoints ([dd447c7](https://github.com/cloudflare/cloudflare-typescript/commit/dd447c75a9ceca80f10ede613723b26aff88dedf)) +* feat(iam): Add SSO Connectors resource to SDKs ([b951900](https://github.com/cloudflare/cloudflare-typescript/commit/b951900426c5ab86ca20deedc5a2aa46ab863ac0)) +* feat(mcp_portals): enable sdks generation ([7760aed](https://github.com/cloudflare/cloudflare-typescript/commit/7760aed7f9af23376a49279230b6f8cd95fe555f)) +* feat(radar): add new group by dimension endpoints; deprecate to_markdown endpoint ([59c3fa8](https://github.com/cloudflare/cloudflare-typescript/commit/59c3fa82a30a74e24e0c95515fca67ba06d5cd14)) +* fix: Correctly reflect schema validation model <-> openapi mapping ([e453fd1](https://github.com/cloudflare/cloudflare-typescript/commit/e453fd193ae133a345fb40741b3751dbbc5643fd)) +* fix: move wvpc ([a61668d](https://github.com/cloudflare/cloudflare-typescript/commit/a61668d9c4fa7ce5c15bc553a9b2911c7bcd29cf)) +* fix: tabbing on realtime-kit api resources ([ff1e8b4](https://github.com/cloudflare/cloudflare-typescript/commit/ff1e8b489d2b0ca868520a6a4ac6859fc6ce5e9c)) +* fix(ai_controls): incorrect use of standalone_api ([fb85a07](https://github.com/cloudflare/cloudflare-typescript/commit/fb85a079dd30e8959bf2af44784e32a0b4303a61)) + + +### Chores + +* **api:** update composite API spec ([e2e9bbd](https://github.com/cloudflare/cloudflare-typescript/commit/e2e9bbd12d72aacc27f47ee3fa3cb8c437fc2e8d)) +* **api:** update composite API spec ([7c20bfe](https://github.com/cloudflare/cloudflare-typescript/commit/7c20bfeb548a7a0c741e9ae4ff8a49140ddeaf71)) +* **api:** update composite API spec ([d68f4df](https://github.com/cloudflare/cloudflare-typescript/commit/d68f4dfc4096c20a524a8dabb45f758e38543cb7)) +* **api:** update composite API spec ([6b8dbe0](https://github.com/cloudflare/cloudflare-typescript/commit/6b8dbe03a3aa0b8df1b046f0c90fc85647b63231)) +* **api:** update composite API spec ([33459bb](https://github.com/cloudflare/cloudflare-typescript/commit/33459bb95326fad56ed321352ef96e7ae31327d3)) +* **api:** update composite API spec ([c614eb3](https://github.com/cloudflare/cloudflare-typescript/commit/c614eb3a0032e15b6032a055bb6df6455841240c)) +* **api:** update composite API spec ([080b997](https://github.com/cloudflare/cloudflare-typescript/commit/080b997a3c7429e6e209ecdec65cb472ea06aefa)) +* **api:** update composite API spec ([5ee80f5](https://github.com/cloudflare/cloudflare-typescript/commit/5ee80f5a28eb4a4c8a43c09eca7a6786e186a678)) +* **api:** update composite API spec ([edf8c4d](https://github.com/cloudflare/cloudflare-typescript/commit/edf8c4dd3e6244d735a28480b619c73cc9062ead)) +* **api:** update composite API spec ([4746f0e](https://github.com/cloudflare/cloudflare-typescript/commit/4746f0e7c8d9e0573def789cfc0e5d2430812ba0)) +* **api:** update composite API spec ([6e4418f](https://github.com/cloudflare/cloudflare-typescript/commit/6e4418fa78ddffd6090a4d4419edb9f64f555677)) +* **api:** update composite API spec ([a016b30](https://github.com/cloudflare/cloudflare-typescript/commit/a016b30d909fef4ce1ce86e7d96167cf6cdcaaf3)) +* **api:** update composite API spec ([4451ae3](https://github.com/cloudflare/cloudflare-typescript/commit/4451ae3e85482dca6cd10d0d85e34d8c592b1d1a)) +* **api:** update composite API spec ([87c840c](https://github.com/cloudflare/cloudflare-typescript/commit/87c840c084f476fef4a830132cf108e755665c0f)) +* **api:** update composite API spec ([4f1a8d8](https://github.com/cloudflare/cloudflare-typescript/commit/4f1a8d86f4db60c109aad7bd203f9df75a135239)) +* **api:** update composite API spec ([bd2264c](https://github.com/cloudflare/cloudflare-typescript/commit/bd2264c643fcce5dd3ab2e52caac3c1adf64c4da)) +* **api:** update composite API spec ([994da03](https://github.com/cloudflare/cloudflare-typescript/commit/994da0333c9cc3c399f4f4c885dc97e55b249729)) +* **api:** update composite API spec ([6321a5b](https://github.com/cloudflare/cloudflare-typescript/commit/6321a5beb1f0ffcd69eed07a8c3bb6c521b31bf1)) +* **api:** update composite API spec ([4ca5332](https://github.com/cloudflare/cloudflare-typescript/commit/4ca5332758542583cecdb4e706d90e76d513d89e)) +* **api:** update composite API spec ([0ddfa1e](https://github.com/cloudflare/cloudflare-typescript/commit/0ddfa1ebeafa8c0cfb8f04d3137ab1816e764f91)) +* **api:** update composite API spec ([a9dbbab](https://github.com/cloudflare/cloudflare-typescript/commit/a9dbbab91ed23481128baca5785c687b117e379a)) +* **api:** update composite API spec ([82a3693](https://github.com/cloudflare/cloudflare-typescript/commit/82a3693b53d6825ae840f409119edd7173aab485)) +* **api:** update composite API spec ([46eaacd](https://github.com/cloudflare/cloudflare-typescript/commit/46eaacd72908ed2f6e940313790fc1225b9c1f6c)) +* **api:** update composite API spec ([98a7c59](https://github.com/cloudflare/cloudflare-typescript/commit/98a7c59b9d8627400dc6870a9f2d6ddecfe7b785)) +* **api:** update composite API spec ([d204f90](https://github.com/cloudflare/cloudflare-typescript/commit/d204f90bc2a60e1cf7be22fb12a7853bfe46037a)) +* **api:** update composite API spec ([ec38fec](https://github.com/cloudflare/cloudflare-typescript/commit/ec38fec79f59dba36fbdaf1fd7d15927b524fb93)) +* **api:** update composite API spec ([9ca4049](https://github.com/cloudflare/cloudflare-typescript/commit/9ca404941e20d7c353377264a46582ceb9c0b5bf)) +* **api:** update composite API spec ([14411b3](https://github.com/cloudflare/cloudflare-typescript/commit/14411b37b7750f07b7988d6dd1e7b80fcf212978)) +* **api:** update composite API spec ([0df6de0](https://github.com/cloudflare/cloudflare-typescript/commit/0df6de0cbb5be238ba0daf8e7b90ff6f7f7179d5)) +* **api:** update composite API spec ([611bc8c](https://github.com/cloudflare/cloudflare-typescript/commit/611bc8ccbf6b04bb336d8a1981efc7c9c9dee297)) +* **api:** update composite API spec ([f8a8648](https://github.com/cloudflare/cloudflare-typescript/commit/f8a8648843c5419968acdc8c7d15bb077dd59a62)) +* **api:** update composite API spec ([1a2d99f](https://github.com/cloudflare/cloudflare-typescript/commit/1a2d99f9b7daed21785d9470d6da42e7005cd4cd)) +* **api:** update composite API spec ([0e54b6d](https://github.com/cloudflare/cloudflare-typescript/commit/0e54b6d8871fbf936633021ddddbb5415c569f85)) +* **api:** update composite API spec ([4ac69f7](https://github.com/cloudflare/cloudflare-typescript/commit/4ac69f7b79452feea2da6e96a8f255057c869f72)) +* **api:** update composite API spec ([9fd9cb7](https://github.com/cloudflare/cloudflare-typescript/commit/9fd9cb77c33102309695e0dae321f0bef5ad3ac7)) +* **api:** update composite API spec ([0866bd5](https://github.com/cloudflare/cloudflare-typescript/commit/0866bd5974efd4a70ff5dcacb681a53ba5189649)) +* **api:** update composite API spec ([af77baf](https://github.com/cloudflare/cloudflare-typescript/commit/af77bafb9ed83802f3f969296371a478ce5cff4d)) +* **api:** update composite API spec ([5c3d38c](https://github.com/cloudflare/cloudflare-typescript/commit/5c3d38cd8be1fce01449fccc9ebf0c3cd3cb81b6)) +* **api:** update composite API spec ([ea4b26d](https://github.com/cloudflare/cloudflare-typescript/commit/ea4b26d15f872f5e64d4036f90394a6f8169c0ce)) +* **api:** update composite API spec ([cf99249](https://github.com/cloudflare/cloudflare-typescript/commit/cf99249750a1bb749bca04fc0b1d3fbd9db619bd)) +* **api:** update composite API spec ([e295d75](https://github.com/cloudflare/cloudflare-typescript/commit/e295d753ba47b7313e5a3c24afa7b00f7d8d295e)) +* **api:** update composite API spec ([712399c](https://github.com/cloudflare/cloudflare-typescript/commit/712399c843de06b97a2a2c49e0ed943d3a7042f8)) +* **api:** update composite API spec ([20039c7](https://github.com/cloudflare/cloudflare-typescript/commit/20039c7a4103a32e44b771390875f68e4cbf3bb9)) +* **api:** update composite API spec ([599d75f](https://github.com/cloudflare/cloudflare-typescript/commit/599d75f03a3da06005d6d4d13dcdf03e88664b53)) +* **api:** update composite API spec ([a4e3d37](https://github.com/cloudflare/cloudflare-typescript/commit/a4e3d3770f26422cd2fdee4ae4168192448c4638)) +* **api:** update composite API spec ([61ca22a](https://github.com/cloudflare/cloudflare-typescript/commit/61ca22ac466f1a9c1bd35d85dfa9a17b4a5726c1)) +* **api:** update composite API spec ([634be45](https://github.com/cloudflare/cloudflare-typescript/commit/634be4563031b41bd259a1fd91deb9c39ac817dd)) +* **api:** update composite API spec ([7e1d515](https://github.com/cloudflare/cloudflare-typescript/commit/7e1d5150cfbd56965d074185cefb12ea21fbef1b)) +* **internal:** use npm pack for build uploads ([44c693f](https://github.com/cloudflare/cloudflare-typescript/commit/44c693f57db12c1f9650e92060d0e8dcb90adb5f)) + ## 5.2.0 (2025-09-30) Full Changelog: [v5.1.0...v5.2.0](https://github.com/cloudflare/cloudflare-typescript/compare/v5.1.0...v5.2.0) diff --git a/api.md b/api.md index 7ffb0aa433..f858f28ed7 100644 --- a/api.md +++ b/api.md @@ -124,6 +124,32 @@ Methods: - client.accounts.logs.audit.list({ ...params }) -> AuditListResponsesCursorPaginationAfter +# Organizations + +Types: + +- Organization +- OrganizationDeleteResponse + +Methods: + +- client.organizations.create({ ...params }) -> Organization +- client.organizations.update(organizationId, { ...params }) -> Organization +- client.organizations.list({ ...params }) -> OrganizationsSinglePage +- client.organizations.delete(organizationId) -> OrganizationDeleteResponse +- client.organizations.get(organizationId) -> Organization + +## OrganizationProfile + +Types: + +- OrganizationProfile + +Methods: + +- client.organizations.organizationProfile.update(organizationId, { ...params }) -> void +- client.organizations.organizationProfile.get(organizationId) -> unnamed_schema_0.Result + # OriginCACertificates Types: @@ -2082,6 +2108,7 @@ Types: - Script - ScriptSetting - ScriptUpdateResponse +- ScriptListResponse - ScriptDeleteResponse - ScriptGetResponse - ScriptSearchResponse @@ -2089,7 +2116,7 @@ Types: Methods: - client.workers.scripts.update(scriptName, { ...params }) -> ScriptUpdateResponse -- client.workers.scripts.list({ ...params }) -> ScriptsSinglePage +- client.workers.scripts.list({ ...params }) -> ScriptListResponsesSinglePage - client.workers.scripts.delete(scriptName, { ...params }) -> ScriptDeleteResponse | null - client.workers.scripts.get(scriptName, { ...params }) -> string - client.workers.scripts.search({ ...params }) -> ScriptSearchResponse @@ -2253,6 +2280,7 @@ Types: Methods: - client.workers.subdomains.update({ ...params }) -> SubdomainUpdateResponse +- client.workers.subdomains.delete({ ...params }) -> void - client.workers.subdomains.get({ ...params }) -> SubdomainGetResponse ## Observability @@ -2421,6 +2449,7 @@ Types: - SubscriptionUpdateResponse - SubscriptionListResponse - SubscriptionDeleteResponse +- SubscriptionGetResponse Methods: @@ -2428,6 +2457,7 @@ Methods: - client.queues.subscriptions.update(subscriptionId, { ...params }) -> SubscriptionUpdateResponse - client.queues.subscriptions.list({ ...params }) -> SubscriptionListResponsesV4PagePaginationArray - client.queues.subscriptions.delete(subscriptionId, { ...params }) -> SubscriptionDeleteResponse +- client.queues.subscriptions.get(subscriptionId, { ...params }) -> SubscriptionGetResponse # APIGateway @@ -2436,11 +2466,10 @@ Methods: Types: - Configuration -- ConfigurationUpdateResponse Methods: -- client.apiGateway.configurations.update({ ...params }) -> ConfigurationUpdateResponse +- client.apiGateway.configurations.update({ ...params }) -> Configuration - client.apiGateway.configurations.get({ ...params }) -> Configuration ## Discovery @@ -2492,14 +2521,14 @@ Methods: Types: -- SettingsMultipleRequest - SchemaValidationUpdateResponse +- SchemaValidationEditResponse - SchemaValidationGetResponse Methods: - client.apiGateway.operations.schemaValidation.update(operationId, { ...params }) -> SchemaValidationUpdateResponse -- client.apiGateway.operations.schemaValidation.edit({ ...params }) -> SettingsMultipleRequest +- client.apiGateway.operations.schemaValidation.edit({ ...params }) -> SchemaValidationEditResponse - client.apiGateway.operations.schemaValidation.get(operationId, { ...params }) -> SchemaValidationGetResponse ## Schemas @@ -2514,34 +2543,36 @@ Methods: ## Settings -Types: +### SchemaValidation -- Settings +Types: -### SchemaValidation +- SchemaValidationUpdateResponse +- SchemaValidationEditResponse +- SchemaValidationGetResponse Methods: -- client.apiGateway.settings.schemaValidation.update({ ...params }) -> Settings -- client.apiGateway.settings.schemaValidation.edit({ ...params }) -> Settings -- client.apiGateway.settings.schemaValidation.get({ ...params }) -> Settings +- client.apiGateway.settings.schemaValidation.update({ ...params }) -> SchemaValidationUpdateResponse +- client.apiGateway.settings.schemaValidation.edit({ ...params }) -> SchemaValidationEditResponse +- client.apiGateway.settings.schemaValidation.get({ ...params }) -> SchemaValidationGetResponse ## UserSchemas Types: - Message -- PublicSchema -- SchemaUpload +- OldPublicSchema +- UserSchemaCreateResponse - UserSchemaDeleteResponse Methods: -- client.apiGateway.userSchemas.create({ ...params }) -> SchemaUpload -- client.apiGateway.userSchemas.list({ ...params }) -> PublicSchemasV4PagePaginationArray +- client.apiGateway.userSchemas.create({ ...params }) -> UserSchemaCreateResponse +- client.apiGateway.userSchemas.list({ ...params }) -> OldPublicSchemasV4PagePaginationArray - client.apiGateway.userSchemas.delete(schemaId, { ...params }) -> UserSchemaDeleteResponse -- client.apiGateway.userSchemas.edit(schemaId, { ...params }) -> PublicSchema -- client.apiGateway.userSchemas.get(schemaId, { ...params }) -> PublicSchema +- client.apiGateway.userSchemas.edit(schemaId, { ...params }) -> OldPublicSchema +- client.apiGateway.userSchemas.get(schemaId, { ...params }) -> OldPublicSchema ### Operations @@ -2918,13 +2949,8 @@ Methods: ## LOADocuments -Types: - -- LOADocumentCreateResponse - Methods: -- client.addressing.loaDocuments.create({ ...params }) -> LOADocumentCreateResponse - client.addressing.loaDocuments.get(loaDocumentId, { ...params }) -> Response ## Prefixes @@ -3925,7 +3951,7 @@ Types: Methods: - client.pages.projects.create({ ...params }) -> Project -- client.pages.projects.list({ ...params }) -> DeploymentsSinglePage +- client.pages.projects.list({ ...params }) -> DeploymentsV4PagePaginationArray - client.pages.projects.delete(projectName, { ...params }) -> ProjectDeleteResponse | null - client.pages.projects.edit(projectName, { ...params }) -> Project - client.pages.projects.get(projectName, { ...params }) -> Project @@ -3940,7 +3966,7 @@ Types: Methods: - client.pages.projects.deployments.create(projectName, { ...params }) -> Deployment -- client.pages.projects.deployments.list(projectName, { ...params }) -> DeploymentsSinglePage +- client.pages.projects.deployments.list(projectName, { ...params }) -> DeploymentsV4PagePaginationArray - client.pages.projects.deployments.delete(projectName, deploymentId, { ...params }) -> DeploymentDeleteResponse | null - client.pages.projects.deployments.get(projectName, deploymentId, { ...params }) -> Deployment - client.pages.projects.deployments.retry(projectName, deploymentId, { ...params }) -> Deployment @@ -5021,6 +5047,48 @@ Methods: ## Access +### AIControls + +#### Mcp + +##### Portals + +Types: + +- PortalCreateResponse +- PortalUpdateResponse +- PortalListResponse +- PortalDeleteResponse +- PortalReadResponse + +Methods: + +- client.zeroTrust.access.aiControls.mcp.portals.create({ ...params }) -> PortalCreateResponse +- client.zeroTrust.access.aiControls.mcp.portals.update(id, { ...params }) -> PortalUpdateResponse +- client.zeroTrust.access.aiControls.mcp.portals.list({ ...params }) -> PortalListResponsesV4PagePaginationArray +- client.zeroTrust.access.aiControls.mcp.portals.delete(id, { ...params }) -> PortalDeleteResponse +- client.zeroTrust.access.aiControls.mcp.portals.read(id, { ...params }) -> PortalReadResponse + +##### Servers + +Types: + +- ServerCreateResponse +- ServerUpdateResponse +- ServerListResponse +- ServerDeleteResponse +- ServerReadResponse +- ServerSyncResponse + +Methods: + +- client.zeroTrust.access.aiControls.mcp.servers.create({ ...params }) -> ServerCreateResponse +- client.zeroTrust.access.aiControls.mcp.servers.update(id, { ...params }) -> ServerUpdateResponse +- client.zeroTrust.access.aiControls.mcp.servers.list({ ...params }) -> ServerListResponsesV4PagePaginationArray +- client.zeroTrust.access.aiControls.mcp.servers.delete(id, { ...params }) -> ServerDeleteResponse +- client.zeroTrust.access.aiControls.mcp.servers.read(id, { ...params }) -> ServerReadResponse +- client.zeroTrust.access.aiControls.mcp.servers.sync(id, { ...params }) -> ServerSyncResponse + ### GatewayCA Types: @@ -5578,21 +5646,13 @@ Methods: ### Cloudflared -Types: - -- CloudflaredCreateResponse -- CloudflaredListResponse -- CloudflaredDeleteResponse -- CloudflaredEditResponse -- CloudflaredGetResponse - Methods: -- client.zeroTrust.tunnels.cloudflared.create({ ...params }) -> CloudflaredCreateResponse -- client.zeroTrust.tunnels.cloudflared.list({ ...params }) -> CloudflaredListResponsesV4PagePaginationArray -- client.zeroTrust.tunnels.cloudflared.delete(tunnelId, { ...params }) -> CloudflaredDeleteResponse -- client.zeroTrust.tunnels.cloudflared.edit(tunnelId, { ...params }) -> CloudflaredEditResponse -- client.zeroTrust.tunnels.cloudflared.get(tunnelId, { ...params }) -> CloudflaredGetResponse +- client.zeroTrust.tunnels.cloudflared.create({ ...params }) -> CloudflareTunnel +- client.zeroTrust.tunnels.cloudflared.list({ ...params }) -> CloudflareTunnelsV4PagePaginationArray +- client.zeroTrust.tunnels.cloudflared.delete(tunnelId, { ...params }) -> CloudflareTunnel +- client.zeroTrust.tunnels.cloudflared.edit(tunnelId, { ...params }) -> CloudflareTunnel +- client.zeroTrust.tunnels.cloudflared.get(tunnelId, { ...params }) -> CloudflareTunnel #### Configurations @@ -6061,10 +6121,10 @@ Types: Methods: - client.zeroTrust.gateway.proxyEndpoints.create({ ...params }) -> ProxyEndpoint -- client.zeroTrust.gateway.proxyEndpoints.list({ ...params }) -> ProxyEndpoint +- client.zeroTrust.gateway.proxyEndpoints.list({ ...params }) -> ProxyEndpointsSinglePage - client.zeroTrust.gateway.proxyEndpoints.delete(proxyEndpointId, { ...params }) -> ProxyEndpointDeleteResponse - client.zeroTrust.gateway.proxyEndpoints.edit(proxyEndpointId, { ...params }) -> ProxyEndpoint -- client.zeroTrust.gateway.proxyEndpoints.get(proxyEndpointId, { ...params }) -> ProxyEndpointsSinglePage +- client.zeroTrust.gateway.proxyEndpoints.get(proxyEndpointId, { ...params }) -> ProxyEndpoint ### Rules @@ -6085,6 +6145,7 @@ Methods: - client.zeroTrust.gateway.rules.list({ ...params }) -> GatewayRulesSinglePage - client.zeroTrust.gateway.rules.delete(ruleId, { ...params }) -> RuleDeleteResponse - client.zeroTrust.gateway.rules.get(ruleId, { ...params }) -> GatewayRule +- client.zeroTrust.gateway.rules.listTenant({ ...params }) -> GatewayRulesSinglePage - client.zeroTrust.gateway.rules.resetExpiration(ruleId, { ...params }) -> GatewayRule ### Certificates @@ -6268,6 +6329,27 @@ Methods: - client.turnstile.widgets.get(sitekey, { ...params }) -> Widget - client.turnstile.widgets.rotateSecret(sitekey, { ...params }) -> Widget +# Connectivity + +## Directory + +### Services + +Types: + +- ServiceCreateResponse +- ServiceUpdateResponse +- ServiceListResponse +- ServiceGetResponse + +Methods: + +- client.connectivity.directory.services.create({ ...params }) -> ServiceCreateResponse +- client.connectivity.directory.services.update(serviceId, { ...params }) -> ServiceUpdateResponse +- client.connectivity.directory.services.list({ ...params }) -> ServiceListResponsesV4PagePaginationArray +- client.connectivity.directory.services.delete(serviceId, { ...params }) -> void +- client.connectivity.directory.services.get(serviceId, { ...params }) -> ServiceGetResponse + # Hyperdrive Types: @@ -6427,6 +6509,16 @@ Methods: ### Inference +Types: + +- InferenceSummaryV2Response +- InferenceTimeseriesGroupsV2Response + +Methods: + +- client.radar.ai.inference.summaryV2(dimension, { ...params }) -> InferenceSummaryV2Response +- client.radar.ai.inference.timeseriesGroupsV2(dimension, { ...params }) -> InferenceTimeseriesGroupsV2Response + #### Summary Types: @@ -6455,6 +6547,18 @@ Methods: ### Bots +Types: + +- BotSummaryV2Response +- BotTimeseriesResponse +- BotTimeseriesGroupsResponse + +Methods: + +- client.radar.ai.bots.summaryV2(dimension, { ...params }) -> BotSummaryV2Response +- client.radar.ai.bots.timeseries({ ...params }) -> BotTimeseriesResponse +- client.radar.ai.bots.timeseriesGroups(dimension, { ...params }) -> BotTimeseriesGroupsResponse + #### Summary Types: @@ -6673,11 +6777,15 @@ Methods: Types: +- DNSSummaryV2Response - DNSTimeseriesResponse +- DNSTimeseriesGroupsV2Response Methods: +- client.radar.dns.summaryV2(dimension, { ...params }) -> DNSSummaryV2Response - client.radar.dns.timeseries({ ...params }) -> DNSTimeseriesResponse +- client.radar.dns.timeseriesGroupsV2(dimension, { ...params }) -> DNSTimeseriesGroupsV2Response ### Top @@ -6752,12 +6860,16 @@ Methods: Types: - NetflowSummaryResponse +- NetflowSummaryV2Response - NetflowTimeseriesResponse +- NetflowTimeseriesGroupsResponse Methods: - client.radar.netflows.summary({ ...params }) -> NetflowSummaryResponse +- client.radar.netflows.summaryV2(dimension, { ...params }) -> NetflowSummaryV2Response - client.radar.netflows.timeseries({ ...params }) -> NetflowTimeseriesResponse +- client.radar.netflows.timeseriesGroups(dimension, { ...params }) -> NetflowTimeseriesGroupsResponse ### Top @@ -6799,11 +6911,15 @@ Methods: Types: +- AS112SummaryV2Response - AS112TimeseriesResponse +- AS112TimeseriesGroupsV2Response Methods: +- client.radar.as112.summaryV2(dimension, { ...params }) -> AS112SummaryV2Response - client.radar.as112.timeseries({ ...params }) -> AS112TimeseriesResponse +- client.radar.as112.timeseriesGroupsV2(dimension, { ...params }) -> AS112TimeseriesGroupsV2Response ### Summary @@ -6870,6 +6986,16 @@ Types: ### Routing +Types: + +- RoutingSummaryV2Response +- RoutingTimeseriesGroupsV2Response + +Methods: + +- client.radar.email.routing.summaryV2(dimension, { ...params }) -> RoutingSummaryV2Response +- client.radar.email.routing.timeseriesGroupsV2(dimension, { ...params }) -> RoutingTimeseriesGroupsV2Response + #### Summary Types: @@ -6912,6 +7038,16 @@ Methods: ### Security +Types: + +- SecuritySummaryV2Response +- SecurityTimeseriesGroupsV2Response + +Methods: + +- client.radar.email.security.summaryV2(dimension, { ...params }) -> SecuritySummaryV2Response +- client.radar.email.security.timeseriesGroupsV2(dimension, { ...params }) -> SecurityTimeseriesGroupsV2Response + #### Top ##### Tlds @@ -7012,11 +7148,15 @@ Methods: Types: +- Layer3SummaryV2Response - Layer3TimeseriesResponse +- Layer3TimeseriesGroupsV2Response Methods: +- client.radar.attacks.layer3.summaryV2(dimension, { ...params }) -> Layer3SummaryV2Response - client.radar.attacks.layer3.timeseries({ ...params }) -> Layer3TimeseriesResponse +- client.radar.attacks.layer3.timeseriesGroupsV2(dimension, { ...params }) -> Layer3TimeseriesGroupsV2Response #### Summary @@ -7092,11 +7232,15 @@ Methods: Types: +- Layer7SummaryV2Response - Layer7TimeseriesResponse +- Layer7TimeseriesGroupsV2Response Methods: +- client.radar.attacks.layer7.summaryV2(dimension, { ...params }) -> Layer7SummaryV2Response - client.radar.attacks.layer7.timeseries({ ...params }) -> Layer7TimeseriesResponse +- client.radar.attacks.layer7.timeseriesGroupsV2(dimension, { ...params }) -> Layer7TimeseriesGroupsV2Response #### Summary @@ -7218,15 +7362,31 @@ Methods: - client.radar.entities.locations.list({ ...params }) -> LocationListResponse - client.radar.entities.locations.get(location, { ...params }) -> LocationGetResponse +## Geolocations + +Types: + +- GeolocationListResponse +- GeolocationGetResponse + +Methods: + +- client.radar.geolocations.list({ ...params }) -> GeolocationListResponse +- client.radar.geolocations.get(geoId, { ...params }) -> GeolocationGetResponse + ## HTTP Types: +- HTTPSummaryV2Response - HTTPTimeseriesResponse +- HTTPTimeseriesGroupsV2Response Methods: +- client.radar.http.summaryV2(dimension, { ...params }) -> HTTPSummaryV2Response - client.radar.http.timeseries({ ...params }) -> HTTPTimeseriesResponse +- client.radar.http.timeseriesGroupsV2(dimension, { ...params }) -> HTTPTimeseriesGroupsV2Response ### Locations @@ -7602,6 +7762,16 @@ Methods: ## LeakedCredentials +Types: + +- LeakedCredentialSummaryV2Response +- LeakedCredentialTimeseriesGroupsV2Response + +Methods: + +- client.radar.leakedCredentials.summaryV2(dimension, { ...params }) -> LeakedCredentialSummaryV2Response +- client.radar.leakedCredentials.timeseriesGroupsV2(dimension, { ...params }) -> LeakedCredentialTimeseriesGroupsV2Response + ### Summary Types: @@ -7851,6 +8021,8 @@ Methods: - client.snippets.rules.list({ ...params }) -> RuleListResponsesSinglePage - client.snippets.rules.delete({ ...params }) -> RuleDeleteResponsesSinglePage +# RealtimeKit + # Calls ## SFU @@ -8305,6 +8477,26 @@ Methods: - client.iam.userGroups.members.list(userGroupId, { ...params }) -> MemberListResponsesV4PagePaginationArray - client.iam.userGroups.members.delete(userGroupId, memberId, { ...params }) -> MemberDeleteResponse +## SSO + +Types: + +- SSOCreateResponse +- SSOUpdateResponse +- SSOListResponse +- SSODeleteResponse +- SSOBeginVerificationResponse +- SSOGetResponse + +Methods: + +- client.iam.sso.create({ ...params }) -> SSOCreateResponse +- client.iam.sso.update(ssoConnectorId, { ...params }) -> SSOUpdateResponse +- client.iam.sso.list({ ...params }) -> SSOListResponsesSinglePage +- client.iam.sso.delete(ssoConnectorId, { ...params }) -> SSODeleteResponse | null +- client.iam.sso.beginVerification(ssoConnectorId, { ...params }) -> SSOBeginVerificationResponse +- client.iam.sso.get(ssoConnectorId, { ...params }) -> SSOGetResponse + # CloudConnector ## Rules @@ -8509,13 +8701,19 @@ Methods: Types: +- ContentScanningCreateResponse +- ContentScanningUpdateResponse - ContentScanningDisableResponse - ContentScanningEnableResponse +- ContentScanningGetResponse Methods: +- client.contentScanning.create({ ...params }) -> ContentScanningCreateResponse +- client.contentScanning.update({ ...params }) -> ContentScanningUpdateResponse - client.contentScanning.disable({ ...params }) -> ContentScanningDisableResponse - client.contentScanning.enable({ ...params }) -> ContentScanningEnableResponse +- client.contentScanning.get({ ...params }) -> ContentScanningGetResponse ## Payloads @@ -8546,10 +8744,14 @@ Methods: Types: - AbuseReportCreateResponse +- AbuseReportListResponse +- AbuseReportGetResponse Methods: -- client.abuseReports.create(reportType, { ...params }) -> AbuseReportCreateResponse +- client.abuseReports.create(reportParam, { ...params }) -> AbuseReportCreateResponse +- client.abuseReports.list({ ...params }) -> AbuseReportListResponsesV4PagePagination +- client.abuseReports.get(reportParam, { ...params }) -> AbuseReportGetResponse # AI @@ -8850,19 +9052,16 @@ Methods: Types: -- SchemaCreateResponse -- SchemaListResponse +- PublicSchema - SchemaDeleteResponse -- SchemaEditResponse -- SchemaGetResponse Methods: -- client.schemaValidation.schemas.create({ ...params }) -> SchemaCreateResponse -- client.schemaValidation.schemas.list({ ...params }) -> SchemaListResponsesV4PagePaginationArray +- client.schemaValidation.schemas.create({ ...params }) -> PublicSchema +- client.schemaValidation.schemas.list({ ...params }) -> PublicSchemasV4PagePaginationArray - client.schemaValidation.schemas.delete(schemaId, { ...params }) -> SchemaDeleteResponse -- client.schemaValidation.schemas.edit(schemaId, { ...params }) -> SchemaEditResponse -- client.schemaValidation.schemas.get(schemaId, { ...params }) -> SchemaGetResponse +- client.schemaValidation.schemas.edit(schemaId, { ...params }) -> PublicSchema +- client.schemaValidation.schemas.get(schemaId, { ...params }) -> PublicSchema ## Settings @@ -8895,3 +9094,48 @@ Methods: - client.schemaValidation.settings.operations.delete(operationId, { ...params }) -> OperationDeleteResponse - client.schemaValidation.settings.operations.bulkEdit({ ...params }) -> OperationBulkEditResponse - client.schemaValidation.settings.operations.get(operationId, { ...params }) -> OperationGetResponse + +# TokenValidation + +## Configuration + +Types: + +- TokenConfig +- ConfigurationDeleteResponse +- ConfigurationEditResponse + +Methods: + +- client.tokenValidation.configuration.create({ ...params }) -> TokenConfig +- client.tokenValidation.configuration.list({ ...params }) -> TokenConfigsV4PagePaginationArray +- client.tokenValidation.configuration.delete(configId, { ...params }) -> ConfigurationDeleteResponse +- client.tokenValidation.configuration.edit(configId, { ...params }) -> ConfigurationEditResponse +- client.tokenValidation.configuration.get(configId, { ...params }) -> TokenConfig + +### Credentials + +Types: + +- CredentialUpdateResponse + +Methods: + +- client.tokenValidation.configuration.credentials.update(configId, { ...params }) -> CredentialUpdateResponse + +## Rules + +Types: + +- TokenValidationRule +- RuleDeleteResponse + +Methods: + +- client.tokenValidation.rules.create({ ...params }) -> TokenValidationRule +- client.tokenValidation.rules.list({ ...params }) -> TokenValidationRulesV4PagePaginationArray +- client.tokenValidation.rules.delete(ruleId, { ...params }) -> RuleDeleteResponse +- client.tokenValidation.rules.bulkCreate([ ...body ]) -> TokenValidationRulesSinglePage +- client.tokenValidation.rules.bulkEdit([ ...body ]) -> TokenValidationRulesSinglePage +- client.tokenValidation.rules.edit(ruleId, { ...params }) -> TokenValidationRule +- client.tokenValidation.rules.get(ruleId, { ...params }) -> TokenValidationRule diff --git a/package.json b/package.json index 254904983e..82f40f4fee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cloudflare", - "version": "5.2.0", + "version": "5.3.0", "description": "The official TypeScript library for the Cloudflare API", "author": "Cloudflare ", "types": "dist/index.d.ts", diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 4580a22d2d..f7392ad1e8 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -16,6 +16,8 @@ TEST_PATHS=( tests/api-resources/accounts/tokens/value.test.ts tests/api-resources/accounts/logs/logs.test.ts tests/api-resources/accounts/logs/audit.test.ts + tests/api-resources/organizations/organizations.test.ts + tests/api-resources/organizations/organization-profile.test.ts tests/api-resources/origin-ca-certificates.test.ts tests/api-resources/ips.test.ts tests/api-resources/memberships.test.ts @@ -430,6 +432,10 @@ TEST_PATHS=( tests/api-resources/zero-trust/organizations/doh.test.ts tests/api-resources/zero-trust/seats.test.ts tests/api-resources/zero-trust/access/access.test.ts + tests/api-resources/zero-trust/access/ai-controls/ai-controls.test.ts + tests/api-resources/zero-trust/access/ai-controls/mcp/mcp.test.ts + tests/api-resources/zero-trust/access/ai-controls/mcp/portals.test.ts + tests/api-resources/zero-trust/access/ai-controls/mcp/servers.test.ts tests/api-resources/zero-trust/access/gateway-ca.test.ts tests/api-resources/zero-trust/access/infrastructure/infrastructure.test.ts tests/api-resources/zero-trust/access/infrastructure/targets.test.ts @@ -529,6 +535,9 @@ TEST_PATHS=( tests/api-resources/zero-trust/risk-scoring/integrations/references.test.ts tests/api-resources/turnstile/turnstile.test.ts tests/api-resources/turnstile/widgets.test.ts + tests/api-resources/connectivity/connectivity.test.ts + tests/api-resources/connectivity/directory/directory.test.ts + tests/api-resources/connectivity/directory/services.test.ts tests/api-resources/hyperdrive/hyperdrive.test.ts tests/api-resources/hyperdrive/configs.test.ts tests/api-resources/rum/rum.test.ts @@ -607,6 +616,7 @@ TEST_PATHS=( tests/api-resources/radar/entities/entities.test.ts tests/api-resources/radar/entities/asns.test.ts tests/api-resources/radar/entities/locations.test.ts + tests/api-resources/radar/geolocations.test.ts tests/api-resources/radar/http/http.test.ts tests/api-resources/radar/http/locations/locations.test.ts tests/api-resources/radar/http/locations/bot-class.test.ts @@ -701,6 +711,7 @@ TEST_PATHS=( tests/api-resources/iam/resource-groups.test.ts tests/api-resources/iam/user-groups/user-groups.test.ts tests/api-resources/iam/user-groups/members.test.ts + tests/api-resources/iam/sso.test.ts tests/api-resources/cloud-connector/cloud-connector.test.ts tests/api-resources/cloud-connector/rules.test.ts tests/api-resources/botnet-feed/botnet-feed.test.ts @@ -755,6 +766,10 @@ TEST_PATHS=( tests/api-resources/schema-validation/schemas.test.ts tests/api-resources/schema-validation/settings/settings.test.ts tests/api-resources/schema-validation/settings/operations.test.ts + tests/api-resources/token-validation/token-validation.test.ts + tests/api-resources/token-validation/configuration/configuration.test.ts + tests/api-resources/token-validation/configuration/credentials.test.ts + tests/api-resources/token-validation/rules.test.ts tests/index.test.ts ) diff --git a/src/index.ts b/src/index.ts index e95a62b7e6..717929079c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -37,6 +37,7 @@ import { OriginPostQuantumEncryption } from './resources/origin-post-quantum-enc import { PageRules } from './resources/page-rules'; import { Pipelines } from './resources/pipelines'; import { RateLimits } from './resources/rate-limits'; +import { RealtimeKit } from './resources/realtime-kit'; import { SecurityTXT } from './resources/security-txt'; import { URLNormalization } from './resources/url-normalization'; import { Accounts } from './resources/accounts/accounts'; @@ -56,6 +57,7 @@ import { Calls } from './resources/calls/calls'; import { CertificateAuthorities } from './resources/certificate-authorities/certificate-authorities'; import { CloudConnector } from './resources/cloud-connector/cloud-connector'; import { CloudforceOne } from './resources/cloudforce-one/cloudforce-one'; +import { Connectivity } from './resources/connectivity/connectivity'; import { ContentScanning } from './resources/content-scanning/content-scanning'; import { CustomCertificates } from './resources/custom-certificates/custom-certificates'; import { CustomHostnames } from './resources/custom-hostnames/custom-hostnames'; @@ -83,6 +85,7 @@ import { MagicNetworkMonitoring } from './resources/magic-network-monitoring/mag import { MagicTransit } from './resources/magic-transit/magic-transit'; import { MTLSCertificates } from './resources/mtls-certificates/mtls-certificates'; import { NetworkInterconnects } from './resources/network-interconnects/network-interconnects'; +import { Organizations } from './resources/organizations/organizations'; import { OriginTLSClientAuth } from './resources/origin-tls-client-auth/origin-tls-client-auth'; import { PageShield } from './resources/page-shield/page-shield'; import { Pages } from './resources/pages/pages'; @@ -103,6 +106,7 @@ import { Spectrum } from './resources/spectrum/spectrum'; import { Speed } from './resources/speed/speed'; import { SSL } from './resources/ssl/ssl'; import { Stream } from './resources/stream/stream'; +import { TokenValidation } from './resources/token-validation/token-validation'; import { Turnstile } from './resources/turnstile/turnstile'; import { URLScanner } from './resources/url-scanner/url-scanner'; import { User } from './resources/user/user'; @@ -266,6 +270,7 @@ export class Cloudflare extends Core.APIClient { } accounts: API.Accounts = new API.Accounts(this); + organizations: API.Organizations = new API.Organizations(this); originCACertificates: API.OriginCACertificates = new API.OriginCACertificates(this); ips: API.IPs = new API.IPs(this); memberships: API.Memberships = new API.Memberships(this); @@ -329,6 +334,7 @@ export class Cloudflare extends Core.APIClient { workersForPlatforms: API.WorkersForPlatforms = new API.WorkersForPlatforms(this); zeroTrust: API.ZeroTrust = new API.ZeroTrust(this); turnstile: API.Turnstile = new API.Turnstile(this); + connectivity: API.Connectivity = new API.Connectivity(this); hyperdrive: API.HyperdriveResource = new API.HyperdriveResource(this); rum: API.RUM = new API.RUM(this); vectorize: API.Vectorize = new API.Vectorize(this); @@ -341,6 +347,7 @@ export class Cloudflare extends Core.APIClient { dcvDelegation: API.DCVDelegation = new API.DCVDelegation(this); hostnames: API.Hostnames = new API.Hostnames(this); snippets: API.Snippets = new API.Snippets(this); + realtimeKit: API.RealtimeKit = new API.RealtimeKit(this); calls: API.Calls = new API.Calls(this); cloudforceOne: API.CloudforceOne = new API.CloudforceOne(this); aiGateway: API.AIGateway = new API.AIGateway(this); @@ -360,6 +367,7 @@ export class Cloudflare extends Core.APIClient { secretsStore: API.SecretsStore = new API.SecretsStore(this); pipelines: API.Pipelines = new API.Pipelines(this); schemaValidation: API.SchemaValidation = new API.SchemaValidation(this); + tokenValidation: API.TokenValidation = new API.TokenValidation(this); /** * Check whether the base URL is set to its default. @@ -503,6 +511,7 @@ export class Cloudflare extends Core.APIClient { } Cloudflare.Accounts = Accounts; +Cloudflare.Organizations = Organizations; Cloudflare.OriginCACertificates = OriginCACertificates; Cloudflare.IPs = IPs; Cloudflare.Memberships = Memberships; @@ -566,6 +575,7 @@ Cloudflare.R2 = R2; Cloudflare.WorkersForPlatforms = WorkersForPlatforms; Cloudflare.ZeroTrust = ZeroTrust; Cloudflare.Turnstile = Turnstile; +Cloudflare.Connectivity = Connectivity; Cloudflare.HyperdriveResource = HyperdriveResource; Cloudflare.RUM = RUM; Cloudflare.Vectorize = Vectorize; @@ -578,6 +588,7 @@ Cloudflare.Speed = Speed; Cloudflare.DCVDelegation = DCVDelegation; Cloudflare.Hostnames = Hostnames; Cloudflare.Snippets = Snippets; +Cloudflare.RealtimeKit = RealtimeKit; Cloudflare.Calls = Calls; Cloudflare.CloudforceOne = CloudforceOne; Cloudflare.AIGateway = AIGateway; @@ -597,6 +608,7 @@ Cloudflare.CustomPages = CustomPages; Cloudflare.SecretsStore = SecretsStore; Cloudflare.Pipelines = Pipelines; Cloudflare.SchemaValidation = SchemaValidation; +Cloudflare.TokenValidation = TokenValidation; export declare namespace Cloudflare { export type RequestOptions = Core.RequestOptions; @@ -636,6 +648,8 @@ export declare namespace Cloudflare { export { Accounts as Accounts }; + export { Organizations as Organizations }; + export { OriginCACertificates as OriginCACertificates }; export { IPs as IPs }; @@ -762,6 +776,8 @@ export declare namespace Cloudflare { export { Turnstile as Turnstile }; + export { Connectivity as Connectivity }; + export { HyperdriveResource as HyperdriveResource }; export { RUM as RUM }; @@ -786,6 +802,8 @@ export declare namespace Cloudflare { export { Snippets as Snippets }; + export { RealtimeKit as RealtimeKit }; + export { Calls as Calls }; export { CloudforceOne as CloudforceOne }; @@ -824,6 +842,8 @@ export declare namespace Cloudflare { export { SchemaValidation as SchemaValidation }; + export { TokenValidation as TokenValidation }; + export type ASN = API.ASN; export type AuditLog = API.AuditLog; export type CertificateCA = API.CertificateCA; diff --git a/src/resources/abuse-reports.ts b/src/resources/abuse-reports.ts index 451e42c504..a890c9539a 100644 --- a/src/resources/abuse-reports.ts +++ b/src/resources/abuse-reports.ts @@ -2,31 +2,201 @@ import { APIResource } from '../resource'; import * as Core from '../core'; +import { V4PagePagination, type V4PagePaginationParams } from '../pagination'; export class AbuseReports extends APIResource { /** * Submit the Abuse Report of a particular type */ create( - reportType: string, + reportParam: string, params: AbuseReportCreateParams, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id, ...body } = params; return ( - this._client.post(`/accounts/${account_id}/abuse-reports/${reportType}`, { + this._client.post(`/accounts/${account_id}/abuse-reports/${reportParam}`, { body, ...options, }) as Core.APIPromise<{ result: AbuseReportCreateResponse }> )._thenUnwrap((obj) => obj.result); } + + /** + * List the abuse reports for a given account + */ + list( + params: AbuseReportListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/abuse-reports`, + AbuseReportListResponsesV4PagePagination, + { query, ...options }, + ); + } + + /** + * Retrieve the details of an abuse report. + */ + get( + reportParam: string, + params: AbuseReportGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get(`/accounts/${account_id}/abuse-reports/${reportParam}`, options) as Core.APIPromise<{ + result: AbuseReportGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } } +export class AbuseReportListResponsesV4PagePagination extends V4PagePagination {} + /** * The result should be 'success' for successful response */ export type AbuseReportCreateResponse = string; +export interface AbuseReportListResponse { + reports: Array; +} + +export namespace AbuseReportListResponse { + export interface Report { + /** + * Public facing ID of abuse report, aka abuse_rand. + */ + id: string; + + /** + * Creation date of report. Time in RFC 3339 format + * (https://www.rfc-editor.org/rfc/rfc3339.html) + */ + cdate: string; + + /** + * Domain that relates to the report. + */ + domain: string; + + /** + * A summary of the mitigations related to this report. + */ + mitigation_summary: Report.MitigationSummary; + + /** + * An enum value that represents the status of an abuse record + */ + status: 'accepted' | 'in_review'; + + /** + * The abuse report type + */ + type: 'PHISH' | 'GEN' | 'THREAT' | 'DMCA' | 'EMER' | 'TM' | 'REG_WHO' | 'NCSEI' | 'NETWORK'; + } + + export namespace Report { + /** + * A summary of the mitigations related to this report. + */ + export interface MitigationSummary { + /** + * How many of the reported URLs were confirmed as abusive. + */ + accepted_url_count: number; + + /** + * How many mitigations are active. + */ + active_count: number; + + /** + * Whether the report has been forwarded to an external hosting provider. + */ + external_host_notified: boolean; + + /** + * How many mitigations are under review. + */ + in_review_count: number; + + /** + * How many mitigations are pending their effective date. + */ + pending_count: number; + } + } +} + +export interface AbuseReportGetResponse { + /** + * Public facing ID of abuse report, aka abuse_rand. + */ + id: string; + + /** + * Creation date of report. Time in RFC 3339 format + * (https://www.rfc-editor.org/rfc/rfc3339.html) + */ + cdate: string; + + /** + * Domain that relates to the report. + */ + domain: string; + + /** + * A summary of the mitigations related to this report. + */ + mitigation_summary: AbuseReportGetResponse.MitigationSummary; + + /** + * An enum value that represents the status of an abuse record + */ + status: 'accepted' | 'in_review'; + + /** + * The abuse report type + */ + type: 'PHISH' | 'GEN' | 'THREAT' | 'DMCA' | 'EMER' | 'TM' | 'REG_WHO' | 'NCSEI' | 'NETWORK'; +} + +export namespace AbuseReportGetResponse { + /** + * A summary of the mitigations related to this report. + */ + export interface MitigationSummary { + /** + * How many of the reported URLs were confirmed as abusive. + */ + accepted_url_count: number; + + /** + * How many mitigations are active. + */ + active_count: number; + + /** + * Whether the report has been forwarded to an external hosting provider. + */ + external_host_notified: boolean; + + /** + * How many mitigations are under review. + */ + in_review_count: number; + + /** + * How many mitigations are pending their effective date. + */ + pending_count: number; + } +} + export type AbuseReportCreateParams = | AbuseReportCreateParams.AbuseReportsDmcaReport | AbuseReportCreateParams.AbuseReportsTrademarkReport @@ -40,12 +210,12 @@ export type AbuseReportCreateParams = export declare namespace AbuseReportCreateParams { export interface AbuseReportsDmcaReport { /** - * Path param: The account ID of the submitter. + * Path param: Cloudflare Account ID */ account_id: string; /** - * Body param: The abuse report type. + * Body param: The report type for submitted reports. */ act: 'abuse_dmca'; @@ -181,12 +351,12 @@ export declare namespace AbuseReportCreateParams { export interface AbuseReportsTrademarkReport { /** - * Path param: The account ID of the submitter. + * Path param: Cloudflare Account ID */ account_id: string; /** - * Body param: The abuse report type. + * Body param: The report type for submitted reports. */ act: 'abuse_trademark'; @@ -289,12 +459,12 @@ export declare namespace AbuseReportCreateParams { export interface AbuseReportsGeneralReport { /** - * Path param: The account ID of the submitter. + * Path param: Cloudflare Account ID */ account_id: string; /** - * Body param: The abuse report type. + * Body param: The report type for submitted reports. */ act: 'abuse_general'; @@ -404,12 +574,12 @@ export declare namespace AbuseReportCreateParams { export interface AbuseReportsPhishingReport { /** - * Path param: The account ID of the submitter. + * Path param: Cloudflare Account ID */ account_id: string; /** - * Body param: The abuse report type. + * Body param: The report type for submitted reports. */ act: 'abuse_phishing'; @@ -504,12 +674,12 @@ export declare namespace AbuseReportCreateParams { export interface AbuseReportsCsamReport { /** - * Path param: The account ID of the submitter. + * Path param: Cloudflare Account ID */ account_id: string; /** - * Body param: The abuse report type. + * Body param: The report type for submitted reports. */ act: 'abuse_children'; @@ -610,12 +780,12 @@ export declare namespace AbuseReportCreateParams { export interface AbuseReportsThreatReport { /** - * Path param: The account ID of the submitter. + * Path param: Cloudflare Account ID */ account_id: string; /** - * Body param: The abuse report type. + * Body param: The report type for submitted reports. */ act: 'abuse_threat'; @@ -703,12 +873,12 @@ export declare namespace AbuseReportCreateParams { export interface AbuseReportsRegistrarWhoisReport { /** - * Path param: The account ID of the submitter. + * Path param: Cloudflare Account ID */ account_id: string; /** - * Body param: The abuse report type. + * Body param: The report type for submitted reports. */ act: 'abuse_registrar_whois'; @@ -783,12 +953,12 @@ export declare namespace AbuseReportCreateParams { export interface AbuseReportsNcseiReport { /** - * Path param: The account ID of the submitter. + * Path param: Cloudflare Account ID */ account_id: string; /** - * Body param: The abuse report type. + * Body param: The report type for submitted reports. */ act: 'abuse_ncsei'; @@ -881,9 +1051,66 @@ export declare namespace AbuseReportCreateParams { } } +export interface AbuseReportListParams extends V4PagePaginationParams { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Query param: Returns reports created after the specified date + */ + created_after?: string; + + /** + * Query param: Returns reports created before the specified date + */ + created_before?: string; + + /** + * Query param: Filter by domain name related to the abuse report + */ + domain?: string; + + /** + * Query param: Filter reports that have any mitigations in the given status. + */ + mitigation_status?: 'pending' | 'active' | 'in_review' | 'cancelled' | 'removed'; + + /** + * Query param: A property to sort by, followed by the order (id, cdate, domain, + * type, status) + */ + sort?: string; + + /** + * Query param: Filter by the status of the report. + */ + status?: 'accepted' | 'in_review'; + + /** + * Query param: Filter by the type of the report. + */ + type?: 'PHISH' | 'GEN' | 'THREAT' | 'DMCA' | 'EMER' | 'TM' | 'REG_WHO' | 'NCSEI' | 'NETWORK'; +} + +export interface AbuseReportGetParams { + /** + * Cloudflare Account ID + */ + account_id: string; +} + +AbuseReports.AbuseReportListResponsesV4PagePagination = AbuseReportListResponsesV4PagePagination; + export declare namespace AbuseReports { export { type AbuseReportCreateResponse as AbuseReportCreateResponse, + type AbuseReportListResponse as AbuseReportListResponse, + type AbuseReportGetResponse as AbuseReportGetResponse, + AbuseReportListResponsesV4PagePagination as AbuseReportListResponsesV4PagePagination, type AbuseReportCreateParams as AbuseReportCreateParams, + type AbuseReportListParams as AbuseReportListParams, + type AbuseReportGetParams as AbuseReportGetParams, }; } diff --git a/src/resources/accounts/accounts.ts b/src/resources/accounts/accounts.ts index 1f17f46efb..332d3d488d 100644 --- a/src/resources/accounts/accounts.ts +++ b/src/resources/accounts/accounts.ts @@ -175,6 +175,11 @@ export interface Account { */ created_on?: string; + /** + * Parent container details + */ + managed_by?: Account.ManagedBy; + /** * Account settings */ @@ -182,6 +187,21 @@ export interface Account { } export namespace Account { + /** + * Parent container details + */ + export interface ManagedBy { + /** + * ID of the parent Organization, if one exists + */ + parent_org_id?: string; + + /** + * Name of the parent Organization, if one exists + */ + parent_org_name?: string; + } + /** * Account settings */ @@ -257,6 +277,11 @@ export interface AccountUpdateParams { */ type: 'standard' | 'enterprise'; + /** + * Body param: Parent container details + */ + managed_by?: AccountUpdateParams.ManagedBy; + /** * Body param: Account settings */ @@ -264,6 +289,11 @@ export interface AccountUpdateParams { } export namespace AccountUpdateParams { + /** + * Parent container details + */ + export interface ManagedBy {} + /** * Account settings */ diff --git a/src/resources/addressing/addressing.ts b/src/resources/addressing/addressing.ts index 06599a8421..d38bac8b1f 100644 --- a/src/resources/addressing/addressing.ts +++ b/src/resources/addressing/addressing.ts @@ -2,12 +2,7 @@ import { APIResource } from '../../resource'; import * as LOADocumentsAPI from './loa-documents'; -import { - LOADocumentCreateParams, - LOADocumentCreateResponse, - LOADocumentGetParams, - LOADocuments, -} from './loa-documents'; +import { LOADocumentGetParams, LOADocuments } from './loa-documents'; import * as ServicesAPI from './services'; import { ServiceListParams, ServiceListResponse, ServiceListResponsesSinglePage, Services } from './services'; import * as AddressMapsAPI from './address-maps/address-maps'; @@ -111,12 +106,7 @@ export declare namespace Addressing { type AddressMapGetParams as AddressMapGetParams, }; - export { - LOADocuments as LOADocuments, - type LOADocumentCreateResponse as LOADocumentCreateResponse, - type LOADocumentCreateParams as LOADocumentCreateParams, - type LOADocumentGetParams as LOADocumentGetParams, - }; + export { LOADocuments as LOADocuments, type LOADocumentGetParams as LOADocumentGetParams }; export { Prefixes as Prefixes, diff --git a/src/resources/addressing/index.ts b/src/resources/addressing/index.ts index 6b64a96cdf..53a85afcca 100644 --- a/src/resources/addressing/index.ts +++ b/src/resources/addressing/index.ts @@ -15,12 +15,7 @@ export { type AddressMapGetParams, } from './address-maps/index'; export { Addressing } from './addressing'; -export { - LOADocuments, - type LOADocumentCreateResponse, - type LOADocumentCreateParams, - type LOADocumentGetParams, -} from './loa-documents'; +export { LOADocuments, type LOADocumentGetParams } from './loa-documents'; export { PrefixesSinglePage, Prefixes, diff --git a/src/resources/addressing/loa-documents.ts b/src/resources/addressing/loa-documents.ts index dafacf0abb..b93c60afc5 100644 --- a/src/resources/addressing/loa-documents.ts +++ b/src/resources/addressing/loa-documents.ts @@ -5,31 +5,6 @@ import * as Core from '../../core'; import { type Response } from '../../_shims/index'; export class LOADocuments extends APIResource { - /** - * Submit LOA document (pdf format) under the account. - * - * @example - * ```ts - * const loaDocument = - * await client.addressing.loaDocuments.create({ - * account_id: '258def64c72dae45f3e4c8516e2111f2', - * loa_document: '@document.pdf', - * }); - * ``` - */ - create( - params: LOADocumentCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post( - `/accounts/${account_id}/addressing/loa_documents`, - Core.multipartFormRequestOptions({ body, ...options }), - ) as Core.APIPromise<{ result: LOADocumentCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * Download specified LOA document under the account. * @@ -59,52 +34,6 @@ export class LOADocuments extends APIResource { } } -export interface LOADocumentCreateResponse { - /** - * Identifier for the uploaded LOA document. - */ - id?: string | null; - - /** - * Identifier of a Cloudflare account. - */ - account_id?: string; - - created?: string; - - /** - * Name of LOA document. Max file size 10MB, and supported filetype is pdf. - */ - filename?: string; - - /** - * File size of the uploaded LOA document. - */ - size_bytes?: number; - - /** - * Whether the LOA has been verified by Cloudflare staff. - */ - verified?: boolean; - - /** - * Timestamp of the moment the LOA was marked as validated. - */ - verified_at?: string | null; -} - -export interface LOADocumentCreateParams { - /** - * Path param: Identifier of a Cloudflare account. - */ - account_id: string; - - /** - * Body param: LOA document to upload. - */ - loa_document: string; -} - export interface LOADocumentGetParams { /** * Identifier of a Cloudflare account. @@ -113,9 +42,5 @@ export interface LOADocumentGetParams { } export declare namespace LOADocuments { - export { - type LOADocumentCreateResponse as LOADocumentCreateResponse, - type LOADocumentCreateParams as LOADocumentCreateParams, - type LOADocumentGetParams as LOADocumentGetParams, - }; + export { type LOADocumentGetParams as LOADocumentGetParams }; } diff --git a/src/resources/addressing/prefixes/bgp-prefixes.ts b/src/resources/addressing/prefixes/bgp-prefixes.ts index 1945d1a5b1..f8cd80f52e 100644 --- a/src/resources/addressing/prefixes/bgp-prefixes.ts +++ b/src/resources/addressing/prefixes/bgp-prefixes.ts @@ -15,7 +15,10 @@ export class BGPPrefixes extends APIResource { * const bgpPrefix = * await client.addressing.prefixes.bgpPrefixes.create( * '2af39739cc4e3b5910c918468bb89828', - * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * { + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * cidr: '192.0.2.0/24', + * }, * ); * ``` */ @@ -196,7 +199,7 @@ export namespace BGPPrefix { on_demand_enabled?: boolean; /** - * Whether advertisement status of the prefix is locked, meaning it cannot be + * Whether the advertisement status of the prefix is locked, meaning it cannot be * changed. */ on_demand_locked?: boolean; @@ -212,7 +215,7 @@ export interface BGPPrefixCreateParams { /** * Body param: IP Prefix in Classless Inter-Domain Routing format. */ - cidr?: string; + cidr: string; } export interface BGPPrefixListParams { diff --git a/src/resources/addressing/prefixes/prefixes.ts b/src/resources/addressing/prefixes/prefixes.ts index a965d93b86..51124a3677 100644 --- a/src/resources/addressing/prefixes/prefixes.ts +++ b/src/resources/addressing/prefixes/prefixes.ts @@ -56,9 +56,8 @@ export class Prefixes extends APIResource { * ```ts * const prefix = await client.addressing.prefixes.create({ * account_id: '258def64c72dae45f3e4c8516e2111f2', - * asn: 209242, + * asn: 13335, * cidr: '192.0.2.0/24', - * loa_document_id: 'd933b1530bc56c9953cf8ce166da8004', * }); * ``` */ @@ -200,7 +199,7 @@ export interface Prefix { /** * Autonomous System Number (ASN) the prefix will be advertised under. */ - asn?: number | null; + asn?: number; /** * IP Prefix in Classless Inter-Domain Routing format. @@ -209,11 +208,22 @@ export interface Prefix { created_at?: string; + /** + * Whether Cloudflare is allowed to generate the LOA document on behalf of the + * prefix owner. + */ + delegate_loa_creation?: boolean; + /** * Description of the prefix. */ description?: string; + /** + * State of one kind of validation for an IP prefix. + */ + irr_validation_state?: string; + /** * Identifier for the uploaded LOA document. */ @@ -236,6 +246,21 @@ export interface Prefix { * Prefix. */ on_demand_locked?: boolean; + + /** + * State of one kind of validation for an IP prefix. + */ + ownership_validation_state?: string; + + /** + * Token provided to demonstrate ownership of the prefix. + */ + ownership_validation_token?: string; + + /** + * State of one kind of validation for an IP prefix. + */ + rpki_validation_state?: string; } export interface PrefixDeleteResponse { @@ -247,8 +272,6 @@ export interface PrefixDeleteResponse { * Whether the API call was successful. */ success: true; - - result_info?: PrefixDeleteResponse.ResultInfo; } export namespace PrefixDeleteResponse { @@ -283,28 +306,6 @@ export namespace PrefixDeleteResponse { pointer?: string; } } - - export interface ResultInfo { - /** - * Total number of results for the requested service. - */ - count?: number; - - /** - * Current page within paginated list of results. - */ - page?: number; - - /** - * Number of results per page of results. - */ - per_page?: number; - - /** - * Total results available without any search parameters. - */ - total_count?: number; - } } export interface PrefixCreateParams { @@ -316,7 +317,7 @@ export interface PrefixCreateParams { /** * Body param: Autonomous System Number (ASN) the prefix will be advertised under. */ - asn: number | null; + asn: number; /** * Body param: IP Prefix in Classless Inter-Domain Routing format. @@ -324,9 +325,15 @@ export interface PrefixCreateParams { cidr: string; /** - * Body param: Identifier for the uploaded LOA document. + * Body param: Whether Cloudflare is allowed to generate the LOA document on behalf + * of the prefix owner. */ - loa_document_id: string | null; + delegate_loa_creation?: boolean; + + /** + * Body param: Description of the prefix. + */ + description?: string; } export interface PrefixListParams { diff --git a/src/resources/addressing/prefixes/service-bindings.ts b/src/resources/addressing/prefixes/service-bindings.ts index 5ef9365d41..a12783f519 100644 --- a/src/resources/addressing/prefixes/service-bindings.ts +++ b/src/resources/addressing/prefixes/service-bindings.ts @@ -7,17 +7,22 @@ import { SinglePage } from '../../../pagination'; export class ServiceBindings extends APIResource { /** * Creates a new Service Binding, routing traffic to IPs within the given CIDR to a - * service running on Cloudflare's network. **Note:** This API may only be used on - * prefixes currently configured with a Magic Transit/Cloudflare CDN/Cloudflare - * Spectrum service binding, and only allows creating upgrade service bindings for - * the Cloudflare CDN or Cloudflare Spectrum. + * service running on Cloudflare's network. **NOTE:** The first Service Binding + * created for an IP Prefix must exactly match the IP Prefix's CIDR. Subsequent + * Service Bindings may be created with a more-specific CIDR. Refer to the + * [Service Bindings Documentation](https://developers.cloudflare.com/byoip/service-bindings/) + * for compatibility details. * * @example * ```ts * const serviceBinding = * await client.addressing.prefixes.serviceBindings.create( * '2af39739cc4e3b5910c918468bb89828', - * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * { + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * cidr: '192.0.2.0/24', + * service_id: '2db684ee7ca04e159946fd05b99e1bcd', + * }, * ); * ``` */ @@ -219,13 +224,13 @@ export interface ServiceBindingCreateParams { /** * Body param: IP Prefix in Classless Inter-Domain Routing format. */ - cidr?: string; + cidr: string; /** * Body param: Identifier of a Service on the Cloudflare network. Available * services and their IDs may be found in the **List Services** endpoint. */ - service_id?: string; + service_id: string; } export interface ServiceBindingListParams { diff --git a/src/resources/alerting/destinations/webhooks.ts b/src/resources/alerting/destinations/webhooks.ts index 279c67d0bf..605e015ae3 100644 --- a/src/resources/alerting/destinations/webhooks.ts +++ b/src/resources/alerting/destinations/webhooks.ts @@ -35,7 +35,7 @@ export class Webhooks extends APIResource { * ```ts * const webhook = * await client.alerting.destinations.webhooks.update( - * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + * 'b115d5ec15c641ee8b7692c449b5227b', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * name: 'Slack Webhook', @@ -90,7 +90,7 @@ export class Webhooks extends APIResource { * ```ts * const webhook = * await client.alerting.destinations.webhooks.delete( - * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + * 'b115d5ec15c641ee8b7692c449b5227b', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -114,7 +114,7 @@ export class Webhooks extends APIResource { * ```ts * const webhooks = * await client.alerting.destinations.webhooks.get( - * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + * 'b115d5ec15c641ee8b7692c449b5227b', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` diff --git a/src/resources/alerting/policies.ts b/src/resources/alerting/policies.ts index c2caed4005..7e22a6cc36 100644 --- a/src/resources/alerting/policies.ts +++ b/src/resources/alerting/policies.ts @@ -35,7 +35,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.update( - * '0da2b59e-f118-439d-8097-bdfb215203c9', + * '0da2b59ef118439d8097bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -85,7 +85,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.delete( - * '0da2b59e-f118-439d-8097-bdfb215203c9', + * '0da2b59ef118439d8097bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -105,7 +105,7 @@ export class Policies extends APIResource { * @example * ```ts * const policy = await client.alerting.policies.get( - * '0da2b59e-f118-439d-8097-bdfb215203c9', + * '0da2b59ef118439d8097bdfb215203c9', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -211,6 +211,7 @@ export interface Policy { * possible values. */ alert_type?: + | 'abuse_report_alert' | 'access_custom_certificate_expiration_type' | 'advanced_ddos_attack_l4_alert' | 'advanced_ddos_attack_l7_alert' @@ -520,6 +521,11 @@ export interface PolicyFilter { */ tunnel_name?: Array; + /** + * Usage depends on specific alert type + */ + type?: Array; + /** * Usage depends on specific alert type */ @@ -739,6 +745,11 @@ export interface PolicyFilterParam { */ tunnel_name?: Array; + /** + * Usage depends on specific alert type + */ + type?: Array; + /** * Usage depends on specific alert type */ @@ -825,6 +836,7 @@ export interface PolicyCreateParams { * possible values. */ alert_type: + | 'abuse_report_alert' | 'access_custom_certificate_expiration_type' | 'advanced_ddos_attack_l4_alert' | 'advanced_ddos_attack_l7_alert' @@ -946,6 +958,7 @@ export interface PolicyUpdateParams { * possible values. */ alert_type?: + | 'abuse_report_alert' | 'access_custom_certificate_expiration_type' | 'advanced_ddos_attack_l4_alert' | 'advanced_ddos_attack_l7_alert' diff --git a/src/resources/api-gateway/api-gateway.ts b/src/resources/api-gateway/api-gateway.ts index 1f9fb727e9..44b4380eba 100644 --- a/src/resources/api-gateway/api-gateway.ts +++ b/src/resources/api-gateway/api-gateway.ts @@ -6,7 +6,6 @@ import { Configuration, ConfigurationGetParams, ConfigurationUpdateParams, - ConfigurationUpdateResponse, Configurations, } from './configurations'; import * as SchemasAPI from './schemas'; @@ -44,10 +43,10 @@ import { Settings } from './settings/settings'; import * as UserSchemasAPI from './user-schemas/user-schemas'; import { Message, - PublicSchema, - PublicSchemasV4PagePaginationArray, - SchemaUpload, + OldPublicSchema, + OldPublicSchemasV4PagePaginationArray, UserSchemaCreateParams, + UserSchemaCreateResponse, UserSchemaDeleteParams, UserSchemaDeleteResponse, UserSchemaEditParams, @@ -74,15 +73,15 @@ APIGateway.Operations = Operations; APIGateway.OperationListResponsesV4PagePaginationArray = OperationListResponsesV4PagePaginationArray; APIGateway.OperationBulkCreateResponsesSinglePage = OperationBulkCreateResponsesSinglePage; APIGateway.Schemas = Schemas; +APIGateway.Settings = Settings; APIGateway.UserSchemas = UserSchemas; -APIGateway.PublicSchemasV4PagePaginationArray = PublicSchemasV4PagePaginationArray; +APIGateway.OldPublicSchemasV4PagePaginationArray = OldPublicSchemasV4PagePaginationArray; APIGateway.ExpressionTemplate = ExpressionTemplate; export declare namespace APIGateway { export { Configurations as Configurations, type Configuration as Configuration, - type ConfigurationUpdateResponse as ConfigurationUpdateResponse, type ConfigurationUpdateParams as ConfigurationUpdateParams, type ConfigurationGetParams as ConfigurationGetParams, }; @@ -119,15 +118,15 @@ export declare namespace APIGateway { type SchemaListParams as SchemaListParams, }; - export { type Settings as Settings }; + export { Settings as Settings }; export { UserSchemas as UserSchemas, type Message as Message, - type PublicSchema as PublicSchema, - type SchemaUpload as SchemaUpload, + type OldPublicSchema as OldPublicSchema, + type UserSchemaCreateResponse as UserSchemaCreateResponse, type UserSchemaDeleteResponse as UserSchemaDeleteResponse, - PublicSchemasV4PagePaginationArray as PublicSchemasV4PagePaginationArray, + OldPublicSchemasV4PagePaginationArray as OldPublicSchemasV4PagePaginationArray, type UserSchemaCreateParams as UserSchemaCreateParams, type UserSchemaListParams as UserSchemaListParams, type UserSchemaDeleteParams as UserSchemaDeleteParams, diff --git a/src/resources/api-gateway/configurations.ts b/src/resources/api-gateway/configurations.ts index 5659e51452..5082ea818a 100644 --- a/src/resources/api-gateway/configurations.ts +++ b/src/resources/api-gateway/configurations.ts @@ -2,11 +2,10 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as UserSchemasAPI from './user-schemas/user-schemas'; export class Configurations extends APIResource { /** - * Set configuration properties + * Update configuration properties * * @example * ```ts @@ -19,12 +18,14 @@ export class Configurations extends APIResource { * }); * ``` */ - update( - params: ConfigurationUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + update(params: ConfigurationUpdateParams, options?: Core.RequestOptions): Core.APIPromise { const { zone_id, ...body } = params; - return this._client.put(`/zones/${zone_id}/api_gateway/configuration`, { body, ...options }); + return ( + this._client.put(`/zones/${zone_id}/api_gateway/configuration`, { + body, + ...options, + }) as Core.APIPromise<{ result: Configuration }> + )._thenUnwrap((obj) => obj.result); } /** @@ -39,12 +40,11 @@ export class Configurations extends APIResource { * ``` */ get(params: ConfigurationGetParams, options?: Core.RequestOptions): Core.APIPromise { - const { zone_id, ...query } = params; + const { zone_id } = params; return ( - this._client.get(`/zones/${zone_id}/api_gateway/configuration`, { - query, - ...options, - }) as Core.APIPromise<{ result: Configuration }> + this._client.get(`/zones/${zone_id}/api_gateway/configuration`, options) as Core.APIPromise<{ + result: Configuration; + }> )._thenUnwrap((obj) => obj.result); } } @@ -93,17 +93,6 @@ export namespace Configuration { } } -export interface ConfigurationUpdateResponse { - errors: UserSchemasAPI.Message; - - messages: UserSchemasAPI.Message; - - /** - * Whether the API call was successful. - */ - success: true; -} - export interface ConfigurationUpdateParams { /** * Path param: Identifier. @@ -159,20 +148,14 @@ export namespace ConfigurationUpdateParams { export interface ConfigurationGetParams { /** - * Path param: Identifier. + * Identifier. */ zone_id: string; - - /** - * Query param: Requests information about certain properties. - */ - properties?: Array<'auth_id_characteristics'>; } export declare namespace Configurations { export { type Configuration as Configuration, - type ConfigurationUpdateResponse as ConfigurationUpdateResponse, type ConfigurationUpdateParams as ConfigurationUpdateParams, type ConfigurationGetParams as ConfigurationGetParams, }; diff --git a/src/resources/api-gateway/index.ts b/src/resources/api-gateway/index.ts index 5941af87f3..494074729b 100644 --- a/src/resources/api-gateway/index.ts +++ b/src/resources/api-gateway/index.ts @@ -4,7 +4,6 @@ export { APIGateway } from './api-gateway'; export { Configurations, type Configuration, - type ConfigurationUpdateResponse, type ConfigurationUpdateParams, type ConfigurationGetParams, } from './configurations'; @@ -16,6 +15,19 @@ export { type DiscoveryGetParams, } from './discovery/index'; export { ExpressionTemplate } from './expression-template/index'; +export { + OldPublicSchemasV4PagePaginationArray, + UserSchemas, + type Message, + type OldPublicSchema, + type UserSchemaCreateResponse, + type UserSchemaDeleteResponse, + type UserSchemaCreateParams, + type UserSchemaListParams, + type UserSchemaDeleteParams, + type UserSchemaEditParams, + type UserSchemaGetParams, +} from './user-schemas/index'; export { OperationListResponsesV4PagePaginationArray, OperationBulkCreateResponsesSinglePage, @@ -34,18 +46,5 @@ export { type OperationBulkDeleteParams, type OperationGetParams, } from './operations/index'; -export { - PublicSchemasV4PagePaginationArray, - UserSchemas, - type Message, - type PublicSchema, - type SchemaUpload, - type UserSchemaDeleteResponse, - type UserSchemaCreateParams, - type UserSchemaListParams, - type UserSchemaDeleteParams, - type UserSchemaEditParams, - type UserSchemaGetParams, -} from './user-schemas/index'; export { Schemas, type SchemaListResponse, type SchemaListParams } from './schemas'; export { Settings } from './settings/index'; diff --git a/src/resources/api-gateway/operations/index.ts b/src/resources/api-gateway/operations/index.ts index 312dd5fe1e..41346972b3 100644 --- a/src/resources/api-gateway/operations/index.ts +++ b/src/resources/api-gateway/operations/index.ts @@ -20,8 +20,8 @@ export { } from './operations'; export { SchemaValidation, - type SettingsMultipleRequest, type SchemaValidationUpdateResponse, + type SchemaValidationEditResponse, type SchemaValidationGetResponse, type SchemaValidationUpdateParams, type SchemaValidationEditParams, diff --git a/src/resources/api-gateway/operations/operations.ts b/src/resources/api-gateway/operations/operations.ts index 44afc92131..3db9ed07bf 100644 --- a/src/resources/api-gateway/operations/operations.ts +++ b/src/resources/api-gateway/operations/operations.ts @@ -6,11 +6,11 @@ import * as SchemaValidationAPI from './schema-validation'; import { SchemaValidation, SchemaValidationEditParams, + SchemaValidationEditResponse, SchemaValidationGetParams, SchemaValidationGetResponse, SchemaValidationUpdateParams, SchemaValidationUpdateResponse, - SettingsMultipleRequest, } from './schema-validation'; import * as UserSchemasAPI from '../user-schemas/user-schemas'; import { SinglePage, V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; @@ -1490,8 +1490,8 @@ export declare namespace Operations { export { SchemaValidation as SchemaValidation, - type SettingsMultipleRequest as SettingsMultipleRequest, type SchemaValidationUpdateResponse as SchemaValidationUpdateResponse, + type SchemaValidationEditResponse as SchemaValidationEditResponse, type SchemaValidationGetResponse as SchemaValidationGetResponse, type SchemaValidationUpdateParams as SchemaValidationUpdateParams, type SchemaValidationEditParams as SchemaValidationEditParams, diff --git a/src/resources/api-gateway/operations/schema-validation.ts b/src/resources/api-gateway/operations/schema-validation.ts index 19466e0d9f..2bfda168e6 100644 --- a/src/resources/api-gateway/operations/schema-validation.ts +++ b/src/resources/api-gateway/operations/schema-validation.ts @@ -29,13 +29,13 @@ export class SchemaValidation extends APIResource { edit( params: SchemaValidationEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, settings_multiple_request } = params; + ): Core.APIPromise { + const { zone_id, body } = params; return ( this._client.patch(`/zones/${zone_id}/api_gateway/operations/schema_validation`, { - body: settings_multiple_request, + body: body, ...options, - }) as Core.APIPromise<{ result: SettingsMultipleRequest }> + }) as Core.APIPromise<{ result: SchemaValidationEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -57,30 +57,28 @@ export class SchemaValidation extends APIResource { } } -export type SettingsMultipleRequest = { [key: string]: SettingsMultipleRequest.item }; +export interface SchemaValidationUpdateResponse { + /** + * When set, this applies a mitigation action to this operation + * + * - `log` log request when request does not conform to schema for this operation + * - `block` deny access to the site when request does not conform to schema for + * this operation + * - `none` will skip mitigation for this operation + * - `null` indicates that no operation level mitigation is in place, see Zone + * Level Schema Validation Settings for mitigation action that will be applied + */ + mitigation_action?: 'log' | 'block' | 'none' | null; -export namespace SettingsMultipleRequest { /** - * Operation ID to mitigation action mappings + * UUID. */ - export interface item { - /** - * When set, this applies a mitigation action to this operation - * - * - `log` log request when request does not conform to schema for this operation - * - `block` deny access to the site when request does not conform to schema for - * this operation - * - `none` will skip mitigation for this operation - * - `null` indicates that no operation level mitigation is in place, see Zone - * Level Schema Validation Settings for mitigation action that will be applied - */ - mitigation_action?: 'log' | 'block' | 'none' | null; - } + operation_id?: string; } -export type SettingsMultipleRequestParam = { [key: string]: SettingsMultipleRequestParam.item }; +export type SchemaValidationEditResponse = { [key: string]: SchemaValidationEditResponse.item }; -export namespace SettingsMultipleRequestParam { +export namespace SchemaValidationEditResponse { /** * Operation ID to mitigation action mappings */ @@ -99,25 +97,6 @@ export namespace SettingsMultipleRequestParam { } } -export interface SchemaValidationUpdateResponse { - /** - * When set, this applies a mitigation action to this operation - * - * - `log` log request when request does not conform to schema for this operation - * - `block` deny access to the site when request does not conform to schema for - * this operation - * - `none` will skip mitigation for this operation - * - `null` indicates that no operation level mitigation is in place, see Zone - * Level Schema Validation Settings for mitigation action that will be applied - */ - mitigation_action?: 'log' | 'block' | 'none' | null; - - /** - * UUID. - */ - operation_id?: string; -} - export interface SchemaValidationGetResponse { /** * When set, this applies a mitigation action to this operation @@ -165,7 +144,26 @@ export interface SchemaValidationEditParams { /** * Body param: */ - settings_multiple_request: SettingsMultipleRequestParam; + body: { [key: string]: SchemaValidationEditParams.Body }; +} + +export namespace SchemaValidationEditParams { + /** + * Operation ID to mitigation action mappings + */ + export interface Body { + /** + * When set, this applies a mitigation action to this operation + * + * - `log` log request when request does not conform to schema for this operation + * - `block` deny access to the site when request does not conform to schema for + * this operation + * - `none` will skip mitigation for this operation + * - `null` indicates that no operation level mitigation is in place, see Zone + * Level Schema Validation Settings for mitigation action that will be applied + */ + mitigation_action?: 'log' | 'block' | 'none' | null; + } } export interface SchemaValidationGetParams { @@ -177,8 +175,8 @@ export interface SchemaValidationGetParams { export declare namespace SchemaValidation { export { - type SettingsMultipleRequest as SettingsMultipleRequest, type SchemaValidationUpdateResponse as SchemaValidationUpdateResponse, + type SchemaValidationEditResponse as SchemaValidationEditResponse, type SchemaValidationGetResponse as SchemaValidationGetResponse, type SchemaValidationUpdateParams as SchemaValidationUpdateParams, type SchemaValidationEditParams as SchemaValidationEditParams, diff --git a/src/resources/api-gateway/settings/index.ts b/src/resources/api-gateway/settings/index.ts index 086f66ad01..091b4c6421 100644 --- a/src/resources/api-gateway/settings/index.ts +++ b/src/resources/api-gateway/settings/index.ts @@ -2,6 +2,9 @@ export { SchemaValidation, + type SchemaValidationUpdateResponse, + type SchemaValidationEditResponse, + type SchemaValidationGetResponse, type SchemaValidationUpdateParams, type SchemaValidationEditParams, type SchemaValidationGetParams, diff --git a/src/resources/api-gateway/settings/schema-validation.ts b/src/resources/api-gateway/settings/schema-validation.ts index 8b3dbc93f7..88293ab668 100644 --- a/src/resources/api-gateway/settings/schema-validation.ts +++ b/src/resources/api-gateway/settings/schema-validation.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as SettingsAPI from './settings'; export class SchemaValidation extends APIResource { /** @@ -13,7 +12,7 @@ export class SchemaValidation extends APIResource { update( params: SchemaValidationUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { zone_id, ...body } = params; return this._client.put(`/zones/${zone_id}/api_gateway/settings/schema_validation`, { body, ...options }); } @@ -26,7 +25,7 @@ export class SchemaValidation extends APIResource { edit( params: SchemaValidationEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { zone_id, ...body } = params; return this._client.patch(`/zones/${zone_id}/api_gateway/settings/schema_validation`, { body, @@ -42,12 +41,84 @@ export class SchemaValidation extends APIResource { get( params: SchemaValidationGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { zone_id } = params; return this._client.get(`/zones/${zone_id}/api_gateway/settings/schema_validation`, options); } } +export interface SchemaValidationUpdateResponse { + /** + * The default mitigation action used when there is no mitigation action defined on + * the operation + * + * Mitigation actions are as follows: + * + * - `log` - log request when request does not conform to schema + * - `block` - deny access to the site when request does not conform to schema + * + * A special value of of `none` will skip running schema validation entirely for + * the request when there is no mitigation action defined on the operation + */ + validation_default_mitigation_action?: 'none' | 'log' | 'block'; + + /** + * When set, this overrides both zone level and operation level mitigation actions. + * + * - `none` will skip running schema validation entirely for the request + * - `null` indicates that no override is in place + */ + validation_override_mitigation_action?: 'none' | null; +} + +export interface SchemaValidationEditResponse { + /** + * The default mitigation action used when there is no mitigation action defined on + * the operation + * + * Mitigation actions are as follows: + * + * - `log` - log request when request does not conform to schema + * - `block` - deny access to the site when request does not conform to schema + * + * A special value of of `none` will skip running schema validation entirely for + * the request when there is no mitigation action defined on the operation + */ + validation_default_mitigation_action?: 'none' | 'log' | 'block'; + + /** + * When set, this overrides both zone level and operation level mitigation actions. + * + * - `none` will skip running schema validation entirely for the request + * - `null` indicates that no override is in place + */ + validation_override_mitigation_action?: 'none' | null; +} + +export interface SchemaValidationGetResponse { + /** + * The default mitigation action used when there is no mitigation action defined on + * the operation + * + * Mitigation actions are as follows: + * + * - `log` - log request when request does not conform to schema + * - `block` - deny access to the site when request does not conform to schema + * + * A special value of of `none` will skip running schema validation entirely for + * the request when there is no mitigation action defined on the operation + */ + validation_default_mitigation_action?: 'none' | 'log' | 'block'; + + /** + * When set, this overrides both zone level and operation level mitigation actions. + * + * - `none` will skip running schema validation entirely for the request + * - `null` indicates that no override is in place + */ + validation_override_mitigation_action?: 'none' | null; +} + export interface SchemaValidationUpdateParams { /** * Path param: Identifier. @@ -122,6 +193,9 @@ export interface SchemaValidationGetParams { export declare namespace SchemaValidation { export { + type SchemaValidationUpdateResponse as SchemaValidationUpdateResponse, + type SchemaValidationEditResponse as SchemaValidationEditResponse, + type SchemaValidationGetResponse as SchemaValidationGetResponse, type SchemaValidationUpdateParams as SchemaValidationUpdateParams, type SchemaValidationEditParams as SchemaValidationEditParams, type SchemaValidationGetParams as SchemaValidationGetParams, diff --git a/src/resources/api-gateway/settings/settings.ts b/src/resources/api-gateway/settings/settings.ts index 9c7236a309..3404409098 100644 --- a/src/resources/api-gateway/settings/settings.ts +++ b/src/resources/api-gateway/settings/settings.ts @@ -5,8 +5,11 @@ import * as SchemaValidationAPI from './schema-validation'; import { SchemaValidation, SchemaValidationEditParams, + SchemaValidationEditResponse, SchemaValidationGetParams, + SchemaValidationGetResponse, SchemaValidationUpdateParams, + SchemaValidationUpdateResponse, } from './schema-validation'; export class Settings extends APIResource { @@ -15,37 +18,14 @@ export class Settings extends APIResource { ); } -export interface Settings { - /** - * The default mitigation action used when there is no mitigation action defined on - * the operation - * - * Mitigation actions are as follows: - * - * - `log` - log request when request does not conform to schema - * - `block` - deny access to the site when request does not conform to schema - * - * A special value of of `none` will skip running schema validation entirely for - * the request when there is no mitigation action defined on the operation - */ - validation_default_mitigation_action?: 'none' | 'log' | 'block'; - - /** - * When set, this overrides both zone level and operation level mitigation actions. - * - * - `none` will skip running schema validation entirely for the request - * - `null` indicates that no override is in place - */ - validation_override_mitigation_action?: 'none' | null; -} - Settings.SchemaValidation = SchemaValidation; export declare namespace Settings { - export { type Settings as Settings }; - export { SchemaValidation as SchemaValidation, + type SchemaValidationUpdateResponse as SchemaValidationUpdateResponse, + type SchemaValidationEditResponse as SchemaValidationEditResponse, + type SchemaValidationGetResponse as SchemaValidationGetResponse, type SchemaValidationUpdateParams as SchemaValidationUpdateParams, type SchemaValidationEditParams as SchemaValidationEditParams, type SchemaValidationGetParams as SchemaValidationGetParams, diff --git a/src/resources/api-gateway/user-schemas/index.ts b/src/resources/api-gateway/user-schemas/index.ts index 867f9925f7..73dd44c925 100644 --- a/src/resources/api-gateway/user-schemas/index.ts +++ b/src/resources/api-gateway/user-schemas/index.ts @@ -7,17 +7,11 @@ export { type HostListParams, } from './hosts'; export { - OperationListResponsesV4PagePaginationArray, - Operations, - type OperationListResponse, - type OperationListParams, -} from './operations'; -export { - PublicSchemasV4PagePaginationArray, + OldPublicSchemasV4PagePaginationArray, UserSchemas, type Message, - type PublicSchema, - type SchemaUpload, + type OldPublicSchema, + type UserSchemaCreateResponse, type UserSchemaDeleteResponse, type UserSchemaCreateParams, type UserSchemaListParams, @@ -25,3 +19,9 @@ export { type UserSchemaEditParams, type UserSchemaGetParams, } from './user-schemas'; +export { + OperationListResponsesV4PagePaginationArray, + Operations, + type OperationListResponse, + type OperationListParams, +} from './operations'; diff --git a/src/resources/api-gateway/user-schemas/user-schemas.ts b/src/resources/api-gateway/user-schemas/user-schemas.ts index f143c9c67d..3b93a8f984 100644 --- a/src/resources/api-gateway/user-schemas/user-schemas.ts +++ b/src/resources/api-gateway/user-schemas/user-schemas.ts @@ -22,13 +22,16 @@ export class UserSchemas extends APIResource { * * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. */ - create(params: UserSchemaCreateParams, options?: Core.RequestOptions): Core.APIPromise { + create( + params: UserSchemaCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { const { zone_id, ...body } = params; return ( this._client.post( `/zones/${zone_id}/api_gateway/user_schemas`, Core.multipartFormRequestOptions({ body, ...options }), - ) as Core.APIPromise<{ result: SchemaUpload }> + ) as Core.APIPromise<{ result: UserSchemaCreateResponse }> )._thenUnwrap((obj) => obj.result); } @@ -40,11 +43,11 @@ export class UserSchemas extends APIResource { list( params: UserSchemaListParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { const { zone_id, ...query } = params; return this._client.getAPIList( `/zones/${zone_id}/api_gateway/user_schemas`, - PublicSchemasV4PagePaginationArray, + OldPublicSchemasV4PagePaginationArray, { query, ...options }, ); } @@ -72,13 +75,13 @@ export class UserSchemas extends APIResource { schemaId: string, params: UserSchemaEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { zone_id, ...body } = params; return ( this._client.patch(`/zones/${zone_id}/api_gateway/user_schemas/${schemaId}`, { body, ...options, - }) as Core.APIPromise<{ result: PublicSchema }> + }) as Core.APIPromise<{ result: OldPublicSchema }> )._thenUnwrap((obj) => obj.result); } @@ -91,18 +94,18 @@ export class UserSchemas extends APIResource { schemaId: string, params: UserSchemaGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { zone_id, ...query } = params; return ( this._client.get(`/zones/${zone_id}/api_gateway/user_schemas/${schemaId}`, { query, ...options, - }) as Core.APIPromise<{ result: PublicSchema }> + }) as Core.APIPromise<{ result: OldPublicSchema }> )._thenUnwrap((obj) => obj.result); } } -export class PublicSchemasV4PagePaginationArray extends V4PagePaginationArray {} +export class OldPublicSchemasV4PagePaginationArray extends V4PagePaginationArray {} export type Message = Array; @@ -124,7 +127,7 @@ export namespace Message { } } -export interface PublicSchema { +export interface OldPublicSchema { created_at: string; /** @@ -153,13 +156,13 @@ export interface PublicSchema { validation_enabled?: boolean; } -export interface SchemaUpload { - schema: PublicSchema; +export interface UserSchemaCreateResponse { + schema: OldPublicSchema; - upload_details?: SchemaUpload.UploadDetails; + upload_details?: UserSchemaCreateResponse.UploadDetails; } -export namespace SchemaUpload { +export namespace UserSchemaCreateResponse { export interface UploadDetails { /** * Diagnostic warning events that occurred during processing. These events are @@ -276,7 +279,7 @@ export interface UserSchemaGetParams { omit_source?: boolean; } -UserSchemas.PublicSchemasV4PagePaginationArray = PublicSchemasV4PagePaginationArray; +UserSchemas.OldPublicSchemasV4PagePaginationArray = OldPublicSchemasV4PagePaginationArray; UserSchemas.Operations = Operations; UserSchemas.OperationListResponsesV4PagePaginationArray = OperationListResponsesV4PagePaginationArray; UserSchemas.Hosts = Hosts; @@ -285,10 +288,10 @@ UserSchemas.HostListResponsesV4PagePaginationArray = HostListResponsesV4PagePagi export declare namespace UserSchemas { export { type Message as Message, - type PublicSchema as PublicSchema, - type SchemaUpload as SchemaUpload, + type OldPublicSchema as OldPublicSchema, + type UserSchemaCreateResponse as UserSchemaCreateResponse, type UserSchemaDeleteResponse as UserSchemaDeleteResponse, - PublicSchemasV4PagePaginationArray as PublicSchemasV4PagePaginationArray, + OldPublicSchemasV4PagePaginationArray as OldPublicSchemasV4PagePaginationArray, type UserSchemaCreateParams as UserSchemaCreateParams, type UserSchemaListParams as UserSchemaListParams, type UserSchemaDeleteParams as UserSchemaDeleteParams, diff --git a/src/resources/client-certificates.ts b/src/resources/client-certificates.ts index 67289dfae7..a7842e54dd 100644 --- a/src/resources/client-certificates.ts +++ b/src/resources/client-certificates.ts @@ -102,12 +102,12 @@ export class ClientCertificates extends APIResource { params: ClientCertificateEditParams, options?: Core.RequestOptions, ): Core.APIPromise { - const { zone_id } = params; + const { zone_id, ...body } = params; return ( - this._client.patch( - `/zones/${zone_id}/client_certificates/${clientCertificateId}`, - options, - ) as Core.APIPromise<{ result: ClientCertificate }> + this._client.patch(`/zones/${zone_id}/client_certificates/${clientCertificateId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: ClientCertificate }> )._thenUnwrap((obj) => obj.result); } @@ -293,9 +293,14 @@ export interface ClientCertificateDeleteParams { export interface ClientCertificateEditParams { /** - * Identifier. + * Path param: Identifier. */ zone_id: string; + + /** + * Body param: + */ + reactivate?: boolean; } export interface ClientCertificateGetParams { diff --git a/src/resources/cloudforce-one/threat-events/attackers.ts b/src/resources/cloudforce-one/threat-events/attackers.ts index 8e7254e8cf..30395b7c9f 100644 --- a/src/resources/cloudforce-one/threat-events/attackers.ts +++ b/src/resources/cloudforce-one/threat-events/attackers.ts @@ -5,7 +5,7 @@ import * as Core from '../../../core'; export class Attackers extends APIResource { /** - * Lists attackers + * Lists attackers across multiple datasets * * @example * ```ts @@ -16,8 +16,8 @@ export class Attackers extends APIResource { * ``` */ list(params: AttackerListParams, options?: Core.RequestOptions): Core.APIPromise { - const { account_id } = params; - return this._client.get(`/accounts/${account_id}/cloudforce-one/events/attackers`, options); + const { account_id, ...query } = params; + return this._client.get(`/accounts/${account_id}/cloudforce-one/events/attackers`, { query, ...options }); } } @@ -35,9 +35,15 @@ export namespace AttackerListResponse { export interface AttackerListParams { /** - * Account ID. + * Path param: Account ID. */ account_id: string; + + /** + * Query param: Array of dataset IDs to query attackers from. If not provided, + * returns all attackers from Event DO tables. + */ + datasetIds?: Array; } export declare namespace Attackers { diff --git a/src/resources/cloudforce-one/threat-events/categories.ts b/src/resources/cloudforce-one/threat-events/categories.ts index 9b19bc008e..8dd433202d 100644 --- a/src/resources/cloudforce-one/threat-events/categories.ts +++ b/src/resources/cloudforce-one/threat-events/categories.ts @@ -31,7 +31,7 @@ export class Categories extends APIResource { } /** - * Lists categories + * Lists categories across multiple datasets * * @example * ```ts @@ -42,8 +42,11 @@ export class Categories extends APIResource { * ``` */ list(params: CategoryListParams, options?: Core.RequestOptions): Core.APIPromise { - const { account_id } = params; - return this._client.get(`/accounts/${account_id}/cloudforce-one/events/categories`, options); + const { account_id, ...query } = params; + return this._client.get(`/accounts/${account_id}/cloudforce-one/events/categories`, { + query, + ...options, + }); } /** @@ -204,9 +207,15 @@ export interface CategoryCreateParams { export interface CategoryListParams { /** - * Account ID. + * Path param: Account ID. */ account_id: string; + + /** + * Query param: Array of dataset IDs to query categories from. If not provided, + * returns all categories from D1 database. + */ + datasetIds?: Array; } export interface CategoryDeleteParams { diff --git a/src/resources/cloudforce-one/threat-events/indicator-types.ts b/src/resources/cloudforce-one/threat-events/indicator-types.ts index 7fa1b77a16..030839110f 100644 --- a/src/resources/cloudforce-one/threat-events/indicator-types.ts +++ b/src/resources/cloudforce-one/threat-events/indicator-types.ts @@ -5,15 +5,10 @@ import * as Core from '../../../core'; export class IndicatorTypes extends APIResource { /** - * Lists all indicator types + * This Method is deprecated. Please use /events/dataset/:dataset_id/indicatorTypes + * instead. * - * @example - * ```ts - * const indicatorTypes = - * await client.cloudforceOne.threatEvents.indicatorTypes.list( - * { account_id: 'account_id' }, - * ); - * ``` + * @deprecated */ list( params: IndicatorTypeListParams, diff --git a/src/resources/cloudforce-one/threat-events/target-industries.ts b/src/resources/cloudforce-one/threat-events/target-industries.ts index 06a6f38e30..682c3cda17 100644 --- a/src/resources/cloudforce-one/threat-events/target-industries.ts +++ b/src/resources/cloudforce-one/threat-events/target-industries.ts @@ -5,7 +5,7 @@ import * as Core from '../../../core'; export class TargetIndustries extends APIResource { /** - * Lists all target industries + * Lists target industries across multiple datasets * * @example * ```ts @@ -19,8 +19,11 @@ export class TargetIndustries extends APIResource { params: TargetIndustryListParams, options?: Core.RequestOptions, ): Core.APIPromise { - const { account_id } = params; - return this._client.get(`/accounts/${account_id}/cloudforce-one/events/targetIndustries`, options); + const { account_id, ...query } = params; + return this._client.get(`/accounts/${account_id}/cloudforce-one/events/targetIndustries`, { + query, + ...options, + }); } } @@ -38,9 +41,15 @@ export namespace TargetIndustryListResponse { export interface TargetIndustryListParams { /** - * Account ID. + * Path param: Account ID. */ account_id: string; + + /** + * Query param: Array of dataset IDs to query target industries from. If not + * provided, returns all target industries from Event tables across all datasets. + */ + datasetIds?: Array; } export declare namespace TargetIndustries { diff --git a/src/resources/cloudforce-one/threat-events/threat-events.ts b/src/resources/cloudforce-one/threat-events/threat-events.ts index 119f0b95d8..8ad50fe4a8 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -209,15 +209,10 @@ export class ThreatEvents extends APIResource { } /** - * Reads an event + * This Method is deprecated. Please use + * /events/dataset/:dataset_id/events/:event_id instead. * - * @example - * ```ts - * const threatEvent = - * await client.cloudforceOne.threatEvents.get('event_id', { - * account_id: 'account_id', - * }); - * ``` + * @deprecated */ get( eventId: string, diff --git a/src/resources/connectivity.ts b/src/resources/connectivity.ts new file mode 100644 index 0000000000..341db75965 --- /dev/null +++ b/src/resources/connectivity.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './connectivity/index'; diff --git a/src/resources/connectivity/connectivity.ts b/src/resources/connectivity/connectivity.ts new file mode 100644 index 0000000000..5b5cdd89eb --- /dev/null +++ b/src/resources/connectivity/connectivity.ts @@ -0,0 +1,15 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as DirectoryAPI from './directory/directory'; +import { Directory } from './directory/directory'; + +export class Connectivity extends APIResource { + directory: DirectoryAPI.Directory = new DirectoryAPI.Directory(this._client); +} + +Connectivity.Directory = Directory; + +export declare namespace Connectivity { + export { Directory as Directory }; +} diff --git a/src/resources/connectivity/directory.ts b/src/resources/connectivity/directory.ts new file mode 100644 index 0000000000..2756bf16f7 --- /dev/null +++ b/src/resources/connectivity/directory.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './directory/index'; diff --git a/src/resources/connectivity/directory/directory.ts b/src/resources/connectivity/directory/directory.ts new file mode 100644 index 0000000000..2966ea7f0f --- /dev/null +++ b/src/resources/connectivity/directory/directory.ts @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as ServicesAPI from './services'; +import { + ServiceCreateParams, + ServiceCreateResponse, + ServiceDeleteParams, + ServiceGetParams, + ServiceGetResponse, + ServiceListParams, + ServiceListResponse, + ServiceListResponsesV4PagePaginationArray, + ServiceUpdateParams, + ServiceUpdateResponse, + Services, +} from './services'; + +export class Directory extends APIResource { + services: ServicesAPI.Services = new ServicesAPI.Services(this._client); +} + +Directory.Services = Services; +Directory.ServiceListResponsesV4PagePaginationArray = ServiceListResponsesV4PagePaginationArray; + +export declare namespace Directory { + export { + Services as Services, + type ServiceCreateResponse as ServiceCreateResponse, + type ServiceUpdateResponse as ServiceUpdateResponse, + type ServiceListResponse as ServiceListResponse, + type ServiceGetResponse as ServiceGetResponse, + ServiceListResponsesV4PagePaginationArray as ServiceListResponsesV4PagePaginationArray, + type ServiceCreateParams as ServiceCreateParams, + type ServiceUpdateParams as ServiceUpdateParams, + type ServiceListParams as ServiceListParams, + type ServiceDeleteParams as ServiceDeleteParams, + type ServiceGetParams as ServiceGetParams, + }; +} diff --git a/src/resources/connectivity/directory/index.ts b/src/resources/connectivity/directory/index.ts new file mode 100644 index 0000000000..2d94b5e566 --- /dev/null +++ b/src/resources/connectivity/directory/index.ts @@ -0,0 +1,16 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { Directory } from './directory'; +export { + ServiceListResponsesV4PagePaginationArray, + Services, + type ServiceCreateResponse, + type ServiceUpdateResponse, + type ServiceListResponse, + type ServiceGetResponse, + type ServiceCreateParams, + type ServiceUpdateParams, + type ServiceListParams, + type ServiceDeleteParams, + type ServiceGetParams, +} from './services'; diff --git a/src/resources/connectivity/directory/services.ts b/src/resources/connectivity/directory/services.ts new file mode 100644 index 0000000000..65079e2c04 --- /dev/null +++ b/src/resources/connectivity/directory/services.ts @@ -0,0 +1,669 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; + +export class Services extends APIResource { + /** + * Create connectivity service + * + * @example + * ```ts + * const service = + * await client.connectivity.directory.services.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * host: { + * hostname: 'api.example.com', + * resolver_network: { + * tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da', + * }, + * }, + * name: 'web-server', + * type: 'http', + * }); + * ``` + */ + create(params: ServiceCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/connectivity/directory/services`, { + body, + ...options, + }) as Core.APIPromise<{ result: ServiceCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update connectivity service + * + * @example + * ```ts + * const service = + * await client.connectivity.directory.services.update( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { + * account_id: 'account_id', + * host: { + * ipv4: '10.0.0.1', + * network: { + * tunnel_id: '0191dce4-9ab4-7fce-b660-8e5dec5172da', + * }, + * }, + * name: 'web-app', + * type: 'http', + * }, + * ); + * ``` + */ + update( + serviceId: string, + params: ServiceUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.put(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: ServiceUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List connectivity services + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const serviceListResponse of client.connectivity.directory.services.list( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: ServiceListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/connectivity/directory/services`, + ServiceListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Delete connectivity service + * + * @example + * ```ts + * await client.connectivity.directory.services.delete( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'account_id' }, + * ); + * ``` + */ + delete( + serviceId: string, + params: ServiceDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.delete(`/accounts/${account_id}/connectivity/directory/services/${serviceId}`, { + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); + } + + /** + * Get connectivity service + * + * @example + * ```ts + * const service = + * await client.connectivity.directory.services.get( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'account_id' }, + * ); + * ``` + */ + get( + serviceId: string, + params: ServiceGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/connectivity/directory/services/${serviceId}`, + options, + ) as Core.APIPromise<{ result: ServiceGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class ServiceListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface ServiceCreateResponse { + host: + | ServiceCreateResponse.InfraIPv4Host + | ServiceCreateResponse.InfraIPv6Host + | ServiceCreateResponse.InfraDualStackHost + | ServiceCreateResponse.InfraHostnameHost; + + name: string; + + type: 'http'; + + created_at?: string; + + http_port?: number | null; + + https_port?: number | null; + + service_id?: string; + + updated_at?: string; +} + +export namespace ServiceCreateResponse { + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; + + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } + } +} + +export interface ServiceUpdateResponse { + host: + | ServiceUpdateResponse.InfraIPv4Host + | ServiceUpdateResponse.InfraIPv6Host + | ServiceUpdateResponse.InfraDualStackHost + | ServiceUpdateResponse.InfraHostnameHost; + + name: string; + + type: 'http'; + + created_at?: string; + + http_port?: number | null; + + https_port?: number | null; + + service_id?: string; + + updated_at?: string; +} + +export namespace ServiceUpdateResponse { + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; + + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } + } +} + +export interface ServiceListResponse { + host: + | ServiceListResponse.InfraIPv4Host + | ServiceListResponse.InfraIPv6Host + | ServiceListResponse.InfraDualStackHost + | ServiceListResponse.InfraHostnameHost; + + name: string; + + type: 'http'; + + created_at?: string; + + http_port?: number | null; + + https_port?: number | null; + + service_id?: string; + + updated_at?: string; +} + +export namespace ServiceListResponse { + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; + + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } + } +} + +export interface ServiceGetResponse { + host: + | ServiceGetResponse.InfraIPv4Host + | ServiceGetResponse.InfraIPv6Host + | ServiceGetResponse.InfraDualStackHost + | ServiceGetResponse.InfraHostnameHost; + + name: string; + + type: 'http'; + + created_at?: string; + + http_port?: number | null; + + https_port?: number | null; + + service_id?: string; + + updated_at?: string; +} + +export namespace ServiceGetResponse { + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; + + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } + } +} + +export interface ServiceCreateParams { + /** + * Path param: Account identifier + */ + account_id: string; + + /** + * Body param: + */ + host: + | ServiceCreateParams.InfraIPv4Host + | ServiceCreateParams.InfraIPv6Host + | ServiceCreateParams.InfraDualStackHost + | ServiceCreateParams.InfraHostnameHost; + + /** + * Body param: + */ + name: string; + + /** + * Body param: + */ + type: 'http'; + + /** + * Body param: + */ + http_port?: number | null; + + /** + * Body param: + */ + https_port?: number | null; +} + +export namespace ServiceCreateParams { + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; + + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } + } +} + +export interface ServiceUpdateParams { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + host: + | ServiceUpdateParams.InfraIPv4Host + | ServiceUpdateParams.InfraIPv6Host + | ServiceUpdateParams.InfraDualStackHost + | ServiceUpdateParams.InfraHostnameHost; + + /** + * Body param: + */ + name: string; + + /** + * Body param: + */ + type: 'http'; + + /** + * Body param: + */ + http_port?: number | null; + + /** + * Body param: + */ + https_port?: number | null; +} + +export namespace ServiceUpdateParams { + export interface InfraIPv4Host { + ipv4: string; + + network: InfraIPv4Host.Network; + } + + export namespace InfraIPv4Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraIPv6Host { + ipv6: string; + + network: InfraIPv6Host.Network; + } + + export namespace InfraIPv6Host { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraDualStackHost { + ipv4: string; + + ipv6: string; + + network: InfraDualStackHost.Network; + } + + export namespace InfraDualStackHost { + export interface Network { + tunnel_id: string; + } + } + + export interface InfraHostnameHost { + hostname: string; + + resolver_network: InfraHostnameHost.ResolverNetwork; + } + + export namespace InfraHostnameHost { + export interface ResolverNetwork { + tunnel_id: string; + + resolver_ips?: Array | null; + } + } +} + +export interface ServiceListParams extends V4PagePaginationArrayParams { + /** + * Path param: Account identifier + */ + account_id: string; + + /** + * Query param: + */ + type?: 'http' | null; +} + +export interface ServiceDeleteParams { + account_id: string; +} + +export interface ServiceGetParams { + account_id: string; +} + +Services.ServiceListResponsesV4PagePaginationArray = ServiceListResponsesV4PagePaginationArray; + +export declare namespace Services { + export { + type ServiceCreateResponse as ServiceCreateResponse, + type ServiceUpdateResponse as ServiceUpdateResponse, + type ServiceListResponse as ServiceListResponse, + type ServiceGetResponse as ServiceGetResponse, + ServiceListResponsesV4PagePaginationArray as ServiceListResponsesV4PagePaginationArray, + type ServiceCreateParams as ServiceCreateParams, + type ServiceUpdateParams as ServiceUpdateParams, + type ServiceListParams as ServiceListParams, + type ServiceDeleteParams as ServiceDeleteParams, + type ServiceGetParams as ServiceGetParams, + }; +} diff --git a/src/resources/connectivity/index.ts b/src/resources/connectivity/index.ts new file mode 100644 index 0000000000..6672dc60e6 --- /dev/null +++ b/src/resources/connectivity/index.ts @@ -0,0 +1,4 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { Connectivity } from './connectivity'; +export { Directory } from './directory/index'; diff --git a/src/resources/content-scanning/content-scanning.ts b/src/resources/content-scanning/content-scanning.ts index 18f79cbd0a..49130883ac 100644 --- a/src/resources/content-scanning/content-scanning.ts +++ b/src/resources/content-scanning/content-scanning.ts @@ -22,8 +22,67 @@ export class ContentScanning extends APIResource { payloads: PayloadsAPI.Payloads = new PayloadsAPI.Payloads(this._client); settings: SettingsAPI.Settings = new SettingsAPI.Settings(this._client); + /** + * Update the Content Scanning status. + * + * @example + * ```ts + * const contentScanning = await client.contentScanning.create( + * { + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * value: 'enabled', + * }, + * ); + * ``` + */ + create( + params: ContentScanningCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.put(`/zones/${zone_id}/content-upload-scan/settings`, { + body, + ...options, + }) as Core.APIPromise<{ result: ContentScanningCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update the Content Scanning status. + * + * @example + * ```ts + * const contentScanning = await client.contentScanning.update( + * { + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * value: 'enabled', + * }, + * ); + * ``` + */ + update( + params: ContentScanningUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.put(`/zones/${zone_id}/content-upload-scan/settings`, { + body, + ...options, + }) as Core.APIPromise<{ result: ContentScanningUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Disable Content Scanning. + * + * @example + * ```ts + * const response = await client.contentScanning.disable({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ disable( params: ContentScanningDisableParams, @@ -39,6 +98,13 @@ export class ContentScanning extends APIResource { /** * Enable Content Scanning. + * + * @example + * ```ts + * const response = await client.contentScanning.enable({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ enable( params: ContentScanningEnableParams, @@ -51,12 +117,103 @@ export class ContentScanning extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieve the current status of Content Scanning. + * + * @example + * ```ts + * const contentScanning = await client.contentScanning.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + get( + params: ContentScanningGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.get(`/zones/${zone_id}/content-upload-scan/settings`, options) as Core.APIPromise<{ + result: ContentScanningGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +/** + * Defines the status for Content Scanning. + */ +export interface ContentScanningCreateResponse { + /** + * Defines the last modification date (ISO 8601) of the Content Scanning status. + */ + modified?: string; + + /** + * Defines the status of Content Scanning. + */ + value?: string; +} + +/** + * Defines the status for Content Scanning. + */ +export interface ContentScanningUpdateResponse { + /** + * Defines the last modification date (ISO 8601) of the Content Scanning status. + */ + modified?: string; + + /** + * Defines the status of Content Scanning. + */ + value?: string; } export type ContentScanningDisableResponse = unknown; export type ContentScanningEnableResponse = unknown; +/** + * Defines the status for Content Scanning. + */ +export interface ContentScanningGetResponse { + /** + * Defines the last modification date (ISO 8601) of the Content Scanning status. + */ + modified?: string; + + /** + * Defines the status of Content Scanning. + */ + value?: string; +} + +export interface ContentScanningCreateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: The status value for Content Scanning. + */ + value: 'enabled' | 'disabled'; +} + +export interface ContentScanningUpdateParams { + /** + * Path param: Defines an identifier. + */ + zone_id: string; + + /** + * Body param: The status value for Content Scanning. + */ + value: 'enabled' | 'disabled'; +} + export interface ContentScanningDisableParams { /** * Defines an identifier. @@ -71,6 +228,13 @@ export interface ContentScanningEnableParams { zone_id: string; } +export interface ContentScanningGetParams { + /** + * Defines an identifier. + */ + zone_id: string; +} + ContentScanning.Payloads = Payloads; ContentScanning.PayloadCreateResponsesSinglePage = PayloadCreateResponsesSinglePage; ContentScanning.PayloadListResponsesSinglePage = PayloadListResponsesSinglePage; @@ -79,10 +243,16 @@ ContentScanning.Settings = Settings; export declare namespace ContentScanning { export { + type ContentScanningCreateResponse as ContentScanningCreateResponse, + type ContentScanningUpdateResponse as ContentScanningUpdateResponse, type ContentScanningDisableResponse as ContentScanningDisableResponse, type ContentScanningEnableResponse as ContentScanningEnableResponse, + type ContentScanningGetResponse as ContentScanningGetResponse, + type ContentScanningCreateParams as ContentScanningCreateParams, + type ContentScanningUpdateParams as ContentScanningUpdateParams, type ContentScanningDisableParams as ContentScanningDisableParams, type ContentScanningEnableParams as ContentScanningEnableParams, + type ContentScanningGetParams as ContentScanningGetParams, }; export { diff --git a/src/resources/content-scanning/payloads.ts b/src/resources/content-scanning/payloads.ts index d3fad16a42..12c7fa4b8e 100644 --- a/src/resources/content-scanning/payloads.ts +++ b/src/resources/content-scanning/payloads.ts @@ -7,6 +7,24 @@ import { SinglePage } from '../../pagination'; export class Payloads extends APIResource { /** * Add custom scan expressions for Content Scanning. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const payloadCreateResponse of client.contentScanning.payloads.create( + * { + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * body: [ + * { + * payload: + * 'lookup_json_string(http.request.body.raw, "file")', + * }, + * ], + * }, + * )) { + * // ... + * } + * ``` */ create( params: PayloadCreateParams, @@ -22,6 +40,16 @@ export class Payloads extends APIResource { /** * Get a list of existing custom scan expressions for Content Scanning. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const payloadListResponse of client.contentScanning.payloads.list( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` */ list( params: PayloadListParams, @@ -37,6 +65,17 @@ export class Payloads extends APIResource { /** * Delete a Content Scan Custom Expression. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const payloadDeleteResponse of client.contentScanning.payloads.delete( + * 'a350a054caa840c9becd89c3b4f0195b', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` */ delete( expressionId: string, diff --git a/src/resources/content-scanning/settings.ts b/src/resources/content-scanning/settings.ts index 8d5958e68a..4f1eaef4f5 100644 --- a/src/resources/content-scanning/settings.ts +++ b/src/resources/content-scanning/settings.ts @@ -6,6 +6,13 @@ import * as Core from '../../core'; export class Settings extends APIResource { /** * Retrieve the current status of Content Scanning. + * + * @example + * ```ts + * const setting = await client.contentScanning.settings.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ get(params: SettingGetParams, options?: Core.RequestOptions): Core.APIPromise { const { zone_id } = params; diff --git a/src/resources/custom-pages.ts b/src/resources/custom-pages.ts index 6bd1b13cf7..4c861b1e41 100644 --- a/src/resources/custom-pages.ts +++ b/src/resources/custom-pages.ts @@ -24,13 +24,15 @@ export class CustomPages extends APIResource { */ update( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params: CustomPageUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { @@ -123,36 +125,42 @@ export class CustomPages extends APIResource { */ get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params?: CustomPageGetParams, options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', options?: Core.RequestOptions, ): Core.APIPromise; get( identifier: - | 'waf_block' - | 'ip_block' - | 'country_challenge' - | '500_errors' | '1000_errors' + | '500_errors' + | 'basic_challenge' + | 'country_challenge' + | 'ip_block' | 'managed_challenge' - | 'ratelimit_block', + | 'ratelimit_block' + | 'under_attack' + | 'waf_block', params: CustomPageGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { diff --git a/src/resources/d1/database.ts b/src/resources/d1/database.ts index 905848c187..8489b4555e 100644 --- a/src/resources/d1/database.ts +++ b/src/resources/d1/database.ts @@ -658,6 +658,12 @@ export interface DatabaseCreateParams { */ name: string; + /** + * Body param: Specify the location to restrict the D1 database to run and store + * data. If this option is present, the location hint is ignored. + */ + jurisdiction?: 'eu' | 'fedramp'; + /** * Body param: Specify the region to create the D1 primary, if available. If this * option is omitted, the D1 will be created as close as possible to the current @@ -856,40 +862,102 @@ export declare namespace DatabaseImportParams { } } -export interface DatabaseQueryParams { - /** - * Path param: Account identifier tag. - */ - account_id: string; +export type DatabaseQueryParams = DatabaseQueryParams.D1SingleQuery | DatabaseQueryParams.MultipleQueries; - /** - * Body param: Your SQL query. Supports multiple statements, joined by semicolons, - * which will be executed as a batch. - */ - sql: string; +export declare namespace DatabaseQueryParams { + export interface D1SingleQuery { + /** + * Path param: Account identifier tag. + */ + account_id: string; - /** - * Body param: - */ - params?: Array; + /** + * Body param: Your SQL query. Supports multiple statements, joined by semicolons, + * which will be executed as a batch. + */ + sql: string; + + /** + * Body param: + */ + params?: Array; + } + + export interface MultipleQueries { + /** + * Path param: Account identifier tag. + */ + account_id: string; + + /** + * Body param: + */ + batch?: Array; + } + + export namespace MultipleQueries { + /** + * A single query with or without parameters + */ + export interface Batch { + /** + * Your SQL query. Supports multiple statements, joined by semicolons, which will + * be executed as a batch. + */ + sql: string; + + params?: Array; + } + } } -export interface DatabaseRawParams { - /** - * Path param: Account identifier tag. - */ - account_id: string; +export type DatabaseRawParams = DatabaseRawParams.D1SingleQuery | DatabaseRawParams.MultipleQueries; - /** - * Body param: Your SQL query. Supports multiple statements, joined by semicolons, - * which will be executed as a batch. - */ - sql: string; +export declare namespace DatabaseRawParams { + export interface D1SingleQuery { + /** + * Path param: Account identifier tag. + */ + account_id: string; - /** - * Body param: - */ - params?: Array; + /** + * Body param: Your SQL query. Supports multiple statements, joined by semicolons, + * which will be executed as a batch. + */ + sql: string; + + /** + * Body param: + */ + params?: Array; + } + + export interface MultipleQueries { + /** + * Path param: Account identifier tag. + */ + account_id: string; + + /** + * Body param: + */ + batch?: Array; + } + + export namespace MultipleQueries { + /** + * A single query with or without parameters + */ + export interface Batch { + /** + * Your SQL query. Supports multiple statements, joined by semicolons, which will + * be executed as a batch. + */ + sql: string; + + params?: Array; + } + } } Database.DatabaseListResponsesV4PagePaginationArray = DatabaseListResponsesV4PagePaginationArray; diff --git a/src/resources/dns/records.ts b/src/resources/dns/records.ts index 0a09cf3cb4..b3eb5c6bb2 100644 --- a/src/resources/dns/records.ts +++ b/src/resources/dns/records.ts @@ -3701,30 +3701,30 @@ export namespace Record { } export type RecordResponse = - | RecordResponse.ARecord - | RecordResponse.AAAARecord - | RecordResponse.CNAMERecord - | RecordResponse.MXRecord - | RecordResponse.NSRecord - | RecordResponse.OpenpgpkeyRecord - | RecordResponse.PTRRecord - | RecordResponse.TXTRecord - | RecordResponse.CAARecord - | RecordResponse.CERTRecord - | RecordResponse.DNSKEYRecord - | RecordResponse.DSRecord - | RecordResponse.HTTPSRecord - | RecordResponse.LOCRecord - | RecordResponse.NAPTRRecord - | RecordResponse.SMIMEARecord - | RecordResponse.SRVRecord - | RecordResponse.SSHFPRecord - | RecordResponse.SVCBRecord - | RecordResponse.TLSARecord - | RecordResponse.URIRecord; + | RecordResponse.A + | RecordResponse.AAAA + | RecordResponse.CNAME + | RecordResponse.MX + | RecordResponse.NS + | RecordResponse.Openpgpkey + | RecordResponse.PTR + | RecordResponse.TXT + | RecordResponse.CAA + | RecordResponse.CERT + | RecordResponse.DNSKEY + | RecordResponse.DS + | RecordResponse.HTTPS + | RecordResponse.LOC + | RecordResponse.NAPTR + | RecordResponse.SMIMEA + | RecordResponse.SRV + | RecordResponse.SSHFP + | RecordResponse.SVCB + | RecordResponse.TLSA + | RecordResponse.URI; export namespace RecordResponse { - export interface ARecord extends RecordsAPI.ARecord { + export interface A extends RecordsAPI.ARecord { /** * Identifier. */ @@ -3761,7 +3761,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface AAAARecord extends RecordsAPI.AAAARecord { + export interface AAAA extends RecordsAPI.AAAARecord { /** * Identifier. */ @@ -3798,7 +3798,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface CNAMERecord extends RecordsAPI.CNAMERecord { + export interface CNAME extends RecordsAPI.CNAMERecord { /** * Identifier. */ @@ -3835,7 +3835,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface MXRecord extends RecordsAPI.MXRecord { + export interface MX extends RecordsAPI.MXRecord { /** * Identifier. */ @@ -3872,7 +3872,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface NSRecord extends RecordsAPI.NSRecord { + export interface NS extends RecordsAPI.NSRecord { /** * Identifier. */ @@ -3909,7 +3909,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface OpenpgpkeyRecord { + export interface Openpgpkey { /** * Identifier. */ @@ -3960,7 +3960,7 @@ export namespace RecordResponse { /** * Settings for the DNS record. */ - settings: OpenpgpkeyRecord.Settings; + settings: Openpgpkey.Settings; /** * Custom tags for the DNS record. This field has no effect on DNS responses. @@ -3990,7 +3990,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export namespace OpenpgpkeyRecord { + export namespace Openpgpkey { /** * Settings for the DNS record. */ @@ -4013,7 +4013,7 @@ export namespace RecordResponse { } } - export interface PTRRecord extends RecordsAPI.PTRRecord { + export interface PTR extends RecordsAPI.PTRRecord { /** * Identifier. */ @@ -4050,7 +4050,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface TXTRecord extends RecordsAPI.TXTRecord { + export interface TXT extends RecordsAPI.TXTRecord { /** * Identifier. */ @@ -4087,7 +4087,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface CAARecord extends RecordsAPI.CAARecord { + export interface CAA extends RecordsAPI.CAARecord { /** * Identifier. */ @@ -4124,7 +4124,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface CERTRecord extends RecordsAPI.CERTRecord { + export interface CERT extends RecordsAPI.CERTRecord { /** * Identifier. */ @@ -4161,7 +4161,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface DNSKEYRecord extends RecordsAPI.DNSKEYRecord { + export interface DNSKEY extends RecordsAPI.DNSKEYRecord { /** * Identifier. */ @@ -4198,7 +4198,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface DSRecord extends RecordsAPI.DSRecord { + export interface DS extends RecordsAPI.DSRecord { /** * Identifier. */ @@ -4235,7 +4235,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface HTTPSRecord extends RecordsAPI.HTTPSRecord { + export interface HTTPS extends RecordsAPI.HTTPSRecord { /** * Identifier. */ @@ -4272,7 +4272,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface LOCRecord extends RecordsAPI.LOCRecord { + export interface LOC extends RecordsAPI.LOCRecord { /** * Identifier. */ @@ -4309,7 +4309,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface NAPTRRecord extends RecordsAPI.NAPTRRecord { + export interface NAPTR extends RecordsAPI.NAPTRRecord { /** * Identifier. */ @@ -4346,7 +4346,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SMIMEARecord extends RecordsAPI.SMIMEARecord { + export interface SMIMEA extends RecordsAPI.SMIMEARecord { /** * Identifier. */ @@ -4383,7 +4383,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SRVRecord extends RecordsAPI.SRVRecord { + export interface SRV extends RecordsAPI.SRVRecord { /** * Identifier. */ @@ -4420,7 +4420,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SSHFPRecord extends RecordsAPI.SSHFPRecord { + export interface SSHFP extends RecordsAPI.SSHFPRecord { /** * Identifier. */ @@ -4457,7 +4457,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface SVCBRecord extends RecordsAPI.SVCBRecord { + export interface SVCB extends RecordsAPI.SVCBRecord { /** * Identifier. */ @@ -4494,7 +4494,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface TLSARecord extends RecordsAPI.TLSARecord { + export interface TLSA extends RecordsAPI.TLSARecord { /** * Identifier. */ @@ -4531,7 +4531,7 @@ export namespace RecordResponse { tags_modified_on?: string; } - export interface URIRecord extends RecordsAPI.URIRecord { + export interface URI extends RecordsAPI.URIRecord { /** * Identifier. */ diff --git a/src/resources/email-security/investigate/investigate.ts b/src/resources/email-security/investigate/investigate.ts index a15d9630ba..b7f32c860e 100644 --- a/src/resources/email-security/investigate/investigate.ts +++ b/src/resources/email-security/investigate/investigate.ts @@ -199,10 +199,33 @@ export namespace InvestigateListResponse { } export interface Finding { + attachment?: string | null; + detail?: string | null; + detection?: + | 'MALICIOUS' + | 'MALICIOUS-BEC' + | 'SUSPICIOUS' + | 'SPOOF' + | 'SPAM' + | 'BULK' + | 'ENCRYPTED' + | 'EXTERNAL' + | 'UNKNOWN' + | 'NONE' + | null; + + field?: string | null; + name?: string | null; + portion?: string | null; + + reason?: string | null; + + score?: number | null; + value?: string | null; } @@ -321,10 +344,33 @@ export namespace InvestigateGetResponse { } export interface Finding { + attachment?: string | null; + detail?: string | null; + detection?: + | 'MALICIOUS' + | 'MALICIOUS-BEC' + | 'SUSPICIOUS' + | 'SPOOF' + | 'SPAM' + | 'BULK' + | 'ENCRYPTED' + | 'EXTERNAL' + | 'UNKNOWN' + | 'NONE' + | null; + + field?: string | null; + name?: string | null; + portion?: string | null; + + reason?: string | null; + + score?: number | null; + value?: string | null; } @@ -355,6 +401,11 @@ export interface InvestigateListParams extends V4PagePaginationArrayParams { */ alert_id?: string; + /** + * Query param: + */ + cursor?: string; + /** * Query param: Determines if the search results will include detections or not. */ diff --git a/src/resources/iam/iam.ts b/src/resources/iam/iam.ts index c8fef6d0b3..13cff578a1 100644 --- a/src/resources/iam/iam.ts +++ b/src/resources/iam/iam.ts @@ -25,6 +25,23 @@ import { ResourceGroupUpdateResponse, ResourceGroups, } from './resource-groups'; +import * as SSOAPI from './sso'; +import { + SSO, + SSOBeginVerificationParams, + SSOBeginVerificationResponse, + SSOCreateParams, + SSOCreateResponse, + SSODeleteParams, + SSODeleteResponse, + SSOGetParams, + SSOGetResponse, + SSOListParams, + SSOListResponse, + SSOListResponsesSinglePage, + SSOUpdateParams, + SSOUpdateResponse, +} from './sso'; import * as UserGroupsAPI from './user-groups/user-groups'; import { UserGroupCreateParams, @@ -47,6 +64,7 @@ export class IAM extends APIResource { ); resourceGroups: ResourceGroupsAPI.ResourceGroups = new ResourceGroupsAPI.ResourceGroups(this._client); userGroups: UserGroupsAPI.UserGroups = new UserGroupsAPI.UserGroups(this._client); + sso: SSOAPI.SSO = new SSOAPI.SSO(this._client); } IAM.PermissionGroups = PermissionGroups; @@ -55,6 +73,8 @@ IAM.ResourceGroups = ResourceGroups; IAM.ResourceGroupListResponsesSinglePage = ResourceGroupListResponsesSinglePage; IAM.UserGroups = UserGroups; IAM.UserGroupListResponsesV4PagePaginationArray = UserGroupListResponsesV4PagePaginationArray; +IAM.SSO = SSO; +IAM.SSOListResponsesSinglePage = SSOListResponsesSinglePage; export declare namespace IAM { export { @@ -95,4 +115,21 @@ export declare namespace IAM { type UserGroupDeleteParams as UserGroupDeleteParams, type UserGroupGetParams as UserGroupGetParams, }; + + export { + SSO as SSO, + type SSOCreateResponse as SSOCreateResponse, + type SSOUpdateResponse as SSOUpdateResponse, + type SSOListResponse as SSOListResponse, + type SSODeleteResponse as SSODeleteResponse, + type SSOBeginVerificationResponse as SSOBeginVerificationResponse, + type SSOGetResponse as SSOGetResponse, + SSOListResponsesSinglePage as SSOListResponsesSinglePage, + type SSOCreateParams as SSOCreateParams, + type SSOUpdateParams as SSOUpdateParams, + type SSOListParams as SSOListParams, + type SSODeleteParams as SSODeleteParams, + type SSOBeginVerificationParams as SSOBeginVerificationParams, + type SSOGetParams as SSOGetParams, + }; } diff --git a/src/resources/iam/index.ts b/src/resources/iam/index.ts index bdba3c5cd0..d4f22ccc30 100644 --- a/src/resources/iam/index.ts +++ b/src/resources/iam/index.ts @@ -23,6 +23,22 @@ export { type ResourceGroupDeleteParams, type ResourceGroupGetParams, } from './resource-groups'; +export { + SSOListResponsesSinglePage, + SSO, + type SSOCreateResponse, + type SSOUpdateResponse, + type SSOListResponse, + type SSODeleteResponse, + type SSOBeginVerificationResponse, + type SSOGetResponse, + type SSOCreateParams, + type SSOUpdateParams, + type SSOListParams, + type SSODeleteParams, + type SSOBeginVerificationParams, + type SSOGetParams, +} from './sso'; export { UserGroupListResponsesV4PagePaginationArray, UserGroups, diff --git a/src/resources/iam/sso.ts b/src/resources/iam/sso.ts new file mode 100644 index 0000000000..ecfbfb6028 --- /dev/null +++ b/src/resources/iam/sso.ts @@ -0,0 +1,465 @@ +// 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 SSO extends APIResource { + /** + * Initialize new SSO connector + * + * @example + * ```ts + * const sso = await client.iam.sso.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * email_domain: 'example.com', + * }); + * ``` + */ + create(params: SSOCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/sso_connectors`, { body, ...options }) as Core.APIPromise<{ + result: SSOCreateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update SSO connector state + * + * @example + * ```ts + * const sso = await client.iam.sso.update( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + update( + ssoConnectorId: string, + params: SSOUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.patch(`/accounts/${account_id}/sso_connectors/${ssoConnectorId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: SSOUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get all SSO connectors + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const ssoListResponse of client.iam.sso.list({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * })) { + * // ... + * } + * ``` + */ + list( + params: SSOListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList( + `/accounts/${account_id}/sso_connectors`, + SSOListResponsesSinglePage, + options, + ); + } + + /** + * Delete SSO connector + * + * @example + * ```ts + * const sso = await client.iam.sso.delete( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + ssoConnectorId: string, + params: SSODeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete( + `/accounts/${account_id}/sso_connectors/${ssoConnectorId}`, + options, + ) as Core.APIPromise<{ result: SSODeleteResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Begin SSO connector verification + * + * @example + * ```ts + * const response = await client.iam.sso.beginVerification( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + beginVerification( + ssoConnectorId: string, + params: SSOBeginVerificationParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.post( + `/accounts/${account_id}/sso_connectors/${ssoConnectorId}/begin_verification`, + options, + ); + } + + /** + * Get single SSO connector + * + * @example + * ```ts + * const sso = await client.iam.sso.get( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + ssoConnectorId: string, + params: SSOGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/sso_connectors/${ssoConnectorId}`, + options, + ) as Core.APIPromise<{ result: SSOGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class SSOListResponsesSinglePage extends SinglePage {} + +export interface SSOCreateResponse { + /** + * SSO Connector identifier tag. + */ + id?: string; + + /** + * Timestamp for the creation of the SSO connector + */ + created_on?: string; + + email_domain?: string; + + enabled?: boolean; + + /** + * Timestamp for the last update of the SSO connector + */ + updated_on?: string; + + /** + * Controls the display of FedRAMP language to the user during SSO login + */ + use_fedramp_language?: boolean; + + verification?: SSOCreateResponse.Verification; +} + +export namespace SSOCreateResponse { + export interface Verification { + /** + * DNS verification code. Add this entire string to the DNS TXT record of the email + * domain to validate ownership. + */ + code?: string; + + /** + * The status of the verification code from the verification process. + */ + status?: 'awaiting' | 'pending' | 'failed' | 'verified'; + } +} + +export interface SSOUpdateResponse { + /** + * SSO Connector identifier tag. + */ + id?: string; + + /** + * Timestamp for the creation of the SSO connector + */ + created_on?: string; + + email_domain?: string; + + enabled?: boolean; + + /** + * Timestamp for the last update of the SSO connector + */ + updated_on?: string; + + /** + * Controls the display of FedRAMP language to the user during SSO login + */ + use_fedramp_language?: boolean; + + verification?: SSOUpdateResponse.Verification; +} + +export namespace SSOUpdateResponse { + export interface Verification { + /** + * DNS verification code. Add this entire string to the DNS TXT record of the email + * domain to validate ownership. + */ + code?: string; + + /** + * The status of the verification code from the verification process. + */ + status?: 'awaiting' | 'pending' | 'failed' | 'verified'; + } +} + +export interface SSOListResponse { + /** + * SSO Connector identifier tag. + */ + id?: string; + + /** + * Timestamp for the creation of the SSO connector + */ + created_on?: string; + + email_domain?: string; + + enabled?: boolean; + + /** + * Timestamp for the last update of the SSO connector + */ + updated_on?: string; + + /** + * Controls the display of FedRAMP language to the user during SSO login + */ + use_fedramp_language?: boolean; + + verification?: SSOListResponse.Verification; +} + +export namespace SSOListResponse { + export interface Verification { + /** + * DNS verification code. Add this entire string to the DNS TXT record of the email + * domain to validate ownership. + */ + code?: string; + + /** + * The status of the verification code from the verification process. + */ + status?: 'awaiting' | 'pending' | 'failed' | 'verified'; + } +} + +export interface SSODeleteResponse { + /** + * Identifier + */ + id: string; +} + +export interface SSOBeginVerificationResponse { + errors: Array; + + messages: Array; + + /** + * Whether the API call was successful. + */ + success: true; +} + +export namespace SSOBeginVerificationResponse { + 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 SSOGetResponse { + /** + * SSO Connector identifier tag. + */ + id?: string; + + /** + * Timestamp for the creation of the SSO connector + */ + created_on?: string; + + email_domain?: string; + + enabled?: boolean; + + /** + * Timestamp for the last update of the SSO connector + */ + updated_on?: string; + + /** + * Controls the display of FedRAMP language to the user during SSO login + */ + use_fedramp_language?: boolean; + + verification?: SSOGetResponse.Verification; +} + +export namespace SSOGetResponse { + export interface Verification { + /** + * DNS verification code. Add this entire string to the DNS TXT record of the email + * domain to validate ownership. + */ + code?: string; + + /** + * The status of the verification code from the verification process. + */ + status?: 'awaiting' | 'pending' | 'failed' | 'verified'; + } +} + +export interface SSOCreateParams { + /** + * Path param: Account identifier tag. + */ + account_id: string; + + /** + * Body param: Email domain of the new SSO connector + */ + email_domain: string; + + /** + * Body param: Begin the verification process after creation + */ + begin_verification?: boolean; + + /** + * Body param: Controls the display of FedRAMP language to the user during SSO + * login + */ + use_fedramp_language?: boolean; +} + +export interface SSOUpdateParams { + /** + * Path param: Account identifier tag. + */ + account_id: string; + + /** + * Body param: SSO Connector enabled state + */ + enabled?: boolean; + + /** + * Body param: Controls the display of FedRAMP language to the user during SSO + * login + */ + use_fedramp_language?: boolean; +} + +export interface SSOListParams { + /** + * Account identifier tag. + */ + account_id: string; +} + +export interface SSODeleteParams { + /** + * Account identifier tag. + */ + account_id: string; +} + +export interface SSOBeginVerificationParams { + /** + * Account identifier tag. + */ + account_id: string; +} + +export interface SSOGetParams { + /** + * Account identifier tag. + */ + account_id: string; +} + +SSO.SSOListResponsesSinglePage = SSOListResponsesSinglePage; + +export declare namespace SSO { + export { + type SSOCreateResponse as SSOCreateResponse, + type SSOUpdateResponse as SSOUpdateResponse, + type SSOListResponse as SSOListResponse, + type SSODeleteResponse as SSODeleteResponse, + type SSOBeginVerificationResponse as SSOBeginVerificationResponse, + type SSOGetResponse as SSOGetResponse, + SSOListResponsesSinglePage as SSOListResponsesSinglePage, + type SSOCreateParams as SSOCreateParams, + type SSOUpdateParams as SSOUpdateParams, + type SSOListParams as SSOListParams, + type SSODeleteParams as SSODeleteParams, + type SSOBeginVerificationParams as SSOBeginVerificationParams, + type SSOGetParams as SSOGetParams, + }; +} diff --git a/src/resources/index.ts b/src/resources/index.ts index ac499e1b7f..7047ef0fb0 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -22,6 +22,7 @@ export { CertificateAuthorities } from './certificate-authorities/certificate-au export { ClientCertificates } from './client-certificates'; export { CloudConnector } from './cloud-connector/cloud-connector'; export { CloudforceOne } from './cloudforce-one/cloudforce-one'; +export { Connectivity } from './connectivity/connectivity'; export { ContentScanning } from './content-scanning/content-scanning'; export { CustomCertificates } from './custom-certificates/custom-certificates'; export { CustomHostnames } from './custom-hostnames/custom-hostnames'; @@ -57,6 +58,7 @@ export { MagicTransit } from './magic-transit/magic-transit'; export { ManagedTransforms } from './managed-transforms'; export { Memberships } from './memberships'; export { NetworkInterconnects } from './network-interconnects/network-interconnects'; +export { Organizations } from './organizations/organizations'; export { OriginCACertificates } from './origin-ca-certificates'; export { OriginPostQuantumEncryption } from './origin-post-quantum-encryption'; export { OriginTLSClientAuth } from './origin-tls-client-auth/origin-tls-client-auth'; @@ -69,6 +71,7 @@ export { R2 } from './r2/r2'; export { RUM } from './rum/rum'; export { Radar } from './radar/radar'; export { RateLimits } from './rate-limits'; +export { RealtimeKit } from './realtime-kit'; export { Registrar } from './registrar/registrar'; export { RequestTracers } from './request-tracers/request-tracers'; export { ResourceSharing } from './resource-sharing/resource-sharing'; @@ -83,6 +86,7 @@ export { Snippets } from './snippets/snippets'; export { Spectrum } from './spectrum/spectrum'; export { Speed } from './speed/speed'; export { Stream } from './stream/stream'; +export { TokenValidation } from './token-validation/token-validation'; export { Turnstile } from './turnstile/turnstile'; export { URLNormalization } from './url-normalization'; export { URLScanner } from './url-scanner/url-scanner'; diff --git a/src/resources/intel/attack-surface-report/issues.ts b/src/resources/intel/attack-surface-report/issues.ts index 3e41e46003..a10956bec3 100644 --- a/src/resources/intel/attack-surface-report/issues.ts +++ b/src/resources/intel/attack-surface-report/issues.ts @@ -96,14 +96,16 @@ export type IssueType = | 'email_security' | 'exposed_infrastructure' | 'insecure_configuration' - | 'weak_authentication'; + | 'weak_authentication' + | 'configuration_suggestion'; export type IssueTypeParam = | 'compliance_violation' | 'email_security' | 'exposed_infrastructure' | 'insecure_configuration' - | 'weak_authentication'; + | 'weak_authentication' + | 'configuration_suggestion'; export type SeverityQueryParam = 'low' | 'moderate' | 'critical'; @@ -138,7 +140,7 @@ export namespace IssueListResponse { issue_type?: IssuesAPI.IssueType; - payload?: unknown; + payload?: Issue.Payload; resolve_link?: string; @@ -152,6 +154,17 @@ export namespace IssueListResponse { timestamp?: string; } + + export namespace Issue { + export interface Payload { + /** + * Method used to detect insight + */ + detection_method?: string; + + zone_tag?: string; + } + } } export type IssueClassResponse = Array; diff --git a/src/resources/kv/namespaces/values.ts b/src/resources/kv/namespaces/values.ts index a8de1f25b5..49566f425a 100644 --- a/src/resources/kv/namespaces/values.ts +++ b/src/resources/kv/namespaces/values.ts @@ -37,12 +37,8 @@ export class Values extends APIResource { return ( this._client.put( `/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/values/${keyName}`, - Core.multipartFormRequestOptions({ - query: { expiration, expiration_ttl }, - body, - __multipartSyntax: 'json', - ...options, - }), + Core.multipartFormRequestOptions({ query: { expiration, expiration_ttl }, body, + __multipartSyntax: 'json', ...options }), ) as Core.APIPromise<{ result: ValueUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } diff --git a/src/resources/logpush/datasets/fields.ts b/src/resources/logpush/datasets/fields.ts index 3ba1f069f7..f0a2086930 100644 --- a/src/resources/logpush/datasets/fields.ts +++ b/src/resources/logpush/datasets/fields.ts @@ -26,6 +26,8 @@ export class Fields extends APIResource { | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' + | 'dex_application_tests' + | 'dex_device_state_events' | 'dlp_forensic_copies' | 'dns_firewall_logs' | 'dns_logs' @@ -35,6 +37,7 @@ export class Fields extends APIResource { | 'gateway_http' | 'gateway_network' | 'http_requests' + | 'ipsec_logs' | 'magic_ids_detections' | 'nel_reports' | 'network_analytics_logs' @@ -42,6 +45,8 @@ export class Fields extends APIResource { | 'sinkhole_http_logs' | 'spectrum_events' | 'ssh_logs' + | 'warp_config_changes' + | 'warp_toggle_changes' | 'workers_trace_events' | 'zaraz_events' | 'zero_trust_network_sessions' @@ -57,6 +62,8 @@ export class Fields extends APIResource { | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' + | 'dex_application_tests' + | 'dex_device_state_events' | 'dlp_forensic_copies' | 'dns_firewall_logs' | 'dns_logs' @@ -66,6 +73,7 @@ export class Fields extends APIResource { | 'gateway_http' | 'gateway_network' | 'http_requests' + | 'ipsec_logs' | 'magic_ids_detections' | 'nel_reports' | 'network_analytics_logs' @@ -73,6 +81,8 @@ export class Fields extends APIResource { | 'sinkhole_http_logs' | 'spectrum_events' | 'ssh_logs' + | 'warp_config_changes' + | 'warp_toggle_changes' | 'workers_trace_events' | 'zaraz_events' | 'zero_trust_network_sessions' @@ -87,6 +97,8 @@ export class Fields extends APIResource { | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' + | 'dex_application_tests' + | 'dex_device_state_events' | 'dlp_forensic_copies' | 'dns_firewall_logs' | 'dns_logs' @@ -96,6 +108,7 @@ export class Fields extends APIResource { | 'gateway_http' | 'gateway_network' | 'http_requests' + | 'ipsec_logs' | 'magic_ids_detections' | 'nel_reports' | 'network_analytics_logs' @@ -103,6 +116,8 @@ export class Fields extends APIResource { | 'sinkhole_http_logs' | 'spectrum_events' | 'ssh_logs' + | 'warp_config_changes' + | 'warp_toggle_changes' | 'workers_trace_events' | 'zaraz_events' | 'zero_trust_network_sessions' diff --git a/src/resources/logpush/datasets/jobs.ts b/src/resources/logpush/datasets/jobs.ts index 90c7438608..e4a3921516 100644 --- a/src/resources/logpush/datasets/jobs.ts +++ b/src/resources/logpush/datasets/jobs.ts @@ -30,6 +30,8 @@ export class Jobs extends APIResource { | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' + | 'dex_application_tests' + | 'dex_device_state_events' | 'dlp_forensic_copies' | 'dns_firewall_logs' | 'dns_logs' @@ -39,6 +41,7 @@ export class Jobs extends APIResource { | 'gateway_http' | 'gateway_network' | 'http_requests' + | 'ipsec_logs' | 'magic_ids_detections' | 'nel_reports' | 'network_analytics_logs' @@ -46,6 +49,8 @@ export class Jobs extends APIResource { | 'sinkhole_http_logs' | 'spectrum_events' | 'ssh_logs' + | 'warp_config_changes' + | 'warp_toggle_changes' | 'workers_trace_events' | 'zaraz_events' | 'zero_trust_network_sessions' @@ -61,6 +66,8 @@ export class Jobs extends APIResource { | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' + | 'dex_application_tests' + | 'dex_device_state_events' | 'dlp_forensic_copies' | 'dns_firewall_logs' | 'dns_logs' @@ -70,6 +77,7 @@ export class Jobs extends APIResource { | 'gateway_http' | 'gateway_network' | 'http_requests' + | 'ipsec_logs' | 'magic_ids_detections' | 'nel_reports' | 'network_analytics_logs' @@ -77,6 +85,8 @@ export class Jobs extends APIResource { | 'sinkhole_http_logs' | 'spectrum_events' | 'ssh_logs' + | 'warp_config_changes' + | 'warp_toggle_changes' | 'workers_trace_events' | 'zaraz_events' | 'zero_trust_network_sessions' @@ -91,6 +101,8 @@ export class Jobs extends APIResource { | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' + | 'dex_application_tests' + | 'dex_device_state_events' | 'dlp_forensic_copies' | 'dns_firewall_logs' | 'dns_logs' @@ -100,6 +112,7 @@ export class Jobs extends APIResource { | 'gateway_http' | 'gateway_network' | 'http_requests' + | 'ipsec_logs' | 'magic_ids_detections' | 'nel_reports' | 'network_analytics_logs' @@ -107,6 +120,8 @@ export class Jobs extends APIResource { | 'sinkhole_http_logs' | 'spectrum_events' | 'ssh_logs' + | 'warp_config_changes' + | 'warp_toggle_changes' | 'workers_trace_events' | 'zaraz_events' | 'zero_trust_network_sessions' diff --git a/src/resources/logpush/jobs.ts b/src/resources/logpush/jobs.ts index 4b6fba4fa1..7a267dce43 100644 --- a/src/resources/logpush/jobs.ts +++ b/src/resources/logpush/jobs.ts @@ -292,6 +292,8 @@ export interface LogpushJob { | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' + | 'dex_application_tests' + | 'dex_device_state_events' | 'dlp_forensic_copies' | 'dns_firewall_logs' | 'dns_logs' @@ -301,6 +303,7 @@ export interface LogpushJob { | 'gateway_http' | 'gateway_network' | 'http_requests' + | 'ipsec_logs' | 'magic_ids_detections' | 'nel_reports' | 'network_analytics_logs' @@ -308,6 +311,8 @@ export interface LogpushJob { | 'sinkhole_http_logs' | 'spectrum_events' | 'ssh_logs' + | 'warp_config_changes' + | 'warp_toggle_changes' | 'workers_trace_events' | 'zaraz_events' | 'zero_trust_network_sessions' @@ -601,6 +606,8 @@ export interface JobCreateParams { | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' + | 'dex_application_tests' + | 'dex_device_state_events' | 'dlp_forensic_copies' | 'dns_firewall_logs' | 'dns_logs' @@ -610,6 +617,7 @@ export interface JobCreateParams { | 'gateway_http' | 'gateway_network' | 'http_requests' + | 'ipsec_logs' | 'magic_ids_detections' | 'nel_reports' | 'network_analytics_logs' @@ -617,6 +625,8 @@ export interface JobCreateParams { | 'sinkhole_http_logs' | 'spectrum_events' | 'ssh_logs' + | 'warp_config_changes' + | 'warp_toggle_changes' | 'workers_trace_events' | 'zaraz_events' | 'zero_trust_network_sessions' diff --git a/src/resources/magic-transit/connectors/connectors.ts b/src/resources/magic-transit/connectors/connectors.ts index c7f3bde0de..368ca729b7 100644 --- a/src/resources/magic-transit/connectors/connectors.ts +++ b/src/resources/magic-transit/connectors/connectors.ts @@ -49,7 +49,7 @@ export class Connectors extends APIResource { } /** - * Replace Connector + * Replace Connector or Re-provision License Key * * @example * ```ts @@ -126,7 +126,7 @@ export class Connectors extends APIResource { } /** - * Edit Connector to update specific properties + * Edit Connector to update specific properties or Re-provision License Key * * @example * ```ts @@ -198,6 +198,8 @@ export interface ConnectorCreateResponse { last_heartbeat?: string; last_seen_version?: string; + + license_key?: string; } export namespace ConnectorCreateResponse { @@ -228,6 +230,8 @@ export interface ConnectorUpdateResponse { last_heartbeat?: string; last_seen_version?: string; + + license_key?: string; } export namespace ConnectorUpdateResponse { @@ -258,6 +262,8 @@ export interface ConnectorListResponse { last_heartbeat?: string; last_seen_version?: string; + + license_key?: string; } export namespace ConnectorListResponse { @@ -288,6 +294,8 @@ export interface ConnectorDeleteResponse { last_heartbeat?: string; last_seen_version?: string; + + license_key?: string; } export namespace ConnectorDeleteResponse { @@ -318,6 +326,8 @@ export interface ConnectorEditResponse { last_heartbeat?: string; last_seen_version?: string; + + license_key?: string; } export namespace ConnectorEditResponse { @@ -348,6 +358,8 @@ export interface ConnectorGetResponse { last_heartbeat?: string; last_seen_version?: string; + + license_key?: string; } export namespace ConnectorGetResponse { @@ -365,7 +377,8 @@ export interface ConnectorCreateParams { account_id: string; /** - * Body param: + * Body param: Exactly one of id, serial_number, or provision_license must be + * provided. */ device: ConnectorCreateParams.Device; @@ -396,9 +409,17 @@ export interface ConnectorCreateParams { } export namespace ConnectorCreateParams { + /** + * Exactly one of id, serial_number, or provision_license must be provided. + */ export interface Device { id?: string; + /** + * When true, create and provision a new licence key for the connector. + */ + provision_license?: boolean; + serial_number?: string; } } @@ -429,6 +450,11 @@ export interface ConnectorUpdateParams { */ notes?: string; + /** + * Body param: When true, regenerate license key for the connector. + */ + provision_license?: boolean; + /** * Body param: */ @@ -475,6 +501,11 @@ export interface ConnectorEditParams { */ notes?: string; + /** + * Body param: When true, regenerate license key for the connector. + */ + provision_license?: boolean; + /** * Body param: */ diff --git a/src/resources/magic-transit/connectors/snapshots/latest.ts b/src/resources/magic-transit/connectors/snapshots/latest.ts index 16d9eaff01..c51d9f1abe 100644 --- a/src/resources/magic-transit/connectors/snapshots/latest.ts +++ b/src/resources/magic-transit/connectors/snapshots/latest.ts @@ -72,6 +72,8 @@ export namespace LatestListResponse { */ v: string; + bonds?: Array; + /** * Count of processors/cores */ @@ -876,6 +878,21 @@ export namespace LatestListResponse { } export namespace Item { + /** + * Snapshot Bond + */ + export interface Bond { + /** + * Name of the network interface + */ + name: string; + + /** + * Current status of the network interface + */ + status: string; + } + /** * Snapshot DHCP lease */ @@ -1279,6 +1296,11 @@ export namespace LatestListResponse { * Connector identifier */ connector_id?: string; + + /** + * MTU as measured between the two ends of the tunnel + */ + probed_mtu?: number; } } } diff --git a/src/resources/magic-transit/connectors/snapshots/snapshots.ts b/src/resources/magic-transit/connectors/snapshots/snapshots.ts index 69b5c098e5..a7d1e0d815 100644 --- a/src/resources/magic-transit/connectors/snapshots/snapshots.ts +++ b/src/resources/magic-transit/connectors/snapshots/snapshots.ts @@ -123,6 +123,8 @@ export interface SnapshotGetResponse { */ v: string; + bonds?: Array; + /** * Count of processors/cores */ @@ -927,6 +929,21 @@ export interface SnapshotGetResponse { } export namespace SnapshotGetResponse { + /** + * Snapshot Bond + */ + export interface Bond { + /** + * Name of the network interface + */ + name: string; + + /** + * Current status of the network interface + */ + status: string; + } + /** * Snapshot DHCP lease */ @@ -1330,6 +1347,11 @@ export namespace SnapshotGetResponse { * Connector identifier */ connector_id?: string; + + /** + * MTU as measured between the two ends of the tunnel + */ + probed_mtu?: number; } } diff --git a/src/resources/organizations.ts b/src/resources/organizations.ts new file mode 100644 index 0000000000..61ddaf165e --- /dev/null +++ b/src/resources/organizations.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './organizations/index'; diff --git a/src/resources/organizations/index.ts b/src/resources/organizations/index.ts new file mode 100644 index 0000000000..74e4c1078f --- /dev/null +++ b/src/resources/organizations/index.ts @@ -0,0 +1,8 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + OrganizationProfileResource, + type OrganizationProfile, + type OrganizationProfileUpdateParams, +} from './organization-profile'; +export { Organizations } from './organizations'; diff --git a/src/resources/organizations/organization-profile.ts b/src/resources/organizations/organization-profile.ts new file mode 100644 index 0000000000..c1f64836a5 --- /dev/null +++ b/src/resources/organizations/organization-profile.ts @@ -0,0 +1,65 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; + +export class OrganizationProfileResource extends APIResource { + /** + * Modify organization profile. (Currently in Closed Beta - see + * https://developers.cloudflare.com/fundamentals/organizations/) + */ + update( + organizationId: string, + body: OrganizationProfileUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.put(`/organizations/${organizationId}/profile`, { + body, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); + } + + /** + * Get an organizations profile if it exists. (Currently in Closed Beta - see + * https://developers.cloudflare.com/fundamentals/organizations/) + */ + get(organizationId: string, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.get(`/organizations/${organizationId}/profile`, options) as Core.APIPromise<{ + result: unnamed_schema_0.Result; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface OrganizationProfile { + business_address: string; + + business_email: string; + + business_name: string; + + business_phone: string; + + external_metadata: string; +} + +export interface OrganizationProfileUpdateParams { + business_address: string; + + business_email: string; + + business_name: string; + + business_phone: string; + + external_metadata: string; +} + +export declare namespace OrganizationProfileResource { + export { + type OrganizationProfile as OrganizationProfile, + type OrganizationProfileUpdateParams as OrganizationProfileUpdateParams, + }; +} diff --git a/src/resources/organizations/organizations.ts b/src/resources/organizations/organizations.ts new file mode 100644 index 0000000000..44b26476c0 --- /dev/null +++ b/src/resources/organizations/organizations.ts @@ -0,0 +1,315 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import { isRequestOptions } from '../../core'; +import * as Core from '../../core'; +import * as OrganizationProfileAPI from './organization-profile'; +import { + OrganizationProfile, + OrganizationProfileResource, + OrganizationProfileUpdateParams, +} from './organization-profile'; +import { SinglePage } from '../../pagination'; + +export class Organizations extends APIResource { + organizationProfile: OrganizationProfileAPI.OrganizationProfileResource = + new OrganizationProfileAPI.OrganizationProfileResource(this._client); + + /** + * Create a new organization for a user. (Currently in Closed Beta - see + * https://developers.cloudflare.com/fundamentals/organizations/) + */ + create(body: OrganizationCreateParams, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.post('/organizations', { body, ...options }) as Core.APIPromise<{ result: Organization }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Modify organization. (Currently in Closed Beta - see + * https://developers.cloudflare.com/fundamentals/organizations/) + */ + update( + organizationId: string, + body: OrganizationUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/organizations/${organizationId}`, { body, ...options }) as Core.APIPromise<{ + result: Organization; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieve a list of organizations a particular user has access to. (Currently in + * Closed Beta - see https://developers.cloudflare.com/fundamentals/organizations/) + */ + list( + query?: OrganizationListParams, + options?: Core.RequestOptions, + ): Core.PagePromise; + list(options?: Core.RequestOptions): Core.PagePromise; + list( + query: OrganizationListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.PagePromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return this._client.getAPIList('/organizations', OrganizationsSinglePage, { query, ...options }); + } + + /** + * Delete an organization. The organization MUST be empty before deleting. It must + * not contain any sub-organizations, accounts, members or users. (Currently in + * Closed Beta - see https://developers.cloudflare.com/fundamentals/organizations/) + */ + delete(organizationId: string, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.delete(`/organizations/${organizationId}`, options) as Core.APIPromise<{ + result: OrganizationDeleteResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieve the details of a certain organization. (Currently in Closed Beta - see + * https://developers.cloudflare.com/fundamentals/organizations/) + */ + get(organizationId: string, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.get(`/organizations/${organizationId}`, options) as Core.APIPromise<{ + result: Organization; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class OrganizationsSinglePage extends SinglePage {} + +/** + * References an Organization in the Cloudflare data model. + */ +export interface Organization { + id: string; + + create_time: string; + + meta: Organization.Meta; + + name: string; + + parent?: Organization.Parent; + + profile?: Organization.Profile; +} + +export namespace Organization { + export interface Meta { + /** + * Enable features for Organizations. + */ + flags?: Meta.Flags; + + managed_by?: string; + + [k: string]: unknown; + } + + export namespace Meta { + /** + * Enable features for Organizations. + */ + export interface Flags { + account_creation: string; + + account_deletion: string; + + account_migration: string; + + account_mobility: string; + + sub_org_creation: string; + } + } + + export interface Parent { + id: string; + + name: string; + } + + export interface Profile { + business_address: string; + + business_email: string; + + business_name: string; + + business_phone: string; + + external_metadata: string; + } +} + +export interface OrganizationDeleteResponse { + id: string; +} + +export interface OrganizationCreateParams { + name: string; + + parent?: OrganizationCreateParams.Parent; + + profile?: OrganizationCreateParams.Profile; +} + +export namespace OrganizationCreateParams { + export interface Parent { + id: string; + } + + export interface Profile { + business_address: string; + + business_email: string; + + business_name: string; + + business_phone: string; + + external_metadata: string; + } +} + +export interface OrganizationUpdateParams { + name: string; + + parent?: OrganizationUpdateParams.Parent; + + profile?: OrganizationUpdateParams.Profile; +} + +export namespace OrganizationUpdateParams { + export interface Parent { + id: string; + } + + export interface Profile { + business_address: string; + + business_email: string; + + business_name: string; + + business_phone: string; + + external_metadata: string; + } +} + +export interface OrganizationListParams { + /** + * Only return organizations with the specified IDs (ex. id=foo&id=bar). Send + * multiple elements by repeating the query value. + */ + id?: Array; + + containing?: OrganizationListParams.Containing; + + name?: OrganizationListParams.Name; + + /** + * The amount of items to return. Defaults to 10. + */ + page_size?: number; + + /** + * An opaque token returned from the last list response that when provided will + * retrieve the next page. + * + * Parameters used to filter the retrieved list must remain in subsequent requests + * with a page token. + */ + page_token?: string; + + parent?: OrganizationListParams.Parent; +} + +export namespace OrganizationListParams { + export interface Containing { + /** + * Filter the list of organizations to the ones that contain this particular + * account. + */ + account?: string; + + /** + * Filter the list of organizations to the ones that contain this particular + * organization. + */ + organization?: string; + + /** + * Filter the list of organizations to the ones that contain this particular user. + * + * IMPORTANT: Just because an organization "contains" a user is not a + * representation of any authorization or privilege to manage any resources + * therein. An organization "containing" a user simply means the user is managed by + * that organization. + */ + user?: string; + } + + export interface Name { + /** + * (case-insensitive) Filter the list of organizations to where the name contains a + * particular string. + */ + contains?: string; + + /** + * (case-insensitive) Filter the list of organizations to where the name ends with + * a particular string. + */ + endsWith?: string; + + /** + * (case-insensitive) Filter the list of organizations to where the name starts + * with a particular string. + */ + startsWith?: string; + } + + export interface Parent { + /** + * Filter the list of organizations to the ones that are a sub-organization of the + * specified organization. + * + * "null" is a valid value to provide for this parameter. It means "where an + * organization has no parent (i.e. it is a 'root' organization)." + */ + id?: (string & {}) | 'null'; + } +} + +Organizations.OrganizationsSinglePage = OrganizationsSinglePage; +Organizations.OrganizationProfileResource = OrganizationProfileResource; + +export declare namespace Organizations { + export { + type Organization as Organization, + type OrganizationDeleteResponse as OrganizationDeleteResponse, + OrganizationsSinglePage as OrganizationsSinglePage, + type OrganizationCreateParams as OrganizationCreateParams, + type OrganizationUpdateParams as OrganizationUpdateParams, + type OrganizationListParams as OrganizationListParams, + }; + + export { + OrganizationProfileResource as OrganizationProfileResource, + type OrganizationProfile as OrganizationProfile, + type OrganizationProfileUpdateParams as OrganizationProfileUpdateParams, + }; +} diff --git a/src/resources/pages/index.ts b/src/resources/pages/index.ts index 2b2862b5c1..94a789fe04 100644 --- a/src/resources/pages/index.ts +++ b/src/resources/pages/index.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - DeploymentsSinglePage, + DeploymentsV4PagePaginationArray, Projects, type Deployment, type Project, diff --git a/src/resources/pages/pages.ts b/src/resources/pages/pages.ts index e92779690f..e0331f786f 100644 --- a/src/resources/pages/pages.ts +++ b/src/resources/pages/pages.ts @@ -4,7 +4,7 @@ import { APIResource } from '../../resource'; import * as ProjectsAPI from './projects/projects'; import { Deployment, - DeploymentsSinglePage, + DeploymentsV4PagePaginationArray, Project, ProjectCreateParams, ProjectDeleteParams, @@ -23,7 +23,7 @@ export class Pages extends APIResource { } Pages.Projects = Projects; -Pages.DeploymentsSinglePage = DeploymentsSinglePage; +Pages.DeploymentsV4PagePaginationArray = DeploymentsV4PagePaginationArray; export declare namespace Pages { export { @@ -33,7 +33,7 @@ export declare namespace Pages { type Stage as Stage, type ProjectDeleteResponse as ProjectDeleteResponse, type ProjectPurgeBuildCacheResponse as ProjectPurgeBuildCacheResponse, - DeploymentsSinglePage as DeploymentsSinglePage, + DeploymentsV4PagePaginationArray as DeploymentsV4PagePaginationArray, type ProjectCreateParams as ProjectCreateParams, type ProjectListParams as ProjectListParams, type ProjectDeleteParams as ProjectDeleteParams, diff --git a/src/resources/pages/projects/deployments/deployments.ts b/src/resources/pages/projects/deployments/deployments.ts index 97b2b41db9..f45cd3edd4 100644 --- a/src/resources/pages/projects/deployments/deployments.ts +++ b/src/resources/pages/projects/deployments/deployments.ts @@ -3,9 +3,10 @@ import { APIResource } from '../../../../resource'; import * as Core from '../../../../core'; import * as ProjectsAPI from '../projects'; -import { DeploymentsSinglePage } from '../projects'; +import { DeploymentsV4PagePaginationArray } from '../projects'; import * as HistoryAPI from './history/history'; import { History } from './history/history'; +import { type V4PagePaginationArrayParams } from '../../../../pagination'; export class Deployments extends APIResource { history: HistoryAPI.History = new HistoryAPI.History(this._client); @@ -55,11 +56,11 @@ export class Deployments extends APIResource { projectName: string, params: DeploymentListParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { const { account_id, ...query } = params; return this._client.getAPIList( `/accounts/${account_id}/pages/projects/${projectName}/deployments`, - DeploymentsSinglePage, + DeploymentsV4PagePaginationArray, { query, ...options }, ); } @@ -192,14 +193,80 @@ export interface DeploymentCreateParams { */ account_id: string; + /** + * Body param: Headers configuration file for the deployment. + */ + _headers?: Core.Uploadable; + + /** + * Body param: Redirects configuration file for the deployment. + */ + _redirects?: Core.Uploadable; + + /** + * Body param: Routes configuration file defining routing rules. + */ + '_routes.json'?: Core.Uploadable; + + /** + * Body param: Worker bundle file in multipart/form-data format. Mutually exclusive + * with `_worker.js`. Cannot specify both `_worker.js` and `_worker.bundle` in the + * same request. Maximum size: 25 MiB. + */ + '_worker.bundle'?: Core.Uploadable; + + /** + * Body param: Worker JavaScript file. Mutually exclusive with `_worker.bundle`. + * Cannot specify both `_worker.js` and `_worker.bundle` in the same request. + */ + '_worker.js'?: Core.Uploadable; + /** * Body param: The branch to build the new deployment from. The `HEAD` of the * branch will be used. If omitted, the production branch will be used by default. */ branch?: string; + + /** + * Body param: Boolean string indicating if the working directory has uncommitted + * changes. + */ + commit_dirty?: 'true' | 'false'; + + /** + * Body param: Git commit SHA associated with this deployment. + */ + commit_hash?: string; + + /** + * Body param: Git commit message associated with this deployment. + */ + commit_message?: string; + + /** + * Body param: Functions routing configuration file. + */ + 'functions-filepath-routing-config.json'?: Core.Uploadable; + + /** + * Body param: JSON string containing a manifest of files to deploy. Maps file + * paths to their content hashes. Required for direct upload deployments. Maximum + * 20,000 entries. + */ + manifest?: string; + + /** + * Body param: The build output directory path. + */ + pages_build_output_dir?: string; + + /** + * Body param: Hash of the Wrangler configuration file used for this deployment. + */ + wrangler_config_hash?: string; } -export interface DeploymentListParams { +export interface DeploymentListParams extends V4PagePaginationArrayParams { /** * Path param: Identifier */ @@ -265,4 +332,4 @@ export declare namespace Deployments { export { History as History }; } -export { DeploymentsSinglePage }; +export { DeploymentsV4PagePaginationArray }; diff --git a/src/resources/pages/projects/index.ts b/src/resources/pages/projects/index.ts index a40f121ec5..35949ce346 100644 --- a/src/resources/pages/projects/index.ts +++ b/src/resources/pages/projects/index.ts @@ -11,7 +11,7 @@ export { type DeploymentRollbackParams, } from './deployments/index'; export { - DeploymentsSinglePage, + DeploymentsV4PagePaginationArray, Projects, type Deployment, type Project, diff --git a/src/resources/pages/projects/projects.ts b/src/resources/pages/projects/projects.ts index 01225591dc..d889e19765 100644 --- a/src/resources/pages/projects/projects.ts +++ b/src/resources/pages/projects/projects.ts @@ -28,7 +28,7 @@ import { DeploymentRollbackParams, Deployments, } from './deployments/deployments'; -import { SinglePage } from '../../../pagination'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; export class Projects extends APIResource { deployments: DeploymentsAPI.Deployments = new DeploymentsAPI.Deployments(this._client); @@ -41,6 +41,8 @@ export class Projects extends APIResource { * ```ts * const project = await client.pages.projects.create({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * name: 'my-pages-app', + * production_branch: 'main', * }); * ``` */ @@ -69,9 +71,13 @@ export class Projects extends APIResource { list( params: ProjectListParams, options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id } = params; - return this._client.getAPIList(`/accounts/${account_id}/pages/projects`, DeploymentsSinglePage, options); + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/pages/projects`, + DeploymentsV4PagePaginationArray, + { query, ...options }, + ); } /** @@ -107,7 +113,11 @@ export class Projects extends APIResource { * ```ts * const project = await client.pages.projects.edit( * 'this-is-my-project-01', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * name: 'my-pages-app', + * production_branch: 'main', + * }, * ); * ``` */ @@ -176,7 +186,7 @@ export class Projects extends APIResource { } } -export class DeploymentsSinglePage extends SinglePage {} +export class DeploymentsV4PagePaginationArray extends V4PagePaginationArray {} export interface Deployment { /** @@ -209,7 +219,7 @@ export interface Deployment { */ env_vars?: { [key: string]: Deployment.PagesPlainTextEnvVar | null | Deployment.PagesSecretTextEnvVar | null; - }; + } | null; /** * Type of deploy. @@ -359,31 +369,74 @@ export namespace Deployment { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } @@ -391,17 +444,27 @@ export namespace Deployment { export interface Project { /** - * Id of the project. + * ID of the project. */ - id?: string; + id: string; + + /** + * Name of the project. + */ + name: string; + + /** + * Production branch of the project. Used to identify production deployments. + */ + production_branch: string; /** * Configs for the project build process. */ - build_config?: Project.BuildConfig; + build_config?: Project.BuildConfig | null; /** - * Most recent deployment to the repo. + * Most recent production deployment of the project. */ canonical_deployment?: Deployment | null; @@ -413,7 +476,7 @@ export interface Project { /** * Configs for deployments in a project. */ - deployment_configs?: Project.DeploymentConfigs; + deployment_configs?: Project.DeploymentConfigs | null; /** * A list of associated custom domains for the project. @@ -421,19 +484,29 @@ export interface Project { domains?: Array; /** - * Most recent deployment to the repo. + * Framework the project is using. + */ + framework?: string; + + /** + * Version of the framework the project is using. + */ + framework_version?: string; + + /** + * Most recent deployment of the project. */ latest_deployment?: Deployment | null; /** - * Name of the project. + * Name of the preview script. */ - name?: string; + preview_script_name?: string; /** - * Production branch of the project. Used to identify production deployments. + * Name of the production script. */ - production_branch?: string; + production_script_name?: string; source?: Project.Source; @@ -441,6 +514,11 @@ export interface Project { * The Cloudflare subdomain associated with the project. */ subdomain?: string; + + /** + * Whether the project uses functions. + */ + uses_functions?: boolean; } export namespace Project { @@ -486,12 +564,12 @@ export namespace Project { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview; + preview?: DeploymentConfigs.Preview | null; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production; + production?: DeploymentConfigs.Production | null; } export namespace DeploymentConfigs { @@ -504,6 +582,11 @@ export namespace Project { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -514,6 +597,11 @@ export namespace Project { */ browsers?: { [key: string]: Preview.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -522,7 +610,7 @@ export namespace Project { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -539,7 +627,12 @@ export namespace Project { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -551,6 +644,11 @@ export namespace Project { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Preview.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -576,10 +674,20 @@ export namespace Project { */ services?: { [key: string]: Preview.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Preview { @@ -666,6 +774,16 @@ export namespace Project { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -745,6 +863,11 @@ export namespace Project { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -755,6 +878,11 @@ export namespace Project { */ browsers?: { [key: string]: Production.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -763,7 +891,7 @@ export namespace Project { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -780,7 +908,12 @@ export namespace Project { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -792,6 +925,11 @@ export namespace Project { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Production.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -817,10 +955,20 @@ export namespace Project { */ services?: { [key: string]: Production.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Production { @@ -907,6 +1055,16 @@ export namespace Project { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -981,31 +1139,74 @@ export namespace Project { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } @@ -1047,25 +1248,25 @@ export interface ProjectCreateParams { account_id: string; /** - * Body param: Configs for the project build process. + * Body param: Name of the project. */ - build_config?: ProjectCreateParams.BuildConfig; + name: string; /** - * Body param: Configs for deployments in a project. + * Body param: Production branch of the project. Used to identify production + * deployments. */ - deployment_configs?: ProjectCreateParams.DeploymentConfigs; + production_branch: string; /** - * Body param: Name of the project. + * Body param: Configs for the project build process. */ - name?: string; + build_config?: ProjectCreateParams.BuildConfig | null; /** - * Body param: Production branch of the project. Used to identify production - * deployments. + * Body param: Configs for deployments in a project. */ - production_branch?: string; + deployment_configs?: ProjectCreateParams.DeploymentConfigs | null; /** * Body param: @@ -1116,12 +1317,12 @@ export namespace ProjectCreateParams { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview; + preview?: DeploymentConfigs.Preview | null; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production; + production?: DeploymentConfigs.Production | null; } export namespace DeploymentConfigs { @@ -1134,6 +1335,11 @@ export namespace ProjectCreateParams { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -1144,6 +1350,11 @@ export namespace ProjectCreateParams { */ browsers?: { [key: string]: Preview.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -1152,7 +1363,7 @@ export namespace ProjectCreateParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -1169,7 +1380,12 @@ export namespace ProjectCreateParams { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -1181,6 +1397,11 @@ export namespace ProjectCreateParams { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Preview.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -1206,10 +1427,20 @@ export namespace ProjectCreateParams { */ services?: { [key: string]: Preview.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Preview { @@ -1296,6 +1527,16 @@ export namespace ProjectCreateParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -1375,6 +1616,11 @@ export namespace ProjectCreateParams { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -1385,6 +1631,11 @@ export namespace ProjectCreateParams { */ browsers?: { [key: string]: Production.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -1393,7 +1644,7 @@ export namespace ProjectCreateParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -1410,7 +1661,12 @@ export namespace ProjectCreateParams { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -1422,6 +1678,11 @@ export namespace ProjectCreateParams { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Production.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -1447,10 +1708,20 @@ export namespace ProjectCreateParams { */ services?: { [key: string]: Production.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Production { @@ -1537,6 +1808,16 @@ export namespace ProjectCreateParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -1611,39 +1892,82 @@ export namespace ProjectCreateParams { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } } -export interface ProjectListParams { +export interface ProjectListParams extends V4PagePaginationArrayParams { /** - * Identifier + * Path param: Identifier */ account_id: string; } @@ -1662,25 +1986,25 @@ export interface ProjectEditParams { account_id: string; /** - * Body param: Configs for the project build process. + * Body param: Name of the project. */ - build_config?: ProjectEditParams.BuildConfig; + name: string; /** - * Body param: Configs for deployments in a project. + * Body param: Production branch of the project. Used to identify production + * deployments. */ - deployment_configs?: ProjectEditParams.DeploymentConfigs; + production_branch: string; /** - * Body param: Name of the project. + * Body param: Configs for the project build process. */ - name?: string; + build_config?: ProjectEditParams.BuildConfig | null; /** - * Body param: Production branch of the project. Used to identify production - * deployments. + * Body param: Configs for deployments in a project. */ - production_branch?: string; + deployment_configs?: ProjectEditParams.DeploymentConfigs | null; /** * Body param: @@ -1731,12 +2055,12 @@ export namespace ProjectEditParams { /** * Configs for preview deploys. */ - preview?: DeploymentConfigs.Preview; + preview?: DeploymentConfigs.Preview | null; /** * Configs for production deploys. */ - production?: DeploymentConfigs.Production; + production?: DeploymentConfigs.Production | null; } export namespace DeploymentConfigs { @@ -1749,6 +2073,11 @@ export namespace ProjectEditParams { */ ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -1759,6 +2088,11 @@ export namespace ProjectEditParams { */ browsers?: { [key: string]: Preview.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -1767,7 +2101,7 @@ export namespace ProjectEditParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -1784,7 +2118,12 @@ export namespace ProjectEditParams { */ env_vars?: { [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -1796,6 +2135,11 @@ export namespace ProjectEditParams { */ kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Preview.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -1821,10 +2165,20 @@ export namespace ProjectEditParams { */ services?: { [key: string]: Preview.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Preview { @@ -1911,6 +2265,16 @@ export namespace ProjectEditParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -1990,6 +2354,11 @@ export namespace ProjectEditParams { */ ai_bindings?: { [key: string]: Production.AIBindings | null } | null; + /** + * Whether to always use the latest compatibility date for Pages Functions. + */ + always_use_latest_compatibility_date?: boolean; + /** * Analytics Engine bindings used for Pages Functions. */ @@ -2000,6 +2369,11 @@ export namespace ProjectEditParams { */ browsers?: { [key: string]: Production.Browsers | null } | null; + /** + * The major version of the build image to use for Pages Functions. + */ + build_image_major_version?: number; + /** * Compatibility date used for Pages Functions. */ @@ -2008,7 +2382,7 @@ export namespace ProjectEditParams { /** * Compatibility flags used for Pages Functions. */ - compatibility_flags?: Array; + compatibility_flags?: Array | null; /** * D1 databases used for Pages Functions. @@ -2025,7 +2399,12 @@ export namespace ProjectEditParams { */ env_vars?: { [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; - }; + } | null; + + /** + * Whether to fail open when the deployment config cannot be applied. + */ + fail_open?: boolean; /** * Hyperdrive bindings used for Pages Functions. @@ -2037,6 +2416,11 @@ export namespace ProjectEditParams { */ kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; + /** + * Limits for Pages Functions. + */ + limits?: Production.Limits | null; + /** * mTLS bindings used for Pages Functions. */ @@ -2062,10 +2446,20 @@ export namespace ProjectEditParams { */ services?: { [key: string]: Production.Services | null } | null; + /** + * @deprecated All new projects now use the Standard usage model. + */ + usage_model?: 'standard' | 'bundled' | 'unbound'; + /** * Vectorize bindings used for Pages Functions. */ vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; + + /** + * Hash of the Wrangler configuration used for the deployment. + */ + wrangler_config_hash?: string; } export namespace Production { @@ -2152,6 +2546,16 @@ export namespace ProjectEditParams { namespace_id?: string; } + /** + * Limits for Pages Functions. + */ + export interface Limits { + /** + * CPU time limit in milliseconds. + */ + cpu_ms?: number; + } + /** * mTLS binding. */ @@ -2226,31 +2630,74 @@ export namespace ProjectEditParams { export interface Source { config?: Source.Config; - type?: string; + /** + * The source control management provider. + */ + type?: 'github' | 'gitlab'; } export namespace Source { export interface Config { + /** + * @deprecated Use `production_deployments_enabled` and + * `preview_deployment_setting` for more granular control. + */ deployments_enabled?: boolean; + /** + * The owner of the repository. + */ owner?: string; + /** + * A list of paths that should be excluded from triggering a preview deployment. + * Wildcard syntax (`*`) is supported. + */ path_excludes?: Array; + /** + * A list of paths that should be watched to trigger a preview deployment. Wildcard + * syntax (`*`) is supported. + */ path_includes?: Array; + /** + * Whether to enable PR comments. + */ pr_comments_enabled?: boolean; + /** + * A list of branches that should not trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_excludes?: Array; + /** + * A list of branches that should trigger a preview deployment. Wildcard syntax + * (`*`) is supported. Must be used with `preview_deployment_setting` set to + * `custom`. + */ preview_branch_includes?: Array; + /** + * Controls whether commits to preview branches trigger a preview deployment. + */ preview_deployment_setting?: 'all' | 'none' | 'custom'; + /** + * The production branch of the repository. + */ production_branch?: string; + /** + * Whether to trigger a production deployment on commits to the production branch. + */ production_deployments_enabled?: boolean; + /** + * The name of the repository. + */ repo_name?: string; } } @@ -2270,7 +2717,7 @@ export interface ProjectPurgeBuildCacheParams { account_id: string; } -Projects.DeploymentsSinglePage = DeploymentsSinglePage; +Projects.DeploymentsV4PagePaginationArray = DeploymentsV4PagePaginationArray; Projects.Deployments = Deployments; Projects.Domains = Domains; Projects.DomainListResponsesSinglePage = DomainListResponsesSinglePage; @@ -2282,7 +2729,7 @@ export declare namespace Projects { type Stage as Stage, type ProjectDeleteResponse as ProjectDeleteResponse, type ProjectPurgeBuildCacheResponse as ProjectPurgeBuildCacheResponse, - DeploymentsSinglePage as DeploymentsSinglePage, + DeploymentsV4PagePaginationArray as DeploymentsV4PagePaginationArray, type ProjectCreateParams as ProjectCreateParams, type ProjectListParams as ProjectListParams, type ProjectDeleteParams as ProjectDeleteParams, diff --git a/src/resources/pipelines.ts b/src/resources/pipelines.ts index 02e40368e4..cfc4b0add9 100644 --- a/src/resources/pipelines.ts +++ b/src/resources/pipelines.ts @@ -5,29 +5,10 @@ import * as Core from '../core'; export class Pipelines extends APIResource { /** - * Create a new pipeline. + * [DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint + * instead. * - * @example - * ```ts - * const pipeline = await client.pipelines.create({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * destination: { - * batch: {}, - * compression: {}, - * credentials: { - * access_key_id: '', - * endpoint: - * 'https://123f8a8258064ed892a347f173372359.r2.cloudflarestorage.com', - * secret_access_key: '', - * }, - * format: 'json', - * path: { bucket: 'bucket' }, - * type: 'r2', - * }, - * name: 'sample_pipeline', - * source: [{ format: 'json', type: 'type' }], - * }); - * ``` + * @deprecated */ create( params: PipelineCreateParams, @@ -42,26 +23,10 @@ export class Pipelines extends APIResource { } /** - * Update an existing pipeline. + * [DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines + * endpoint instead. * - * @example - * ```ts - * const pipeline = await client.pipelines.update( - * 'sample_pipeline', - * { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * destination: { - * batch: {}, - * compression: {}, - * format: 'json', - * path: { bucket: 'bucket' }, - * type: 'r2', - * }, - * name: 'sample_pipeline', - * source: [{ format: 'json', type: 'type' }], - * }, - * ); - * ``` + * @deprecated */ update( pipelineName: string, @@ -78,14 +43,10 @@ export class Pipelines extends APIResource { } /** - * List, filter, and paginate pipelines in an account. + * [DEPRECATED] List, filter, and paginate pipelines in an account. Use the new + * /pipelines/v1/pipelines endpoint instead. * - * @example - * ```ts - * const pipelines = await client.pipelines.list({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` + * @deprecated */ list(params: PipelineListParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...query } = params; @@ -93,14 +54,10 @@ export class Pipelines extends APIResource { } /** - * Delete a pipeline. + * [DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint + * instead. * - * @example - * ```ts - * await client.pipelines.delete('sample_pipeline', { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` + * @deprecated */ delete( pipelineName: string, @@ -115,15 +72,10 @@ export class Pipelines extends APIResource { } /** - * Get configuration of a pipeline. + * [DEPRECATED] Get configuration of a pipeline. Use the new + * /pipelines/v1/pipelines endpoint instead. * - * @example - * ```ts - * const pipeline = await client.pipelines.get( - * 'sample_pipeline', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` + * @deprecated */ get( pipelineName: string, @@ -140,7 +92,8 @@ export class Pipelines extends APIResource { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface PipelineCreateResponse { /** @@ -238,6 +191,10 @@ export namespace PipelineCreateResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -263,6 +220,10 @@ export namespace PipelineCreateResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -274,7 +235,8 @@ export namespace PipelineCreateResponse { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface PipelineUpdateResponse { /** @@ -372,6 +334,10 @@ export namespace PipelineUpdateResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -397,6 +363,10 @@ export namespace PipelineUpdateResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -442,7 +412,8 @@ export namespace PipelineListResponse { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface Result { /** @@ -540,6 +511,10 @@ export namespace PipelineListResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -565,6 +540,10 @@ export namespace PipelineListResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -577,7 +556,8 @@ export namespace PipelineListResponse { } /** - * Describes the configuration of a pipeline. + * @deprecated [DEPRECATED] Describes the configuration of a pipeline. Use the new + * streams/sinks/pipelines API instead. */ export interface PipelineGetResponse { /** @@ -675,6 +655,10 @@ export namespace PipelineGetResponse { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -700,6 +684,10 @@ export namespace PipelineGetResponse { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -821,6 +809,10 @@ export namespace PipelineCreateParams { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -846,6 +838,10 @@ export namespace PipelineCreateParams { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. @@ -967,6 +963,10 @@ export namespace PipelineUpdateParams { } } + /** + * @deprecated [DEPRECATED] HTTP source configuration. Use the new streams API + * instead. + */ export interface CloudflarePipelinesWorkersPipelinesHTTPSource { /** * Specifies the format of source data. @@ -992,6 +992,10 @@ export namespace PipelineUpdateParams { } } + /** + * @deprecated [DEPRECATED] Worker binding source configuration. Use the new + * streams API instead. + */ export interface CloudflarePipelinesWorkersPipelinesBindingSource { /** * Specifies the format of source data. diff --git a/src/resources/queues/index.ts b/src/resources/queues/index.ts index ebf2923861..ab15d31aa7 100644 --- a/src/resources/queues/index.ts +++ b/src/resources/queues/index.ts @@ -31,8 +31,10 @@ export { type SubscriptionUpdateResponse, type SubscriptionListResponse, type SubscriptionDeleteResponse, + type SubscriptionGetResponse, type SubscriptionCreateParams, type SubscriptionUpdateParams, type SubscriptionListParams, type SubscriptionDeleteParams, + type SubscriptionGetParams, } from './subscriptions'; diff --git a/src/resources/queues/queues.ts b/src/resources/queues/queues.ts index 667ab7a44a..836f42bd41 100644 --- a/src/resources/queues/queues.ts +++ b/src/resources/queues/queues.ts @@ -35,6 +35,8 @@ import { SubscriptionCreateResponse, SubscriptionDeleteParams, SubscriptionDeleteResponse, + SubscriptionGetParams, + SubscriptionGetResponse, SubscriptionListParams, SubscriptionListResponse, SubscriptionListResponsesV4PagePaginationArray, @@ -399,10 +401,12 @@ export declare namespace Queues { type SubscriptionUpdateResponse as SubscriptionUpdateResponse, type SubscriptionListResponse as SubscriptionListResponse, type SubscriptionDeleteResponse as SubscriptionDeleteResponse, + type SubscriptionGetResponse as SubscriptionGetResponse, SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, type SubscriptionCreateParams as SubscriptionCreateParams, type SubscriptionUpdateParams as SubscriptionUpdateParams, type SubscriptionListParams as SubscriptionListParams, type SubscriptionDeleteParams as SubscriptionDeleteParams, + type SubscriptionGetParams as SubscriptionGetParams, }; } diff --git a/src/resources/queues/subscriptions.ts b/src/resources/queues/subscriptions.ts index 3bb405e3fc..74c9b0e81f 100644 --- a/src/resources/queues/subscriptions.ts +++ b/src/resources/queues/subscriptions.ts @@ -105,6 +105,31 @@ export class Subscriptions extends APIResource { ) as Core.APIPromise<{ result: SubscriptionDeleteResponse }> )._thenUnwrap((obj) => obj.result); } + + /** + * Get details about an existing event subscription + * + * @example + * ```ts + * const subscription = await client.queues.subscriptions.get( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + subscriptionId: string, + params: SubscriptionGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/event_subscriptions/subscriptions/${subscriptionId}`, + options, + ) as Core.APIPromise<{ result: SubscriptionGetResponse }> + )._thenUnwrap((obj) => obj.result); + } } export class SubscriptionListResponsesV4PagePaginationArray extends V4PagePaginationArray {} @@ -661,6 +686,144 @@ export namespace SubscriptionDeleteResponse { } } +export interface SubscriptionGetResponse { + /** + * Unique identifier for the subscription + */ + id: string; + + /** + * When the subscription was created + */ + created_at: string; + + /** + * Destination configuration for the subscription + */ + destination: SubscriptionGetResponse.Destination; + + /** + * Whether the subscription is active + */ + enabled: boolean; + + /** + * List of event types this subscription handles + */ + events: Array; + + /** + * When the subscription was last modified + */ + modified_at: string; + + /** + * Name of the subscription + */ + name: string; + + /** + * Source configuration for the subscription + */ + source: + | SubscriptionGetResponse.MqEventSourceImages + | SubscriptionGetResponse.MqEventSourceKV + | SubscriptionGetResponse.MqEventSourceR2 + | SubscriptionGetResponse.MqEventSourceSuperSlurper + | SubscriptionGetResponse.MqEventSourceVectorize + | SubscriptionGetResponse.MqEventSourceWorkersAIModel + | SubscriptionGetResponse.MqEventSourceWorkersBuildsWorker + | SubscriptionGetResponse.MqEventSourceWorkflowsWorkflow; +} + +export namespace SubscriptionGetResponse { + /** + * Destination configuration for the subscription + */ + export interface Destination { + /** + * ID of the target queue + */ + queue_id: string; + + /** + * Type of destination + */ + type: 'queues.queue'; + } + + export interface MqEventSourceImages { + /** + * Type of source + */ + type?: 'images'; + } + + export interface MqEventSourceKV { + /** + * Type of source + */ + type?: 'kv'; + } + + export interface MqEventSourceR2 { + /** + * Type of source + */ + type?: 'r2'; + } + + export interface MqEventSourceSuperSlurper { + /** + * Type of source + */ + type?: 'superSlurper'; + } + + export interface MqEventSourceVectorize { + /** + * Type of source + */ + type?: 'vectorize'; + } + + export interface MqEventSourceWorkersAIModel { + /** + * Name of the Workers AI model + */ + model_name?: string; + + /** + * Type of source + */ + type?: 'workersAi.model'; + } + + export interface MqEventSourceWorkersBuildsWorker { + /** + * Type of source + */ + type?: 'workersBuilds.worker'; + + /** + * Name of the worker + */ + worker_name?: string; + } + + export interface MqEventSourceWorkflowsWorkflow { + /** + * Type of source + */ + type?: 'workflows.workflow'; + + /** + * Name of the workflow + */ + workflow_name?: string; + } +} + export interface SubscriptionCreateParams { /** * Path param: A Resource identifier. @@ -857,6 +1020,13 @@ export interface SubscriptionDeleteParams { account_id: string; } +export interface SubscriptionGetParams { + /** + * A Resource identifier. + */ + account_id: string; +} + Subscriptions.SubscriptionListResponsesV4PagePaginationArray = SubscriptionListResponsesV4PagePaginationArray; export declare namespace Subscriptions { @@ -865,10 +1035,12 @@ export declare namespace Subscriptions { type SubscriptionUpdateResponse as SubscriptionUpdateResponse, type SubscriptionListResponse as SubscriptionListResponse, type SubscriptionDeleteResponse as SubscriptionDeleteResponse, + type SubscriptionGetResponse as SubscriptionGetResponse, SubscriptionListResponsesV4PagePaginationArray as SubscriptionListResponsesV4PagePaginationArray, type SubscriptionCreateParams as SubscriptionCreateParams, type SubscriptionUpdateParams as SubscriptionUpdateParams, type SubscriptionListParams as SubscriptionListParams, type SubscriptionDeleteParams as SubscriptionDeleteParams, + type SubscriptionGetParams as SubscriptionGetParams, }; } diff --git a/src/resources/r2/buckets/event-notifications.ts b/src/resources/r2/buckets/event-notifications.ts index cb0ba791f0..b3f163f204 100644 --- a/src/resources/r2/buckets/event-notifications.ts +++ b/src/resources/r2/buckets/event-notifications.ts @@ -13,7 +13,10 @@ export class EventNotifications extends APIResource { * await client.r2.buckets.eventNotifications.update( * 'example-bucket', * 'queue_id', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * rules: [{ actions: ['PutObject', 'CopyObject'] }], + * }, * ); * ``` */ @@ -275,7 +278,7 @@ export interface EventNotificationUpdateParams { /** * Body param: Array of rules to drive notifications. */ - rules?: Array; + rules: Array; /** * Header param: Jurisdiction where objects in this bucket are guaranteed to be diff --git a/src/resources/r2/super-slurper/connectivity-precheck.ts b/src/resources/r2/super-slurper/connectivity-precheck.ts index 654a8193d5..2283824388 100644 --- a/src/resources/r2/super-slurper/connectivity-precheck.ts +++ b/src/resources/r2/super-slurper/connectivity-precheck.ts @@ -13,6 +13,12 @@ export class ConnectivityPrecheck extends APIResource { * const response = * await client.r2.superSlurper.connectivityPrecheck.source({ * account_id: 'account_id', + * bucket: 'bucket', + * secret: { + * accessKeyId: 'accessKeyId', + * secretAccessKey: 'secretAccessKey', + * }, + * vendor: 's3', * }); * ``` */ @@ -37,6 +43,12 @@ export class ConnectivityPrecheck extends APIResource { * const response = * await client.r2.superSlurper.connectivityPrecheck.target({ * account_id: 'account_id', + * bucket: 'bucket', + * secret: { + * accessKeyId: 'accessKeyId', + * secretAccessKey: 'secretAccessKey', + * }, + * vendor: 'r2', * }); * ``` */ @@ -77,7 +89,17 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket?: string; + bucket: string; + + /** + * Body param: + */ + secret: R2SlurperS3SourceSchema.Secret; + + /** + * Body param: + */ + vendor: 's3'; /** * Body param: @@ -87,19 +109,19 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - secret?: R2SlurperS3SourceSchema.Secret; + pathPrefix?: string | null; /** * Body param: */ - vendor?: 's3'; + region?: string | null; } export namespace R2SlurperS3SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } @@ -112,24 +134,29 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket?: string; + bucket: string; + + /** + * Body param: + */ + secret: R2SlurperGcsSourceSchema.Secret; /** * Body param: */ - secret?: R2SlurperGcsSourceSchema.Secret; + vendor: 'gcs'; /** * Body param: */ - vendor?: 'gcs'; + pathPrefix?: string | null; } export namespace R2SlurperGcsSourceSchema { export interface Secret { - clientEmail?: string; + clientEmail: string; - privateKey?: string; + privateKey: string; } } @@ -142,29 +169,34 @@ export declare namespace ConnectivityPrecheckSourceParams { /** * Body param: */ - bucket?: string; + bucket: string; /** * Body param: */ - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: R2SlurperR2SourceSchema.Secret; + + /** + * Body param: + */ + vendor: SippyAPI.ProviderParam; /** * Body param: */ - secret?: R2SlurperR2SourceSchema.Secret; + jurisdiction?: 'default' | 'eu' | 'fedramp'; /** * Body param: */ - vendor?: SippyAPI.ProviderParam; + pathPrefix?: string | null; } export namespace R2SlurperR2SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } } @@ -178,29 +210,29 @@ export interface ConnectivityPrecheckTargetParams { /** * Body param: */ - bucket?: string; + bucket: string; /** * Body param: */ - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: ConnectivityPrecheckTargetParams.Secret; /** * Body param: */ - secret?: ConnectivityPrecheckTargetParams.Secret; + vendor: SippyAPI.ProviderParam; /** * Body param: */ - vendor?: SippyAPI.ProviderParam; + jurisdiction?: 'default' | 'eu' | 'fedramp'; } export namespace ConnectivityPrecheckTargetParams { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } diff --git a/src/resources/r2/super-slurper/jobs/jobs.ts b/src/resources/r2/super-slurper/jobs/jobs.ts index 0e70bb10e5..7732e944b1 100644 --- a/src/resources/r2/super-slurper/jobs/jobs.ts +++ b/src/resources/r2/super-slurper/jobs/jobs.ts @@ -360,72 +360,80 @@ export interface JobCreateParams { export namespace JobCreateParams { export interface R2SlurperS3SourceSchema { - bucket?: string; + bucket: string; + + secret: R2SlurperS3SourceSchema.Secret; + + vendor: 's3'; endpoint?: string | null; - secret?: R2SlurperS3SourceSchema.Secret; + pathPrefix?: string | null; - vendor?: 's3'; + region?: string | null; } export namespace R2SlurperS3SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } export interface R2SlurperGcsSourceSchema { - bucket?: string; + bucket: string; - secret?: R2SlurperGcsSourceSchema.Secret; + secret: R2SlurperGcsSourceSchema.Secret; - vendor?: 'gcs'; + vendor: 'gcs'; + + pathPrefix?: string | null; } export namespace R2SlurperGcsSourceSchema { export interface Secret { - clientEmail?: string; + clientEmail: string; - privateKey?: string; + privateKey: string; } } export interface R2SlurperR2SourceSchema { - bucket?: string; + bucket: string; - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: R2SlurperR2SourceSchema.Secret; - secret?: R2SlurperR2SourceSchema.Secret; + vendor: SippyAPI.ProviderParam; + + jurisdiction?: 'default' | 'eu' | 'fedramp'; - vendor?: SippyAPI.ProviderParam; + pathPrefix?: string | null; } export namespace R2SlurperR2SourceSchema { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } export interface Target { - bucket?: string; + bucket: string; - jurisdiction?: 'default' | 'eu' | 'fedramp'; + secret: Target.Secret; - secret?: Target.Secret; + vendor: SippyAPI.ProviderParam; - vendor?: SippyAPI.ProviderParam; + jurisdiction?: 'default' | 'eu' | 'fedramp'; } export namespace Target { export interface Secret { - accessKeyId?: string; + accessKeyId: string; - secretAccessKey?: string; + secretAccessKey: string; } } } diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index c4830c1214..b9f3118f5f 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -21,9 +21,23 @@ import { ToMarkdownCreateResponsesSinglePage, } from './to-markdown'; import * as BotsAPI from './bots/bots'; -import { Bots } from './bots/bots'; +import { + BotSummaryV2Params, + BotSummaryV2Response, + BotTimeseriesGroupsParams, + BotTimeseriesGroupsResponse, + BotTimeseriesParams, + BotTimeseriesResponse, + Bots, +} from './bots/bots'; import * as InferenceAPI from './inference/inference'; -import { Inference } from './inference/inference'; +import { + Inference, + InferenceSummaryV2Params, + InferenceSummaryV2Response, + InferenceTimeseriesGroupsV2Params, + InferenceTimeseriesGroupsV2Response, +} from './inference/inference'; export class AI extends APIResource { toMarkdown: ToMarkdownAPI.ToMarkdown = new ToMarkdownAPI.ToMarkdown(this._client); @@ -48,9 +62,23 @@ export declare namespace AI { type ToMarkdownCreateParams as ToMarkdownCreateParams, }; - export { Inference as Inference }; + export { + Inference as Inference, + type InferenceSummaryV2Response as InferenceSummaryV2Response, + type InferenceTimeseriesGroupsV2Response as InferenceTimeseriesGroupsV2Response, + type InferenceSummaryV2Params as InferenceSummaryV2Params, + type InferenceTimeseriesGroupsV2Params as InferenceTimeseriesGroupsV2Params, + }; - export { Bots as Bots }; + export { + Bots as Bots, + type BotSummaryV2Response as BotSummaryV2Response, + type BotTimeseriesResponse as BotTimeseriesResponse, + type BotTimeseriesGroupsResponse as BotTimeseriesGroupsResponse, + type BotSummaryV2Params as BotSummaryV2Params, + type BotTimeseriesParams as BotTimeseriesParams, + type BotTimeseriesGroupsParams as BotTimeseriesGroupsParams, + }; export { TimeseriesGroups as TimeseriesGroups, diff --git a/src/resources/radar/ai/bots/bots.ts b/src/resources/radar/ai/bots/bots.ts index 865665cba6..6529350fe7 100644 --- a/src/resources/radar/ai/bots/bots.ts +++ b/src/resources/radar/ai/bots/bots.ts @@ -1,16 +1,688 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../resource'; +import { isRequestOptions } from '../../../../core'; +import * as Core from '../../../../core'; import * as SummaryAPI from './summary'; import { Summary, SummaryUserAgentParams, SummaryUserAgentResponse } from './summary'; export class Bots extends APIResource { summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); + + /** + * Retrieves an aggregated summary of AI bots HTTP requests grouped by the + * specified dimension. + * + * @example + * ```ts + * const response = await client.radar.ai.bots.summaryV2( + * 'USER_AGENT', + * ); + * ``` + */ + summaryV2( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE' | 'INDUSTRY' | 'VERTICAL', + query?: BotSummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE' | 'INDUSTRY' | 'VERTICAL', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE' | 'INDUSTRY' | 'VERTICAL', + query: BotSummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: BotSummaryV2Response; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves AI bots HTTP request volume over time. + * + * @example + * ```ts + * const response = await client.radar.ai.bots.timeseries(); + * ``` + */ + timeseries( + query?: BotTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: BotTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/ai/bots/timeseries', { query, ...options }) as Core.APIPromise<{ + result: BotTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the + * specified dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.bots.timeseriesGroups('USER_AGENT'); + * ``` + */ + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE' | 'INDUSTRY' | 'VERTICAL', + query?: BotTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE' | 'INDUSTRY' | 'VERTICAL', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE' | 'INDUSTRY' | 'VERTICAL', + query: BotTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: BotTimeseriesGroupsResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface BotSummaryV2Response { + /** + * Metadata for the results. + */ + meta: BotSummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace BotSummaryV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + +export interface BotTimeseriesResponse { + /** + * Metadata for the results. + */ + meta: BotTimeseriesResponse.Meta; + + [k: string]: + | BotTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb + | BotTimeseriesResponse.Meta + | undefined; +} + +export namespace BotTimeseriesResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { + timestamps: Array; + + values: Array; + } +} + +export interface BotTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: BotTimeseriesGroupsResponse.Meta; + + serie_0: BotTimeseriesGroupsResponse.Serie0; +} + +export namespace BotTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface BotSummaryV2Params { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by industry. + */ + industry?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by vertical. + */ + vertical?: Array; +} + +export interface BotTimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by industry. + */ + industry?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by user agent. + */ + userAgent?: Array; + + /** + * Filters results by vertical. + */ + vertical?: Array; +} + +export interface BotTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by industry. + */ + industry?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; + + /** + * Filters results by vertical. + */ + vertical?: Array; } Bots.Summary = Summary; export declare namespace Bots { + export { + type BotSummaryV2Response as BotSummaryV2Response, + type BotTimeseriesResponse as BotTimeseriesResponse, + type BotTimeseriesGroupsResponse as BotTimeseriesGroupsResponse, + type BotSummaryV2Params as BotSummaryV2Params, + type BotTimeseriesParams as BotTimeseriesParams, + type BotTimeseriesGroupsParams as BotTimeseriesGroupsParams, + }; + export { Summary as Summary, type SummaryUserAgentResponse as SummaryUserAgentResponse, diff --git a/src/resources/radar/ai/bots/index.ts b/src/resources/radar/ai/bots/index.ts index c94177cbcd..8d3512cf95 100644 --- a/src/resources/radar/ai/bots/index.ts +++ b/src/resources/radar/ai/bots/index.ts @@ -1,4 +1,12 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Bots } from './bots'; +export { + Bots, + type BotSummaryV2Response, + type BotTimeseriesResponse, + type BotTimeseriesGroupsResponse, + type BotSummaryV2Params, + type BotTimeseriesParams, + type BotTimeseriesGroupsParams, +} from './bots'; export { Summary, type SummaryUserAgentResponse, type SummaryUserAgentParams } from './summary'; diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts index 75c99603d5..c9e77e1896 100644 --- a/src/resources/radar/ai/bots/summary.ts +++ b/src/resources/radar/ai/bots/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of traffic by AI user agent. * - * @deprecated + * @deprecated Use [Radar AI Bots Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/summary_v2/) instead. */ userAgent( query?: SummaryUserAgentParams, diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index d56384a99a..12a71ffebc 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -1,8 +1,22 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { AI } from './ai'; -export { Bots } from './bots/index'; -export { Inference } from './inference/index'; +export { + Bots, + type BotSummaryV2Response, + type BotTimeseriesResponse, + type BotTimeseriesGroupsResponse, + type BotSummaryV2Params, + type BotTimeseriesParams, + type BotTimeseriesGroupsParams, +} from './bots/index'; +export { + Inference, + type InferenceSummaryV2Response, + type InferenceTimeseriesGroupsV2Response, + type InferenceSummaryV2Params, + type InferenceTimeseriesGroupsV2Params, +} from './inference/index'; export { TimeseriesGroups, type TimeseriesGroupSummaryResponse, diff --git a/src/resources/radar/ai/inference/index.ts b/src/resources/radar/ai/inference/index.ts index a26b5943df..3e6766d9a6 100644 --- a/src/resources/radar/ai/inference/index.ts +++ b/src/resources/radar/ai/inference/index.ts @@ -1,6 +1,12 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Inference } from './inference'; +export { + Inference, + type InferenceSummaryV2Response, + type InferenceTimeseriesGroupsV2Response, + type InferenceSummaryV2Params, + type InferenceTimeseriesGroupsV2Params, +} from './inference'; export { Summary, type SummaryModelResponse, diff --git a/src/resources/radar/ai/inference/inference.ts b/src/resources/radar/ai/inference/inference.ts index 7f31aa0ffb..2f55d10668 100644 --- a/src/resources/radar/ai/inference/inference.ts +++ b/src/resources/radar/ai/inference/inference.ts @@ -1,6 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../resource'; +import { isRequestOptions } from '../../../../core'; +import * as Core from '../../../../core'; import * as SummaryAPI from './summary'; import { Summary, @@ -17,12 +19,427 @@ export class Inference extends APIResource { timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( this._client, ); + + /** + * Retrieves an aggregated summary of unique accounts using Workers AI inference + * grouped by the specified dimension. + * + * @example + * ```ts + * const response = await client.radar.ai.inference.summaryV2( + * 'MODEL', + * ); + * ``` + */ + summaryV2( + dimension: 'MODEL' | 'TASK', + query?: InferenceSummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'MODEL' | 'TASK', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'MODEL' | 'TASK', + query: InferenceSummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/inference/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: InferenceSummaryV2Response; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of unique accounts using Workers AI inference, + * grouped by the specified dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.inference.timeseriesGroupsV2( + * 'MODEL', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: 'MODEL' | 'TASK', + query?: InferenceTimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'MODEL' | 'TASK', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'MODEL' | 'TASK', + query: InferenceTimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/inference/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: InferenceTimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface InferenceSummaryV2Response { + /** + * Metadata for the results. + */ + meta: InferenceSummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace InferenceSummaryV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + +export interface InferenceTimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + meta: InferenceTimeseriesGroupsV2Response.Meta; + + serie_0: InferenceTimeseriesGroupsV2Response.Serie0; +} + +export namespace InferenceTimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface InferenceSummaryV2Params { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export interface InferenceTimeseriesGroupsV2Params { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; } Inference.Summary = Summary; Inference.TimeseriesGroups = TimeseriesGroups; export declare namespace Inference { + export { + type InferenceSummaryV2Response as InferenceSummaryV2Response, + type InferenceTimeseriesGroupsV2Response as InferenceTimeseriesGroupsV2Response, + type InferenceSummaryV2Params as InferenceSummaryV2Params, + type InferenceTimeseriesGroupsV2Params as InferenceTimeseriesGroupsV2Params, + }; + export { Summary as Summary, type SummaryModelResponse as SummaryModelResponse, diff --git a/src/resources/radar/ai/inference/summary.ts b/src/resources/radar/ai/inference/summary.ts index a22b6f10e9..4b9b871ddc 100644 --- a/src/resources/radar/ai/inference/summary.ts +++ b/src/resources/radar/ai/inference/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by model. * - * @deprecated + * @deprecated Use [Radar AI Inference Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/summary_v2/) instead. */ model(query?: SummaryModelParams, options?: Core.RequestOptions): Core.APIPromise; model(options?: Core.RequestOptions): Core.APIPromise; @@ -29,7 +29,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by task. * - * @deprecated + * @deprecated Use [Radar AI Inference Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/summary_v2/) instead. */ task(query?: SummaryTaskParams, options?: Core.RequestOptions): Core.APIPromise; task(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/ai/inference/timeseries-groups/summary.ts b/src/resources/radar/ai/inference/timeseries-groups/summary.ts index bf808d1b21..43edd89a6c 100644 --- a/src/resources/radar/ai/inference/timeseries-groups/summary.ts +++ b/src/resources/radar/ai/inference/timeseries-groups/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by model over time. * - * @deprecated + * @deprecated Use [Radar AI Inference Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/timeseries_groups_v2/) instead. */ model(query?: SummaryModelParams, options?: Core.RequestOptions): Core.APIPromise; model(options?: Core.RequestOptions): Core.APIPromise; @@ -30,7 +30,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by task over time. * - * @deprecated + * @deprecated Use [Radar AI Inference Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/timeseries_groups_v2/) instead. */ task(query?: SummaryTaskParams, options?: Core.RequestOptions): Core.APIPromise; task(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index 09ff1ff862..c516b5d812 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -9,13 +9,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves an aggregated summary of AI bots HTTP requests grouped by the * specified dimension. * - * @example - * ```ts - * const response = - * await client.radar.ai.timeseriesGroups.summary( - * 'USER_AGENT', - * ); - * ``` + * @deprecated Use [Radar > AI > Bots > Summary](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/summary_v2/) instead. */ summary( dimension: 'USER_AGENT' | 'CRAWL_PURPOSE' | 'INDUSTRY' | 'VERTICAL', @@ -44,11 +38,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves AI bots HTTP request volume over time. * - * @example - * ```ts - * const response = - * await client.radar.ai.timeseriesGroups.timeseries(); - * ``` + * @deprecated Use [Radar > AI > Bots > Timeseries](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/timeseries/) instead. */ timeseries( query?: TimeseriesGroupTimeseriesParams, @@ -73,13 +63,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the * specified dimension over time. * - * @example - * ```ts - * const response = - * await client.radar.ai.timeseriesGroups.timeseriesGroups( - * 'USER_AGENT', - * ); - * ``` + * @deprecated Use [Radar > AI > Bots > Timeseries Groups](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/timeseries_groups/) instead. */ timeseriesGroups( dimension: 'USER_AGENT' | 'CRAWL_PURPOSE' | 'INDUSTRY' | 'VERTICAL', @@ -109,7 +93,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of traffic by AI user agent over time. * - * @deprecated + * @deprecated Use [Radar AI Bots Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/timeseries_groups/) instead. */ userAgent( query?: TimeseriesGroupUserAgentParams, diff --git a/src/resources/radar/ai/to-markdown.ts b/src/resources/radar/ai/to-markdown.ts index cc254c45c8..b3016565e9 100644 --- a/src/resources/radar/ai/to-markdown.ts +++ b/src/resources/radar/ai/to-markdown.ts @@ -9,16 +9,7 @@ export class ToMarkdown extends APIResource { /** * Convert Files into Markdown * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const toMarkdownCreateResponse of client.radar.ai.toMarkdown.create( - * fs.createReadStream('path/to/file'), - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` + * @deprecated Use [AI > To Markdown](https://developers.cloudflare.com/api/resources/ai/subresources/to_markdown/) instead. */ create( body: string | ArrayBufferView | ArrayBuffer | BlobLike, diff --git a/src/resources/radar/as112/as112.ts b/src/resources/radar/as112/as112.ts index 876d8d74aa..31b487f018 100644 --- a/src/resources/radar/as112/as112.ts +++ b/src/resources/radar/as112/as112.ts @@ -55,6 +55,40 @@ export class AS112 extends APIResource { ); top: TopAPI.Top = new TopAPI.Top(this._client); + /** + * Retrieves the distribution of AS112 queries by the specified dimension. + * + * @example + * ```ts + * const response = await client.radar.as112.summaryV2( + * 'DNSSEC', + * ); + * ``` + */ + summaryV2( + dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', + query?: AS112SummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', + query: AS112SummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/as112/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: AS112SummaryV2Response; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves the AS112 DNS queries over time. * @@ -81,6 +115,137 @@ export class AS112 extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieves the distribution of AS112 queries grouped by dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.as112.timeseriesGroupsV2('DNSSEC'); + * ``` + */ + timeseriesGroupsV2( + dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', + query?: AS112TimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'DNSSEC' | 'EDNS' | 'IP_VERSION' | 'PROTOCOL' | 'QUERY_TYPE' | 'RESPONSE_CODE', + query: AS112TimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/as112/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: AS112TimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface AS112SummaryV2Response { + /** + * Metadata for the results. + */ + meta: AS112SummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace AS112SummaryV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } } export interface AS112TimeseriesResponse { @@ -196,14 +361,117 @@ export namespace AS112TimeseriesResponse { } } -export interface AS112TimeseriesParams { +export interface AS112TimeseriesGroupsV2Response { /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + * Metadata for the results. */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; + meta: AS112TimeseriesGroupsV2Response.Meta; + + serie_0: AS112TimeseriesGroupsV2Response.Serie0; +} + +export namespace AS112TimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} +export interface AS112SummaryV2Params { /** * Filters results by continent. Specify a comma-separated list of alpha-2 codes. * Prefix with `-` to exclude continents from results. For example, `-EU,NA` @@ -233,6 +501,370 @@ export interface AS112TimeseriesParams { */ format?: 'JSON' | 'CSV'; + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by DNS transport protocol. + */ + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; + + /** + * Filters results by DNS query type. + */ + queryType?: Array< + | 'A' + | 'AAAA' + | 'A6' + | 'AFSDB' + | 'ANY' + | 'APL' + | 'ATMA' + | 'AXFR' + | 'CAA' + | 'CDNSKEY' + | 'CDS' + | 'CERT' + | 'CNAME' + | 'CSYNC' + | 'DHCID' + | 'DLV' + | 'DNAME' + | 'DNSKEY' + | 'DOA' + | 'DS' + | 'EID' + | 'EUI48' + | 'EUI64' + | 'GPOS' + | 'GID' + | 'HINFO' + | 'HIP' + | 'HTTPS' + | 'IPSECKEY' + | 'ISDN' + | 'IXFR' + | 'KEY' + | 'KX' + | 'L32' + | 'L64' + | 'LOC' + | 'LP' + | 'MAILA' + | 'MAILB' + | 'MB' + | 'MD' + | 'MF' + | 'MG' + | 'MINFO' + | 'MR' + | 'MX' + | 'NAPTR' + | 'NB' + | 'NBSTAT' + | 'NID' + | 'NIMLOC' + | 'NINFO' + | 'NS' + | 'NSAP' + | 'NSEC' + | 'NSEC3' + | 'NSEC3PARAM' + | 'NULL' + | 'NXT' + | 'OPENPGPKEY' + | 'OPT' + | 'PTR' + | 'PX' + | 'RKEY' + | 'RP' + | 'RRSIG' + | 'RT' + | 'SIG' + | 'SINK' + | 'SMIMEA' + | 'SOA' + | 'SPF' + | 'SRV' + | 'SSHFP' + | 'SVCB' + | 'TA' + | 'TALINK' + | 'TKEY' + | 'TLSA' + | 'TSIG' + | 'TXT' + | 'UINFO' + | 'UID' + | 'UNSPEC' + | 'URI' + | 'WKS' + | 'X25' + | 'ZONEMD' + | null + >; + + /** + * Filters results by DNS response code. + */ + responseCode?: Array< + | 'NOERROR' + | 'FORMERR' + | 'SERVFAIL' + | 'NXDOMAIN' + | 'NOTIMP' + | 'REFUSED' + | 'YXDOMAIN' + | 'YXRRSET' + | 'NXRRSET' + | 'NOTAUTH' + | 'NOTZONE' + | 'BADSIG' + | 'BADKEY' + | 'BADTIME' + | 'BADMODE' + | 'BADNAME' + | 'BADALG' + | 'BADTRUNC' + | 'BADCOOKIE' + >; +} + +export interface AS112TimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by DNS transport protocol. + */ + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; + + /** + * Filters results by DNS query type. + */ + queryType?: Array< + | 'A' + | 'AAAA' + | 'A6' + | 'AFSDB' + | 'ANY' + | 'APL' + | 'ATMA' + | 'AXFR' + | 'CAA' + | 'CDNSKEY' + | 'CDS' + | 'CERT' + | 'CNAME' + | 'CSYNC' + | 'DHCID' + | 'DLV' + | 'DNAME' + | 'DNSKEY' + | 'DOA' + | 'DS' + | 'EID' + | 'EUI48' + | 'EUI64' + | 'GPOS' + | 'GID' + | 'HINFO' + | 'HIP' + | 'HTTPS' + | 'IPSECKEY' + | 'ISDN' + | 'IXFR' + | 'KEY' + | 'KX' + | 'L32' + | 'L64' + | 'LOC' + | 'LP' + | 'MAILA' + | 'MAILB' + | 'MB' + | 'MD' + | 'MF' + | 'MG' + | 'MINFO' + | 'MR' + | 'MX' + | 'NAPTR' + | 'NB' + | 'NBSTAT' + | 'NID' + | 'NIMLOC' + | 'NINFO' + | 'NS' + | 'NSAP' + | 'NSEC' + | 'NSEC3' + | 'NSEC3PARAM' + | 'NULL' + | 'NXT' + | 'OPENPGPKEY' + | 'OPT' + | 'PTR' + | 'PX' + | 'RKEY' + | 'RP' + | 'RRSIG' + | 'RT' + | 'SIG' + | 'SINK' + | 'SMIMEA' + | 'SOA' + | 'SPF' + | 'SRV' + | 'SSHFP' + | 'SVCB' + | 'TA' + | 'TALINK' + | 'TKEY' + | 'TLSA' + | 'TSIG' + | 'TXT' + | 'UINFO' + | 'UID' + | 'UNSPEC' + | 'URI' + | 'WKS' + | 'X25' + | 'ZONEMD' + | null + >; + + /** + * Filters results by DNS response code. + */ + responseCode?: Array< + | 'NOERROR' + | 'FORMERR' + | 'SERVFAIL' + | 'NXDOMAIN' + | 'NOTIMP' + | 'REFUSED' + | 'YXDOMAIN' + | 'YXRRSET' + | 'NXRRSET' + | 'NOTAUTH' + | 'NOTZONE' + | 'BADSIG' + | 'BADKEY' + | 'BADTIME' + | 'BADMODE' + | 'BADNAME' + | 'BADALG' + | 'BADTRUNC' + | 'BADCOOKIE' + >; +} + +export interface AS112TimeseriesGroupsV2Params { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + /** * Filters results by location. Specify a comma-separated list of alpha-2 codes. * Prefix with `-` to exclude locations from results. For example, `-US,PT` @@ -248,12 +880,12 @@ export interface AS112TimeseriesParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -342,12 +974,13 @@ export interface AS112TimeseriesParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -366,7 +999,8 @@ export interface AS112TimeseriesParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } AS112.Summary = Summary; @@ -375,8 +1009,12 @@ AS112.Top = Top; export declare namespace AS112 { export { + type AS112SummaryV2Response as AS112SummaryV2Response, type AS112TimeseriesResponse as AS112TimeseriesResponse, + type AS112TimeseriesGroupsV2Response as AS112TimeseriesGroupsV2Response, + type AS112SummaryV2Params as AS112SummaryV2Params, type AS112TimeseriesParams as AS112TimeseriesParams, + type AS112TimeseriesGroupsV2Params as AS112TimeseriesGroupsV2Params, }; export { diff --git a/src/resources/radar/as112/index.ts b/src/resources/radar/as112/index.ts index 7b5e4752cb..f3e1911eea 100644 --- a/src/resources/radar/as112/index.ts +++ b/src/resources/radar/as112/index.ts @@ -1,6 +1,14 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { AS112, type AS112TimeseriesResponse, type AS112TimeseriesParams } from './as112'; +export { + AS112, + type AS112SummaryV2Response, + type AS112TimeseriesResponse, + type AS112TimeseriesGroupsV2Response, + type AS112SummaryV2Params, + type AS112TimeseriesParams, + type AS112TimeseriesGroupsV2Params, +} from './as112'; export { Summary, type SummaryDNSSECResponse, diff --git a/src/resources/radar/as112/summary.ts b/src/resources/radar/as112/summary.ts index c59fdaeb5a..d839219855 100644 --- a/src/resources/radar/as112/summary.ts +++ b/src/resources/radar/as112/summary.ts @@ -9,10 +9,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by DNSSEC (DNS Security * Extensions) support. * - * @example - * ```ts - * const response = await client.radar.as112.summary.dnssec(); - * ``` + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -34,10 +31,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries to AS112 by EDNS (Extension Mechanisms * for DNS) support. * - * @example - * ```ts - * const response = await client.radar.as112.summary.edns(); - * ``` + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ edns(query?: SummaryEdnsParams, options?: Core.RequestOptions): Core.APIPromise; edns(options?: Core.RequestOptions): Core.APIPromise; @@ -58,11 +52,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by IP version. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.ipVersion(); - * ``` + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -86,11 +76,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by protocol. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.protocol(); - * ``` + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ protocol( query?: SummaryProtocolParams, @@ -114,11 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries to AS112 by type. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.queryType(); - * ``` + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ queryType( query?: SummaryQueryTypeParams, @@ -142,11 +124,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of AS112 DNS requests classified by response code. * - * @example - * ```ts - * const response = - * await client.radar.as112.summary.responseCodes(); - * ``` + * @deprecated Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead. */ responseCodes( query?: SummaryResponseCodesParams, @@ -853,12 +831,12 @@ export interface SummaryDNSSECParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -947,12 +925,13 @@ export interface SummaryDNSSECParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -971,7 +950,8 @@ export interface SummaryDNSSECParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface SummaryEdnsParams { @@ -1019,12 +999,12 @@ export interface SummaryEdnsParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1113,12 +1093,13 @@ export interface SummaryEdnsParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1137,7 +1118,8 @@ export interface SummaryEdnsParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface SummaryIPVersionParams { @@ -1185,12 +1167,12 @@ export interface SummaryIPVersionParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1279,12 +1261,13 @@ export interface SummaryIPVersionParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1303,7 +1286,8 @@ export interface SummaryIPVersionParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface SummaryProtocolParams { @@ -1351,7 +1335,7 @@ export interface SummaryProtocolParams { /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1440,12 +1424,13 @@ export interface SummaryProtocolParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1464,7 +1449,8 @@ export interface SummaryProtocolParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface SummaryQueryTypeParams { @@ -1519,12 +1505,12 @@ export interface SummaryQueryTypeParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1543,7 +1529,8 @@ export interface SummaryQueryTypeParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface SummaryResponseCodesParams { @@ -1598,12 +1585,12 @@ export interface SummaryResponseCodesParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1692,7 +1679,8 @@ export interface SummaryResponseCodesParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; } export declare namespace Summary { diff --git a/src/resources/radar/as112/timeseries-groups.ts b/src/resources/radar/as112/timeseries-groups.ts index a9e2aa049c..c55ebcbca7 100644 --- a/src/resources/radar/as112/timeseries-groups.ts +++ b/src/resources/radar/as112/timeseries-groups.ts @@ -9,11 +9,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by DNSSEC (DNS Security * Extensions) support over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.dnssec(); - * ``` + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -38,11 +34,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS queries by EDNS (Extension Mechanisms * for DNS) support over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.edns(); - * ``` + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ edns( query?: TimeseriesGroupEdnsParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.ipVersion(); - * ``` + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -96,11 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by protocol over * time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.protocol(); - * ``` + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ protocol( query?: TimeseriesGroupProtocolParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of AS112 DNS queries by type over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.queryType(); - * ``` + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -154,11 +134,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of AS112 DNS requests classified by response code * over time. * - * @example - * ```ts - * const response = - * await client.radar.as112.timeseriesGroups.responseCodes(); - * ``` + * @deprecated Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead. */ responseCodes( query?: TimeseriesGroupResponseCodesParams, @@ -897,12 +873,12 @@ export interface TimeseriesGroupDNSSECParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -991,12 +967,13 @@ export interface TimeseriesGroupDNSSECParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1015,7 +992,8 @@ export interface TimeseriesGroupDNSSECParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface TimeseriesGroupEdnsParams { @@ -1070,12 +1048,12 @@ export interface TimeseriesGroupEdnsParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1164,12 +1142,13 @@ export interface TimeseriesGroupEdnsParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1188,7 +1167,8 @@ export interface TimeseriesGroupEdnsParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface TimeseriesGroupIPVersionParams { @@ -1243,12 +1223,12 @@ export interface TimeseriesGroupIPVersionParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1337,12 +1317,13 @@ export interface TimeseriesGroupIPVersionParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1361,7 +1342,8 @@ export interface TimeseriesGroupIPVersionParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface TimeseriesGroupProtocolParams { @@ -1416,7 +1398,7 @@ export interface TimeseriesGroupProtocolParams { /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1505,12 +1487,13 @@ export interface TimeseriesGroupProtocolParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1529,7 +1512,8 @@ export interface TimeseriesGroupProtocolParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface TimeseriesGroupQueryTypeParams { @@ -1591,12 +1575,12 @@ export interface TimeseriesGroupQueryTypeParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1615,7 +1599,8 @@ export interface TimeseriesGroupQueryTypeParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; } export interface TimeseriesGroupResponseCodesParams { @@ -1677,12 +1662,12 @@ export interface TimeseriesGroupResponseCodesParams { /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1771,7 +1756,8 @@ export interface TimeseriesGroupResponseCodesParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; } export declare namespace TimeseriesGroups { diff --git a/src/resources/radar/attacks/attacks.ts b/src/resources/radar/attacks/attacks.ts index 9d3c9c4aef..4346cf6862 100644 --- a/src/resources/radar/attacks/attacks.ts +++ b/src/resources/radar/attacks/attacks.ts @@ -2,9 +2,25 @@ import { APIResource } from '../../../resource'; import * as Layer3API from './layer3/layer3'; -import { Layer3, Layer3TimeseriesParams, Layer3TimeseriesResponse } from './layer3/layer3'; +import { + Layer3, + Layer3SummaryV2Params, + Layer3SummaryV2Response, + Layer3TimeseriesGroupsV2Params, + Layer3TimeseriesGroupsV2Response, + Layer3TimeseriesParams, + Layer3TimeseriesResponse, +} from './layer3/layer3'; import * as Layer7API from './layer7/layer7'; -import { Layer7, Layer7TimeseriesParams, Layer7TimeseriesResponse } from './layer7/layer7'; +import { + Layer7, + Layer7SummaryV2Params, + Layer7SummaryV2Response, + Layer7TimeseriesGroupsV2Params, + Layer7TimeseriesGroupsV2Response, + Layer7TimeseriesParams, + Layer7TimeseriesResponse, +} from './layer7/layer7'; export class Attacks extends APIResource { layer3: Layer3API.Layer3 = new Layer3API.Layer3(this._client); @@ -17,13 +33,21 @@ Attacks.Layer7 = Layer7; export declare namespace Attacks { export { Layer3 as Layer3, + type Layer3SummaryV2Response as Layer3SummaryV2Response, type Layer3TimeseriesResponse as Layer3TimeseriesResponse, + type Layer3TimeseriesGroupsV2Response as Layer3TimeseriesGroupsV2Response, + type Layer3SummaryV2Params as Layer3SummaryV2Params, type Layer3TimeseriesParams as Layer3TimeseriesParams, + type Layer3TimeseriesGroupsV2Params as Layer3TimeseriesGroupsV2Params, }; export { Layer7 as Layer7, + type Layer7SummaryV2Response as Layer7SummaryV2Response, type Layer7TimeseriesResponse as Layer7TimeseriesResponse, + type Layer7TimeseriesGroupsV2Response as Layer7TimeseriesGroupsV2Response, + type Layer7SummaryV2Params as Layer7SummaryV2Params, type Layer7TimeseriesParams as Layer7TimeseriesParams, + type Layer7TimeseriesGroupsV2Params as Layer7TimeseriesGroupsV2Params, }; } diff --git a/src/resources/radar/attacks/index.ts b/src/resources/radar/attacks/index.ts index 28216f9bd4..5ff5753f57 100644 --- a/src/resources/radar/attacks/index.ts +++ b/src/resources/radar/attacks/index.ts @@ -1,5 +1,21 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Attacks } from './attacks'; -export { Layer3, type Layer3TimeseriesResponse, type Layer3TimeseriesParams } from './layer3/index'; -export { Layer7, type Layer7TimeseriesResponse, type Layer7TimeseriesParams } from './layer7/index'; +export { + Layer3, + type Layer3SummaryV2Response, + type Layer3TimeseriesResponse, + type Layer3TimeseriesGroupsV2Response, + type Layer3SummaryV2Params, + type Layer3TimeseriesParams, + type Layer3TimeseriesGroupsV2Params, +} from './layer3/index'; +export { + Layer7, + type Layer7SummaryV2Response, + type Layer7TimeseriesResponse, + type Layer7TimeseriesGroupsV2Response, + type Layer7SummaryV2Params, + type Layer7TimeseriesParams, + type Layer7TimeseriesGroupsV2Params, +} from './layer7/index'; diff --git a/src/resources/radar/attacks/layer3/index.ts b/src/resources/radar/attacks/layer3/index.ts index aea57a5a87..5cda25b111 100644 --- a/src/resources/radar/attacks/layer3/index.ts +++ b/src/resources/radar/attacks/layer3/index.ts @@ -1,6 +1,14 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Layer3, type Layer3TimeseriesResponse, type Layer3TimeseriesParams } from './layer3'; +export { + Layer3, + type Layer3SummaryV2Response, + type Layer3TimeseriesResponse, + type Layer3TimeseriesGroupsV2Response, + type Layer3SummaryV2Params, + type Layer3TimeseriesParams, + type Layer3TimeseriesGroupsV2Params, +} from './layer3'; export { Summary, type SummaryBitrateResponse, diff --git a/src/resources/radar/attacks/layer3/layer3.ts b/src/resources/radar/attacks/layer3/layer3.ts index 3fcf323b99..673db07fec 100644 --- a/src/resources/radar/attacks/layer3/layer3.ts +++ b/src/resources/radar/attacks/layer3/layer3.ts @@ -57,6 +57,40 @@ export class Layer3 extends APIResource { ); top: TopAPI.Top = new TopAPI.Top(this._client); + /** + * Retrieves the distribution of layer 3 attacks by the specified dimension. + * + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.summaryV2('PROTOCOL'); + * ``` + */ + summaryV2( + dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', + query?: Layer3SummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', + query: Layer3SummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/attacks/layer3/summary/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: Layer3SummaryV2Response }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves layer 3 attacks over time. * @@ -84,6 +118,139 @@ export class Layer3 extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieves the distribution of layer 3 attacks grouped by dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.attacks.layer3.timeseriesGroupsV2( + * 'PROTOCOL', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', + query?: Layer3TimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'PROTOCOL' | 'IP_VERSION' | 'VECTOR' | 'DURATION' | 'BITRATE' | 'VERTICAL' | 'INDUSTRY', + query: Layer3TimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/attacks/layer3/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: Layer3TimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface Layer3SummaryV2Response { + /** + * Metadata for the results. + */ + meta: Layer3SummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace Layer3SummaryV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } } export interface Layer3TimeseriesResponse { @@ -199,6 +366,182 @@ export namespace Layer3TimeseriesResponse { } } +export interface Layer3TimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + meta: Layer3TimeseriesGroupsV2Response.Meta; + + serie_0: Layer3TimeseriesGroupsV2Response.Serie0; +} + +export namespace Layer3TimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface Layer3SummaryV2Params { + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Specifies whether the `location` filter applies to the source or target + * location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters the results by layer 3/4 protocol. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + export interface Layer3TimeseriesParams { /** * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). @@ -284,14 +627,97 @@ export interface Layer3TimeseriesParams { protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; } +export interface Layer3TimeseriesGroupsV2Params { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Specifies whether the `location` filter applies to the source or target + * location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; + + /** + * Filters the results by layer 3/4 protocol. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + Layer3.Summary = Summary; Layer3.TimeseriesGroups = TimeseriesGroups; Layer3.Top = Top; export declare namespace Layer3 { export { + type Layer3SummaryV2Response as Layer3SummaryV2Response, type Layer3TimeseriesResponse as Layer3TimeseriesResponse, + type Layer3TimeseriesGroupsV2Response as Layer3TimeseriesGroupsV2Response, + type Layer3SummaryV2Params as Layer3SummaryV2Params, type Layer3TimeseriesParams as Layer3TimeseriesParams, + type Layer3TimeseriesGroupsV2Params as Layer3TimeseriesGroupsV2Params, }; export { diff --git a/src/resources/radar/attacks/layer3/summary.ts b/src/resources/radar/attacks/layer3/summary.ts index 73ed7d7c70..869dd46727 100644 --- a/src/resources/radar/attacks/layer3/summary.ts +++ b/src/resources/radar/attacks/layer3/summary.ts @@ -8,11 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.bitrate(); - * ``` + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ bitrate( query?: SummaryBitrateParams, @@ -36,11 +32,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.duration(); - * ``` + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ duration( query?: SummaryDurationParams, @@ -64,11 +56,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.industry(); - * ``` + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ industry( query?: SummaryIndustryParams, @@ -92,11 +80,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.ipVersion(); - * ``` + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -120,11 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.protocol(); - * ``` + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ protocol( query?: SummaryProtocolParams, @@ -148,11 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.vector(); - * ``` + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ vector(query?: SummaryVectorParams, options?: Core.RequestOptions): Core.APIPromise; vector(options?: Core.RequestOptions): Core.APIPromise; @@ -173,11 +149,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.summary.vertical(); - * ``` + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer3/timeseries-groups.ts b/src/resources/radar/attacks/layer3/timeseries-groups.ts index 740bb97cae..622eb83d71 100644 --- a/src/resources/radar/attacks/layer3/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer3/timeseries-groups.ts @@ -8,11 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.bitrate(); - * ``` + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ bitrate( query?: TimeseriesGroupBitrateParams, @@ -37,11 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by duration over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.duration(); - * ``` + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ duration( query?: TimeseriesGroupDurationParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted industry over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.industry(); - * ``` + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ industry( query?: TimeseriesGroupIndustryParams, @@ -95,11 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.ipVersion(); - * ``` + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by protocol over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.protocol(); - * ``` + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ protocol( query?: TimeseriesGroupProtocolParams, @@ -153,11 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by vector over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.vector(); - * ``` + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ vector( query?: TimeseriesGroupVectorParams, @@ -182,11 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by targeted vertical over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer3.timeseriesGroups.vertical(); - * ``` + * @deprecated Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead. */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer3/top/top.ts b/src/resources/radar/attacks/layer3/top/top.ts index 2da56402ce..e8e5c6b5b8 100644 --- a/src/resources/radar/attacks/layer3/top/top.ts +++ b/src/resources/radar/attacks/layer3/top/top.ts @@ -47,7 +47,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by industry endpoint. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ industry(query?: TopIndustryParams, options?: Core.RequestOptions): Core.APIPromise; industry(options?: Core.RequestOptions): Core.APIPromise; @@ -69,7 +69,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by vertical endpoint. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead. */ vertical(query?: TopVerticalParams, options?: Core.RequestOptions): Core.APIPromise; vertical(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/attacks/layer7/index.ts b/src/resources/radar/attacks/layer7/index.ts index ea12e3b31d..20456df07c 100644 --- a/src/resources/radar/attacks/layer7/index.ts +++ b/src/resources/radar/attacks/layer7/index.ts @@ -1,6 +1,14 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Layer7, type Layer7TimeseriesResponse, type Layer7TimeseriesParams } from './layer7'; +export { + Layer7, + type Layer7SummaryV2Response, + type Layer7TimeseriesResponse, + type Layer7TimeseriesGroupsV2Response, + type Layer7SummaryV2Params, + type Layer7TimeseriesParams, + type Layer7TimeseriesGroupsV2Params, +} from './layer7'; export { Summary, type SummaryHTTPMethodResponse, diff --git a/src/resources/radar/attacks/layer7/layer7.ts b/src/resources/radar/attacks/layer7/layer7.ts index 633b50c1a5..b997d1b7f5 100644 --- a/src/resources/radar/attacks/layer7/layer7.ts +++ b/src/resources/radar/attacks/layer7/layer7.ts @@ -57,6 +57,63 @@ export class Layer7 extends APIResource { ); top: TopAPI.Top = new TopAPI.Top(this._client); + /** + * Retrieves the distribution of layer 7 attacks by the specified dimension. + * + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.summaryV2( + * 'HTTP_METHOD', + * ); + * ``` + */ + summaryV2( + dimension: + | 'HTTP_METHOD' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'MANAGED_RULES' + | 'MITIGATION_PRODUCT' + | 'VERTICAL' + | 'INDUSTRY', + query?: Layer7SummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'HTTP_METHOD' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'MANAGED_RULES' + | 'MITIGATION_PRODUCT' + | 'VERTICAL' + | 'INDUSTRY', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'HTTP_METHOD' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'MANAGED_RULES' + | 'MITIGATION_PRODUCT' + | 'VERTICAL' + | 'INDUSTRY', + query: Layer7SummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/attacks/layer7/summary/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: Layer7SummaryV2Response }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves layer 7 attacks over time. * @@ -84,6 +141,160 @@ export class Layer7 extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieves the distribution of layer 7 attacks grouped by dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.attacks.layer7.timeseriesGroupsV2( + * 'HTTP_METHOD', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: + | 'HTTP_METHOD' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'MANAGED_RULES' + | 'MITIGATION_PRODUCT' + | 'VERTICAL' + | 'INDUSTRY', + query?: Layer7TimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'HTTP_METHOD' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'MANAGED_RULES' + | 'MITIGATION_PRODUCT' + | 'VERTICAL' + | 'INDUSTRY', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'HTTP_METHOD' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'MANAGED_RULES' + | 'MITIGATION_PRODUCT' + | 'VERTICAL' + | 'INDUSTRY', + query: Layer7TimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/attacks/layer7/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: Layer7TimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface Layer7SummaryV2Response { + /** + * Metadata for the results. + */ + meta: Layer7SummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace Layer7SummaryV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } } export interface Layer7TimeseriesResponse { @@ -196,6 +407,249 @@ export namespace Layer7TimeseriesResponse { } } +export interface Layer7TimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + meta: Layer7TimeseriesGroupsV2Response.Meta; + + serie_0: Layer7TimeseriesGroupsV2Response.Serie0; +} + +export namespace Layer7TimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface Layer7SummaryV2Params { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by HTTP method. + */ + httpMethod?: Array< + | 'GET' + | 'POST' + | 'DELETE' + | 'PUT' + | 'HEAD' + | 'PURGE' + | 'OPTIONS' + | 'PROPFIND' + | 'MKCOL' + | 'PATCH' + | 'ACL' + | 'BCOPY' + | 'BDELETE' + | 'BMOVE' + | 'BPROPFIND' + | 'BPROPPATCH' + | 'CHECKIN' + | 'CHECKOUT' + | 'CONNECT' + | 'COPY' + | 'LABEL' + | 'LOCK' + | 'MERGE' + | 'MKACTIVITY' + | 'MKWORKSPACE' + | 'MOVE' + | 'NOTIFY' + | 'ORDERPATCH' + | 'POLL' + | 'PROPPATCH' + | 'REPORT' + | 'SEARCH' + | 'SUBSCRIBE' + | 'TRACE' + | 'UNCHECKOUT' + | 'UNLOCK' + | 'UNSUBSCRIBE' + | 'UPDATE' + | 'VERSIONCONTROL' + | 'BASELINECONTROL' + | 'XMSENUMATTS' + | 'RPC_OUT_DATA' + | 'RPC_IN_DATA' + | 'JSON' + | 'COOK' + | 'TRACK' + >; + + /** + * Filters results by HTTP version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Filters the results by layer 7 mitigation product. + */ + mitigationProduct?: Array< + | 'DDOS' + | 'WAF' + | 'BOT_MANAGEMENT' + | 'ACCESS_RULES' + | 'IP_REPUTATION' + | 'API_SHIELD' + | 'DATA_LOSS_PREVENTION' + >; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + export interface Layer7TimeseriesParams { /** * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). @@ -335,14 +789,164 @@ export interface Layer7TimeseriesParams { normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; } +export interface Layer7TimeseriesGroupsV2Params { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by HTTP method. + */ + httpMethod?: Array< + | 'GET' + | 'POST' + | 'DELETE' + | 'PUT' + | 'HEAD' + | 'PURGE' + | 'OPTIONS' + | 'PROPFIND' + | 'MKCOL' + | 'PATCH' + | 'ACL' + | 'BCOPY' + | 'BDELETE' + | 'BMOVE' + | 'BPROPFIND' + | 'BPROPPATCH' + | 'CHECKIN' + | 'CHECKOUT' + | 'CONNECT' + | 'COPY' + | 'LABEL' + | 'LOCK' + | 'MERGE' + | 'MKACTIVITY' + | 'MKWORKSPACE' + | 'MOVE' + | 'NOTIFY' + | 'ORDERPATCH' + | 'POLL' + | 'PROPPATCH' + | 'REPORT' + | 'SEARCH' + | 'SUBSCRIBE' + | 'TRACE' + | 'UNCHECKOUT' + | 'UNLOCK' + | 'UNSUBSCRIBE' + | 'UPDATE' + | 'VERSIONCONTROL' + | 'BASELINECONTROL' + | 'XMSENUMATTS' + | 'RPC_OUT_DATA' + | 'RPC_IN_DATA' + | 'JSON' + | 'COOK' + | 'TRACK' + >; + + /** + * Filters results by HTTP version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Filters the results by layer 7 mitigation product. + */ + mitigationProduct?: Array< + | 'DDOS' + | 'WAF' + | 'BOT_MANAGEMENT' + | 'ACCESS_RULES' + | 'IP_REPUTATION' + | 'API_SHIELD' + | 'DATA_LOSS_PREVENTION' + >; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; +} + Layer7.Summary = Summary; Layer7.TimeseriesGroups = TimeseriesGroups; Layer7.Top = Top; export declare namespace Layer7 { export { + type Layer7SummaryV2Response as Layer7SummaryV2Response, type Layer7TimeseriesResponse as Layer7TimeseriesResponse, + type Layer7TimeseriesGroupsV2Response as Layer7TimeseriesGroupsV2Response, + type Layer7SummaryV2Params as Layer7SummaryV2Params, type Layer7TimeseriesParams as Layer7TimeseriesParams, + type Layer7TimeseriesGroupsV2Params as Layer7TimeseriesGroupsV2Params, }; export { diff --git a/src/resources/radar/attacks/layer7/summary.ts b/src/resources/radar/attacks/layer7/summary.ts index 4afa3d68d0..3d4b27fb58 100644 --- a/src/resources/radar/attacks/layer7/summary.ts +++ b/src/resources/radar/attacks/layer7/summary.ts @@ -8,11 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.httpMethod(); - * ``` + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ httpMethod( query?: SummaryHTTPMethodParams, @@ -37,11 +33,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.httpVersion(); - * ``` + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ httpVersion( query?: SummaryHTTPVersionParams, @@ -66,11 +58,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.industry(); - * ``` + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ industry( query?: SummaryIndustryParams, @@ -94,11 +82,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.ipVersion(); - * ``` + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -122,11 +106,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.managedRules(); - * ``` + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ managedRules( query?: SummaryManagedRulesParams, @@ -151,11 +131,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.mitigationProduct(); - * ``` + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ mitigationProduct( query?: SummaryMitigationProductParams, @@ -180,11 +156,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.summary.vertical(); - * ``` + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ vertical( query?: SummaryVerticalParams, diff --git a/src/resources/radar/attacks/layer7/timeseries-groups.ts b/src/resources/radar/attacks/layer7/timeseries-groups.ts index ab7e962788..ab5076ef90 100644 --- a/src/resources/radar/attacks/layer7/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer7/timeseries-groups.ts @@ -8,11 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP method over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.httpMethod(); - * ``` + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ httpMethod( query?: TimeseriesGroupHTTPMethodParams, @@ -37,11 +33,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by HTTP version over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.httpVersion(); - * ``` + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted industry over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.industry(); - * ``` + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ industry( query?: TimeseriesGroupIndustryParams, @@ -95,11 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by IP version used over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.ipVersion(); - * ``` + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by managed rules over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.managedRules(); - * ``` + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ managedRules( query?: TimeseriesGroupManagedRulesParams, @@ -153,11 +133,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by mitigation product over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.mitigationProduct(); - * ``` + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ mitigationProduct( query?: TimeseriesGroupMitigationProductParams, @@ -182,11 +158,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 7 attacks by targeted vertical over time. * - * @example - * ```ts - * const response = - * await client.radar.attacks.layer7.timeseriesGroups.vertical(); - * ``` + * @deprecated Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead. */ vertical( query?: TimeseriesGroupVerticalParams, diff --git a/src/resources/radar/attacks/layer7/top/top.ts b/src/resources/radar/attacks/layer7/top/top.ts index 74086112c2..1fa4d17fff 100644 --- a/src/resources/radar/attacks/layer7/top/top.ts +++ b/src/resources/radar/attacks/layer7/top/top.ts @@ -51,7 +51,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by industry endpoint. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ industry(query?: TopIndustryParams, options?: Core.RequestOptions): Core.APIPromise; industry(options?: Core.RequestOptions): Core.APIPromise; @@ -73,7 +73,7 @@ export class Top extends APIResource { * This endpoint is deprecated. To continue getting this data, switch to the * summary by vertical endpoint. * - * @deprecated + * @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead. */ vertical(query?: TopVerticalParams, options?: Core.RequestOptions): Core.APIPromise; vertical(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/bgp/hijacks/events.ts b/src/resources/radar/bgp/hijacks/events.ts index 10e427a591..d1f81f790b 100644 --- a/src/resources/radar/bgp/hijacks/events.ts +++ b/src/resources/radar/bgp/hijacks/events.ts @@ -155,9 +155,6 @@ export interface EventListParams extends V4PagePaginationParams { */ minConfidence?: number; - /** - * Network prefix, IPv4 or IPv6. - */ prefix?: string; /** diff --git a/src/resources/radar/bgp/routes.ts b/src/resources/radar/bgp/routes.ts index 6a67caeff7..4fd17648af 100644 --- a/src/resources/radar/bgp/routes.ts +++ b/src/resources/radar/bgp/routes.ts @@ -510,9 +510,6 @@ export interface RouteMoasParams { */ origin?: number; - /** - * Network prefix, IPv4 or IPv6. - */ prefix?: string; } @@ -533,9 +530,6 @@ export interface RoutePfx2asParams { */ origin?: number; - /** - * Network prefix, IPv4 or IPv6. - */ prefix?: string; /** @@ -550,9 +544,6 @@ export interface RouteRealtimeParams { */ format?: 'JSON' | 'CSV'; - /** - * Network prefix, IPv4 or IPv6. - */ prefix?: string; } diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts index 4ba71c4acf..829a017a4b 100644 --- a/src/resources/radar/ct/logs.ts +++ b/src/resources/radar/ct/logs.ts @@ -121,6 +121,12 @@ export namespace LogGetResponse { */ api: 'RFC6962' | 'STATIC'; + /** + * The average throughput of the CT log, measured in certificates per hour + * (certs/hour). + */ + avgThroughput: number; + /** * A brief description of the certificate log. */ @@ -131,6 +137,11 @@ export namespace LogGetResponse { */ endExclusive: string; + /** + * Timestamp of the most recent update to the CT log. + */ + lastUpdate: string; + /** * The organization responsible for operating the certificate log. */ @@ -168,6 +179,18 @@ export namespace LogGetResponse { */ stateTimestamp: string; + /** + * Number of certificates that are eligible for inclusion to this log but have not + * been included yet. Based on certificates signed by trusted root CAs within the + * log's accepted date range. + */ + submittableCertCount: string | null; + + /** + * Number of certificates already included in this CT log. + */ + submittedCertCount: string | null; + /** * The URL for the certificate log. */ diff --git a/src/resources/radar/dns/dns.ts b/src/resources/radar/dns/dns.ts index 8220269674..c5aab5eee2 100644 --- a/src/resources/radar/dns/dns.ts +++ b/src/resources/radar/dns/dns.ts @@ -61,6 +61,76 @@ export class DNS extends APIResource { this._client, ); + /** + * Retrieves the distribution of DNS queries by the specified dimension. + * + * @example + * ```ts + * const response = await client.radar.dns.summaryV2( + * 'IP_VERSION', + * ); + * ``` + */ + summaryV2( + dimension: + | 'IP_VERSION' + | 'CACHE_HIT' + | 'DNSSEC' + | 'DNSSEC_AWARE' + | 'DNSSEC_E2E' + | 'MATCHING_ANSWER' + | 'PROTOCOL' + | 'QUERY_TYPE' + | 'RESPONSE_CODE' + | 'RESPONSE_TTL' + | 'TLD' + | 'TLD_DNS_MAGNITUDE', + query?: DNSSummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'IP_VERSION' + | 'CACHE_HIT' + | 'DNSSEC' + | 'DNSSEC_AWARE' + | 'DNSSEC_E2E' + | 'MATCHING_ANSWER' + | 'PROTOCOL' + | 'QUERY_TYPE' + | 'RESPONSE_CODE' + | 'RESPONSE_TTL' + | 'TLD' + | 'TLD_DNS_MAGNITUDE', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'IP_VERSION' + | 'CACHE_HIT' + | 'DNSSEC' + | 'DNSSEC_AWARE' + | 'DNSSEC_E2E' + | 'MATCHING_ANSWER' + | 'PROTOCOL' + | 'QUERY_TYPE' + | 'RESPONSE_CODE' + | 'RESPONSE_TTL' + | 'TLD' + | 'TLD_DNS_MAGNITUDE', + query: DNSSummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/dns/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: DNSSummaryV2Response; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves normalized query volume to the 1.1.1.1 DNS resolver over time. * @@ -87,6 +157,171 @@ export class DNS extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieves the distribution of DNS queries grouped by dimension over time. + * + * @example + * ```ts + * const response = await client.radar.dns.timeseriesGroupsV2( + * 'IP_VERSION', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: + | 'IP_VERSION' + | 'CACHE_HIT' + | 'DNSSEC' + | 'DNSSEC_AWARE' + | 'DNSSEC_E2E' + | 'MATCHING_ANSWER' + | 'PROTOCOL' + | 'QUERY_TYPE' + | 'RESPONSE_CODE' + | 'RESPONSE_TTL' + | 'TLD', + query?: DNSTimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'IP_VERSION' + | 'CACHE_HIT' + | 'DNSSEC' + | 'DNSSEC_AWARE' + | 'DNSSEC_E2E' + | 'MATCHING_ANSWER' + | 'PROTOCOL' + | 'QUERY_TYPE' + | 'RESPONSE_CODE' + | 'RESPONSE_TTL' + | 'TLD', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'IP_VERSION' + | 'CACHE_HIT' + | 'DNSSEC' + | 'DNSSEC_AWARE' + | 'DNSSEC_E2E' + | 'MATCHING_ANSWER' + | 'PROTOCOL' + | 'QUERY_TYPE' + | 'RESPONSE_CODE' + | 'RESPONSE_TTL' + | 'TLD', + query: DNSTimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/dns/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: DNSTimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface DNSSummaryV2Response { + /** + * Metadata for the results. + */ + meta: DNSSummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace DNSSummaryV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } } export interface DNSTimeseriesResponse { @@ -202,14 +437,117 @@ export namespace DNSTimeseriesResponse { } } -export interface DNSTimeseriesParams { +export interface DNSTimeseriesGroupsV2Response { /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + * Metadata for the results. */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; + meta: DNSTimeseriesGroupsV2Response.Meta; + + serie_0: DNSTimeseriesGroupsV2Response.Serie0; +} + +export namespace DNSTimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} +export interface DNSSummaryV2Params { /** * Filters results by Autonomous System. Specify one or more Autonomous System * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from @@ -218,6 +556,11 @@ export interface DNSTimeseriesParams { */ asn?: Array; + /** + * Filters results based on cache status. + */ + cacheHit?: Array; + /** * Filters results by continent. Specify a comma-separated list of alpha-2 codes. * Prefix with `-` to exclude continents from results. For example, `-EU,NA` @@ -242,11 +585,38 @@ export interface DNSTimeseriesParams { */ dateStart?: Array; + /** + * Filters results based on DNSSEC (DNS Security Extensions) support. + */ + dnssec?: Array<'INVALID' | 'INSECURE' | 'SECURE' | 'OTHER'>; + + /** + * Filters results based on DNSSEC (DNS Security Extensions) client awareness. + */ + dnssecAware?: Array<'SUPPORTED' | 'NOT_SUPPORTED'>; + + /** + * Filters results based on DNSSEC-validated answers by end-to-end security status. + */ + dnssecE2e?: Array; + /** * Format in which results will be returned. */ format?: 'JSON' | 'CSV'; + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + /** * Filters results by location. Specify a comma-separated list of alpha-2 codes. * Prefix with `-` to exclude locations from results. For example, `-US,PT` @@ -254,6 +624,11 @@ export interface DNSTimeseriesParams { */ location?: Array; + /** + * Filters results based on whether the queries have a matching answer. + */ + matchingAnswer?: Array; + /** * Array of names used to label the series in the response. */ @@ -262,17 +637,17 @@ export interface DNSTimeseriesParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -361,12 +736,13 @@ export interface DNSTimeseriesParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -385,10 +761,491 @@ export interface DNSTimeseriesParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; + + /** + * Filters results by DNS response TTL. + */ + responseTtl?: Array< + 'LTE_1M' | 'GT_1M_LTE_5M' | 'GT_5M_LTE_15M' | 'GT_15M_LTE_1H' | 'GT_1H_LTE_1D' | 'GT_1D_LTE_1W' | 'GT_1W' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; +} + +export interface DNSTimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results based on cache status. + */ + cacheHit?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results based on DNSSEC (DNS Security Extensions) support. + */ + dnssec?: Array<'INVALID' | 'INSECURE' | 'SECURE' | 'OTHER'>; + + /** + * Filters results based on DNSSEC (DNS Security Extensions) client awareness. + */ + dnssecAware?: Array<'SUPPORTED' | 'NOT_SUPPORTED'>; + + /** + * Filters results based on DNSSEC-validated answers by end-to-end security status. + */ + dnssecE2e?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Filters results based on whether the queries have a matching answer. + */ + matchingAnswer?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Specifies whether the response includes empty DNS responses (NODATA). + */ + nodata?: Array; + + /** + * Filters results by DNS transport protocol. + */ + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; + + /** + * Filters results by DNS query type. + */ + queryType?: Array< + | 'A' + | 'AAAA' + | 'A6' + | 'AFSDB' + | 'ANY' + | 'APL' + | 'ATMA' + | 'AXFR' + | 'CAA' + | 'CDNSKEY' + | 'CDS' + | 'CERT' + | 'CNAME' + | 'CSYNC' + | 'DHCID' + | 'DLV' + | 'DNAME' + | 'DNSKEY' + | 'DOA' + | 'DS' + | 'EID' + | 'EUI48' + | 'EUI64' + | 'GPOS' + | 'GID' + | 'HINFO' + | 'HIP' + | 'HTTPS' + | 'IPSECKEY' + | 'ISDN' + | 'IXFR' + | 'KEY' + | 'KX' + | 'L32' + | 'L64' + | 'LOC' + | 'LP' + | 'MAILA' + | 'MAILB' + | 'MB' + | 'MD' + | 'MF' + | 'MG' + | 'MINFO' + | 'MR' + | 'MX' + | 'NAPTR' + | 'NB' + | 'NBSTAT' + | 'NID' + | 'NIMLOC' + | 'NINFO' + | 'NS' + | 'NSAP' + | 'NSEC' + | 'NSEC3' + | 'NSEC3PARAM' + | 'NULL' + | 'NXT' + | 'OPENPGPKEY' + | 'OPT' + | 'PTR' + | 'PX' + | 'RKEY' + | 'RP' + | 'RRSIG' + | 'RT' + | 'SIG' + | 'SINK' + | 'SMIMEA' + | 'SOA' + | 'SPF' + | 'SRV' + | 'SSHFP' + | 'SVCB' + | 'TA' + | 'TALINK' + | 'TKEY' + | 'TLSA' + | 'TSIG' + | 'TXT' + | 'UINFO' + | 'UID' + | 'UNSPEC' + | 'URI' + | 'WKS' + | 'X25' + | 'ZONEMD' + | null + >; + + /** + * Filters results by DNS response code. + */ + responseCode?: Array< + | 'NOERROR' + | 'FORMERR' + | 'SERVFAIL' + | 'NXDOMAIN' + | 'NOTIMP' + | 'REFUSED' + | 'YXDOMAIN' + | 'YXRRSET' + | 'NXRRSET' + | 'NOTAUTH' + | 'NOTZONE' + | 'BADSIG' + | 'BADKEY' + | 'BADTIME' + | 'BADMODE' + | 'BADNAME' + | 'BADALG' + | 'BADTRUNC' + | 'BADCOOKIE' + >; + + /** + * Filters results by DNS response TTL. + */ + responseTtl?: Array< + 'LTE_1M' | 'GT_1M_LTE_5M' | 'GT_5M_LTE_15M' | 'GT_15M_LTE_1H' | 'GT_1H_LTE_1D' | 'GT_1D_LTE_1W' | 'GT_1W' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; +} + +export interface DNSTimeseriesGroupsV2Params { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results based on cache status. + */ + cacheHit?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results based on DNSSEC (DNS Security Extensions) support. + */ + dnssec?: Array<'INVALID' | 'INSECURE' | 'SECURE' | 'OTHER'>; + + /** + * Filters results based on DNSSEC (DNS Security Extensions) client awareness. + */ + dnssecAware?: Array<'SUPPORTED' | 'NOT_SUPPORTED'>; + + /** + * Filters results based on DNSSEC-validated answers by end-to-end security status. + */ + dnssecE2e?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Filters results based on whether the queries have a matching answer. + */ + matchingAnswer?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Specifies whether the response includes empty DNS responses (NODATA). + */ + nodata?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; + + /** + * Filters results by DNS transport protocol. + */ + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; + + /** + * Filters results by DNS query type. + */ + queryType?: Array< + | 'A' + | 'AAAA' + | 'A6' + | 'AFSDB' + | 'ANY' + | 'APL' + | 'ATMA' + | 'AXFR' + | 'CAA' + | 'CDNSKEY' + | 'CDS' + | 'CERT' + | 'CNAME' + | 'CSYNC' + | 'DHCID' + | 'DLV' + | 'DNAME' + | 'DNSKEY' + | 'DOA' + | 'DS' + | 'EID' + | 'EUI48' + | 'EUI64' + | 'GPOS' + | 'GID' + | 'HINFO' + | 'HIP' + | 'HTTPS' + | 'IPSECKEY' + | 'ISDN' + | 'IXFR' + | 'KEY' + | 'KX' + | 'L32' + | 'L64' + | 'LOC' + | 'LP' + | 'MAILA' + | 'MAILB' + | 'MB' + | 'MD' + | 'MF' + | 'MG' + | 'MINFO' + | 'MR' + | 'MX' + | 'NAPTR' + | 'NB' + | 'NBSTAT' + | 'NID' + | 'NIMLOC' + | 'NINFO' + | 'NS' + | 'NSAP' + | 'NSEC' + | 'NSEC3' + | 'NSEC3PARAM' + | 'NULL' + | 'NXT' + | 'OPENPGPKEY' + | 'OPT' + | 'PTR' + | 'PX' + | 'RKEY' + | 'RP' + | 'RRSIG' + | 'RT' + | 'SIG' + | 'SINK' + | 'SMIMEA' + | 'SOA' + | 'SPF' + | 'SRV' + | 'SSHFP' + | 'SVCB' + | 'TA' + | 'TALINK' + | 'TKEY' + | 'TLSA' + | 'TSIG' + | 'TXT' + | 'UINFO' + | 'UID' + | 'UNSPEC' + | 'URI' + | 'WKS' + | 'X25' + | 'ZONEMD' + | null + >; + + /** + * Filters results by DNS response code. + */ + responseCode?: Array< + | 'NOERROR' + | 'FORMERR' + | 'SERVFAIL' + | 'NXDOMAIN' + | 'NOTIMP' + | 'REFUSED' + | 'YXDOMAIN' + | 'YXRRSET' + | 'NXRRSET' + | 'NOTAUTH' + | 'NOTZONE' + | 'BADSIG' + | 'BADKEY' + | 'BADTIME' + | 'BADMODE' + | 'BADNAME' + | 'BADALG' + | 'BADTRUNC' + | 'BADCOOKIE' + >; + + /** + * Filters results by DNS response TTL. + */ + responseTtl?: Array< + 'LTE_1M' | 'GT_1M_LTE_5M' | 'GT_5M_LTE_15M' | 'GT_15M_LTE_1H' | 'GT_1H_LTE_1D' | 'GT_1D_LTE_1W' | 'GT_1W' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -399,8 +1256,12 @@ DNS.TimeseriesGroups = TimeseriesGroups; export declare namespace DNS { export { + type DNSSummaryV2Response as DNSSummaryV2Response, type DNSTimeseriesResponse as DNSTimeseriesResponse, + type DNSTimeseriesGroupsV2Response as DNSTimeseriesGroupsV2Response, + type DNSSummaryV2Params as DNSSummaryV2Params, type DNSTimeseriesParams as DNSTimeseriesParams, + type DNSTimeseriesGroupsV2Params as DNSTimeseriesGroupsV2Params, }; export { diff --git a/src/resources/radar/dns/index.ts b/src/resources/radar/dns/index.ts index 5254679872..d86325efb1 100644 --- a/src/resources/radar/dns/index.ts +++ b/src/resources/radar/dns/index.ts @@ -1,6 +1,14 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns'; +export { + DNS, + type DNSSummaryV2Response, + type DNSTimeseriesResponse, + type DNSTimeseriesGroupsV2Response, + type DNSSummaryV2Params, + type DNSTimeseriesParams, + type DNSTimeseriesGroupsV2Params, +} from './dns'; export { Summary, type SummaryCacheHitResponse, diff --git a/src/resources/radar/dns/summary.ts b/src/resources/radar/dns/summary.ts index 9bc87aa1f9..e0bfffe069 100644 --- a/src/resources/radar/dns/summary.ts +++ b/src/resources/radar/dns/summary.ts @@ -8,10 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by cache status. * - * @example - * ```ts - * const response = await client.radar.dns.summary.cacheHit(); - * ``` + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ cacheHit( query?: SummaryCacheHitParams, @@ -36,10 +33,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support. * - * @example - * ```ts - * const response = await client.radar.dns.summary.dnssec(); - * ``` + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; @@ -61,11 +55,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.dnssecAware(); - * ``` + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ dnssecAware( query?: SummaryDNSSECAwareParams, @@ -90,10 +80,7 @@ export class Summary extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status. * - * @example - * ```ts - * const response = await client.radar.dns.summary.dnssecE2E(); - * ``` + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ dnssecE2E( query?: SummaryDNSSECE2EParams, @@ -117,10 +104,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by IP version. * - * @example - * ```ts - * const response = await client.radar.dns.summary.ipVersion(); - * ``` + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -144,11 +128,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.matchingAnswer(); - * ``` + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ matchingAnswer( query?: SummaryMatchingAnswerParams, @@ -172,10 +152,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol. * - * @example - * ```ts - * const response = await client.radar.dns.summary.protocol(); - * ``` + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ protocol( query?: SummaryProtocolParams, @@ -199,10 +176,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by type. * - * @example - * ```ts - * const response = await client.radar.dns.summary.queryType(); - * ``` + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ queryType( query?: SummaryQueryTypeParams, @@ -226,11 +200,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by response code. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.responseCode(); - * ``` + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ responseCode( query?: SummaryResponseCodeParams, @@ -254,11 +224,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of DNS queries by minimum response TTL. * - * @example - * ```ts - * const response = - * await client.radar.dns.summary.responseTTL(); - * ``` + * @deprecated Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead. */ responseTTL( query?: SummaryResponseTTLParams, @@ -1444,17 +1410,17 @@ export interface SummaryCacheHitParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1543,12 +1509,13 @@ export interface SummaryCacheHitParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1567,10 +1534,11 @@ export interface SummaryCacheHitParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -1628,17 +1596,17 @@ export interface SummaryDNSSECParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1727,12 +1695,13 @@ export interface SummaryDNSSECParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1751,10 +1720,11 @@ export interface SummaryDNSSECParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -1812,17 +1782,17 @@ export interface SummaryDNSSECAwareParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1911,12 +1881,13 @@ export interface SummaryDNSSECAwareParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1935,10 +1906,11 @@ export interface SummaryDNSSECAwareParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -1996,17 +1968,17 @@ export interface SummaryDNSSECE2EParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2095,12 +2067,13 @@ export interface SummaryDNSSECE2EParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2119,10 +2092,11 @@ export interface SummaryDNSSECE2EParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2180,17 +2154,17 @@ export interface SummaryIPVersionParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2279,12 +2253,13 @@ export interface SummaryIPVersionParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2303,10 +2278,11 @@ export interface SummaryIPVersionParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2364,17 +2340,17 @@ export interface SummaryMatchingAnswerParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2463,12 +2439,13 @@ export interface SummaryMatchingAnswerParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2487,10 +2464,11 @@ export interface SummaryMatchingAnswerParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2548,12 +2526,12 @@ export interface SummaryProtocolParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2642,12 +2620,13 @@ export interface SummaryProtocolParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2666,10 +2645,11 @@ export interface SummaryProtocolParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2734,17 +2714,17 @@ export interface SummaryQueryTypeParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2763,10 +2743,11 @@ export interface SummaryQueryTypeParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2831,17 +2812,17 @@ export interface SummaryResponseCodeParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2930,10 +2911,11 @@ export interface SummaryResponseCodeParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2991,17 +2973,17 @@ export interface SummaryResponseTTLParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -3090,12 +3072,13 @@ export interface SummaryResponseTTLParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -3114,10 +3097,11 @@ export interface SummaryResponseTTLParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } diff --git a/src/resources/radar/dns/timeseries-groups.ts b/src/resources/radar/dns/timeseries-groups.ts index 9a242a93fb..e6e96ec514 100644 --- a/src/resources/radar/dns/timeseries-groups.ts +++ b/src/resources/radar/dns/timeseries-groups.ts @@ -8,11 +8,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by cache status over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.cacheHit(); - * ``` + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ cacheHit( query?: TimeseriesGroupCacheHitParams, @@ -37,11 +33,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) * support over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.dnssec(); - * ``` + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ dnssec( query?: TimeseriesGroupDNSSECParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) * client awareness over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.dnssecAware(); - * ``` + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ dnssecAware( query?: TimeseriesGroupDNSSECAwareParams, @@ -96,11 +84,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of DNSSEC-validated answers by end-to-end security * status over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.dnssecE2E(); - * ``` + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ dnssecE2E( query?: TimeseriesGroupDNSSECE2EParams, @@ -124,11 +108,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.ipVersion(); - * ``` + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -152,11 +132,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by matching answers over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.matchingAnswer(); - * ``` + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ matchingAnswer( query?: TimeseriesGroupMatchingAnswerParams, @@ -181,11 +157,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by DNS transport protocol over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.protocol(); - * ``` + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ protocol( query?: TimeseriesGroupProtocolParams, @@ -209,11 +181,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by type over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.queryType(); - * ``` + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ queryType( query?: TimeseriesGroupQueryTypeParams, @@ -237,11 +205,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by response code over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.responseCode(); - * ``` + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ responseCode( query?: TimeseriesGroupResponseCodeParams, @@ -266,11 +230,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of DNS queries by minimum answer TTL over time. * - * @example - * ```ts - * const response = - * await client.radar.dns.timeseriesGroups.responseTTL(); - * ``` + * @deprecated Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead. */ responseTTL( query?: TimeseriesGroupResponseTTLParams, @@ -1471,17 +1431,17 @@ export interface TimeseriesGroupCacheHitParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1570,12 +1530,13 @@ export interface TimeseriesGroupCacheHitParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1594,10 +1555,11 @@ export interface TimeseriesGroupCacheHitParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -1662,17 +1624,17 @@ export interface TimeseriesGroupDNSSECParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1761,12 +1723,13 @@ export interface TimeseriesGroupDNSSECParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1785,10 +1748,11 @@ export interface TimeseriesGroupDNSSECParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -1853,17 +1817,17 @@ export interface TimeseriesGroupDNSSECAwareParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -1952,12 +1916,13 @@ export interface TimeseriesGroupDNSSECAwareParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -1976,10 +1941,11 @@ export interface TimeseriesGroupDNSSECAwareParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2044,17 +2010,17 @@ export interface TimeseriesGroupDNSSECE2EParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2143,12 +2109,13 @@ export interface TimeseriesGroupDNSSECE2EParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2167,10 +2134,11 @@ export interface TimeseriesGroupDNSSECE2EParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2235,17 +2203,17 @@ export interface TimeseriesGroupIPVersionParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2334,12 +2302,13 @@ export interface TimeseriesGroupIPVersionParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2358,10 +2327,11 @@ export interface TimeseriesGroupIPVersionParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2426,17 +2396,17 @@ export interface TimeseriesGroupMatchingAnswerParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2525,12 +2495,13 @@ export interface TimeseriesGroupMatchingAnswerParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2549,10 +2520,11 @@ export interface TimeseriesGroupMatchingAnswerParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2617,12 +2589,12 @@ export interface TimeseriesGroupProtocolParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -2711,12 +2683,13 @@ export interface TimeseriesGroupProtocolParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2735,10 +2708,11 @@ export interface TimeseriesGroupProtocolParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2810,17 +2784,17 @@ export interface TimeseriesGroupQueryTypeParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -2839,10 +2813,11 @@ export interface TimeseriesGroupQueryTypeParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -2914,17 +2889,17 @@ export interface TimeseriesGroupResponseCodeParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -3013,10 +2988,11 @@ export interface TimeseriesGroupResponseCodeParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } @@ -3081,17 +3057,17 @@ export interface TimeseriesGroupResponseTTLParams { /** * Specifies whether the response includes empty DNS responses (NODATA). */ - nodata?: boolean; + nodata?: Array; /** * Filters results by DNS transport protocol. */ - protocol?: 'UDP' | 'TCP' | 'HTTPS' | 'TLS'; + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; /** * Filters results by DNS query type. */ - queryType?: + queryType?: Array< | 'A' | 'AAAA' | 'A6' @@ -3180,12 +3156,13 @@ export interface TimeseriesGroupResponseTTLParams { | 'WKS' | 'X25' | 'ZONEMD' - | null; + | null + >; /** * Filters results by DNS response code. */ - responseCode?: + responseCode?: Array< | 'NOERROR' | 'FORMERR' | 'SERVFAIL' @@ -3204,10 +3181,11 @@ export interface TimeseriesGroupResponseTTLParams { | 'BADNAME' | 'BADALG' | 'BADTRUNC' - | 'BADCOOKIE'; + | 'BADCOOKIE' + >; /** - * Filters results by country code top-level domain (ccTLD). + * Filters results by top-level domain. */ tld?: Array; } diff --git a/src/resources/radar/dns/top.ts b/src/resources/radar/dns/top.ts index fe0bd763d1..e3e8493770 100644 --- a/src/resources/radar/dns/top.ts +++ b/src/resources/radar/dns/top.ts @@ -280,6 +280,11 @@ export interface TopAsesParams { */ asn?: Array; + /** + * Filters results based on cache status. + */ + cacheHit?: Array; + /** * Filters results by continent. Specify a comma-separated list of alpha-2 codes. * Prefix with `-` to exclude continents from results. For example, `-EU,NA` @@ -304,6 +309,21 @@ export interface TopAsesParams { */ dateStart?: Array; + /** + * Filters results based on DNSSEC (DNS Security Extensions) support. + */ + dnssec?: Array<'INVALID' | 'INSECURE' | 'SECURE' | 'OTHER'>; + + /** + * Filters results based on DNSSEC (DNS Security Extensions) client awareness. + */ + dnssecAware?: Array<'SUPPORTED' | 'NOT_SUPPORTED'>; + + /** + * Filters results based on DNSSEC-validated answers by end-to-end security status. + */ + dnssecE2e?: Array; + /** * Filters results by domain name. */ @@ -314,6 +334,11 @@ export interface TopAsesParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + /** * Limits the number of objects returned in the response. */ @@ -326,10 +351,152 @@ export interface TopAsesParams { */ location?: Array; + /** + * Filters results based on whether the queries have a matching answer. + */ + matchingAnswer?: Array; + /** * Array of names used to label the series in the response. */ name?: Array; + + /** + * Specifies whether the response includes empty DNS responses (NODATA). + */ + nodata?: Array; + + /** + * Filters results by DNS transport protocol. + */ + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; + + /** + * Filters results by DNS query type. + */ + queryType?: Array< + | 'A' + | 'AAAA' + | 'A6' + | 'AFSDB' + | 'ANY' + | 'APL' + | 'ATMA' + | 'AXFR' + | 'CAA' + | 'CDNSKEY' + | 'CDS' + | 'CERT' + | 'CNAME' + | 'CSYNC' + | 'DHCID' + | 'DLV' + | 'DNAME' + | 'DNSKEY' + | 'DOA' + | 'DS' + | 'EID' + | 'EUI48' + | 'EUI64' + | 'GPOS' + | 'GID' + | 'HINFO' + | 'HIP' + | 'HTTPS' + | 'IPSECKEY' + | 'ISDN' + | 'IXFR' + | 'KEY' + | 'KX' + | 'L32' + | 'L64' + | 'LOC' + | 'LP' + | 'MAILA' + | 'MAILB' + | 'MB' + | 'MD' + | 'MF' + | 'MG' + | 'MINFO' + | 'MR' + | 'MX' + | 'NAPTR' + | 'NB' + | 'NBSTAT' + | 'NID' + | 'NIMLOC' + | 'NINFO' + | 'NS' + | 'NSAP' + | 'NSEC' + | 'NSEC3' + | 'NSEC3PARAM' + | 'NULL' + | 'NXT' + | 'OPENPGPKEY' + | 'OPT' + | 'PTR' + | 'PX' + | 'RKEY' + | 'RP' + | 'RRSIG' + | 'RT' + | 'SIG' + | 'SINK' + | 'SMIMEA' + | 'SOA' + | 'SPF' + | 'SRV' + | 'SSHFP' + | 'SVCB' + | 'TA' + | 'TALINK' + | 'TKEY' + | 'TLSA' + | 'TSIG' + | 'TXT' + | 'UINFO' + | 'UID' + | 'UNSPEC' + | 'URI' + | 'WKS' + | 'X25' + | 'ZONEMD' + | null + >; + + /** + * Filters results by DNS response code. + */ + responseCode?: Array< + | 'NOERROR' + | 'FORMERR' + | 'SERVFAIL' + | 'NXDOMAIN' + | 'NOTIMP' + | 'REFUSED' + | 'YXDOMAIN' + | 'YXRRSET' + | 'NXRRSET' + | 'NOTAUTH' + | 'NOTZONE' + | 'BADSIG' + | 'BADKEY' + | 'BADTIME' + | 'BADMODE' + | 'BADNAME' + | 'BADALG' + | 'BADTRUNC' + | 'BADCOOKIE' + >; + + /** + * Filters results by DNS response TTL. + */ + responseTtl?: Array< + 'LTE_1M' | 'GT_1M_LTE_5M' | 'GT_5M_LTE_15M' | 'GT_15M_LTE_1H' | 'GT_1H_LTE_1D' | 'GT_1D_LTE_1W' | 'GT_1W' + >; } export interface TopLocationsParams { @@ -341,6 +508,11 @@ export interface TopLocationsParams { */ asn?: Array; + /** + * Filters results based on cache status. + */ + cacheHit?: Array; + /** * Filters results by continent. Specify a comma-separated list of alpha-2 codes. * Prefix with `-` to exclude continents from results. For example, `-EU,NA` @@ -365,6 +537,21 @@ export interface TopLocationsParams { */ dateStart?: Array; + /** + * Filters results based on DNSSEC (DNS Security Extensions) support. + */ + dnssec?: Array<'INVALID' | 'INSECURE' | 'SECURE' | 'OTHER'>; + + /** + * Filters results based on DNSSEC (DNS Security Extensions) client awareness. + */ + dnssecAware?: Array<'SUPPORTED' | 'NOT_SUPPORTED'>; + + /** + * Filters results based on DNSSEC-validated answers by end-to-end security status. + */ + dnssecE2e?: Array; + /** * Filters results by domain name. */ @@ -375,6 +562,11 @@ export interface TopLocationsParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + /** * Limits the number of objects returned in the response. */ @@ -387,10 +579,157 @@ export interface TopLocationsParams { */ location?: Array; + /** + * Filters results based on whether the queries have a matching answer. + */ + matchingAnswer?: Array; + /** * Array of names used to label the series in the response. */ name?: Array; + + /** + * Specifies whether the response includes empty DNS responses (NODATA). + */ + nodata?: Array; + + /** + * Filters results by DNS transport protocol. + */ + protocol?: Array<'UDP' | 'TCP' | 'HTTPS' | 'TLS'>; + + /** + * Filters results by DNS query type. + */ + queryType?: Array< + | 'A' + | 'AAAA' + | 'A6' + | 'AFSDB' + | 'ANY' + | 'APL' + | 'ATMA' + | 'AXFR' + | 'CAA' + | 'CDNSKEY' + | 'CDS' + | 'CERT' + | 'CNAME' + | 'CSYNC' + | 'DHCID' + | 'DLV' + | 'DNAME' + | 'DNSKEY' + | 'DOA' + | 'DS' + | 'EID' + | 'EUI48' + | 'EUI64' + | 'GPOS' + | 'GID' + | 'HINFO' + | 'HIP' + | 'HTTPS' + | 'IPSECKEY' + | 'ISDN' + | 'IXFR' + | 'KEY' + | 'KX' + | 'L32' + | 'L64' + | 'LOC' + | 'LP' + | 'MAILA' + | 'MAILB' + | 'MB' + | 'MD' + | 'MF' + | 'MG' + | 'MINFO' + | 'MR' + | 'MX' + | 'NAPTR' + | 'NB' + | 'NBSTAT' + | 'NID' + | 'NIMLOC' + | 'NINFO' + | 'NS' + | 'NSAP' + | 'NSEC' + | 'NSEC3' + | 'NSEC3PARAM' + | 'NULL' + | 'NXT' + | 'OPENPGPKEY' + | 'OPT' + | 'PTR' + | 'PX' + | 'RKEY' + | 'RP' + | 'RRSIG' + | 'RT' + | 'SIG' + | 'SINK' + | 'SMIMEA' + | 'SOA' + | 'SPF' + | 'SRV' + | 'SSHFP' + | 'SVCB' + | 'TA' + | 'TALINK' + | 'TKEY' + | 'TLSA' + | 'TSIG' + | 'TXT' + | 'UINFO' + | 'UID' + | 'UNSPEC' + | 'URI' + | 'WKS' + | 'X25' + | 'ZONEMD' + | null + >; + + /** + * Filters results by DNS response code. + */ + responseCode?: Array< + | 'NOERROR' + | 'FORMERR' + | 'SERVFAIL' + | 'NXDOMAIN' + | 'NOTIMP' + | 'REFUSED' + | 'YXDOMAIN' + | 'YXRRSET' + | 'NXRRSET' + | 'NOTAUTH' + | 'NOTZONE' + | 'BADSIG' + | 'BADKEY' + | 'BADTIME' + | 'BADMODE' + | 'BADNAME' + | 'BADALG' + | 'BADTRUNC' + | 'BADCOOKIE' + >; + + /** + * Filters results by DNS response TTL. + */ + responseTtl?: Array< + 'LTE_1M' | 'GT_1M_LTE_5M' | 'GT_5M_LTE_15M' | 'GT_15M_LTE_1H' | 'GT_1H_LTE_1D' | 'GT_1D_LTE_1W' | 'GT_1W' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; } export declare namespace Top { diff --git a/src/resources/radar/email/email.ts b/src/resources/radar/email/email.ts index 460238da53..e490d29630 100644 --- a/src/resources/radar/email/email.ts +++ b/src/resources/radar/email/email.ts @@ -2,9 +2,21 @@ import { APIResource } from '../../../resource'; import * as RoutingAPI from './routing/routing'; -import { Routing } from './routing/routing'; +import { + Routing, + RoutingSummaryV2Params, + RoutingSummaryV2Response, + RoutingTimeseriesGroupsV2Params, + RoutingTimeseriesGroupsV2Response, +} from './routing/routing'; import * as SecurityAPI from './security/security'; -import { Security } from './security/security'; +import { + Security, + SecuritySummaryV2Params, + SecuritySummaryV2Response, + SecurityTimeseriesGroupsV2Params, + SecurityTimeseriesGroupsV2Response, +} from './security/security'; export class Email extends APIResource { routing: RoutingAPI.Routing = new RoutingAPI.Routing(this._client); @@ -42,7 +54,19 @@ Email.Security = Security; export declare namespace Email { export { type RadarEmailSeries as RadarEmailSeries, type RadarEmailSummary as RadarEmailSummary }; - export { Routing as Routing }; + export { + Routing as Routing, + type RoutingSummaryV2Response as RoutingSummaryV2Response, + type RoutingTimeseriesGroupsV2Response as RoutingTimeseriesGroupsV2Response, + type RoutingSummaryV2Params as RoutingSummaryV2Params, + type RoutingTimeseriesGroupsV2Params as RoutingTimeseriesGroupsV2Params, + }; - export { Security as Security }; + export { + Security as Security, + type SecuritySummaryV2Response as SecuritySummaryV2Response, + type SecurityTimeseriesGroupsV2Response as SecurityTimeseriesGroupsV2Response, + type SecuritySummaryV2Params as SecuritySummaryV2Params, + type SecurityTimeseriesGroupsV2Params as SecurityTimeseriesGroupsV2Params, + }; } diff --git a/src/resources/radar/email/index.ts b/src/resources/radar/email/index.ts index 0e113c2250..47de1d26d8 100644 --- a/src/resources/radar/email/index.ts +++ b/src/resources/radar/email/index.ts @@ -1,5 +1,17 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Email, type RadarEmailSeries, type RadarEmailSummary } from './email'; -export { Routing } from './routing/index'; -export { Security } from './security/index'; +export { + Routing, + type RoutingSummaryV2Response, + type RoutingTimeseriesGroupsV2Response, + type RoutingSummaryV2Params, + type RoutingTimeseriesGroupsV2Params, +} from './routing/index'; +export { + Security, + type SecuritySummaryV2Response, + type SecurityTimeseriesGroupsV2Response, + type SecuritySummaryV2Params, + type SecurityTimeseriesGroupsV2Params, +} from './security/index'; diff --git a/src/resources/radar/email/routing/index.ts b/src/resources/radar/email/routing/index.ts index a7447f6d0f..4e2cf69ee7 100644 --- a/src/resources/radar/email/routing/index.ts +++ b/src/resources/radar/email/routing/index.ts @@ -1,6 +1,12 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Routing } from './routing'; +export { + Routing, + type RoutingSummaryV2Response, + type RoutingTimeseriesGroupsV2Response, + type RoutingSummaryV2Params, + type RoutingTimeseriesGroupsV2Params, +} from './routing'; export { Summary, type SummaryARCResponse, diff --git a/src/resources/radar/email/routing/routing.ts b/src/resources/radar/email/routing/routing.ts index f4c5d68359..49efcfd36c 100644 --- a/src/resources/radar/email/routing/routing.ts +++ b/src/resources/radar/email/routing/routing.ts @@ -1,6 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../resource'; +import { isRequestOptions } from '../../../../core'; +import * as Core from '../../../../core'; import * as SummaryAPI from './summary'; import { Summary, @@ -39,12 +41,439 @@ export class Routing extends APIResource { timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( this._client, ); + + /** + * Retrieves the distribution of email routing metrics by the specified dimension. + * + * @example + * ```ts + * const response = await client.radar.email.routing.summaryV2( + * 'IP_VERSION', + * ); + * ``` + */ + summaryV2( + dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', + query?: RoutingSummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', + query: RoutingSummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/email/routing/summary/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: RoutingSummaryV2Response }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of email routing metrics grouped by dimension over + * time. + * + * @example + * ```ts + * const response = + * await client.radar.email.routing.timeseriesGroupsV2( + * 'IP_VERSION', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', + query?: RoutingTimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'IP_VERSION' | 'ENCRYPTED' | 'ARC' | 'DKIM' | 'DMARC' | 'SPF', + query: RoutingTimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/email/routing/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: RoutingTimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface RoutingSummaryV2Response { + /** + * Metadata for the results. + */ + meta: RoutingSummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace RoutingSummaryV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + +export interface RoutingTimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + meta: RoutingTimeseriesGroupsV2Response.Meta; + + serie_0: RoutingTimeseriesGroupsV2Response.Serie0; +} + +export namespace RoutingTimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface RoutingSummaryV2Params { + /** + * Filters results by ARC (Authenticated Received Chain) validation. + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by DKIM (DomainKeys Identified Mail) validation status. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by DMARC (Domain-based Message Authentication, Reporting and + * Conformance) validation status. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by encryption status (encrypted vs. not-encrypted). + */ + encrypted?: Array<'ENCRYPTED' | 'NOT_ENCRYPTED'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by SPF (Sender Policy Framework) validation status. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export interface RoutingTimeseriesGroupsV2Params { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by ARC (Authenticated Received Chain) validation. + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by DKIM (DomainKeys Identified Mail) validation status. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by DMARC (Domain-based Message Authentication, Reporting and + * Conformance) validation status. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by encryption status (encrypted vs. not-encrypted). + */ + encrypted?: Array<'ENCRYPTED' | 'NOT_ENCRYPTED'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by SPF (Sender Policy Framework) validation status. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; } Routing.Summary = Summary; Routing.TimeseriesGroups = TimeseriesGroups; export declare namespace Routing { + export { + type RoutingSummaryV2Response as RoutingSummaryV2Response, + type RoutingTimeseriesGroupsV2Response as RoutingTimeseriesGroupsV2Response, + type RoutingSummaryV2Params as RoutingSummaryV2Params, + type RoutingTimeseriesGroupsV2Params as RoutingTimeseriesGroupsV2Params, + }; + export { Summary as Summary, type SummaryARCResponse as SummaryARCResponse, diff --git a/src/resources/radar/email/routing/summary.ts b/src/resources/radar/email/routing/summary.ts index 4085dc05e9..3d29f93974 100644 --- a/src/resources/radar/email/routing/summary.ts +++ b/src/resources/radar/email/routing/summary.ts @@ -10,11 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.arc(); - * ``` + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -36,11 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.dkim(); - * ``` + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -62,11 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.dmarc(); - * ``` + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -88,11 +76,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted). * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.encrypted(); - * ``` + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ encrypted( query?: SummaryEncryptedParams, @@ -116,11 +100,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by IP version. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.ipVersion(); - * ``` + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -145,11 +125,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.summary.spf(); - * ``` + * @deprecated Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead. */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/email/routing/timeseries-groups.ts b/src/resources/radar/email/routing/timeseries-groups.ts index c398945534..4d12509309 100644 --- a/src/resources/radar/email/routing/timeseries-groups.ts +++ b/src/resources/radar/email/routing/timeseries-groups.ts @@ -10,11 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.arc(); - * ``` + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ arc( query?: TimeseriesGroupARCParams, @@ -40,11 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.dkim(); - * ``` + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ dkim( query?: TimeseriesGroupDKIMParams, @@ -70,11 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.dmarc(); - * ``` + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -100,11 +88,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by encryption status (encrypted vs. * not-encrypted) over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.encrypted(); - * ``` + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ encrypted( query?: TimeseriesGroupEncryptedParams, @@ -129,11 +113,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.ipVersion(); - * ``` + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -159,11 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @example - * ```ts - * const response = - * await client.radar.email.routing.timeseriesGroups.spf(); - * ``` + * @deprecated Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead. */ spf( query?: TimeseriesGroupSPFParams, diff --git a/src/resources/radar/email/security/index.ts b/src/resources/radar/email/security/index.ts index b48f43fb39..01cfb4dade 100644 --- a/src/resources/radar/email/security/index.ts +++ b/src/resources/radar/email/security/index.ts @@ -1,6 +1,12 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Security } from './security'; +export { + Security, + type SecuritySummaryV2Response, + type SecurityTimeseriesGroupsV2Response, + type SecuritySummaryV2Params, + type SecurityTimeseriesGroupsV2Params, +} from './security'; export { Summary, type SummaryARCResponse, diff --git a/src/resources/radar/email/security/security.ts b/src/resources/radar/email/security/security.ts index c1c1c5f337..a4b1700f96 100644 --- a/src/resources/radar/email/security/security.ts +++ b/src/resources/radar/email/security/security.ts @@ -1,6 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../resource'; +import { isRequestOptions } from '../../../../core'; +import * as Core from '../../../../core'; import * as SummaryAPI from './summary'; import { Summary, @@ -54,6 +56,469 @@ export class Security extends APIResource { timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( this._client, ); + + /** + * Retrieves the distribution of email security metrics by the specified dimension. + * + * @example + * ```ts + * const response = + * await client.radar.email.security.summaryV2('SPAM'); + * ``` + */ + summaryV2( + dimension: + | 'SPAM' + | 'MALICIOUS' + | 'SPOOF' + | 'THREAT_CATEGORY' + | 'ARC' + | 'DKIM' + | 'DMARC' + | 'SPF' + | 'TLS_VERSION', + query?: SecuritySummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'SPAM' + | 'MALICIOUS' + | 'SPOOF' + | 'THREAT_CATEGORY' + | 'ARC' + | 'DKIM' + | 'DMARC' + | 'SPF' + | 'TLS_VERSION', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'SPAM' + | 'MALICIOUS' + | 'SPOOF' + | 'THREAT_CATEGORY' + | 'ARC' + | 'DKIM' + | 'DMARC' + | 'SPF' + | 'TLS_VERSION', + query: SecuritySummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/email/security/summary/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: SecuritySummaryV2Response }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of email security metrics grouped by dimension over + * time. + * + * @example + * ```ts + * const response = + * await client.radar.email.security.timeseriesGroupsV2( + * 'SPAM', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: + | 'SPAM' + | 'MALICIOUS' + | 'SPOOF' + | 'THREAT_CATEGORY' + | 'ARC' + | 'DKIM' + | 'DMARC' + | 'SPF' + | 'TLS_VERSION', + query?: SecurityTimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'SPAM' + | 'MALICIOUS' + | 'SPOOF' + | 'THREAT_CATEGORY' + | 'ARC' + | 'DKIM' + | 'DMARC' + | 'SPF' + | 'TLS_VERSION', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'SPAM' + | 'MALICIOUS' + | 'SPOOF' + | 'THREAT_CATEGORY' + | 'ARC' + | 'DKIM' + | 'DMARC' + | 'SPF' + | 'TLS_VERSION', + query: SecurityTimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/email/security/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: SecurityTimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SecuritySummaryV2Response { + /** + * Metadata for the results. + */ + meta: SecuritySummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace SecuritySummaryV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + +export interface SecurityTimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + meta: SecurityTimeseriesGroupsV2Response.Meta; + + serie_0: SecurityTimeseriesGroupsV2Response.Serie0; +} + +export namespace SecurityTimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface SecuritySummaryV2Params { + /** + * Filters results by ARC (Authenticated Received Chain) validation. + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by DKIM (DomainKeys Identified Mail) validation status. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by DMARC (Domain-based Message Authentication, Reporting and + * Conformance) validation status. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by SPF (Sender Policy Framework) validation status. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by TLS version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3'>; +} + +export interface SecurityTimeseriesGroupsV2Params { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by ARC (Authenticated Received Chain) validation. + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by DKIM (DomainKeys Identified Mail) validation status. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by DMARC (Domain-based Message Authentication, Reporting and + * Conformance) validation status. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by SPF (Sender Policy Framework) validation status. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filters results by TLS version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3'>; } Security.Top = Top; @@ -61,6 +526,13 @@ Security.Summary = Summary; Security.TimeseriesGroups = TimeseriesGroups; export declare namespace Security { + export { + type SecuritySummaryV2Response as SecuritySummaryV2Response, + type SecurityTimeseriesGroupsV2Response as SecurityTimeseriesGroupsV2Response, + type SecuritySummaryV2Params as SecuritySummaryV2Params, + type SecurityTimeseriesGroupsV2Params as SecurityTimeseriesGroupsV2Params, + }; + export { Top as Top }; export { diff --git a/src/resources/radar/email/security/summary.ts b/src/resources/radar/email/security/summary.ts index 3a984c2f4f..c3432f9f36 100644 --- a/src/resources/radar/email/security/summary.ts +++ b/src/resources/radar/email/security/summary.ts @@ -10,11 +10,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.arc(); - * ``` + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ arc(query?: SummaryARCParams, options?: Core.RequestOptions): Core.APIPromise; arc(options?: Core.RequestOptions): Core.APIPromise; @@ -36,11 +32,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.dkim(); - * ``` + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; dkim(options?: Core.RequestOptions): Core.APIPromise; @@ -62,11 +54,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.dmarc(); - * ``` + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ dmarc(query?: SummaryDMARCParams, options?: Core.RequestOptions): Core.APIPromise; dmarc(options?: Core.RequestOptions): Core.APIPromise; @@ -87,11 +75,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by malicious classification. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.malicious(); - * ``` + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ malicious( query?: SummaryMaliciousParams, @@ -115,11 +99,7 @@ export class Summary extends APIResource { /** * Retrieves the proportion of emails by spam classification (spam vs. non-spam). * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.spam(); - * ``` + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ spam(query?: SummarySpamParams, options?: Core.RequestOptions): Core.APIPromise; spam(options?: Core.RequestOptions): Core.APIPromise; @@ -141,11 +121,7 @@ export class Summary extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) * validation. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.spf(); - * ``` + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; spf(options?: Core.RequestOptions): Core.APIPromise; @@ -167,11 +143,7 @@ export class Summary extends APIResource { * Retrieves the proportion of emails by spoof classification (spoof vs. * non-spoof). * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.spoof(); - * ``` + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ spoof(query?: SummarySpoofParams, options?: Core.RequestOptions): Core.APIPromise; spoof(options?: Core.RequestOptions): Core.APIPromise; @@ -192,11 +164,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by threat categories. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.threatCategory(); - * ``` + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ threatCategory( query?: SummaryThreatCategoryParams, @@ -221,11 +189,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of emails by TLS version. * - * @example - * ```ts - * const response = - * await client.radar.email.security.summary.tlsVersion(); - * ``` + * @deprecated Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead. */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/email/security/timeseries-groups.ts b/src/resources/radar/email/security/timeseries-groups.ts index 2fb9bbef99..9b33cf953e 100644 --- a/src/resources/radar/email/security/timeseries-groups.ts +++ b/src/resources/radar/email/security/timeseries-groups.ts @@ -10,11 +10,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by ARC (Authenticated Received Chain) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.arc(); - * ``` + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ arc( query?: TimeseriesGroupARCParams, @@ -40,11 +36,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) * validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.dkim(); - * ``` + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ dkim( query?: TimeseriesGroupDKIMParams, @@ -70,11 +62,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by DMARC (Domain-based Message * Authentication, Reporting and Conformance) validation over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.dmarc(); - * ``` + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ dmarc( query?: TimeseriesGroupDMARCParams, @@ -99,11 +87,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by malicious classification over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.malicious(); - * ``` + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ malicious( query?: TimeseriesGroupMaliciousParams, @@ -129,11 +113,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spam classification (spam vs. non-spam) * over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.spam(); - * ``` + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ spam( query?: TimeseriesGroupSpamParams, @@ -159,11 +139,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by SPF (Sender Policy Framework) validation * over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.spf(); - * ``` + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ spf( query?: TimeseriesGroupSPFParams, @@ -189,11 +165,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of emails by spoof classification (spoof vs. * non-spoof) over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.spoof(); - * ``` + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ spoof( query?: TimeseriesGroupSpoofParams, @@ -218,11 +190,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by threat category over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.threatCategory(); - * ``` + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ threatCategory( query?: TimeseriesGroupThreatCategoryParams, @@ -247,11 +215,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of emails by TLS version over time. * - * @example - * ```ts - * const response = - * await client.radar.email.security.timeseriesGroups.tlsVersion(); - * ``` + * @deprecated Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead. */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/entities/asns.ts b/src/resources/radar/entities/asns.ts index 66ecf4a6e9..7697e9dd84 100644 --- a/src/resources/radar/entities/asns.ts +++ b/src/resources/radar/entities/asns.ts @@ -194,10 +194,20 @@ export namespace ASNAsSetResponse { */ name: string; + /** + * The AS number following hierarchical AS-SET name + */ + hierarchical_asn?: number; + /** * The inferred AS number of the AS-SET */ - asn?: number; + inferred_asn?: number; + + /** + * The AS number matching PeeringDB record + */ + peeringdb_asn?: number; } } diff --git a/src/resources/radar/geolocations.ts b/src/resources/radar/geolocations.ts new file mode 100644 index 0000000000..13ead450ff --- /dev/null +++ b/src/resources/radar/geolocations.ts @@ -0,0 +1,263 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import { isRequestOptions } from '../../core'; +import * as Core from '../../core'; + +export class Geolocations extends APIResource { + /** + * Retrieves a list of geolocations. + * + * @example + * ```ts + * const geolocations = await client.radar.geolocations.list(); + * ``` + */ + list( + query?: GeolocationListParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: GeolocationListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/geolocations', { query, ...options }) as Core.APIPromise<{ + result: GeolocationListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the requested Geolocation information. + * + * @example + * ```ts + * const geolocation = await client.radar.geolocations.get( + * '3190509', + * ); + * ``` + */ + get( + geoId: string, + query?: GeolocationGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(geoId: string, options?: Core.RequestOptions): Core.APIPromise; + get( + geoId: string, + query: GeolocationGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(geoId, {}, query); + } + return ( + this._client.get(`/radar/geolocations/${geoId}`, { query, ...options }) as Core.APIPromise<{ + result: GeolocationGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface GeolocationListResponse { + geolocations: Array; +} + +export namespace GeolocationListResponse { + export interface Geolocation { + geoId: string; + + /** + * A numeric string. + */ + latitude: string; + + /** + * A numeric string. + */ + longitude: string; + + name: string; + + parent: Geolocation.Parent; + + /** + * The type of the geolocation. + */ + type: 'CONTINENT' | 'COUNTRY' | 'ADM1'; + } + + export namespace Geolocation { + export interface Parent { + geoId: string; + + /** + * A numeric string. + */ + latitude: string; + + /** + * A numeric string. + */ + longitude: string; + + name: string; + + parent: Parent.Parent; + + /** + * The type of the geolocation. + */ + type: 'CONTINENT' | 'COUNTRY' | 'ADM1'; + } + + export namespace Parent { + export interface Parent { + geoId: string; + + /** + * A numeric string. + */ + latitude: string; + + /** + * A numeric string. + */ + longitude: string; + + name: string; + + /** + * The type of the geolocation. + */ + type: 'CONTINENT' | 'COUNTRY' | 'ADM1'; + } + } + } +} + +export interface GeolocationGetResponse { + geolocation: GeolocationGetResponse.Geolocation; +} + +export namespace GeolocationGetResponse { + export interface Geolocation { + geoId: string; + + /** + * A numeric string. + */ + latitude: string; + + /** + * A numeric string. + */ + longitude: string; + + name: string; + + parent: Geolocation.Parent; + + /** + * The type of the geolocation. + */ + type: 'CONTINENT' | 'COUNTRY' | 'ADM1'; + } + + export namespace Geolocation { + export interface Parent { + geoId: string; + + /** + * A numeric string. + */ + latitude: string; + + /** + * A numeric string. + */ + longitude: string; + + name: string; + + parent: Parent.Parent; + + /** + * The type of the geolocation. + */ + type: 'CONTINENT' | 'COUNTRY' | 'ADM1'; + } + + export namespace Parent { + export interface Parent { + geoId: string; + + /** + * A numeric string. + */ + latitude: string; + + /** + * A numeric string. + */ + longitude: string; + + name: string; + + /** + * The type of the geolocation. + */ + type: 'CONTINENT' | 'COUNTRY' | 'ADM1'; + } + } + } +} + +export interface GeolocationListParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by geolocation. Specify a comma-separated list of GeoNames IDs. + */ + geoId?: string; + + /** + * Limits the number of objects returned in the response. + */ + limit?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 location + * codes. + */ + location?: string; + + /** + * Skips the specified number of objects before fetching the results. + */ + offset?: number; +} + +export interface GeolocationGetParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; +} + +export declare namespace Geolocations { + export { + type GeolocationListResponse as GeolocationListResponse, + type GeolocationGetResponse as GeolocationGetResponse, + type GeolocationListParams as GeolocationListParams, + type GeolocationGetParams as GeolocationGetParams, + }; +} diff --git a/src/resources/radar/http/http.ts b/src/resources/radar/http/http.ts index 7d3a80fcb6..7db445c93a 100644 --- a/src/resources/radar/http/http.ts +++ b/src/resources/radar/http/http.ts @@ -69,6 +69,71 @@ export class HTTP extends APIResource { ); top: TopAPI.Top = new TopAPI.Top(this._client); + /** + * Retrieves the distribution of HTTP requests by the specified dimension. + * + * @example + * ```ts + * const response = await client.radar.http.summaryV2('ADM1'); + * ``` + */ + summaryV2( + dimension: + | 'ADM1' + | 'BOT_CLASS' + | 'BROWSER' + | 'BROWSER_FAMILY' + | 'DEVICE_TYPE' + | 'HTTP_PROTOCOL' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'OS' + | 'POST_QUANTUM' + | 'TLS_VERSION', + query?: HTTPSummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'ADM1' + | 'BOT_CLASS' + | 'BROWSER' + | 'BROWSER_FAMILY' + | 'DEVICE_TYPE' + | 'HTTP_PROTOCOL' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'OS' + | 'POST_QUANTUM' + | 'TLS_VERSION', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: + | 'ADM1' + | 'BOT_CLASS' + | 'BROWSER' + | 'BROWSER_FAMILY' + | 'DEVICE_TYPE' + | 'HTTP_PROTOCOL' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'OS' + | 'POST_QUANTUM' + | 'TLS_VERSION', + query: HTTPSummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/http/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: HTTPSummaryV2Response; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves the HTTP requests over time. * @@ -95,6 +160,171 @@ export class HTTP extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieves the distribution of HTTP requests grouped by dimension. + * + * @example + * ```ts + * const response = await client.radar.http.timeseriesGroupsV2( + * 'ADM1', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: + | 'ADM1' + | 'BOT_CLASS' + | 'BROWSER' + | 'BROWSER_FAMILY' + | 'DEVICE_TYPE' + | 'HTTP_PROTOCOL' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'OS' + | 'POST_QUANTUM' + | 'TLS_VERSION', + query?: HTTPTimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'ADM1' + | 'BOT_CLASS' + | 'BROWSER' + | 'BROWSER_FAMILY' + | 'DEVICE_TYPE' + | 'HTTP_PROTOCOL' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'OS' + | 'POST_QUANTUM' + | 'TLS_VERSION', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: + | 'ADM1' + | 'BOT_CLASS' + | 'BROWSER' + | 'BROWSER_FAMILY' + | 'DEVICE_TYPE' + | 'HTTP_PROTOCOL' + | 'HTTP_VERSION' + | 'IP_VERSION' + | 'OS' + | 'POST_QUANTUM' + | 'TLS_VERSION', + query: HTTPTimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/http/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: HTTPTimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface HTTPSummaryV2Response { + /** + * Metadata for the results. + */ + meta: HTTPSummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace HTTPSummaryV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } } export interface HTTPTimeseriesResponse { @@ -210,6 +440,218 @@ export namespace HTTPTimeseriesResponse { } } +export interface HTTPTimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + meta: HTTPTimeseriesGroupsV2Response.Meta; + + serie_0: HTTPTimeseriesGroupsV2Response.Serie0; +} + +export namespace HTTPTimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface HTTPSummaryV2Params { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + + /** + * Filters results by HTTP protocol (HTTP vs. HTTPS). + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filters results by HTTP version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by operating system. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filters results by TLS version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + export interface HTTPTimeseriesParams { /** * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). @@ -323,6 +765,121 @@ export interface HTTPTimeseriesParams { tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; } +export interface HTTPTimeseriesGroupsV2Params { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + + /** + * Filters results by HTTP protocol (HTTP vs. HTTPS). + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filters results by HTTP version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filters results by IP version (Ipv4 vs. IPv6). + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; + + /** + * Filters results by operating system. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filters results by TLS version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + HTTP.Locations = Locations; HTTP.Ases = Ases; HTTP.Summary = Summary; @@ -331,8 +888,12 @@ HTTP.Top = Top; export declare namespace HTTP { export { + type HTTPSummaryV2Response as HTTPSummaryV2Response, type HTTPTimeseriesResponse as HTTPTimeseriesResponse, + type HTTPTimeseriesGroupsV2Response as HTTPTimeseriesGroupsV2Response, + type HTTPSummaryV2Params as HTTPSummaryV2Params, type HTTPTimeseriesParams as HTTPTimeseriesParams, + type HTTPTimeseriesGroupsV2Params as HTTPTimeseriesGroupsV2Params, }; export { diff --git a/src/resources/radar/http/index.ts b/src/resources/radar/http/index.ts index cd20232224..d4b520cd3c 100644 --- a/src/resources/radar/http/index.ts +++ b/src/resources/radar/http/index.ts @@ -1,7 +1,15 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Ases, type AseGetResponse, type AseGetParams } from './ases/index'; -export { HTTP, type HTTPTimeseriesResponse, type HTTPTimeseriesParams } from './http'; +export { + HTTP, + type HTTPSummaryV2Response, + type HTTPTimeseriesResponse, + type HTTPTimeseriesGroupsV2Response, + type HTTPSummaryV2Params, + type HTTPTimeseriesParams, + type HTTPTimeseriesGroupsV2Params, +} from './http'; export { Locations, type LocationGetResponse, type LocationGetParams } from './locations/index'; export { Summary, diff --git a/src/resources/radar/http/summary.ts b/src/resources/radar/http/summary.ts index 9f7f84b12e..5c5792f467 100644 --- a/src/resources/radar/http/summary.ts +++ b/src/resources/radar/http/summary.ts @@ -11,7 +11,7 @@ export class Summary extends APIResource { * https://developers.cloudflare.com/radar/concepts/bot-classes/ for more * information. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ botClass( query?: SummaryBotClassParams, @@ -36,7 +36,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP requests generated by mobile, desktop, and * other types of devices. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ deviceType( query?: SummaryDeviceTypeParams, @@ -60,7 +60,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. HTTPS). * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ httpProtocol( query?: SummaryHTTPProtocolParams, @@ -84,7 +84,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP version. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ httpVersion( query?: SummaryHTTPVersionParams, @@ -108,7 +108,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by IP version. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ ipVersion( query?: SummaryIPVersionParams, @@ -133,7 +133,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP requests by operating system (Windows, macOS, * Android, iOS, and others). * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ os(query?: SummaryOSParams, options?: Core.RequestOptions): Core.APIPromise; os(options?: Core.RequestOptions): Core.APIPromise; @@ -154,7 +154,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by post-quantum support. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ postQuantum( query?: SummaryPostQuantumParams, @@ -178,7 +178,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by TLS version. * - * @deprecated + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ tlsVersion( query?: SummaryTLSVersionParams, diff --git a/src/resources/radar/http/timeseries-groups.ts b/src/resources/radar/http/timeseries-groups.ts index a22fdb7774..6e44b45b29 100644 --- a/src/resources/radar/http/timeseries-groups.ts +++ b/src/resources/radar/http/timeseries-groups.ts @@ -10,7 +10,7 @@ export class TimeseriesGroups extends APIResource { * over time. Visit https://developers.cloudflare.com/radar/concepts/bot-classes/ * for more information. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ botClass( query?: TimeseriesGroupBotClassParams, @@ -34,7 +34,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by user agent over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ browser( query?: TimeseriesGroupBrowserParams, @@ -58,7 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by user agent family over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ browserFamily( query?: TimeseriesGroupBrowserFamilyParams, @@ -83,7 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by device type over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ deviceType( query?: TimeseriesGroupDeviceTypeParams, @@ -109,7 +109,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. HTTPS) * over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ httpProtocol( query?: TimeseriesGroupHTTPProtocolParams, @@ -134,7 +134,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP version over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -159,7 +159,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by IP version over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -183,7 +183,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by operating system over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ os( query?: TimeseriesGroupOSParams, @@ -207,7 +207,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by post-quantum support over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ postQuantum( query?: TimeseriesGroupPostQuantumParams, @@ -232,7 +232,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by TLS version over time. * - * @deprecated + * @deprecated Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead. */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, diff --git a/src/resources/radar/http/top.ts b/src/resources/radar/http/top.ts index 01ee05806f..8419bea370 100644 --- a/src/resources/radar/http/top.ts +++ b/src/resources/radar/http/top.ts @@ -8,10 +8,7 @@ export class Top extends APIResource { /** * Retrieves the top user agents by HTTP requests. * - * @example - * ```ts - * const response = await client.radar.http.top.browser(); - * ``` + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ browser(query?: TopBrowserParams, options?: Core.RequestOptions): Core.APIPromise; browser(options?: Core.RequestOptions): Core.APIPromise; @@ -32,11 +29,7 @@ export class Top extends APIResource { /** * Retrieves the top user agents, aggregated in families, by HTTP requests. * - * @example - * ```ts - * const response = - * await client.radar.http.top.browserFamily(); - * ``` + * @deprecated Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead. */ browserFamily( query?: TopBrowserFamilyParams, diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index 9b9bba8ee0..8bade1de40 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -1,7 +1,15 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { AI } from './ai/index'; -export { AS112, type AS112TimeseriesResponse, type AS112TimeseriesParams } from './as112/index'; +export { + AS112, + type AS112SummaryV2Response, + type AS112TimeseriesResponse, + type AS112TimeseriesGroupsV2Response, + type AS112SummaryV2Params, + type AS112TimeseriesParams, + type AS112TimeseriesGroupsV2Params, +} from './as112/index'; export { Annotations, type AnnotationListResponse, type AnnotationListParams } from './annotations/index'; export { Attacks } from './attacks/index'; export { BGP, type BGPTimeseriesResponse, type BGPTimeseriesParams } from './bgp/index'; @@ -27,7 +35,15 @@ export { type CtTimeseriesParams, type CtTimeseriesGroupsParams, } from './ct/index'; -export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns/index'; +export { + DNS, + type DNSSummaryV2Response, + type DNSTimeseriesResponse, + type DNSTimeseriesGroupsV2Response, + type DNSSummaryV2Params, + type DNSTimeseriesParams, + type DNSTimeseriesGroupsV2Params, +} from './dns/index'; export { Datasets, type DatasetListResponse, @@ -38,14 +54,39 @@ export { } from './datasets'; export { Email, type RadarEmailSeries, type RadarEmailSummary } from './email/index'; export { Entities, type EntityGetResponse, type EntityGetParams } from './entities/index'; -export { HTTP, type HTTPTimeseriesResponse, type HTTPTimeseriesParams } from './http/index'; -export { LeakedCredentials } from './leaked-credentials/index'; +export { + Geolocations, + type GeolocationListResponse, + type GeolocationGetResponse, + type GeolocationListParams, + type GeolocationGetParams, +} from './geolocations'; +export { + HTTP, + type HTTPSummaryV2Response, + type HTTPTimeseriesResponse, + type HTTPTimeseriesGroupsV2Response, + type HTTPSummaryV2Params, + type HTTPTimeseriesParams, + type HTTPTimeseriesGroupsV2Params, +} from './http/index'; +export { + LeakedCredentials, + type LeakedCredentialSummaryV2Response, + type LeakedCredentialTimeseriesGroupsV2Response, + type LeakedCredentialSummaryV2Params, + type LeakedCredentialTimeseriesGroupsV2Params, +} from './leaked-credentials/index'; export { Netflows, type NetflowSummaryResponse, + type NetflowSummaryV2Response, type NetflowTimeseriesResponse, + type NetflowTimeseriesGroupsResponse, type NetflowSummaryParams, + type NetflowSummaryV2Params, type NetflowTimeseriesParams, + type NetflowTimeseriesGroupsParams, } from './netflows/index'; export { Quality } from './quality/index'; export { Radar } from './radar'; diff --git a/src/resources/radar/leaked-credentials/index.ts b/src/resources/radar/leaked-credentials/index.ts index dd87ce4dc7..0e9f80aa96 100644 --- a/src/resources/radar/leaked-credentials/index.ts +++ b/src/resources/radar/leaked-credentials/index.ts @@ -1,6 +1,12 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { LeakedCredentials } from './leaked-credentials'; +export { + LeakedCredentials, + type LeakedCredentialSummaryV2Response, + type LeakedCredentialTimeseriesGroupsV2Response, + type LeakedCredentialSummaryV2Params, + type LeakedCredentialTimeseriesGroupsV2Params, +} from './leaked-credentials'; export { Summary, type SummaryBotClassResponse, diff --git a/src/resources/radar/leaked-credentials/leaked-credentials.ts b/src/resources/radar/leaked-credentials/leaked-credentials.ts index 0b08cd020b..717982687d 100644 --- a/src/resources/radar/leaked-credentials/leaked-credentials.ts +++ b/src/resources/radar/leaked-credentials/leaked-credentials.ts @@ -1,6 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; import * as SummaryAPI from './summary'; import { Summary, @@ -23,12 +25,462 @@ export class LeakedCredentials extends APIResource { timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( this._client, ); + + /** + * Retrieves an aggregated summary of HTTP authentication requests grouped by the + * specified dimension. + * + * @example + * ```ts + * const response = + * await client.radar.leakedCredentials.summaryV2( + * 'COMPROMISED', + * ); + * ``` + */ + summaryV2( + dimension: 'COMPROMISED' | 'BOT_CLASS', + query?: LeakedCredentialSummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'COMPROMISED' | 'BOT_CLASS', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'COMPROMISED' | 'BOT_CLASS', + query: LeakedCredentialSummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/leaked_credential_checks/summary/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: LeakedCredentialSummaryV2Response }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of HTTP authentication requests, grouped by the + * specified dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.leakedCredentials.timeseriesGroupsV2( + * 'COMPROMISED', + * ); + * ``` + */ + timeseriesGroupsV2( + dimension: 'COMPROMISED' | 'BOT_CLASS', + query?: LeakedCredentialTimeseriesGroupsV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'COMPROMISED' | 'BOT_CLASS', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroupsV2( + dimension: 'COMPROMISED' | 'BOT_CLASS', + query: LeakedCredentialTimeseriesGroupsV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroupsV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/leaked_credential_checks/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: LeakedCredentialTimeseriesGroupsV2Response }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface LeakedCredentialSummaryV2Response { + /** + * Metadata for the results. + */ + meta: LeakedCredentialSummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace LeakedCredentialSummaryV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + +export interface LeakedCredentialTimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + meta: LeakedCredentialTimeseriesGroupsV2Response.Meta; + + serie_0: LeakedCredentialTimeseriesGroupsV2Response.Serie0; +} + +export namespace LeakedCredentialTimeseriesGroupsV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface LeakedCredentialSummaryV2Params { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * Filters results by compromised credential status (clean vs. compromised). + */ + compromised?: Array<'CLEAN' | 'COMPROMISED'>; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export interface LeakedCredentialTimeseriesGroupsV2Params { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * Filters results by leaked credential check result. + */ + checkResult?: Array< + | 'CLEAN' + | 'USERNAME_LEAKED' + | 'USERNAME_PASSWORD_SIMILAR' + | 'USERNAME_AND_PASSWORD_LEAKED' + | 'PASSWORD_LEAKED' + >; + + /** + * Filters results by compromised credential status (clean vs. compromised). + */ + compromised?: Array<'CLEAN' | 'COMPROMISED'>; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; } LeakedCredentials.Summary = Summary; LeakedCredentials.TimeseriesGroups = TimeseriesGroups; export declare namespace LeakedCredentials { + export { + type LeakedCredentialSummaryV2Response as LeakedCredentialSummaryV2Response, + type LeakedCredentialTimeseriesGroupsV2Response as LeakedCredentialTimeseriesGroupsV2Response, + type LeakedCredentialSummaryV2Params as LeakedCredentialSummaryV2Params, + type LeakedCredentialTimeseriesGroupsV2Params as LeakedCredentialTimeseriesGroupsV2Params, + }; + export { Summary as Summary, type SummaryBotClassResponse as SummaryBotClassResponse, diff --git a/src/resources/radar/leaked-credentials/summary.ts b/src/resources/radar/leaked-credentials/summary.ts index 917ce13982..970fde6b56 100644 --- a/src/resources/radar/leaked-credentials/summary.ts +++ b/src/resources/radar/leaked-credentials/summary.ts @@ -8,7 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP authentication requests by bot class. * - * @deprecated + * @deprecated Use [Radar Leaked Credentials Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/summary_v2/) instead. */ botClass( query?: SummaryBotClassParams, @@ -34,7 +34,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP authentication requests by compromised * credential status. * - * @deprecated + * @deprecated Use [Radar Leaked Credentials Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/summary_v2/) instead. */ compromised( query?: SummaryCompromisedParams, diff --git a/src/resources/radar/leaked-credentials/timeseries-groups.ts b/src/resources/radar/leaked-credentials/timeseries-groups.ts index 83aa48d077..859a012a8c 100644 --- a/src/resources/radar/leaked-credentials/timeseries-groups.ts +++ b/src/resources/radar/leaked-credentials/timeseries-groups.ts @@ -9,7 +9,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP authentication requests by bot class over * time. * - * @deprecated + * @deprecated Use [Radar Leaked Credentials Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/timeseries_groups_v2/) instead. */ botClass( query?: TimeseriesGroupBotClassParams, @@ -35,7 +35,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP authentication requests by compromised * credential status over time. * - * @deprecated + * @deprecated Use [Radar Leaked Credentials Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/timeseries_groups_v2/) instead. */ compromised( query?: TimeseriesGroupCompromisedParams, diff --git a/src/resources/radar/netflows/index.ts b/src/resources/radar/netflows/index.ts index cceee75f9d..8b6dfc637a 100644 --- a/src/resources/radar/netflows/index.ts +++ b/src/resources/radar/netflows/index.ts @@ -3,9 +3,13 @@ export { Netflows, type NetflowSummaryResponse, + type NetflowSummaryV2Response, type NetflowTimeseriesResponse, + type NetflowTimeseriesGroupsResponse, type NetflowSummaryParams, + type NetflowSummaryV2Params, type NetflowTimeseriesParams, + type NetflowTimeseriesGroupsParams, } from './netflows'; export { Top, diff --git a/src/resources/radar/netflows/netflows.ts b/src/resources/radar/netflows/netflows.ts index c484510bb6..2b4c86b9ae 100644 --- a/src/resources/radar/netflows/netflows.ts +++ b/src/resources/radar/netflows/netflows.ts @@ -13,7 +13,7 @@ export class Netflows extends APIResource { * Retrieves the distribution of network traffic (NetFlows) by HTTP vs other * protocols. * - * @deprecated + * @deprecated Use [Get Network Traffic Distribution By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/netflows/methods/summary_v2/) instead. */ summary( query?: NetflowSummaryParams, @@ -34,6 +34,41 @@ export class Netflows extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Retrieves the distribution of network traffic (NetFlows) by the specified + * dimension. + * + * @example + * ```ts + * const response = await client.radar.netflows.summaryV2( + * 'ADM1', + * ); + * ``` + */ + summaryV2( + dimension: 'ADM1' | 'PRODUCT', + query?: NetflowSummaryV2Params, + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'ADM1' | 'PRODUCT', + options?: Core.RequestOptions, + ): Core.APIPromise; + summaryV2( + dimension: 'ADM1' | 'PRODUCT', + query: NetflowSummaryV2Params | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summaryV2(dimension, {}, query); + } + return ( + this._client.get(`/radar/netflows/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: NetflowSummaryV2Response; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves network traffic (NetFlows) over time. * @@ -60,6 +95,41 @@ export class Netflows extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieves the distribution of NetFlows traffic, grouped by chosen the specified + * dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.netflows.timeseriesGroups('ADM1'); + * ``` + */ + timeseriesGroups( + dimension: 'ADM1' | 'PRODUCT', + query?: NetflowTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'ADM1' | 'PRODUCT', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'ADM1' | 'PRODUCT', + query: NetflowTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/netflows/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: NetflowTimeseriesGroupsResponse }> + )._thenUnwrap((obj) => obj.result); + } } export interface NetflowSummaryResponse { @@ -171,6 +241,103 @@ export namespace NetflowSummaryResponse { } } +export interface NetflowSummaryV2Response { + /** + * Metadata for the results. + */ + meta: NetflowSummaryV2Response.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace NetflowSummaryV2Response { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + export interface NetflowTimeseriesResponse { /** * Metadata for the results. @@ -281,6 +448,116 @@ export namespace NetflowTimeseriesResponse { } } +export interface NetflowTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: NetflowTimeseriesGroupsResponse.Meta; + + serie_0: NetflowTimeseriesGroupsResponse.Serie0; +} + +export namespace NetflowTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + export interface NetflowSummaryParams { /** * Filters results by Autonomous System. Specify one or more Autonomous System @@ -340,6 +617,77 @@ export interface NetflowSummaryParams { name?: Array; } +export interface NetflowSummaryV2Params { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters the results by network traffic product types. + */ + product?: Array<'HTTP' | 'ALL'>; +} + export interface NetflowTimeseriesParams { /** * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). @@ -417,14 +765,102 @@ export interface NetflowTimeseriesParams { product?: Array<'HTTP' | 'ALL'>; } +export interface NetflowTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; + + /** + * Filters the results by network traffic product types. + */ + product?: Array<'HTTP' | 'ALL'>; +} + Netflows.Top = Top; export declare namespace Netflows { export { type NetflowSummaryResponse as NetflowSummaryResponse, + type NetflowSummaryV2Response as NetflowSummaryV2Response, type NetflowTimeseriesResponse as NetflowTimeseriesResponse, + type NetflowTimeseriesGroupsResponse as NetflowTimeseriesGroupsResponse, type NetflowSummaryParams as NetflowSummaryParams, + type NetflowSummaryV2Params as NetflowSummaryV2Params, type NetflowTimeseriesParams as NetflowTimeseriesParams, + type NetflowTimeseriesGroupsParams as NetflowTimeseriesGroupsParams, }; export { diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 0ed666d88a..1349fb443f 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -10,6 +10,14 @@ import { DatasetListResponse, Datasets, } from './datasets'; +import * as GeolocationsAPI from './geolocations'; +import { + GeolocationGetParams, + GeolocationGetResponse, + GeolocationListParams, + GeolocationListResponse, + Geolocations, +} from './geolocations'; import * as SearchAPI from './search'; import { Search, SearchGlobalParams, SearchGlobalResponse } from './search'; import * as TCPResetsTimeoutsAPI from './tcp-resets-timeouts'; @@ -25,7 +33,15 @@ import { AI } from './ai/ai'; import * as AnnotationsAPI from './annotations/annotations'; import { AnnotationListParams, AnnotationListResponse, Annotations } from './annotations/annotations'; import * as AS112API from './as112/as112'; -import { AS112, AS112TimeseriesParams, AS112TimeseriesResponse } from './as112/as112'; +import { + AS112, + AS112SummaryV2Params, + AS112SummaryV2Response, + AS112TimeseriesGroupsV2Params, + AS112TimeseriesGroupsV2Response, + AS112TimeseriesParams, + AS112TimeseriesResponse, +} from './as112/as112'; import * as AttacksAPI from './attacks/attacks'; import { Attacks } from './attacks/attacks'; import * as BGPAPI from './bgp/bgp'; @@ -55,19 +71,45 @@ import { CtTimeseriesResponse, } from './ct/ct'; import * as DNSAPI from './dns/dns'; -import { DNS, DNSTimeseriesParams, DNSTimeseriesResponse } from './dns/dns'; +import { + DNS, + DNSSummaryV2Params, + DNSSummaryV2Response, + DNSTimeseriesGroupsV2Params, + DNSTimeseriesGroupsV2Response, + DNSTimeseriesParams, + DNSTimeseriesResponse, +} from './dns/dns'; import * as EmailAPI from './email/email'; import { Email, RadarEmailSeries, RadarEmailSummary } from './email/email'; import * as EntitiesAPI from './entities/entities'; import { Entities, EntityGetParams, EntityGetResponse } from './entities/entities'; import * as HTTPAPI from './http/http'; -import { HTTP, HTTPTimeseriesParams, HTTPTimeseriesResponse } from './http/http'; +import { + HTTP, + HTTPSummaryV2Params, + HTTPSummaryV2Response, + HTTPTimeseriesGroupsV2Params, + HTTPTimeseriesGroupsV2Response, + HTTPTimeseriesParams, + HTTPTimeseriesResponse, +} from './http/http'; import * as LeakedCredentialsAPI from './leaked-credentials/leaked-credentials'; -import { LeakedCredentials } from './leaked-credentials/leaked-credentials'; +import { + LeakedCredentialSummaryV2Params, + LeakedCredentialSummaryV2Response, + LeakedCredentialTimeseriesGroupsV2Params, + LeakedCredentialTimeseriesGroupsV2Response, + LeakedCredentials, +} from './leaked-credentials/leaked-credentials'; import * as NetflowsAPI from './netflows/netflows'; import { NetflowSummaryParams, NetflowSummaryResponse, + NetflowSummaryV2Params, + NetflowSummaryV2Response, + NetflowTimeseriesGroupsParams, + NetflowTimeseriesGroupsResponse, NetflowTimeseriesParams, NetflowTimeseriesResponse, Netflows, @@ -108,6 +150,7 @@ export class Radar extends APIResource { email: EmailAPI.Email = new EmailAPI.Email(this._client); attacks: AttacksAPI.Attacks = new AttacksAPI.Attacks(this._client); entities: EntitiesAPI.Entities = new EntitiesAPI.Entities(this._client); + geolocations: GeolocationsAPI.Geolocations = new GeolocationsAPI.Geolocations(this._client); http: HTTPAPI.HTTP = new HTTPAPI.HTTP(this._client); quality: QualityAPI.Quality = new QualityAPI.Quality(this._client); ranking: RankingAPI.Ranking = new RankingAPI.Ranking(this._client); @@ -137,6 +180,7 @@ Radar.AS112 = AS112; Radar.Email = Email; Radar.Attacks = Attacks; Radar.Entities = Entities; +Radar.Geolocations = Geolocations; Radar.HTTP = HTTP; Radar.Quality = Quality; Radar.Ranking = Ranking; @@ -195,16 +239,24 @@ export declare namespace Radar { export { DNS as DNS, + type DNSSummaryV2Response as DNSSummaryV2Response, type DNSTimeseriesResponse as DNSTimeseriesResponse, + type DNSTimeseriesGroupsV2Response as DNSTimeseriesGroupsV2Response, + type DNSSummaryV2Params as DNSSummaryV2Params, type DNSTimeseriesParams as DNSTimeseriesParams, + type DNSTimeseriesGroupsV2Params as DNSTimeseriesGroupsV2Params, }; export { Netflows as Netflows, type NetflowSummaryResponse as NetflowSummaryResponse, + type NetflowSummaryV2Response as NetflowSummaryV2Response, type NetflowTimeseriesResponse as NetflowTimeseriesResponse, + type NetflowTimeseriesGroupsResponse as NetflowTimeseriesGroupsResponse, type NetflowSummaryParams as NetflowSummaryParams, + type NetflowSummaryV2Params as NetflowSummaryV2Params, type NetflowTimeseriesParams as NetflowTimeseriesParams, + type NetflowTimeseriesGroupsParams as NetflowTimeseriesGroupsParams, }; export { @@ -217,8 +269,12 @@ export declare namespace Radar { export { AS112 as AS112, + type AS112SummaryV2Response as AS112SummaryV2Response, type AS112TimeseriesResponse as AS112TimeseriesResponse, + type AS112TimeseriesGroupsV2Response as AS112TimeseriesGroupsV2Response, + type AS112SummaryV2Params as AS112SummaryV2Params, type AS112TimeseriesParams as AS112TimeseriesParams, + type AS112TimeseriesGroupsV2Params as AS112TimeseriesGroupsV2Params, }; export { @@ -235,10 +291,22 @@ export declare namespace Radar { type EntityGetParams as EntityGetParams, }; + export { + Geolocations as Geolocations, + type GeolocationListResponse as GeolocationListResponse, + type GeolocationGetResponse as GeolocationGetResponse, + type GeolocationListParams as GeolocationListParams, + type GeolocationGetParams as GeolocationGetParams, + }; + export { HTTP as HTTP, + type HTTPSummaryV2Response as HTTPSummaryV2Response, type HTTPTimeseriesResponse as HTTPTimeseriesResponse, + type HTTPTimeseriesGroupsV2Response as HTTPTimeseriesGroupsV2Response, + type HTTPSummaryV2Params as HTTPSummaryV2Params, type HTTPTimeseriesParams as HTTPTimeseriesParams, + type HTTPTimeseriesGroupsV2Params as HTTPTimeseriesGroupsV2Params, }; export { Quality as Quality }; @@ -267,5 +335,11 @@ export declare namespace Radar { export { RobotsTXT as RobotsTXT }; - export { LeakedCredentials as LeakedCredentials }; + export { + LeakedCredentials as LeakedCredentials, + type LeakedCredentialSummaryV2Response as LeakedCredentialSummaryV2Response, + type LeakedCredentialTimeseriesGroupsV2Response as LeakedCredentialTimeseriesGroupsV2Response, + type LeakedCredentialSummaryV2Params as LeakedCredentialSummaryV2Params, + type LeakedCredentialTimeseriesGroupsV2Params as LeakedCredentialTimeseriesGroupsV2Params, + }; } diff --git a/src/resources/realtime-kit.ts b/src/resources/realtime-kit.ts new file mode 100644 index 0000000000..050298a232 --- /dev/null +++ b/src/resources/realtime-kit.ts @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../resource'; + +export class RealtimeKit extends APIResource {} diff --git a/src/resources/rulesets/rules.ts b/src/resources/rulesets/rules.ts index ee0495559c..3cca8dc4a5 100644 --- a/src/resources/rulesets/rules.ts +++ b/src/resources/rulesets/rules.ts @@ -5850,7 +5850,7 @@ export namespace SetConfigRule { bic?: boolean; /** - * Whether to disable Cloudflare Apps. + * @deprecated Cloudflare Apps are deprected. */ disable_apps?: true; @@ -5885,7 +5885,8 @@ export namespace SetConfigRule { hotlink_protection?: boolean; /** - * Whether to enable Mirage. + * @deprecated Mirage is deprecated. More information at + * https://developers.cloudflare.com/speed/optimization/images/mirage/. */ mirage?: boolean; @@ -6087,7 +6088,7 @@ export namespace SetConfigRuleParam { bic?: boolean; /** - * Whether to disable Cloudflare Apps. + * @deprecated Cloudflare Apps are deprected. */ disable_apps?: true; @@ -6122,7 +6123,8 @@ export namespace SetConfigRuleParam { hotlink_protection?: boolean; /** - * Whether to enable Mirage. + * @deprecated Mirage is deprecated. More information at + * https://developers.cloudflare.com/speed/optimization/images/mirage/. */ mirage?: boolean; @@ -11368,7 +11370,7 @@ export declare namespace RuleCreateParams { bic?: boolean; /** - * Whether to disable Cloudflare Apps. + * @deprecated Cloudflare Apps are deprected. */ disable_apps?: true; @@ -11403,7 +11405,8 @@ export declare namespace RuleCreateParams { hotlink_protection?: boolean; /** - * Whether to enable Mirage. + * @deprecated Mirage is deprecated. More information at + * https://developers.cloudflare.com/speed/optimization/images/mirage/. */ mirage?: boolean; @@ -15560,7 +15563,7 @@ export declare namespace RuleEditParams { bic?: boolean; /** - * Whether to disable Cloudflare Apps. + * @deprecated Cloudflare Apps are deprected. */ disable_apps?: true; @@ -15595,7 +15598,8 @@ export declare namespace RuleEditParams { hotlink_protection?: boolean; /** - * Whether to enable Mirage. + * @deprecated Mirage is deprecated. More information at + * https://developers.cloudflare.com/speed/optimization/images/mirage/. */ mirage?: boolean; diff --git a/src/resources/schema-validation/index.ts b/src/resources/schema-validation/index.ts index a738b4fc8d..2d9ad2ee1c 100644 --- a/src/resources/schema-validation/index.ts +++ b/src/resources/schema-validation/index.ts @@ -1,13 +1,10 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - SchemaListResponsesV4PagePaginationArray, + PublicSchemasV4PagePaginationArray, Schemas, - type SchemaCreateResponse, - type SchemaListResponse, + type PublicSchema, type SchemaDeleteResponse, - type SchemaEditResponse, - type SchemaGetResponse, type SchemaCreateParams, type SchemaListParams, type SchemaDeleteParams, diff --git a/src/resources/schema-validation/schema-validation.ts b/src/resources/schema-validation/schema-validation.ts index cacc6e1c93..3c754a3ffb 100644 --- a/src/resources/schema-validation/schema-validation.ts +++ b/src/resources/schema-validation/schema-validation.ts @@ -3,17 +3,14 @@ import { APIResource } from '../../resource'; import * as SchemasAPI from './schemas'; import { + PublicSchema, + PublicSchemasV4PagePaginationArray, SchemaCreateParams, - SchemaCreateResponse, SchemaDeleteParams, SchemaDeleteResponse, SchemaEditParams, - SchemaEditResponse, SchemaGetParams, - SchemaGetResponse, SchemaListParams, - SchemaListResponse, - SchemaListResponsesV4PagePaginationArray, Schemas, } from './schemas'; import * as SettingsAPI from './settings/settings'; @@ -33,18 +30,15 @@ export class SchemaValidation extends APIResource { } SchemaValidation.Schemas = Schemas; -SchemaValidation.SchemaListResponsesV4PagePaginationArray = SchemaListResponsesV4PagePaginationArray; +SchemaValidation.PublicSchemasV4PagePaginationArray = PublicSchemasV4PagePaginationArray; SchemaValidation.Settings = Settings; export declare namespace SchemaValidation { export { Schemas as Schemas, - type SchemaCreateResponse as SchemaCreateResponse, - type SchemaListResponse as SchemaListResponse, + type PublicSchema as PublicSchema, type SchemaDeleteResponse as SchemaDeleteResponse, - type SchemaEditResponse as SchemaEditResponse, - type SchemaGetResponse as SchemaGetResponse, - SchemaListResponsesV4PagePaginationArray as SchemaListResponsesV4PagePaginationArray, + PublicSchemasV4PagePaginationArray as PublicSchemasV4PagePaginationArray, type SchemaCreateParams as SchemaCreateParams, type SchemaListParams as SchemaListParams, type SchemaDeleteParams as SchemaDeleteParams, diff --git a/src/resources/schema-validation/schemas.ts b/src/resources/schema-validation/schemas.ts index 6db2534007..050b1728e1 100644 --- a/src/resources/schema-validation/schemas.ts +++ b/src/resources/schema-validation/schemas.ts @@ -10,24 +10,23 @@ export class Schemas extends APIResource { * * @example * ```ts - * const schema = await client.schemaValidation.schemas.create( - * { + * const publicSchema = + * await client.schemaValidation.schemas.create({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * kind: 'openapi_v3', * name: 'petstore schema', * source: '', * validation_enabled: true, - * }, - * ); + * }); * ``` */ - create(params: SchemaCreateParams, options?: Core.RequestOptions): Core.APIPromise { + create(params: SchemaCreateParams, options?: Core.RequestOptions): Core.APIPromise { const { zone_id, ...body } = params; return ( this._client.post(`/zones/${zone_id}/schema_validation/schemas`, { body, ...options, - }) as Core.APIPromise<{ result: SchemaCreateResponse }> + }) as Core.APIPromise<{ result: PublicSchema }> )._thenUnwrap((obj) => obj.result); } @@ -37,7 +36,7 @@ export class Schemas extends APIResource { * @example * ```ts * // Automatically fetches more pages as needed. - * for await (const schemaListResponse of client.schemaValidation.schemas.list( + * for await (const publicSchema of client.schemaValidation.schemas.list( * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * )) { * // ... @@ -47,11 +46,11 @@ export class Schemas extends APIResource { list( params: SchemaListParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { const { zone_id, ...query } = params; return this._client.getAPIList( `/zones/${zone_id}/schema_validation/schemas`, - SchemaListResponsesV4PagePaginationArray, + PublicSchemasV4PagePaginationArray, { query, ...options }, ); } @@ -86,23 +85,24 @@ export class Schemas extends APIResource { * * @example * ```ts - * const response = await client.schemaValidation.schemas.edit( - * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); + * const publicSchema = + * await client.schemaValidation.schemas.edit( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); * ``` */ edit( schemaId: string, params: SchemaEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { zone_id, ...body } = params; return ( this._client.patch(`/zones/${zone_id}/schema_validation/schemas/${schemaId}`, { body, ...options, - }) as Core.APIPromise<{ result: SchemaEditResponse }> + }) as Core.APIPromise<{ result: PublicSchema }> )._thenUnwrap((obj) => obj.result); } @@ -111,65 +111,34 @@ export class Schemas extends APIResource { * * @example * ```ts - * const schema = await client.schemaValidation.schemas.get( - * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); + * const publicSchema = + * await client.schemaValidation.schemas.get( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); * ``` */ get( schemaId: string, params: SchemaGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { zone_id, ...query } = params; return ( this._client.get(`/zones/${zone_id}/schema_validation/schemas/${schemaId}`, { query, ...options, - }) as Core.APIPromise<{ result: SchemaGetResponse }> + }) as Core.APIPromise<{ result: PublicSchema }> )._thenUnwrap((obj) => obj.result); } } -export class SchemaListResponsesV4PagePaginationArray extends V4PagePaginationArray {} +export class PublicSchemasV4PagePaginationArray extends V4PagePaginationArray {} /** * A schema used in schema validation */ -export interface SchemaCreateResponse { - created_at: string; - - /** - * The kind of the schema - */ - kind: 'openapi_v3'; - - /** - * A human-readable name for the schema - */ - name: string; - - /** - * A unique identifier of this schema - */ - schema_id: string; - - /** - * The raw schema, e.g., the OpenAPI schema, either as JSON or YAML - */ - source: string; - - /** - * An indicator if this schema is enabled - */ - validation_enabled?: boolean; -} - -/** - * A schema used in schema validation - */ -export interface SchemaListResponse { +export interface PublicSchema { created_at: string; /** @@ -202,71 +171,7 @@ export interface SchemaDeleteResponse { /** * The ID of the schema that was just deleted */ - schema_id: string; -} - -/** - * A schema used in schema validation - */ -export interface SchemaEditResponse { - created_at: string; - - /** - * The kind of the schema - */ - kind: 'openapi_v3'; - - /** - * A human-readable name for the schema - */ - name: string; - - /** - * A unique identifier of this schema - */ - schema_id: string; - - /** - * The raw schema, e.g., the OpenAPI schema, either as JSON or YAML - */ - source: string; - - /** - * An indicator if this schema is enabled - */ - validation_enabled?: boolean; -} - -/** - * A schema used in schema validation - */ -export interface SchemaGetResponse { - created_at: string; - - /** - * The kind of the schema - */ - kind: 'openapi_v3'; - - /** - * A human-readable name for the schema - */ - name: string; - - /** - * A unique identifier of this schema - */ - schema_id: string; - - /** - * The raw schema, e.g., the OpenAPI schema, either as JSON or YAML - */ - source: string; - - /** - * An indicator if this schema is enabled - */ - validation_enabled?: boolean; + id: string; } export interface SchemaCreateParams { @@ -344,16 +249,13 @@ export interface SchemaGetParams { omit_source?: boolean; } -Schemas.SchemaListResponsesV4PagePaginationArray = SchemaListResponsesV4PagePaginationArray; +Schemas.PublicSchemasV4PagePaginationArray = PublicSchemasV4PagePaginationArray; export declare namespace Schemas { export { - type SchemaCreateResponse as SchemaCreateResponse, - type SchemaListResponse as SchemaListResponse, + type PublicSchema as PublicSchema, type SchemaDeleteResponse as SchemaDeleteResponse, - type SchemaEditResponse as SchemaEditResponse, - type SchemaGetResponse as SchemaGetResponse, - SchemaListResponsesV4PagePaginationArray as SchemaListResponsesV4PagePaginationArray, + PublicSchemasV4PagePaginationArray as PublicSchemasV4PagePaginationArray, type SchemaCreateParams as SchemaCreateParams, type SchemaListParams as SchemaListParams, type SchemaDeleteParams as SchemaDeleteParams, diff --git a/src/resources/secrets-store/stores/secrets.ts b/src/resources/secrets-store/stores/secrets.ts index 1ab72e50dc..ec0ca694ed 100644 --- a/src/resources/secrets-store/stores/secrets.ts +++ b/src/resources/secrets-store/stores/secrets.ts @@ -18,7 +18,7 @@ export class Secrets extends APIResource { * body: [ * { * name: 'MY_API_KEY', - * scopes: ['workers', 'ai_gateway'], + * scopes: ['workers', 'ai_gateway', 'dex', 'access'], * value: 'api-token-secret-123', * }, * ], @@ -135,7 +135,7 @@ export class Secrets extends APIResource { * { * account_id: '985e105f4ecef8ad9ca31a8372d0c353', * name: 'MY_API_KEY', - * scopes: ['workers', 'ai_gateway'], + * scopes: ['workers', 'ai_gateway', 'dex', 'access'], * }, * ); * ``` diff --git a/src/resources/security-center/insights/insights.ts b/src/resources/security-center/insights/insights.ts index 1006bfe3bd..42ba05277e 100644 --- a/src/resources/security-center/insights/insights.ts +++ b/src/resources/security-center/insights/insights.ts @@ -122,7 +122,7 @@ export namespace InsightListResponse { issue_type?: IssuesAPI.IssueType; - payload?: unknown; + payload?: Issue.Payload; resolve_link?: string; @@ -136,6 +136,17 @@ export namespace InsightListResponse { timestamp?: string; } + + export namespace Issue { + export interface Payload { + /** + * Method used to detect insight + */ + detection_method?: string; + + zone_tag?: string; + } + } } export interface InsightDismissResponse { diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 9f1502f6d4..0ccf097746 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -998,3 +998,5 @@ export class SubscriptionsSinglePage extends SinglePage {} export class TokensV4PagePaginationArray extends V4PagePaginationArray {} export class AuditLogsV4PagePaginationArray extends V4PagePaginationArray {} + +export class CloudflareTunnelsV4PagePaginationArray extends V4PagePaginationArray {} diff --git a/src/resources/stream/downloads.ts b/src/resources/stream/downloads.ts index a9d2589f13..1fd7a50c02 100644 --- a/src/resources/stream/downloads.ts +++ b/src/resources/stream/downloads.ts @@ -6,7 +6,8 @@ import * as Core from '../../core'; export class Downloads extends APIResource { /** * Creates a download for a video when a video is ready to view. Use - * `/downloads/{download_type}` instead for type-specific downloads. + * `/downloads/{download_type}` instead for type-specific downloads. Available + * types are `default` and `audio`. * * @example * ```ts @@ -35,7 +36,7 @@ export class Downloads extends APIResource { /** * Delete the downloads for a video. Use `/downloads/{download_type}` instead for - * type-specific downloads. + * type-specific downloads. Available types are `default` and `audio`. * * @example * ```ts diff --git a/src/resources/token-validation.ts b/src/resources/token-validation.ts new file mode 100644 index 0000000000..87665996ca --- /dev/null +++ b/src/resources/token-validation.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './token-validation/index'; diff --git a/src/resources/token-validation/configuration.ts b/src/resources/token-validation/configuration.ts new file mode 100644 index 0000000000..43ed080b36 --- /dev/null +++ b/src/resources/token-validation/configuration.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './configuration/index'; diff --git a/src/resources/token-validation/configuration/configuration.ts b/src/resources/token-validation/configuration/configuration.ts new file mode 100644 index 0000000000..a4e09be2f4 --- /dev/null +++ b/src/resources/token-validation/configuration/configuration.ts @@ -0,0 +1,518 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import * as CredentialsAPI from './credentials'; +import { + CredentialUpdateParams, + CredentialUpdateResponse, + Credentials as CredentialsAPICredentials, +} from './credentials'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; + +export class Configuration extends APIResource { + credentials: CredentialsAPI.Credentials = new CredentialsAPI.Credentials(this._client); + + /** + * Create a new Token Validation configuration + * + * @example + * ```ts + * const tokenConfig = + * await client.tokenValidation.configuration.create({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * credentials: { + * keys: [ + * { + * alg: 'ES256', + * crv: 'P-256', + * kid: '38013f13-c266-4eec-a72a-92ec92779f21', + * kty: 'EC', + * x: 'KN53JRwN3wCjm2o39bvZUX2VdrsHzS8pxOAGjm8m7EQ', + * y: 'lnkkzIxaveggz-HFhcMWW15nxvOj0Z_uQsXbpK0GFcY', + * }, + * ], + * }, + * description: + * 'Long description for Token Validation Configuration', + * title: 'Example Token Validation Configuration', + * token_sources: [ + * 'http.request.headers["x-auth"][0]', + * 'http.request.cookies["Authorization"][0]', + * ], + * token_type: 'JWT', + * }); + * ``` + */ + create(params: ConfigurationCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/token_validation/config`, { + body, + ...options, + }) as Core.APIPromise<{ result: TokenConfig }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Lists all token validation configurations for this zone + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const tokenConfig of client.tokenValidation.configuration.list( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: ConfigurationListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { zone_id, ...query } = params; + return this._client.getAPIList( + `/zones/${zone_id}/token_validation/config`, + TokenConfigsV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Delete Token Configuration + * + * @example + * ```ts + * const configuration = + * await client.tokenValidation.configuration.delete( + * '4a7ee8d3-dd63-4ceb-9d5f-c27831854ce7', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + configId: string, + params: ConfigurationDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.delete( + `/zones/${zone_id}/token_validation/config/${configId}`, + options, + ) as Core.APIPromise<{ result: ConfigurationDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Edit fields of an existing Token Configuration + * + * @example + * ```ts + * const response = + * await client.tokenValidation.configuration.edit( + * '4a7ee8d3-dd63-4ceb-9d5f-c27831854ce7', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + edit( + configId: string, + params: ConfigurationEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.patch(`/zones/${zone_id}/token_validation/config/${configId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: ConfigurationEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a single Token Configuration + * + * @example + * ```ts + * const tokenConfig = + * await client.tokenValidation.configuration.get( + * '4a7ee8d3-dd63-4ceb-9d5f-c27831854ce7', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + configId: string, + params: ConfigurationGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.get(`/zones/${zone_id}/token_validation/config/${configId}`, options) as Core.APIPromise<{ + result: TokenConfig; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class TokenConfigsV4PagePaginationArray extends V4PagePaginationArray {} + +export interface TokenConfig { + /** + * UUID. + */ + id: string; + + created_at: string; + + credentials: TokenConfig.Credentials; + + description: string; + + last_updated: string; + + title: string; + + token_sources: Array; + + token_type: 'JWT'; +} + +export namespace TokenConfig { + export interface Credentials { + keys: Array< + | Credentials.APIShieldCredentialsJWTKeyRSA + | Credentials.APIShieldCredentialsJWTKeyEcEs256 + | Credentials.APIShieldCredentialsJWTKeyEcEs384 + >; + } + + export namespace Credentials { + /** + * JSON representation of an RSA key. + */ + export interface APIShieldCredentialsJWTKeyRSA { + /** + * Algorithm + */ + alg: 'RS256' | 'RS384' | 'RS512' | 'PS256' | 'PS384' | 'PS512'; + + /** + * RSA exponent + */ + e: string; + + /** + * Key ID + */ + kid: string; + + /** + * Key Type + */ + kty: 'RSA'; + + /** + * RSA modulus + */ + n: string; + } + + /** + * JSON representation of an ES256 key + */ + export interface APIShieldCredentialsJWTKeyEcEs256 { + /** + * Algorithm + */ + alg: 'ES256'; + + /** + * Curve + */ + crv: 'P-256'; + + /** + * Key ID + */ + kid: string; + + /** + * Key Type + */ + kty: 'EC'; + + /** + * X EC coordinate + */ + x: string; + + /** + * Y EC coordinate + */ + y: string; + } + + /** + * JSON representation of an ES384 key + */ + export interface APIShieldCredentialsJWTKeyEcEs384 { + /** + * Algorithm + */ + alg: 'ES384'; + + /** + * Curve + */ + crv: 'P-384'; + + /** + * Key ID + */ + kid: string; + + /** + * Key Type + */ + kty: 'EC'; + + /** + * X EC coordinate + */ + x: string; + + /** + * Y EC coordinate + */ + y: string; + } + } +} + +export interface ConfigurationDeleteResponse { + /** + * UUID. + */ + id?: string; +} + +export interface ConfigurationEditResponse { + description?: string; + + title?: string; + + token_sources?: Array; +} + +export interface ConfigurationCreateParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: + */ + credentials: ConfigurationCreateParams.Credentials; + + /** + * Body param: + */ + description: string; + + /** + * Body param: + */ + title: string; + + /** + * Body param: + */ + token_sources: Array; + + /** + * Body param: + */ + token_type: 'JWT'; +} + +export namespace ConfigurationCreateParams { + export interface Credentials { + keys: Array< + | Credentials.APIShieldCredentialsJWTKeyRSA + | Credentials.APIShieldCredentialsJWTKeyEcEs256 + | Credentials.APIShieldCredentialsJWTKeyEcEs384 + >; + } + + export namespace Credentials { + /** + * JSON representation of an RSA key. + */ + export interface APIShieldCredentialsJWTKeyRSA { + /** + * Algorithm + */ + alg: 'RS256' | 'RS384' | 'RS512' | 'PS256' | 'PS384' | 'PS512'; + + /** + * RSA exponent + */ + e: string; + + /** + * Key ID + */ + kid: string; + + /** + * Key Type + */ + kty: 'RSA'; + + /** + * RSA modulus + */ + n: string; + } + + /** + * JSON representation of an ES256 key + */ + export interface APIShieldCredentialsJWTKeyEcEs256 { + /** + * Algorithm + */ + alg: 'ES256'; + + /** + * Curve + */ + crv: 'P-256'; + + /** + * Key ID + */ + kid: string; + + /** + * Key Type + */ + kty: 'EC'; + + /** + * X EC coordinate + */ + x: string; + + /** + * Y EC coordinate + */ + y: string; + } + + /** + * JSON representation of an ES384 key + */ + export interface APIShieldCredentialsJWTKeyEcEs384 { + /** + * Algorithm + */ + alg: 'ES384'; + + /** + * Curve + */ + crv: 'P-384'; + + /** + * Key ID + */ + kid: string; + + /** + * Key Type + */ + kty: 'EC'; + + /** + * X EC coordinate + */ + x: string; + + /** + * Y EC coordinate + */ + y: string; + } + } +} + +export interface ConfigurationListParams extends V4PagePaginationArrayParams { + /** + * Path param: Identifier. + */ + zone_id: string; +} + +export interface ConfigurationDeleteParams { + /** + * Identifier. + */ + zone_id: string; +} + +export interface ConfigurationEditParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: + */ + description?: string; + + /** + * Body param: + */ + title?: string; + + /** + * Body param: + */ + token_sources?: Array; +} + +export interface ConfigurationGetParams { + /** + * Identifier. + */ + zone_id: string; +} + +Configuration.TokenConfigsV4PagePaginationArray = TokenConfigsV4PagePaginationArray; +Configuration.Credentials = CredentialsAPICredentials; + +export declare namespace Configuration { + export { + type TokenConfig as TokenConfig, + type ConfigurationDeleteResponse as ConfigurationDeleteResponse, + type ConfigurationEditResponse as ConfigurationEditResponse, + TokenConfigsV4PagePaginationArray as TokenConfigsV4PagePaginationArray, + type ConfigurationCreateParams as ConfigurationCreateParams, + type ConfigurationListParams as ConfigurationListParams, + type ConfigurationDeleteParams as ConfigurationDeleteParams, + type ConfigurationEditParams as ConfigurationEditParams, + type ConfigurationGetParams as ConfigurationGetParams, + }; + + export { + CredentialsAPICredentials as Credentials, + type CredentialUpdateResponse as CredentialUpdateResponse, + type CredentialUpdateParams as CredentialUpdateParams, + }; +} diff --git a/src/resources/token-validation/configuration/credentials.ts b/src/resources/token-validation/configuration/credentials.ts new file mode 100644 index 0000000000..447ee00ba5 --- /dev/null +++ b/src/resources/token-validation/configuration/credentials.ts @@ -0,0 +1,287 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import * as UserSchemasAPI from '../../api-gateway/user-schemas/user-schemas'; + +export class Credentials extends APIResource { + /** + * Update Token Configuration credentials + * + * @example + * ```ts + * const credential = + * await client.tokenValidation.configuration.credentials.update( + * '4a7ee8d3-dd63-4ceb-9d5f-c27831854ce7', + * { + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * keys: [ + * { + * alg: 'ES256', + * crv: 'P-256', + * kid: '38013f13-c266-4eec-a72a-92ec92779f21', + * kty: 'EC', + * x: 'KN53JRwN3wCjm2o39bvZUX2VdrsHzS8pxOAGjm8m7EQ', + * y: 'lnkkzIxaveggz-HFhcMWW15nxvOj0Z_uQsXbpK0GFcY', + * }, + * ], + * }, + * ); + * ``` + */ + update( + configId: string, + params: CredentialUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return this._client.put(`/zones/${zone_id}/token_validation/config/${configId}/credentials`, { + body, + ...options, + }); + } +} + +export interface CredentialUpdateResponse { + errors: UserSchemasAPI.Message; + + keys: Array< + | CredentialUpdateResponse.APIShieldCredentialsJWTKeyRSA + | CredentialUpdateResponse.APIShieldCredentialsJWTKeyEcEs256 + | CredentialUpdateResponse.APIShieldCredentialsJWTKeyEcEs384 + >; + + messages: UserSchemasAPI.Message; + + /** + * Whether the API call was successful. + */ + success: true; +} + +export namespace CredentialUpdateResponse { + /** + * JSON representation of an RSA key. + */ + export interface APIShieldCredentialsJWTKeyRSA { + /** + * Algorithm + */ + alg: 'RS256' | 'RS384' | 'RS512' | 'PS256' | 'PS384' | 'PS512'; + + /** + * RSA exponent + */ + e: string; + + /** + * Key ID + */ + kid: string; + + /** + * Key Type + */ + kty: 'RSA'; + + /** + * RSA modulus + */ + n: string; + } + + /** + * JSON representation of an ES256 key + */ + export interface APIShieldCredentialsJWTKeyEcEs256 { + /** + * Algorithm + */ + alg: 'ES256'; + + /** + * Curve + */ + crv: 'P-256'; + + /** + * Key ID + */ + kid: string; + + /** + * Key Type + */ + kty: 'EC'; + + /** + * X EC coordinate + */ + x: string; + + /** + * Y EC coordinate + */ + y: string; + } + + /** + * JSON representation of an ES384 key + */ + export interface APIShieldCredentialsJWTKeyEcEs384 { + /** + * Algorithm + */ + alg: 'ES384'; + + /** + * Curve + */ + crv: 'P-384'; + + /** + * Key ID + */ + kid: string; + + /** + * Key Type + */ + kty: 'EC'; + + /** + * X EC coordinate + */ + x: string; + + /** + * Y EC coordinate + */ + y: string; + } +} + +export interface CredentialUpdateParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: + */ + keys: Array< + | CredentialUpdateParams.APIShieldCredentialsJWTKeyRSA + | CredentialUpdateParams.APIShieldCredentialsJWTKeyEcEs256 + | CredentialUpdateParams.APIShieldCredentialsJWTKeyEcEs384 + >; +} + +export namespace CredentialUpdateParams { + /** + * JSON representation of an RSA key. + */ + export interface APIShieldCredentialsJWTKeyRSA { + /** + * Algorithm + */ + alg: 'RS256' | 'RS384' | 'RS512' | 'PS256' | 'PS384' | 'PS512'; + + /** + * RSA exponent + */ + e: string; + + /** + * Key ID + */ + kid: string; + + /** + * Key Type + */ + kty: 'RSA'; + + /** + * RSA modulus + */ + n: string; + } + + /** + * JSON representation of an ES256 key + */ + export interface APIShieldCredentialsJWTKeyEcEs256 { + /** + * Algorithm + */ + alg: 'ES256'; + + /** + * Curve + */ + crv: 'P-256'; + + /** + * Key ID + */ + kid: string; + + /** + * Key Type + */ + kty: 'EC'; + + /** + * X EC coordinate + */ + x: string; + + /** + * Y EC coordinate + */ + y: string; + } + + /** + * JSON representation of an ES384 key + */ + export interface APIShieldCredentialsJWTKeyEcEs384 { + /** + * Algorithm + */ + alg: 'ES384'; + + /** + * Curve + */ + crv: 'P-384'; + + /** + * Key ID + */ + kid: string; + + /** + * Key Type + */ + kty: 'EC'; + + /** + * X EC coordinate + */ + x: string; + + /** + * Y EC coordinate + */ + y: string; + } +} + +export declare namespace Credentials { + export { + type CredentialUpdateResponse as CredentialUpdateResponse, + type CredentialUpdateParams as CredentialUpdateParams, + }; +} diff --git a/src/resources/token-validation/configuration/index.ts b/src/resources/token-validation/configuration/index.ts new file mode 100644 index 0000000000..926e2265b2 --- /dev/null +++ b/src/resources/token-validation/configuration/index.ts @@ -0,0 +1,15 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { Credentials, type CredentialUpdateResponse, type CredentialUpdateParams } from './credentials'; +export { + TokenConfigsV4PagePaginationArray, + Configuration, + type TokenConfig, + type ConfigurationDeleteResponse, + type ConfigurationEditResponse, + type ConfigurationCreateParams, + type ConfigurationListParams, + type ConfigurationDeleteParams, + type ConfigurationEditParams, + type ConfigurationGetParams, +} from './configuration'; diff --git a/src/resources/token-validation/index.ts b/src/resources/token-validation/index.ts new file mode 100644 index 0000000000..47b6bfc852 --- /dev/null +++ b/src/resources/token-validation/index.ts @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + TokenConfigsV4PagePaginationArray, + Configuration, + type TokenConfig, + type ConfigurationDeleteResponse, + type ConfigurationEditResponse, + type ConfigurationCreateParams, + type ConfigurationListParams, + type ConfigurationDeleteParams, + type ConfigurationEditParams, + type ConfigurationGetParams, +} from './configuration/index'; +export { TokenValidation } from './token-validation'; +export { + TokenValidationRulesV4PagePaginationArray, + TokenValidationRulesSinglePage, + Rules, + type TokenValidationRule, + type RuleDeleteResponse, + type RuleCreateParams, + type RuleListParams, + type RuleDeleteParams, + type RuleBulkCreateParams, + type RuleBulkEditParams, + type RuleEditParams, + type RuleGetParams, +} from './rules'; diff --git a/src/resources/token-validation/rules.ts b/src/resources/token-validation/rules.ts new file mode 100644 index 0000000000..bfd7e857b0 --- /dev/null +++ b/src/resources/token-validation/rules.ts @@ -0,0 +1,794 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { SinglePage, V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; + +export class Rules extends APIResource { + /** + * Create a token validation rule. + * + * @example + * ```ts + * const tokenValidationRule = + * await client.tokenValidation.rules.create({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * action: 'log', + * description: + * 'Long description for Token Validation Rule', + * enabled: true, + * expression: + * 'is_jwt_valid("52973293-cb04-4a97-8f55-e7d2ad1107dd") or is_jwt_valid("46eab8d1-6376-45e3-968f-2c649d77d423")', + * selector: {}, + * title: 'Example Token Validation Rule', + * }); + * ``` + */ + create(params: RuleCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/token_validation/rules`, { body, ...options }) as Core.APIPromise<{ + result: TokenValidationRule; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List token validation rules + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const tokenValidationRule of client.tokenValidation.rules.list( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: RuleListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { zone_id, ...query } = params; + return this._client.getAPIList( + `/zones/${zone_id}/token_validation/rules`, + TokenValidationRulesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Delete a zone token validation rule. + * + * @example + * ```ts + * const rule = await client.tokenValidation.rules.delete( + * '4a7ee8d3-dd63-4ceb-9d5f-c27831854ce7', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + ruleId: string, + params: RuleDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.delete(`/zones/${zone_id}/token_validation/rules/${ruleId}`, options) as Core.APIPromise<{ + result: RuleDeleteResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Create zone token validation rules. + * + * A request can create multiple Token Validation Rules. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const tokenValidationRule of client.tokenValidation.rules.bulkCreate( + * { + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * body: [ + * { + * action: 'log', + * description: + * 'Long description for Token Validation Rule', + * enabled: true, + * expression: + * 'is_jwt_valid("52973293-cb04-4a97-8f55-e7d2ad1107dd") or is_jwt_valid("46eab8d1-6376-45e3-968f-2c649d77d423")', + * selector: {}, + * title: 'Example Token Validation Rule', + * }, + * ], + * }, + * )) { + * // ... + * } + * ``` + */ + bulkCreate( + params: RuleBulkCreateParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { zone_id, body } = params; + return this._client.getAPIList( + `/zones/${zone_id}/token_validation/rules/bulk`, + TokenValidationRulesSinglePage, + { body: body, method: 'post', ...options }, + ); + } + + /** + * Edit token validation rules. + * + * A request can update multiple Token Validation Rules. + * + * Rules can be re-ordered using the `position` field. + * + * Returns all updated rules. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const tokenValidationRule of client.tokenValidation.rules.bulkEdit( + * { + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * body: [{ id: '0d9bf70c-92e1-4bb3-9411-34a3bcc59003' }], + * }, + * )) { + * // ... + * } + * ``` + */ + bulkEdit( + params: RuleBulkEditParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { zone_id, body } = params; + return this._client.getAPIList( + `/zones/${zone_id}/token_validation/rules/bulk`, + TokenValidationRulesSinglePage, + { body: body, method: 'patch', ...options }, + ); + } + + /** + * Edit a zone token validation rule. + * + * @example + * ```ts + * const tokenValidationRule = + * await client.tokenValidation.rules.edit( + * '4a7ee8d3-dd63-4ceb-9d5f-c27831854ce7', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + edit( + ruleId: string, + params: RuleEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.patch(`/zones/${zone_id}/token_validation/rules/${ruleId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: TokenValidationRule }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a zone token validation rule. + * + * @example + * ```ts + * const tokenValidationRule = + * await client.tokenValidation.rules.get( + * '4a7ee8d3-dd63-4ceb-9d5f-c27831854ce7', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + ruleId: string, + params: RuleGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.get(`/zones/${zone_id}/token_validation/rules/${ruleId}`, options) as Core.APIPromise<{ + result: TokenValidationRule; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class TokenValidationRulesV4PagePaginationArray extends V4PagePaginationArray {} + +export class TokenValidationRulesSinglePage extends SinglePage {} + +/** + * A Token Validation rule that can enforce security policies using JWT Tokens. + */ +export interface TokenValidationRule { + /** + * Action to take on requests that match operations included in `selector` and fail + * `expression`. + */ + action: 'log' | 'block'; + + /** + * A human-readable description that gives more details than `title`. + */ + description: string; + + /** + * Toggle rule on or off. + */ + enabled: boolean; + + /** + * Rule expression. Requests that fail to match this expression will be subject to + * `action`. + * + * For details on expressions, see the + * [Cloudflare Docs](https://developers.cloudflare.com/api-shield/security/jwt-validation/). + */ + expression: string; + + /** + * Select operations covered by this rule. + * + * For details on selectors, see the + * [Cloudflare Docs](https://developers.cloudflare.com/api-shield/security/jwt-validation/). + */ + selector: TokenValidationRule.Selector; + + /** + * A human-readable name for the rule. + */ + title: string; + + /** + * UUID. + */ + id?: string; + + created_at?: string; + + last_updated?: string; +} + +export namespace TokenValidationRule { + /** + * Select operations covered by this rule. + * + * For details on selectors, see the + * [Cloudflare Docs](https://developers.cloudflare.com/api-shield/security/jwt-validation/). + */ + export interface Selector { + /** + * Ignore operations that were otherwise included by `include`. + */ + exclude?: Array | null; + + /** + * Select all matching operations. + */ + include?: Array | null; + } + + export namespace Selector { + export interface Exclude { + /** + * Excluded operation IDs. + */ + operation_ids?: Array; + } + + export interface Include { + /** + * Included hostnames. + */ + host?: Array; + } + } +} + +export type RuleDeleteResponse = unknown; + +export interface RuleCreateParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: Action to take on requests that match operations included in + * `selector` and fail `expression`. + */ + action: 'log' | 'block'; + + /** + * Body param: A human-readable description that gives more details than `title`. + */ + description: string; + + /** + * Body param: Toggle rule on or off. + */ + enabled: boolean; + + /** + * Body param: Rule expression. Requests that fail to match this expression will be + * subject to `action`. + * + * For details on expressions, see the + * [Cloudflare Docs](https://developers.cloudflare.com/api-shield/security/jwt-validation/). + */ + expression: string; + + /** + * Body param: Select operations covered by this rule. + * + * For details on selectors, see the + * [Cloudflare Docs](https://developers.cloudflare.com/api-shield/security/jwt-validation/). + */ + selector: RuleCreateParams.Selector; + + /** + * Body param: A human-readable name for the rule. + */ + title: string; +} + +export namespace RuleCreateParams { + /** + * Select operations covered by this rule. + * + * For details on selectors, see the + * [Cloudflare Docs](https://developers.cloudflare.com/api-shield/security/jwt-validation/). + */ + export interface Selector { + /** + * Ignore operations that were otherwise included by `include`. + */ + exclude?: Array | null; + + /** + * Select all matching operations. + */ + include?: Array | null; + } + + export namespace Selector { + export interface Exclude { + /** + * Excluded operation IDs. + */ + operation_ids?: Array; + } + + export interface Include { + /** + * Included hostnames. + */ + host?: Array; + } + } +} + +export interface RuleListParams extends V4PagePaginationArrayParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Query param: Select rules with these IDs. + */ + id?: string; + + /** + * Query param: Action to take on requests that match operations included in + * `selector` and fail `expression`. + */ + action?: 'log' | 'block'; + + /** + * Query param: Toggle rule on or off. + */ + enabled?: boolean; + + /** + * Query param: Select rules with this host in `include`. + */ + host?: string; + + /** + * Query param: Select rules with this host in `include`. + */ + hostname?: string; + + /** + * Query param: Select rules with these IDs. + */ + rule_id?: string; + + /** + * Query param: Select rules using any of these token configurations. + */ + token_configuration?: Array; +} + +export interface RuleDeleteParams { + /** + * Identifier. + */ + zone_id: string; +} + +export interface RuleBulkCreateParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: + */ + body: Array; +} + +export namespace RuleBulkCreateParams { + /** + * A Token Validation rule that can enforce security policies using JWT Tokens. + */ + export interface Body { + /** + * Action to take on requests that match operations included in `selector` and fail + * `expression`. + */ + action: 'log' | 'block'; + + /** + * A human-readable description that gives more details than `title`. + */ + description: string; + + /** + * Toggle rule on or off. + */ + enabled: boolean; + + /** + * Rule expression. Requests that fail to match this expression will be subject to + * `action`. + * + * For details on expressions, see the + * [Cloudflare Docs](https://developers.cloudflare.com/api-shield/security/jwt-validation/). + */ + expression: string; + + /** + * Select operations covered by this rule. + * + * For details on selectors, see the + * [Cloudflare Docs](https://developers.cloudflare.com/api-shield/security/jwt-validation/). + */ + selector: Body.Selector; + + /** + * A human-readable name for the rule. + */ + title: string; + } + + export namespace Body { + /** + * Select operations covered by this rule. + * + * For details on selectors, see the + * [Cloudflare Docs](https://developers.cloudflare.com/api-shield/security/jwt-validation/). + */ + export interface Selector { + /** + * Ignore operations that were otherwise included by `include`. + */ + exclude?: Array | null; + + /** + * Select all matching operations. + */ + include?: Array | null; + } + + export namespace Selector { + export interface Exclude { + /** + * Excluded operation IDs. + */ + operation_ids?: Array; + } + + export interface Include { + /** + * Included hostnames. + */ + host?: Array; + } + } + } +} + +export interface RuleBulkEditParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: + */ + body: Array; +} + +export namespace RuleBulkEditParams { + export interface Body { + /** + * Rule ID this patch applies to + */ + id: string; + + /** + * Action to take on requests that match operations included in `selector` and fail + * `expression`. + */ + action?: 'log' | 'block'; + + /** + * A human-readable description that gives more details than `title`. + */ + description?: string; + + /** + * Toggle rule on or off. + */ + enabled?: boolean; + + /** + * Rule expression. Requests that fail to match this expression will be subject to + * `action`. + * + * For details on expressions, see the + * [Cloudflare Docs](https://developers.cloudflare.com/api-shield/security/jwt-validation/). + */ + expression?: string; + + /** + * Update rule order among zone rules. + */ + position?: Body.APIShieldIndex | Body.APIShieldBefore | Body.APIShieldAfter; + + /** + * Select operations covered by this rule. + * + * For details on selectors, see the + * [Cloudflare Docs](https://developers.cloudflare.com/api-shield/security/jwt-validation/). + */ + selector?: Body.Selector; + + /** + * A human-readable name for the rule. + */ + title?: string; + } + + export namespace Body { + export interface APIShieldIndex { + /** + * Move rule to this position + */ + index: number; + } + + /** + * Move rule to after rule with ID. + */ + export interface APIShieldBefore { + /** + * Move rule to before rule with this ID. + */ + before?: string; + } + + /** + * Move rule to before rule with ID. + */ + export interface APIShieldAfter { + /** + * Move rule to after rule with this ID. + */ + after?: string; + } + + /** + * Select operations covered by this rule. + * + * For details on selectors, see the + * [Cloudflare Docs](https://developers.cloudflare.com/api-shield/security/jwt-validation/). + */ + export interface Selector { + /** + * Ignore operations that were otherwise included by `include`. + */ + exclude?: Array | null; + + /** + * Select all matching operations. + */ + include?: Array | null; + } + + export namespace Selector { + export interface Exclude { + /** + * Excluded operation IDs. + */ + operation_ids?: Array; + } + + export interface Include { + /** + * Included hostnames. + */ + host?: Array; + } + } + } +} + +export interface RuleEditParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: Action to take on requests that match operations included in + * `selector` and fail `expression`. + */ + action?: 'log' | 'block'; + + /** + * Body param: A human-readable description that gives more details than `title`. + */ + description?: string; + + /** + * Body param: Toggle rule on or off. + */ + enabled?: boolean; + + /** + * Body param: Rule expression. Requests that fail to match this expression will be + * subject to `action`. + * + * For details on expressions, see the + * [Cloudflare Docs](https://developers.cloudflare.com/api-shield/security/jwt-validation/). + */ + expression?: string; + + /** + * Body param: Update rule order among zone rules. + */ + position?: RuleEditParams.APIShieldIndex | RuleEditParams.APIShieldBefore | RuleEditParams.APIShieldAfter; + + /** + * Body param: Select operations covered by this rule. + * + * For details on selectors, see the + * [Cloudflare Docs](https://developers.cloudflare.com/api-shield/security/jwt-validation/). + */ + selector?: RuleEditParams.Selector; + + /** + * Body param: A human-readable name for the rule. + */ + title?: string; +} + +export namespace RuleEditParams { + export interface APIShieldIndex { + /** + * Move rule to this position + */ + index: number; + } + + /** + * Move rule to after rule with ID. + */ + export interface APIShieldBefore { + /** + * Move rule to before rule with this ID. + */ + before?: string; + } + + /** + * Move rule to before rule with ID. + */ + export interface APIShieldAfter { + /** + * Move rule to after rule with this ID. + */ + after?: string; + } + + /** + * Select operations covered by this rule. + * + * For details on selectors, see the + * [Cloudflare Docs](https://developers.cloudflare.com/api-shield/security/jwt-validation/). + */ + export interface Selector { + /** + * Ignore operations that were otherwise included by `include`. + */ + exclude?: Array | null; + + /** + * Select all matching operations. + */ + include?: Array | null; + } + + export namespace Selector { + export interface Exclude { + /** + * Excluded operation IDs. + */ + operation_ids?: Array; + } + + export interface Include { + /** + * Included hostnames. + */ + host?: Array; + } + } +} + +export interface RuleGetParams { + /** + * Identifier. + */ + zone_id: string; +} + +Rules.TokenValidationRulesV4PagePaginationArray = TokenValidationRulesV4PagePaginationArray; +Rules.TokenValidationRulesSinglePage = TokenValidationRulesSinglePage; + +export declare namespace Rules { + export { + type TokenValidationRule as TokenValidationRule, + type RuleDeleteResponse as RuleDeleteResponse, + TokenValidationRulesV4PagePaginationArray as TokenValidationRulesV4PagePaginationArray, + TokenValidationRulesSinglePage as TokenValidationRulesSinglePage, + type RuleCreateParams as RuleCreateParams, + type RuleListParams as RuleListParams, + type RuleDeleteParams as RuleDeleteParams, + type RuleBulkCreateParams as RuleBulkCreateParams, + type RuleBulkEditParams as RuleBulkEditParams, + type RuleEditParams as RuleEditParams, + type RuleGetParams as RuleGetParams, + }; +} diff --git a/src/resources/token-validation/token-validation.ts b/src/resources/token-validation/token-validation.ts new file mode 100644 index 0000000000..7d68e71fb4 --- /dev/null +++ b/src/resources/token-validation/token-validation.ts @@ -0,0 +1,72 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as RulesAPI from './rules'; +import { + RuleBulkCreateParams, + RuleBulkEditParams, + RuleCreateParams, + RuleDeleteParams, + RuleDeleteResponse, + RuleEditParams, + RuleGetParams, + RuleListParams, + Rules, + TokenValidationRule, + TokenValidationRulesSinglePage, + TokenValidationRulesV4PagePaginationArray, +} from './rules'; +import * as ConfigurationAPI from './configuration/configuration'; +import { + Configuration, + ConfigurationCreateParams, + ConfigurationDeleteParams, + ConfigurationDeleteResponse, + ConfigurationEditParams, + ConfigurationEditResponse, + ConfigurationGetParams, + ConfigurationListParams, + TokenConfig, + TokenConfigsV4PagePaginationArray, +} from './configuration/configuration'; + +export class TokenValidation extends APIResource { + configuration: ConfigurationAPI.Configuration = new ConfigurationAPI.Configuration(this._client); + rules: RulesAPI.Rules = new RulesAPI.Rules(this._client); +} + +TokenValidation.Configuration = Configuration; +TokenValidation.TokenConfigsV4PagePaginationArray = TokenConfigsV4PagePaginationArray; +TokenValidation.Rules = Rules; +TokenValidation.TokenValidationRulesV4PagePaginationArray = TokenValidationRulesV4PagePaginationArray; +TokenValidation.TokenValidationRulesSinglePage = TokenValidationRulesSinglePage; + +export declare namespace TokenValidation { + export { + Configuration as Configuration, + type TokenConfig as TokenConfig, + type ConfigurationDeleteResponse as ConfigurationDeleteResponse, + type ConfigurationEditResponse as ConfigurationEditResponse, + TokenConfigsV4PagePaginationArray as TokenConfigsV4PagePaginationArray, + type ConfigurationCreateParams as ConfigurationCreateParams, + type ConfigurationListParams as ConfigurationListParams, + type ConfigurationDeleteParams as ConfigurationDeleteParams, + type ConfigurationEditParams as ConfigurationEditParams, + type ConfigurationGetParams as ConfigurationGetParams, + }; + + export { + Rules as Rules, + type TokenValidationRule as TokenValidationRule, + type RuleDeleteResponse as RuleDeleteResponse, + TokenValidationRulesV4PagePaginationArray as TokenValidationRulesV4PagePaginationArray, + TokenValidationRulesSinglePage as TokenValidationRulesSinglePage, + type RuleCreateParams as RuleCreateParams, + type RuleListParams as RuleListParams, + type RuleDeleteParams as RuleDeleteParams, + type RuleBulkCreateParams as RuleBulkCreateParams, + type RuleBulkEditParams as RuleBulkEditParams, + type RuleEditParams as RuleEditParams, + type RuleGetParams as RuleGetParams, + }; +} diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts index 8b15a53e2d..d2cb382d90 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts @@ -63,7 +63,6 @@ export type BindingGetResponse = | BindingGetResponse.WorkersBindingKindSecretText | BindingGetResponse.WorkersBindingKindSendEmail | BindingGetResponse.WorkersBindingKindService - | BindingGetResponse.WorkersBindingKindTailConsumer | BindingGetResponse.WorkersBindingKindTextBlob | BindingGetResponse.WorkersBindingKindVectorize | BindingGetResponse.WorkersBindingKindVersionMetadata @@ -168,7 +167,7 @@ export namespace BindingGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -493,23 +492,6 @@ export namespace BindingGetResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts index 9170366dbd..8536843291 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -175,7 +175,7 @@ export interface ScriptUpdateResponse { startup_time_ms: number; /** - * The id of the script in the Workers system. Usually the script name. + * The name used to identify the script. */ id?: string; @@ -197,6 +197,11 @@ export interface ScriptUpdateResponse { */ created_on?: string; + /** + * The entry point for the script. + */ + entry_point?: string; + /** * Hashed script content, can be used in a If-None-Match header when updating. */ @@ -244,6 +249,11 @@ export interface ScriptUpdateResponse { */ named_handlers?: Array; + /** + * Observability settings for the Worker. + */ + observability?: ScriptUpdateResponse.Observability; + /** * Configuration for * [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). @@ -260,10 +270,20 @@ export interface ScriptUpdateResponse { */ placement_status?: 'SUCCESS' | 'UNSUPPORTED_APPLICATION' | 'INSUFFICIENT_INVOCATIONS'; + /** + * The immutable ID of the script. + */ + tag?: string; + + /** + * Tags associated with the Worker. + */ + tags?: Array | null; + /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array | null; /** * Usage model for the Worker invocations. @@ -284,6 +304,61 @@ export namespace ScriptUpdateResponse { name?: string; } + /** + * Observability settings for the Worker. + */ + export interface Observability { + /** + * Whether observability is enabled for the Worker. + */ + enabled: boolean; + + /** + * The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). + * Default is 1. + */ + head_sampling_rate?: number | null; + + /** + * Log settings for the Worker. + */ + logs?: Observability.Logs | null; + } + + export namespace Observability { + /** + * Log settings for the Worker. + */ + export interface Logs { + /** + * Whether logs are enabled for the Worker. + */ + enabled: boolean; + + /** + * Whether + * [invocation logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/#invocation-logs) + * are enabled for the Worker. + */ + invocation_logs: boolean; + + /** + * A list of destinations where logs will be exported to. + */ + destinations?: Array; + + /** + * The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1. + */ + head_sampling_rate?: number | null; + + /** + * Whether log persistence is enabled for the Worker. + */ + persist?: boolean; + } + } + /** * Configuration for * [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). @@ -372,7 +447,6 @@ export namespace ScriptUpdateParams { | Metadata.WorkersBindingKindSecretText | Metadata.WorkersBindingKindSendEmail | Metadata.WorkersBindingKindService - | Metadata.WorkersBindingKindTailConsumer | Metadata.WorkersBindingKindTextBlob | Metadata.WorkersBindingKindVectorize | Metadata.WorkersBindingKindVersionMetadata @@ -452,7 +526,7 @@ export namespace ScriptUpdateParams { /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array | null; /** * Usage model for the Worker invocations. @@ -616,7 +690,7 @@ export namespace ScriptUpdateParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -946,23 +1020,6 @@ export namespace ScriptUpdateParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts index fea3a53ffc..436d10f14e 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -91,7 +91,6 @@ export interface SettingEditResponse { | SettingEditResponse.WorkersBindingKindSecretText | SettingEditResponse.WorkersBindingKindSendEmail | SettingEditResponse.WorkersBindingKindService - | SettingEditResponse.WorkersBindingKindTailConsumer | SettingEditResponse.WorkersBindingKindTextBlob | SettingEditResponse.WorkersBindingKindVectorize | SettingEditResponse.WorkersBindingKindVersionMetadata @@ -138,12 +137,12 @@ export interface SettingEditResponse { /** * Tags associated with the Worker. */ - tags?: Array; + tags?: Array | null; /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array | null; /** * Usage model for the Worker invocations. @@ -247,7 +246,7 @@ export namespace SettingEditResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -572,23 +571,6 @@ export namespace SettingEditResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -843,7 +825,6 @@ export interface SettingGetResponse { | SettingGetResponse.WorkersBindingKindSecretText | SettingGetResponse.WorkersBindingKindSendEmail | SettingGetResponse.WorkersBindingKindService - | SettingGetResponse.WorkersBindingKindTailConsumer | SettingGetResponse.WorkersBindingKindTextBlob | SettingGetResponse.WorkersBindingKindVectorize | SettingGetResponse.WorkersBindingKindVersionMetadata @@ -890,12 +871,12 @@ export interface SettingGetResponse { /** * Tags associated with the Worker. */ - tags?: Array; + tags?: Array | null; /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array | null; /** * Usage model for the Worker invocations. @@ -999,7 +980,7 @@ export namespace SettingGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1324,23 +1305,6 @@ export namespace SettingGetResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1608,7 +1572,6 @@ export namespace SettingEditParams { | Settings.WorkersBindingKindSecretText | Settings.WorkersBindingKindSendEmail | Settings.WorkersBindingKindService - | Settings.WorkersBindingKindTailConsumer | Settings.WorkersBindingKindTextBlob | Settings.WorkersBindingKindVectorize | Settings.WorkersBindingKindVersionMetadata @@ -1660,12 +1623,12 @@ export namespace SettingEditParams { /** * Tags associated with the Worker. */ - tags?: Array; + tags?: Array | null; /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array | null; /** * Usage model for the Worker invocations. @@ -1769,7 +1732,7 @@ export namespace SettingEditParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -2099,23 +2062,6 @@ export namespace SettingEditParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/tags.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/tags.ts index 73ea9f79b9..b1a6bd94be 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/tags.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/tags.ts @@ -116,7 +116,7 @@ export interface TagUpdateParams { /** * Body param: Tags associated with the Worker. */ - body: Array; + body: Array | null; } export interface TagListParams { diff --git a/src/resources/workers/beta/workers/versions.ts b/src/resources/workers/beta/workers/versions.ts index 300510fc56..66bebbd506 100644 --- a/src/resources/workers/beta/workers/versions.ts +++ b/src/resources/workers/beta/workers/versions.ts @@ -176,7 +176,6 @@ export interface Version { | Version.WorkersBindingKindSecretText | Version.WorkersBindingKindSendEmail | Version.WorkersBindingKindService - | Version.WorkersBindingKindTailConsumer | Version.WorkersBindingKindTextBlob | Version.WorkersBindingKindVectorize | Version.WorkersBindingKindVersionMetadata @@ -409,7 +408,7 @@ export namespace Version { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -734,23 +733,6 @@ export namespace Version { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1039,7 +1021,6 @@ export interface VersionCreateParams { | VersionCreateParams.WorkersBindingKindSecretText | VersionCreateParams.WorkersBindingKindSendEmail | VersionCreateParams.WorkersBindingKindService - | VersionCreateParams.WorkersBindingKindTailConsumer | VersionCreateParams.WorkersBindingKindTextBlob | VersionCreateParams.WorkersBindingKindVectorize | VersionCreateParams.WorkersBindingKindVersionMetadata @@ -1263,7 +1244,7 @@ export namespace VersionCreateParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1593,23 +1574,6 @@ export namespace VersionCreateParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers/beta/workers/workers.ts b/src/resources/workers/beta/workers/workers.ts index ba7791704e..d4e49b0055 100644 --- a/src/resources/workers/beta/workers/workers.ts +++ b/src/resources/workers/beta/workers/workers.ts @@ -193,6 +193,11 @@ export interface Worker { */ observability: Worker.Observability; + /** + * Other resources that reference the Worker and depend on it existing. + */ + references: Worker.References; + /** * Subdomain settings for the Worker. */ @@ -259,6 +264,139 @@ export namespace Worker { } } + /** + * Other resources that reference the Worker and depend on it existing. + */ + export interface References { + /** + * Other Workers that reference the Worker as an outbound for a dispatch namespace. + */ + dispatch_namespace_outbounds: Array; + + /** + * Custom domains connected to the Worker. + */ + domains: Array; + + /** + * Other Workers that reference Durable Object classes implemented by the Worker. + */ + durable_objects: Array; + + /** + * Queues that send messages to the Worker. + */ + queues: Array; + + /** + * Other Workers that reference the Worker using + * [service bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/). + */ + workers: Array; + } + + export namespace References { + export interface DispatchNamespaceOutbound { + /** + * ID of the dispatch namespace. + */ + namespace_id: string; + + /** + * Name of the dispatch namespace. + */ + namespace_name: string; + + /** + * ID of the Worker using the dispatch namespace. + */ + worker_id: string; + + /** + * Name of the Worker using the dispatch namespace. + */ + worker_name: string; + } + + export interface Domain { + /** + * ID of the custom domain. + */ + id: string; + + /** + * ID of the TLS certificate issued for the custom domain. + */ + certificate_id: string; + + /** + * Full hostname of the custom domain, including the zone name. + */ + hostname: string; + + /** + * ID of the zone. + */ + zone_id: string; + + /** + * Name of the zone. + */ + zone_name: string; + } + + export interface DurableObject { + /** + * ID of the Durable Object namespace being used. + */ + namespace_id: string; + + /** + * Name of the Durable Object namespace being used. + */ + namespace_name: string; + + /** + * ID of the Worker using the Durable Object implementation. + */ + worker_id: string; + + /** + * Name of the Worker using the Durable Object implementation. + */ + worker_name: string; + } + + export interface Queue { + /** + * ID of the queue consumer configuration. + */ + queue_consumer_id: string; + + /** + * ID of the queue. + */ + queue_id: string; + + /** + * Name of the queue. + */ + queue_name: string; + } + + export interface Worker { + /** + * ID of the referencing Worker. + */ + id: string; + + /** + * Name of the referencing Worker. + */ + name: string; + } + } + /** * Subdomain settings for the Worker. */ diff --git a/src/resources/workers/index.ts b/src/resources/workers/index.ts index 08d046d2c3..67c98e03aa 100644 --- a/src/resources/workers/index.ts +++ b/src/resources/workers/index.ts @@ -34,11 +34,12 @@ export { type RouteGetParams, } from './routes'; export { - ScriptsSinglePage, + ScriptListResponsesSinglePage, Scripts, type Script, type ScriptSetting, type ScriptUpdateResponse, + type ScriptListResponse, type ScriptDeleteResponse, type ScriptGetResponse, type ScriptSearchResponse, @@ -53,6 +54,7 @@ export { type SubdomainUpdateResponse, type SubdomainGetResponse, type SubdomainUpdateParams, + type SubdomainDeleteParams, type SubdomainGetParams, } from './subdomains'; export { Workers } from './workers'; diff --git a/src/resources/workers/scripts/index.ts b/src/resources/workers/scripts/index.ts index 4bbd0bb198..6fe0155b7b 100644 --- a/src/resources/workers/scripts/index.ts +++ b/src/resources/workers/scripts/index.ts @@ -27,11 +27,12 @@ export { type ScriptAndVersionSettingGetParams, } from './script-and-version-settings'; export { - ScriptsSinglePage, + ScriptListResponsesSinglePage, Scripts, type Script, type ScriptSetting, type ScriptUpdateResponse, + type ScriptListResponse, type ScriptDeleteResponse, type ScriptGetResponse, type ScriptSearchResponse, diff --git a/src/resources/workers/scripts/script-and-version-settings.ts b/src/resources/workers/scripts/script-and-version-settings.ts index 05bc7152a0..ea56961922 100644 --- a/src/resources/workers/scripts/script-and-version-settings.ts +++ b/src/resources/workers/scripts/script-and-version-settings.ts @@ -87,7 +87,6 @@ export interface ScriptAndVersionSettingEditResponse { | ScriptAndVersionSettingEditResponse.WorkersBindingKindSecretText | ScriptAndVersionSettingEditResponse.WorkersBindingKindSendEmail | ScriptAndVersionSettingEditResponse.WorkersBindingKindService - | ScriptAndVersionSettingEditResponse.WorkersBindingKindTailConsumer | ScriptAndVersionSettingEditResponse.WorkersBindingKindTextBlob | ScriptAndVersionSettingEditResponse.WorkersBindingKindVectorize | ScriptAndVersionSettingEditResponse.WorkersBindingKindVersionMetadata @@ -134,12 +133,12 @@ export interface ScriptAndVersionSettingEditResponse { /** * Tags associated with the Worker. */ - tags?: Array; + tags?: Array | null; /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array | null; /** * Usage model for the Worker invocations. @@ -243,7 +242,7 @@ export namespace ScriptAndVersionSettingEditResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -568,23 +567,6 @@ export namespace ScriptAndVersionSettingEditResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -839,7 +821,6 @@ export interface ScriptAndVersionSettingGetResponse { | ScriptAndVersionSettingGetResponse.WorkersBindingKindSecretText | ScriptAndVersionSettingGetResponse.WorkersBindingKindSendEmail | ScriptAndVersionSettingGetResponse.WorkersBindingKindService - | ScriptAndVersionSettingGetResponse.WorkersBindingKindTailConsumer | ScriptAndVersionSettingGetResponse.WorkersBindingKindTextBlob | ScriptAndVersionSettingGetResponse.WorkersBindingKindVectorize | ScriptAndVersionSettingGetResponse.WorkersBindingKindVersionMetadata @@ -886,12 +867,12 @@ export interface ScriptAndVersionSettingGetResponse { /** * Tags associated with the Worker. */ - tags?: Array; + tags?: Array | null; /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array | null; /** * Usage model for the Worker invocations. @@ -995,7 +976,7 @@ export namespace ScriptAndVersionSettingGetResponse { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -1320,23 +1301,6 @@ export namespace ScriptAndVersionSettingGetResponse { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. @@ -1604,7 +1568,6 @@ export namespace ScriptAndVersionSettingEditParams { | Settings.WorkersBindingKindSecretText | Settings.WorkersBindingKindSendEmail | Settings.WorkersBindingKindService - | Settings.WorkersBindingKindTailConsumer | Settings.WorkersBindingKindTextBlob | Settings.WorkersBindingKindVectorize | Settings.WorkersBindingKindVersionMetadata @@ -1656,12 +1619,12 @@ export namespace ScriptAndVersionSettingEditParams { /** * Tags associated with the Worker. */ - tags?: Array; + tags?: Array | null; /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array | null; /** * Usage model for the Worker invocations. @@ -1765,7 +1728,7 @@ export namespace ScriptAndVersionSettingEditParams { name: string; /** - * Namespace to bind to. + * The name of the dispatch namespace. */ namespace: string; @@ -2095,23 +2058,6 @@ export namespace ScriptAndVersionSettingEditParams { environment?: string; } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Tail Worker to bind to. - */ - service: string; - - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } - export interface WorkersBindingKindTextBlob { /** * A JavaScript variable name for the binding. diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index d96bb354dc..e3f4f45945 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -137,16 +137,19 @@ export class Scripts extends APIResource { * @example * ```ts * // Automatically fetches more pages as needed. - * for await (const script of client.workers.scripts.list({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * })) { + * for await (const scriptListResponse of client.workers.scripts.list( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { * // ... * } * ``` */ - list(params: ScriptListParams, options?: Core.RequestOptions): Core.PagePromise { + list( + params: ScriptListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { const { account_id, ...query } = params; - return this._client.getAPIList(`/accounts/${account_id}/workers/scripts`, ScriptsSinglePage, { + return this._client.getAPIList(`/accounts/${account_id}/workers/scripts`, ScriptListResponsesSinglePage, { query, ...options, }); @@ -218,11 +221,11 @@ export class Scripts extends APIResource { } } -export class ScriptsSinglePage extends SinglePage