diff --git a/.stats.yml b/.stats.yml index 42d2723898..0692994e46 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 1111 +configured_endpoints: 1168 diff --git a/api.md b/api.md index 3533902eed..4201a33d1e 100644 --- a/api.md +++ b/api.md @@ -495,12 +495,12 @@ Types: Methods: -- client.access.applications.create(accountOrZone, accountOrZoneId, { ...params }) -> ApplicationCreateResponse -- client.access.applications.update(accountOrZone, accountOrZoneId, appId, { ...params }) -> ApplicationUpdateResponse -- client.access.applications.list(accountOrZone, accountOrZoneId) -> ApplicationListResponse | null -- client.access.applications.delete(accountOrZone, accountOrZoneId, appId) -> ApplicationDeleteResponse -- client.access.applications.get(accountOrZone, accountOrZoneId, appId) -> ApplicationGetResponse -- client.access.applications.revokeTokens(accountOrZone, accountOrZoneId, appId) -> ApplicationRevokeTokensResponse | null +- client.access.applications.create({ ...params }) -> ApplicationCreateResponse +- client.access.applications.update(appId, { ...params }) -> ApplicationUpdateResponse +- client.access.applications.list({ ...params }) -> ApplicationListResponse | null +- client.access.applications.delete(appId, { ...params }) -> ApplicationDeleteResponse +- client.access.applications.get(appId, { ...params }) -> ApplicationGetResponse +- client.access.applications.revokeTokens(appId, { ...params }) -> ApplicationRevokeTokensResponse | null ### Cas @@ -513,10 +513,10 @@ Types: Methods: -- client.access.applications.cas.create(accountOrZone, accountOrZoneId, uuid) -> CaCreateResponse -- client.access.applications.cas.list(accountOrZone, accountOrZoneId) -> CaListResponse | null -- client.access.applications.cas.delete(accountOrZone, accountOrZoneId, uuid) -> CaDeleteResponse -- client.access.applications.cas.get(accountOrZone, accountOrZoneId, uuid) -> CaGetResponse +- client.access.applications.cas.create(uuid, { ...params }) -> CaCreateResponse +- client.access.applications.cas.list({ ...params }) -> CaListResponse | null +- client.access.applications.cas.delete(uuid, { ...params }) -> CaDeleteResponse +- client.access.applications.cas.get(uuid, { ...params }) -> CaGetResponse ### UserPolicyChecks @@ -526,7 +526,7 @@ Types: Methods: -- client.access.applications.userPolicyChecks.list(accountOrZone, accountOrZoneId, appId) -> UserPolicyCheckListResponse +- client.access.applications.userPolicyChecks.list(appId, { ...params }) -> UserPolicyCheckListResponse ### Policies @@ -540,11 +540,11 @@ Types: Methods: -- client.access.applications.policies.create(accountOrZone, accountOrZoneId, uuid, { ...params }) -> PolicyCreateResponse -- client.access.applications.policies.update(accountOrZone, accountOrZoneId, uuid1, uuid, { ...params }) -> PolicyUpdateResponse -- client.access.applications.policies.list(accountOrZone, accountOrZoneId, uuid) -> PolicyListResponse | null -- client.access.applications.policies.delete(accountOrZone, accountOrZoneId, uuid1, uuid) -> PolicyDeleteResponse -- client.access.applications.policies.get(accountOrZone, accountOrZoneId, uuid1, uuid) -> PolicyGetResponse +- client.access.applications.policies.create(uuid, { ...params }) -> PolicyCreateResponse +- client.access.applications.policies.update(uuid1, uuid, { ...params }) -> PolicyUpdateResponse +- client.access.applications.policies.list(uuid, { ...params }) -> PolicyListResponse | null +- client.access.applications.policies.delete(uuid1, uuid, { ...params }) -> PolicyDeleteResponse +- client.access.applications.policies.get(uuid1, uuid, { ...params }) -> PolicyGetResponse ## Certificates @@ -558,11 +558,11 @@ Types: Methods: -- client.access.certificates.create(accountOrZone, accountOrZoneId, { ...params }) -> CertificateCreateResponse -- client.access.certificates.update(accountOrZone, accountOrZoneId, uuid, { ...params }) -> CertificateUpdateResponse -- client.access.certificates.list(accountOrZone, accountOrZoneId) -> CertificateListResponse | null -- client.access.certificates.delete(accountOrZone, accountOrZoneId, uuid) -> CertificateDeleteResponse -- client.access.certificates.get(accountOrZone, accountOrZoneId, uuid) -> CertificateGetResponse +- client.access.certificates.create({ ...params }) -> CertificateCreateResponse +- client.access.certificates.update(uuid, { ...params }) -> CertificateUpdateResponse +- client.access.certificates.list({ ...params }) -> CertificateListResponse | null +- client.access.certificates.delete(uuid, { ...params }) -> CertificateDeleteResponse +- client.access.certificates.get(uuid, { ...params }) -> CertificateGetResponse ### Settings @@ -573,8 +573,8 @@ Types: Methods: -- client.access.certificates.settings.update(accountOrZone, accountOrZoneId, { ...params }) -> SettingUpdateResponse | null -- client.access.certificates.settings.list(accountOrZone, accountOrZoneId) -> SettingListResponse | null +- client.access.certificates.settings.update({ ...params }) -> SettingUpdateResponse | null +- client.access.certificates.settings.list({ ...params }) -> SettingListResponse | null ## Groups @@ -588,11 +588,11 @@ Types: Methods: -- client.access.groups.create(accountOrZone, accountOrZoneId, { ...params }) -> GroupCreateResponse -- client.access.groups.update(accountOrZone, accountOrZoneId, uuid, { ...params }) -> GroupUpdateResponse -- client.access.groups.list(accountOrZone, accountOrZoneId) -> GroupListResponse | null -- client.access.groups.delete(accountOrZone, accountOrZoneId, uuid) -> GroupDeleteResponse -- client.access.groups.get(accountOrZone, accountOrZoneId, uuid) -> GroupGetResponse +- client.access.groups.create({ ...params }) -> GroupCreateResponse +- client.access.groups.update(uuid, { ...params }) -> GroupUpdateResponse +- client.access.groups.list({ ...params }) -> GroupListResponse | null +- client.access.groups.delete(uuid, { ...params }) -> GroupDeleteResponse +- client.access.groups.get(uuid, { ...params }) -> GroupGetResponse ## IdentityProviders @@ -606,11 +606,11 @@ Types: Methods: -- client.access.identityProviders.create(accountOrZone, accountOrZoneId, { ...params }) -> IdentityProviderCreateResponse -- client.access.identityProviders.update(accountOrZone, accountOrZoneId, uuid, { ...params }) -> IdentityProviderUpdateResponse -- client.access.identityProviders.list(accountOrZone, accountOrZoneId) -> IdentityProviderListResponse | null -- client.access.identityProviders.delete(accountOrZone, accountOrZoneId, uuid) -> IdentityProviderDeleteResponse -- client.access.identityProviders.get(accountOrZone, accountOrZoneId, uuid) -> IdentityProviderGetResponse +- client.access.identityProviders.create({ ...params }) -> IdentityProviderCreateResponse +- client.access.identityProviders.update(uuid, { ...params }) -> IdentityProviderUpdateResponse +- client.access.identityProviders.list({ ...params }) -> IdentityProviderListResponse | null +- client.access.identityProviders.delete(uuid, { ...params }) -> IdentityProviderDeleteResponse +- client.access.identityProviders.get(uuid, { ...params }) -> IdentityProviderGetResponse ## Organizations @@ -623,10 +623,10 @@ Types: Methods: -- client.access.organizations.create(accountOrZone, accountOrZoneId, { ...params }) -> OrganizationCreateResponse -- client.access.organizations.update(accountOrZone, accountOrZoneId, { ...params }) -> OrganizationUpdateResponse -- client.access.organizations.list(accountOrZone, accountOrZoneId) -> OrganizationListResponse -- client.access.organizations.revokeUsers(accountOrZone, accountOrZoneId, { ...params }) -> OrganizationRevokeUsersResponse +- client.access.organizations.create({ ...params }) -> OrganizationCreateResponse +- client.access.organizations.update({ ...params }) -> OrganizationUpdateResponse +- client.access.organizations.list({ ...params }) -> OrganizationListResponse +- client.access.organizations.revokeUsers({ ...params }) -> OrganizationRevokeUsersResponse ## ServiceTokens @@ -641,10 +641,10 @@ Types: Methods: -- client.access.serviceTokens.create(accountOrZone, accountOrZoneId, { ...params }) -> ServiceTokenCreateResponse -- client.access.serviceTokens.update(accountOrZone, accountOrZoneId, uuid, { ...params }) -> ServiceTokenUpdateResponse -- client.access.serviceTokens.list(accountOrZone, accountOrZoneId) -> ServiceTokenListResponse | null -- client.access.serviceTokens.delete(accountOrZone, accountOrZoneId, uuid) -> ServiceTokenDeleteResponse +- client.access.serviceTokens.create({ ...params }) -> ServiceTokenCreateResponse +- client.access.serviceTokens.update(uuid, { ...params }) -> ServiceTokenUpdateResponse +- client.access.serviceTokens.list({ ...params }) -> ServiceTokenListResponse | null +- client.access.serviceTokens.delete(uuid, { ...params }) -> ServiceTokenDeleteResponse - client.access.serviceTokens.refresh(identifier, uuid) -> ServiceTokenRefreshResponse - client.access.serviceTokens.rotate(identifier, uuid) -> ServiceTokenRotateResponse @@ -810,17 +810,17 @@ Methods: - client.cache.purge(zoneId, { ...params }) -> CachePurgeResponse | null -## CacheReserves +## CacheReserve Types: -- CacheReserveListResponse -- CacheReserveEditResponse +- CacheReserveListResponse +- CacheReserveEditResponse Methods: -- client.cache.cacheReserves.list(zoneId) -> CacheReserveListResponse -- client.cache.cacheReserves.edit(zoneId, { ...params }) -> CacheReserveEditResponse +- client.cache.cacheReserve.list(zoneId) -> CacheReserveListResponse +- client.cache.cacheReserve.edit(zoneId, { ...params }) -> CacheReserveEditResponse ## TieredCacheSmartTopology @@ -1332,11 +1332,11 @@ Types: Methods: -- client.firewalls.accessRules.create(accountOrZone, accountOrZoneId, { ...params }) -> AccessRuleCreateResponse | null -- client.firewalls.accessRules.list(accountOrZone, accountOrZoneId, { ...params }) -> AccessRuleListResponsesV4PagePaginationArray -- client.firewalls.accessRules.delete(accountOrZone, accountOrZoneId, identifier) -> AccessRuleDeleteResponse | null +- client.firewalls.accessRules.create({ ...params }) -> AccessRuleCreateResponse | null +- client.firewalls.accessRules.list({ ...params }) -> AccessRuleListResponsesV4PagePaginationArray +- client.firewalls.accessRules.delete(identifier, { ...params }) -> AccessRuleDeleteResponse | null - client.firewalls.accessRules.edit(identifier, { ...params }) -> AccessRuleEditResponse | null -- client.firewalls.accessRules.get(accountOrZone, accountOrZoneId, identifier) -> AccessRuleGetResponse | null +- client.firewalls.accessRules.get(identifier, { ...params }) -> AccessRuleGetResponse | null ## UaRules @@ -1478,7 +1478,7 @@ Types: Methods: -- client.logpush.datasets.fields.list(accountOrZone, accountOrZoneId, datasetId) -> FieldListResponse +- client.logpush.datasets.fields.list(datasetId, { ...params }) -> FieldListResponse ### Jobs @@ -1488,7 +1488,7 @@ Types: Methods: -- client.logpush.datasets.jobs.list(accountOrZone, accountOrZoneId, datasetId) -> JobListResponse +- client.logpush.datasets.jobs.list(datasetId, { ...params }) -> JobListResponse ## Edge @@ -1514,11 +1514,11 @@ Types: Methods: -- client.logpush.jobs.create(accountOrZone, accountOrZoneId, { ...params }) -> JobCreateResponse | null -- client.logpush.jobs.update(accountOrZone, accountOrZoneId, jobId, { ...params }) -> JobUpdateResponse | null -- client.logpush.jobs.list(accountOrZone, accountOrZoneId) -> JobListResponse -- client.logpush.jobs.delete(accountOrZone, accountOrZoneId, jobId) -> JobDeleteResponse | null -- client.logpush.jobs.get(accountOrZone, accountOrZoneId, jobId) -> JobGetResponse | null +- client.logpush.jobs.create({ ...params }) -> JobCreateResponse | null +- client.logpush.jobs.update(jobId, { ...params }) -> JobUpdateResponse | null +- client.logpush.jobs.list({ ...params }) -> JobListResponse +- client.logpush.jobs.delete(jobId, { ...params }) -> JobDeleteResponse | null +- client.logpush.jobs.get(jobId, { ...params }) -> JobGetResponse | null ## Ownership @@ -1529,8 +1529,8 @@ Types: Methods: -- client.logpush.ownership.create(accountOrZone, accountOrZoneId, { ...params }) -> OwnershipCreateResponse | null -- client.logpush.ownership.validate(accountOrZone, accountOrZoneId, { ...params }) -> OwnershipValidateResponse | null +- client.logpush.ownership.create({ ...params }) -> OwnershipCreateResponse | null +- client.logpush.ownership.validate({ ...params }) -> OwnershipValidateResponse | null ## Validate @@ -1541,8 +1541,8 @@ Types: Methods: -- client.logpush.validate.destination(accountOrZone, accountOrZoneId, { ...params }) -> ValidateDestinationResponse | null -- client.logpush.validate.origin(accountOrZone, accountOrZoneId, { ...params }) -> ValidateOriginResponse | null +- client.logpush.validate.destination({ ...params }) -> ValidateDestinationResponse | null +- client.logpush.validate.origin({ ...params }) -> ValidateOriginResponse | null # Logs @@ -2925,11 +2925,11 @@ Types: Methods: -- client.rulesets.create(accountOrZone, accountOrZoneId, { ...params }) -> RulesetCreateResponse -- client.rulesets.update(accountOrZone, accountOrZoneId, rulesetId, { ...params }) -> RulesetUpdateResponse -- client.rulesets.list(accountOrZone, accountOrZoneId) -> RulesetListResponse -- client.rulesets.delete(accountOrZone, accountOrZoneId, rulesetId) -> void -- client.rulesets.get(accountOrZone, accountOrZoneId, rulesetId) -> RulesetGetResponse +- client.rulesets.create({ ...params }) -> RulesetCreateResponse +- client.rulesets.update(rulesetId, { ...params }) -> RulesetUpdateResponse +- client.rulesets.list({ ...params }) -> RulesetListResponse +- client.rulesets.delete(rulesetId, { ...params }) -> void +- client.rulesets.get(rulesetId, { ...params }) -> RulesetGetResponse ## Phases @@ -2939,7 +2939,7 @@ Types: Methods: -- client.rulesets.phases.get(accountOrZone, accountOrZoneId, rulesetPhase) -> PhaseGetResponse +- client.rulesets.phases.get(rulesetPhase, { ...params }) -> PhaseGetResponse ## Rules @@ -2951,8 +2951,8 @@ Types: Methods: -- client.rulesets.rules.create(accountOrZone, accountOrZoneId, rulesetId, { ...params }) -> RuleCreateResponse -- client.rulesets.rules.delete(accountOrZone, accountOrZoneId, rulesetId, ruleId) -> RuleDeleteResponse +- client.rulesets.rules.create(rulesetId, { ...params }) -> RuleCreateResponse +- client.rulesets.rules.delete(rulesetId, ruleId, { ...params }) -> RuleDeleteResponse - client.rulesets.rules.edit(rulesetId, ruleId, { ...params }) -> RuleEditResponse ## Versions @@ -2964,9 +2964,9 @@ Types: Methods: -- client.rulesets.versions.list(accountOrZone, accountOrZoneId, rulesetId) -> VersionListResponse -- client.rulesets.versions.delete(accountOrZone, accountOrZoneId, rulesetId, rulesetVersion) -> void -- client.rulesets.versions.get(accountOrZone, accountOrZoneId, rulesetId, rulesetVersion) -> VersionGetResponse +- client.rulesets.versions.list(rulesetId, { ...params }) -> VersionListResponse +- client.rulesets.versions.delete(rulesetId, rulesetVersion, { ...params }) -> void +- client.rulesets.versions.get(rulesetId, rulesetVersion, { ...params }) -> VersionGetResponse ### ByTags @@ -4937,6 +4937,20 @@ Methods: - client.r2.buckets.delete(accountId, bucketName) -> BucketDeleteResponse - client.r2.buckets.get(accountId, bucketName) -> BucketGetResponse +## Sippy + +Types: + +- SippyUpdateResponse +- SippyDeleteResponse +- SippyGetResponse + +Methods: + +- client.r2.sippy.update(accountId, bucketName, { ...params }) -> SippyUpdateResponse +- client.r2.sippy.delete(accountId, bucketName) -> SippyDeleteResponse +- client.r2.sippy.get(accountId, bucketName) -> SippyGetResponse + # Teamnet ## Routes @@ -5253,45 +5267,31 @@ Methods: Types: -- OutageListResponse - -Methods: - -- client.radar.annotations.outages.list({ ...params }) -> OutageListResponse - -#### Locations - -Types: - -- LocationListResponse +- OutageLocationsResponse Methods: -- client.radar.annotations.outages.locations.list({ ...params }) -> LocationListResponse +- client.radar.annotations.outages.locations({ ...params }) -> OutageLocationsResponse ## BGP -### Leaks - -#### Events - Types: -- EventListResponse +- BGPTimeseriesResponse Methods: -- client.radar.bgp.leaks.events.list({ ...params }) -> EventListResponsesV4PagePagination +- client.radar.bgp.timeseries({ ...params }) -> BGPTimeseriesResponse -### Timeseries +### Leaks Types: -- TimeseryListResponse +- LeakEventsResponse Methods: -- client.radar.bgp.timeseries.list({ ...params }) -> TimeseryListResponse +- client.radar.bgp.leaks.events({ ...params }) -> LeakEventsResponse ### Tops @@ -5299,579 +5299,669 @@ Methods: Types: -- AseListResponse +- AsePrefixesResponse Methods: -- client.radar.bgp.tops.ases.list({ ...params }) -> AseListResponse +- client.radar.bgp.tops.ases.prefixes({ ...params }) -> AsePrefixesResponse -##### Prefixes +### Hijacks Types: -- PrefixListResponse +- HijackEventsResponse Methods: -- client.radar.bgp.tops.ases.prefixes.list({ ...params }) -> PrefixListResponse +- client.radar.bgp.hijacks.events({ ...params }) -> HijackEventsResponse -#### Prefixes +### Routes Types: -- PrefixListResponse +- RouteMoasResponse +- RoutePfx2asResponse +- RouteStatsResponse Methods: -- client.radar.bgp.tops.prefixes.list({ ...params }) -> PrefixListResponse +- client.radar.bgp.routes.moas({ ...params }) -> RouteMoasResponse +- client.radar.bgp.routes.pfx2as({ ...params }) -> RoutePfx2asResponse +- client.radar.bgp.routes.stats({ ...params }) -> RouteStatsResponse -### Hijacks +## Datasets Types: -- HijackListResponse +- DatasetListResponse +- DatasetDownloadResponse +- DatasetGetResponse Methods: -- client.radar.bgp.hijacks.list({ ...params }) -> HijackListResponsesV4PagePagination - -### Routes - -#### Moas - -Types: - -- MoaListResponse - -Methods: +- client.radar.datasets.list({ ...params }) -> DatasetListResponse +- client.radar.datasets.download({ ...params }) -> DatasetDownloadResponse +- client.radar.datasets.get(alias, { ...params }) -> string -- client.radar.bgp.routes.moas.list({ ...params }) -> MoaListResponse +## DNS -#### Pfx2as +### Top Types: -- Pfx2aListResponse +- TopAsesResponse +- TopLocationsResponse Methods: -- client.radar.bgp.routes.pfx2as.list({ ...params }) -> Pfx2aListResponse +- client.radar.dns.top.ases({ ...params }) -> TopAsesResponse +- client.radar.dns.top.locations({ ...params }) -> TopLocationsResponse -#### Stats +## Netflows Types: -- StatListResponse +- NetflowTimeseriesResponse Methods: -- client.radar.bgp.routes.stats.list({ ...params }) -> StatListResponse +- client.radar.netflows.timeseries({ ...params }) -> NetflowTimeseriesResponse -## Datasets +### Top Types: -- DatasetListResponse -- DatasetGetResponse +- TopAsesResponse +- TopLocationsResponse Methods: -- client.radar.datasets.list({ ...params }) -> DatasetListResponse -- client.radar.datasets.get(alias, { ...params }) -> string +- client.radar.netflows.top.ases({ ...params }) -> TopAsesResponse +- client.radar.netflows.top.locations({ ...params }) -> TopLocationsResponse -### Downloads +## Search Types: -- DownloadCreateResponse +- SearchGlobalResponse Methods: -- client.radar.datasets.downloads.create({ ...params }) -> DownloadCreateResponse - -## DNS +- client.radar.search.global({ ...params }) -> SearchGlobalResponse -### Tops +## VerifiedBots -#### Ases +### Top Types: -- AseListResponse +- TopBotsResponse +- TopCategoriesResponse Methods: -- client.radar.dns.tops.ases.list({ ...params }) -> AseListResponse +- client.radar.verifiedBots.top.bots({ ...params }) -> TopBotsResponse +- client.radar.verifiedBots.top.categories({ ...params }) -> TopCategoriesResponse -#### Locations +## As112 Types: -- LocationListResponse +- As112TimeseriesResponse Methods: -- client.radar.dns.tops.locations.list({ ...params }) -> LocationListResponse +- client.radar.as112.timeseries({ ...params }) -> As112TimeseriesResponse -## Netflows - -### Timeseries +### Summary Types: -- TimeseryListResponse +- SummaryDNSSECResponse +- SummaryEdnsResponse +- SummaryIPVersionResponse +- SummaryProtocolResponse +- SummaryQueryTypeResponse +- SummaryResponseCodesResponse Methods: -- client.radar.netflows.timeseries.list({ ...params }) -> TimeseryListResponse +- client.radar.as112.summary.dnssec({ ...params }) -> SummaryDNSSECResponse +- client.radar.as112.summary.edns({ ...params }) -> SummaryEdnsResponse +- client.radar.as112.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse +- client.radar.as112.summary.protocol({ ...params }) -> SummaryProtocolResponse +- client.radar.as112.summary.queryType({ ...params }) -> SummaryQueryTypeResponse +- client.radar.as112.summary.responseCodes({ ...params }) -> SummaryResponseCodesResponse -### Tops - -#### Ases +### TimeseriesGroups Types: -- AseListResponse +- TimeseriesGroupDNSSECResponse +- TimeseriesGroupEdnsResponse +- TimeseriesGroupIPVersionResponse +- TimeseriesGroupProtocolResponse +- TimeseriesGroupQueryTypeResponse +- TimeseriesGroupResponseCodesResponse Methods: -- client.radar.netflows.tops.ases.list({ ...params }) -> AseListResponse +- client.radar.as112.timeseriesGroups.dnssec({ ...params }) -> TimeseriesGroupDNSSECResponse +- client.radar.as112.timeseriesGroups.edns({ ...params }) -> TimeseriesGroupEdnsResponse +- client.radar.as112.timeseriesGroups.ipVersion({ ...params }) -> TimeseriesGroupIPVersionResponse +- client.radar.as112.timeseriesGroups.protocol({ ...params }) -> TimeseriesGroupProtocolResponse +- client.radar.as112.timeseriesGroups.queryType({ ...params }) -> TimeseriesGroupQueryTypeResponse +- client.radar.as112.timeseriesGroups.responseCodes({ ...params }) -> TimeseriesGroupResponseCodesResponse -#### Locations +### Top Types: -- LocationListResponse +- TopDNSSECResponse +- TopEdnsResponse +- TopIPVersionResponse +- TopLocationsResponse Methods: -- client.radar.netflows.tops.locations.list({ ...params }) -> LocationListResponse - -## Searches +- client.radar.as112.top.dnssec(dnssec, { ...params }) -> TopDNSSECResponse +- client.radar.as112.top.edns(edns, { ...params }) -> TopEdnsResponse +- client.radar.as112.top.ipVersion(ipVersion, { ...params }) -> TopIPVersionResponse +- client.radar.as112.top.locations({ ...params }) -> TopLocationsResponse -### Globals +## ConnectionTampering Types: -- GlobalListResponse +- ConnectionTamperingSummaryResponse +- ConnectionTamperingTimeseriesGroupsResponse Methods: -- client.radar.searches.globals.list({ ...params }) -> GlobalListResponse +- client.radar.connectionTampering.summary({ ...params }) -> ConnectionTamperingSummaryResponse +- client.radar.connectionTampering.timeseriesGroups({ ...params }) -> ConnectionTamperingTimeseriesGroupsResponse -## VerifiedBots +## Email -### Tops +### Security -#### Bots +#### Summary Types: -- BotListResponse +- SummaryArcResponse +- SummaryDKIMResponse +- SummaryDmarcResponse +- SummaryMaliciousResponse +- SummarySpamResponse +- SummarySPFResponse +- SummaryThreatCategoryResponse Methods: -- client.radar.verifiedBots.tops.bots.list({ ...params }) -> BotListResponse +- client.radar.email.security.summary.arc({ ...params }) -> SummaryArcResponse +- client.radar.email.security.summary.dkim({ ...params }) -> SummaryDKIMResponse +- client.radar.email.security.summary.dmarc({ ...params }) -> SummaryDmarcResponse +- client.radar.email.security.summary.malicious({ ...params }) -> SummaryMaliciousResponse +- client.radar.email.security.summary.spam({ ...params }) -> SummarySpamResponse +- client.radar.email.security.summary.spf({ ...params }) -> SummarySPFResponse +- client.radar.email.security.summary.threatCategory({ ...params }) -> SummaryThreatCategoryResponse -#### Categories +#### TimeseriesGroups Types: -- CategoryListResponse +- TimeseriesGroupArcResponse +- TimeseriesGroupDKIMResponse Methods: -- client.radar.verifiedBots.tops.categories.list({ ...params }) -> CategoryListResponse - -## As112 - -### TimeseriesGroups - -#### DNSSEC +- client.radar.email.security.timeseriesGroups.arc({ ...params }) -> TimeseriesGroupArcResponse +- client.radar.email.security.timeseriesGroups.dkim({ ...params }) -> TimeseriesGroupDKIMResponse -Types: - -- DNSSECListResponse - -Methods: - -- client.radar.as112.timeseriesGroups.dnssec.list({ ...params }) -> DNSSECListResponse +## Attacks -#### Edns +### Layer3 Types: -- EdnListResponse +- Layer3TimeseriesResponse Methods: -- client.radar.as112.timeseriesGroups.edns.list({ ...params }) -> EdnListResponse +- client.radar.attacks.layer3.timeseries({ ...params }) -> Layer3TimeseriesResponse -#### IPVersion +#### Summary Types: -- IPVersionListResponse +- SummaryBitrateResponse +- SummaryDurationResponse +- SummaryGetResponse +- SummaryIPVersionResponse +- SummaryProtocolResponse +- SummaryVectorResponse Methods: -- client.radar.as112.timeseriesGroups.ipVersion.list({ ...params }) -> IPVersionListResponse +- client.radar.attacks.layer3.summary.bitrate({ ...params }) -> SummaryBitrateResponse +- client.radar.attacks.layer3.summary.duration({ ...params }) -> SummaryDurationResponse +- client.radar.attacks.layer3.summary.get({ ...params }) -> SummaryGetResponse +- client.radar.attacks.layer3.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse +- client.radar.attacks.layer3.summary.protocol({ ...params }) -> SummaryProtocolResponse +- client.radar.attacks.layer3.summary.vector({ ...params }) -> SummaryVectorResponse -## ConnectionTampering +#### TimeseriesGroups Types: -- ConnectionTamperingListResponse +- TimeseriesGroupBitrateResponse +- TimeseriesGroupDurationResponse +- TimeseriesGroupGetResponse +- TimeseriesGroupIndustryResponse +- TimeseriesGroupIPVersionResponse +- TimeseriesGroupProtocolResponse +- TimeseriesGroupVectorResponse +- TimeseriesGroupVerticalResponse Methods: -- client.radar.connectionTampering.list({ ...params }) -> ConnectionTamperingListResponse +- client.radar.attacks.layer3.timeseriesGroups.bitrate({ ...params }) -> TimeseriesGroupBitrateResponse +- client.radar.attacks.layer3.timeseriesGroups.duration({ ...params }) -> TimeseriesGroupDurationResponse +- client.radar.attacks.layer3.timeseriesGroups.get({ ...params }) -> TimeseriesGroupGetResponse +- client.radar.attacks.layer3.timeseriesGroups.industry({ ...params }) -> TimeseriesGroupIndustryResponse +- client.radar.attacks.layer3.timeseriesGroups.ipVersion({ ...params }) -> TimeseriesGroupIPVersionResponse +- client.radar.attacks.layer3.timeseriesGroups.protocol({ ...params }) -> TimeseriesGroupProtocolResponse +- client.radar.attacks.layer3.timeseriesGroups.vector({ ...params }) -> TimeseriesGroupVectorResponse +- client.radar.attacks.layer3.timeseriesGroups.vertical({ ...params }) -> TimeseriesGroupVerticalResponse -### TimeseriesGroups +#### Top Types: -- TimeseriesGroupListResponse +- TopAttacksResponse +- TopIndustryResponse +- TopVerticalResponse Methods: -- client.radar.connectionTampering.timeseriesGroups.list({ ...params }) -> TimeseriesGroupListResponse - -## Email - -### Security +- client.radar.attacks.layer3.top.attacks({ ...params }) -> TopAttacksResponse +- client.radar.attacks.layer3.top.industry({ ...params }) -> TopIndustryResponse +- client.radar.attacks.layer3.top.vertical({ ...params }) -> TopVerticalResponse -#### Summaries - -##### Arcs +##### Locations Types: -- ArcListResponse +- LocationOriginResponse +- LocationTargetResponse Methods: -- client.radar.email.security.summaries.arcs.list({ ...params }) -> ArcListResponse +- client.radar.attacks.layer3.top.locations.origin({ ...params }) -> LocationOriginResponse +- client.radar.attacks.layer3.top.locations.target({ ...params }) -> LocationTargetResponse -##### DKIMs +### Layer7 Types: -- DKIMListResponse +- Layer7TimeseriesResponse Methods: -- client.radar.email.security.summaries.dkims.list({ ...params }) -> DKIMListResponse +- client.radar.attacks.layer7.timeseries({ ...params }) -> Layer7TimeseriesResponse -##### Dmarcs +#### Summary Types: -- DmarcListResponse +- SummaryBitrateResponse +- SummaryDurationResponse +- SummaryGetResponse +- SummaryIPVersionResponse +- SummaryProtocolResponse +- SummaryVectorResponse Methods: -- client.radar.email.security.summaries.dmarcs.list({ ...params }) -> DmarcListResponse +- client.radar.attacks.layer7.summary.bitrate({ ...params }) -> SummaryBitrateResponse +- client.radar.attacks.layer7.summary.duration({ ...params }) -> SummaryDurationResponse +- client.radar.attacks.layer7.summary.get({ ...params }) -> SummaryGetResponse +- client.radar.attacks.layer7.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse +- client.radar.attacks.layer7.summary.protocol({ ...params }) -> SummaryProtocolResponse +- client.radar.attacks.layer7.summary.vector({ ...params }) -> SummaryVectorResponse -##### Malicious +#### TimeseriesGroups Types: -- MaliciousListResponse +- TimeseriesGroupBitrateResponse +- TimeseriesGroupDurationResponse +- TimeseriesGroupGetResponse +- TimeseriesGroupIndustryResponse +- TimeseriesGroupIPVersionResponse +- TimeseriesGroupProtocolResponse +- TimeseriesGroupVectorResponse +- TimeseriesGroupVerticalResponse Methods: -- client.radar.email.security.summaries.malicious.list({ ...params }) -> MaliciousListResponse +- client.radar.attacks.layer7.timeseriesGroups.bitrate({ ...params }) -> TimeseriesGroupBitrateResponse +- client.radar.attacks.layer7.timeseriesGroups.duration({ ...params }) -> TimeseriesGroupDurationResponse +- client.radar.attacks.layer7.timeseriesGroups.get({ ...params }) -> TimeseriesGroupGetResponse +- client.radar.attacks.layer7.timeseriesGroups.industry({ ...params }) -> TimeseriesGroupIndustryResponse +- client.radar.attacks.layer7.timeseriesGroups.ipVersion({ ...params }) -> TimeseriesGroupIPVersionResponse +- client.radar.attacks.layer7.timeseriesGroups.protocol({ ...params }) -> TimeseriesGroupProtocolResponse +- client.radar.attacks.layer7.timeseriesGroups.vector({ ...params }) -> TimeseriesGroupVectorResponse +- client.radar.attacks.layer7.timeseriesGroups.vertical({ ...params }) -> TimeseriesGroupVerticalResponse -##### Spams +#### Top Types: -- SpamListResponse +- TopAttacksResponse +- TopIndustryResponse +- TopVerticalResponse Methods: -- client.radar.email.security.summaries.spams.list({ ...params }) -> SpamListResponse +- client.radar.attacks.layer7.top.attacks({ ...params }) -> TopAttacksResponse +- client.radar.attacks.layer7.top.industry({ ...params }) -> TopIndustryResponse +- client.radar.attacks.layer7.top.vertical({ ...params }) -> TopVerticalResponse -##### SPFs +##### Locations Types: -- SPFListResponse +- LocationOriginResponse +- LocationTargetResponse Methods: -- client.radar.email.security.summaries.spfs.list({ ...params }) -> SPFListResponse - -##### ThreatCategories +- client.radar.attacks.layer7.top.locations.origin({ ...params }) -> LocationOriginResponse +- client.radar.attacks.layer7.top.locations.target({ ...params }) -> LocationTargetResponse -Types: - -- ThreatCategoryListResponse - -Methods: +## Emails -- client.radar.email.security.summaries.threatCategories.list({ ...params }) -> ThreatCategoryListResponse +### Security #### TimeseriesGroups -##### Arcs - Types: -- ArcListResponse +- TimeseriesGroupDmarcResponse +- TimeseriesGroupMaliciousResponse +- TimeseriesGroupSpamResponse +- TimeseriesGroupSPFResponse +- TimeseriesGroupThreatCategoryResponse Methods: -- client.radar.email.security.timeseriesGroups.arcs.list({ ...params }) -> ArcListResponse +- client.radar.emails.security.timeseriesGroups.dmarc({ ...params }) -> TimeseriesGroupDmarcResponse +- client.radar.emails.security.timeseriesGroups.malicious({ ...params }) -> TimeseriesGroupMaliciousResponse +- client.radar.emails.security.timeseriesGroups.spam({ ...params }) -> TimeseriesGroupSpamResponse +- client.radar.emails.security.timeseriesGroups.spf({ ...params }) -> TimeseriesGroupSPFResponse +- client.radar.emails.security.timeseriesGroups.threatCategory({ ...params }) -> TimeseriesGroupThreatCategoryResponse -##### DKIMs +## Entities Types: -- DKIMListResponse +- EntityGetResponse Methods: -- client.radar.email.security.timeseriesGroups.dkims.list({ ...params }) -> DKIMListResponse - -## Attacks - -### Layer3 +- client.radar.entities.get({ ...params }) -> EntityGetResponse -#### TimeseriesGroups - -##### Industry +### Asns Types: -- IndustryListResponse +- AsnListResponse +- AsnGetResponse +- AsnIPResponse +- AsnRelResponse Methods: -- client.radar.attacks.layer3.timeseriesGroups.industry.list({ ...params }) -> IndustryListResponse +- client.radar.entities.asns.list({ ...params }) -> AsnListResponse +- client.radar.entities.asns.get(asn, { ...params }) -> AsnGetResponse +- client.radar.entities.asns.ip({ ...params }) -> AsnIPResponse +- client.radar.entities.asns.rel(asn, { ...params }) -> AsnRelResponse -##### IPVersion +### Locations Types: -- IPVersionListResponse +- LocationListResponse +- LocationGetResponse Methods: -- client.radar.attacks.layer3.timeseriesGroups.ipVersion.list({ ...params }) -> IPVersionListResponse - -##### Protocol - -Types: - -- ProtocolListResponse +- client.radar.entities.locations.list({ ...params }) -> LocationListResponse +- client.radar.entities.locations.get(location, { ...params }) -> LocationGetResponse -Methods: - -- client.radar.attacks.layer3.timeseriesGroups.protocol.list({ ...params }) -> ProtocolListResponse +## HTTP -##### Vector +### Top Types: -- VectorListResponse +- TopBrowserFamiliesResponse +- TopBrowsersResponse Methods: -- client.radar.attacks.layer3.timeseriesGroups.vector.list({ ...params }) -> VectorListResponse +- client.radar.http.top.browserFamilies({ ...params }) -> TopBrowserFamiliesResponse +- client.radar.http.top.browsers({ ...params }) -> TopBrowsersResponse -##### Vertical +### Locations Types: -- VerticalListResponse +- LocationGetResponse Methods: -- client.radar.attacks.layer3.timeseriesGroups.vertical.list({ ...params }) -> VerticalListResponse - -#### Top +- client.radar.http.locations.get({ ...params }) -> LocationGetResponse -##### Attacks +#### BotClass Types: -- AttackListResponse +- BotClassGetResponse Methods: -- client.radar.attacks.layer3.top.attacks.list({ ...params }) -> AttackListResponse +- client.radar.http.locations.botClass.get(botClass, { ...params }) -> BotClassGetResponse -##### Industry +#### DeviceType Types: -- IndustryListResponse +- DeviceTypeGetResponse Methods: -- client.radar.attacks.layer3.top.industry.list({ ...params }) -> IndustryListResponse - -##### Locations +- client.radar.http.locations.deviceType.get(deviceType, { ...params }) -> DeviceTypeGetResponse -###### Origin +#### HTTPProtocol Types: -- OriginListResponse +- HTTPProtocolGetResponse Methods: -- client.radar.attacks.layer3.top.locations.origin.list({ ...params }) -> OriginListResponse +- client.radar.http.locations.httpProtocol.get(httpProtocol, { ...params }) -> HTTPProtocolGetResponse -###### Target +#### HTTPMethod Types: -- TargetListResponse +- HTTPMethodGetResponse Methods: -- client.radar.attacks.layer3.top.locations.target.list({ ...params }) -> TargetListResponse +- client.radar.http.locations.httpMethod.get(httpVersion, { ...params }) -> HTTPMethodGetResponse -##### Vertical +#### IPVersion Types: -- VerticalListResponse +- IPVersionGetResponse Methods: -- client.radar.attacks.layer3.top.vertical.list({ ...params }) -> VerticalListResponse - -## Emails - -### Security +- client.radar.http.locations.ipVersion.get(ipVersion, { ...params }) -> IPVersionGetResponse -#### Dmarc +#### Os Types: -- DmarcListResponse +- OGetResponse Methods: -- client.radar.emails.security.dmarc.list({ ...params }) -> DmarcListResponse +- client.radar.http.locations.os.get(os, { ...params }) -> OGetResponse -#### Malicious +#### TLSVersion Types: -- MaliciousListResponse +- TLSVersionGetResponse Methods: -- client.radar.emails.security.malicious.list({ ...params }) -> MaliciousListResponse +- client.radar.http.locations.tlsVersion.get(tlsVersion, { ...params }) -> TLSVersionGetResponse -#### Spam +### Ases Types: -- SpamListResponse +- AseGetResponse Methods: -- client.radar.emails.security.spam.list({ ...params }) -> SpamListResponse +- client.radar.http.ases.get({ ...params }) -> AseGetResponse -#### SPF +#### BotClass Types: -- SPFListResponse +- BotClassGetResponse Methods: -- client.radar.emails.security.spf.list({ ...params }) -> SPFListResponse +- client.radar.http.ases.botClass.get(botClass, { ...params }) -> BotClassGetResponse -#### ThreatCategory +#### DeviceType Types: -- ThreatCategoryListResponse +- DeviceTypeGetResponse Methods: -- client.radar.emails.security.threatCategory.list({ ...params }) -> ThreatCategoryListResponse +- client.radar.http.ases.deviceType.get(deviceType, { ...params }) -> DeviceTypeGetResponse -#### Top - -##### Ases +#### HTTPProtocol Types: -- AseListResponse +- HTTPProtocolGetResponse Methods: -- client.radar.emails.security.top.ases.list({ ...params }) -> AseListResponse +- client.radar.http.ases.httpProtocol.get(httpProtocol, { ...params }) -> HTTPProtocolGetResponse -###### Arc +#### HTTPMethod Types: -- ArcGetResponse +- HTTPMethodGetResponse Methods: -- client.radar.emails.security.top.ases.arc.get(arc, { ...params }) -> ArcGetResponse +- client.radar.http.ases.httpMethod.get(httpVersion, { ...params }) -> HTTPMethodGetResponse -###### DKIM +#### IPVersion Types: -- DKIMGetResponse +- IPVersionGetResponse Methods: -- client.radar.emails.security.top.ases.dkim.get(dkim, { ...params }) -> DKIMGetResponse +- client.radar.http.ases.ipVersion.get(ipVersion, { ...params }) -> IPVersionGetResponse -###### Dmarc +#### Os Types: -- DmarcGetResponse +- OGetResponse Methods: -- client.radar.emails.security.top.ases.dmarc.get(dmarc, { ...params }) -> DmarcGetResponse +- client.radar.http.ases.os.get(os, { ...params }) -> OGetResponse -## Entities +#### TLSVersion Types: -- EntityListResponse +- TLSVersionGetResponse Methods: -- client.radar.entities.list({ ...params }) -> EntityListResponse +- client.radar.http.ases.tlsVersion.get(tlsVersion, { ...params }) -> TLSVersionGetResponse -### Asns +### Summary Types: -- AsnRelResponse +- SummaryBotClassResponse +- SummaryDeviceTypeResponse +- SummaryHTTPProtocolResponse +- SummaryHTTPVersionResponse +- SummaryIPVersionResponse +- SummaryOsResponse +- SummaryTLSVersionResponse Methods: -- client.radar.entities.asns.rel(asn, { ...params }) -> AsnRelResponse +- client.radar.http.summary.botClass({ ...params }) -> SummaryBotClassResponse +- client.radar.http.summary.deviceType({ ...params }) -> SummaryDeviceTypeResponse +- client.radar.http.summary.httpProtocol({ ...params }) -> SummaryHTTPProtocolResponse +- client.radar.http.summary.httpVersion({ ...params }) -> SummaryHTTPVersionResponse +- client.radar.http.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse +- client.radar.http.summary.os({ ...params }) -> SummaryOsResponse +- client.radar.http.summary.tlsVersion({ ...params }) -> SummaryTLSVersionResponse -## HTTP - -### TLSVersion +### TimeseriesGroups Types: -- TLSVersionListResponse +- TimeseriesGroupBotClassResponse +- TimeseriesGroupBrowserResponse +- TimeseriesGroupBrowserFamilyResponse +- TimeseriesGroupDeviceTypeResponse +- TimeseriesGroupHTTPProtocolResponse +- TimeseriesGroupHTTPVersionResponse +- TimeseriesGroupIPVersionResponse +- TimeseriesGroupOsResponse +- TimeseriesGroupTLSVersionResponse Methods: -- client.radar.http.tlsVersion.list({ ...params }) -> TLSVersionListResponse +- client.radar.http.timeseriesGroups.botClass({ ...params }) -> TimeseriesGroupBotClassResponse +- client.radar.http.timeseriesGroups.browser({ ...params }) -> TimeseriesGroupBrowserResponse +- client.radar.http.timeseriesGroups.browserFamily({ ...params }) -> TimeseriesGroupBrowserFamilyResponse +- client.radar.http.timeseriesGroups.deviceType({ ...params }) -> TimeseriesGroupDeviceTypeResponse +- client.radar.http.timeseriesGroups.httpProtocol({ ...params }) -> TimeseriesGroupHTTPProtocolResponse +- client.radar.http.timeseriesGroups.httpVersion({ ...params }) -> TimeseriesGroupHTTPVersionResponse +- client.radar.http.timeseriesGroups.ipVersion({ ...params }) -> TimeseriesGroupIPVersionResponse +- client.radar.http.timeseriesGroups.os({ ...params }) -> TimeseriesGroupOsResponse +- client.radar.http.timeseriesGroups.tlsVersion({ ...params }) -> TimeseriesGroupTLSVersionResponse ## Quality @@ -5879,97 +5969,77 @@ Methods: Types: -- IqiListResponse +- IqiSummaryResponse Methods: -- client.radar.quality.iqi.list({ ...params }) -> IqiListResponse - -#### TimeseriesGroups - -Types: - -- TimeseriesGroupListResponse - -Methods: - -- client.radar.quality.iqi.timeseriesGroups.list({ ...params }) -> TimeseriesGroupListResponse +- client.radar.quality.iqi.summary({ ...params }) -> IqiSummaryResponse ### Speed -#### Histogram - -Types: - -- HistogramListResponse - -Methods: - -- client.radar.quality.speed.histogram.list({ ...params }) -> HistogramListResponse - -#### Summary - Types: -- SummaryListResponse +- SpeedHistogramResponse +- SpeedSummaryResponse Methods: -- client.radar.quality.speed.summary.list({ ...params }) -> SummaryListResponse +- client.radar.quality.speed.histogram({ ...params }) -> SpeedHistogramResponse +- client.radar.quality.speed.summary({ ...params }) -> SpeedSummaryResponse #### Top -##### Ases - Types: -- AseListResponse +- TopAsesResponse +- TopLocationsResponse Methods: -- client.radar.quality.speed.top.ases.list({ ...params }) -> AseListResponse +- client.radar.quality.speed.top.ases({ ...params }) -> TopAsesResponse +- client.radar.quality.speed.top.locations({ ...params }) -> TopLocationsResponse -##### Locations +## Ranking Types: -- LocationListResponse +- RankingTimeseriesGroupsResponse Methods: -- client.radar.quality.speed.top.locations.list({ ...params }) -> LocationListResponse +- client.radar.ranking.timeseriesGroups({ ...params }) -> RankingTimeseriesGroupsResponse -## Ranking - -### TimeseriesGroups +### Ranking Types: -- TimeseriesGroupListResponse +- RankingGetResponse +- RankingTopResponse Methods: -- client.radar.ranking.timeseriesGroups.list({ ...params }) -> TimeseriesGroupListResponse +- client.radar.ranking.ranking.get(domain, { ...params }) -> RankingGetResponse +- client.radar.ranking.ranking.top({ ...params }) -> RankingTopResponse ## TrafficAnomalies Types: -- TrafficAnomalyListResponse +- TrafficAnomalyGetResponse Methods: -- client.radar.trafficAnomalies.list({ ...params }) -> TrafficAnomalyListResponse +- client.radar.trafficAnomalies.get({ ...params }) -> TrafficAnomalyGetResponse ### Locations Types: -- LocationListResponse +- LocationGetResponse Methods: -- client.radar.trafficAnomalies.locations.list({ ...params }) -> LocationListResponse +- client.radar.trafficAnomalies.locations.get({ ...params }) -> LocationGetResponse # BotManagement @@ -5983,18 +6053,6 @@ Methods: - client.botManagement.update(zoneId, { ...params }) -> BotManagementUpdateResponse - client.botManagement.get(zoneId) -> BotManagementGetResponse -# CacheReserve - -Types: - -- CacheReserveCreateResponse -- CacheReserveGetResponse - -Methods: - -- client.cacheReserve.create(zoneId) -> CacheReserveCreateResponse -- client.cacheReserve.get(zoneId) -> CacheReserveGetResponse - # OriginPostQuantumEncryption Types: diff --git a/src/index.ts b/src/index.ts index 271868970a..3ac15cd4ec 100644 --- a/src/index.ts +++ b/src/index.ts @@ -125,7 +125,7 @@ export class Cloudflare extends Core.APIClient { } if (apiEmail === undefined) { throw new Errors.CloudflareError( - "The CLOUDFLARE_EMAIL environment variable is missing or empty; either provide it, or instantiate the Cloudflare client with an apiEmail option, like new Cloudflare({ apiEmail: 'dev@cloudflare.com' }).", + "The CLOUDFLARE_EMAIL environment variable is missing or empty; either provide it, or instantiate the Cloudflare client with an apiEmail option, like new Cloudflare({ apiEmail: 'user@example.com' }).", ); } if (apiToken === undefined) { @@ -135,7 +135,7 @@ export class Cloudflare extends Core.APIClient { } if (userServiceKey === undefined) { throw new Errors.CloudflareError( - "The CLOUDFLARE_API_USER_SERVICE_KEY environment variable is missing or empty; either provide it, or instantiate the Cloudflare client with an userServiceKey option, like new Cloudflare({ userServiceKey: 'My User Service Key' }).", + "The CLOUDFLARE_API_USER_SERVICE_KEY environment variable is missing or empty; either provide it, or instantiate the Cloudflare client with an userServiceKey option, like new Cloudflare({ userServiceKey: 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719' }).", ); } @@ -252,7 +252,6 @@ export class Cloudflare extends Core.APIClient { urlScanner: API.URLScanner = new API.URLScanner(this); radar: API.Radar = new API.Radar(this); botManagement: API.BotManagement = new API.BotManagement(this); - cacheReserve: API.CacheReserve = new API.CacheReserve(this); originPostQuantumEncryption: API.OriginPostQuantumEncryption = new API.OriginPostQuantumEncryption(this); firewall: API.Firewall = new API.Firewall(this); zaraz: API.Zaraz = new API.Zaraz(this); @@ -610,6 +609,9 @@ export namespace Cloudflare { export import RulesetGetResponse = API.RulesetGetResponse; export import RulesetCreateParams = API.RulesetCreateParams; export import RulesetUpdateParams = API.RulesetUpdateParams; + export import RulesetListParams = API.RulesetListParams; + export import RulesetDeleteParams = API.RulesetDeleteParams; + export import RulesetGetParams = API.RulesetGetParams; export import URLNormalizations = API.URLNormalizations; export import URLNormalizationUpdateResponse = API.URLNormalizationUpdateResponse; @@ -772,10 +774,6 @@ export namespace Cloudflare { export import BotManagementGetResponse = API.BotManagementGetResponse; export import BotManagementUpdateParams = API.BotManagementUpdateParams; - export import CacheReserve = API.CacheReserve; - export import CacheReserveCreateResponse = API.CacheReserveCreateResponse; - export import CacheReserveGetResponse = API.CacheReserveGetResponse; - export import OriginPostQuantumEncryption = API.OriginPostQuantumEncryption; export import OriginPostQuantumEncryptionUpdateResponse = API.OriginPostQuantumEncryptionUpdateResponse; export import OriginPostQuantumEncryptionGetResponse = API.OriginPostQuantumEncryptionGetResponse; diff --git a/src/resources/access/access.ts b/src/resources/access/access.ts index 3a71c55afb..3b240323c5 100644 --- a/src/resources/access/access.ts +++ b/src/resources/access/access.ts @@ -43,6 +43,10 @@ export namespace Access { export import ApplicationRevokeTokensResponse = ApplicationsAPI.ApplicationRevokeTokensResponse; export import ApplicationCreateParams = ApplicationsAPI.ApplicationCreateParams; export import ApplicationUpdateParams = ApplicationsAPI.ApplicationUpdateParams; + export import ApplicationListParams = ApplicationsAPI.ApplicationListParams; + export import ApplicationDeleteParams = ApplicationsAPI.ApplicationDeleteParams; + export import ApplicationGetParams = ApplicationsAPI.ApplicationGetParams; + export import ApplicationRevokeTokensParams = ApplicationsAPI.ApplicationRevokeTokensParams; export import Certificates = CertificatesAPI.Certificates; export import CertificateCreateResponse = CertificatesAPI.CertificateCreateResponse; export import CertificateUpdateResponse = CertificatesAPI.CertificateUpdateResponse; @@ -51,6 +55,9 @@ export namespace Access { export import CertificateGetResponse = CertificatesAPI.CertificateGetResponse; export import CertificateCreateParams = CertificatesAPI.CertificateCreateParams; export import CertificateUpdateParams = CertificatesAPI.CertificateUpdateParams; + export import CertificateListParams = CertificatesAPI.CertificateListParams; + export import CertificateDeleteParams = CertificatesAPI.CertificateDeleteParams; + export import CertificateGetParams = CertificatesAPI.CertificateGetParams; export import Groups = GroupsAPI.Groups; export import GroupCreateResponse = GroupsAPI.GroupCreateResponse; export import GroupUpdateResponse = GroupsAPI.GroupUpdateResponse; @@ -59,6 +66,9 @@ export namespace Access { export import GroupGetResponse = GroupsAPI.GroupGetResponse; export import GroupCreateParams = GroupsAPI.GroupCreateParams; export import GroupUpdateParams = GroupsAPI.GroupUpdateParams; + export import GroupListParams = GroupsAPI.GroupListParams; + export import GroupDeleteParams = GroupsAPI.GroupDeleteParams; + export import GroupGetParams = GroupsAPI.GroupGetParams; export import IdentityProviders = IdentityProvidersAPI.IdentityProviders; export import IdentityProviderCreateResponse = IdentityProvidersAPI.IdentityProviderCreateResponse; export import IdentityProviderUpdateResponse = IdentityProvidersAPI.IdentityProviderUpdateResponse; @@ -67,6 +77,9 @@ export namespace Access { export import IdentityProviderGetResponse = IdentityProvidersAPI.IdentityProviderGetResponse; export import IdentityProviderCreateParams = IdentityProvidersAPI.IdentityProviderCreateParams; export import IdentityProviderUpdateParams = IdentityProvidersAPI.IdentityProviderUpdateParams; + export import IdentityProviderListParams = IdentityProvidersAPI.IdentityProviderListParams; + export import IdentityProviderDeleteParams = IdentityProvidersAPI.IdentityProviderDeleteParams; + export import IdentityProviderGetParams = IdentityProvidersAPI.IdentityProviderGetParams; export import Organizations = OrganizationsAPI.Organizations; export import OrganizationCreateResponse = OrganizationsAPI.OrganizationCreateResponse; export import OrganizationUpdateResponse = OrganizationsAPI.OrganizationUpdateResponse; @@ -74,6 +87,7 @@ export namespace Access { export import OrganizationRevokeUsersResponse = OrganizationsAPI.OrganizationRevokeUsersResponse; export import OrganizationCreateParams = OrganizationsAPI.OrganizationCreateParams; export import OrganizationUpdateParams = OrganizationsAPI.OrganizationUpdateParams; + export import OrganizationListParams = OrganizationsAPI.OrganizationListParams; export import OrganizationRevokeUsersParams = OrganizationsAPI.OrganizationRevokeUsersParams; export import ServiceTokens = ServiceTokensAPI.ServiceTokens; export import ServiceTokenCreateResponse = ServiceTokensAPI.ServiceTokenCreateResponse; @@ -84,6 +98,8 @@ export namespace Access { export import ServiceTokenRotateResponse = ServiceTokensAPI.ServiceTokenRotateResponse; export import ServiceTokenCreateParams = ServiceTokensAPI.ServiceTokenCreateParams; export import ServiceTokenUpdateParams = ServiceTokensAPI.ServiceTokenUpdateParams; + export import ServiceTokenListParams = ServiceTokensAPI.ServiceTokenListParams; + export import ServiceTokenDeleteParams = ServiceTokensAPI.ServiceTokenDeleteParams; export import Bookmarks = BookmarksAPI.Bookmarks; export import BookmarkUpdateResponse = BookmarksAPI.BookmarkUpdateResponse; export import BookmarkListResponse = BookmarksAPI.BookmarkListResponse; diff --git a/src/resources/access/applications/applications.ts b/src/resources/access/applications/applications.ts index f1e49c54f9..63236075e5 100644 --- a/src/resources/access/applications/applications.ts +++ b/src/resources/access/applications/applications.ts @@ -18,16 +18,14 @@ export class Applications extends APIResource { * Adds a new application to Access. */ create( - accountOrZone: string, - accountOrZoneId: string, - body: ApplicationCreateParams, + params: ApplicationCreateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.post(`/${accountOrZone}/${accountOrZoneId}/access/apps`, { - body, - ...options, - }) as Core.APIPromise<{ result: ApplicationCreateResponse }> + this._client.post(`/${account_id}/${zone_id}/access/apps`, { body, ...options }) as Core.APIPromise<{ + result: ApplicationCreateResponse; + }> )._thenUnwrap((obj) => obj.result); } @@ -35,14 +33,13 @@ export class Applications extends APIResource { * Updates an Access application. */ update( - accountOrZone: string, - accountOrZoneId: string, appId: string | string, - body: ApplicationUpdateParams, + params: ApplicationUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}`, { + this._client.put(`/${account_id}/${zone_id}/access/apps/${appId}`, { body, ...options, }) as Core.APIPromise<{ result: ApplicationUpdateResponse }> @@ -53,12 +50,12 @@ export class Applications extends APIResource { * Lists all Access applications in an account or zone. */ list( - accountOrZone: string, - accountOrZoneId: string, + params: ApplicationListParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.get(`/${accountOrZone}/${accountOrZoneId}/access/apps`, options) as Core.APIPromise<{ + this._client.get(`/${account_id}/${zone_id}/access/apps`, options) as Core.APIPromise<{ result: ApplicationListResponse | null; }> )._thenUnwrap((obj) => obj.result); @@ -68,16 +65,15 @@ export class Applications extends APIResource { * Deletes an application from Access. */ delete( - accountOrZone: string, - accountOrZoneId: string, appId: string | string, + params: ApplicationDeleteParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.delete( - `/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}`, - options, - ) as Core.APIPromise<{ result: ApplicationDeleteResponse }> + this._client.delete(`/${account_id}/${zone_id}/access/apps/${appId}`, options) as Core.APIPromise<{ + result: ApplicationDeleteResponse; + }> )._thenUnwrap((obj) => obj.result); } @@ -85,16 +81,15 @@ export class Applications extends APIResource { * Fetches information about an Access application. */ get( - accountOrZone: string, - accountOrZoneId: string, appId: string | string, + params: ApplicationGetParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.get( - `/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}`, - options, - ) as Core.APIPromise<{ result: ApplicationGetResponse }> + this._client.get(`/${account_id}/${zone_id}/access/apps/${appId}`, options) as Core.APIPromise<{ + result: ApplicationGetResponse; + }> )._thenUnwrap((obj) => obj.result); } @@ -102,14 +97,14 @@ export class Applications extends APIResource { * Revokes all tokens issued for an application. */ revokeTokens( - accountOrZone: string, - accountOrZoneId: string, appId: string | string, + params: ApplicationRevokeTokensParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( this._client.post( - `/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}/revoke_tokens`, + `/${account_id}/${zone_id}/access/apps/${appId}/revoke_tokens`, options, ) as Core.APIPromise<{ result: ApplicationRevokeTokensResponse | null }> )._thenUnwrap((obj) => obj.result); @@ -4006,1642 +4001,702 @@ export namespace ApplicationGetResponse { export type ApplicationRevokeTokensResponse = unknown; -export type ApplicationCreateParams = - | ApplicationCreateParams.Variant0 - | ApplicationCreateParams.Variant1 - | ApplicationCreateParams.Variant2 - | ApplicationCreateParams.Variant3 - | ApplicationCreateParams.Variant4 - | ApplicationCreateParams.Variant5 - | ApplicationCreateParams.Variant6 - | ApplicationCreateParams.Variant7; +export interface ApplicationCreateParams { + /** + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; -export namespace ApplicationCreateParams { - export interface Variant0 { - /** - * The primary hostname and path that Access will secure. If the app is visible in - * the App Launcher dashboard, this is the domain that will be displayed. - */ - domain: string; + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; - /** - * The application type. - */ - type: string; + /** + * Body param: When set to true, users can authenticate to this application using + * their WARP session. When set to false this application will always require + * direct IdP authentication. This setting always overrides the organization + * setting for WARP authentication. + */ + allow_authenticate_via_warp?: boolean; - /** - * When set to true, users can authenticate to this application using their WARP - * session. When set to false this application will always require direct IdP - * authentication. This setting always overrides the organization setting for WARP - * authentication. - */ - allow_authenticate_via_warp?: boolean; + /** + * Body param: The identity providers your users can select when connecting to this + * application. Defaults to all IdPs configured in your account. + */ + allowed_idps?: Array; - /** - * The identity providers your users can select when connecting to this - * application. Defaults to all IdPs configured in your account. - */ - allowed_idps?: Array; + /** + * Body param: + */ + app_launcher_visible?: unknown; + + /** + * Body param: When set to `true`, users skip the identity provider selection step + * during login. You must specify only one identity provider in allowed_idps. + */ + auto_redirect_to_identity?: boolean; + + /** + * Body param: + */ + cors_headers?: ApplicationCreateParams.CorsHeaders; + + /** + * Body param: The custom error message shown to a user when they are denied access + * to the application. + */ + custom_deny_message?: string; + + /** + * Body param: The custom URL a user is redirected to when they are denied access + * to the application when failing identity-based rules. + */ + custom_deny_url?: string; + + /** + * Body param: The custom URL a user is redirected to when they are denied access + * to the application when failing non-identity rules. + */ + custom_non_identity_deny_url?: string; + + /** + * Body param: The custom pages that will be displayed when applicable for this + * application + */ + custom_pages?: Array; + + /** + * Body param: The URL or domain of the bookmark. + */ + domain?: unknown; + + /** + * Body param: Enables the binding cookie, which increases security against + * compromised authorization tokens and CSRF attacks. + */ + enable_binding_cookie?: boolean; + + /** + * Body param: Enables the HttpOnly cookie attribute, which increases security + * against XSS attacks. + */ + http_only_cookie_attribute?: boolean; + + /** + * Body param: The image URL for the logo shown in the App Launcher dashboard. + */ + logo_url?: string; + + /** + * Body param: The name of the application. + */ + name?: string; + + /** + * Body param: Enables cookie paths to scope an application's JWT to the + * application path. If disabled, the JWT will scope to the hostname by default + */ + path_cookie_attribute?: boolean; + + /** + * Body param: + */ + saas_app?: ApplicationCreateParams.AccessSamlSaasApp | ApplicationCreateParams.AccessOidcSaasApp; + + /** + * Body param: Sets the SameSite cookie setting, which provides increased security + * against CSRF attacks. + */ + same_site_cookie_attribute?: string; + + /** + * Body param: List of domains that Access will secure. + */ + self_hosted_domains?: Array; + + /** + * Body param: Returns a 401 status code when the request is blocked by a Service + * Auth policy. + */ + service_auth_401_redirect?: boolean; + + /** + * Body param: The amount of time that tokens issued for this application will be + * valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us + * (or µs), ms, s, m, h. + */ + session_duration?: string; + + /** + * Body param: Enables automatic authentication through cloudflared. + */ + skip_interstitial?: boolean; + + /** + * Body param: The tags you want assigned to an application. Tags are used to + * filter applications in the App Launcher dashboard. + */ + tags?: Array; + /** + * Body param: The application type. + */ + type?: string; +} + +export namespace ApplicationCreateParams { + export interface CorsHeaders { /** - * Displays the application in the App Launcher. + * Allows all HTTP request headers. */ - app_launcher_visible?: boolean; + allow_all_headers?: boolean; /** - * When set to `true`, users skip the identity provider selection step during - * login. You must specify only one identity provider in allowed_idps. + * Allows all HTTP request methods. */ - auto_redirect_to_identity?: boolean; - - cors_headers?: ApplicationCreateParams.Variant0.CorsHeaders; + allow_all_methods?: boolean; /** - * The custom error message shown to a user when they are denied access to the - * application. + * Allows all origins. */ - custom_deny_message?: string; + allow_all_origins?: boolean; /** - * The custom URL a user is redirected to when they are denied access to the - * application when failing identity-based rules. + * When set to `true`, includes credentials (cookies, authorization headers, or TLS + * client certificates) with requests. */ - custom_deny_url?: string; + allow_credentials?: boolean; /** - * The custom URL a user is redirected to when they are denied access to the - * application when failing non-identity rules. + * Allowed HTTP request headers. */ - custom_non_identity_deny_url?: string; + allowed_headers?: Array; /** - * The custom pages that will be displayed when applicable for this application + * Allowed HTTP request methods. */ - custom_pages?: Array; + allowed_methods?: Array< + 'GET' | 'POST' | 'HEAD' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH' + >; /** - * Enables the binding cookie, which increases security against compromised - * authorization tokens and CSRF attacks. + * Allowed origins. */ - enable_binding_cookie?: boolean; + allowed_origins?: Array; /** - * Enables the HttpOnly cookie attribute, which increases security against XSS - * attacks. + * The maximum number of seconds the results of a preflight request can be cached. */ - http_only_cookie_attribute?: boolean; + max_age?: number; + } + export interface AccessSamlSaasApp { /** - * The image URL for the logo shown in the App Launcher dashboard. + * Optional identifier indicating the authentication protocol used for the saas + * app. Required for OIDC. Default if unset is "saml" */ - logo_url?: string; + auth_type?: 'saml' | 'oidc'; /** - * The name of the application. + * The service provider's endpoint that is responsible for receiving and parsing a + * SAML assertion. */ - name?: string; + consumer_service_url?: string; + + custom_attributes?: AccessSamlSaasApp.CustomAttributes; /** - * Enables cookie paths to scope an application's JWT to the application path. If - * disabled, the JWT will scope to the hostname by default + * The URL that the user will be redirected to after a successful login for IDP + * initiated logins. */ - path_cookie_attribute?: boolean; + default_relay_state?: string; /** - * Sets the SameSite cookie setting, which provides increased security against CSRF - * attacks. + * The unique identifier for your SaaS application. */ - same_site_cookie_attribute?: string; + idp_entity_id?: string; /** - * List of domains that Access will secure. + * The format of the name identifier sent to the SaaS application. */ - self_hosted_domains?: Array; + name_id_format?: 'id' | 'email'; /** - * Returns a 401 status code when the request is blocked by a Service Auth policy. + * A [JSONata](https://jsonata.org/) expression that transforms an application's + * user identities into a NameID value for its SAML assertion. This expression + * should evaluate to a singular string. The output of this expression can override + * the `name_id_format` setting. */ - service_auth_401_redirect?: boolean; + name_id_transform_jsonata?: string; /** - * The amount of time that tokens issued for this application will be valid. Must - * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, - * s, m, h. + * The Access public certificate that will be used to verify your identity. */ - session_duration?: string; + public_key?: string; /** - * Enables automatic authentication through cloudflared. + * A globally unique name for an identity or service provider. */ - skip_interstitial?: boolean; + sp_entity_id?: string; /** - * The tags you want assigned to an application. Tags are used to filter - * applications in the App Launcher dashboard. + * The endpoint where your SaaS application will send login requests. */ - tags?: Array; + sso_endpoint?: string; } - export namespace Variant0 { - export interface CorsHeaders { - /** - * Allows all HTTP request headers. - */ - allow_all_headers?: boolean; - - /** - * Allows all HTTP request methods. - */ - allow_all_methods?: boolean; - + export namespace AccessSamlSaasApp { + export interface CustomAttributes { /** - * Allows all origins. - */ - allow_all_origins?: boolean; - - /** - * When set to `true`, includes credentials (cookies, authorization headers, or TLS - * client certificates) with requests. - */ - allow_credentials?: boolean; - - /** - * Allowed HTTP request headers. + * The name of the attribute. */ - allowed_headers?: Array; + name?: string; /** - * Allowed HTTP request methods. + * A globally unique name for an identity or service provider. */ - allowed_methods?: Array< - 'GET' | 'POST' | 'HEAD' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH' - >; + name_format?: + | 'urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified' + | 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic' + | 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri'; - /** - * Allowed origins. - */ - allowed_origins?: Array; + source?: CustomAttributes.Source; + } - /** - * The maximum number of seconds the results of a preflight request can be cached. - */ - max_age?: number; + export namespace CustomAttributes { + export interface Source { + /** + * The name of the IdP attribute. + */ + name?: string; + } } } - export interface Variant1 { + export interface AccessOidcSaasApp { /** - * The identity providers your users can select when connecting to this - * application. Defaults to all IdPs configured in your account. + * The URL where this applications tile redirects users */ - allowed_idps?: Array; + app_launcher_url?: string; /** - * Displays the application in the App Launcher. + * Identifier of the authentication protocol used for the saas app. Required for + * OIDC. */ - app_launcher_visible?: boolean; + auth_type?: 'saml' | 'oidc'; /** - * When set to `true`, users skip the identity provider selection step during - * login. You must specify only one identity provider in allowed_idps. + * The application client id */ - auto_redirect_to_identity?: boolean; + client_id?: string; /** - * The custom pages that will be displayed when applicable for this application + * The application client secret, only returned on POST request. */ - custom_pages?: Array; + client_secret?: string; /** - * The image URL for the logo shown in the App Launcher dashboard. + * The OIDC flows supported by this application */ - logo_url?: string; + grant_types?: Array<'authorization_code' | 'authorization_code_with_pkce'>; /** - * The name of the application. + * A regex to filter Cloudflare groups returned in ID token and userinfo endpoint */ - name?: string; + group_filter_regex?: string; - saas_app?: - | ApplicationCreateParams.Variant1.AccessSamlSaasApp - | ApplicationCreateParams.Variant1.AccessOidcSaasApp; + /** + * The Access public certificate that will be used to verify your identity. + */ + public_key?: string; /** - * The tags you want assigned to an application. Tags are used to filter - * applications in the App Launcher dashboard. + * The permitted URL's for Cloudflare to return Authorization codes and Access/ID + * tokens */ - tags?: Array; + redirect_uris?: Array; /** - * The application type. + * Define the user information shared with access */ - type?: string; + scopes?: Array<'openid' | 'groups' | 'email' | 'profile'>; } +} - export namespace Variant1 { - export interface AccessSamlSaasApp { - /** - * Optional identifier indicating the authentication protocol used for the saas - * app. Required for OIDC. Default if unset is "saml" - */ - auth_type?: 'saml' | 'oidc'; +export interface ApplicationUpdateParams { + /** + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; - /** - * The service provider's endpoint that is responsible for receiving and parsing a - * SAML assertion. - */ - consumer_service_url?: string; + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; - custom_attributes?: AccessSamlSaasApp.CustomAttributes; + /** + * Body param: When set to true, users can authenticate to this application using + * their WARP session. When set to false this application will always require + * direct IdP authentication. This setting always overrides the organization + * setting for WARP authentication. + */ + allow_authenticate_via_warp?: boolean; - /** - * The URL that the user will be redirected to after a successful login for IDP - * initiated logins. - */ - default_relay_state?: string; + /** + * Body param: The identity providers your users can select when connecting to this + * application. Defaults to all IdPs configured in your account. + */ + allowed_idps?: Array; - /** - * The unique identifier for your SaaS application. - */ - idp_entity_id?: string; + /** + * Body param: + */ + app_launcher_visible?: unknown; - /** - * The format of the name identifier sent to the SaaS application. - */ - name_id_format?: 'id' | 'email'; + /** + * Body param: When set to `true`, users skip the identity provider selection step + * during login. You must specify only one identity provider in allowed_idps. + */ + auto_redirect_to_identity?: boolean; - /** - * A [JSONata](https://jsonata.org/) expression that transforms an application's - * user identities into a NameID value for its SAML assertion. This expression - * should evaluate to a singular string. The output of this expression can override - * the `name_id_format` setting. - */ - name_id_transform_jsonata?: string; - - /** - * The Access public certificate that will be used to verify your identity. - */ - public_key?: string; - - /** - * A globally unique name for an identity or service provider. - */ - sp_entity_id?: string; - - /** - * The endpoint where your SaaS application will send login requests. - */ - sso_endpoint?: string; - } - - export namespace AccessSamlSaasApp { - export interface CustomAttributes { - /** - * The name of the attribute. - */ - name?: string; - - /** - * A globally unique name for an identity or service provider. - */ - name_format?: - | 'urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified' - | 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic' - | 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri'; - - source?: CustomAttributes.Source; - } - - export namespace CustomAttributes { - export interface Source { - /** - * The name of the IdP attribute. - */ - name?: string; - } - } - } - - export interface AccessOidcSaasApp { - /** - * The URL where this applications tile redirects users - */ - app_launcher_url?: string; - - /** - * Identifier of the authentication protocol used for the saas app. Required for - * OIDC. - */ - auth_type?: 'saml' | 'oidc'; - - /** - * The application client id - */ - client_id?: string; - - /** - * The application client secret, only returned on POST request. - */ - client_secret?: string; - - /** - * The OIDC flows supported by this application - */ - grant_types?: Array<'authorization_code' | 'authorization_code_with_pkce'>; - - /** - * A regex to filter Cloudflare groups returned in ID token and userinfo endpoint - */ - group_filter_regex?: string; - - /** - * The Access public certificate that will be used to verify your identity. - */ - public_key?: string; - - /** - * The permitted URL's for Cloudflare to return Authorization codes and Access/ID - * tokens - */ - redirect_uris?: Array; - - /** - * Define the user information shared with access - */ - scopes?: Array<'openid' | 'groups' | 'email' | 'profile'>; - } - } - - export interface Variant2 { - /** - * The primary hostname and path that Access will secure. If the app is visible in - * the App Launcher dashboard, this is the domain that will be displayed. - */ - domain: string; - - /** - * The application type. - */ - type: string; - - /** - * When set to true, users can authenticate to this application using their WARP - * session. When set to false this application will always require direct IdP - * authentication. This setting always overrides the organization setting for WARP - * authentication. - */ - allow_authenticate_via_warp?: boolean; - - /** - * The identity providers your users can select when connecting to this - * application. Defaults to all IdPs configured in your account. - */ - allowed_idps?: Array; - - /** - * Displays the application in the App Launcher. - */ - app_launcher_visible?: boolean; - - /** - * When set to `true`, users skip the identity provider selection step during - * login. You must specify only one identity provider in allowed_idps. - */ - auto_redirect_to_identity?: boolean; - - cors_headers?: ApplicationCreateParams.Variant2.CorsHeaders; - - /** - * The custom error message shown to a user when they are denied access to the - * application. - */ - custom_deny_message?: string; - - /** - * The custom URL a user is redirected to when they are denied access to the - * application when failing identity-based rules. - */ - custom_deny_url?: string; - - /** - * The custom URL a user is redirected to when they are denied access to the - * application when failing non-identity rules. - */ - custom_non_identity_deny_url?: string; - - /** - * The custom pages that will be displayed when applicable for this application - */ - custom_pages?: Array; - - /** - * Enables the binding cookie, which increases security against compromised - * authorization tokens and CSRF attacks. - */ - enable_binding_cookie?: boolean; - - /** - * Enables the HttpOnly cookie attribute, which increases security against XSS - * attacks. - */ - http_only_cookie_attribute?: boolean; - - /** - * The image URL for the logo shown in the App Launcher dashboard. - */ - logo_url?: string; - - /** - * The name of the application. - */ - name?: string; - - /** - * Enables cookie paths to scope an application's JWT to the application path. If - * disabled, the JWT will scope to the hostname by default - */ - path_cookie_attribute?: boolean; - - /** - * Sets the SameSite cookie setting, which provides increased security against CSRF - * attacks. - */ - same_site_cookie_attribute?: string; - - /** - * List of domains that Access will secure. - */ - self_hosted_domains?: Array; - - /** - * Returns a 401 status code when the request is blocked by a Service Auth policy. - */ - service_auth_401_redirect?: boolean; - - /** - * The amount of time that tokens issued for this application will be valid. Must - * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, - * s, m, h. - */ - session_duration?: string; - - /** - * Enables automatic authentication through cloudflared. - */ - skip_interstitial?: boolean; - - /** - * The tags you want assigned to an application. Tags are used to filter - * applications in the App Launcher dashboard. - */ - tags?: Array; - } - - export namespace Variant2 { - export interface CorsHeaders { - /** - * Allows all HTTP request headers. - */ - allow_all_headers?: boolean; - - /** - * Allows all HTTP request methods. - */ - allow_all_methods?: boolean; - - /** - * Allows all origins. - */ - allow_all_origins?: boolean; - - /** - * When set to `true`, includes credentials (cookies, authorization headers, or TLS - * client certificates) with requests. - */ - allow_credentials?: boolean; - - /** - * Allowed HTTP request headers. - */ - allowed_headers?: Array; - - /** - * Allowed HTTP request methods. - */ - allowed_methods?: Array< - 'GET' | 'POST' | 'HEAD' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH' - >; - - /** - * Allowed origins. - */ - allowed_origins?: Array; - - /** - * The maximum number of seconds the results of a preflight request can be cached. - */ - max_age?: number; - } - } - - export interface Variant3 { - /** - * The primary hostname and path that Access will secure. If the app is visible in - * the App Launcher dashboard, this is the domain that will be displayed. - */ - domain: string; - - /** - * The application type. - */ - type: string; - - /** - * When set to true, users can authenticate to this application using their WARP - * session. When set to false this application will always require direct IdP - * authentication. This setting always overrides the organization setting for WARP - * authentication. - */ - allow_authenticate_via_warp?: boolean; - - /** - * The identity providers your users can select when connecting to this - * application. Defaults to all IdPs configured in your account. - */ - allowed_idps?: Array; - - /** - * Displays the application in the App Launcher. - */ - app_launcher_visible?: boolean; - - /** - * When set to `true`, users skip the identity provider selection step during - * login. You must specify only one identity provider in allowed_idps. - */ - auto_redirect_to_identity?: boolean; - - cors_headers?: ApplicationCreateParams.Variant3.CorsHeaders; - - /** - * The custom error message shown to a user when they are denied access to the - * application. - */ - custom_deny_message?: string; - - /** - * The custom URL a user is redirected to when they are denied access to the - * application when failing identity-based rules. - */ - custom_deny_url?: string; - - /** - * The custom URL a user is redirected to when they are denied access to the - * application when failing non-identity rules. - */ - custom_non_identity_deny_url?: string; - - /** - * The custom pages that will be displayed when applicable for this application - */ - custom_pages?: Array; - - /** - * Enables the binding cookie, which increases security against compromised - * authorization tokens and CSRF attacks. - */ - enable_binding_cookie?: boolean; - - /** - * Enables the HttpOnly cookie attribute, which increases security against XSS - * attacks. - */ - http_only_cookie_attribute?: boolean; - - /** - * The image URL for the logo shown in the App Launcher dashboard. - */ - logo_url?: string; - - /** - * The name of the application. - */ - name?: string; - - /** - * Enables cookie paths to scope an application's JWT to the application path. If - * disabled, the JWT will scope to the hostname by default - */ - path_cookie_attribute?: boolean; - - /** - * Sets the SameSite cookie setting, which provides increased security against CSRF - * attacks. - */ - same_site_cookie_attribute?: string; - - /** - * List of domains that Access will secure. - */ - self_hosted_domains?: Array; - - /** - * Returns a 401 status code when the request is blocked by a Service Auth policy. - */ - service_auth_401_redirect?: boolean; - - /** - * The amount of time that tokens issued for this application will be valid. Must - * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, - * s, m, h. - */ - session_duration?: string; - - /** - * Enables automatic authentication through cloudflared. - */ - skip_interstitial?: boolean; - - /** - * The tags you want assigned to an application. Tags are used to filter - * applications in the App Launcher dashboard. - */ - tags?: Array; - } - - export namespace Variant3 { - export interface CorsHeaders { - /** - * Allows all HTTP request headers. - */ - allow_all_headers?: boolean; - - /** - * Allows all HTTP request methods. - */ - allow_all_methods?: boolean; - - /** - * Allows all origins. - */ - allow_all_origins?: boolean; - - /** - * When set to `true`, includes credentials (cookies, authorization headers, or TLS - * client certificates) with requests. - */ - allow_credentials?: boolean; - - /** - * Allowed HTTP request headers. - */ - allowed_headers?: Array; - - /** - * Allowed HTTP request methods. - */ - allowed_methods?: Array< - 'GET' | 'POST' | 'HEAD' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH' - >; - - /** - * Allowed origins. - */ - allowed_origins?: Array; - - /** - * The maximum number of seconds the results of a preflight request can be cached. - */ - max_age?: number; - } - } - - export interface Variant4 { - /** - * The application type. - */ - type: 'self_hosted' | 'saas' | 'ssh' | 'vnc' | 'app_launcher' | 'warp' | 'biso' | 'bookmark' | 'dash_sso'; - - /** - * The identity providers your users can select when connecting to this - * application. Defaults to all IdPs configured in your account. - */ - allowed_idps?: Array; - - /** - * When set to `true`, users skip the identity provider selection step during - * login. You must specify only one identity provider in allowed_idps. - */ - auto_redirect_to_identity?: boolean; - - /** - * The amount of time that tokens issued for this application will be valid. Must - * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, - * s, m, h. - */ - session_duration?: string; - } - - export interface Variant5 { - /** - * The application type. - */ - type: 'self_hosted' | 'saas' | 'ssh' | 'vnc' | 'app_launcher' | 'warp' | 'biso' | 'bookmark' | 'dash_sso'; - - /** - * The identity providers your users can select when connecting to this - * application. Defaults to all IdPs configured in your account. - */ - allowed_idps?: Array; - - /** - * When set to `true`, users skip the identity provider selection step during - * login. You must specify only one identity provider in allowed_idps. - */ - auto_redirect_to_identity?: boolean; - - /** - * The amount of time that tokens issued for this application will be valid. Must - * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, - * s, m, h. - */ - session_duration?: string; - } - - export interface Variant6 { - /** - * The application type. - */ - type: 'self_hosted' | 'saas' | 'ssh' | 'vnc' | 'app_launcher' | 'warp' | 'biso' | 'bookmark' | 'dash_sso'; - - /** - * The identity providers your users can select when connecting to this - * application. Defaults to all IdPs configured in your account. - */ - allowed_idps?: Array; - - /** - * When set to `true`, users skip the identity provider selection step during - * login. You must specify only one identity provider in allowed_idps. - */ - auto_redirect_to_identity?: boolean; - - /** - * The amount of time that tokens issued for this application will be valid. Must - * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, - * s, m, h. - */ - session_duration?: string; - } - - export interface Variant7 { - app_launcher_visible?: unknown; - - /** - * The URL or domain of the bookmark. - */ - domain?: unknown; - - /** - * The image URL for the logo shown in the App Launcher dashboard. - */ - logo_url?: string; - - /** - * The name of the application. - */ - name?: string; - - /** - * The tags you want assigned to an application. Tags are used to filter - * applications in the App Launcher dashboard. - */ - tags?: Array; - - /** - * The application type. - */ - type?: string; - } -} - -export type ApplicationUpdateParams = - | ApplicationUpdateParams.Variant0 - | ApplicationUpdateParams.Variant1 - | ApplicationUpdateParams.Variant2 - | ApplicationUpdateParams.Variant3 - | ApplicationUpdateParams.Variant4 - | ApplicationUpdateParams.Variant5 - | ApplicationUpdateParams.Variant6 - | ApplicationUpdateParams.Variant7; - -export namespace ApplicationUpdateParams { - export interface Variant0 { - /** - * The primary hostname and path that Access will secure. If the app is visible in - * the App Launcher dashboard, this is the domain that will be displayed. - */ - domain: string; - - /** - * The application type. - */ - type: string; - - /** - * When set to true, users can authenticate to this application using their WARP - * session. When set to false this application will always require direct IdP - * authentication. This setting always overrides the organization setting for WARP - * authentication. - */ - allow_authenticate_via_warp?: boolean; - - /** - * The identity providers your users can select when connecting to this - * application. Defaults to all IdPs configured in your account. - */ - allowed_idps?: Array; - - /** - * Displays the application in the App Launcher. - */ - app_launcher_visible?: boolean; - - /** - * When set to `true`, users skip the identity provider selection step during - * login. You must specify only one identity provider in allowed_idps. - */ - auto_redirect_to_identity?: boolean; - - cors_headers?: ApplicationUpdateParams.Variant0.CorsHeaders; - - /** - * The custom error message shown to a user when they are denied access to the - * application. - */ - custom_deny_message?: string; - - /** - * The custom URL a user is redirected to when they are denied access to the - * application when failing identity-based rules. - */ - custom_deny_url?: string; - - /** - * The custom URL a user is redirected to when they are denied access to the - * application when failing non-identity rules. - */ - custom_non_identity_deny_url?: string; - - /** - * The custom pages that will be displayed when applicable for this application - */ - custom_pages?: Array; - - /** - * Enables the binding cookie, which increases security against compromised - * authorization tokens and CSRF attacks. - */ - enable_binding_cookie?: boolean; - - /** - * Enables the HttpOnly cookie attribute, which increases security against XSS - * attacks. - */ - http_only_cookie_attribute?: boolean; - - /** - * The image URL for the logo shown in the App Launcher dashboard. - */ - logo_url?: string; - - /** - * The name of the application. - */ - name?: string; - - /** - * Enables cookie paths to scope an application's JWT to the application path. If - * disabled, the JWT will scope to the hostname by default - */ - path_cookie_attribute?: boolean; - - /** - * Sets the SameSite cookie setting, which provides increased security against CSRF - * attacks. - */ - same_site_cookie_attribute?: string; - - /** - * List of domains that Access will secure. - */ - self_hosted_domains?: Array; - - /** - * Returns a 401 status code when the request is blocked by a Service Auth policy. - */ - service_auth_401_redirect?: boolean; - - /** - * The amount of time that tokens issued for this application will be valid. Must - * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, - * s, m, h. - */ - session_duration?: string; - - /** - * Enables automatic authentication through cloudflared. - */ - skip_interstitial?: boolean; - - /** - * The tags you want assigned to an application. Tags are used to filter - * applications in the App Launcher dashboard. - */ - tags?: Array; - } - - export namespace Variant0 { - export interface CorsHeaders { - /** - * Allows all HTTP request headers. - */ - allow_all_headers?: boolean; - - /** - * Allows all HTTP request methods. - */ - allow_all_methods?: boolean; - - /** - * Allows all origins. - */ - allow_all_origins?: boolean; - - /** - * When set to `true`, includes credentials (cookies, authorization headers, or TLS - * client certificates) with requests. - */ - allow_credentials?: boolean; - - /** - * Allowed HTTP request headers. - */ - allowed_headers?: Array; - - /** - * Allowed HTTP request methods. - */ - allowed_methods?: Array< - 'GET' | 'POST' | 'HEAD' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH' - >; - - /** - * Allowed origins. - */ - allowed_origins?: Array; - - /** - * The maximum number of seconds the results of a preflight request can be cached. - */ - max_age?: number; - } - } - - export interface Variant1 { - /** - * The identity providers your users can select when connecting to this - * application. Defaults to all IdPs configured in your account. - */ - allowed_idps?: Array; - - /** - * Displays the application in the App Launcher. - */ - app_launcher_visible?: boolean; - - /** - * When set to `true`, users skip the identity provider selection step during - * login. You must specify only one identity provider in allowed_idps. - */ - auto_redirect_to_identity?: boolean; - - /** - * The custom pages that will be displayed when applicable for this application - */ - custom_pages?: Array; - - /** - * The image URL for the logo shown in the App Launcher dashboard. - */ - logo_url?: string; - - /** - * The name of the application. - */ - name?: string; - - saas_app?: - | ApplicationUpdateParams.Variant1.AccessSamlSaasApp - | ApplicationUpdateParams.Variant1.AccessOidcSaasApp; - - /** - * The tags you want assigned to an application. Tags are used to filter - * applications in the App Launcher dashboard. - */ - tags?: Array; - - /** - * The application type. - */ - type?: string; - } - - export namespace Variant1 { - export interface AccessSamlSaasApp { - /** - * Optional identifier indicating the authentication protocol used for the saas - * app. Required for OIDC. Default if unset is "saml" - */ - auth_type?: 'saml' | 'oidc'; - - /** - * The service provider's endpoint that is responsible for receiving and parsing a - * SAML assertion. - */ - consumer_service_url?: string; - - custom_attributes?: AccessSamlSaasApp.CustomAttributes; - - /** - * The URL that the user will be redirected to after a successful login for IDP - * initiated logins. - */ - default_relay_state?: string; - - /** - * The unique identifier for your SaaS application. - */ - idp_entity_id?: string; - - /** - * The format of the name identifier sent to the SaaS application. - */ - name_id_format?: 'id' | 'email'; - - /** - * A [JSONata](https://jsonata.org/) expression that transforms an application's - * user identities into a NameID value for its SAML assertion. This expression - * should evaluate to a singular string. The output of this expression can override - * the `name_id_format` setting. - */ - name_id_transform_jsonata?: string; - - /** - * The Access public certificate that will be used to verify your identity. - */ - public_key?: string; - - /** - * A globally unique name for an identity or service provider. - */ - sp_entity_id?: string; - - /** - * The endpoint where your SaaS application will send login requests. - */ - sso_endpoint?: string; - } - - export namespace AccessSamlSaasApp { - export interface CustomAttributes { - /** - * The name of the attribute. - */ - name?: string; - - /** - * A globally unique name for an identity or service provider. - */ - name_format?: - | 'urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified' - | 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic' - | 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri'; - - source?: CustomAttributes.Source; - } - - export namespace CustomAttributes { - export interface Source { - /** - * The name of the IdP attribute. - */ - name?: string; - } - } - } - - export interface AccessOidcSaasApp { - /** - * The URL where this applications tile redirects users - */ - app_launcher_url?: string; - - /** - * Identifier of the authentication protocol used for the saas app. Required for - * OIDC. - */ - auth_type?: 'saml' | 'oidc'; - - /** - * The application client id - */ - client_id?: string; - - /** - * The application client secret, only returned on POST request. - */ - client_secret?: string; - - /** - * The OIDC flows supported by this application - */ - grant_types?: Array<'authorization_code' | 'authorization_code_with_pkce'>; - - /** - * A regex to filter Cloudflare groups returned in ID token and userinfo endpoint - */ - group_filter_regex?: string; - - /** - * The Access public certificate that will be used to verify your identity. - */ - public_key?: string; - - /** - * The permitted URL's for Cloudflare to return Authorization codes and Access/ID - * tokens - */ - redirect_uris?: Array; - - /** - * Define the user information shared with access - */ - scopes?: Array<'openid' | 'groups' | 'email' | 'profile'>; - } - } - - export interface Variant2 { - /** - * The primary hostname and path that Access will secure. If the app is visible in - * the App Launcher dashboard, this is the domain that will be displayed. - */ - domain: string; - - /** - * The application type. - */ - type: string; - - /** - * When set to true, users can authenticate to this application using their WARP - * session. When set to false this application will always require direct IdP - * authentication. This setting always overrides the organization setting for WARP - * authentication. - */ - allow_authenticate_via_warp?: boolean; - - /** - * The identity providers your users can select when connecting to this - * application. Defaults to all IdPs configured in your account. - */ - allowed_idps?: Array; - - /** - * Displays the application in the App Launcher. - */ - app_launcher_visible?: boolean; - - /** - * When set to `true`, users skip the identity provider selection step during - * login. You must specify only one identity provider in allowed_idps. - */ - auto_redirect_to_identity?: boolean; - - cors_headers?: ApplicationUpdateParams.Variant2.CorsHeaders; - - /** - * The custom error message shown to a user when they are denied access to the - * application. - */ - custom_deny_message?: string; - - /** - * The custom URL a user is redirected to when they are denied access to the - * application when failing identity-based rules. - */ - custom_deny_url?: string; - - /** - * The custom URL a user is redirected to when they are denied access to the - * application when failing non-identity rules. - */ - custom_non_identity_deny_url?: string; - - /** - * The custom pages that will be displayed when applicable for this application - */ - custom_pages?: Array; - - /** - * Enables the binding cookie, which increases security against compromised - * authorization tokens and CSRF attacks. - */ - enable_binding_cookie?: boolean; - - /** - * Enables the HttpOnly cookie attribute, which increases security against XSS - * attacks. - */ - http_only_cookie_attribute?: boolean; - - /** - * The image URL for the logo shown in the App Launcher dashboard. - */ - logo_url?: string; - - /** - * The name of the application. - */ - name?: string; + /** + * Body param: + */ + cors_headers?: ApplicationUpdateParams.CorsHeaders; - /** - * Enables cookie paths to scope an application's JWT to the application path. If - * disabled, the JWT will scope to the hostname by default - */ - path_cookie_attribute?: boolean; + /** + * Body param: The custom error message shown to a user when they are denied access + * to the application. + */ + custom_deny_message?: string; - /** - * Sets the SameSite cookie setting, which provides increased security against CSRF - * attacks. - */ - same_site_cookie_attribute?: string; + /** + * Body param: The custom URL a user is redirected to when they are denied access + * to the application when failing identity-based rules. + */ + custom_deny_url?: string; - /** - * List of domains that Access will secure. - */ - self_hosted_domains?: Array; + /** + * Body param: The custom URL a user is redirected to when they are denied access + * to the application when failing non-identity rules. + */ + custom_non_identity_deny_url?: string; - /** - * Returns a 401 status code when the request is blocked by a Service Auth policy. - */ - service_auth_401_redirect?: boolean; + /** + * Body param: The custom pages that will be displayed when applicable for this + * application + */ + custom_pages?: Array; - /** - * The amount of time that tokens issued for this application will be valid. Must - * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, - * s, m, h. - */ - session_duration?: string; + /** + * Body param: The URL or domain of the bookmark. + */ + domain?: unknown; - /** - * Enables automatic authentication through cloudflared. - */ - skip_interstitial?: boolean; + /** + * Body param: Enables the binding cookie, which increases security against + * compromised authorization tokens and CSRF attacks. + */ + enable_binding_cookie?: boolean; - /** - * The tags you want assigned to an application. Tags are used to filter - * applications in the App Launcher dashboard. - */ - tags?: Array; - } + /** + * Body param: Enables the HttpOnly cookie attribute, which increases security + * against XSS attacks. + */ + http_only_cookie_attribute?: boolean; - export namespace Variant2 { - export interface CorsHeaders { - /** - * Allows all HTTP request headers. - */ - allow_all_headers?: boolean; + /** + * Body param: The image URL for the logo shown in the App Launcher dashboard. + */ + logo_url?: string; - /** - * Allows all HTTP request methods. - */ - allow_all_methods?: boolean; + /** + * Body param: The name of the application. + */ + name?: string; - /** - * Allows all origins. - */ - allow_all_origins?: boolean; + /** + * Body param: Enables cookie paths to scope an application's JWT to the + * application path. If disabled, the JWT will scope to the hostname by default + */ + path_cookie_attribute?: boolean; - /** - * When set to `true`, includes credentials (cookies, authorization headers, or TLS - * client certificates) with requests. - */ - allow_credentials?: boolean; + /** + * Body param: + */ + saas_app?: ApplicationUpdateParams.AccessSamlSaasApp | ApplicationUpdateParams.AccessOidcSaasApp; - /** - * Allowed HTTP request headers. - */ - allowed_headers?: Array; + /** + * Body param: Sets the SameSite cookie setting, which provides increased security + * against CSRF attacks. + */ + same_site_cookie_attribute?: string; - /** - * Allowed HTTP request methods. - */ - allowed_methods?: Array< - 'GET' | 'POST' | 'HEAD' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH' - >; + /** + * Body param: List of domains that Access will secure. + */ + self_hosted_domains?: Array; - /** - * Allowed origins. - */ - allowed_origins?: Array; + /** + * Body param: Returns a 401 status code when the request is blocked by a Service + * Auth policy. + */ + service_auth_401_redirect?: boolean; - /** - * The maximum number of seconds the results of a preflight request can be cached. - */ - max_age?: number; - } - } + /** + * Body param: The amount of time that tokens issued for this application will be + * valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us + * (or µs), ms, s, m, h. + */ + session_duration?: string; - export interface Variant3 { - /** - * The primary hostname and path that Access will secure. If the app is visible in - * the App Launcher dashboard, this is the domain that will be displayed. - */ - domain: string; + /** + * Body param: Enables automatic authentication through cloudflared. + */ + skip_interstitial?: boolean; - /** - * The application type. - */ - type: string; + /** + * Body param: The tags you want assigned to an application. Tags are used to + * filter applications in the App Launcher dashboard. + */ + tags?: Array; - /** - * When set to true, users can authenticate to this application using their WARP - * session. When set to false this application will always require direct IdP - * authentication. This setting always overrides the organization setting for WARP - * authentication. - */ - allow_authenticate_via_warp?: boolean; + /** + * Body param: The application type. + */ + type?: string; +} +export namespace ApplicationUpdateParams { + export interface CorsHeaders { /** - * The identity providers your users can select when connecting to this - * application. Defaults to all IdPs configured in your account. + * Allows all HTTP request headers. */ - allowed_idps?: Array; + allow_all_headers?: boolean; /** - * Displays the application in the App Launcher. + * Allows all HTTP request methods. */ - app_launcher_visible?: boolean; + allow_all_methods?: boolean; /** - * When set to `true`, users skip the identity provider selection step during - * login. You must specify only one identity provider in allowed_idps. + * Allows all origins. */ - auto_redirect_to_identity?: boolean; - - cors_headers?: ApplicationUpdateParams.Variant3.CorsHeaders; + allow_all_origins?: boolean; /** - * The custom error message shown to a user when they are denied access to the - * application. + * When set to `true`, includes credentials (cookies, authorization headers, or TLS + * client certificates) with requests. */ - custom_deny_message?: string; + allow_credentials?: boolean; /** - * The custom URL a user is redirected to when they are denied access to the - * application when failing identity-based rules. + * Allowed HTTP request headers. */ - custom_deny_url?: string; + allowed_headers?: Array; /** - * The custom URL a user is redirected to when they are denied access to the - * application when failing non-identity rules. + * Allowed HTTP request methods. */ - custom_non_identity_deny_url?: string; + allowed_methods?: Array< + 'GET' | 'POST' | 'HEAD' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH' + >; /** - * The custom pages that will be displayed when applicable for this application + * Allowed origins. */ - custom_pages?: Array; + allowed_origins?: Array; /** - * Enables the binding cookie, which increases security against compromised - * authorization tokens and CSRF attacks. + * The maximum number of seconds the results of a preflight request can be cached. */ - enable_binding_cookie?: boolean; + max_age?: number; + } + export interface AccessSamlSaasApp { /** - * Enables the HttpOnly cookie attribute, which increases security against XSS - * attacks. + * Optional identifier indicating the authentication protocol used for the saas + * app. Required for OIDC. Default if unset is "saml" */ - http_only_cookie_attribute?: boolean; + auth_type?: 'saml' | 'oidc'; /** - * The image URL for the logo shown in the App Launcher dashboard. + * The service provider's endpoint that is responsible for receiving and parsing a + * SAML assertion. */ - logo_url?: string; + consumer_service_url?: string; - /** - * The name of the application. - */ - name?: string; + custom_attributes?: AccessSamlSaasApp.CustomAttributes; /** - * Enables cookie paths to scope an application's JWT to the application path. If - * disabled, the JWT will scope to the hostname by default + * The URL that the user will be redirected to after a successful login for IDP + * initiated logins. */ - path_cookie_attribute?: boolean; + default_relay_state?: string; /** - * Sets the SameSite cookie setting, which provides increased security against CSRF - * attacks. + * The unique identifier for your SaaS application. */ - same_site_cookie_attribute?: string; + idp_entity_id?: string; /** - * List of domains that Access will secure. + * The format of the name identifier sent to the SaaS application. */ - self_hosted_domains?: Array; + name_id_format?: 'id' | 'email'; /** - * Returns a 401 status code when the request is blocked by a Service Auth policy. + * A [JSONata](https://jsonata.org/) expression that transforms an application's + * user identities into a NameID value for its SAML assertion. This expression + * should evaluate to a singular string. The output of this expression can override + * the `name_id_format` setting. */ - service_auth_401_redirect?: boolean; + name_id_transform_jsonata?: string; /** - * The amount of time that tokens issued for this application will be valid. Must - * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, - * s, m, h. + * The Access public certificate that will be used to verify your identity. */ - session_duration?: string; + public_key?: string; /** - * Enables automatic authentication through cloudflared. + * A globally unique name for an identity or service provider. */ - skip_interstitial?: boolean; + sp_entity_id?: string; /** - * The tags you want assigned to an application. Tags are used to filter - * applications in the App Launcher dashboard. + * The endpoint where your SaaS application will send login requests. */ - tags?: Array; + sso_endpoint?: string; } - export namespace Variant3 { - export interface CorsHeaders { - /** - * Allows all HTTP request headers. - */ - allow_all_headers?: boolean; - - /** - * Allows all HTTP request methods. - */ - allow_all_methods?: boolean; - - /** - * Allows all origins. - */ - allow_all_origins?: boolean; - - /** - * When set to `true`, includes credentials (cookies, authorization headers, or TLS - * client certificates) with requests. - */ - allow_credentials?: boolean; - + export namespace AccessSamlSaasApp { + export interface CustomAttributes { /** - * Allowed HTTP request headers. + * The name of the attribute. */ - allowed_headers?: Array; + name?: string; /** - * Allowed HTTP request methods. + * A globally unique name for an identity or service provider. */ - allowed_methods?: Array< - 'GET' | 'POST' | 'HEAD' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH' - >; + name_format?: + | 'urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified' + | 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic' + | 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri'; - /** - * Allowed origins. - */ - allowed_origins?: Array; + source?: CustomAttributes.Source; + } - /** - * The maximum number of seconds the results of a preflight request can be cached. - */ - max_age?: number; + export namespace CustomAttributes { + export interface Source { + /** + * The name of the IdP attribute. + */ + name?: string; + } } } - export interface Variant4 { - /** - * The application type. - */ - type: 'self_hosted' | 'saas' | 'ssh' | 'vnc' | 'app_launcher' | 'warp' | 'biso' | 'bookmark' | 'dash_sso'; - + export interface AccessOidcSaasApp { /** - * The identity providers your users can select when connecting to this - * application. Defaults to all IdPs configured in your account. + * The URL where this applications tile redirects users */ - allowed_idps?: Array; + app_launcher_url?: string; /** - * When set to `true`, users skip the identity provider selection step during - * login. You must specify only one identity provider in allowed_idps. + * Identifier of the authentication protocol used for the saas app. Required for + * OIDC. */ - auto_redirect_to_identity?: boolean; + auth_type?: 'saml' | 'oidc'; /** - * The amount of time that tokens issued for this application will be valid. Must - * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, - * s, m, h. + * The application client id */ - session_duration?: string; - } + client_id?: string; - export interface Variant5 { /** - * The application type. + * The application client secret, only returned on POST request. */ - type: 'self_hosted' | 'saas' | 'ssh' | 'vnc' | 'app_launcher' | 'warp' | 'biso' | 'bookmark' | 'dash_sso'; + client_secret?: string; /** - * The identity providers your users can select when connecting to this - * application. Defaults to all IdPs configured in your account. + * The OIDC flows supported by this application */ - allowed_idps?: Array; + grant_types?: Array<'authorization_code' | 'authorization_code_with_pkce'>; /** - * When set to `true`, users skip the identity provider selection step during - * login. You must specify only one identity provider in allowed_idps. + * A regex to filter Cloudflare groups returned in ID token and userinfo endpoint */ - auto_redirect_to_identity?: boolean; + group_filter_regex?: string; /** - * The amount of time that tokens issued for this application will be valid. Must - * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, - * s, m, h. + * The Access public certificate that will be used to verify your identity. */ - session_duration?: string; - } + public_key?: string; - export interface Variant6 { /** - * The application type. + * The permitted URL's for Cloudflare to return Authorization codes and Access/ID + * tokens */ - type: 'self_hosted' | 'saas' | 'ssh' | 'vnc' | 'app_launcher' | 'warp' | 'biso' | 'bookmark' | 'dash_sso'; + redirect_uris?: Array; /** - * The identity providers your users can select when connecting to this - * application. Defaults to all IdPs configured in your account. + * Define the user information shared with access */ - allowed_idps?: Array; + scopes?: Array<'openid' | 'groups' | 'email' | 'profile'>; + } +} - /** - * When set to `true`, users skip the identity provider selection step during - * login. You must specify only one identity provider in allowed_idps. - */ - auto_redirect_to_identity?: boolean; +export interface ApplicationListParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; - /** - * The amount of time that tokens issued for this application will be valid. Must - * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, - * s, m, h. - */ - session_duration?: string; - } + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} - export interface Variant7 { - app_launcher_visible?: unknown; +export interface ApplicationDeleteParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; - /** - * The URL or domain of the bookmark. - */ - domain?: unknown; + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} - /** - * The image URL for the logo shown in the App Launcher dashboard. - */ - logo_url?: string; +export interface ApplicationGetParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; - /** - * The name of the application. - */ - name?: string; + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} - /** - * The tags you want assigned to an application. Tags are used to filter - * applications in the App Launcher dashboard. - */ - tags?: Array; +export interface ApplicationRevokeTokensParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; - /** - * The application type. - */ - type?: string; - } + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; } export namespace Applications { @@ -5653,13 +4708,22 @@ export namespace Applications { export import ApplicationRevokeTokensResponse = ApplicationsAPI.ApplicationRevokeTokensResponse; export import ApplicationCreateParams = ApplicationsAPI.ApplicationCreateParams; export import ApplicationUpdateParams = ApplicationsAPI.ApplicationUpdateParams; + export import ApplicationListParams = ApplicationsAPI.ApplicationListParams; + export import ApplicationDeleteParams = ApplicationsAPI.ApplicationDeleteParams; + export import ApplicationGetParams = ApplicationsAPI.ApplicationGetParams; + export import ApplicationRevokeTokensParams = ApplicationsAPI.ApplicationRevokeTokensParams; export import Cas = CasAPI.Cas; export import CaCreateResponse = CasAPI.CaCreateResponse; export import CaListResponse = CasAPI.CaListResponse; export import CaDeleteResponse = CasAPI.CaDeleteResponse; export import CaGetResponse = CasAPI.CaGetResponse; + export import CaCreateParams = CasAPI.CaCreateParams; + export import CaListParams = CasAPI.CaListParams; + export import CaDeleteParams = CasAPI.CaDeleteParams; + export import CaGetParams = CasAPI.CaGetParams; export import UserPolicyChecks = UserPolicyChecksAPI.UserPolicyChecks; export import UserPolicyCheckListResponse = UserPolicyChecksAPI.UserPolicyCheckListResponse; + export import UserPolicyCheckListParams = UserPolicyChecksAPI.UserPolicyCheckListParams; export import Policies = PoliciesAPI.Policies; export import PolicyCreateResponse = PoliciesAPI.PolicyCreateResponse; export import PolicyUpdateResponse = PoliciesAPI.PolicyUpdateResponse; @@ -5668,4 +4732,7 @@ export namespace Applications { export import PolicyGetResponse = PoliciesAPI.PolicyGetResponse; export import PolicyCreateParams = PoliciesAPI.PolicyCreateParams; export import PolicyUpdateParams = PoliciesAPI.PolicyUpdateParams; + export import PolicyListParams = PoliciesAPI.PolicyListParams; + export import PolicyDeleteParams = PoliciesAPI.PolicyDeleteParams; + export import PolicyGetParams = PoliciesAPI.PolicyGetParams; } diff --git a/src/resources/access/applications/cas.ts b/src/resources/access/applications/cas.ts index 878e8dd3dd..d6d9e8a983 100644 --- a/src/resources/access/applications/cas.ts +++ b/src/resources/access/applications/cas.ts @@ -9,29 +9,25 @@ export class Cas extends APIResource { * Generates a new short-lived certificate CA and public key. */ create( - accountOrZone: string, - accountOrZoneId: string, uuid: string, + params: CaCreateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.post( - `/${accountOrZone}/${accountOrZoneId}/access/apps/${uuid}/ca`, - options, - ) as Core.APIPromise<{ result: CaCreateResponse }> + this._client.post(`/${account_id}/${zone_id}/access/apps/${uuid}/ca`, options) as Core.APIPromise<{ + result: CaCreateResponse; + }> )._thenUnwrap((obj) => obj.result); } /** * Lists short-lived certificate CAs and their public keys. */ - list( - accountOrZone: string, - accountOrZoneId: string, - options?: Core.RequestOptions, - ): Core.APIPromise { + list(params: CaListParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.get(`/${accountOrZone}/${accountOrZoneId}/access/apps/ca`, options) as Core.APIPromise<{ + this._client.get(`/${account_id}/${zone_id}/access/apps/ca`, options) as Core.APIPromise<{ result: CaListResponse | null; }> )._thenUnwrap((obj) => obj.result); @@ -41,33 +37,27 @@ export class Cas extends APIResource { * Deletes a short-lived certificate CA. */ delete( - accountOrZone: string, - accountOrZoneId: string, uuid: string, + params: CaDeleteParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.delete( - `/${accountOrZone}/${accountOrZoneId}/access/apps/${uuid}/ca`, - options, - ) as Core.APIPromise<{ result: CaDeleteResponse }> + this._client.delete(`/${account_id}/${zone_id}/access/apps/${uuid}/ca`, options) as Core.APIPromise<{ + result: CaDeleteResponse; + }> )._thenUnwrap((obj) => obj.result); } /** * Fetches a short-lived certificate CA and its public key. */ - get( - accountOrZone: string, - accountOrZoneId: string, - uuid: string, - options?: Core.RequestOptions, - ): Core.APIPromise { + get(uuid: string, params: CaGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.get( - `/${accountOrZone}/${accountOrZoneId}/access/apps/${uuid}/ca`, - options, - ) as Core.APIPromise<{ result: CaGetResponse }> + this._client.get(`/${account_id}/${zone_id}/access/apps/${uuid}/ca`, options) as Core.APIPromise<{ + result: CaGetResponse; + }> )._thenUnwrap((obj) => obj.result); } } @@ -105,9 +95,61 @@ export interface CaDeleteResponse { export type CaGetResponse = unknown | string; +export interface CaCreateParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + +export interface CaListParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + +export interface CaDeleteParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + +export interface CaGetParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + export namespace Cas { export import CaCreateResponse = CasAPI.CaCreateResponse; export import CaListResponse = CasAPI.CaListResponse; export import CaDeleteResponse = CasAPI.CaDeleteResponse; export import CaGetResponse = CasAPI.CaGetResponse; + export import CaCreateParams = CasAPI.CaCreateParams; + export import CaListParams = CasAPI.CaListParams; + export import CaDeleteParams = CasAPI.CaDeleteParams; + export import CaGetParams = CasAPI.CaGetParams; } diff --git a/src/resources/access/applications/index.ts b/src/resources/access/applications/index.ts index 488b7c6a5e..8d15d0b17b 100644 --- a/src/resources/access/applications/index.ts +++ b/src/resources/access/applications/index.ts @@ -9,9 +9,23 @@ export { ApplicationRevokeTokensResponse, ApplicationCreateParams, ApplicationUpdateParams, + ApplicationListParams, + ApplicationDeleteParams, + ApplicationGetParams, + ApplicationRevokeTokensParams, Applications, } from './applications'; -export { CaCreateResponse, CaListResponse, CaDeleteResponse, CaGetResponse, Cas } from './cas'; +export { + CaCreateResponse, + CaListResponse, + CaDeleteResponse, + CaGetResponse, + CaCreateParams, + CaListParams, + CaDeleteParams, + CaGetParams, + Cas, +} from './cas'; export { PolicyCreateResponse, PolicyUpdateResponse, @@ -20,6 +34,13 @@ export { PolicyGetResponse, PolicyCreateParams, PolicyUpdateParams, + PolicyListParams, + PolicyDeleteParams, + PolicyGetParams, Policies, } from './policies'; -export { UserPolicyCheckListResponse, UserPolicyChecks } from './user-policy-checks'; +export { + UserPolicyCheckListResponse, + UserPolicyCheckListParams, + UserPolicyChecks, +} from './user-policy-checks'; diff --git a/src/resources/access/applications/policies.ts b/src/resources/access/applications/policies.ts index 44a3f90deb..378d9fe885 100644 --- a/src/resources/access/applications/policies.ts +++ b/src/resources/access/applications/policies.ts @@ -9,14 +9,13 @@ export class Policies extends APIResource { * Create a new Access policy for an application. */ create( - accountOrZone: string, - accountOrZoneId: string, uuid: string, - body: PolicyCreateParams, + params: PolicyCreateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.post(`/${accountOrZone}/${accountOrZoneId}/access/apps/${uuid}/policies`, { + this._client.post(`/${account_id}/${zone_id}/access/apps/${uuid}/policies`, { body, ...options, }) as Core.APIPromise<{ result: PolicyCreateResponse }> @@ -27,15 +26,14 @@ export class Policies extends APIResource { * Update a configured Access policy. */ update( - accountOrZone: string, - accountOrZoneId: string, uuid1: string, uuid: string, - body: PolicyUpdateParams, + params: PolicyUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/apps/${uuid1}/policies/${uuid}`, { + this._client.put(`/${account_id}/${zone_id}/access/apps/${uuid1}/policies/${uuid}`, { body, ...options, }) as Core.APIPromise<{ result: PolicyUpdateResponse }> @@ -46,16 +44,15 @@ export class Policies extends APIResource { * Lists Access policies configured for an application. */ list( - accountOrZone: string, - accountOrZoneId: string, uuid: string, + params: PolicyListParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.get( - `/${accountOrZone}/${accountOrZoneId}/access/apps/${uuid}/policies`, - options, - ) as Core.APIPromise<{ result: PolicyListResponse | null }> + this._client.get(`/${account_id}/${zone_id}/access/apps/${uuid}/policies`, options) as Core.APIPromise<{ + result: PolicyListResponse | null; + }> )._thenUnwrap((obj) => obj.result); } @@ -63,15 +60,15 @@ export class Policies extends APIResource { * Delete an Access policy. */ delete( - accountOrZone: string, - accountOrZoneId: string, uuid1: string, uuid: string, + params: PolicyDeleteParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( this._client.delete( - `/${accountOrZone}/${accountOrZoneId}/access/apps/${uuid1}/policies/${uuid}`, + `/${account_id}/${zone_id}/access/apps/${uuid1}/policies/${uuid}`, options, ) as Core.APIPromise<{ result: PolicyDeleteResponse }> )._thenUnwrap((obj) => obj.result); @@ -81,15 +78,15 @@ export class Policies extends APIResource { * Fetches a single Access policy. */ get( - accountOrZone: string, - accountOrZoneId: string, uuid1: string, uuid: string, + params: PolicyGetParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( this._client.get( - `/${accountOrZone}/${accountOrZoneId}/access/apps/${uuid1}/policies/${uuid}`, + `/${account_id}/${zone_id}/access/apps/${uuid1}/policies/${uuid}`, options, ) as Core.APIPromise<{ result: PolicyGetResponse }> )._thenUnwrap((obj) => obj.result); @@ -4533,13 +4530,25 @@ export namespace PolicyGetResponse { export interface PolicyCreateParams { /** - * The action Access will take if a user matches this policy. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: The action Access will take if a user matches this policy. */ decision: 'allow' | 'deny' | 'non_identity' | 'bypass'; /** - * Rules evaluated with an OR logical operator. A user needs to meet only one of - * the Include rules. + * Body param: Rules evaluated with an OR logical operator. A user needs to meet + * only one of the Include rules. */ include: Array< | PolicyCreateParams.AccessEmailRule @@ -4564,24 +4573,24 @@ export interface PolicyCreateParams { >; /** - * The name of the Access policy. + * Body param: The name of the Access policy. */ name: string; /** - * Administrators who can approve a temporary authentication request. + * Body param: Administrators who can approve a temporary authentication request. */ approval_groups?: Array; /** - * Requires the user to request access from an administrator at the start of each - * session. + * Body param: Requires the user to request access from an administrator at the + * start of each session. */ approval_required?: boolean; /** - * Rules evaluated with a NOT logical operator. To match the policy, a user cannot - * meet any of the Exclude rules. + * Body param: Rules evaluated with a NOT logical operator. To match the policy, a + * user cannot meet any of the Exclude rules. */ exclude?: Array< | PolicyCreateParams.AccessEmailRule @@ -4606,30 +4615,33 @@ export interface PolicyCreateParams { >; /** - * Require this application to be served in an isolated browser for users matching - * this policy. 'Client Web Isolation' must be on for the account in order to use - * this feature. + * Body param: Require this application to be served in an isolated browser for + * users matching this policy. 'Client Web Isolation' must be on for the account in + * order to use this feature. */ isolation_required?: boolean; /** - * The order of execution for this policy. Must be unique for each policy. + * Body param: The order of execution for this policy. Must be unique for each + * policy. */ precedence?: number; /** - * A custom message that will appear on the purpose justification screen. + * Body param: A custom message that will appear on the purpose justification + * screen. */ purpose_justification_prompt?: string; /** - * Require users to enter a justification when they log in to the application. + * Body param: Require users to enter a justification when they log in to the + * application. */ purpose_justification_required?: boolean; /** - * Rules evaluated with an AND logical operator. To match the policy, a user must - * meet all of the Require rules. + * Body param: Rules evaluated with an AND logical operator. To match the policy, a + * user must meet all of the Require rules. */ require?: Array< | PolicyCreateParams.AccessEmailRule @@ -4654,9 +4666,9 @@ export interface PolicyCreateParams { >; /** - * The amount of time that tokens issued for the application will be valid. Must be - * in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, - * m, h. + * Body param: The amount of time that tokens issued for the application will be + * valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us + * (or µs), ms, s, m, h. */ session_duration?: string; } @@ -5630,13 +5642,25 @@ export namespace PolicyCreateParams { export interface PolicyUpdateParams { /** - * The action Access will take if a user matches this policy. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: The action Access will take if a user matches this policy. */ decision: 'allow' | 'deny' | 'non_identity' | 'bypass'; /** - * Rules evaluated with an OR logical operator. A user needs to meet only one of - * the Include rules. + * Body param: Rules evaluated with an OR logical operator. A user needs to meet + * only one of the Include rules. */ include: Array< | PolicyUpdateParams.AccessEmailRule @@ -5661,24 +5685,24 @@ export interface PolicyUpdateParams { >; /** - * The name of the Access policy. + * Body param: The name of the Access policy. */ name: string; /** - * Administrators who can approve a temporary authentication request. + * Body param: Administrators who can approve a temporary authentication request. */ approval_groups?: Array; /** - * Requires the user to request access from an administrator at the start of each - * session. + * Body param: Requires the user to request access from an administrator at the + * start of each session. */ approval_required?: boolean; /** - * Rules evaluated with a NOT logical operator. To match the policy, a user cannot - * meet any of the Exclude rules. + * Body param: Rules evaluated with a NOT logical operator. To match the policy, a + * user cannot meet any of the Exclude rules. */ exclude?: Array< | PolicyUpdateParams.AccessEmailRule @@ -5703,30 +5727,33 @@ export interface PolicyUpdateParams { >; /** - * Require this application to be served in an isolated browser for users matching - * this policy. 'Client Web Isolation' must be on for the account in order to use - * this feature. + * Body param: Require this application to be served in an isolated browser for + * users matching this policy. 'Client Web Isolation' must be on for the account in + * order to use this feature. */ isolation_required?: boolean; /** - * The order of execution for this policy. Must be unique for each policy. + * Body param: The order of execution for this policy. Must be unique for each + * policy. */ precedence?: number; /** - * A custom message that will appear on the purpose justification screen. + * Body param: A custom message that will appear on the purpose justification + * screen. */ purpose_justification_prompt?: string; /** - * Require users to enter a justification when they log in to the application. + * Body param: Require users to enter a justification when they log in to the + * application. */ purpose_justification_required?: boolean; /** - * Rules evaluated with an AND logical operator. To match the policy, a user must - * meet all of the Require rules. + * Body param: Rules evaluated with an AND logical operator. To match the policy, a + * user must meet all of the Require rules. */ require?: Array< | PolicyUpdateParams.AccessEmailRule @@ -5751,9 +5778,9 @@ export interface PolicyUpdateParams { >; /** - * The amount of time that tokens issued for the application will be valid. Must be - * in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, - * m, h. + * Body param: The amount of time that tokens issued for the application will be + * valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us + * (or µs), ms, s, m, h. */ session_duration?: string; } @@ -6725,6 +6752,42 @@ export namespace PolicyUpdateParams { } } +export interface PolicyListParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + +export interface PolicyDeleteParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + +export interface PolicyGetParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + export namespace Policies { export import PolicyCreateResponse = PoliciesAPI.PolicyCreateResponse; export import PolicyUpdateResponse = PoliciesAPI.PolicyUpdateResponse; @@ -6733,4 +6796,7 @@ export namespace Policies { export import PolicyGetResponse = PoliciesAPI.PolicyGetResponse; export import PolicyCreateParams = PoliciesAPI.PolicyCreateParams; export import PolicyUpdateParams = PoliciesAPI.PolicyUpdateParams; + export import PolicyListParams = PoliciesAPI.PolicyListParams; + export import PolicyDeleteParams = PoliciesAPI.PolicyDeleteParams; + export import PolicyGetParams = PoliciesAPI.PolicyGetParams; } diff --git a/src/resources/access/applications/user-policy-checks.ts b/src/resources/access/applications/user-policy-checks.ts index 4fe5267534..2408fb34ac 100644 --- a/src/resources/access/applications/user-policy-checks.ts +++ b/src/resources/access/applications/user-policy-checks.ts @@ -9,14 +9,14 @@ export class UserPolicyChecks extends APIResource { * Tests if a specific user has permission to access an application. */ list( - accountOrZone: string, - accountOrZoneId: string, appId: string | string, + params: UserPolicyCheckListParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( this._client.get( - `/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}/user_policy_checks`, + `/${account_id}/${zone_id}/access/apps/${appId}/user_policy_checks`, options, ) as Core.APIPromise<{ result: UserPolicyCheckListResponse }> )._thenUnwrap((obj) => obj.result); @@ -81,6 +81,19 @@ export namespace UserPolicyCheckListResponse { } } +export interface UserPolicyCheckListParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + export namespace UserPolicyChecks { export import UserPolicyCheckListResponse = UserPolicyChecksAPI.UserPolicyCheckListResponse; + export import UserPolicyCheckListParams = UserPolicyChecksAPI.UserPolicyCheckListParams; } diff --git a/src/resources/access/certificates/certificates.ts b/src/resources/access/certificates/certificates.ts index 908adf479b..6c4cbc97f1 100644 --- a/src/resources/access/certificates/certificates.ts +++ b/src/resources/access/certificates/certificates.ts @@ -12,13 +12,12 @@ export class Certificates extends APIResource { * Adds a new mTLS root certificate to Access. */ create( - accountOrZone: string, - accountOrZoneId: string, - body: CertificateCreateParams, + params: CertificateCreateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.post(`/${accountOrZone}/${accountOrZoneId}/access/certificates`, { + this._client.post(`/${account_id}/${zone_id}/access/certificates`, { body, ...options, }) as Core.APIPromise<{ result: CertificateCreateResponse }> @@ -29,14 +28,13 @@ export class Certificates extends APIResource { * Updates a configured mTLS certificate. */ update( - accountOrZone: string, - accountOrZoneId: string, uuid: string, - body: CertificateUpdateParams, + params: CertificateUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/certificates/${uuid}`, { + this._client.put(`/${account_id}/${zone_id}/access/certificates/${uuid}`, { body, ...options, }) as Core.APIPromise<{ result: CertificateUpdateResponse }> @@ -47,15 +45,14 @@ export class Certificates extends APIResource { * Lists all mTLS root certificates. */ list( - accountOrZone: string, - accountOrZoneId: string, + params: CertificateListParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.get( - `/${accountOrZone}/${accountOrZoneId}/access/certificates`, - options, - ) as Core.APIPromise<{ result: CertificateListResponse | null }> + this._client.get(`/${account_id}/${zone_id}/access/certificates`, options) as Core.APIPromise<{ + result: CertificateListResponse | null; + }> )._thenUnwrap((obj) => obj.result); } @@ -63,14 +60,14 @@ export class Certificates extends APIResource { * Deletes an mTLS certificate. */ delete( - accountOrZone: string, - accountOrZoneId: string, uuid: string, + params: CertificateDeleteParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( this._client.delete( - `/${accountOrZone}/${accountOrZoneId}/access/certificates/${uuid}`, + `/${account_id}/${zone_id}/access/certificates/${uuid}`, options, ) as Core.APIPromise<{ result: CertificateDeleteResponse }> )._thenUnwrap((obj) => obj.result); @@ -80,16 +77,15 @@ export class Certificates extends APIResource { * Fetches a single mTLS certificate. */ get( - accountOrZone: string, - accountOrZoneId: string, uuid: string, + params: CertificateGetParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.get( - `/${accountOrZone}/${accountOrZoneId}/access/certificates/${uuid}`, - options, - ) as Core.APIPromise<{ result: CertificateGetResponse }> + this._client.get(`/${account_id}/${zone_id}/access/certificates/${uuid}`, options) as Core.APIPromise<{ + result: CertificateGetResponse; + }> )._thenUnwrap((obj) => obj.result); } } @@ -219,33 +215,93 @@ export interface CertificateGetResponse { export interface CertificateCreateParams { /** - * The certificate content. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: The certificate content. */ certificate: string; /** - * The name of the certificate. + * Body param: The name of the certificate. */ name: string; /** - * The hostnames of the applications that will use this certificate. + * Body param: The hostnames of the applications that will use this certificate. */ associated_hostnames?: Array; } export interface CertificateUpdateParams { /** - * The hostnames of the applications that will use this certificate. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: The hostnames of the applications that will use this certificate. */ associated_hostnames: Array; /** - * The name of the certificate. + * Body param: The name of the certificate. */ name?: string; } +export interface CertificateListParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + +export interface CertificateDeleteParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + +export interface CertificateGetParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + export namespace Certificates { export import CertificateCreateResponse = CertificatesAPI.CertificateCreateResponse; export import CertificateUpdateResponse = CertificatesAPI.CertificateUpdateResponse; @@ -254,8 +310,12 @@ export namespace Certificates { export import CertificateGetResponse = CertificatesAPI.CertificateGetResponse; export import CertificateCreateParams = CertificatesAPI.CertificateCreateParams; export import CertificateUpdateParams = CertificatesAPI.CertificateUpdateParams; + export import CertificateListParams = CertificatesAPI.CertificateListParams; + export import CertificateDeleteParams = CertificatesAPI.CertificateDeleteParams; + export import CertificateGetParams = CertificatesAPI.CertificateGetParams; export import Settings = SettingsAPI.Settings; export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse; export import SettingListResponse = SettingsAPI.SettingListResponse; export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; + export import SettingListParams = SettingsAPI.SettingListParams; } diff --git a/src/resources/access/certificates/index.ts b/src/resources/access/certificates/index.ts index e381ae5ffe..22402c55c6 100644 --- a/src/resources/access/certificates/index.ts +++ b/src/resources/access/certificates/index.ts @@ -8,6 +8,15 @@ export { CertificateGetResponse, CertificateCreateParams, CertificateUpdateParams, + CertificateListParams, + CertificateDeleteParams, + CertificateGetParams, Certificates, } from './certificates'; -export { SettingUpdateResponse, SettingListResponse, SettingUpdateParams, Settings } from './settings'; +export { + SettingUpdateResponse, + SettingListResponse, + SettingUpdateParams, + SettingListParams, + Settings, +} from './settings'; diff --git a/src/resources/access/certificates/settings.ts b/src/resources/access/certificates/settings.ts index 6c95df02c1..227f11a42e 100644 --- a/src/resources/access/certificates/settings.ts +++ b/src/resources/access/certificates/settings.ts @@ -9,13 +9,12 @@ export class Settings extends APIResource { * Updates an mTLS certificate's hostname settings. */ update( - accountOrZone: string, - accountOrZoneId: string, - body: SettingUpdateParams, + params: SettingUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/certificates/settings`, { + this._client.put(`/${account_id}/${zone_id}/access/certificates/settings`, { body, ...options, }) as Core.APIPromise<{ result: SettingUpdateResponse | null }> @@ -26,15 +25,14 @@ export class Settings extends APIResource { * List all mTLS hostname settings for this account or zone. */ list( - accountOrZone: string, - accountOrZoneId: string, + params: SettingListParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.get( - `/${accountOrZone}/${accountOrZoneId}/access/certificates/settings`, - options, - ) as Core.APIPromise<{ result: SettingListResponse | null }> + this._client.get(`/${account_id}/${zone_id}/access/certificates/settings`, options) as Core.APIPromise<{ + result: SettingListResponse | null; + }> )._thenUnwrap((obj) => obj.result); } } @@ -88,6 +86,21 @@ export namespace SettingListResponse { } export interface SettingUpdateParams { + /** + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: + */ settings: Array; } @@ -113,8 +126,21 @@ export namespace SettingUpdateParams { } } +export interface SettingListParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + export namespace Settings { export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse; export import SettingListResponse = SettingsAPI.SettingListResponse; export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; + export import SettingListParams = SettingsAPI.SettingListParams; } diff --git a/src/resources/access/groups.ts b/src/resources/access/groups.ts index b7baa957a4..c585a5f153 100644 --- a/src/resources/access/groups.ts +++ b/src/resources/access/groups.ts @@ -8,17 +8,12 @@ export class Groups extends APIResource { /** * Creates a new Access group. */ - create( - accountOrZone: string, - accountOrZoneId: string, - body: GroupCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + create(params: GroupCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.post(`/${accountOrZone}/${accountOrZoneId}/access/groups`, { - body, - ...options, - }) as Core.APIPromise<{ result: GroupCreateResponse }> + this._client.post(`/${account_id}/${zone_id}/access/groups`, { body, ...options }) as Core.APIPromise<{ + result: GroupCreateResponse; + }> )._thenUnwrap((obj) => obj.result); } @@ -26,14 +21,13 @@ export class Groups extends APIResource { * Updates a configured Access group. */ update( - accountOrZone: string, - accountOrZoneId: string, uuid: string, - body: GroupUpdateParams, + params: GroupUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/groups/${uuid}`, { + this._client.put(`/${account_id}/${zone_id}/access/groups/${uuid}`, { body, ...options, }) as Core.APIPromise<{ result: GroupUpdateResponse }> @@ -43,13 +37,10 @@ export class Groups extends APIResource { /** * Lists all Access groups. */ - list( - accountOrZone: string, - accountOrZoneId: string, - options?: Core.RequestOptions, - ): Core.APIPromise { + list(params: GroupListParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.get(`/${accountOrZone}/${accountOrZoneId}/access/groups`, options) as Core.APIPromise<{ + this._client.get(`/${account_id}/${zone_id}/access/groups`, options) as Core.APIPromise<{ result: GroupListResponse | null; }> )._thenUnwrap((obj) => obj.result); @@ -59,16 +50,15 @@ export class Groups extends APIResource { * Deletes an Access group. */ delete( - accountOrZone: string, - accountOrZoneId: string, uuid: string, + params: GroupDeleteParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.delete( - `/${accountOrZone}/${accountOrZoneId}/access/groups/${uuid}`, - options, - ) as Core.APIPromise<{ result: GroupDeleteResponse }> + this._client.delete(`/${account_id}/${zone_id}/access/groups/${uuid}`, options) as Core.APIPromise<{ + result: GroupDeleteResponse; + }> )._thenUnwrap((obj) => obj.result); } @@ -76,16 +66,15 @@ export class Groups extends APIResource { * Fetches a single Access group. */ get( - accountOrZone: string, - accountOrZoneId: string, uuid: string, + params: GroupGetParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.get( - `/${accountOrZone}/${accountOrZoneId}/access/groups/${uuid}`, - options, - ) as Core.APIPromise<{ result: GroupGetResponse }> + this._client.get(`/${account_id}/${zone_id}/access/groups/${uuid}`, options) as Core.APIPromise<{ + result: GroupGetResponse; + }> )._thenUnwrap((obj) => obj.result); } } @@ -5631,8 +5620,20 @@ export namespace GroupGetResponse { export interface GroupCreateParams { /** - * Rules evaluated with an OR logical operator. A user needs to meet only one of - * the Include rules. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: Rules evaluated with an OR logical operator. A user needs to meet + * only one of the Include rules. */ include: Array< | GroupCreateParams.AccessEmailRule @@ -5657,13 +5658,13 @@ export interface GroupCreateParams { >; /** - * The name of the Access group. + * Body param: The name of the Access group. */ name: string; /** - * Rules evaluated with a NOT logical operator. To match a policy, a user cannot - * meet any of the Exclude rules. + * Body param: Rules evaluated with a NOT logical operator. To match a policy, a + * user cannot meet any of the Exclude rules. */ exclude?: Array< | GroupCreateParams.AccessEmailRule @@ -5688,13 +5689,13 @@ export interface GroupCreateParams { >; /** - * Whether this is the default group + * Body param: Whether this is the default group */ is_default?: boolean; /** - * Rules evaluated with an AND logical operator. To match a policy, a user must - * meet all of the Require rules. + * Body param: Rules evaluated with an AND logical operator. To match a policy, a + * user must meet all of the Require rules. */ require?: Array< | GroupCreateParams.AccessEmailRule @@ -6668,8 +6669,20 @@ export namespace GroupCreateParams { export interface GroupUpdateParams { /** - * Rules evaluated with an OR logical operator. A user needs to meet only one of - * the Include rules. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: Rules evaluated with an OR logical operator. A user needs to meet + * only one of the Include rules. */ include: Array< | GroupUpdateParams.AccessEmailRule @@ -6694,13 +6707,13 @@ export interface GroupUpdateParams { >; /** - * The name of the Access group. + * Body param: The name of the Access group. */ name: string; /** - * Rules evaluated with a NOT logical operator. To match a policy, a user cannot - * meet any of the Exclude rules. + * Body param: Rules evaluated with a NOT logical operator. To match a policy, a + * user cannot meet any of the Exclude rules. */ exclude?: Array< | GroupUpdateParams.AccessEmailRule @@ -6725,13 +6738,13 @@ export interface GroupUpdateParams { >; /** - * Whether this is the default group + * Body param: Whether this is the default group */ is_default?: boolean; /** - * Rules evaluated with an AND logical operator. To match a policy, a user must - * meet all of the Require rules. + * Body param: Rules evaluated with an AND logical operator. To match a policy, a + * user must meet all of the Require rules. */ require?: Array< | GroupUpdateParams.AccessEmailRule @@ -7703,6 +7716,42 @@ export namespace GroupUpdateParams { } } +export interface GroupListParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + +export interface GroupDeleteParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + +export interface GroupGetParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + export namespace Groups { export import GroupCreateResponse = GroupsAPI.GroupCreateResponse; export import GroupUpdateResponse = GroupsAPI.GroupUpdateResponse; @@ -7711,4 +7760,7 @@ export namespace Groups { export import GroupGetResponse = GroupsAPI.GroupGetResponse; export import GroupCreateParams = GroupsAPI.GroupCreateParams; export import GroupUpdateParams = GroupsAPI.GroupUpdateParams; + export import GroupListParams = GroupsAPI.GroupListParams; + export import GroupDeleteParams = GroupsAPI.GroupDeleteParams; + export import GroupGetParams = GroupsAPI.GroupGetParams; } diff --git a/src/resources/access/identity-providers.ts b/src/resources/access/identity-providers.ts index 8911137e80..a961760346 100644 --- a/src/resources/access/identity-providers.ts +++ b/src/resources/access/identity-providers.ts @@ -9,13 +9,12 @@ export class IdentityProviders extends APIResource { * Adds a new identity provider to Access. */ create( - accountOrZone: string, - accountOrZoneId: string, - body: IdentityProviderCreateParams, + params: IdentityProviderCreateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.post(`/${accountOrZone}/${accountOrZoneId}/access/identity_providers`, { + this._client.post(`/${account_id}/${zone_id}/access/identity_providers`, { body, ...options, }) as Core.APIPromise<{ result: IdentityProviderCreateResponse }> @@ -26,14 +25,13 @@ export class IdentityProviders extends APIResource { * Updates a configured identity provider. */ update( - accountOrZone: string, - accountOrZoneId: string, uuid: string, - body: IdentityProviderUpdateParams, + params: IdentityProviderUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/identity_providers/${uuid}`, { + this._client.put(`/${account_id}/${zone_id}/access/identity_providers/${uuid}`, { body, ...options, }) as Core.APIPromise<{ result: IdentityProviderUpdateResponse }> @@ -44,15 +42,14 @@ export class IdentityProviders extends APIResource { * Lists all configured identity providers. */ list( - accountOrZone: string, - accountOrZoneId: string, + params: IdentityProviderListParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.get( - `/${accountOrZone}/${accountOrZoneId}/access/identity_providers`, - options, - ) as Core.APIPromise<{ result: IdentityProviderListResponse | null }> + this._client.get(`/${account_id}/${zone_id}/access/identity_providers`, options) as Core.APIPromise<{ + result: IdentityProviderListResponse | null; + }> )._thenUnwrap((obj) => obj.result); } @@ -60,14 +57,14 @@ export class IdentityProviders extends APIResource { * Deletes an identity provider from Access. */ delete( - accountOrZone: string, - accountOrZoneId: string, uuid: string, + params: IdentityProviderDeleteParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( this._client.delete( - `/${accountOrZone}/${accountOrZoneId}/access/identity_providers/${uuid}`, + `/${account_id}/${zone_id}/access/identity_providers/${uuid}`, options, ) as Core.APIPromise<{ result: IdentityProviderDeleteResponse }> )._thenUnwrap((obj) => obj.result); @@ -77,14 +74,14 @@ export class IdentityProviders extends APIResource { * Fetches a configured identity provider. */ get( - accountOrZone: string, - accountOrZoneId: string, uuid: string, + params: IdentityProviderGetParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( this._client.get( - `/${accountOrZone}/${accountOrZoneId}/access/identity_providers/${uuid}`, + `/${account_id}/${zone_id}/access/identity_providers/${uuid}`, options, ) as Core.APIPromise<{ result: IdentityProviderGetResponse }> )._thenUnwrap((obj) => obj.result); @@ -6552,3134 +6549,500 @@ export namespace IdentityProviderGetResponse { } } -export type IdentityProviderCreateParams = - | IdentityProviderCreateParams.AccessAzureAd - | IdentityProviderCreateParams.AccessCentrify - | IdentityProviderCreateParams.AccessFacebook - | IdentityProviderCreateParams.AccessGitHub - | IdentityProviderCreateParams.AccessGoogle - | IdentityProviderCreateParams.AccessGoogleApps - | IdentityProviderCreateParams.AccessLinkedin - | IdentityProviderCreateParams.AccessOidc - | IdentityProviderCreateParams.AccessOkta - | IdentityProviderCreateParams.AccessOnelogin - | IdentityProviderCreateParams.AccessPingone - | IdentityProviderCreateParams.AccessSaml - | IdentityProviderCreateParams.AccessYandex - | IdentityProviderCreateParams.AccessOnetimepin; +export interface IdentityProviderCreateParams { + /** + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: + */ + config: IdentityProviderCreateParams.Config; + + /** + * Body param: The name of the identity provider, shown to users on the login page. + */ + name: string; + + /** + * Body param: The type of identity provider. To determine the value for a specific + * provider, refer to our + * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + */ + type: + | 'onetimepin' + | 'azureAD' + | 'saml' + | 'centrify' + | 'facebook' + | 'github' + | 'google-apps' + | 'google' + | 'linkedin' + | 'oidc' + | 'okta' + | 'onelogin' + | 'pingone' + | 'yandex'; + + /** + * Body param: + */ + scim_config?: IdentityProviderCreateParams.ScimConfig; +} export namespace IdentityProviderCreateParams { - export interface AccessAzureAd { + export interface Config { /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + * Your companies TLD */ - config: IdentityProviderCreateParams.AccessAzureAd.Config; + apps_domain?: string; /** - * The name of the identity provider, shown to users on the login page. + * A list of SAML attribute names that will be added to your signed JWT token and + * can be used in SAML policy rules. */ - name: string; + attributes?: Array; /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + * The authorization_endpoint URL of your IdP */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; + auth_url?: string; /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. + * Your okta authorization server id */ - scim_config?: IdentityProviderCreateParams.AccessAzureAd.ScimConfig; - } + authorization_server_id?: string; - export namespace AccessAzureAd { /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + * Your centrify account url */ - export interface Config { - /** - * Custom claims - */ - claims?: Array; - - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - - /** - * Should Cloudflare try to load authentication contexts from your account - */ - conditional_access_enabled?: boolean; - - /** - * Your Azure directory uuid - */ - directory_id?: string; + centrify_account?: string; - /** - * The claim name for email in the id_token response. - */ - email_claim_name?: string; + /** + * Your centrify app id + */ + centrify_app_id?: string; - /** - * Should Cloudflare try to load groups from your account - */ - support_groups?: boolean; - } + /** + * The jwks_uri endpoint of your IdP to allow the IdP keys to sign the tokens + */ + certs_url?: string; /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. + * Custom claims */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; + claims?: Array; - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; + /** + * Your OAuth Client ID + */ + client_id?: string; - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; + /** + * Your OAuth Client Secret + */ + client_secret?: string; - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; + /** + * Should Cloudflare try to load authentication contexts from your account + */ + conditional_access_enabled?: boolean; - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } + /** + * Your Azure directory uuid + */ + directory_id?: string; - export interface AccessCentrify { /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + * The attribute name for email in the SAML response. */ - config: IdentityProviderCreateParams.AccessCentrify.Config; + email_attribute_name?: string; /** - * The name of the identity provider, shown to users on the login page. + * The claim name for email in the id_token response. */ - name: string; + email_claim_name?: string; /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + * Add a list of attribute names that will be returned in the response header from + * the Access callback. */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; + header_attributes?: Array; /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. + * X509 certificate to verify the signature in the SAML authentication response */ - scim_config?: IdentityProviderCreateParams.AccessCentrify.ScimConfig; - } + idp_public_certs?: Array; - export namespace AccessCentrify { /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + * IdP Entity ID or Issuer URL */ - export interface Config { - /** - * Your centrify account url - */ - centrify_account?: string; + issuer_url?: string; - /** - * Your centrify app id - */ - centrify_app_id?: string; + /** + * Your okta account url + */ + okta_account?: string; - /** - * Custom claims - */ - claims?: Array; + /** + * Your OneLogin account url + */ + onelogin_account?: string; - /** - * Your OAuth Client ID - */ - client_id?: string; + /** + * Your PingOne environment identifier + */ + ping_env_id?: string; - /** - * Your OAuth Client Secret - */ - client_secret?: string; + /** + * OAuth scopes + */ + scopes?: Array; - /** - * The claim name for email in the id_token response. - */ - email_claim_name?: string; - } + /** + * Sign the SAML authentication request with Access credentials. To verify the + * signature, use the public key from the Access certs endpoints. + */ + sign_request?: boolean; /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. + * URL to send the SAML authentication requests to */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; + sso_target_url?: string; - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; + /** + * Should Cloudflare try to load groups from your account + */ + support_groups?: boolean; - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; + /** + * The token_endpoint URL of your IdP + */ + token_url?: string; + } + export namespace Config { + export interface HeaderAttribute { /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + * attribute name from the IDP */ - secret?: string; + attribute_name?: string; /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. + * header that will be added on the request to the origin */ - user_deprovision?: boolean; + header_name?: string; } } - export interface AccessFacebook { + export interface ScimConfig { /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + * A flag to enable or disable SCIM for the identity provider. */ - config: IdentityProviderCreateParams.AccessFacebook.Config; + enabled?: boolean; /** - * The name of the identity provider, shown to users on the login page. + * A flag to revoke a user's session in Access and force a reauthentication on the + * user's Gateway session when they have been added or removed from a group in the + * Identity Provider. */ - name: string; + group_member_deprovision?: boolean; /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + * A flag to remove a user's seat in Zero Trust when they have been deprovisioned + * in the Identity Provider. This cannot be enabled unless user_deprovision is also + * enabled. */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; + seat_deprovision?: boolean; /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. + * A read-only token generated when the SCIM integration is enabled for the first + * time. It is redacted on subsequent requests. If you lose this you will need to + * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. */ - scim_config?: IdentityProviderCreateParams.AccessFacebook.ScimConfig; - } + secret?: string; - export namespace AccessFacebook { /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + * A flag to enable revoking a user's session in Access and Gateway when they have + * been deprovisioned in the Identity Provider. */ - export interface Config { - /** - * Your OAuth Client ID - */ - client_id?: string; + user_deprovision?: boolean; + } +} - /** - * Your OAuth Client Secret - */ - client_secret?: string; - } +export interface IdentityProviderUpdateParams { + /** + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; + /** + * Body param: + */ + config: IdentityProviderUpdateParams.Config; - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; + /** + * Body param: The name of the identity provider, shown to users on the login page. + */ + name: string; - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; + /** + * Body param: The type of identity provider. To determine the value for a specific + * provider, refer to our + * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + */ + type: + | 'onetimepin' + | 'azureAD' + | 'saml' + | 'centrify' + | 'facebook' + | 'github' + | 'google-apps' + | 'google' + | 'linkedin' + | 'oidc' + | 'okta' + | 'onelogin' + | 'pingone' + | 'yandex'; - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } + /** + * Body param: + */ + scim_config?: IdentityProviderUpdateParams.ScimConfig; +} - export interface AccessGitHub { +export namespace IdentityProviderUpdateParams { + export interface Config { /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + * Your companies TLD */ - config: IdentityProviderCreateParams.AccessGitHub.Config; + apps_domain?: string; /** - * The name of the identity provider, shown to users on the login page. + * A list of SAML attribute names that will be added to your signed JWT token and + * can be used in SAML policy rules. */ - name: string; + attributes?: Array; /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + * The authorization_endpoint URL of your IdP */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; + auth_url?: string; /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. + * Your okta authorization server id */ - scim_config?: IdentityProviderCreateParams.AccessGitHub.ScimConfig; - } + authorization_server_id?: string; - export namespace AccessGitHub { /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + * Your centrify account url */ - export interface Config { - /** - * Your OAuth Client ID - */ - client_id?: string; + centrify_account?: string; - /** - * Your OAuth Client Secret - */ - client_secret?: string; - } + /** + * Your centrify app id + */ + centrify_app_id?: string; /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. + * The jwks_uri endpoint of your IdP to allow the IdP keys to sign the tokens */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; + certs_url?: string; - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; + /** + * Custom claims + */ + claims?: Array; - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; + /** + * Your OAuth Client ID + */ + client_id?: string; - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; + /** + * Your OAuth Client Secret + */ + client_secret?: string; - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } + /** + * Should Cloudflare try to load authentication contexts from your account + */ + conditional_access_enabled?: boolean; - export interface AccessGoogle { /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + * Your Azure directory uuid */ - config: IdentityProviderCreateParams.AccessGoogle.Config; + directory_id?: string; /** - * The name of the identity provider, shown to users on the login page. + * The attribute name for email in the SAML response. */ - name: string; + email_attribute_name?: string; /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + * The claim name for email in the id_token response. */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; + email_claim_name?: string; /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. + * Add a list of attribute names that will be returned in the response header from + * the Access callback. */ - scim_config?: IdentityProviderCreateParams.AccessGoogle.ScimConfig; - } + header_attributes?: Array; - export namespace AccessGoogle { /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + * X509 certificate to verify the signature in the SAML authentication response */ - export interface Config { - /** - * Custom claims - */ - claims?: Array; + idp_public_certs?: Array; - /** - * Your OAuth Client ID - */ - client_id?: string; + /** + * IdP Entity ID or Issuer URL + */ + issuer_url?: string; - /** - * Your OAuth Client Secret - */ - client_secret?: string; + /** + * Your okta account url + */ + okta_account?: string; - /** - * The claim name for email in the id_token response. - */ - email_claim_name?: string; - } + /** + * Your OneLogin account url + */ + onelogin_account?: string; /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. + * Your PingOne environment identifier */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; + ping_env_id?: string; - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; + /** + * OAuth scopes + */ + scopes?: Array; - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; + /** + * Sign the SAML authentication request with Access credentials. To verify the + * signature, use the public key from the Access certs endpoints. + */ + sign_request?: boolean; + + /** + * URL to send the SAML authentication requests to + */ + sso_target_url?: string; + + /** + * Should Cloudflare try to load groups from your account + */ + support_groups?: boolean; + + /** + * The token_endpoint URL of your IdP + */ + token_url?: string; + } + export namespace Config { + export interface HeaderAttribute { /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + * attribute name from the IDP */ - secret?: string; + attribute_name?: string; /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. + * header that will be added on the request to the origin */ - user_deprovision?: boolean; + header_name?: string; } } - export interface AccessGoogleApps { + export interface ScimConfig { /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + * A flag to enable or disable SCIM for the identity provider. */ - config: IdentityProviderCreateParams.AccessGoogleApps.Config; + enabled?: boolean; /** - * The name of the identity provider, shown to users on the login page. + * A flag to revoke a user's session in Access and force a reauthentication on the + * user's Gateway session when they have been added or removed from a group in the + * Identity Provider. */ - name: string; + group_member_deprovision?: boolean; /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + * A flag to remove a user's seat in Zero Trust when they have been deprovisioned + * in the Identity Provider. This cannot be enabled unless user_deprovision is also + * enabled. */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderCreateParams.AccessGoogleApps.ScimConfig; - } - - export namespace AccessGoogleApps { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * Your companies TLD - */ - apps_domain?: string; - - /** - * Custom claims - */ - claims?: Array; - - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - - /** - * The claim name for email in the id_token response. - */ - email_claim_name?: string; - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessLinkedin { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderCreateParams.AccessLinkedin.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderCreateParams.AccessLinkedin.ScimConfig; - } - - export namespace AccessLinkedin { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessOidc { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderCreateParams.AccessOidc.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderCreateParams.AccessOidc.ScimConfig; - } - - export namespace AccessOidc { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * The authorization_endpoint URL of your IdP - */ - auth_url?: string; - - /** - * The jwks_uri endpoint of your IdP to allow the IdP keys to sign the tokens - */ - certs_url?: string; - - /** - * Custom claims - */ - claims?: Array; - - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - - /** - * The claim name for email in the id_token response. - */ - email_claim_name?: string; - - /** - * OAuth scopes - */ - scopes?: Array; - - /** - * The token_endpoint URL of your IdP - */ - token_url?: string; - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessOkta { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderCreateParams.AccessOkta.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderCreateParams.AccessOkta.ScimConfig; - } - - export namespace AccessOkta { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * Your okta authorization server id - */ - authorization_server_id?: string; - - /** - * Custom claims - */ - claims?: Array; - - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - - /** - * The claim name for email in the id_token response. - */ - email_claim_name?: string; - - /** - * Your okta account url - */ - okta_account?: string; - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessOnelogin { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderCreateParams.AccessOnelogin.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderCreateParams.AccessOnelogin.ScimConfig; - } - - export namespace AccessOnelogin { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * Custom claims - */ - claims?: Array; - - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - - /** - * The claim name for email in the id_token response. - */ - email_claim_name?: string; - - /** - * Your OneLogin account url - */ - onelogin_account?: string; - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessPingone { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderCreateParams.AccessPingone.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderCreateParams.AccessPingone.ScimConfig; - } - - export namespace AccessPingone { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * Custom claims - */ - claims?: Array; - - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - - /** - * The claim name for email in the id_token response. - */ - email_claim_name?: string; - - /** - * Your PingOne environment identifier - */ - ping_env_id?: string; - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessSaml { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderCreateParams.AccessSaml.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderCreateParams.AccessSaml.ScimConfig; - } - - export namespace AccessSaml { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * A list of SAML attribute names that will be added to your signed JWT token and - * can be used in SAML policy rules. - */ - attributes?: Array; - - /** - * The attribute name for email in the SAML response. - */ - email_attribute_name?: string; - - /** - * Add a list of attribute names that will be returned in the response header from - * the Access callback. - */ - header_attributes?: Array; - - /** - * X509 certificate to verify the signature in the SAML authentication response - */ - idp_public_certs?: Array; - - /** - * IdP Entity ID or Issuer URL - */ - issuer_url?: string; - - /** - * Sign the SAML authentication request with Access credentials. To verify the - * signature, use the public key from the Access certs endpoints. - */ - sign_request?: boolean; - - /** - * URL to send the SAML authentication requests to - */ - sso_target_url?: string; - } - - export namespace Config { - export interface HeaderAttribute { - /** - * attribute name from the IDP - */ - attribute_name?: string; - - /** - * header that will be added on the request to the origin - */ - header_name?: string; - } - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessYandex { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderCreateParams.AccessYandex.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderCreateParams.AccessYandex.ScimConfig; - } - - export namespace AccessYandex { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessOnetimepin { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: unknown; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderCreateParams.AccessOnetimepin.ScimConfig; - } - - export namespace AccessOnetimepin { - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } -} - -export type IdentityProviderUpdateParams = - | IdentityProviderUpdateParams.AccessAzureAd - | IdentityProviderUpdateParams.AccessCentrify - | IdentityProviderUpdateParams.AccessFacebook - | IdentityProviderUpdateParams.AccessGitHub - | IdentityProviderUpdateParams.AccessGoogle - | IdentityProviderUpdateParams.AccessGoogleApps - | IdentityProviderUpdateParams.AccessLinkedin - | IdentityProviderUpdateParams.AccessOidc - | IdentityProviderUpdateParams.AccessOkta - | IdentityProviderUpdateParams.AccessOnelogin - | IdentityProviderUpdateParams.AccessPingone - | IdentityProviderUpdateParams.AccessSaml - | IdentityProviderUpdateParams.AccessYandex - | IdentityProviderUpdateParams.AccessOnetimepin; - -export namespace IdentityProviderUpdateParams { - export interface AccessAzureAd { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderUpdateParams.AccessAzureAd.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderUpdateParams.AccessAzureAd.ScimConfig; - } - - export namespace AccessAzureAd { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * Custom claims - */ - claims?: Array; - - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - - /** - * Should Cloudflare try to load authentication contexts from your account - */ - conditional_access_enabled?: boolean; - - /** - * Your Azure directory uuid - */ - directory_id?: string; - - /** - * The claim name for email in the id_token response. - */ - email_claim_name?: string; - - /** - * Should Cloudflare try to load groups from your account - */ - support_groups?: boolean; - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessCentrify { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderUpdateParams.AccessCentrify.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderUpdateParams.AccessCentrify.ScimConfig; - } - - export namespace AccessCentrify { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * Your centrify account url - */ - centrify_account?: string; - - /** - * Your centrify app id - */ - centrify_app_id?: string; - - /** - * Custom claims - */ - claims?: Array; - - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - - /** - * The claim name for email in the id_token response. - */ - email_claim_name?: string; - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessFacebook { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderUpdateParams.AccessFacebook.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderUpdateParams.AccessFacebook.ScimConfig; - } - - export namespace AccessFacebook { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessGitHub { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderUpdateParams.AccessGitHub.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderUpdateParams.AccessGitHub.ScimConfig; - } - - export namespace AccessGitHub { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessGoogle { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderUpdateParams.AccessGoogle.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderUpdateParams.AccessGoogle.ScimConfig; - } - - export namespace AccessGoogle { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * Custom claims - */ - claims?: Array; - - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - - /** - * The claim name for email in the id_token response. - */ - email_claim_name?: string; - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessGoogleApps { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderUpdateParams.AccessGoogleApps.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderUpdateParams.AccessGoogleApps.ScimConfig; - } - - export namespace AccessGoogleApps { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * Your companies TLD - */ - apps_domain?: string; - - /** - * Custom claims - */ - claims?: Array; - - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - - /** - * The claim name for email in the id_token response. - */ - email_claim_name?: string; - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessLinkedin { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderUpdateParams.AccessLinkedin.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderUpdateParams.AccessLinkedin.ScimConfig; - } - - export namespace AccessLinkedin { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessOidc { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderUpdateParams.AccessOidc.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderUpdateParams.AccessOidc.ScimConfig; - } - - export namespace AccessOidc { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * The authorization_endpoint URL of your IdP - */ - auth_url?: string; - - /** - * The jwks_uri endpoint of your IdP to allow the IdP keys to sign the tokens - */ - certs_url?: string; - - /** - * Custom claims - */ - claims?: Array; - - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - - /** - * The claim name for email in the id_token response. - */ - email_claim_name?: string; - - /** - * OAuth scopes - */ - scopes?: Array; - - /** - * The token_endpoint URL of your IdP - */ - token_url?: string; - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessOkta { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderUpdateParams.AccessOkta.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderUpdateParams.AccessOkta.ScimConfig; - } - - export namespace AccessOkta { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * Your okta authorization server id - */ - authorization_server_id?: string; - - /** - * Custom claims - */ - claims?: Array; - - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - - /** - * The claim name for email in the id_token response. - */ - email_claim_name?: string; - - /** - * Your okta account url - */ - okta_account?: string; - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessOnelogin { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderUpdateParams.AccessOnelogin.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderUpdateParams.AccessOnelogin.ScimConfig; - } - - export namespace AccessOnelogin { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * Custom claims - */ - claims?: Array; - - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - - /** - * The claim name for email in the id_token response. - */ - email_claim_name?: string; - - /** - * Your OneLogin account url - */ - onelogin_account?: string; - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessPingone { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderUpdateParams.AccessPingone.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderUpdateParams.AccessPingone.ScimConfig; - } - - export namespace AccessPingone { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * Custom claims - */ - claims?: Array; - - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - - /** - * The claim name for email in the id_token response. - */ - email_claim_name?: string; - - /** - * Your PingOne environment identifier - */ - ping_env_id?: string; - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessSaml { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderUpdateParams.AccessSaml.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderUpdateParams.AccessSaml.ScimConfig; - } - - export namespace AccessSaml { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - export interface Config { - /** - * A list of SAML attribute names that will be added to your signed JWT token and - * can be used in SAML policy rules. - */ - attributes?: Array; - - /** - * The attribute name for email in the SAML response. - */ - email_attribute_name?: string; - - /** - * Add a list of attribute names that will be returned in the response header from - * the Access callback. - */ - header_attributes?: Array; - - /** - * X509 certificate to verify the signature in the SAML authentication response - */ - idp_public_certs?: Array; - - /** - * IdP Entity ID or Issuer URL - */ - issuer_url?: string; - - /** - * Sign the SAML authentication request with Access credentials. To verify the - * signature, use the public key from the Access certs endpoints. - */ - sign_request?: boolean; - - /** - * URL to send the SAML authentication requests to - */ - sso_target_url?: string; - } - - export namespace Config { - export interface HeaderAttribute { - /** - * attribute name from the IDP - */ - attribute_name?: string; - - /** - * header that will be added on the request to the origin - */ - header_name?: string; - } - } - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } - - export interface AccessYandex { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: IdentityProviderUpdateParams.AccessYandex.Config; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderUpdateParams.AccessYandex.ScimConfig; - } + seat_deprovision?: boolean; - export namespace AccessYandex { /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + * A read-only token generated when the SCIM integration is enabled for the first + * time. It is redacted on subsequent requests. If you lose this you will need to + * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. */ - export interface Config { - /** - * Your OAuth Client ID - */ - client_id?: string; - - /** - * Your OAuth Client Secret - */ - client_secret?: string; - } + secret?: string; /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. + * A flag to enable revoking a user's session in Access and Gateway when they have + * been deprovisioned in the Identity Provider. */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } + user_deprovision?: boolean; } +} - export interface AccessOnetimepin { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: unknown; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: IdentityProviderUpdateParams.AccessOnetimepin.ScimConfig; - } +export interface IdentityProviderListParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; - export namespace AccessOnetimepin { - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; +export interface IdentityProviderDeleteParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; +export interface IdentityProviderGetParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; } export namespace IdentityProviders { @@ -9690,4 +7053,7 @@ export namespace IdentityProviders { export import IdentityProviderGetResponse = IdentityProvidersAPI.IdentityProviderGetResponse; export import IdentityProviderCreateParams = IdentityProvidersAPI.IdentityProviderCreateParams; export import IdentityProviderUpdateParams = IdentityProvidersAPI.IdentityProviderUpdateParams; + export import IdentityProviderListParams = IdentityProvidersAPI.IdentityProviderListParams; + export import IdentityProviderDeleteParams = IdentityProvidersAPI.IdentityProviderDeleteParams; + export import IdentityProviderGetParams = IdentityProvidersAPI.IdentityProviderGetParams; } diff --git a/src/resources/access/index.ts b/src/resources/access/index.ts index bb6019ca54..5a74a2b837 100644 --- a/src/resources/access/index.ts +++ b/src/resources/access/index.ts @@ -10,6 +10,10 @@ export { ApplicationRevokeTokensResponse, ApplicationCreateParams, ApplicationUpdateParams, + ApplicationListParams, + ApplicationDeleteParams, + ApplicationGetParams, + ApplicationRevokeTokensParams, Applications, } from './applications/index'; export { @@ -27,6 +31,9 @@ export { CertificateGetResponse, CertificateCreateParams, CertificateUpdateParams, + CertificateListParams, + CertificateDeleteParams, + CertificateGetParams, Certificates, } from './certificates/index'; export { @@ -47,6 +54,9 @@ export { GroupGetResponse, GroupCreateParams, GroupUpdateParams, + GroupListParams, + GroupDeleteParams, + GroupGetParams, Groups, } from './groups'; export { @@ -57,6 +67,9 @@ export { IdentityProviderGetResponse, IdentityProviderCreateParams, IdentityProviderUpdateParams, + IdentityProviderListParams, + IdentityProviderDeleteParams, + IdentityProviderGetParams, IdentityProviders, } from './identity-providers'; export { KeyUpdateResponse, KeyListResponse, KeyRotateResponse, KeyUpdateParams, Keys } from './keys'; @@ -68,6 +81,7 @@ export { OrganizationRevokeUsersResponse, OrganizationCreateParams, OrganizationUpdateParams, + OrganizationListParams, OrganizationRevokeUsersParams, Organizations, } from './organizations'; @@ -81,6 +95,8 @@ export { ServiceTokenRotateResponse, ServiceTokenCreateParams, ServiceTokenUpdateParams, + ServiceTokenListParams, + ServiceTokenDeleteParams, ServiceTokens, } from './service-tokens'; export { diff --git a/src/resources/access/organizations.ts b/src/resources/access/organizations.ts index f82f8fa79b..74c9aa7e29 100644 --- a/src/resources/access/organizations.ts +++ b/src/resources/access/organizations.ts @@ -9,13 +9,12 @@ export class Organizations extends APIResource { * Sets up a Zero Trust organization for your account or zone. */ create( - accountOrZone: string, - accountOrZoneId: string, - body: OrganizationCreateParams, + params: OrganizationCreateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.post(`/${accountOrZone}/${accountOrZoneId}/access/organizations`, { + this._client.post(`/${account_id}/${zone_id}/access/organizations`, { body, ...options, }) as Core.APIPromise<{ result: OrganizationCreateResponse }> @@ -26,13 +25,12 @@ export class Organizations extends APIResource { * Updates the configuration for your Zero Trust organization. */ update( - accountOrZone: string, - accountOrZoneId: string, - body: OrganizationUpdateParams, + params: OrganizationUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/organizations`, { + this._client.put(`/${account_id}/${zone_id}/access/organizations`, { body, ...options, }) as Core.APIPromise<{ result: OrganizationUpdateResponse }> @@ -43,15 +41,14 @@ export class Organizations extends APIResource { * Returns the configuration for your Zero Trust organization. */ list( - accountOrZone: string, - accountOrZoneId: string, + params: OrganizationListParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.get( - `/${accountOrZone}/${accountOrZoneId}/access/organizations`, - options, - ) as Core.APIPromise<{ result: OrganizationListResponse }> + this._client.get(`/${account_id}/${zone_id}/access/organizations`, options) as Core.APIPromise<{ + result: OrganizationListResponse; + }> )._thenUnwrap((obj) => obj.result); } @@ -59,13 +56,12 @@ export class Organizations extends APIResource { * Revokes a user's access across all applications. */ revokeUsers( - accountOrZone: string, - accountOrZoneId: string, - body: OrganizationRevokeUsersParams, + params: OrganizationRevokeUsersParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.post(`/${accountOrZone}/${accountOrZoneId}/access/organizations/revoke_user`, { + this._client.post(`/${account_id}/${zone_id}/access/organizations/revoke_user`, { body, ...options, }) as Core.APIPromise<{ result: OrganizationRevokeUsersResponse }> @@ -395,58 +391,77 @@ export type OrganizationRevokeUsersResponse = true | false; export interface OrganizationCreateParams { /** - * The unique subdomain assigned to your Zero Trust organization. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: The unique subdomain assigned to your Zero Trust organization. */ auth_domain: string; /** - * The name of your Zero Trust organization. + * Body param: The name of your Zero Trust organization. */ name: string; /** - * When set to true, users can authenticate via WARP for any application in your - * organization. Application settings will take precedence over this value. + * Body param: When set to true, users can authenticate via WARP for any + * application in your organization. Application settings will take precedence over + * this value. */ allow_authenticate_via_warp?: boolean; /** - * When set to `true`, users skip the identity provider selection step during - * login. + * Body param: When set to `true`, users skip the identity provider selection step + * during login. */ auto_redirect_to_identity?: boolean; /** - * Lock all settings as Read-Only in the Dashboard, regardless of user permission. - * Updates may only be made via the API or Terraform for this account when enabled. + * Body param: Lock all settings as Read-Only in the Dashboard, regardless of user + * permission. Updates may only be made via the API or Terraform for this account + * when enabled. */ is_ui_read_only?: boolean; + /** + * Body param: + */ login_design?: OrganizationCreateParams.LoginDesign; /** - * The amount of time that tokens issued for applications will be valid. Must be in - * the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, - * h. + * Body param: The amount of time that tokens issued for applications will be + * valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us + * (or µs), ms, s, m, h. */ session_duration?: string; /** - * A description of the reason why the UI read only field is being toggled. + * Body param: A description of the reason why the UI read only field is being + * toggled. */ ui_read_only_toggle_reason?: string; /** - * The amount of time a user seat is inactive before it expires. When the user seat - * exceeds the set time of inactivity, the user is removed as an active seat and no - * longer counts against your Teams seat count. Must be in the format `300ms` or - * `2h45m`. Valid time units are: `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. + * Body param: The amount of time a user seat is inactive before it expires. When + * the user seat exceeds the set time of inactivity, the user is removed as an + * active seat and no longer counts against your Teams seat count. Must be in the + * format `300ms` or `2h45m`. Valid time units are: `ns`, `us` (or `µs`), `ms`, + * `s`, `m`, `h`. */ user_seat_expiration_inactive_time?: string; /** - * The amount of time that tokens issued for applications will be valid. Must be in - * the format `30m` or `2h45m`. Valid time units are: m, h. + * Body param: The amount of time that tokens issued for applications will be + * valid. Must be in the format `30m` or `2h45m`. Valid time units are: m, h. */ warp_auth_session_duration?: string; } @@ -482,60 +497,82 @@ export namespace OrganizationCreateParams { export interface OrganizationUpdateParams { /** - * When set to true, users can authenticate via WARP for any application in your - * organization. Application settings will take precedence over this value. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: When set to true, users can authenticate via WARP for any + * application in your organization. Application settings will take precedence over + * this value. */ allow_authenticate_via_warp?: boolean; /** - * The unique subdomain assigned to your Zero Trust organization. + * Body param: The unique subdomain assigned to your Zero Trust organization. */ auth_domain?: string; /** - * When set to `true`, users skip the identity provider selection step during - * login. + * Body param: When set to `true`, users skip the identity provider selection step + * during login. */ auto_redirect_to_identity?: boolean; + /** + * Body param: + */ custom_pages?: OrganizationUpdateParams.CustomPages; /** - * Lock all settings as Read-Only in the Dashboard, regardless of user permission. - * Updates may only be made via the API or Terraform for this account when enabled. + * Body param: Lock all settings as Read-Only in the Dashboard, regardless of user + * permission. Updates may only be made via the API or Terraform for this account + * when enabled. */ is_ui_read_only?: boolean; + /** + * Body param: + */ login_design?: OrganizationUpdateParams.LoginDesign; /** - * The name of your Zero Trust organization. + * Body param: The name of your Zero Trust organization. */ name?: string; /** - * The amount of time that tokens issued for applications will be valid. Must be in - * the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, - * h. + * Body param: The amount of time that tokens issued for applications will be + * valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us + * (or µs), ms, s, m, h. */ session_duration?: string; /** - * A description of the reason why the UI read only field is being toggled. + * Body param: A description of the reason why the UI read only field is being + * toggled. */ ui_read_only_toggle_reason?: string; /** - * The amount of time a user seat is inactive before it expires. When the user seat - * exceeds the set time of inactivity, the user is removed as an active seat and no - * longer counts against your Teams seat count. Must be in the format `300ms` or - * `2h45m`. Valid time units are: `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. + * Body param: The amount of time a user seat is inactive before it expires. When + * the user seat exceeds the set time of inactivity, the user is removed as an + * active seat and no longer counts against your Teams seat count. Must be in the + * format `300ms` or `2h45m`. Valid time units are: `ns`, `us` (or `µs`), `ms`, + * `s`, `m`, `h`. */ user_seat_expiration_inactive_time?: string; /** - * The amount of time that tokens issued for applications will be valid. Must be in - * the format `30m` or `2h45m`. Valid time units are: m, h. + * Body param: The amount of time that tokens issued for applications will be + * valid. Must be in the format `30m` or `2h45m`. Valid time units are: m, h. */ warp_auth_session_duration?: string; } @@ -582,9 +619,33 @@ export namespace OrganizationUpdateParams { } } +export interface OrganizationListParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + export interface OrganizationRevokeUsersParams { /** - * The email of the user to revoke. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: The email of the user to revoke. */ email: string; } @@ -596,5 +657,6 @@ export namespace Organizations { export import OrganizationRevokeUsersResponse = OrganizationsAPI.OrganizationRevokeUsersResponse; export import OrganizationCreateParams = OrganizationsAPI.OrganizationCreateParams; export import OrganizationUpdateParams = OrganizationsAPI.OrganizationUpdateParams; + export import OrganizationListParams = OrganizationsAPI.OrganizationListParams; export import OrganizationRevokeUsersParams = OrganizationsAPI.OrganizationRevokeUsersParams; } diff --git a/src/resources/access/service-tokens.ts b/src/resources/access/service-tokens.ts index c3c2f7ed56..fe7ca18393 100644 --- a/src/resources/access/service-tokens.ts +++ b/src/resources/access/service-tokens.ts @@ -11,13 +11,12 @@ export class ServiceTokens extends APIResource { * Secret or create a new service token. */ create( - accountOrZone: string, - accountOrZoneId: string, - body: ServiceTokenCreateParams, + params: ServiceTokenCreateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.post(`/${accountOrZone}/${accountOrZoneId}/access/service_tokens`, { + this._client.post(`/${account_id}/${zone_id}/access/service_tokens`, { body, ...options, }) as Core.APIPromise<{ result: ServiceTokenCreateResponse }> @@ -28,14 +27,13 @@ export class ServiceTokens extends APIResource { * Updates a configured service token. */ update( - accountOrZone: string, - accountOrZoneId: string, uuid: string, - body: ServiceTokenUpdateParams, + params: ServiceTokenUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/service_tokens/${uuid}`, { + this._client.put(`/${account_id}/${zone_id}/access/service_tokens/${uuid}`, { body, ...options, }) as Core.APIPromise<{ result: ServiceTokenUpdateResponse }> @@ -46,15 +44,14 @@ export class ServiceTokens extends APIResource { * Lists all service tokens. */ list( - accountOrZone: string, - accountOrZoneId: string, + params: ServiceTokenListParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.get( - `/${accountOrZone}/${accountOrZoneId}/access/service_tokens`, - options, - ) as Core.APIPromise<{ result: ServiceTokenListResponse | null }> + this._client.get(`/${account_id}/${zone_id}/access/service_tokens`, options) as Core.APIPromise<{ + result: ServiceTokenListResponse | null; + }> )._thenUnwrap((obj) => obj.result); } @@ -62,14 +59,14 @@ export class ServiceTokens extends APIResource { * Deletes a service token. */ delete( - accountOrZone: string, - accountOrZoneId: string, uuid: string, + params: ServiceTokenDeleteParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( this._client.delete( - `/${accountOrZone}/${accountOrZoneId}/access/service_tokens/${uuid}`, + `/${account_id}/${zone_id}/access/service_tokens/${uuid}`, options, ) as Core.APIPromise<{ result: ServiceTokenDeleteResponse }> )._thenUnwrap((obj) => obj.result); @@ -300,32 +297,80 @@ export interface ServiceTokenRotateResponse { export interface ServiceTokenCreateParams { /** - * The name of the service token. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: The name of the service token. */ name: string; /** - * The duration for how long the service token will be valid. Must be in the format - * `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The - * default is 1 year in hours (8760h). + * Body param: The duration for how long the service token will be valid. Must be + * in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, + * m, h. The default is 1 year in hours (8760h). */ duration?: string; } export interface ServiceTokenUpdateParams { /** - * The duration for how long the service token will be valid. Must be in the format - * `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The - * default is 1 year in hours (8760h). + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: The duration for how long the service token will be valid. Must be + * in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, + * m, h. The default is 1 year in hours (8760h). */ duration?: string; /** - * The name of the service token. + * Body param: The name of the service token. */ name?: string; } +export interface ServiceTokenListParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + +export interface ServiceTokenDeleteParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + export namespace ServiceTokens { export import ServiceTokenCreateResponse = ServiceTokensAPI.ServiceTokenCreateResponse; export import ServiceTokenUpdateResponse = ServiceTokensAPI.ServiceTokenUpdateResponse; @@ -335,4 +380,6 @@ export namespace ServiceTokens { export import ServiceTokenRotateResponse = ServiceTokensAPI.ServiceTokenRotateResponse; export import ServiceTokenCreateParams = ServiceTokensAPI.ServiceTokenCreateParams; export import ServiceTokenUpdateParams = ServiceTokensAPI.ServiceTokenUpdateParams; + export import ServiceTokenListParams = ServiceTokensAPI.ServiceTokenListParams; + export import ServiceTokenDeleteParams = ServiceTokensAPI.ServiceTokenDeleteParams; } diff --git a/src/resources/bot-management.ts b/src/resources/bot-management.ts index f032957b46..2612ce90f7 100644 --- a/src/resources/bot-management.ts +++ b/src/resources/bot-management.ts @@ -303,111 +303,57 @@ export namespace BotManagementGetResponse { } } -export type BotManagementUpdateParams = - | BotManagementUpdateParams.BotManagementBotFightModeConfig - | BotManagementUpdateParams.BotManagementSbfmDefinitelyConfig - | BotManagementUpdateParams.BotManagementSbfmLikelyConfig - | BotManagementUpdateParams.BotManagementBmSubscriptionConfig; - -export namespace BotManagementUpdateParams { - export interface BotManagementBotFightModeConfig { - /** - * Use lightweight, invisible JavaScript detections to improve Bot Management. - * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). - */ - enable_js?: boolean; - - /** - * Whether to enable Bot Fight Mode. - */ - fight_mode?: boolean; - } - - export interface BotManagementSbfmDefinitelyConfig { - /** - * Use lightweight, invisible JavaScript detections to improve Bot Management. - * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). - */ - enable_js?: boolean; - - /** - * Whether to optimize Super Bot Fight Mode protections for Wordpress. - */ - optimize_wordpress?: boolean; - - /** - * Super Bot Fight Mode (SBFM) action to take on definitely automated requests. - */ - sbfm_definitely_automated?: 'allow' | 'block' | 'managed_challenge'; - - /** - * Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if - * static resources on your application need bot protection. Note: Static resource - * protection can also result in legitimate traffic being blocked. - */ - sbfm_static_resource_protection?: boolean; - - /** - * Super Bot Fight Mode (SBFM) action to take on verified bots requests. - */ - sbfm_verified_bots?: 'allow' | 'block'; - } - - export interface BotManagementSbfmLikelyConfig { - /** - * Use lightweight, invisible JavaScript detections to improve Bot Management. - * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). - */ - enable_js?: boolean; +export interface BotManagementUpdateParams { + /** + * Automatically update to the newest bot detection models created by Cloudflare as + * they are released. + * [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) + */ + auto_update_model?: boolean; - /** - * Whether to optimize Super Bot Fight Mode protections for Wordpress. - */ - optimize_wordpress?: boolean; + /** + * Use lightweight, invisible JavaScript detections to improve Bot Management. + * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + */ + enable_js?: boolean; - /** - * Super Bot Fight Mode (SBFM) action to take on definitely automated requests. - */ - sbfm_definitely_automated?: 'allow' | 'block' | 'managed_challenge'; + /** + * Whether to enable Bot Fight Mode. + */ + fight_mode?: boolean; - /** - * Super Bot Fight Mode (SBFM) action to take on likely automated requests. - */ - sbfm_likely_automated?: 'allow' | 'block' | 'managed_challenge'; + /** + * Whether to optimize Super Bot Fight Mode protections for Wordpress. + */ + optimize_wordpress?: boolean; - /** - * Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if - * static resources on your application need bot protection. Note: Static resource - * protection can also result in legitimate traffic being blocked. - */ - sbfm_static_resource_protection?: boolean; + /** + * Super Bot Fight Mode (SBFM) action to take on definitely automated requests. + */ + sbfm_definitely_automated?: 'allow' | 'block' | 'managed_challenge'; - /** - * Super Bot Fight Mode (SBFM) action to take on verified bots requests. - */ - sbfm_verified_bots?: 'allow' | 'block'; - } + /** + * Super Bot Fight Mode (SBFM) action to take on likely automated requests. + */ + sbfm_likely_automated?: 'allow' | 'block' | 'managed_challenge'; - export interface BotManagementBmSubscriptionConfig { - /** - * Automatically update to the newest bot detection models created by Cloudflare as - * they are released. - * [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) - */ - auto_update_model?: boolean; + /** + * Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if + * static resources on your application need bot protection. Note: Static resource + * protection can also result in legitimate traffic being blocked. + */ + sbfm_static_resource_protection?: boolean; - /** - * Use lightweight, invisible JavaScript detections to improve Bot Management. - * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). - */ - enable_js?: boolean; + /** + * Super Bot Fight Mode (SBFM) action to take on verified bots requests. + */ + sbfm_verified_bots?: 'allow' | 'block'; - /** - * Whether to disable tracking the highest bot score for a session in the Bot - * Management cookie. - */ - suppress_session_score?: boolean; - } + /** + * Whether to disable tracking the highest bot score for a session in the Bot + * Management cookie. + */ + suppress_session_score?: boolean; } export namespace BotManagement { diff --git a/src/resources/cache-reserve.ts b/src/resources/cache-reserve.ts deleted file mode 100644 index 9d15b1b4f2..0000000000 --- a/src/resources/cache-reserve.ts +++ /dev/null @@ -1,106 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as CacheReserveAPI from 'cloudflare/resources/cache-reserve'; - -export class CacheReserve extends APIResource { - /** - * You can use Cache Reserve Clear to clear your Cache Reserve, but you must first - * disable Cache Reserve. In most cases, this will be accomplished within 24 hours. - * You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind - * that you cannot undo or cancel this operation. - */ - create(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.post(`/zones/${zoneId}/cache/cache_reserve_clear`, options) as Core.APIPromise<{ - result: CacheReserveCreateResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * You can use Cache Reserve Clear to clear your Cache Reserve, but you must first - * disable Cache Reserve. In most cases, this will be accomplished within 24 hours. - * You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind - * that you cannot undo or cancel this operation. - */ - get(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.get(`/zones/${zoneId}/cache/cache_reserve_clear`, options) as Core.APIPromise<{ - result: CacheReserveGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -/** - * You can use Cache Reserve Clear to clear your Cache Reserve, but you must first - * disable Cache Reserve. In most cases, this will be accomplished within 24 hours. - * You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind - * that you cannot undo or cancel this operation. - */ -export interface CacheReserveCreateResponse { - /** - * ID of the zone setting. - */ - id: 'cache_reserve_clear'; - - /** - * last time this setting was modified. - */ - modified_on: string | null; - - /** - * The time that the latest Cache Reserve Clear operation started. - */ - start_ts: string; - - /** - * The current state of the Cache Reserve Clear operation. - */ - state: 'In-progress' | 'Completed'; - - /** - * The time that the latest Cache Reserve Clear operation completed. - */ - end_ts?: string; -} - -/** - * You can use Cache Reserve Clear to clear your Cache Reserve, but you must first - * disable Cache Reserve. In most cases, this will be accomplished within 24 hours. - * You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind - * that you cannot undo or cancel this operation. - */ -export interface CacheReserveGetResponse { - /** - * ID of the zone setting. - */ - id: 'cache_reserve_clear'; - - /** - * last time this setting was modified. - */ - modified_on: string | null; - - /** - * The time that the latest Cache Reserve Clear operation started. - */ - start_ts: string; - - /** - * The current state of the Cache Reserve Clear operation. - */ - state: 'In-progress' | 'Completed'; - - /** - * The time that the latest Cache Reserve Clear operation completed. - */ - end_ts?: string; -} - -export namespace CacheReserve { - export import CacheReserveCreateResponse = CacheReserveAPI.CacheReserveCreateResponse; - export import CacheReserveGetResponse = CacheReserveAPI.CacheReserveGetResponse; -} diff --git a/src/resources/cache/cache-reserves.ts b/src/resources/cache/cache-reserve.ts similarity index 88% rename from src/resources/cache/cache-reserves.ts rename to src/resources/cache/cache-reserve.ts index 71a2e9aa35..f2e983abde 100644 --- a/src/resources/cache/cache-reserves.ts +++ b/src/resources/cache/cache-reserve.ts @@ -2,9 +2,9 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as CacheReservesAPI from 'cloudflare/resources/cache/cache-reserves'; +import * as CacheReserveAPI from 'cloudflare/resources/cache/cache-reserve'; -export class CacheReserves extends APIResource { +export class CacheReserve extends APIResource { /** * Increase cache lifetimes by automatically storing all cacheable files into * Cloudflare's persistent object storage buckets. Requires Cache Reserve @@ -99,8 +99,8 @@ export interface CacheReserveEditParams { value: 'on' | 'off'; } -export namespace CacheReserves { - export import CacheReserveListResponse = CacheReservesAPI.CacheReserveListResponse; - export import CacheReserveEditResponse = CacheReservesAPI.CacheReserveEditResponse; - export import CacheReserveEditParams = CacheReservesAPI.CacheReserveEditParams; +export namespace CacheReserve { + export import CacheReserveListResponse = CacheReserveAPI.CacheReserveListResponse; + export import CacheReserveEditResponse = CacheReserveAPI.CacheReserveEditResponse; + export import CacheReserveEditParams = CacheReserveAPI.CacheReserveEditParams; } diff --git a/src/resources/cache/cache.ts b/src/resources/cache/cache.ts index 04da9f7d58..547fd486cc 100644 --- a/src/resources/cache/cache.ts +++ b/src/resources/cache/cache.ts @@ -3,13 +3,13 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import * as CacheAPI from 'cloudflare/resources/cache/cache'; -import * as CacheReservesAPI from 'cloudflare/resources/cache/cache-reserves'; +import * as CacheReserveAPI from 'cloudflare/resources/cache/cache-reserve'; import * as RegionalTieredCacheAPI from 'cloudflare/resources/cache/regional-tiered-cache'; import * as TieredCacheSmartTopologyAPI from 'cloudflare/resources/cache/tiered-cache-smart-topology'; import * as VariantsAPI from 'cloudflare/resources/cache/variants'; export class Cache extends APIResource { - cacheReserves: CacheReservesAPI.CacheReserves = new CacheReservesAPI.CacheReserves(this._client); + cacheReserve: CacheReserveAPI.CacheReserve = new CacheReserveAPI.CacheReserve(this._client); tieredCacheSmartTopology: TieredCacheSmartTopologyAPI.TieredCacheSmartTopology = new TieredCacheSmartTopologyAPI.TieredCacheSmartTopology(this._client); variants: VariantsAPI.Variants = new VariantsAPI.Variants(this._client); @@ -67,17 +67,23 @@ export interface CachePurgeResponse { } export type CachePurgeParams = - | CachePurgeParams.CachePurgeFlex + | CachePurgeParams.CachePurgeTags + | CachePurgeParams.CachePurgeHosts + | CachePurgeParams.CachePurgePrefixes | CachePurgeParams.CachePurgeEverything | CachePurgeParams.CachePurgeFiles; export namespace CachePurgeParams { - export interface CachePurgeFlex { + export interface CachePurgeTags { + tags?: Array; + } + + export interface CachePurgeHosts { hosts?: Array; + } + export interface CachePurgePrefixes { prefixes?: Array; - - tags?: Array; } export interface CachePurgeEverything { @@ -85,7 +91,7 @@ export namespace CachePurgeParams { } export interface CachePurgeFiles { - files?: Array; + files?: Array; } export namespace CachePurgeFiles { @@ -100,10 +106,10 @@ export namespace CachePurgeParams { export namespace Cache { export import CachePurgeResponse = CacheAPI.CachePurgeResponse; export import CachePurgeParams = CacheAPI.CachePurgeParams; - export import CacheReserves = CacheReservesAPI.CacheReserves; - export import CacheReserveListResponse = CacheReservesAPI.CacheReserveListResponse; - export import CacheReserveEditResponse = CacheReservesAPI.CacheReserveEditResponse; - export import CacheReserveEditParams = CacheReservesAPI.CacheReserveEditParams; + export import CacheReserve = CacheReserveAPI.CacheReserve; + export import CacheReserveListResponse = CacheReserveAPI.CacheReserveListResponse; + export import CacheReserveEditResponse = CacheReserveAPI.CacheReserveEditResponse; + export import CacheReserveEditParams = CacheReserveAPI.CacheReserveEditParams; export import TieredCacheSmartTopology = TieredCacheSmartTopologyAPI.TieredCacheSmartTopology; export import TieredCacheSmartTopologyDeleteResponse = TieredCacheSmartTopologyAPI.TieredCacheSmartTopologyDeleteResponse; export import TieredCacheSmartTopologyEditResponse = TieredCacheSmartTopologyAPI.TieredCacheSmartTopologyEditResponse; diff --git a/src/resources/cache/index.ts b/src/resources/cache/index.ts index aa8cfdd787..4e30c997b7 100644 --- a/src/resources/cache/index.ts +++ b/src/resources/cache/index.ts @@ -5,8 +5,8 @@ export { CacheReserveListResponse, CacheReserveEditResponse, CacheReserveEditParams, - CacheReserves, -} from './cache-reserves'; + CacheReserve, +} from './cache-reserve'; export { RegionalTieredCacheEditResponse, RegionalTieredCacheGetResponse, diff --git a/src/resources/dispatchers/scripts.ts b/src/resources/dispatchers/scripts.ts index 468254ca84..b81a90f5a0 100644 --- a/src/resources/dispatchers/scripts.ts +++ b/src/resources/dispatchers/scripts.ts @@ -222,102 +222,174 @@ export namespace ScriptGetResponse { } } -export type ScriptUpdateParams = ScriptUpdateParams.Variant0 | ScriptUpdateParams.Variant1; +export interface ScriptUpdateParams { + /** + * A module comprising a Worker script, often a javascript file. Multiple modules + * may be provided as separate named parts, but at least one module must be present + * and referenced in the metadata as `main_module` or `body_part` by part name. + */ + ''?: Array; + + /** + * Rollback message to be associated with this deployment. Only parsed when query + * param `"rollback_to"` is present. + */ + message?: string; + + /** + * JSON encoded metadata about the uploaded parts and Worker configuration. + */ + metadata?: ScriptUpdateParams.Metadata; +} export namespace ScriptUpdateParams { - export interface Variant0 { + /** + * JSON encoded metadata about the uploaded parts and Worker configuration. + */ + export interface Metadata { + /** + * List of bindings available to the worker. + */ + bindings?: Array; + + /** + * Name of the part in the multipart request that contains the script (e.g. the + * file adding a listener to the `fetch` event). Indicates a + * `service worker syntax` Worker. + */ + body_part?: string; + + /** + * Date indicating targeted support in the Workers runtime. Backwards incompatible + * fixes to the runtime following this date will not affect this Worker. + */ + compatibility_date?: string; + + /** + * Flags that enable or disable certain features in the Workers runtime. Used to + * enable upcoming features or opt in or out of specific changes not included in a + * `compatibility_date`. + */ + compatibility_flags?: Array; + + /** + * List of binding types to keep from previous_upload. + */ + keep_bindings?: Array; + + /** + * Whether Logpush is turned on for the Worker. + */ + logpush?: boolean; + + /** + * Name of the part in the multipart request that contains the main module (e.g. + * the file exporting a `fetch` handler). Indicates a `module syntax` Worker. + */ + main_module?: string; + /** - * A module comprising a Worker script, often a javascript file. Multiple modules - * may be provided as separate named parts, but at least one module must be present - * and referenced in the metadata as `main_module` or `body_part` by part name. + * Migrations to apply for Durable Objects associated with this Worker. */ - ''?: Array; + migrations?: Metadata.WorkersSingleStepMigrations | Metadata.WorkersSteppedMigrations; + + placement?: Metadata.Placement; /** - * JSON encoded metadata about the uploaded parts and Worker configuration. + * List of strings to use as tags for this Worker */ - metadata?: ScriptUpdateParams.Variant0.Metadata; + tags?: Array; + + /** + * List of Workers that will consume logs from the attached Worker. + */ + tail_consumers?: Array; + + /** + * Usage model to apply to invocations. + */ + usage_model?: 'bundled' | 'unbound'; + + /** + * Key-value pairs to use as tags for this version of this Worker + */ + version_tags?: unknown; } - export namespace Variant0 { + export namespace Metadata { /** - * JSON encoded metadata about the uploaded parts and Worker configuration. + * A single set of migrations to apply. */ - export interface Metadata { + export interface WorkersSingleStepMigrations { /** - * List of bindings available to the worker. + * A list of classes to delete Durable Object namespaces from. */ - bindings?: Array; + deleted_classes?: Array; /** - * Name of the part in the multipart request that contains the script (e.g. the - * file adding a listener to the `fetch` event). Indicates a - * `service worker syntax` Worker. + * A list of classes to create Durable Object namespaces from. */ - body_part?: string; + new_classes?: Array; /** - * Date indicating targeted support in the Workers runtime. Backwards incompatible - * fixes to the runtime following this date will not affect this Worker. + * Tag to set as the latest migration tag. */ - compatibility_date?: string; + new_tag?: string; /** - * Flags that enable or disable certain features in the Workers runtime. Used to - * enable upcoming features or opt in or out of specific changes not included in a - * `compatibility_date`. + * Tag used to verify against the latest migration tag for this Worker. If they + * don't match, the upload is rejected. */ - compatibility_flags?: Array; + old_tag?: string; /** - * List of binding types to keep from previous_upload. + * A list of classes with Durable Object namespaces that were renamed. */ - keep_bindings?: Array; + renamed_classes?: Array; /** - * Whether Logpush is turned on for the Worker. + * A list of transfers for Durable Object namespaces from a different Worker and + * class to a class defined in this Worker. */ - logpush?: boolean; + transferred_classes?: Array; + } - /** - * Name of the part in the multipart request that contains the main module (e.g. - * the file exporting a `fetch` handler). Indicates a `module syntax` Worker. - */ - main_module?: string; + export namespace WorkersSingleStepMigrations { + export interface RenamedClass { + from?: string; - /** - * Migrations to apply for Durable Objects associated with this Worker. - */ - migrations?: Metadata.WorkersSingleStepMigrations | Metadata.WorkersSteppedMigrations; + to?: string; + } - placement?: Metadata.Placement; + export interface TransferredClass { + from?: string; - /** - * List of strings to use as tags for this Worker - */ - tags?: Array; + from_script?: string; + to?: string; + } + } + + export interface WorkersSteppedMigrations { /** - * List of Workers that will consume logs from the attached Worker. + * Tag to set as the latest migration tag. */ - tail_consumers?: Array; + new_tag?: string; /** - * Usage model to apply to invocations. + * Tag used to verify against the latest migration tag for this Worker. If they + * don't match, the upload is rejected. */ - usage_model?: 'bundled' | 'unbound'; + old_tag?: string; /** - * Key-value pairs to use as tags for this version of this Worker + * Migrations to apply in order. */ - version_tags?: unknown; + steps?: Array; } - export namespace Metadata { - /** - * A single set of migrations to apply. - */ - export interface WorkersSingleStepMigrations { + export namespace WorkersSteppedMigrations { + export interface Step { /** * A list of classes to delete Durable Object namespaces from. */ @@ -328,30 +400,19 @@ export namespace ScriptUpdateParams { */ new_classes?: Array; - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - /** * A list of classes with Durable Object namespaces that were renamed. */ - renamed_classes?: Array; + renamed_classes?: Array; /** * A list of transfers for Durable Object namespaces from a different Worker and * class to a class defined in this Worker. */ - transferred_classes?: Array; + transferred_classes?: Array; } - export namespace WorkersSingleStepMigrations { + export namespace Step { export interface RenamedClass { from?: string; @@ -366,103 +427,36 @@ export namespace ScriptUpdateParams { to?: string; } } + } - export interface WorkersSteppedMigrations { - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - - /** - * Migrations to apply in order. - */ - steps?: Array; - } - - export namespace WorkersSteppedMigrations { - export interface Step { - /** - * A list of classes to delete Durable Object namespaces from. - */ - deleted_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces from. - */ - new_classes?: Array; - - /** - * A list of classes with Durable Object namespaces that were renamed. - */ - renamed_classes?: Array; - - /** - * A list of transfers for Durable Object namespaces from a different Worker and - * class to a class defined in this Worker. - */ - transferred_classes?: Array; - } - - export namespace Step { - export interface RenamedClass { - from?: string; - - to?: string; - } - - export interface TransferredClass { - from?: string; - - from_script?: string; - - to?: string; - } - } - } - - export interface Placement { - /** - * Enables - * [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - * Only `"smart"` is currently supported - */ - mode?: 'smart'; - } - + export interface Placement { /** - * A reference to a script that will consume logs from the attached Worker. + * Enables + * [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + * Only `"smart"` is currently supported */ - export interface TailConsumer { - /** - * Name of Worker that is to be the consumer. - */ - service: string; - - /** - * Optional environment if the Worker utilizes one. - */ - environment?: string; - - /** - * Optional dispatch namespace the script belongs to. - */ - namespace?: string; - } + mode?: 'smart'; } - } - export interface Variant1 { /** - * Rollback message to be associated with this deployment. Only parsed when query - * param `"rollback_to"` is present. + * A reference to a script that will consume logs from the attached Worker. */ - message?: string; + export interface TailConsumer { + /** + * Name of Worker that is to be the consumer. + */ + service: string; + + /** + * Optional environment if the Worker utilizes one. + */ + environment?: string; + + /** + * Optional dispatch namespace the script belongs to. + */ + namespace?: string; + } } } diff --git a/src/resources/dns-records.ts b/src/resources/dns-records.ts index 6017c65f73..3db58c76be 100644 --- a/src/resources/dns-records.ts +++ b/src/resources/dns-records.ts @@ -9675,2301 +9675,531 @@ export interface DNSRecordScanResponse { total_records_parsed?: number; } -export type DNSRecordCreateParams = - | DNSRecordCreateParams.DNSRecordsARecord - | DNSRecordCreateParams.DNSRecordsAaaaRecord - | DNSRecordCreateParams.DNSRecordsCaaRecord - | DNSRecordCreateParams.DNSRecordsCertRecord - | DNSRecordCreateParams.DNSRecordsCnameRecord - | DNSRecordCreateParams.DNSRecordsDnskeyRecord - | DNSRecordCreateParams.DNSRecordsDsRecord - | DNSRecordCreateParams.DNSRecordsHTTPSRecord - | DNSRecordCreateParams.DNSRecordsLocRecord - | DNSRecordCreateParams.DNSRecordsMxRecord - | DNSRecordCreateParams.DNSRecordsNaptrRecord - | DNSRecordCreateParams.DNSRecordsNsRecord - | DNSRecordCreateParams.DNSRecordsPtrRecord - | DNSRecordCreateParams.DNSRecordsSmimeaRecord - | DNSRecordCreateParams.DNSRecordsSrvRecord - | DNSRecordCreateParams.DNSRecordsSshfpRecord - | DNSRecordCreateParams.DNSRecordsSvcbRecord - | DNSRecordCreateParams.DNSRecordsTlsaRecord - | DNSRecordCreateParams.DNSRecordsTxtRecord - | DNSRecordCreateParams.DNSRecordsUriRecord; +export interface DNSRecordCreateParams { + /** + * DNS record name (or @ for the zone apex) in Punycode. + */ + name: string; + + /** + * Record type. + */ + type: 'URI'; + + /** + * Comments or notes about the DNS record. This field has no effect on DNS + * responses. + */ + comment?: string; + + data?: DNSRecordCreateParams.Data; + + meta?: DNSRecordCreateParams.Meta; + + /** + * Required for MX, SRV and URI records; unused by other record types. Records with + * lower priorities are preferred. + */ + priority?: number; + + /** + * Whether the record is receiving the performance and security benefits of + * Cloudflare. + */ + proxied?: boolean; + + /** + * Custom tags for the DNS record. This field has no effect on DNS responses. + */ + tags?: Array; + + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl?: number | 1; +} export namespace DNSRecordCreateParams { - export interface DNSRecordsARecord { + export interface Data { /** - * A valid IPv4 address. + * algorithm. */ - content: string; + algorithm?: number; /** - * DNS record name (or @ for the zone apex) in Punycode. + * Altitude of location in meters. */ - name: string; + altitude?: number; /** - * Record type. + * certificate. */ - type: 'A'; + certificate?: string; /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. + * The record content. */ - comment?: string; + content?: string; /** - * Whether the record is receiving the performance and security benefits of - * Cloudflare. + * Digest. */ - proxied?: boolean; + digest?: string; /** - * Custom tags for the DNS record. This field has no effect on DNS responses. + * Digest Type. */ - tags?: Array; + digest_type?: number; /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. + * fingerprint. */ - ttl?: number | 1; - } + fingerprint?: string; - export interface DNSRecordsAaaaRecord { /** - * A valid IPv6 address. + * Flags. */ - content: string; + flags?: string; /** - * DNS record name (or @ for the zone apex) in Punycode. + * Key Tag. */ - name: string; + key_tag?: number; /** - * Record type. + * Degrees of latitude. */ - type: 'AAAA'; + lat_degrees?: number; /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. + * Latitude direction. */ - comment?: string; + lat_direction?: 'N' | 'S'; /** - * Whether the record is receiving the performance and security benefits of - * Cloudflare. + * Minutes of latitude. */ - proxied?: boolean; + lat_minutes?: number; /** - * Custom tags for the DNS record. This field has no effect on DNS responses. + * Seconds of latitude. */ - tags?: Array; + lat_seconds?: number; /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. + * Degrees of longitude. */ - ttl?: number | 1; - } + long_degrees?: number; - export interface DNSRecordsCaaRecord { /** - * Components of a CAA record. + * Longitude direction. */ - data: DNSRecordCreateParams.DNSRecordsCaaRecord.Data; + long_direction?: 'E' | 'W'; /** - * DNS record name (or @ for the zone apex) in Punycode. + * Minutes of longitude. */ - name: string; + long_minutes?: number; /** - * Record type. + * Seconds of longitude. */ - type: 'CAA'; + long_seconds?: number; /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. + * Matching Type. */ - comment?: string; + matching_type?: number; /** - * Custom tags for the DNS record. This field has no effect on DNS responses. + * A valid hostname. Deprecated in favor of the regular 'name' outside the data + * map. This data map field represents the remainder of the full 'name' after the + * service and protocol. */ - tags?: Array; + name?: string; /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. + * Order. */ - ttl?: number | 1; - } + order?: number; - export namespace DNSRecordsCaaRecord { /** - * Components of a CAA record. + * The port of the service. */ - export interface Data { - /** - * Flags for the CAA record. - */ - flags?: number; - - /** - * Name of the property controlled by this record (e.g.: issue, issuewild, iodef). - */ - tag?: string; + port?: number; - /** - * Value of the record. This field's semantics depend on the chosen tag. - */ - value?: string; - } - } + /** + * Horizontal precision of location. + */ + precision_horz?: number; - export interface DNSRecordsCertRecord { /** - * Components of a CERT record. + * Vertical precision of location. */ - data: DNSRecordCreateParams.DNSRecordsCertRecord.Data; + precision_vert?: number; /** - * DNS record name (or @ for the zone apex) in Punycode. + * Preference. */ - name: string; + preference?: number; /** - * Record type. + * priority. */ - type: 'CERT'; + priority?: number; /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. + * A valid protocol, prefixed with an underscore. Deprecated in favor of the + * regular 'name' outside the data map. This data map field normally represents the + * second label of that 'name'. */ - comment?: string; + proto?: string; /** - * Custom tags for the DNS record. This field has no effect on DNS responses. + * Protocol. */ - tags?: Array; + protocol?: number; /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. + * Public Key. */ - ttl?: number | 1; - } + public_key?: string; - export namespace DNSRecordsCertRecord { /** - * Components of a CERT record. + * Regex. */ - export interface Data { - /** - * Algorithm. - */ - algorithm?: number; + regex?: string; - /** - * Certificate. - */ - certificate?: string; + /** + * Replacement. + */ + replacement?: string; - /** - * Key Tag. - */ - key_tag?: number; + /** + * Selector. + */ + selector?: number; - /** - * Type. - */ - type?: number; - } - } + /** + * A service type, prefixed with an underscore. Deprecated in favor of the regular + * 'name' outside the data map. This data map field normally represents the first + * label of that 'name'. + */ + service?: string; - export interface DNSRecordsCnameRecord { /** - * A valid hostname. Must not match the record's name. + * Size of location in meters. */ - content: unknown; + size?: number; /** - * DNS record name (or @ for the zone apex) in Punycode. + * Name of the property controlled by this record (e.g.: issue, issuewild, iodef). */ - name: string; + tag?: string; /** - * Record type. + * target. */ - type: 'CNAME'; + target?: string; /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. + * type. */ - comment?: string; + type?: number; /** - * Whether the record is receiving the performance and security benefits of - * Cloudflare. + * Usage. */ - proxied?: boolean; + usage?: number; /** - * Custom tags for the DNS record. This field has no effect on DNS responses. + * value. */ - tags?: Array; + value?: string; /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. + * The record weight. */ - ttl?: number | 1; + weight?: number; } - export interface DNSRecordsDnskeyRecord { + export interface Meta { /** - * Components of a DNSKEY record. + * Will exist if Cloudflare automatically added this DNS record during initial + * setup. */ - data: DNSRecordCreateParams.DNSRecordsDnskeyRecord.Data; + auto_added?: boolean; /** - * DNS record name (or @ for the zone apex) in Punycode. + * Where the record originated from. */ - name: string; + source?: string; + } +} + +export interface DNSRecordUpdateParams { + /** + * DNS record name (or @ for the zone apex) in Punycode. + */ + name: string; + + /** + * Record type. + */ + type: 'URI'; + + /** + * Comments or notes about the DNS record. This field has no effect on DNS + * responses. + */ + comment?: string; + + data?: DNSRecordUpdateParams.Data; + + meta?: DNSRecordUpdateParams.Meta; + + /** + * Required for MX, SRV and URI records; unused by other record types. Records with + * lower priorities are preferred. + */ + priority?: number; + + /** + * Whether the record is receiving the performance and security benefits of + * Cloudflare. + */ + proxied?: boolean; + + /** + * Custom tags for the DNS record. This field has no effect on DNS responses. + */ + tags?: Array; + + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl?: number | 1; +} +export namespace DNSRecordUpdateParams { + export interface Data { /** - * Record type. + * algorithm. */ - type: 'DNSKEY'; + algorithm?: number; /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. + * Altitude of location in meters. */ - comment?: string; + altitude?: number; /** - * Custom tags for the DNS record. This field has no effect on DNS responses. + * certificate. */ - tags?: Array; + certificate?: string; /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. + * The record content. */ - ttl?: number | 1; - } + content?: string; - export namespace DNSRecordsDnskeyRecord { /** - * Components of a DNSKEY record. + * Digest. */ - export interface Data { - /** - * Algorithm. - */ - algorithm?: number; - - /** - * Flags. - */ - flags?: number; + digest?: string; - /** - * Protocol. - */ - protocol?: number; + /** + * Digest Type. + */ + digest_type?: number; - /** - * Public Key. - */ - public_key?: string; - } - } + /** + * fingerprint. + */ + fingerprint?: string; - export interface DNSRecordsDsRecord { /** - * Components of a DS record. + * Flags. */ - data: DNSRecordCreateParams.DNSRecordsDsRecord.Data; + flags?: string; /** - * DNS record name (or @ for the zone apex) in Punycode. + * Key Tag. */ - name: string; + key_tag?: number; /** - * Record type. + * Degrees of latitude. */ - type: 'DS'; + lat_degrees?: number; /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. + * Latitude direction. */ - comment?: string; + lat_direction?: 'N' | 'S'; /** - * Custom tags for the DNS record. This field has no effect on DNS responses. + * Minutes of latitude. */ - tags?: Array; + lat_minutes?: number; /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. + * Seconds of latitude. */ - ttl?: number | 1; - } - - export namespace DNSRecordsDsRecord { - /** - * Components of a DS record. - */ - export interface Data { - /** - * Algorithm. - */ - algorithm?: number; - - /** - * Digest. - */ - digest?: string; - - /** - * Digest Type. - */ - digest_type?: number; - - /** - * Key Tag. - */ - key_tag?: number; - } - } - - export interface DNSRecordsHTTPSRecord { - /** - * Components of a HTTPS record. - */ - data: DNSRecordCreateParams.DNSRecordsHTTPSRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'HTTPS'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export namespace DNSRecordsHTTPSRecord { - /** - * Components of a HTTPS record. - */ - export interface Data { - /** - * priority. - */ - priority?: number; - - /** - * target. - */ - target?: string; - - /** - * value. - */ - value?: string; - } - } - - export interface DNSRecordsLocRecord { - /** - * Components of a LOC record. - */ - data: DNSRecordCreateParams.DNSRecordsLocRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'LOC'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export namespace DNSRecordsLocRecord { - /** - * Components of a LOC record. - */ - export interface Data { - /** - * Altitude of location in meters. - */ - altitude?: number; - - /** - * Degrees of latitude. - */ - lat_degrees?: number; - - /** - * Latitude direction. - */ - lat_direction?: 'N' | 'S'; - - /** - * Minutes of latitude. - */ - lat_minutes?: number; - - /** - * Seconds of latitude. - */ - lat_seconds?: number; - - /** - * Degrees of longitude. - */ - long_degrees?: number; - - /** - * Longitude direction. - */ - long_direction?: 'E' | 'W'; - - /** - * Minutes of longitude. - */ - long_minutes?: number; - - /** - * Seconds of longitude. - */ - long_seconds?: number; - - /** - * Horizontal precision of location. - */ - precision_horz?: number; - - /** - * Vertical precision of location. - */ - precision_vert?: number; - - /** - * Size of location in meters. - */ - size?: number; - } - } - - export interface DNSRecordsMxRecord { - /** - * A valid mail server hostname. - */ - content: string; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Required for MX, SRV and URI records; unused by other record types. Records with - * lower priorities are preferred. - */ - priority: number; - - /** - * Record type. - */ - type: 'MX'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export interface DNSRecordsNaptrRecord { - /** - * Components of a NAPTR record. - */ - data: DNSRecordCreateParams.DNSRecordsNaptrRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'NAPTR'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export namespace DNSRecordsNaptrRecord { - /** - * Components of a NAPTR record. - */ - export interface Data { - /** - * Flags. - */ - flags?: string; - - /** - * Order. - */ - order?: number; - - /** - * Preference. - */ - preference?: number; - - /** - * Regex. - */ - regex?: string; - - /** - * Replacement. - */ - replacement?: string; - - /** - * Service. - */ - service?: string; - } - } - - export interface DNSRecordsNsRecord { - /** - * A valid name server host name. - */ - content: unknown; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'NS'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export interface DNSRecordsPtrRecord { - /** - * Domain name pointing to the address. - */ - content: string; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'PTR'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export interface DNSRecordsSmimeaRecord { - /** - * Components of a SMIMEA record. - */ - data: DNSRecordCreateParams.DNSRecordsSmimeaRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'SMIMEA'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export namespace DNSRecordsSmimeaRecord { - /** - * Components of a SMIMEA record. - */ - export interface Data { - /** - * Certificate. - */ - certificate?: string; - - /** - * Matching Type. - */ - matching_type?: number; - - /** - * Selector. - */ - selector?: number; - - /** - * Usage. - */ - usage?: number; - } - } - - export interface DNSRecordsSrvRecord { - /** - * Components of a SRV record. - */ - data: DNSRecordCreateParams.DNSRecordsSrvRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first - * label is normally a service and the second a protocol name, each starting with - * an underscore. - */ - name: string; - - /** - * Record type. - */ - type: 'SRV'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export namespace DNSRecordsSrvRecord { - /** - * Components of a SRV record. - */ - export interface Data { - /** - * A valid hostname. Deprecated in favor of the regular 'name' outside the data - * map. This data map field represents the remainder of the full 'name' after the - * service and protocol. - */ - name?: string; - - /** - * The port of the service. - */ - port?: number; - - /** - * Required for MX, SRV and URI records; unused by other record types. Records with - * lower priorities are preferred. - */ - priority?: number; - - /** - * A valid protocol, prefixed with an underscore. Deprecated in favor of the - * regular 'name' outside the data map. This data map field normally represents the - * second label of that 'name'. - */ - proto?: string; - - /** - * A service type, prefixed with an underscore. Deprecated in favor of the regular - * 'name' outside the data map. This data map field normally represents the first - * label of that 'name'. - */ - service?: string; - - /** - * A valid hostname. - */ - target?: string; - - /** - * The record weight. - */ - weight?: number; - } - } - - export interface DNSRecordsSshfpRecord { - /** - * Components of a SSHFP record. - */ - data: DNSRecordCreateParams.DNSRecordsSshfpRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'SSHFP'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export namespace DNSRecordsSshfpRecord { - /** - * Components of a SSHFP record. - */ - export interface Data { - /** - * algorithm. - */ - algorithm?: number; - - /** - * fingerprint. - */ - fingerprint?: string; - - /** - * type. - */ - type?: number; - } - } - - export interface DNSRecordsSvcbRecord { - /** - * Components of a SVCB record. - */ - data: DNSRecordCreateParams.DNSRecordsSvcbRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'SVCB'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export namespace DNSRecordsSvcbRecord { - /** - * Components of a SVCB record. - */ - export interface Data { - /** - * priority. - */ - priority?: number; - - /** - * target. - */ - target?: string; - - /** - * value. - */ - value?: string; - } - } - - export interface DNSRecordsTlsaRecord { - /** - * Components of a TLSA record. - */ - data: DNSRecordCreateParams.DNSRecordsTlsaRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'TLSA'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export namespace DNSRecordsTlsaRecord { - /** - * Components of a TLSA record. - */ - export interface Data { - /** - * certificate. - */ - certificate?: string; - - /** - * Matching Type. - */ - matching_type?: number; - - /** - * Selector. - */ - selector?: number; - - /** - * Usage. - */ - usage?: number; - } - } - - export interface DNSRecordsTxtRecord { - /** - * Text content for the record. - */ - content: string; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'TXT'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export interface DNSRecordsUriRecord { - /** - * Components of a URI record. - */ - data: DNSRecordCreateParams.DNSRecordsUriRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Required for MX, SRV and URI records; unused by other record types. Records with - * lower priorities are preferred. - */ - priority: number; - - /** - * Record type. - */ - type: 'URI'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export namespace DNSRecordsUriRecord { - /** - * Components of a URI record. - */ - export interface Data { - /** - * The record content. - */ - content?: string; - - /** - * The record weight. - */ - weight?: number; - } - } -} - -export type DNSRecordUpdateParams = - | DNSRecordUpdateParams.DNSRecordsARecord - | DNSRecordUpdateParams.DNSRecordsAaaaRecord - | DNSRecordUpdateParams.DNSRecordsCaaRecord - | DNSRecordUpdateParams.DNSRecordsCertRecord - | DNSRecordUpdateParams.DNSRecordsCnameRecord - | DNSRecordUpdateParams.DNSRecordsDnskeyRecord - | DNSRecordUpdateParams.DNSRecordsDsRecord - | DNSRecordUpdateParams.DNSRecordsHTTPSRecord - | DNSRecordUpdateParams.DNSRecordsLocRecord - | DNSRecordUpdateParams.DNSRecordsMxRecord - | DNSRecordUpdateParams.DNSRecordsNaptrRecord - | DNSRecordUpdateParams.DNSRecordsNsRecord - | DNSRecordUpdateParams.DNSRecordsPtrRecord - | DNSRecordUpdateParams.DNSRecordsSmimeaRecord - | DNSRecordUpdateParams.DNSRecordsSrvRecord - | DNSRecordUpdateParams.DNSRecordsSshfpRecord - | DNSRecordUpdateParams.DNSRecordsSvcbRecord - | DNSRecordUpdateParams.DNSRecordsTlsaRecord - | DNSRecordUpdateParams.DNSRecordsTxtRecord - | DNSRecordUpdateParams.DNSRecordsUriRecord; - -export namespace DNSRecordUpdateParams { - export interface DNSRecordsARecord { - /** - * A valid IPv4 address. - */ - content: string; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'A'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Whether the record is receiving the performance and security benefits of - * Cloudflare. - */ - proxied?: boolean; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export interface DNSRecordsAaaaRecord { - /** - * A valid IPv6 address. - */ - content: string; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'AAAA'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Whether the record is receiving the performance and security benefits of - * Cloudflare. - */ - proxied?: boolean; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export interface DNSRecordsCaaRecord { - /** - * Components of a CAA record. - */ - data: DNSRecordUpdateParams.DNSRecordsCaaRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'CAA'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export namespace DNSRecordsCaaRecord { - /** - * Components of a CAA record. - */ - export interface Data { - /** - * Flags for the CAA record. - */ - flags?: number; - - /** - * Name of the property controlled by this record (e.g.: issue, issuewild, iodef). - */ - tag?: string; - - /** - * Value of the record. This field's semantics depend on the chosen tag. - */ - value?: string; - } - } - - export interface DNSRecordsCertRecord { - /** - * Components of a CERT record. - */ - data: DNSRecordUpdateParams.DNSRecordsCertRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'CERT'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export namespace DNSRecordsCertRecord { - /** - * Components of a CERT record. - */ - export interface Data { - /** - * Algorithm. - */ - algorithm?: number; - - /** - * Certificate. - */ - certificate?: string; - - /** - * Key Tag. - */ - key_tag?: number; - - /** - * Type. - */ - type?: number; - } - } - - export interface DNSRecordsCnameRecord { - /** - * A valid hostname. Must not match the record's name. - */ - content: unknown; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'CNAME'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Whether the record is receiving the performance and security benefits of - * Cloudflare. - */ - proxied?: boolean; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export interface DNSRecordsDnskeyRecord { - /** - * Components of a DNSKEY record. - */ - data: DNSRecordUpdateParams.DNSRecordsDnskeyRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'DNSKEY'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export namespace DNSRecordsDnskeyRecord { - /** - * Components of a DNSKEY record. - */ - export interface Data { - /** - * Algorithm. - */ - algorithm?: number; - - /** - * Flags. - */ - flags?: number; - - /** - * Protocol. - */ - protocol?: number; - - /** - * Public Key. - */ - public_key?: string; - } - } - - export interface DNSRecordsDsRecord { - /** - * Components of a DS record. - */ - data: DNSRecordUpdateParams.DNSRecordsDsRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'DS'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export namespace DNSRecordsDsRecord { - /** - * Components of a DS record. - */ - export interface Data { - /** - * Algorithm. - */ - algorithm?: number; - - /** - * Digest. - */ - digest?: string; - - /** - * Digest Type. - */ - digest_type?: number; - - /** - * Key Tag. - */ - key_tag?: number; - } - } - - export interface DNSRecordsHTTPSRecord { - /** - * Components of a HTTPS record. - */ - data: DNSRecordUpdateParams.DNSRecordsHTTPSRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'HTTPS'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export namespace DNSRecordsHTTPSRecord { - /** - * Components of a HTTPS record. - */ - export interface Data { - /** - * priority. - */ - priority?: number; - - /** - * target. - */ - target?: string; - - /** - * value. - */ - value?: string; - } - } - - export interface DNSRecordsLocRecord { - /** - * Components of a LOC record. - */ - data: DNSRecordUpdateParams.DNSRecordsLocRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'LOC'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export namespace DNSRecordsLocRecord { - /** - * Components of a LOC record. - */ - export interface Data { - /** - * Altitude of location in meters. - */ - altitude?: number; - - /** - * Degrees of latitude. - */ - lat_degrees?: number; - - /** - * Latitude direction. - */ - lat_direction?: 'N' | 'S'; - - /** - * Minutes of latitude. - */ - lat_minutes?: number; - - /** - * Seconds of latitude. - */ - lat_seconds?: number; - - /** - * Degrees of longitude. - */ - long_degrees?: number; - - /** - * Longitude direction. - */ - long_direction?: 'E' | 'W'; - - /** - * Minutes of longitude. - */ - long_minutes?: number; - - /** - * Seconds of longitude. - */ - long_seconds?: number; - - /** - * Horizontal precision of location. - */ - precision_horz?: number; - - /** - * Vertical precision of location. - */ - precision_vert?: number; - - /** - * Size of location in meters. - */ - size?: number; - } - } - - export interface DNSRecordsMxRecord { - /** - * A valid mail server hostname. - */ - content: string; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Required for MX, SRV and URI records; unused by other record types. Records with - * lower priorities are preferred. - */ - priority: number; - - /** - * Record type. - */ - type: 'MX'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export interface DNSRecordsNaptrRecord { - /** - * Components of a NAPTR record. - */ - data: DNSRecordUpdateParams.DNSRecordsNaptrRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'NAPTR'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export namespace DNSRecordsNaptrRecord { - /** - * Components of a NAPTR record. - */ - export interface Data { - /** - * Flags. - */ - flags?: string; - - /** - * Order. - */ - order?: number; - - /** - * Preference. - */ - preference?: number; - - /** - * Regex. - */ - regex?: string; - - /** - * Replacement. - */ - replacement?: string; - - /** - * Service. - */ - service?: string; - } - } - - export interface DNSRecordsNsRecord { - /** - * A valid name server host name. - */ - content: unknown; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'NS'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export interface DNSRecordsPtrRecord { - /** - * Domain name pointing to the address. - */ - content: string; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'PTR'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export interface DNSRecordsSmimeaRecord { - /** - * Components of a SMIMEA record. - */ - data: DNSRecordUpdateParams.DNSRecordsSmimeaRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'SMIMEA'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export namespace DNSRecordsSmimeaRecord { - /** - * Components of a SMIMEA record. - */ - export interface Data { - /** - * Certificate. - */ - certificate?: string; - - /** - * Matching Type. - */ - matching_type?: number; - - /** - * Selector. - */ - selector?: number; - - /** - * Usage. - */ - usage?: number; - } - } - - export interface DNSRecordsSrvRecord { - /** - * Components of a SRV record. - */ - data: DNSRecordUpdateParams.DNSRecordsSrvRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first - * label is normally a service and the second a protocol name, each starting with - * an underscore. - */ - name: string; - - /** - * Record type. - */ - type: 'SRV'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export namespace DNSRecordsSrvRecord { - /** - * Components of a SRV record. - */ - export interface Data { - /** - * A valid hostname. Deprecated in favor of the regular 'name' outside the data - * map. This data map field represents the remainder of the full 'name' after the - * service and protocol. - */ - name?: string; - - /** - * The port of the service. - */ - port?: number; - - /** - * Required for MX, SRV and URI records; unused by other record types. Records with - * lower priorities are preferred. - */ - priority?: number; - - /** - * A valid protocol, prefixed with an underscore. Deprecated in favor of the - * regular 'name' outside the data map. This data map field normally represents the - * second label of that 'name'. - */ - proto?: string; - - /** - * A service type, prefixed with an underscore. Deprecated in favor of the regular - * 'name' outside the data map. This data map field normally represents the first - * label of that 'name'. - */ - service?: string; - - /** - * A valid hostname. - */ - target?: string; - - /** - * The record weight. - */ - weight?: number; - } - } - - export interface DNSRecordsSshfpRecord { - /** - * Components of a SSHFP record. - */ - data: DNSRecordUpdateParams.DNSRecordsSshfpRecord.Data; + lat_seconds?: number; /** - * DNS record name (or @ for the zone apex) in Punycode. + * Degrees of longitude. */ - name: string; + long_degrees?: number; /** - * Record type. + * Longitude direction. */ - type: 'SSHFP'; + long_direction?: 'E' | 'W'; /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. + * Minutes of longitude. */ - comment?: string; + long_minutes?: number; /** - * Custom tags for the DNS record. This field has no effect on DNS responses. + * Seconds of longitude. */ - tags?: Array; + long_seconds?: number; /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. + * Matching Type. */ - ttl?: number | 1; - } + matching_type?: number; - export namespace DNSRecordsSshfpRecord { /** - * Components of a SSHFP record. + * A valid hostname. Deprecated in favor of the regular 'name' outside the data + * map. This data map field represents the remainder of the full 'name' after the + * service and protocol. */ - export interface Data { - /** - * algorithm. - */ - algorithm?: number; - - /** - * fingerprint. - */ - fingerprint?: string; - - /** - * type. - */ - type?: number; - } - } + name?: string; - export interface DNSRecordsSvcbRecord { /** - * Components of a SVCB record. + * Order. */ - data: DNSRecordUpdateParams.DNSRecordsSvcbRecord.Data; + order?: number; /** - * DNS record name (or @ for the zone apex) in Punycode. + * The port of the service. */ - name: string; + port?: number; /** - * Record type. + * Horizontal precision of location. */ - type: 'SVCB'; + precision_horz?: number; /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. + * Vertical precision of location. */ - comment?: string; + precision_vert?: number; /** - * Custom tags for the DNS record. This field has no effect on DNS responses. + * Preference. */ - tags?: Array; + preference?: number; /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. + * priority. */ - ttl?: number | 1; - } + priority?: number; - export namespace DNSRecordsSvcbRecord { /** - * Components of a SVCB record. + * A valid protocol, prefixed with an underscore. Deprecated in favor of the + * regular 'name' outside the data map. This data map field normally represents the + * second label of that 'name'. */ - export interface Data { - /** - * priority. - */ - priority?: number; - - /** - * target. - */ - target?: string; - - /** - * value. - */ - value?: string; - } - } + proto?: string; - export interface DNSRecordsTlsaRecord { /** - * Components of a TLSA record. + * Protocol. */ - data: DNSRecordUpdateParams.DNSRecordsTlsaRecord.Data; + protocol?: number; /** - * DNS record name (or @ for the zone apex) in Punycode. + * Public Key. */ - name: string; + public_key?: string; /** - * Record type. + * Regex. */ - type: 'TLSA'; + regex?: string; /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. + * Replacement. */ - comment?: string; + replacement?: string; /** - * Custom tags for the DNS record. This field has no effect on DNS responses. + * Selector. */ - tags?: Array; + selector?: number; /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. + * A service type, prefixed with an underscore. Deprecated in favor of the regular + * 'name' outside the data map. This data map field normally represents the first + * label of that 'name'. */ - ttl?: number | 1; - } + service?: string; - export namespace DNSRecordsTlsaRecord { /** - * Components of a TLSA record. + * Size of location in meters. */ - export interface Data { - /** - * certificate. - */ - certificate?: string; - - /** - * Matching Type. - */ - matching_type?: number; - - /** - * Selector. - */ - selector?: number; - - /** - * Usage. - */ - usage?: number; - } - } + size?: number; - export interface DNSRecordsTxtRecord { /** - * Text content for the record. + * Name of the property controlled by this record (e.g.: issue, issuewild, iodef). */ - content: string; + tag?: string; /** - * DNS record name (or @ for the zone apex) in Punycode. + * target. */ - name: string; + target?: string; /** - * Record type. + * type. */ - type: 'TXT'; + type?: number; /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. + * Usage. */ - comment?: string; + usage?: number; /** - * Custom tags for the DNS record. This field has no effect on DNS responses. + * value. */ - tags?: Array; + value?: string; /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. + * The record weight. */ - ttl?: number | 1; + weight?: number; } - export interface DNSRecordsUriRecord { - /** - * Components of a URI record. - */ - data: DNSRecordUpdateParams.DNSRecordsUriRecord.Data; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Required for MX, SRV and URI records; unused by other record types. Records with - * lower priorities are preferred. - */ - priority: number; - - /** - * Record type. - */ - type: 'URI'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - + export interface Meta { /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. + * Will exist if Cloudflare automatically added this DNS record during initial + * setup. */ - ttl?: number | 1; - } + auto_added?: boolean; - export namespace DNSRecordsUriRecord { /** - * Components of a URI record. + * Where the record originated from. */ - export interface Data { - /** - * The record content. - */ - content?: string; - - /** - * The record weight. - */ - weight?: number; - } + source?: string; } } diff --git a/src/resources/firewalls/access-rules.ts b/src/resources/firewalls/access-rules.ts index 3bc0e440f1..61595c16f2 100644 --- a/src/resources/firewalls/access-rules.ts +++ b/src/resources/firewalls/access-rules.ts @@ -2,7 +2,6 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; import * as AccessRulesAPI from 'cloudflare/resources/firewalls/access-rules'; import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination'; @@ -15,13 +14,12 @@ export class AccessRules extends APIResource { * [IP Access rules for a zone](#ip-access-rules-for-a-zone) endpoints. */ create( - accountOrZone: string, - accountOrZoneId: unknown, - body: AccessRuleCreateParams, + params: AccessRuleCreateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.post(`/${accountOrZone}/${accountOrZoneId}/firewall/access_rules/rules`, { + this._client.post(`/${account_id}/${zone_id}/firewall/access_rules/rules`, { body, ...options, }) as Core.APIPromise<{ result: AccessRuleCreateResponse | null }> @@ -34,27 +32,12 @@ export class AccessRules extends APIResource { * parameters. */ list( - accountOrZone: string, - accountOrZoneId: unknown, - query?: AccessRuleListParams, - options?: Core.RequestOptions, - ): Core.PagePromise; - list( - accountOrZone: string, - accountOrZoneId: unknown, - options?: Core.RequestOptions, - ): Core.PagePromise; - list( - accountOrZone: string, - accountOrZoneId: unknown, - query: AccessRuleListParams | Core.RequestOptions = {}, + params: AccessRuleListParams, options?: Core.RequestOptions, ): Core.PagePromise { - if (isRequestOptions(query)) { - return this.list(accountOrZone, accountOrZoneId, {}, query); - } + const { account_id, zone_id, ...query } = params; return this._client.getAPIList( - `/${accountOrZone}/${accountOrZoneId}/firewall/access_rules/rules`, + `/${account_id}/${zone_id}/firewall/access_rules/rules`, AccessRuleListResponsesV4PagePaginationArray, { query, ...options }, ); @@ -66,14 +49,14 @@ export class AccessRules extends APIResource { * Note: This operation will affect all zones in the account or zone. */ delete( - accountOrZone: string, - accountOrZoneId: unknown, identifier: unknown, + params: AccessRuleDeleteParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( this._client.delete( - `/${accountOrZone}/${accountOrZoneId}/firewall/access_rules/rules/${identifier}`, + `/${account_id}/${zone_id}/firewall/access_rules/rules/${identifier}`, options, ) as Core.APIPromise<{ result: AccessRuleDeleteResponse | null }> )._thenUnwrap((obj) => obj.result); @@ -102,14 +85,14 @@ export class AccessRules extends APIResource { * Fetches the details of an IP Access rule defined. */ get( - accountOrZone: string, - accountOrZoneId: unknown, identifier: unknown, + params: AccessRuleGetParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( this._client.get( - `/${accountOrZone}/${accountOrZoneId}/firewall/access_rules/rules/${identifier}`, + `/${account_id}/${zone_id}/firewall/access_rules/rules/${identifier}`, options, ) as Core.APIPromise<{ result: AccessRuleGetResponse | null }> )._thenUnwrap((obj) => obj.result); @@ -135,7 +118,19 @@ export type AccessRuleGetResponse = unknown | string; export interface AccessRuleCreateParams { /** - * The rule configuration. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: unknown; + + /** + * Body param: The rule configuration. */ configuration: | AccessRuleCreateParams.LegacyJhsIPConfiguration @@ -145,12 +140,13 @@ export interface AccessRuleCreateParams { | AccessRuleCreateParams.LegacyJhsCountryConfiguration; /** - * The action to apply to a matched request. + * Body param: The action to apply to a matched request. */ mode: 'block' | 'challenge' | 'whitelist' | 'js_challenge' | 'managed_challenge'; /** - * An informative summary of the rule, typically used as a reminder or explanation. + * Body param: An informative summary of the rule, typically used as a reminder or + * explanation. */ notes?: string; } @@ -227,16 +223,34 @@ export namespace AccessRuleCreateParams { export interface AccessRuleListParams extends V4PagePaginationArrayParams { /** - * The direction used to sort returned rules. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: unknown; + + /** + * Query param: The direction used to sort returned rules. */ direction?: 'asc' | 'desc'; + /** + * Query param: + */ 'egs-pagination'?: AccessRuleListParams.EgsPagination; + /** + * Query param: + */ filters?: AccessRuleListParams.Filters; /** - * The field used to sort returned rules. + * Query param: The field used to sort returned rules. */ order?: 'configuration.target' | 'configuration.value' | 'mode'; } @@ -295,6 +309,18 @@ export namespace AccessRuleListParams { } } +export interface AccessRuleDeleteParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: unknown; +} + export interface AccessRuleEditParams { /** * Path param: @@ -393,6 +419,18 @@ export namespace AccessRuleEditParams { } } +export interface AccessRuleGetParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: unknown; +} + export namespace AccessRules { export import AccessRuleCreateResponse = AccessRulesAPI.AccessRuleCreateResponse; export import AccessRuleListResponse = AccessRulesAPI.AccessRuleListResponse; @@ -402,5 +440,7 @@ export namespace AccessRules { export import AccessRuleListResponsesV4PagePaginationArray = AccessRulesAPI.AccessRuleListResponsesV4PagePaginationArray; export import AccessRuleCreateParams = AccessRulesAPI.AccessRuleCreateParams; export import AccessRuleListParams = AccessRulesAPI.AccessRuleListParams; + export import AccessRuleDeleteParams = AccessRulesAPI.AccessRuleDeleteParams; export import AccessRuleEditParams = AccessRulesAPI.AccessRuleEditParams; + export import AccessRuleGetParams = AccessRulesAPI.AccessRuleGetParams; } diff --git a/src/resources/firewalls/firewalls.ts b/src/resources/firewalls/firewalls.ts index 354807dae7..95e79eac90 100644 --- a/src/resources/firewalls/firewalls.ts +++ b/src/resources/firewalls/firewalls.ts @@ -48,7 +48,9 @@ export namespace Firewalls { export import AccessRuleListResponsesV4PagePaginationArray = AccessRulesAPI.AccessRuleListResponsesV4PagePaginationArray; export import AccessRuleCreateParams = AccessRulesAPI.AccessRuleCreateParams; export import AccessRuleListParams = AccessRulesAPI.AccessRuleListParams; + export import AccessRuleDeleteParams = AccessRulesAPI.AccessRuleDeleteParams; export import AccessRuleEditParams = AccessRulesAPI.AccessRuleEditParams; + export import AccessRuleGetParams = AccessRulesAPI.AccessRuleGetParams; export import UaRules = UaRulesAPI.UaRules; export import UaRuleCreateResponse = UaRulesAPI.UaRuleCreateResponse; export import UaRuleUpdateResponse = UaRulesAPI.UaRuleUpdateResponse; diff --git a/src/resources/firewalls/index.ts b/src/resources/firewalls/index.ts index 26b6cf16f8..dc52b056f0 100644 --- a/src/resources/firewalls/index.ts +++ b/src/resources/firewalls/index.ts @@ -8,7 +8,9 @@ export { AccessRuleGetResponse, AccessRuleCreateParams, AccessRuleListParams, + AccessRuleDeleteParams, AccessRuleEditParams, + AccessRuleGetParams, AccessRuleListResponsesV4PagePaginationArray, AccessRules, } from './access-rules'; diff --git a/src/resources/images/v1s/v1s.ts b/src/resources/images/v1s/v1s.ts index 1d9588af63..512f99fedf 100644 --- a/src/resources/images/v1s/v1s.ts +++ b/src/resources/images/v1s/v1s.ts @@ -281,22 +281,13 @@ export interface V1GetResponse { variants?: Array; } -export type V1CreateParams = V1CreateParams.ImagesImageUploadViaFile | V1CreateParams.ImagesImageUploadViaURL; - -export namespace V1CreateParams { - export interface ImagesImageUploadViaFile { - /** - * An image binary data. - */ - file: unknown; - } +export interface V1CreateParams { + metadata?: unknown; - export interface ImagesImageUploadViaURL { - /** - * A URL to fetch an image from origin. - */ - url: string; - } + /** + * Indicates whether the image requires a signature token for the access. + */ + requireSignedURLs?: boolean; } export interface V1ListParams extends V4PagePaginationParams {} diff --git a/src/resources/index.ts b/src/resources/index.ts index b18692be4b..02dbfca470 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -46,7 +46,6 @@ export { } from './bot-management'; export { BrandProtection } from './brand-protection/brand-protection'; export { CachePurgeResponse, CachePurgeParams, Cache } from './cache/cache'; -export { CacheReserveCreateResponse, CacheReserveGetResponse, CacheReserve } from './cache-reserve'; export { CallCreateResponse, CallUpdateResponse, @@ -297,6 +296,9 @@ export { RulesetGetResponse, RulesetCreateParams, RulesetUpdateParams, + RulesetListParams, + RulesetDeleteParams, + RulesetGetParams, Rulesets, } from './rulesets/rulesets'; export { Rum } from './rum/rum'; diff --git a/src/resources/logpush/datasets/datasets.ts b/src/resources/logpush/datasets/datasets.ts index 17a2133884..6996997fca 100644 --- a/src/resources/logpush/datasets/datasets.ts +++ b/src/resources/logpush/datasets/datasets.ts @@ -12,6 +12,8 @@ export class Datasets extends APIResource { export namespace Datasets { export import Fields = FieldsAPI.Fields; export import FieldListResponse = FieldsAPI.FieldListResponse; + export import FieldListParams = FieldsAPI.FieldListParams; export import Jobs = JobsAPI.Jobs; export import JobListResponse = JobsAPI.JobListResponse; + export import JobListParams = JobsAPI.JobListParams; } diff --git a/src/resources/logpush/datasets/fields.ts b/src/resources/logpush/datasets/fields.ts index 77f75e279d..2363c274e3 100644 --- a/src/resources/logpush/datasets/fields.ts +++ b/src/resources/logpush/datasets/fields.ts @@ -10,14 +10,14 @@ export class Fields extends APIResource { * key-value pairs, where keys are field names, and values are descriptions. */ list( - accountOrZone: string, - accountOrZoneId: string, datasetId: string | null, + params: FieldListParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( this._client.get( - `/${accountOrZone}/${accountOrZoneId}/logpush/datasets/${datasetId}/fields`, + `/${account_id}/${zone_id}/logpush/datasets/${datasetId}/fields`, options, ) as Core.APIPromise<{ result: FieldListResponse }> )._thenUnwrap((obj) => obj.result); @@ -26,6 +26,19 @@ export class Fields extends APIResource { export type FieldListResponse = unknown; +export interface FieldListParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + export namespace Fields { export import FieldListResponse = FieldsAPI.FieldListResponse; + export import FieldListParams = FieldsAPI.FieldListParams; } diff --git a/src/resources/logpush/datasets/index.ts b/src/resources/logpush/datasets/index.ts index ab4e7e637a..5313924c69 100644 --- a/src/resources/logpush/datasets/index.ts +++ b/src/resources/logpush/datasets/index.ts @@ -1,5 +1,5 @@ // File generated from our OpenAPI spec by Stainless. export { Datasets } from './datasets'; -export { FieldListResponse, Fields } from './fields'; -export { JobListResponse, Jobs } from './jobs'; +export { FieldListResponse, FieldListParams, Fields } from './fields'; +export { JobListResponse, JobListParams, Jobs } from './jobs'; diff --git a/src/resources/logpush/datasets/jobs.ts b/src/resources/logpush/datasets/jobs.ts index 138580bc59..e2b18737d6 100644 --- a/src/resources/logpush/datasets/jobs.ts +++ b/src/resources/logpush/datasets/jobs.ts @@ -9,14 +9,14 @@ export class Jobs extends APIResource { * Lists Logpush jobs for an account or zone for a dataset. */ list( - accountOrZone: string, - accountOrZoneId: string, datasetId: string | null, + params: JobListParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( this._client.get( - `/${accountOrZone}/${accountOrZoneId}/logpush/datasets/${datasetId}/jobs`, + `/${account_id}/${zone_id}/logpush/datasets/${datasetId}/jobs`, options, ) as Core.APIPromise<{ result: JobListResponse }> )._thenUnwrap((obj) => obj.result); @@ -181,6 +181,19 @@ export namespace JobListResponse { } } +export interface JobListParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + export namespace Jobs { export import JobListResponse = JobsAPI.JobListResponse; + export import JobListParams = JobsAPI.JobListParams; } diff --git a/src/resources/logpush/index.ts b/src/resources/logpush/index.ts index 4ff05b403a..85c05de99c 100644 --- a/src/resources/logpush/index.ts +++ b/src/resources/logpush/index.ts @@ -10,6 +10,9 @@ export { JobGetResponse, JobCreateParams, JobUpdateParams, + JobListParams, + JobDeleteParams, + JobGetParams, Jobs, } from './jobs'; export { Logpush } from './logpush'; diff --git a/src/resources/logpush/jobs.ts b/src/resources/logpush/jobs.ts index ac028205b1..80d2da378c 100644 --- a/src/resources/logpush/jobs.ts +++ b/src/resources/logpush/jobs.ts @@ -8,17 +8,12 @@ export class Jobs extends APIResource { /** * Creates a new Logpush job for an account or zone. */ - create( - accountOrZone: string, - accountOrZoneId: string, - body: JobCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + create(params: JobCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.post(`/${accountOrZone}/${accountOrZoneId}/logpush/jobs`, { - body, - ...options, - }) as Core.APIPromise<{ result: JobCreateResponse | null }> + this._client.post(`/${account_id}/${zone_id}/logpush/jobs`, { body, ...options }) as Core.APIPromise<{ + result: JobCreateResponse | null; + }> )._thenUnwrap((obj) => obj.result); } @@ -26,14 +21,13 @@ export class Jobs extends APIResource { * Updates a Logpush job. */ update( - accountOrZone: string, - accountOrZoneId: string, jobId: number, - body: JobUpdateParams, + params: JobUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/logpush/jobs/${jobId}`, { + this._client.put(`/${account_id}/${zone_id}/logpush/jobs/${jobId}`, { body, ...options, }) as Core.APIPromise<{ result: JobUpdateResponse | null }> @@ -43,13 +37,10 @@ export class Jobs extends APIResource { /** * Lists Logpush jobs for an account or zone. */ - list( - accountOrZone: string, - accountOrZoneId: string, - options?: Core.RequestOptions, - ): Core.APIPromise { + list(params: JobListParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.get(`/${accountOrZone}/${accountOrZoneId}/logpush/jobs`, options) as Core.APIPromise<{ + this._client.get(`/${account_id}/${zone_id}/logpush/jobs`, options) as Core.APIPromise<{ result: JobListResponse; }> )._thenUnwrap((obj) => obj.result); @@ -59,16 +50,15 @@ export class Jobs extends APIResource { * Deletes a Logpush job. */ delete( - accountOrZone: string, - accountOrZoneId: string, jobId: number, + params: JobDeleteParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.delete( - `/${accountOrZone}/${accountOrZoneId}/logpush/jobs/${jobId}`, - options, - ) as Core.APIPromise<{ result: JobDeleteResponse | null }> + this._client.delete(`/${account_id}/${zone_id}/logpush/jobs/${jobId}`, options) as Core.APIPromise<{ + result: JobDeleteResponse | null; + }> )._thenUnwrap((obj) => obj.result); } @@ -76,16 +66,15 @@ export class Jobs extends APIResource { * Gets the details of a Logpush job. */ get( - accountOrZone: string, - accountOrZoneId: string, jobId: number, + params: JobGetParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.get( - `/${accountOrZone}/${accountOrZoneId}/logpush/jobs/${jobId}`, - options, - ) as Core.APIPromise<{ result: JobGetResponse | null }> + this._client.get(`/${account_id}/${zone_id}/logpush/jobs/${jobId}`, options) as Core.APIPromise<{ + result: JobGetResponse | null; + }> )._thenUnwrap((obj) => obj.result); } } @@ -714,53 +703,66 @@ export namespace JobGetResponse { export interface JobCreateParams { /** - * Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - * Additional configuration parameters supported by the destination may be - * included. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: Uniquely identifies a resource (such as an s3 bucket) where data + * will be pushed. Additional configuration parameters supported by the destination + * may be included. */ destination_conf: string; /** - * Name of the dataset. + * Body param: Name of the dataset. */ dataset?: string | null; /** - * Flag that indicates if the job is enabled. + * Body param: Flag that indicates if the job is enabled. */ enabled?: boolean; /** - * The frequency at which Cloudflare sends batches of logs to your destination. - * Setting frequency to high sends your logs in larger quantities of smaller files. - * Setting frequency to low sends logs in smaller quantities of larger files. + * Body param: The frequency at which Cloudflare sends batches of logs to your + * destination. Setting frequency to high sends your logs in larger quantities of + * smaller files. Setting frequency to low sends logs in smaller quantities of + * larger files. */ frequency?: 'high' | 'low' | null; /** - * This field is deprecated. Use `output_options` instead. Configuration string. It - * specifies things like requested fields and timestamp formats. If migrating from - * the logpull api, copy the url (full url or just the query string) of your call - * here, and logpush will keep on making this call for you, setting start and end - * times appropriately. + * Body param: This field is deprecated. Use `output_options` instead. + * Configuration string. It specifies things like requested fields and timestamp + * formats. If migrating from the logpull api, copy the url (full url or just the + * query string) of your call here, and logpush will keep on making this call for + * you, setting start and end times appropriately. */ logpull_options?: string | null; /** - * Optional human readable job name. Not unique. Cloudflare suggests that you set - * this to a meaningful string, like the domain name, to make it easier to identify - * your job. + * Body param: Optional human readable job name. Not unique. Cloudflare suggests + * that you set this to a meaningful string, like the domain name, to make it + * easier to identify your job. */ name?: string | null; /** - * The structured replacement for `logpull_options`. When including this field, the - * `logpull_option` field will be ignored. + * Body param: The structured replacement for `logpull_options`. When including + * this field, the `logpull_option` field will be ignored. */ output_options?: JobCreateParams.OutputOptions | null; /** - * Ownership challenge token to prove destination ownership. + * Body param: Ownership challenge token to prove destination ownership. */ ownership_challenge?: string; } @@ -845,41 +847,54 @@ export namespace JobCreateParams { export interface JobUpdateParams { /** - * Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - * Additional configuration parameters supported by the destination may be - * included. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: Uniquely identifies a resource (such as an s3 bucket) where data + * will be pushed. Additional configuration parameters supported by the destination + * may be included. */ destination_conf?: string; /** - * Flag that indicates if the job is enabled. + * Body param: Flag that indicates if the job is enabled. */ enabled?: boolean; /** - * The frequency at which Cloudflare sends batches of logs to your destination. - * Setting frequency to high sends your logs in larger quantities of smaller files. - * Setting frequency to low sends logs in smaller quantities of larger files. + * Body param: The frequency at which Cloudflare sends batches of logs to your + * destination. Setting frequency to high sends your logs in larger quantities of + * smaller files. Setting frequency to low sends logs in smaller quantities of + * larger files. */ frequency?: 'high' | 'low' | null; /** - * This field is deprecated. Use `output_options` instead. Configuration string. It - * specifies things like requested fields and timestamp formats. If migrating from - * the logpull api, copy the url (full url or just the query string) of your call - * here, and logpush will keep on making this call for you, setting start and end - * times appropriately. + * Body param: This field is deprecated. Use `output_options` instead. + * Configuration string. It specifies things like requested fields and timestamp + * formats. If migrating from the logpull api, copy the url (full url or just the + * query string) of your call here, and logpush will keep on making this call for + * you, setting start and end times appropriately. */ logpull_options?: string | null; /** - * The structured replacement for `logpull_options`. When including this field, the - * `logpull_option` field will be ignored. + * Body param: The structured replacement for `logpull_options`. When including + * this field, the `logpull_option` field will be ignored. */ output_options?: JobUpdateParams.OutputOptions | null; /** - * Ownership challenge token to prove destination ownership. + * Body param: Ownership challenge token to prove destination ownership. */ ownership_challenge?: string; } @@ -962,6 +977,42 @@ export namespace JobUpdateParams { } } +export interface JobListParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + +export interface JobDeleteParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + +export interface JobGetParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + export namespace Jobs { export import JobCreateResponse = JobsAPI.JobCreateResponse; export import JobUpdateResponse = JobsAPI.JobUpdateResponse; @@ -970,4 +1021,7 @@ export namespace Jobs { export import JobGetResponse = JobsAPI.JobGetResponse; export import JobCreateParams = JobsAPI.JobCreateParams; export import JobUpdateParams = JobsAPI.JobUpdateParams; + export import JobListParams = JobsAPI.JobListParams; + export import JobDeleteParams = JobsAPI.JobDeleteParams; + export import JobGetParams = JobsAPI.JobGetParams; } diff --git a/src/resources/logpush/logpush.ts b/src/resources/logpush/logpush.ts index 780ca0f685..6a9542a246 100644 --- a/src/resources/logpush/logpush.ts +++ b/src/resources/logpush/logpush.ts @@ -29,6 +29,9 @@ export namespace Logpush { export import JobGetResponse = JobsAPI.JobGetResponse; export import JobCreateParams = JobsAPI.JobCreateParams; export import JobUpdateParams = JobsAPI.JobUpdateParams; + export import JobListParams = JobsAPI.JobListParams; + export import JobDeleteParams = JobsAPI.JobDeleteParams; + export import JobGetParams = JobsAPI.JobGetParams; export import Ownership = OwnershipAPI.Ownership; export import OwnershipCreateResponse = OwnershipAPI.OwnershipCreateResponse; export import OwnershipValidateResponse = OwnershipAPI.OwnershipValidateResponse; diff --git a/src/resources/logpush/ownership.ts b/src/resources/logpush/ownership.ts index 1dd743c427..d5ec17f45d 100644 --- a/src/resources/logpush/ownership.ts +++ b/src/resources/logpush/ownership.ts @@ -9,13 +9,12 @@ export class Ownership extends APIResource { * Gets a new ownership challenge sent to your destination. */ create( - accountOrZone: string, - accountOrZoneId: string, - body: OwnershipCreateParams, + params: OwnershipCreateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.post(`/${accountOrZone}/${accountOrZoneId}/logpush/ownership`, { + this._client.post(`/${account_id}/${zone_id}/logpush/ownership`, { body, ...options, }) as Core.APIPromise<{ result: OwnershipCreateResponse | null }> @@ -26,13 +25,12 @@ export class Ownership extends APIResource { * Validates ownership challenge of the destination. */ validate( - accountOrZone: string, - accountOrZoneId: string, - body: OwnershipValidateParams, + params: OwnershipValidateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.post(`/${accountOrZone}/${accountOrZoneId}/logpush/ownership/validate`, { + this._client.post(`/${account_id}/${zone_id}/logpush/ownership/validate`, { body, ...options, }) as Core.APIPromise<{ result: OwnershipValidateResponse | null }> @@ -54,23 +52,47 @@ export interface OwnershipValidateResponse { export interface OwnershipCreateParams { /** - * Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - * Additional configuration parameters supported by the destination may be - * included. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: Uniquely identifies a resource (such as an s3 bucket) where data + * will be pushed. Additional configuration parameters supported by the destination + * may be included. */ destination_conf: string; } export interface OwnershipValidateParams { /** - * Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - * Additional configuration parameters supported by the destination may be - * included. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: Uniquely identifies a resource (such as an s3 bucket) where data + * will be pushed. Additional configuration parameters supported by the destination + * may be included. */ destination_conf: string; /** - * Ownership challenge token to prove destination ownership. + * Body param: Ownership challenge token to prove destination ownership. */ ownership_challenge: string; } diff --git a/src/resources/logpush/validate.ts b/src/resources/logpush/validate.ts index 679fcc414f..16ae3190d1 100644 --- a/src/resources/logpush/validate.ts +++ b/src/resources/logpush/validate.ts @@ -9,13 +9,12 @@ export class Validate extends APIResource { * Checks if there is an existing job with a destination. */ destination( - accountOrZone: string, - accountOrZoneId: string, - body: ValidateDestinationParams, + params: ValidateDestinationParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.post(`/${accountOrZone}/${accountOrZoneId}/logpush/validate/destination/exists`, { + this._client.post(`/${account_id}/${zone_id}/logpush/validate/destination/exists`, { body, ...options, }) as Core.APIPromise<{ result: ValidateDestinationResponse | null }> @@ -26,13 +25,12 @@ export class Validate extends APIResource { * Validates logpull origin with logpull_options. */ origin( - accountOrZone: string, - accountOrZoneId: string, - body: ValidateOriginParams, + params: ValidateOriginParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.post(`/${accountOrZone}/${accountOrZoneId}/logpush/validate/origin`, { + this._client.post(`/${account_id}/${zone_id}/logpush/validate/origin`, { body, ...options, }) as Core.APIPromise<{ result: ValidateOriginResponse | null }> @@ -52,20 +50,44 @@ export interface ValidateOriginResponse { export interface ValidateDestinationParams { /** - * Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - * Additional configuration parameters supported by the destination may be - * included. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: Uniquely identifies a resource (such as an s3 bucket) where data + * will be pushed. Additional configuration parameters supported by the destination + * may be included. */ destination_conf: string; } export interface ValidateOriginParams { /** - * This field is deprecated. Use `output_options` instead. Configuration string. It - * specifies things like requested fields and timestamp formats. If migrating from - * the logpull api, copy the url (full url or just the query string) of your call - * here, and logpush will keep on making this call for you, setting start and end - * times appropriately. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: This field is deprecated. Use `output_options` instead. + * Configuration string. It specifies things like requested fields and timestamp + * formats. If migrating from the logpull api, copy the url (full url or just the + * query string) of your call here, and logpush will keep on making this call for + * you, setting start and end times appropriately. */ logpull_options: string | null; } diff --git a/src/resources/pcaps/pcaps.ts b/src/resources/pcaps/pcaps.ts index 4432c7002d..bcaca14284 100644 --- a/src/resources/pcaps/pcaps.ts +++ b/src/resources/pcaps/pcaps.ts @@ -53,11 +53,11 @@ export class Pcaps extends APIResource { } export type PcapCreateResponse = - | PcapCreateResponse._3K3498u9PcapsResponseSimple - | PcapCreateResponse._3K3498u9PcapsResponseFull; + | PcapCreateResponse._7Ks0f1TyPcapsResponseSimple + | PcapCreateResponse._7Ks0f1TyPcapsResponseFull; export namespace PcapCreateResponse { - export interface _3K3498u9PcapsResponseSimple { + export interface _7Ks0f1TyPcapsResponseSimple { /** * The ID for the packet capture. */ @@ -66,7 +66,7 @@ export namespace PcapCreateResponse { /** * The packet capture filter. When this field is empty, all packets are captured. */ - filter_v1?: _3K3498u9PcapsResponseSimple.FilterV1; + filter_v1?: _7Ks0f1TyPcapsResponseSimple.FilterV1; /** * The status of the packet capture request. @@ -103,7 +103,7 @@ export namespace PcapCreateResponse { type?: 'simple' | 'full'; } - export namespace _3K3498u9PcapsResponseSimple { + export namespace _7Ks0f1TyPcapsResponseSimple { /** * The packet capture filter. When this field is empty, all packets are captured. */ @@ -135,7 +135,7 @@ export namespace PcapCreateResponse { } } - export interface _3K3498u9PcapsResponseFull { + export interface _7Ks0f1TyPcapsResponseFull { /** * The ID for the packet capture. */ @@ -168,7 +168,7 @@ export namespace PcapCreateResponse { /** * The packet capture filter. When this field is empty, all packets are captured. */ - filter_v1?: _3K3498u9PcapsResponseFull.FilterV1; + filter_v1?: _7Ks0f1TyPcapsResponseFull.FilterV1; /** * The status of the packet capture request. @@ -205,7 +205,7 @@ export namespace PcapCreateResponse { type?: 'simple' | 'full'; } - export namespace _3K3498u9PcapsResponseFull { + export namespace _7Ks0f1TyPcapsResponseFull { /** * The packet capture filter. When this field is empty, all packets are captured. */ @@ -239,11 +239,11 @@ export namespace PcapCreateResponse { } export type PcapListResponse = Array< - PcapListResponse._3K3498u9PcapsResponseSimple | PcapListResponse._3K3498u9PcapsResponseFull + PcapListResponse._7Ks0f1TyPcapsResponseSimple | PcapListResponse._7Ks0f1TyPcapsResponseFull >; export namespace PcapListResponse { - export interface _3K3498u9PcapsResponseSimple { + export interface _7Ks0f1TyPcapsResponseSimple { /** * The ID for the packet capture. */ @@ -252,7 +252,7 @@ export namespace PcapListResponse { /** * The packet capture filter. When this field is empty, all packets are captured. */ - filter_v1?: _3K3498u9PcapsResponseSimple.FilterV1; + filter_v1?: _7Ks0f1TyPcapsResponseSimple.FilterV1; /** * The status of the packet capture request. @@ -289,7 +289,7 @@ export namespace PcapListResponse { type?: 'simple' | 'full'; } - export namespace _3K3498u9PcapsResponseSimple { + export namespace _7Ks0f1TyPcapsResponseSimple { /** * The packet capture filter. When this field is empty, all packets are captured. */ @@ -321,7 +321,7 @@ export namespace PcapListResponse { } } - export interface _3K3498u9PcapsResponseFull { + export interface _7Ks0f1TyPcapsResponseFull { /** * The ID for the packet capture. */ @@ -354,7 +354,7 @@ export namespace PcapListResponse { /** * The packet capture filter. When this field is empty, all packets are captured. */ - filter_v1?: _3K3498u9PcapsResponseFull.FilterV1; + filter_v1?: _7Ks0f1TyPcapsResponseFull.FilterV1; /** * The status of the packet capture request. @@ -391,7 +391,7 @@ export namespace PcapListResponse { type?: 'simple' | 'full'; } - export namespace _3K3498u9PcapsResponseFull { + export namespace _7Ks0f1TyPcapsResponseFull { /** * The packet capture filter. When this field is empty, all packets are captured. */ @@ -425,11 +425,11 @@ export namespace PcapListResponse { } export type PcapGetResponse = - | PcapGetResponse._3K3498u9PcapsResponseSimple - | PcapGetResponse._3K3498u9PcapsResponseFull; + | PcapGetResponse._7Ks0f1TyPcapsResponseSimple + | PcapGetResponse._7Ks0f1TyPcapsResponseFull; export namespace PcapGetResponse { - export interface _3K3498u9PcapsResponseSimple { + export interface _7Ks0f1TyPcapsResponseSimple { /** * The ID for the packet capture. */ @@ -438,7 +438,7 @@ export namespace PcapGetResponse { /** * The packet capture filter. When this field is empty, all packets are captured. */ - filter_v1?: _3K3498u9PcapsResponseSimple.FilterV1; + filter_v1?: _7Ks0f1TyPcapsResponseSimple.FilterV1; /** * The status of the packet capture request. @@ -475,7 +475,7 @@ export namespace PcapGetResponse { type?: 'simple' | 'full'; } - export namespace _3K3498u9PcapsResponseSimple { + export namespace _7Ks0f1TyPcapsResponseSimple { /** * The packet capture filter. When this field is empty, all packets are captured. */ @@ -507,7 +507,7 @@ export namespace PcapGetResponse { } } - export interface _3K3498u9PcapsResponseFull { + export interface _7Ks0f1TyPcapsResponseFull { /** * The ID for the packet capture. */ @@ -540,7 +540,7 @@ export namespace PcapGetResponse { /** * The packet capture filter. When this field is empty, all packets are captured. */ - filter_v1?: _3K3498u9PcapsResponseFull.FilterV1; + filter_v1?: _7Ks0f1TyPcapsResponseFull.FilterV1; /** * The status of the packet capture request. @@ -577,7 +577,7 @@ export namespace PcapGetResponse { type?: 'simple' | 'full'; } - export namespace _3K3498u9PcapsResponseFull { + export namespace _7Ks0f1TyPcapsResponseFull { /** * The packet capture filter. When this field is empty, all packets are captured. */ @@ -610,147 +610,75 @@ export namespace PcapGetResponse { } } -export type PcapCreateParams = - | PcapCreateParams._3K3498u9PcapsRequestSimple - | PcapCreateParams._3K3498u9PcapsRequestFull; - -export namespace PcapCreateParams { - export interface _3K3498u9PcapsRequestSimple { - /** - * The limit of packets contained in a packet capture. - */ - packet_limit: number; - - /** - * The system used to collect packet captures. - */ - system: 'magic-transit'; - - /** - * The packet capture duration in seconds. - */ - time_limit: number; - - /** - * The type of packet capture. `Simple` captures sampled packets, and `full` - * captures entire payloads and non-sampled packets. - */ - type: 'simple' | 'full'; - - /** - * The packet capture filter. When this field is empty, all packets are captured. - */ - filter_v1?: PcapCreateParams._3K3498u9PcapsRequestSimple.FilterV1; - } - - export namespace _3K3498u9PcapsRequestSimple { - /** - * The packet capture filter. When this field is empty, all packets are captured. - */ - export interface FilterV1 { - /** - * The destination IP address of the packet. - */ - destination_address?: string; - - /** - * The destination port of the packet. - */ - destination_port?: number; +export interface PcapCreateParams { + /** + * The system used to collect packet captures. + */ + system: 'magic-transit'; - /** - * The protocol number of the packet. - */ - protocol?: number; + /** + * The packet capture duration in seconds. + */ + time_limit: number; - /** - * The source IP address of the packet. - */ - source_address?: string; + /** + * The type of packet capture. `Simple` captures sampled packets, and `full` + * captures entire payloads and non-sampled packets. + */ + type: 'simple' | 'full'; - /** - * The source port of the packet. - */ - source_port?: number; - } - } + /** + * The maximum number of bytes to capture. This field only applies to `full` packet + * captures. + */ + byte_limit?: number; - export interface _3K3498u9PcapsRequestFull { - /** - * The name of the data center used for the packet capture. This can be a specific - * colo (ord02) or a multi-colo name (ORD). This field only applies to `full` - * packet captures. - */ - colo_name: string; + /** + * The name of the data center used for the packet capture. This can be a specific + * colo (ord02) or a multi-colo name (ORD). This field only applies to `full` + * packet captures. + */ + colo_name?: string; - /** - * The full URI for the bucket. This field only applies to `full` packet captures. - */ - destination_conf: string; + /** + * The full URI for the bucket. This field only applies to `full` packet captures. + */ + destination_conf?: string; - /** - * The system used to collect packet captures. - */ - system: 'magic-transit'; + filter_v1?: PcapCreateParams.FilterV1; - /** - * The packet capture duration in seconds. - */ - time_limit: number; + /** + * The limit of packets contained in a packet capture. + */ + packet_limit?: number; +} +export namespace PcapCreateParams { + export interface FilterV1 { /** - * The type of packet capture. `Simple` captures sampled packets, and `full` - * captures entire payloads and non-sampled packets. + * The destination IP address of the packet. */ - type: 'simple' | 'full'; + destination_address?: string; /** - * The maximum number of bytes to capture. This field only applies to `full` packet - * captures. + * The destination port of the packet. */ - byte_limit?: number; + destination_port?: number; /** - * The packet capture filter. When this field is empty, all packets are captured. + * The protocol number of the packet. */ - filter_v1?: PcapCreateParams._3K3498u9PcapsRequestFull.FilterV1; + protocol?: number; /** - * The limit of packets contained in a packet capture. + * The source IP address of the packet. */ - packet_limit?: number; - } + source_address?: string; - export namespace _3K3498u9PcapsRequestFull { /** - * The packet capture filter. When this field is empty, all packets are captured. + * The source port of the packet. */ - export interface FilterV1 { - /** - * The destination IP address of the packet. - */ - destination_address?: string; - - /** - * The destination port of the packet. - */ - destination_port?: number; - - /** - * The protocol number of the packet. - */ - protocol?: number; - - /** - * The source IP address of the packet. - */ - source_address?: string; - - /** - * The source port of the packet. - */ - source_port?: number; - } + source_port?: number; } } diff --git a/src/resources/r2/index.ts b/src/resources/r2/index.ts index fba55ba957..45a046a56a 100644 --- a/src/resources/r2/index.ts +++ b/src/resources/r2/index.ts @@ -10,3 +10,10 @@ export { Buckets, } from './buckets'; export { R2 } from './r2'; +export { + SippyUpdateResponse, + SippyDeleteResponse, + SippyGetResponse, + SippyUpdateParams, + Sippy, +} from './sippy'; diff --git a/src/resources/r2/r2.ts b/src/resources/r2/r2.ts index 0c04621a95..b59f3959c3 100644 --- a/src/resources/r2/r2.ts +++ b/src/resources/r2/r2.ts @@ -2,9 +2,11 @@ import { APIResource } from 'cloudflare/resource'; import * as BucketsAPI from 'cloudflare/resources/r2/buckets'; +import * as SippyAPI from 'cloudflare/resources/r2/sippy'; export class R2 extends APIResource { buckets: BucketsAPI.Buckets = new BucketsAPI.Buckets(this._client); + sippy: SippyAPI.Sippy = new SippyAPI.Sippy(this._client); } export namespace R2 { @@ -15,4 +17,9 @@ export namespace R2 { export import BucketGetResponse = BucketsAPI.BucketGetResponse; export import BucketCreateParams = BucketsAPI.BucketCreateParams; export import BucketListParams = BucketsAPI.BucketListParams; + export import Sippy = SippyAPI.Sippy; + export import SippyUpdateResponse = SippyAPI.SippyUpdateResponse; + export import SippyDeleteResponse = SippyAPI.SippyDeleteResponse; + export import SippyGetResponse = SippyAPI.SippyGetResponse; + export import SippyUpdateParams = SippyAPI.SippyUpdateParams; } diff --git a/src/resources/r2/sippy.ts b/src/resources/r2/sippy.ts new file mode 100644 index 0000000000..2f8fcf60fd --- /dev/null +++ b/src/resources/r2/sippy.ts @@ -0,0 +1,242 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import * as SippyAPI from 'cloudflare/resources/r2/sippy'; + +export class Sippy extends APIResource { + /** + * Sets configuration for Sippy for an existing R2 bucket. + */ + update( + accountId: string, + bucketName: string, + body: SippyUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/r2/buckets/${bucketName}/sippy`, { + body, + ...options, + }) as Core.APIPromise<{ result: SippyUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Disables Sippy on this bucket + */ + delete( + accountId: string, + bucketName: string, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.delete( + `/accounts/${accountId}/r2/buckets/${bucketName}/sippy`, + options, + ) as Core.APIPromise<{ result: SippyDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Gets configuration for Sippy for an existing R2 bucket. + */ + get( + accountId: string, + bucketName: string, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.get(`/accounts/${accountId}/r2/buckets/${bucketName}/sippy`, options) as Core.APIPromise<{ + result: SippyGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SippyUpdateResponse { + /** + * Details about the configured destination bucket + */ + destination?: SippyUpdateResponse.Destination; + + /** + * State of Sippy for this bucket + */ + enabled?: boolean; + + /** + * Details about the configured source bucket + */ + source?: SippyUpdateResponse.Source; +} + +export namespace SippyUpdateResponse { + /** + * Details about the configured destination bucket + */ + export interface Destination { + /** + * ID of the Cloudflare API token used when writing objects to this bucket + */ + accessKeyId?: string; + + account?: string; + + /** + * Name of the bucket on the provider + */ + bucket?: string; + + provider?: 'r2'; + } + + /** + * Details about the configured source bucket + */ + export interface Source { + /** + * Name of the bucket on the provider + */ + bucket?: string; + + provider?: 'aws' | 'gcs'; + + /** + * Region where the bucket resides (AWS only) + */ + region?: string | null; + } +} + +export interface SippyDeleteResponse { + enabled?: false; +} + +export interface SippyGetResponse { + /** + * Details about the configured destination bucket + */ + destination?: SippyGetResponse.Destination; + + /** + * State of Sippy for this bucket + */ + enabled?: boolean; + + /** + * Details about the configured source bucket + */ + source?: SippyGetResponse.Source; +} + +export namespace SippyGetResponse { + /** + * Details about the configured destination bucket + */ + export interface Destination { + /** + * ID of the Cloudflare API token used when writing objects to this bucket + */ + accessKeyId?: string; + + account?: string; + + /** + * Name of the bucket on the provider + */ + bucket?: string; + + provider?: 'r2'; + } + + /** + * Details about the configured source bucket + */ + export interface Source { + /** + * Name of the bucket on the provider + */ + bucket?: string; + + provider?: 'aws' | 'gcs'; + + /** + * Region where the bucket resides (AWS only) + */ + region?: string | null; + } +} + +export interface SippyUpdateParams { + destination?: SippyUpdateParams.Destination; + + source?: SippyUpdateParams.Source; +} + +export namespace SippyUpdateParams { + export interface Destination { + /** + * ID of a Cloudflare API token. This is the value labelled "Access Key ID" when + * creating an API token from the + * [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens). + * + * Sippy will use this token when writing objects to R2, so it is best to scope + * this token to the bucket you're enabling Sippy for. + */ + accessKeyId?: string; + + provider?: 'r2'; + + /** + * Value of a Cloudflare API token. This is the value labelled "Secret Access Key" + * when creating an API token from the + * [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens). + * + * Sippy will use this token when writing objects to R2, so it is best to scope + * this token to the bucket you're enabling Sippy for. + */ + secretAccessKey?: string; + } + + export interface Source { + /** + * Access Key ID of an IAM credential (ideally scoped to a single S3 bucket) + */ + accessKeyId?: string; + + /** + * Name of the GCS bucket + */ + bucket?: string; + + /** + * Client email of an IAM credential (ideally scoped to a single GCS bucket) + */ + clientEmail?: string; + + /** + * Private Key of an IAM credential (ideally scoped to a single GCS bucket) + */ + privateKey?: string; + + provider?: 'gcs'; + + /** + * Name of the AWS availability zone + */ + region?: string; + + /** + * Secret Access Key of an IAM credential (ideally scoped to a single S3 bucket) + */ + secretAccessKey?: string; + } +} + +export namespace Sippy { + export import SippyUpdateResponse = SippyAPI.SippyUpdateResponse; + export import SippyDeleteResponse = SippyAPI.SippyDeleteResponse; + export import SippyGetResponse = SippyAPI.SippyGetResponse; + export import SippyUpdateParams = SippyAPI.SippyUpdateParams; +} diff --git a/src/resources/radar/annotations/annotations.ts b/src/resources/radar/annotations/annotations.ts index bf905236d7..d3ab7962bb 100644 --- a/src/resources/radar/annotations/annotations.ts +++ b/src/resources/radar/annotations/annotations.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. import { APIResource } from 'cloudflare/resource'; -import * as OutagesAPI from 'cloudflare/resources/radar/annotations/outages/outages'; +import * as OutagesAPI from 'cloudflare/resources/radar/annotations/outages'; export class Annotations extends APIResource { outages: OutagesAPI.Outages = new OutagesAPI.Outages(this._client); @@ -9,6 +9,6 @@ export class Annotations extends APIResource { export namespace Annotations { export import Outages = OutagesAPI.Outages; - export import OutageListResponse = OutagesAPI.OutageListResponse; - export import OutageListParams = OutagesAPI.OutageListParams; + export import OutageLocationsResponse = OutagesAPI.OutageLocationsResponse; + export import OutageLocationsParams = OutagesAPI.OutageLocationsParams; } diff --git a/src/resources/radar/annotations/index.ts b/src/resources/radar/annotations/index.ts index c6964a7b84..359b5e3af4 100644 --- a/src/resources/radar/annotations/index.ts +++ b/src/resources/radar/annotations/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. export { Annotations } from './annotations'; -export { OutageListResponse, OutageListParams, Outages } from './outages/index'; +export { OutageLocationsResponse, OutageLocationsParams, Outages } from './outages'; diff --git a/src/resources/radar/annotations/outages/locations.ts b/src/resources/radar/annotations/outages.ts similarity index 59% rename from src/resources/radar/annotations/outages/locations.ts rename to src/resources/radar/annotations/outages.ts index 2b6a72cab4..893d05d356 100644 --- a/src/resources/radar/annotations/outages/locations.ts +++ b/src/resources/radar/annotations/outages.ts @@ -3,34 +3,37 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import { isRequestOptions } from 'cloudflare/core'; -import * as LocationsAPI from 'cloudflare/resources/radar/annotations/outages/locations'; +import * as OutagesAPI from 'cloudflare/resources/radar/annotations/outages'; -export class Locations extends APIResource { +export class Outages extends APIResource { /** * Get the number of outages for locations. */ - list(query?: LocationListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: LocationListParams | Core.RequestOptions = {}, + locations( + query?: OutageLocationsParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise; + locations(options?: Core.RequestOptions): Core.APIPromise; + locations( + query: OutageLocationsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.list({}, query); + return this.locations({}, query); } return ( this._client.get('/radar/annotations/outages/locations', { query, ...options }) as Core.APIPromise<{ - result: LocationListResponse; + result: OutageLocationsResponse; }> )._thenUnwrap((obj) => obj.result); } } -export interface LocationListResponse { - annotations: Array; +export interface OutageLocationsResponse { + annotations: Array; } -export namespace LocationListResponse { +export namespace OutageLocationsResponse { export interface Annotation { clientCountryAlpha2: string; @@ -40,7 +43,7 @@ export namespace LocationListResponse { } } -export interface LocationListParams { +export interface OutageLocationsParams { /** * End of the date range (inclusive). */ @@ -83,7 +86,7 @@ export interface LocationListParams { limit?: number; } -export namespace Locations { - export import LocationListResponse = LocationsAPI.LocationListResponse; - export import LocationListParams = LocationsAPI.LocationListParams; +export namespace Outages { + export import OutageLocationsResponse = OutagesAPI.OutageLocationsResponse; + export import OutageLocationsParams = OutagesAPI.OutageLocationsParams; } diff --git a/src/resources/radar/annotations/outages/index.ts b/src/resources/radar/annotations/outages/index.ts deleted file mode 100644 index b33e3c0596..0000000000 --- a/src/resources/radar/annotations/outages/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { LocationListResponse, LocationListParams, Locations } from './locations'; -export { OutageListResponse, OutageListParams, Outages } from './outages'; diff --git a/src/resources/radar/annotations/outages/outages.ts b/src/resources/radar/annotations/outages/outages.ts deleted file mode 100644 index 9728841192..0000000000 --- a/src/resources/radar/annotations/outages/outages.ts +++ /dev/null @@ -1,160 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as OutagesAPI from 'cloudflare/resources/radar/annotations/outages/outages'; -import * as LocationsAPI from 'cloudflare/resources/radar/annotations/outages/locations'; - -export class Outages extends APIResource { - locations: LocationsAPI.Locations = new LocationsAPI.Locations(this._client); - - /** - * Get latest Internet outages and anomalies. - */ - list(query?: OutageListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: OutageListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/annotations/outages', { query, ...options }) as Core.APIPromise<{ - result: OutageListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface OutageListResponse { - annotations: Array; -} - -export namespace OutageListResponse { - export interface Annotation { - id: string; - - asns: Array; - - asnsDetails: Array; - - dataSource: string; - - eventType: string; - - locations: Array; - - locationsDetails: Array; - - outage: Annotation.Outage; - - startDate: string; - - description?: string; - - endDate?: string; - - linkedUrl?: string; - - scope?: string; - } - - export namespace Annotation { - export interface AsnsDetail { - asn: string; - - name: string; - - locations?: AsnsDetail.Locations; - } - - export namespace AsnsDetail { - export interface Locations { - code: string; - - name: string; - } - } - - export interface LocationsDetail { - code: string; - - name: string; - } - - export interface Outage { - outageCause: string; - - outageType: string; - } - } -} - -export interface OutageListParams { - /** - * Single ASN as integer. - */ - asn?: number; - - /** - * End of the date range (inclusive). - */ - dateEnd?: string; - - /** - * Shorthand date ranges for the last X days - use when you don't need specific - * start and end dates. - */ - dateRange?: - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl'; - - /** - * Start of the date range (inclusive). - */ - dateStart?: string; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limit the number of objects in the response. - */ - limit?: number; - - /** - * Location Alpha2 code. - */ - location?: string; - - /** - * Number of objects to skip before grabbing results. - */ - offset?: number; -} - -export namespace Outages { - export import OutageListResponse = OutagesAPI.OutageListResponse; - export import OutageListParams = OutagesAPI.OutageListParams; - export import Locations = LocationsAPI.Locations; - export import LocationListResponse = LocationsAPI.LocationListResponse; - export import LocationListParams = LocationsAPI.LocationListParams; -} diff --git a/src/resources/radar/as112/as112.ts b/src/resources/radar/as112/as112.ts index 8ed7b1a0a6..a63cb60059 100644 --- a/src/resources/radar/as112/as112.ts +++ b/src/resources/radar/as112/as112.ts @@ -1,14 +1,207 @@ // File generated from our OpenAPI spec by Stainless. +import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/as112/timeseries-groups/timeseries-groups'; +import { isRequestOptions } from 'cloudflare/core'; +import * as As112API from 'cloudflare/resources/radar/as112/as112'; +import * as SummaryAPI from 'cloudflare/resources/radar/as112/summary'; +import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/as112/timeseries-groups'; +import * as TopAPI from 'cloudflare/resources/radar/as112/top'; export class As112 extends APIResource { + summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( this._client, ); + top: TopAPI.Top = new TopAPI.Top(this._client); + + /** + * Get AS112 queries change over time. + */ + timeseries( + query?: As112TimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: As112TimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/as112/timeseries', { query, ...options }) as Core.APIPromise<{ + result: As112TimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface As112TimeseriesResponse { + meta: As112TimeseriesResponse.Meta; + + serie_0: As112TimeseriesResponse.Serie0; +} + +export namespace As112TimeseriesResponse { + export interface Meta { + aggInterval: string; + + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Serie0 { + timestamps: Array; + + values: Array; + } +} + +export interface As112TimeseriesParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; } export namespace As112 { + export import As112TimeseriesResponse = As112API.As112TimeseriesResponse; + export import As112TimeseriesParams = As112API.As112TimeseriesParams; + export import Summary = SummaryAPI.Summary; + export import SummaryDNSSECResponse = SummaryAPI.SummaryDNSSECResponse; + export import SummaryEdnsResponse = SummaryAPI.SummaryEdnsResponse; + export import SummaryIPVersionResponse = SummaryAPI.SummaryIPVersionResponse; + export import SummaryProtocolResponse = SummaryAPI.SummaryProtocolResponse; + export import SummaryQueryTypeResponse = SummaryAPI.SummaryQueryTypeResponse; + export import SummaryResponseCodesResponse = SummaryAPI.SummaryResponseCodesResponse; + export import SummaryDNSSECParams = SummaryAPI.SummaryDNSSECParams; + export import SummaryEdnsParams = SummaryAPI.SummaryEdnsParams; + export import SummaryIPVersionParams = SummaryAPI.SummaryIPVersionParams; + export import SummaryProtocolParams = SummaryAPI.SummaryProtocolParams; + export import SummaryQueryTypeParams = SummaryAPI.SummaryQueryTypeParams; + export import SummaryResponseCodesParams = SummaryAPI.SummaryResponseCodesParams; export import TimeseriesGroups = TimeseriesGroupsAPI.TimeseriesGroups; + export import TimeseriesGroupDNSSECResponse = TimeseriesGroupsAPI.TimeseriesGroupDNSSECResponse; + export import TimeseriesGroupEdnsResponse = TimeseriesGroupsAPI.TimeseriesGroupEdnsResponse; + export import TimeseriesGroupIPVersionResponse = TimeseriesGroupsAPI.TimeseriesGroupIPVersionResponse; + export import TimeseriesGroupProtocolResponse = TimeseriesGroupsAPI.TimeseriesGroupProtocolResponse; + export import TimeseriesGroupQueryTypeResponse = TimeseriesGroupsAPI.TimeseriesGroupQueryTypeResponse; + export import TimeseriesGroupResponseCodesResponse = TimeseriesGroupsAPI.TimeseriesGroupResponseCodesResponse; + export import TimeseriesGroupDNSSECParams = TimeseriesGroupsAPI.TimeseriesGroupDNSSECParams; + export import TimeseriesGroupEdnsParams = TimeseriesGroupsAPI.TimeseriesGroupEdnsParams; + export import TimeseriesGroupIPVersionParams = TimeseriesGroupsAPI.TimeseriesGroupIPVersionParams; + export import TimeseriesGroupProtocolParams = TimeseriesGroupsAPI.TimeseriesGroupProtocolParams; + export import TimeseriesGroupQueryTypeParams = TimeseriesGroupsAPI.TimeseriesGroupQueryTypeParams; + export import TimeseriesGroupResponseCodesParams = TimeseriesGroupsAPI.TimeseriesGroupResponseCodesParams; + export import Top = TopAPI.Top; + export import TopDNSSECResponse = TopAPI.TopDNSSECResponse; + export import TopEdnsResponse = TopAPI.TopEdnsResponse; + export import TopIPVersionResponse = TopAPI.TopIPVersionResponse; + export import TopLocationsResponse = TopAPI.TopLocationsResponse; + export import TopDNSSECParams = TopAPI.TopDNSSECParams; + export import TopEdnsParams = TopAPI.TopEdnsParams; + export import TopIPVersionParams = TopAPI.TopIPVersionParams; + export import TopLocationsParams = TopAPI.TopLocationsParams; } diff --git a/src/resources/radar/as112/index.ts b/src/resources/radar/as112/index.ts index f9e59b04de..c4ee4f4e2b 100644 --- a/src/resources/radar/as112/index.ts +++ b/src/resources/radar/as112/index.ts @@ -1,4 +1,44 @@ // File generated from our OpenAPI spec by Stainless. -export { As112 } from './as112'; -export { TimeseriesGroups } from './timeseries-groups/index'; +export { As112TimeseriesResponse, As112TimeseriesParams, As112 } from './as112'; +export { + SummaryDNSSECResponse, + SummaryEdnsResponse, + SummaryIPVersionResponse, + SummaryProtocolResponse, + SummaryQueryTypeResponse, + SummaryResponseCodesResponse, + SummaryDNSSECParams, + SummaryEdnsParams, + SummaryIPVersionParams, + SummaryProtocolParams, + SummaryQueryTypeParams, + SummaryResponseCodesParams, + Summary, +} from './summary'; +export { + TimeseriesGroupDNSSECResponse, + TimeseriesGroupEdnsResponse, + TimeseriesGroupIPVersionResponse, + TimeseriesGroupProtocolResponse, + TimeseriesGroupQueryTypeResponse, + TimeseriesGroupResponseCodesResponse, + TimeseriesGroupDNSSECParams, + TimeseriesGroupEdnsParams, + TimeseriesGroupIPVersionParams, + TimeseriesGroupProtocolParams, + TimeseriesGroupQueryTypeParams, + TimeseriesGroupResponseCodesParams, + TimeseriesGroups, +} from './timeseries-groups'; +export { + TopDNSSECResponse, + TopEdnsResponse, + TopIPVersionResponse, + TopLocationsResponse, + TopDNSSECParams, + TopEdnsParams, + TopIPVersionParams, + TopLocationsParams, + Top, +} from './top'; diff --git a/src/resources/radar/as112/summary.ts b/src/resources/radar/as112/summary.ts new file mode 100644 index 0000000000..0d1770b3e1 --- /dev/null +++ b/src/resources/radar/as112/summary.ts @@ -0,0 +1,881 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as SummaryAPI from 'cloudflare/resources/radar/as112/summary'; + +export class Summary extends APIResource { + /** + * Percentage distribution of DNS queries to AS112 by DNSSEC support. + */ + dnssec(query?: SummaryDNSSECParams, options?: Core.RequestOptions): Core.APIPromise; + dnssec(options?: Core.RequestOptions): Core.APIPromise; + dnssec( + query: SummaryDNSSECParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.dnssec({}, query); + } + return ( + this._client.get('/radar/as112/summary/dnssec', { query, ...options }) as Core.APIPromise<{ + result: SummaryDNSSECResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of DNS queries, to AS112, by EDNS support. + */ + edns(query?: SummaryEdnsParams, options?: Core.RequestOptions): Core.APIPromise; + edns(options?: Core.RequestOptions): Core.APIPromise; + edns( + query: SummaryEdnsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.edns({}, query); + } + return ( + this._client.get('/radar/as112/summary/edns', { query, ...options }) as Core.APIPromise<{ + result: SummaryEdnsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of DNS queries to AS112 per IP Version. + */ + ipVersion( + query?: SummaryIPVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + ipVersion(options?: Core.RequestOptions): Core.APIPromise; + ipVersion( + query: SummaryIPVersionParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.ipVersion({}, query); + } + return ( + this._client.get('/radar/as112/summary/ip_version', { query, ...options }) as Core.APIPromise<{ + result: SummaryIPVersionResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of DNS queries to AS112 per protocol. + */ + protocol( + query?: SummaryProtocolParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + protocol(options?: Core.RequestOptions): Core.APIPromise; + protocol( + query: SummaryProtocolParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.protocol({}, query); + } + return ( + this._client.get('/radar/as112/summary/protocol', { query, ...options }) as Core.APIPromise<{ + result: SummaryProtocolResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of DNS queries to AS112 by Query Type. + */ + queryType( + query?: SummaryQueryTypeParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + queryType(options?: Core.RequestOptions): Core.APIPromise; + queryType( + query: SummaryQueryTypeParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.queryType({}, query); + } + return ( + this._client.get('/radar/as112/summary/query_type', { query, ...options }) as Core.APIPromise<{ + result: SummaryQueryTypeResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of AS112 dns requests classified per Response Codes. + */ + responseCodes( + query?: SummaryResponseCodesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + responseCodes(options?: Core.RequestOptions): Core.APIPromise; + responseCodes( + query: SummaryResponseCodesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.responseCodes({}, query); + } + return ( + this._client.get('/radar/as112/summary/response_codes', { query, ...options }) as Core.APIPromise<{ + result: SummaryResponseCodesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SummaryDNSSECResponse { + meta: SummaryDNSSECResponse.Meta; + + summary_0: SummaryDNSSECResponse.Summary0; +} + +export namespace SummaryDNSSECResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + NOT_SUPPORTED: string; + + SUPPORTED: string; + } +} + +export interface SummaryEdnsResponse { + meta: SummaryEdnsResponse.Meta; + + summary_0: SummaryEdnsResponse.Summary0; +} + +export namespace SummaryEdnsResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + NOT_SUPPORTED: string; + + SUPPORTED: string; + } +} + +export interface SummaryIPVersionResponse { + meta: SummaryIPVersionResponse.Meta; + + summary_0: SummaryIPVersionResponse.Summary0; +} + +export namespace SummaryIPVersionResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + IPv4: string; + + IPv6: string; + } +} + +export interface SummaryProtocolResponse { + meta: SummaryProtocolResponse.Meta; + + summary_0: SummaryProtocolResponse.Summary0; +} + +export namespace SummaryProtocolResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + tcp: string; + + udp: string; + } +} + +export interface SummaryQueryTypeResponse { + meta: SummaryQueryTypeResponse.Meta; + + summary_0: SummaryQueryTypeResponse.Summary0; +} + +export namespace SummaryQueryTypeResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + A: string; + + AAAA: string; + + PTR: string; + + SOA: string; + + SRV: string; + } +} + +export interface SummaryResponseCodesResponse { + meta: SummaryResponseCodesResponse.Meta; + + summary_0: SummaryResponseCodesResponse.Summary0; +} + +export namespace SummaryResponseCodesResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + NOERROR: string; + + NXDOMAIN: string; + } +} + +export interface SummaryDNSSECParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface SummaryEdnsParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface SummaryIPVersionParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface SummaryProtocolParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface SummaryQueryTypeParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface SummaryResponseCodesParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export namespace Summary { + export import SummaryDNSSECResponse = SummaryAPI.SummaryDNSSECResponse; + export import SummaryEdnsResponse = SummaryAPI.SummaryEdnsResponse; + export import SummaryIPVersionResponse = SummaryAPI.SummaryIPVersionResponse; + export import SummaryProtocolResponse = SummaryAPI.SummaryProtocolResponse; + export import SummaryQueryTypeResponse = SummaryAPI.SummaryQueryTypeResponse; + export import SummaryResponseCodesResponse = SummaryAPI.SummaryResponseCodesResponse; + export import SummaryDNSSECParams = SummaryAPI.SummaryDNSSECParams; + export import SummaryEdnsParams = SummaryAPI.SummaryEdnsParams; + export import SummaryIPVersionParams = SummaryAPI.SummaryIPVersionParams; + export import SummaryProtocolParams = SummaryAPI.SummaryProtocolParams; + export import SummaryQueryTypeParams = SummaryAPI.SummaryQueryTypeParams; + export import SummaryResponseCodesParams = SummaryAPI.SummaryResponseCodesParams; +} diff --git a/src/resources/radar/as112/timeseries-groups.ts b/src/resources/radar/as112/timeseries-groups.ts new file mode 100644 index 0000000000..db51a3ad34 --- /dev/null +++ b/src/resources/radar/as112/timeseries-groups.ts @@ -0,0 +1,645 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/as112/timeseries-groups'; + +export class TimeseriesGroups extends APIResource { + /** + * Percentage distribution of DNS AS112 queries by DNSSEC support over time. + */ + dnssec( + query?: TimeseriesGroupDNSSECParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + dnssec(options?: Core.RequestOptions): Core.APIPromise; + dnssec( + query: TimeseriesGroupDNSSECParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.dnssec({}, query); + } + return ( + this._client.get('/radar/as112/timeseries_groups/dnssec', { query, ...options }) as Core.APIPromise<{ + result: TimeseriesGroupDNSSECResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of AS112 DNS queries by EDNS support over time. + */ + edns( + query?: TimeseriesGroupEdnsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + edns(options?: Core.RequestOptions): Core.APIPromise; + edns( + query: TimeseriesGroupEdnsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.edns({}, query); + } + return ( + this._client.get('/radar/as112/timeseries_groups/edns', { query, ...options }) as Core.APIPromise<{ + result: TimeseriesGroupEdnsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of AS112 DNS queries by IP Version over time. + */ + ipVersion( + query?: TimeseriesGroupIPVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + ipVersion(options?: Core.RequestOptions): Core.APIPromise; + ipVersion( + query: TimeseriesGroupIPVersionParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.ipVersion({}, query); + } + return ( + this._client.get('/radar/as112/timeseries_groups/ip_version', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupIPVersionResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of AS112 dns requests classified per Protocol over time. + */ + protocol( + query?: TimeseriesGroupProtocolParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + protocol(options?: Core.RequestOptions): Core.APIPromise; + protocol( + query: TimeseriesGroupProtocolParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.protocol({}, query); + } + return ( + this._client.get('/radar/as112/timeseries_groups/protocol', { query, ...options }) as Core.APIPromise<{ + result: TimeseriesGroupProtocolResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of AS112 DNS queries by Query Type over time. + */ + queryType( + query?: TimeseriesGroupQueryTypeParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + queryType(options?: Core.RequestOptions): Core.APIPromise; + queryType( + query: TimeseriesGroupQueryTypeParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.queryType({}, query); + } + return ( + this._client.get('/radar/as112/timeseries_groups/query_type', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupQueryTypeResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of AS112 dns requests classified per Response Codes over + * time. + */ + responseCodes( + query?: TimeseriesGroupResponseCodesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + responseCodes(options?: Core.RequestOptions): Core.APIPromise; + responseCodes( + query: TimeseriesGroupResponseCodesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.responseCodes({}, query); + } + return ( + this._client.get('/radar/as112/timeseries_groups/response_codes', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupResponseCodesResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TimeseriesGroupDNSSECResponse { + meta: unknown; + + serie_0: TimeseriesGroupDNSSECResponse.Serie0; +} + +export namespace TimeseriesGroupDNSSECResponse { + export interface Serie0 { + NOT_SUPPORTED: Array; + + SUPPORTED: Array; + } +} + +export interface TimeseriesGroupEdnsResponse { + meta: unknown; + + serie_0: TimeseriesGroupEdnsResponse.Serie0; +} + +export namespace TimeseriesGroupEdnsResponse { + export interface Serie0 { + NOT_SUPPORTED: Array; + + SUPPORTED: Array; + } +} + +export interface TimeseriesGroupIPVersionResponse { + meta: unknown; + + serie_0: TimeseriesGroupIPVersionResponse.Serie0; +} + +export namespace TimeseriesGroupIPVersionResponse { + export interface Serie0 { + IPv4: Array; + + IPv6: Array; + } +} + +export interface TimeseriesGroupProtocolResponse { + meta: unknown; + + serie_0: TimeseriesGroupProtocolResponse.Serie0; +} + +export namespace TimeseriesGroupProtocolResponse { + export interface Serie0 { + tcp: Array; + + udp: Array; + } +} + +export interface TimeseriesGroupQueryTypeResponse { + meta: unknown; + + serie_0: TimeseriesGroupQueryTypeResponse.Serie0; +} + +export namespace TimeseriesGroupQueryTypeResponse { + export interface Serie0 { + A: Array; + + AAAA: Array; + + PTR: Array; + + SOA: Array; + + SRV: Array; + } +} + +export interface TimeseriesGroupResponseCodesResponse { + meta: unknown; + + serie_0: TimeseriesGroupResponseCodesResponse.Serie0; +} + +export namespace TimeseriesGroupResponseCodesResponse { + export interface Serie0 { + NOERROR: Array; + + NXDOMAIN: Array; + } +} + +export interface TimeseriesGroupDNSSECParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface TimeseriesGroupEdnsParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface TimeseriesGroupIPVersionParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface TimeseriesGroupProtocolParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface TimeseriesGroupQueryTypeParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface TimeseriesGroupResponseCodesParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export namespace TimeseriesGroups { + export import TimeseriesGroupDNSSECResponse = TimeseriesGroupsAPI.TimeseriesGroupDNSSECResponse; + export import TimeseriesGroupEdnsResponse = TimeseriesGroupsAPI.TimeseriesGroupEdnsResponse; + export import TimeseriesGroupIPVersionResponse = TimeseriesGroupsAPI.TimeseriesGroupIPVersionResponse; + export import TimeseriesGroupProtocolResponse = TimeseriesGroupsAPI.TimeseriesGroupProtocolResponse; + export import TimeseriesGroupQueryTypeResponse = TimeseriesGroupsAPI.TimeseriesGroupQueryTypeResponse; + export import TimeseriesGroupResponseCodesResponse = TimeseriesGroupsAPI.TimeseriesGroupResponseCodesResponse; + export import TimeseriesGroupDNSSECParams = TimeseriesGroupsAPI.TimeseriesGroupDNSSECParams; + export import TimeseriesGroupEdnsParams = TimeseriesGroupsAPI.TimeseriesGroupEdnsParams; + export import TimeseriesGroupIPVersionParams = TimeseriesGroupsAPI.TimeseriesGroupIPVersionParams; + export import TimeseriesGroupProtocolParams = TimeseriesGroupsAPI.TimeseriesGroupProtocolParams; + export import TimeseriesGroupQueryTypeParams = TimeseriesGroupsAPI.TimeseriesGroupQueryTypeParams; + export import TimeseriesGroupResponseCodesParams = TimeseriesGroupsAPI.TimeseriesGroupResponseCodesParams; +} diff --git a/src/resources/radar/as112/timeseries-groups/dnssec.ts b/src/resources/radar/as112/timeseries-groups/dnssec.ts deleted file mode 100644 index 3a2f6325cd..0000000000 --- a/src/resources/radar/as112/timeseries-groups/dnssec.ts +++ /dev/null @@ -1,112 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as DNSSECAPI from 'cloudflare/resources/radar/as112/timeseries-groups/dnssec'; - -export class DNSSEC extends APIResource { - /** - * Percentage distribution of DNS AS112 queries by DNSSEC support over time. - */ - list(query?: DNSSECListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: DNSSECListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/as112/timeseries_groups/dnssec', { query, ...options }) as Core.APIPromise<{ - result: DNSSECListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface DNSSECListResponse { - meta: unknown; - - serie_0: DNSSECListResponse.Serie0; -} - -export namespace DNSSECListResponse { - export interface Serie0 { - NOT_SUPPORTED: Array; - - SUPPORTED: Array; - } -} - -export interface DNSSECListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; -} - -export namespace DNSSEC { - export import DNSSECListResponse = DNSSECAPI.DNSSECListResponse; - export import DNSSECListParams = DNSSECAPI.DNSSECListParams; -} diff --git a/src/resources/radar/as112/timeseries-groups/edns.ts b/src/resources/radar/as112/timeseries-groups/edns.ts deleted file mode 100644 index 374c6f85d4..0000000000 --- a/src/resources/radar/as112/timeseries-groups/edns.ts +++ /dev/null @@ -1,112 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as EdnsAPI from 'cloudflare/resources/radar/as112/timeseries-groups/edns'; - -export class Edns extends APIResource { - /** - * Percentage distribution of AS112 DNS queries by EDNS support over time. - */ - list(query?: EdnListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: EdnListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/as112/timeseries_groups/edns', { query, ...options }) as Core.APIPromise<{ - result: EdnListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface EdnListResponse { - meta: unknown; - - serie_0: EdnListResponse.Serie0; -} - -export namespace EdnListResponse { - export interface Serie0 { - NOT_SUPPORTED: Array; - - SUPPORTED: Array; - } -} - -export interface EdnListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; -} - -export namespace Edns { - export import EdnListResponse = EdnsAPI.EdnListResponse; - export import EdnListParams = EdnsAPI.EdnListParams; -} diff --git a/src/resources/radar/as112/timeseries-groups/index.ts b/src/resources/radar/as112/timeseries-groups/index.ts deleted file mode 100644 index 752e5b5553..0000000000 --- a/src/resources/radar/as112/timeseries-groups/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { DNSSECListResponse, DNSSECListParams, DNSSEC } from './dnssec'; -export { EdnListResponse, EdnListParams, Edns } from './edns'; -export { IPVersionListResponse, IPVersionListParams, IPVersion } from './ip-version'; -export { TimeseriesGroups } from './timeseries-groups'; diff --git a/src/resources/radar/as112/timeseries-groups/ip-version.ts b/src/resources/radar/as112/timeseries-groups/ip-version.ts deleted file mode 100644 index a6814f15dc..0000000000 --- a/src/resources/radar/as112/timeseries-groups/ip-version.ts +++ /dev/null @@ -1,113 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as IPVersionAPI from 'cloudflare/resources/radar/as112/timeseries-groups/ip-version'; - -export class IPVersion extends APIResource { - /** - * Percentage distribution of AS112 DNS queries by IP Version over time. - */ - list(query?: IPVersionListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: IPVersionListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/as112/timeseries_groups/ip_version', { - query, - ...options, - }) as Core.APIPromise<{ result: IPVersionListResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface IPVersionListResponse { - meta: unknown; - - serie_0: IPVersionListResponse.Serie0; -} - -export namespace IPVersionListResponse { - export interface Serie0 { - IPv4: Array; - - IPv6: Array; - } -} - -export interface IPVersionListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; -} - -export namespace IPVersion { - export import IPVersionListResponse = IPVersionAPI.IPVersionListResponse; - export import IPVersionListParams = IPVersionAPI.IPVersionListParams; -} diff --git a/src/resources/radar/as112/timeseries-groups/timeseries-groups.ts b/src/resources/radar/as112/timeseries-groups/timeseries-groups.ts deleted file mode 100644 index 031d5a4d36..0000000000 --- a/src/resources/radar/as112/timeseries-groups/timeseries-groups.ts +++ /dev/null @@ -1,24 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import { APIResource } from 'cloudflare/resource'; -import * as DNSSECAPI from 'cloudflare/resources/radar/as112/timeseries-groups/dnssec'; -import * as EdnsAPI from 'cloudflare/resources/radar/as112/timeseries-groups/edns'; -import * as IPVersionAPI from 'cloudflare/resources/radar/as112/timeseries-groups/ip-version'; - -export class TimeseriesGroups extends APIResource { - dnssec: DNSSECAPI.DNSSEC = new DNSSECAPI.DNSSEC(this._client); - edns: EdnsAPI.Edns = new EdnsAPI.Edns(this._client); - ipVersion: IPVersionAPI.IPVersion = new IPVersionAPI.IPVersion(this._client); -} - -export namespace TimeseriesGroups { - export import DNSSEC = DNSSECAPI.DNSSEC; - export import DNSSECListResponse = DNSSECAPI.DNSSECListResponse; - export import DNSSECListParams = DNSSECAPI.DNSSECListParams; - export import Edns = EdnsAPI.Edns; - export import EdnListResponse = EdnsAPI.EdnListResponse; - export import EdnListParams = EdnsAPI.EdnListParams; - export import IPVersion = IPVersionAPI.IPVersion; - export import IPVersionListResponse = IPVersionAPI.IPVersionListResponse; - export import IPVersionListParams = IPVersionAPI.IPVersionListParams; -} diff --git a/src/resources/radar/as112/top.ts b/src/resources/radar/as112/top.ts new file mode 100644 index 0000000000..9d1197d0bb --- /dev/null +++ b/src/resources/radar/as112/top.ts @@ -0,0 +1,620 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as TopAPI from 'cloudflare/resources/radar/as112/top'; + +export class Top extends APIResource { + /** + * Get the top locations by DNS queries DNSSEC support to AS112. + */ + dnssec( + dnssec: 'SUPPORTED' | 'NOT_SUPPORTED', + query?: TopDNSSECParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + dnssec( + dnssec: 'SUPPORTED' | 'NOT_SUPPORTED', + options?: Core.RequestOptions, + ): Core.APIPromise; + dnssec( + dnssec: 'SUPPORTED' | 'NOT_SUPPORTED', + query: TopDNSSECParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.dnssec(dnssec, {}, query); + } + return ( + this._client.get(`/radar/as112/top/locations/dnssec/${dnssec}`, { + query, + ...options, + }) as Core.APIPromise<{ result: TopDNSSECResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get the top locations, by DNS queries EDNS support to AS112. + */ + edns( + edns: 'SUPPORTED' | 'NOT_SUPPORTED', + query?: TopEdnsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + edns(edns: 'SUPPORTED' | 'NOT_SUPPORTED', options?: Core.RequestOptions): Core.APIPromise; + edns( + edns: 'SUPPORTED' | 'NOT_SUPPORTED', + query: TopEdnsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.edns(edns, {}, query); + } + return ( + this._client.get(`/radar/as112/top/locations/edns/${edns}`, { query, ...options }) as Core.APIPromise<{ + result: TopEdnsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get the top locations by DNS queries IP version to AS112. + */ + ipVersion( + ipVersion: 'IPv4' | 'IPv6', + query?: TopIPVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + ipVersion(ipVersion: 'IPv4' | 'IPv6', options?: Core.RequestOptions): Core.APIPromise; + ipVersion( + ipVersion: 'IPv4' | 'IPv6', + query: TopIPVersionParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.ipVersion(ipVersion, {}, query); + } + return ( + this._client.get(`/radar/as112/top/locations/ip_version/${ipVersion}`, { + query, + ...options, + }) as Core.APIPromise<{ result: TopIPVersionResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get the top locations by AS112 DNS queries. Values are a percentage out of the + * total queries. + */ + locations(query?: TopLocationsParams, options?: Core.RequestOptions): Core.APIPromise; + locations(options?: Core.RequestOptions): Core.APIPromise; + locations( + query: TopLocationsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.locations({}, query); + } + return ( + this._client.get('/radar/as112/top/locations', { query, ...options }) as Core.APIPromise<{ + result: TopLocationsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TopDNSSECResponse { + meta: TopDNSSECResponse.Meta; + + top_0: Array; +} + +export namespace TopDNSSECResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface TopEdnsResponse { + meta: TopEdnsResponse.Meta; + + top_0: Array; +} + +export namespace TopEdnsResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface TopIPVersionResponse { + meta: TopIPVersionResponse.Meta; + + top_0: Array; +} + +export namespace TopIPVersionResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface TopLocationsResponse { + meta: TopLocationsResponse.Meta; + + top_0: Array; +} + +export namespace TopLocationsResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface TopDNSSECParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface TopEdnsParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface TopIPVersionParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface TopLocationsParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export namespace Top { + export import TopDNSSECResponse = TopAPI.TopDNSSECResponse; + export import TopEdnsResponse = TopAPI.TopEdnsResponse; + export import TopIPVersionResponse = TopAPI.TopIPVersionResponse; + export import TopLocationsResponse = TopAPI.TopLocationsResponse; + export import TopDNSSECParams = TopAPI.TopDNSSECParams; + export import TopEdnsParams = TopAPI.TopEdnsParams; + export import TopIPVersionParams = TopAPI.TopIPVersionParams; + export import TopLocationsParams = TopAPI.TopLocationsParams; +} diff --git a/src/resources/radar/attacks/attacks.ts b/src/resources/radar/attacks/attacks.ts index 4c22f566f6..38b9ef8314 100644 --- a/src/resources/radar/attacks/attacks.ts +++ b/src/resources/radar/attacks/attacks.ts @@ -2,11 +2,18 @@ import { APIResource } from 'cloudflare/resource'; import * as Layer3API from 'cloudflare/resources/radar/attacks/layer3/layer3'; +import * as Layer7API from 'cloudflare/resources/radar/attacks/layer7/layer7'; export class Attacks extends APIResource { layer3: Layer3API.Layer3 = new Layer3API.Layer3(this._client); + layer7: Layer7API.Layer7 = new Layer7API.Layer7(this._client); } export namespace Attacks { export import Layer3 = Layer3API.Layer3; + export import Layer3TimeseriesResponse = Layer3API.Layer3TimeseriesResponse; + export import Layer3TimeseriesParams = Layer3API.Layer3TimeseriesParams; + export import Layer7 = Layer7API.Layer7; + export import Layer7TimeseriesResponse = Layer7API.Layer7TimeseriesResponse; + export import Layer7TimeseriesParams = Layer7API.Layer7TimeseriesParams; } diff --git a/src/resources/radar/attacks/index.ts b/src/resources/radar/attacks/index.ts index 07e1ab7e92..7e15bc9339 100644 --- a/src/resources/radar/attacks/index.ts +++ b/src/resources/radar/attacks/index.ts @@ -1,4 +1,5 @@ // File generated from our OpenAPI spec by Stainless. export { Attacks } from './attacks'; -export { Layer3 } from './layer3/index'; +export { Layer3TimeseriesResponse, Layer3TimeseriesParams, Layer3 } from './layer3/index'; +export { Layer7TimeseriesResponse, Layer7TimeseriesParams, Layer7 } from './layer7/index'; diff --git a/src/resources/radar/attacks/layer3/index.ts b/src/resources/radar/attacks/layer3/index.ts index cc2e50fe3c..e8eae60bc4 100644 --- a/src/resources/radar/attacks/layer3/index.ts +++ b/src/resources/radar/attacks/layer3/index.ts @@ -1,5 +1,46 @@ // File generated from our OpenAPI spec by Stainless. -export { Layer3 } from './layer3'; -export { TimeseriesGroups } from './timeseries-groups/index'; -export { Top } from './top/index'; +export { Layer3TimeseriesResponse, Layer3TimeseriesParams, Layer3 } from './layer3'; +export { + SummaryBitrateResponse, + SummaryDurationResponse, + SummaryGetResponse, + SummaryIPVersionResponse, + SummaryProtocolResponse, + SummaryVectorResponse, + SummaryBitrateParams, + SummaryDurationParams, + SummaryGetParams, + SummaryIPVersionParams, + SummaryProtocolParams, + SummaryVectorParams, + Summary, +} from './summary'; +export { + TimeseriesGroupBitrateResponse, + TimeseriesGroupDurationResponse, + TimeseriesGroupGetResponse, + TimeseriesGroupIndustryResponse, + TimeseriesGroupIPVersionResponse, + TimeseriesGroupProtocolResponse, + TimeseriesGroupVectorResponse, + TimeseriesGroupVerticalResponse, + TimeseriesGroupBitrateParams, + TimeseriesGroupDurationParams, + TimeseriesGroupGetParams, + TimeseriesGroupIndustryParams, + TimeseriesGroupIPVersionParams, + TimeseriesGroupProtocolParams, + TimeseriesGroupVectorParams, + TimeseriesGroupVerticalParams, + TimeseriesGroups, +} from './timeseries-groups'; +export { + TopAttacksResponse, + TopIndustryResponse, + TopVerticalResponse, + TopAttacksParams, + TopIndustryParams, + TopVerticalParams, + Top, +} from './top/index'; diff --git a/src/resources/radar/attacks/layer3/layer3.ts b/src/resources/radar/attacks/layer3/layer3.ts index 6900b60bbb..53667a065e 100644 --- a/src/resources/radar/attacks/layer3/layer3.ts +++ b/src/resources/radar/attacks/layer3/layer3.ts @@ -1,17 +1,188 @@ // File generated from our OpenAPI spec by Stainless. +import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/attacks/layer3/timeseries-groups/timeseries-groups'; +import { isRequestOptions } from 'cloudflare/core'; +import * as Layer3API from 'cloudflare/resources/radar/attacks/layer3/layer3'; +import * as SummaryAPI from 'cloudflare/resources/radar/attacks/layer3/summary'; +import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/attacks/layer3/timeseries-groups'; import * as TopAPI from 'cloudflare/resources/radar/attacks/layer3/top/top'; export class Layer3 extends APIResource { + summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( this._client, ); top: TopAPI.Top = new TopAPI.Top(this._client); + + /** + * Get attacks change over time by bytes. + */ + timeseries( + query?: Layer3TimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: Layer3TimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/timeseries', { query, ...options }) as Core.APIPromise<{ + result: Layer3TimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface Layer3TimeseriesResponse { + meta: unknown; + + serie_0: Layer3TimeseriesResponse.Serie0; +} + +export namespace Layer3TimeseriesResponse { + export interface Serie0 { + timestamps: Array; + + values: Array; + } +} + +export interface Layer3TimeseriesParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Measurement units, eg. bytes. + */ + metric?: 'BYTES' | 'BYTES_OLD'; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Normalization method applied. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; } export namespace Layer3 { + export import Layer3TimeseriesResponse = Layer3API.Layer3TimeseriesResponse; + export import Layer3TimeseriesParams = Layer3API.Layer3TimeseriesParams; + export import Summary = SummaryAPI.Summary; + export import SummaryBitrateResponse = SummaryAPI.SummaryBitrateResponse; + export import SummaryDurationResponse = SummaryAPI.SummaryDurationResponse; + export import SummaryGetResponse = SummaryAPI.SummaryGetResponse; + export import SummaryIPVersionResponse = SummaryAPI.SummaryIPVersionResponse; + export import SummaryProtocolResponse = SummaryAPI.SummaryProtocolResponse; + export import SummaryVectorResponse = SummaryAPI.SummaryVectorResponse; + export import SummaryBitrateParams = SummaryAPI.SummaryBitrateParams; + export import SummaryDurationParams = SummaryAPI.SummaryDurationParams; + export import SummaryGetParams = SummaryAPI.SummaryGetParams; + export import SummaryIPVersionParams = SummaryAPI.SummaryIPVersionParams; + export import SummaryProtocolParams = SummaryAPI.SummaryProtocolParams; + export import SummaryVectorParams = SummaryAPI.SummaryVectorParams; export import TimeseriesGroups = TimeseriesGroupsAPI.TimeseriesGroups; + export import TimeseriesGroupBitrateResponse = TimeseriesGroupsAPI.TimeseriesGroupBitrateResponse; + export import TimeseriesGroupDurationResponse = TimeseriesGroupsAPI.TimeseriesGroupDurationResponse; + export import TimeseriesGroupGetResponse = TimeseriesGroupsAPI.TimeseriesGroupGetResponse; + export import TimeseriesGroupIndustryResponse = TimeseriesGroupsAPI.TimeseriesGroupIndustryResponse; + export import TimeseriesGroupIPVersionResponse = TimeseriesGroupsAPI.TimeseriesGroupIPVersionResponse; + export import TimeseriesGroupProtocolResponse = TimeseriesGroupsAPI.TimeseriesGroupProtocolResponse; + export import TimeseriesGroupVectorResponse = TimeseriesGroupsAPI.TimeseriesGroupVectorResponse; + export import TimeseriesGroupVerticalResponse = TimeseriesGroupsAPI.TimeseriesGroupVerticalResponse; + export import TimeseriesGroupBitrateParams = TimeseriesGroupsAPI.TimeseriesGroupBitrateParams; + export import TimeseriesGroupDurationParams = TimeseriesGroupsAPI.TimeseriesGroupDurationParams; + export import TimeseriesGroupGetParams = TimeseriesGroupsAPI.TimeseriesGroupGetParams; + export import TimeseriesGroupIndustryParams = TimeseriesGroupsAPI.TimeseriesGroupIndustryParams; + export import TimeseriesGroupIPVersionParams = TimeseriesGroupsAPI.TimeseriesGroupIPVersionParams; + export import TimeseriesGroupProtocolParams = TimeseriesGroupsAPI.TimeseriesGroupProtocolParams; + export import TimeseriesGroupVectorParams = TimeseriesGroupsAPI.TimeseriesGroupVectorParams; + export import TimeseriesGroupVerticalParams = TimeseriesGroupsAPI.TimeseriesGroupVerticalParams; export import Top = TopAPI.Top; + export import TopAttacksResponse = TopAPI.TopAttacksResponse; + export import TopIndustryResponse = TopAPI.TopIndustryResponse; + export import TopVerticalResponse = TopAPI.TopVerticalResponse; + export import TopAttacksParams = TopAPI.TopAttacksParams; + export import TopIndustryParams = TopAPI.TopIndustryParams; + export import TopVerticalParams = TopAPI.TopVerticalParams; } diff --git a/src/resources/radar/attacks/layer3/summary.ts b/src/resources/radar/attacks/layer3/summary.ts new file mode 100644 index 0000000000..1706474ab6 --- /dev/null +++ b/src/resources/radar/attacks/layer3/summary.ts @@ -0,0 +1,923 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as SummaryAPI from 'cloudflare/resources/radar/attacks/layer3/summary'; + +export class Summary extends APIResource { + /** + * Percentage distribution of attacks by bitrate. + */ + bitrate( + query?: SummaryBitrateParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + bitrate(options?: Core.RequestOptions): Core.APIPromise; + bitrate( + query: SummaryBitrateParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.bitrate({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/summary/bitrate', { query, ...options }) as Core.APIPromise<{ + result: SummaryBitrateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by duration. + */ + duration( + query?: SummaryDurationParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + duration(options?: Core.RequestOptions): Core.APIPromise; + duration( + query: SummaryDurationParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.duration({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/summary/duration', { query, ...options }) as Core.APIPromise<{ + result: SummaryDurationResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of network protocols in layer 3/4 attacks over a given + * time period. + */ + get(query?: SummaryGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(options?: Core.RequestOptions): Core.APIPromise; + get( + query: SummaryGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/summary', { query, ...options }) as Core.APIPromise<{ + result: SummaryGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by ip version used. + */ + ipVersion( + query?: SummaryIPVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + ipVersion(options?: Core.RequestOptions): Core.APIPromise; + ipVersion( + query: SummaryIPVersionParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.ipVersion({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/summary/ip_version', { query, ...options }) as Core.APIPromise<{ + result: SummaryIPVersionResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by protocol used. + */ + protocol( + query?: SummaryProtocolParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + protocol(options?: Core.RequestOptions): Core.APIPromise; + protocol( + query: SummaryProtocolParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.protocol({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/summary/protocol', { query, ...options }) as Core.APIPromise<{ + result: SummaryProtocolResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by vector. + */ + vector(query?: SummaryVectorParams, options?: Core.RequestOptions): Core.APIPromise; + vector(options?: Core.RequestOptions): Core.APIPromise; + vector( + query: SummaryVectorParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.vector({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/summary/vector', { query, ...options }) as Core.APIPromise<{ + result: SummaryVectorResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SummaryBitrateResponse { + meta: SummaryBitrateResponse.Meta; + + summary_0: SummaryBitrateResponse.Summary0; +} + +export namespace SummaryBitrateResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + _1_GBPS_TO_10_GBPS: string; + + _10_GBPS_TO_100_GBPS: string; + + _500_MBPS_TO_1_GBPS: string; + + OVER_100_GBPS: string; + + UNDER_500_MBPS: string; + } +} + +export interface SummaryDurationResponse { + meta: SummaryDurationResponse.Meta; + + summary_0: SummaryDurationResponse.Summary0; +} + +export namespace SummaryDurationResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + _1_HOUR_TO_3_HOURS: string; + + _10_MINS_TO_20_MINS: string; + + _20_MINS_TO_40_MINS: string; + + _40_MINS_TO_1_HOUR: string; + + OVER_3_HOURS: string; + + UNDER_10_MINS: string; + } +} + +export interface SummaryGetResponse { + meta: SummaryGetResponse.Meta; + + summary_0: SummaryGetResponse.Summary0; +} + +export namespace SummaryGetResponse { + export interface Meta { + dateRange: Array; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + gre: string; + + icmp: string; + + tcp: string; + + udp: string; + } +} + +export interface SummaryIPVersionResponse { + meta: SummaryIPVersionResponse.Meta; + + summary_0: SummaryIPVersionResponse.Summary0; +} + +export namespace SummaryIPVersionResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + IPv4: string; + + IPv6: string; + } +} + +export interface SummaryProtocolResponse { + meta: SummaryProtocolResponse.Meta; + + summary_0: SummaryProtocolResponse.Summary0; +} + +export namespace SummaryProtocolResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + GRE: string; + + ICMP: string; + + TCP: string; + + UDP: string; + } +} + +export interface SummaryVectorResponse { + meta: SummaryVectorResponse.Meta; + + summary_0: Record>; +} + +export namespace SummaryVectorResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } +} + +export interface SummaryBitrateParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface SummaryDurationParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface SummaryGetParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface SummaryIPVersionParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface SummaryProtocolParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface SummaryVectorParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export namespace Summary { + export import SummaryBitrateResponse = SummaryAPI.SummaryBitrateResponse; + export import SummaryDurationResponse = SummaryAPI.SummaryDurationResponse; + export import SummaryGetResponse = SummaryAPI.SummaryGetResponse; + export import SummaryIPVersionResponse = SummaryAPI.SummaryIPVersionResponse; + export import SummaryProtocolResponse = SummaryAPI.SummaryProtocolResponse; + export import SummaryVectorResponse = SummaryAPI.SummaryVectorResponse; + export import SummaryBitrateParams = SummaryAPI.SummaryBitrateParams; + export import SummaryDurationParams = SummaryAPI.SummaryDurationParams; + export import SummaryGetParams = SummaryAPI.SummaryGetParams; + export import SummaryIPVersionParams = SummaryAPI.SummaryIPVersionParams; + export import SummaryProtocolParams = SummaryAPI.SummaryProtocolParams; + export import SummaryVectorParams = SummaryAPI.SummaryVectorParams; +} diff --git a/src/resources/radar/attacks/layer3/timeseries-groups.ts b/src/resources/radar/attacks/layer3/timeseries-groups.ts new file mode 100644 index 0000000000..1210c08870 --- /dev/null +++ b/src/resources/radar/attacks/layer3/timeseries-groups.ts @@ -0,0 +1,1031 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/attacks/layer3/timeseries-groups'; + +export class TimeseriesGroups extends APIResource { + /** + * Percentage distribution of attacks by bitrate over time. + */ + bitrate( + query?: TimeseriesGroupBitrateParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + bitrate(options?: Core.RequestOptions): Core.APIPromise; + bitrate( + query: TimeseriesGroupBitrateParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.bitrate({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/timeseries_groups/bitrate', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupBitrateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by duration over time. + */ + duration( + query?: TimeseriesGroupDurationParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + duration(options?: Core.RequestOptions): Core.APIPromise; + duration( + query: TimeseriesGroupDurationParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.duration({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/timeseries_groups/duration', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupDurationResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a timeseries of the percentage distribution of network protocols in Layer + * 3/4 attacks. + */ + get( + query?: TimeseriesGroupGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(options?: Core.RequestOptions): Core.APIPromise; + get( + query: TimeseriesGroupGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/timeseries_groups', { query, ...options }) as Core.APIPromise<{ + result: TimeseriesGroupGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by industry used over time. + */ + industry( + query?: TimeseriesGroupIndustryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + industry(options?: Core.RequestOptions): Core.APIPromise; + industry( + query: TimeseriesGroupIndustryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.industry({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/timeseries_groups/industry', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupIndustryResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by ip version used over time. + */ + ipVersion( + query?: TimeseriesGroupIPVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + ipVersion(options?: Core.RequestOptions): Core.APIPromise; + ipVersion( + query: TimeseriesGroupIPVersionParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.ipVersion({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/timeseries_groups/ip_version', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupIPVersionResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by protocol used over time. + */ + protocol( + query?: TimeseriesGroupProtocolParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + protocol(options?: Core.RequestOptions): Core.APIPromise; + protocol( + query: TimeseriesGroupProtocolParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.protocol({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/timeseries_groups/protocol', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupProtocolResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by vector used over time. + */ + vector( + query?: TimeseriesGroupVectorParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + vector(options?: Core.RequestOptions): Core.APIPromise; + vector( + query: TimeseriesGroupVectorParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.vector({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/timeseries_groups/vector', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupVectorResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by vertical used over time. + */ + vertical( + query?: TimeseriesGroupVerticalParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + vertical(options?: Core.RequestOptions): Core.APIPromise; + vertical( + query: TimeseriesGroupVerticalParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.vertical({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/timeseries_groups/vertical', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupVerticalResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TimeseriesGroupBitrateResponse { + meta: unknown; + + serie_0: TimeseriesGroupBitrateResponse.Serie0; +} + +export namespace TimeseriesGroupBitrateResponse { + export interface Serie0 { + _1_GBPS_TO_10_GBPS: Array; + + _10_GBPS_TO_100_GBPS: Array; + + _500_MBPS_TO_1_GBPS: Array; + + OVER_100_GBPS: Array; + + timestamps: Array; + + UNDER_500_MBPS: Array; + } +} + +export interface TimeseriesGroupDurationResponse { + meta: unknown; + + serie_0: TimeseriesGroupDurationResponse.Serie0; +} + +export namespace TimeseriesGroupDurationResponse { + export interface Serie0 { + _1_HOUR_TO_3_HOURS: Array; + + _10_MINS_TO_20_MINS: Array; + + _20_MINS_TO_40_MINS: Array; + + _40_MINS_TO_1_HOUR: Array; + + OVER_3_HOURS: Array; + + timestamps: Array; + + UNDER_10_MINS: Array; + } +} + +export interface TimeseriesGroupGetResponse { + meta: TimeseriesGroupGetResponse.Meta; + + serie_0: TimeseriesGroupGetResponse.Serie0; +} + +export namespace TimeseriesGroupGetResponse { + export interface Meta { + aggInterval: string; + + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Serie0 { + gre: Array; + + icmp: Array; + + tcp: Array; + + timestamps: Array; + + udp: Array; + } +} + +export interface TimeseriesGroupIndustryResponse { + meta: unknown; + + serie_0: TimeseriesGroupIndustryResponse.Serie0; +} + +export namespace TimeseriesGroupIndustryResponse { + export interface Serie0 { + timestamps: Array; + [k: string]: Array; + } +} + +export interface TimeseriesGroupIPVersionResponse { + meta: unknown; + + serie_0: TimeseriesGroupIPVersionResponse.Serie0; +} + +export namespace TimeseriesGroupIPVersionResponse { + export interface Serie0 { + IPv4: Array; + + IPv6: Array; + + timestamps: Array; + } +} + +export interface TimeseriesGroupProtocolResponse { + meta: unknown; + + serie_0: TimeseriesGroupProtocolResponse.Serie0; +} + +export namespace TimeseriesGroupProtocolResponse { + export interface Serie0 { + GRE: Array; + + ICMP: Array; + + TCP: Array; + + timestamps: Array; + + UDP: Array; + } +} + +export interface TimeseriesGroupVectorResponse { + meta: unknown; + + serie_0: TimeseriesGroupVectorResponse.Serie0; +} + +export namespace TimeseriesGroupVectorResponse { + export interface Serie0 { + timestamps: Array; + [k: string]: Array; + } +} + +export interface TimeseriesGroupVerticalResponse { + meta: unknown; + + serie_0: TimeseriesGroupVerticalResponse.Serie0; +} + +export namespace TimeseriesGroupVerticalResponse { + export interface Serie0 { + timestamps: Array; + [k: string]: Array; + } +} + +export interface TimeseriesGroupBitrateParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Normalization method applied. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface TimeseriesGroupDurationParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Normalization method applied. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface TimeseriesGroupGetParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface TimeseriesGroupIndustryParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects (eg browsers, verticals, etc) to the top items over + * the time range. + */ + limitPerGroup?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Normalization method applied. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; +} + +export interface TimeseriesGroupIPVersionParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Normalization method applied. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface TimeseriesGroupProtocolParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Normalization method applied. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; +} + +export interface TimeseriesGroupVectorParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects (eg browsers, verticals, etc) to the top items over + * the time range. + */ + limitPerGroup?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Normalization method applied. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface TimeseriesGroupVerticalParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects (eg browsers, verticals, etc) to the top items over + * the time range. + */ + limitPerGroup?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Normalization method applied. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; +} + +export namespace TimeseriesGroups { + export import TimeseriesGroupBitrateResponse = TimeseriesGroupsAPI.TimeseriesGroupBitrateResponse; + export import TimeseriesGroupDurationResponse = TimeseriesGroupsAPI.TimeseriesGroupDurationResponse; + export import TimeseriesGroupGetResponse = TimeseriesGroupsAPI.TimeseriesGroupGetResponse; + export import TimeseriesGroupIndustryResponse = TimeseriesGroupsAPI.TimeseriesGroupIndustryResponse; + export import TimeseriesGroupIPVersionResponse = TimeseriesGroupsAPI.TimeseriesGroupIPVersionResponse; + export import TimeseriesGroupProtocolResponse = TimeseriesGroupsAPI.TimeseriesGroupProtocolResponse; + export import TimeseriesGroupVectorResponse = TimeseriesGroupsAPI.TimeseriesGroupVectorResponse; + export import TimeseriesGroupVerticalResponse = TimeseriesGroupsAPI.TimeseriesGroupVerticalResponse; + export import TimeseriesGroupBitrateParams = TimeseriesGroupsAPI.TimeseriesGroupBitrateParams; + export import TimeseriesGroupDurationParams = TimeseriesGroupsAPI.TimeseriesGroupDurationParams; + export import TimeseriesGroupGetParams = TimeseriesGroupsAPI.TimeseriesGroupGetParams; + export import TimeseriesGroupIndustryParams = TimeseriesGroupsAPI.TimeseriesGroupIndustryParams; + export import TimeseriesGroupIPVersionParams = TimeseriesGroupsAPI.TimeseriesGroupIPVersionParams; + export import TimeseriesGroupProtocolParams = TimeseriesGroupsAPI.TimeseriesGroupProtocolParams; + export import TimeseriesGroupVectorParams = TimeseriesGroupsAPI.TimeseriesGroupVectorParams; + export import TimeseriesGroupVerticalParams = TimeseriesGroupsAPI.TimeseriesGroupVerticalParams; +} diff --git a/src/resources/radar/attacks/layer3/timeseries-groups/index.ts b/src/resources/radar/attacks/layer3/timeseries-groups/index.ts deleted file mode 100644 index 4ae9c77be4..0000000000 --- a/src/resources/radar/attacks/layer3/timeseries-groups/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { IPVersionListResponse, IPVersionListParams, IPVersion } from './ip-version'; -export { IndustryListResponse, IndustryListParams, Industry } from './industry'; -export { ProtocolListResponse, ProtocolListParams, Protocol } from './protocol'; -export { TimeseriesGroups } from './timeseries-groups'; -export { VectorListResponse, VectorListParams, Vector } from './vector'; -export { VerticalListResponse, VerticalListParams, Vertical } from './vertical'; diff --git a/src/resources/radar/attacks/layer3/timeseries-groups/industry.ts b/src/resources/radar/attacks/layer3/timeseries-groups/industry.ts deleted file mode 100644 index 84c248ecea..0000000000 --- a/src/resources/radar/attacks/layer3/timeseries-groups/industry.ts +++ /dev/null @@ -1,128 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as IndustryAPI from 'cloudflare/resources/radar/attacks/layer3/timeseries-groups/industry'; - -export class Industry extends APIResource { - /** - * Percentage distribution of attacks by industry used over time. - */ - list(query?: IndustryListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: IndustryListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/attacks/layer3/timeseries_groups/industry', { - query, - ...options, - }) as Core.APIPromise<{ result: IndustryListResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface IndustryListResponse { - meta: unknown; - - serie_0: IndustryListResponse.Serie0; -} - -export namespace IndustryListResponse { - export interface Serie0 { - timestamps: Array; - [k: string]: Array; - } -} - -export interface IndustryListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Together with the `location` parameter, will apply the filter to origin or - * target location. - */ - direction?: 'ORIGIN' | 'TARGET'; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filter for ip version. - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - - /** - * Limit the number of objects (eg browsers, verticals, etc) to the top items over - * the time range. - */ - limitPerGroup?: number; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Normalization method applied. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'PERCENTAGE' | 'MIN0_MAX'; -} - -export namespace Industry { - export import IndustryListResponse = IndustryAPI.IndustryListResponse; - export import IndustryListParams = IndustryAPI.IndustryListParams; -} diff --git a/src/resources/radar/attacks/layer3/timeseries-groups/ip-version.ts b/src/resources/radar/attacks/layer3/timeseries-groups/ip-version.ts deleted file mode 100644 index 47ed59ce01..0000000000 --- a/src/resources/radar/attacks/layer3/timeseries-groups/ip-version.ts +++ /dev/null @@ -1,125 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as IPVersionAPI from 'cloudflare/resources/radar/attacks/layer3/timeseries-groups/ip-version'; - -export class IPVersion extends APIResource { - /** - * Percentage distribution of attacks by ip version used over time. - */ - list(query?: IPVersionListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: IPVersionListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/attacks/layer3/timeseries_groups/ip_version', { - query, - ...options, - }) as Core.APIPromise<{ result: IPVersionListResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface IPVersionListResponse { - meta: unknown; - - serie_0: IPVersionListResponse.Serie0; -} - -export namespace IPVersionListResponse { - export interface Serie0 { - IPv4: Array; - - IPv6: Array; - - timestamps: Array; - } -} - -export interface IPVersionListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Together with the `location` parameter, will apply the filter to origin or - * target location. - */ - direction?: 'ORIGIN' | 'TARGET'; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Normalization method applied. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'PERCENTAGE' | 'MIN0_MAX'; - - /** - * Array of L3/4 attack types. - */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; -} - -export namespace IPVersion { - export import IPVersionListResponse = IPVersionAPI.IPVersionListResponse; - export import IPVersionListParams = IPVersionAPI.IPVersionListParams; -} diff --git a/src/resources/radar/attacks/layer3/timeseries-groups/protocol.ts b/src/resources/radar/attacks/layer3/timeseries-groups/protocol.ts deleted file mode 100644 index c28ea6f8c8..0000000000 --- a/src/resources/radar/attacks/layer3/timeseries-groups/protocol.ts +++ /dev/null @@ -1,129 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as ProtocolAPI from 'cloudflare/resources/radar/attacks/layer3/timeseries-groups/protocol'; - -export class Protocol extends APIResource { - /** - * Percentage distribution of attacks by protocol used over time. - */ - list(query?: ProtocolListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: ProtocolListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/attacks/layer3/timeseries_groups/protocol', { - query, - ...options, - }) as Core.APIPromise<{ result: ProtocolListResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface ProtocolListResponse { - meta: unknown; - - serie_0: ProtocolListResponse.Serie0; -} - -export namespace ProtocolListResponse { - export interface Serie0 { - GRE: Array; - - ICMP: Array; - - TCP: Array; - - timestamps: Array; - - UDP: Array; - } -} - -export interface ProtocolListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Together with the `location` parameter, will apply the filter to origin or - * target location. - */ - direction?: 'ORIGIN' | 'TARGET'; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filter for ip version. - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Normalization method applied. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'PERCENTAGE' | 'MIN0_MAX'; -} - -export namespace Protocol { - export import ProtocolListResponse = ProtocolAPI.ProtocolListResponse; - export import ProtocolListParams = ProtocolAPI.ProtocolListParams; -} diff --git a/src/resources/radar/attacks/layer3/timeseries-groups/timeseries-groups.ts b/src/resources/radar/attacks/layer3/timeseries-groups/timeseries-groups.ts deleted file mode 100644 index dbfb7717a5..0000000000 --- a/src/resources/radar/attacks/layer3/timeseries-groups/timeseries-groups.ts +++ /dev/null @@ -1,34 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import { APIResource } from 'cloudflare/resource'; -import * as IndustryAPI from 'cloudflare/resources/radar/attacks/layer3/timeseries-groups/industry'; -import * as IPVersionAPI from 'cloudflare/resources/radar/attacks/layer3/timeseries-groups/ip-version'; -import * as ProtocolAPI from 'cloudflare/resources/radar/attacks/layer3/timeseries-groups/protocol'; -import * as VectorAPI from 'cloudflare/resources/radar/attacks/layer3/timeseries-groups/vector'; -import * as VerticalAPI from 'cloudflare/resources/radar/attacks/layer3/timeseries-groups/vertical'; - -export class TimeseriesGroups extends APIResource { - industry: IndustryAPI.Industry = new IndustryAPI.Industry(this._client); - ipVersion: IPVersionAPI.IPVersion = new IPVersionAPI.IPVersion(this._client); - protocol: ProtocolAPI.Protocol = new ProtocolAPI.Protocol(this._client); - vector: VectorAPI.Vector = new VectorAPI.Vector(this._client); - vertical: VerticalAPI.Vertical = new VerticalAPI.Vertical(this._client); -} - -export namespace TimeseriesGroups { - export import Industry = IndustryAPI.Industry; - export import IndustryListResponse = IndustryAPI.IndustryListResponse; - export import IndustryListParams = IndustryAPI.IndustryListParams; - export import IPVersion = IPVersionAPI.IPVersion; - export import IPVersionListResponse = IPVersionAPI.IPVersionListResponse; - export import IPVersionListParams = IPVersionAPI.IPVersionListParams; - export import Protocol = ProtocolAPI.Protocol; - export import ProtocolListResponse = ProtocolAPI.ProtocolListResponse; - export import ProtocolListParams = ProtocolAPI.ProtocolListParams; - export import Vector = VectorAPI.Vector; - export import VectorListResponse = VectorAPI.VectorListResponse; - export import VectorListParams = VectorAPI.VectorListParams; - export import Vertical = VerticalAPI.Vertical; - export import VerticalListResponse = VerticalAPI.VerticalListResponse; - export import VerticalListParams = VerticalAPI.VerticalListParams; -} diff --git a/src/resources/radar/attacks/layer3/timeseries-groups/vector.ts b/src/resources/radar/attacks/layer3/timeseries-groups/vector.ts deleted file mode 100644 index a07add94a4..0000000000 --- a/src/resources/radar/attacks/layer3/timeseries-groups/vector.ts +++ /dev/null @@ -1,133 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as VectorAPI from 'cloudflare/resources/radar/attacks/layer3/timeseries-groups/vector'; - -export class Vector extends APIResource { - /** - * Percentage distribution of attacks by vector used over time. - */ - list(query?: VectorListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: VectorListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/attacks/layer3/timeseries_groups/vector', { - query, - ...options, - }) as Core.APIPromise<{ result: VectorListResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface VectorListResponse { - meta: unknown; - - serie_0: VectorListResponse.Serie0; -} - -export namespace VectorListResponse { - export interface Serie0 { - timestamps: Array; - [k: string]: Array; - } -} - -export interface VectorListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Together with the `location` parameter, will apply the filter to origin or - * target location. - */ - direction?: 'ORIGIN' | 'TARGET'; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filter for ip version. - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - - /** - * Limit the number of objects (eg browsers, verticals, etc) to the top items over - * the time range. - */ - limitPerGroup?: number; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Normalization method applied. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'PERCENTAGE' | 'MIN0_MAX'; - - /** - * Array of L3/4 attack types. - */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; -} - -export namespace Vector { - export import VectorListResponse = VectorAPI.VectorListResponse; - export import VectorListParams = VectorAPI.VectorListParams; -} diff --git a/src/resources/radar/attacks/layer3/timeseries-groups/vertical.ts b/src/resources/radar/attacks/layer3/timeseries-groups/vertical.ts deleted file mode 100644 index e41c6560af..0000000000 --- a/src/resources/radar/attacks/layer3/timeseries-groups/vertical.ts +++ /dev/null @@ -1,128 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as VerticalAPI from 'cloudflare/resources/radar/attacks/layer3/timeseries-groups/vertical'; - -export class Vertical extends APIResource { - /** - * Percentage distribution of attacks by vertical used over time. - */ - list(query?: VerticalListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: VerticalListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/attacks/layer3/timeseries_groups/vertical', { - query, - ...options, - }) as Core.APIPromise<{ result: VerticalListResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface VerticalListResponse { - meta: unknown; - - serie_0: VerticalListResponse.Serie0; -} - -export namespace VerticalListResponse { - export interface Serie0 { - timestamps: Array; - [k: string]: Array; - } -} - -export interface VerticalListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Together with the `location` parameter, will apply the filter to origin or - * target location. - */ - direction?: 'ORIGIN' | 'TARGET'; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filter for ip version. - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - - /** - * Limit the number of objects (eg browsers, verticals, etc) to the top items over - * the time range. - */ - limitPerGroup?: number; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Normalization method applied. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'PERCENTAGE' | 'MIN0_MAX'; -} - -export namespace Vertical { - export import VerticalListResponse = VerticalAPI.VerticalListResponse; - export import VerticalListParams = VerticalAPI.VerticalListParams; -} diff --git a/src/resources/radar/attacks/layer3/top/attacks.ts b/src/resources/radar/attacks/layer3/top/attacks.ts deleted file mode 100644 index 3a499ff7a8..0000000000 --- a/src/resources/radar/attacks/layer3/top/attacks.ts +++ /dev/null @@ -1,177 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as AttacksAPI from 'cloudflare/resources/radar/attacks/layer3/top/attacks'; - -export class Attacks extends APIResource { - /** - * Get the top attacks from origin to target location. Values are a percentage out - * of the total layer 3 attacks (with billing country). You can optionally limit - * the number of attacks per origin/target location (useful if all the top attacks - * are from or to the same location). - */ - list(query?: AttackListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: AttackListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/attacks/layer3/top/attacks', { query, ...options }) as Core.APIPromise<{ - result: AttackListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface AttackListResponse { - meta: AttackListResponse.Meta; - - top_0: Array; -} - -export namespace AttackListResponse { - export interface Meta { - dateRange: Array; - - lastUpdated: string; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Top0 { - originCountryAlpha2: string; - - originCountryName: string; - - value: string; - } -} - -export interface AttackListParams { - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filter for ip version. - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - - /** - * Limit the number of objects in the response. - */ - limit?: number; - - /** - * Array of attack origin/target location attack limits. Together with - * `limitPerLocation`, limits how many objects will be fetched per origin/target - * location. - */ - limitDirection?: 'ORIGIN' | 'TARGET'; - - /** - * Limit the number of attacks per origin/target (refer to `limitDirection` - * parameter) location. - */ - limitPerLocation?: number; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Array of L3/4 attack types. - */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; -} - -export namespace Attacks { - export import AttackListResponse = AttacksAPI.AttackListResponse; - export import AttackListParams = AttacksAPI.AttackListParams; -} diff --git a/src/resources/radar/attacks/layer3/top/index.ts b/src/resources/radar/attacks/layer3/top/index.ts index c099c694ca..bb58406b48 100644 --- a/src/resources/radar/attacks/layer3/top/index.ts +++ b/src/resources/radar/attacks/layer3/top/index.ts @@ -1,7 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -export { AttackListResponse, AttackListParams, Attacks } from './attacks'; -export { IndustryListResponse, IndustryListParams, Industry } from './industry'; -export { Locations } from './locations/index'; -export { Top } from './top'; -export { VerticalListResponse, VerticalListParams, Vertical } from './vertical'; +export { + LocationOriginResponse, + LocationTargetResponse, + LocationOriginParams, + LocationTargetParams, + Locations, +} from './locations'; +export { + TopAttacksResponse, + TopIndustryResponse, + TopVerticalResponse, + TopAttacksParams, + TopIndustryParams, + TopVerticalParams, + Top, +} from './top'; diff --git a/src/resources/radar/attacks/layer3/top/industry.ts b/src/resources/radar/attacks/layer3/top/industry.ts deleted file mode 100644 index a2995637e9..0000000000 --- a/src/resources/radar/attacks/layer3/top/industry.ts +++ /dev/null @@ -1,159 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as IndustryAPI from 'cloudflare/resources/radar/attacks/layer3/top/industry'; - -export class Industry extends APIResource { - /** - * Get the Industry of attacks. - */ - list(query?: IndustryListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: IndustryListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/attacks/layer3/top/industry', { query, ...options }) as Core.APIPromise<{ - result: IndustryListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface IndustryListResponse { - meta: IndustryListResponse.Meta; - - top_0: Array; -} - -export namespace IndustryListResponse { - export interface Meta { - dateRange: Array; - - lastUpdated: string; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Top0 { - name: string; - - value: string; - } -} - -export interface IndustryListParams { - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filter for ip version. - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - - /** - * Limit the number of objects in the response. - */ - limit?: number; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Array of L3/4 attack types. - */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; -} - -export namespace Industry { - export import IndustryListResponse = IndustryAPI.IndustryListResponse; - export import IndustryListParams = IndustryAPI.IndustryListParams; -} diff --git a/src/resources/radar/attacks/layer3/top/locations.ts b/src/resources/radar/attacks/layer3/top/locations.ts new file mode 100644 index 0000000000..bed1cfcf94 --- /dev/null +++ b/src/resources/radar/attacks/layer3/top/locations.ts @@ -0,0 +1,323 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as LocationsAPI from 'cloudflare/resources/radar/attacks/layer3/top/locations'; + +export class Locations extends APIResource { + /** + * Get the origin locations of attacks. + */ + origin( + query?: LocationOriginParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + origin(options?: Core.RequestOptions): Core.APIPromise; + origin( + query: LocationOriginParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.origin({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/top/locations/origin', { + query, + ...options, + }) as Core.APIPromise<{ result: LocationOriginResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get the target locations of attacks. + */ + target( + query?: LocationTargetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + target(options?: Core.RequestOptions): Core.APIPromise; + target( + query: LocationTargetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.target({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/top/locations/target', { + query, + ...options, + }) as Core.APIPromise<{ result: LocationTargetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface LocationOriginResponse { + meta: LocationOriginResponse.Meta; + + top_0: Array; +} + +export namespace LocationOriginResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + originCountryAlpha2: string; + + originCountryName: string; + + rank: number; + + value: string; + } +} + +export interface LocationTargetResponse { + meta: LocationTargetResponse.Meta; + + top_0: Array; +} + +export namespace LocationTargetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + rank: number; + + targetCountryAlpha2: string; + + targetCountryName: string; + + value: string; + } +} + +export interface LocationOriginParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface LocationTargetParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export namespace Locations { + export import LocationOriginResponse = LocationsAPI.LocationOriginResponse; + export import LocationTargetResponse = LocationsAPI.LocationTargetResponse; + export import LocationOriginParams = LocationsAPI.LocationOriginParams; + export import LocationTargetParams = LocationsAPI.LocationTargetParams; +} diff --git a/src/resources/radar/attacks/layer3/top/locations/index.ts b/src/resources/radar/attacks/layer3/top/locations/index.ts deleted file mode 100644 index 6330c3ae7e..0000000000 --- a/src/resources/radar/attacks/layer3/top/locations/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { Locations } from './locations'; -export { OriginListResponse, OriginListParams, Origin } from './origin'; -export { TargetListResponse, TargetListParams, Target } from './target'; diff --git a/src/resources/radar/attacks/layer3/top/locations/locations.ts b/src/resources/radar/attacks/layer3/top/locations/locations.ts deleted file mode 100644 index df63dfca80..0000000000 --- a/src/resources/radar/attacks/layer3/top/locations/locations.ts +++ /dev/null @@ -1,19 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import { APIResource } from 'cloudflare/resource'; -import * as OriginAPI from 'cloudflare/resources/radar/attacks/layer3/top/locations/origin'; -import * as TargetAPI from 'cloudflare/resources/radar/attacks/layer3/top/locations/target'; - -export class Locations extends APIResource { - origin: OriginAPI.Origin = new OriginAPI.Origin(this._client); - target: TargetAPI.Target = new TargetAPI.Target(this._client); -} - -export namespace Locations { - export import Origin = OriginAPI.Origin; - export import OriginListResponse = OriginAPI.OriginListResponse; - export import OriginListParams = OriginAPI.OriginListParams; - export import Target = TargetAPI.Target; - export import TargetListResponse = TargetAPI.TargetListResponse; - export import TargetListParams = TargetAPI.TargetListParams; -} diff --git a/src/resources/radar/attacks/layer3/top/locations/origin.ts b/src/resources/radar/attacks/layer3/top/locations/origin.ts deleted file mode 100644 index 24e43ddaa5..0000000000 --- a/src/resources/radar/attacks/layer3/top/locations/origin.ts +++ /dev/null @@ -1,164 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as OriginAPI from 'cloudflare/resources/radar/attacks/layer3/top/locations/origin'; - -export class Origin extends APIResource { - /** - * Get the origin locations of attacks. - */ - list(query?: OriginListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: OriginListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/attacks/layer3/top/locations/origin', { - query, - ...options, - }) as Core.APIPromise<{ result: OriginListResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface OriginListResponse { - meta: OriginListResponse.Meta; - - top_0: Array; -} - -export namespace OriginListResponse { - export interface Meta { - dateRange: Array; - - lastUpdated: string; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Top0 { - originCountryAlpha2: string; - - originCountryName: string; - - rank: number; - - value: string; - } -} - -export interface OriginListParams { - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filter for ip version. - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - - /** - * Limit the number of objects in the response. - */ - limit?: number; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Array of L3/4 attack types. - */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; -} - -export namespace Origin { - export import OriginListResponse = OriginAPI.OriginListResponse; - export import OriginListParams = OriginAPI.OriginListParams; -} diff --git a/src/resources/radar/attacks/layer3/top/locations/target.ts b/src/resources/radar/attacks/layer3/top/locations/target.ts deleted file mode 100644 index 4a4c2e1ef8..0000000000 --- a/src/resources/radar/attacks/layer3/top/locations/target.ts +++ /dev/null @@ -1,164 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as TargetAPI from 'cloudflare/resources/radar/attacks/layer3/top/locations/target'; - -export class Target extends APIResource { - /** - * Get the target locations of attacks. - */ - list(query?: TargetListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: TargetListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/attacks/layer3/top/locations/target', { - query, - ...options, - }) as Core.APIPromise<{ result: TargetListResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface TargetListResponse { - meta: TargetListResponse.Meta; - - top_0: Array; -} - -export namespace TargetListResponse { - export interface Meta { - dateRange: Array; - - lastUpdated: string; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Top0 { - rank: number; - - targetCountryAlpha2: string; - - targetCountryName: string; - - value: string; - } -} - -export interface TargetListParams { - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filter for ip version. - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - - /** - * Limit the number of objects in the response. - */ - limit?: number; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Array of L3/4 attack types. - */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; -} - -export namespace Target { - export import TargetListResponse = TargetAPI.TargetListResponse; - export import TargetListParams = TargetAPI.TargetListParams; -} diff --git a/src/resources/radar/attacks/layer3/top/top.ts b/src/resources/radar/attacks/layer3/top/top.ts index f89e947f03..dc3c9f48bb 100644 --- a/src/resources/radar/attacks/layer3/top/top.ts +++ b/src/resources/radar/attacks/layer3/top/top.ts @@ -1,27 +1,481 @@ // File generated from our OpenAPI spec by Stainless. +import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as AttacksAPI from 'cloudflare/resources/radar/attacks/layer3/top/attacks'; -import * as IndustryAPI from 'cloudflare/resources/radar/attacks/layer3/top/industry'; -import * as VerticalAPI from 'cloudflare/resources/radar/attacks/layer3/top/vertical'; -import * as LocationsAPI from 'cloudflare/resources/radar/attacks/layer3/top/locations/locations'; +import { isRequestOptions } from 'cloudflare/core'; +import * as TopAPI from 'cloudflare/resources/radar/attacks/layer3/top/top'; +import * as LocationsAPI from 'cloudflare/resources/radar/attacks/layer3/top/locations'; export class Top extends APIResource { - attacks: AttacksAPI.Attacks = new AttacksAPI.Attacks(this._client); - industry: IndustryAPI.Industry = new IndustryAPI.Industry(this._client); locations: LocationsAPI.Locations = new LocationsAPI.Locations(this._client); - vertical: VerticalAPI.Vertical = new VerticalAPI.Vertical(this._client); + + /** + * Get the top attacks from origin to target location. Values are a percentage out + * of the total layer 3 attacks (with billing country). You can optionally limit + * the number of attacks per origin/target location (useful if all the top attacks + * are from or to the same location). + */ + attacks(query?: TopAttacksParams, options?: Core.RequestOptions): Core.APIPromise; + attacks(options?: Core.RequestOptions): Core.APIPromise; + attacks( + query: TopAttacksParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.attacks({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/top/attacks', { query, ...options }) as Core.APIPromise<{ + result: TopAttacksResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get the Industry of attacks. + */ + industry(query?: TopIndustryParams, options?: Core.RequestOptions): Core.APIPromise; + industry(options?: Core.RequestOptions): Core.APIPromise; + industry( + query: TopIndustryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.industry({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/top/industry', { query, ...options }) as Core.APIPromise<{ + result: TopIndustryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get the Verticals of attacks. + */ + vertical(query?: TopVerticalParams, options?: Core.RequestOptions): Core.APIPromise; + vertical(options?: Core.RequestOptions): Core.APIPromise; + vertical( + query: TopVerticalParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.vertical({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/top/vertical', { query, ...options }) as Core.APIPromise<{ + result: TopVerticalResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TopAttacksResponse { + meta: TopAttacksResponse.Meta; + + top_0: Array; +} + +export namespace TopAttacksResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + originCountryAlpha2: string; + + originCountryName: string; + + value: string; + } +} + +export interface TopIndustryResponse { + meta: TopIndustryResponse.Meta; + + top_0: Array; +} + +export namespace TopIndustryResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + name: string; + + value: string; + } +} + +export interface TopVerticalResponse { + meta: TopVerticalResponse.Meta; + + top_0: Array; +} + +export namespace TopVerticalResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + name: string; + + value: string; + } +} + +export interface TopAttacksParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of attack origin/target location attack limits. Together with + * `limitPerLocation`, limits how many objects will be fetched per origin/target + * location. + */ + limitDirection?: 'ORIGIN' | 'TARGET'; + + /** + * Limit the number of attacks per origin/target (refer to `limitDirection` + * parameter) location. + */ + limitPerLocation?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface TopIndustryParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface TopVerticalParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; } export namespace Top { - export import Attacks = AttacksAPI.Attacks; - export import AttackListResponse = AttacksAPI.AttackListResponse; - export import AttackListParams = AttacksAPI.AttackListParams; - export import Industry = IndustryAPI.Industry; - export import IndustryListResponse = IndustryAPI.IndustryListResponse; - export import IndustryListParams = IndustryAPI.IndustryListParams; + export import TopAttacksResponse = TopAPI.TopAttacksResponse; + export import TopIndustryResponse = TopAPI.TopIndustryResponse; + export import TopVerticalResponse = TopAPI.TopVerticalResponse; + export import TopAttacksParams = TopAPI.TopAttacksParams; + export import TopIndustryParams = TopAPI.TopIndustryParams; + export import TopVerticalParams = TopAPI.TopVerticalParams; export import Locations = LocationsAPI.Locations; - export import Vertical = VerticalAPI.Vertical; - export import VerticalListResponse = VerticalAPI.VerticalListResponse; - export import VerticalListParams = VerticalAPI.VerticalListParams; + export import LocationOriginResponse = LocationsAPI.LocationOriginResponse; + export import LocationTargetResponse = LocationsAPI.LocationTargetResponse; + export import LocationOriginParams = LocationsAPI.LocationOriginParams; + export import LocationTargetParams = LocationsAPI.LocationTargetParams; } diff --git a/src/resources/radar/attacks/layer3/top/vertical.ts b/src/resources/radar/attacks/layer3/top/vertical.ts deleted file mode 100644 index 3b87a383d5..0000000000 --- a/src/resources/radar/attacks/layer3/top/vertical.ts +++ /dev/null @@ -1,159 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as VerticalAPI from 'cloudflare/resources/radar/attacks/layer3/top/vertical'; - -export class Vertical extends APIResource { - /** - * Get the Verticals of attacks. - */ - list(query?: VerticalListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: VerticalListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/attacks/layer3/top/vertical', { query, ...options }) as Core.APIPromise<{ - result: VerticalListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface VerticalListResponse { - meta: VerticalListResponse.Meta; - - top_0: Array; -} - -export namespace VerticalListResponse { - export interface Meta { - dateRange: Array; - - lastUpdated: string; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Top0 { - name: string; - - value: string; - } -} - -export interface VerticalListParams { - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filter for ip version. - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - - /** - * Limit the number of objects in the response. - */ - limit?: number; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Array of L3/4 attack types. - */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; -} - -export namespace Vertical { - export import VerticalListResponse = VerticalAPI.VerticalListResponse; - export import VerticalListParams = VerticalAPI.VerticalListParams; -} diff --git a/src/resources/radar/attacks/layer7/index.ts b/src/resources/radar/attacks/layer7/index.ts new file mode 100644 index 0000000000..d34526e841 --- /dev/null +++ b/src/resources/radar/attacks/layer7/index.ts @@ -0,0 +1,46 @@ +// File generated from our OpenAPI spec by Stainless. + +export { Layer7TimeseriesResponse, Layer7TimeseriesParams, Layer7 } from './layer7'; +export { + SummaryBitrateResponse, + SummaryDurationResponse, + SummaryGetResponse, + SummaryIPVersionResponse, + SummaryProtocolResponse, + SummaryVectorResponse, + SummaryBitrateParams, + SummaryDurationParams, + SummaryGetParams, + SummaryIPVersionParams, + SummaryProtocolParams, + SummaryVectorParams, + Summary, +} from './summary'; +export { + TimeseriesGroupBitrateResponse, + TimeseriesGroupDurationResponse, + TimeseriesGroupGetResponse, + TimeseriesGroupIndustryResponse, + TimeseriesGroupIPVersionResponse, + TimeseriesGroupProtocolResponse, + TimeseriesGroupVectorResponse, + TimeseriesGroupVerticalResponse, + TimeseriesGroupBitrateParams, + TimeseriesGroupDurationParams, + TimeseriesGroupGetParams, + TimeseriesGroupIndustryParams, + TimeseriesGroupIPVersionParams, + TimeseriesGroupProtocolParams, + TimeseriesGroupVectorParams, + TimeseriesGroupVerticalParams, + TimeseriesGroups, +} from './timeseries-groups'; +export { + TopAttacksResponse, + TopIndustryResponse, + TopVerticalResponse, + TopAttacksParams, + TopIndustryParams, + TopVerticalParams, + Top, +} from './top/index'; diff --git a/src/resources/radar/attacks/layer7/layer7.ts b/src/resources/radar/attacks/layer7/layer7.ts new file mode 100644 index 0000000000..db9ddc6d62 --- /dev/null +++ b/src/resources/radar/attacks/layer7/layer7.ts @@ -0,0 +1,188 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as Layer7API from 'cloudflare/resources/radar/attacks/layer7/layer7'; +import * as SummaryAPI from 'cloudflare/resources/radar/attacks/layer7/summary'; +import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/attacks/layer7/timeseries-groups'; +import * as TopAPI from 'cloudflare/resources/radar/attacks/layer7/top/top'; + +export class Layer7 extends APIResource { + summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); + timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( + this._client, + ); + top: TopAPI.Top = new TopAPI.Top(this._client); + + /** + * Get attacks change over time by bytes. + */ + timeseries( + query?: Layer7TimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: Layer7TimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/timeseries', { query, ...options }) as Core.APIPromise<{ + result: Layer7TimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface Layer7TimeseriesResponse { + meta: unknown; + + serie_0: Layer7TimeseriesResponse.Serie0; +} + +export namespace Layer7TimeseriesResponse { + export interface Serie0 { + timestamps: Array; + + values: Array; + } +} + +export interface Layer7TimeseriesParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Measurement units, eg. bytes. + */ + metric?: 'BYTES' | 'BYTES_OLD'; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Normalization method applied. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export namespace Layer7 { + export import Layer7TimeseriesResponse = Layer7API.Layer7TimeseriesResponse; + export import Layer7TimeseriesParams = Layer7API.Layer7TimeseriesParams; + export import Summary = SummaryAPI.Summary; + export import SummaryBitrateResponse = SummaryAPI.SummaryBitrateResponse; + export import SummaryDurationResponse = SummaryAPI.SummaryDurationResponse; + export import SummaryGetResponse = SummaryAPI.SummaryGetResponse; + export import SummaryIPVersionResponse = SummaryAPI.SummaryIPVersionResponse; + export import SummaryProtocolResponse = SummaryAPI.SummaryProtocolResponse; + export import SummaryVectorResponse = SummaryAPI.SummaryVectorResponse; + export import SummaryBitrateParams = SummaryAPI.SummaryBitrateParams; + export import SummaryDurationParams = SummaryAPI.SummaryDurationParams; + export import SummaryGetParams = SummaryAPI.SummaryGetParams; + export import SummaryIPVersionParams = SummaryAPI.SummaryIPVersionParams; + export import SummaryProtocolParams = SummaryAPI.SummaryProtocolParams; + export import SummaryVectorParams = SummaryAPI.SummaryVectorParams; + export import TimeseriesGroups = TimeseriesGroupsAPI.TimeseriesGroups; + export import TimeseriesGroupBitrateResponse = TimeseriesGroupsAPI.TimeseriesGroupBitrateResponse; + export import TimeseriesGroupDurationResponse = TimeseriesGroupsAPI.TimeseriesGroupDurationResponse; + export import TimeseriesGroupGetResponse = TimeseriesGroupsAPI.TimeseriesGroupGetResponse; + export import TimeseriesGroupIndustryResponse = TimeseriesGroupsAPI.TimeseriesGroupIndustryResponse; + export import TimeseriesGroupIPVersionResponse = TimeseriesGroupsAPI.TimeseriesGroupIPVersionResponse; + export import TimeseriesGroupProtocolResponse = TimeseriesGroupsAPI.TimeseriesGroupProtocolResponse; + export import TimeseriesGroupVectorResponse = TimeseriesGroupsAPI.TimeseriesGroupVectorResponse; + export import TimeseriesGroupVerticalResponse = TimeseriesGroupsAPI.TimeseriesGroupVerticalResponse; + export import TimeseriesGroupBitrateParams = TimeseriesGroupsAPI.TimeseriesGroupBitrateParams; + export import TimeseriesGroupDurationParams = TimeseriesGroupsAPI.TimeseriesGroupDurationParams; + export import TimeseriesGroupGetParams = TimeseriesGroupsAPI.TimeseriesGroupGetParams; + export import TimeseriesGroupIndustryParams = TimeseriesGroupsAPI.TimeseriesGroupIndustryParams; + export import TimeseriesGroupIPVersionParams = TimeseriesGroupsAPI.TimeseriesGroupIPVersionParams; + export import TimeseriesGroupProtocolParams = TimeseriesGroupsAPI.TimeseriesGroupProtocolParams; + export import TimeseriesGroupVectorParams = TimeseriesGroupsAPI.TimeseriesGroupVectorParams; + export import TimeseriesGroupVerticalParams = TimeseriesGroupsAPI.TimeseriesGroupVerticalParams; + export import Top = TopAPI.Top; + export import TopAttacksResponse = TopAPI.TopAttacksResponse; + export import TopIndustryResponse = TopAPI.TopIndustryResponse; + export import TopVerticalResponse = TopAPI.TopVerticalResponse; + export import TopAttacksParams = TopAPI.TopAttacksParams; + export import TopIndustryParams = TopAPI.TopIndustryParams; + export import TopVerticalParams = TopAPI.TopVerticalParams; +} diff --git a/src/resources/radar/attacks/layer7/summary.ts b/src/resources/radar/attacks/layer7/summary.ts new file mode 100644 index 0000000000..ef28bf8d86 --- /dev/null +++ b/src/resources/radar/attacks/layer7/summary.ts @@ -0,0 +1,923 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as SummaryAPI from 'cloudflare/resources/radar/attacks/layer7/summary'; + +export class Summary extends APIResource { + /** + * Percentage distribution of attacks by bitrate. + */ + bitrate( + query?: SummaryBitrateParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + bitrate(options?: Core.RequestOptions): Core.APIPromise; + bitrate( + query: SummaryBitrateParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.bitrate({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/summary/bitrate', { query, ...options }) as Core.APIPromise<{ + result: SummaryBitrateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by duration. + */ + duration( + query?: SummaryDurationParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + duration(options?: Core.RequestOptions): Core.APIPromise; + duration( + query: SummaryDurationParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.duration({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/summary/duration', { query, ...options }) as Core.APIPromise<{ + result: SummaryDurationResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of network protocols in layer 3/4 attacks over a given + * time period. + */ + get(query?: SummaryGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(options?: Core.RequestOptions): Core.APIPromise; + get( + query: SummaryGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/summary', { query, ...options }) as Core.APIPromise<{ + result: SummaryGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by ip version used. + */ + ipVersion( + query?: SummaryIPVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + ipVersion(options?: Core.RequestOptions): Core.APIPromise; + ipVersion( + query: SummaryIPVersionParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.ipVersion({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/summary/ip_version', { query, ...options }) as Core.APIPromise<{ + result: SummaryIPVersionResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by protocol used. + */ + protocol( + query?: SummaryProtocolParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + protocol(options?: Core.RequestOptions): Core.APIPromise; + protocol( + query: SummaryProtocolParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.protocol({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/summary/protocol', { query, ...options }) as Core.APIPromise<{ + result: SummaryProtocolResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by vector. + */ + vector(query?: SummaryVectorParams, options?: Core.RequestOptions): Core.APIPromise; + vector(options?: Core.RequestOptions): Core.APIPromise; + vector( + query: SummaryVectorParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.vector({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/summary/vector', { query, ...options }) as Core.APIPromise<{ + result: SummaryVectorResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SummaryBitrateResponse { + meta: SummaryBitrateResponse.Meta; + + summary_0: SummaryBitrateResponse.Summary0; +} + +export namespace SummaryBitrateResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + _1_GBPS_TO_10_GBPS: string; + + _10_GBPS_TO_100_GBPS: string; + + _500_MBPS_TO_1_GBPS: string; + + OVER_100_GBPS: string; + + UNDER_500_MBPS: string; + } +} + +export interface SummaryDurationResponse { + meta: SummaryDurationResponse.Meta; + + summary_0: SummaryDurationResponse.Summary0; +} + +export namespace SummaryDurationResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + _1_HOUR_TO_3_HOURS: string; + + _10_MINS_TO_20_MINS: string; + + _20_MINS_TO_40_MINS: string; + + _40_MINS_TO_1_HOUR: string; + + OVER_3_HOURS: string; + + UNDER_10_MINS: string; + } +} + +export interface SummaryGetResponse { + meta: SummaryGetResponse.Meta; + + summary_0: SummaryGetResponse.Summary0; +} + +export namespace SummaryGetResponse { + export interface Meta { + dateRange: Array; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + gre: string; + + icmp: string; + + tcp: string; + + udp: string; + } +} + +export interface SummaryIPVersionResponse { + meta: SummaryIPVersionResponse.Meta; + + summary_0: SummaryIPVersionResponse.Summary0; +} + +export namespace SummaryIPVersionResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + IPv4: string; + + IPv6: string; + } +} + +export interface SummaryProtocolResponse { + meta: SummaryProtocolResponse.Meta; + + summary_0: SummaryProtocolResponse.Summary0; +} + +export namespace SummaryProtocolResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + GRE: string; + + ICMP: string; + + TCP: string; + + UDP: string; + } +} + +export interface SummaryVectorResponse { + meta: SummaryVectorResponse.Meta; + + summary_0: Record>; +} + +export namespace SummaryVectorResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } +} + +export interface SummaryBitrateParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface SummaryDurationParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface SummaryGetParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface SummaryIPVersionParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface SummaryProtocolParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface SummaryVectorParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export namespace Summary { + export import SummaryBitrateResponse = SummaryAPI.SummaryBitrateResponse; + export import SummaryDurationResponse = SummaryAPI.SummaryDurationResponse; + export import SummaryGetResponse = SummaryAPI.SummaryGetResponse; + export import SummaryIPVersionResponse = SummaryAPI.SummaryIPVersionResponse; + export import SummaryProtocolResponse = SummaryAPI.SummaryProtocolResponse; + export import SummaryVectorResponse = SummaryAPI.SummaryVectorResponse; + export import SummaryBitrateParams = SummaryAPI.SummaryBitrateParams; + export import SummaryDurationParams = SummaryAPI.SummaryDurationParams; + export import SummaryGetParams = SummaryAPI.SummaryGetParams; + export import SummaryIPVersionParams = SummaryAPI.SummaryIPVersionParams; + export import SummaryProtocolParams = SummaryAPI.SummaryProtocolParams; + export import SummaryVectorParams = SummaryAPI.SummaryVectorParams; +} diff --git a/src/resources/radar/attacks/layer7/timeseries-groups.ts b/src/resources/radar/attacks/layer7/timeseries-groups.ts new file mode 100644 index 0000000000..53192fd83a --- /dev/null +++ b/src/resources/radar/attacks/layer7/timeseries-groups.ts @@ -0,0 +1,1031 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/attacks/layer7/timeseries-groups'; + +export class TimeseriesGroups extends APIResource { + /** + * Percentage distribution of attacks by bitrate over time. + */ + bitrate( + query?: TimeseriesGroupBitrateParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + bitrate(options?: Core.RequestOptions): Core.APIPromise; + bitrate( + query: TimeseriesGroupBitrateParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.bitrate({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/timeseries_groups/bitrate', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupBitrateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by duration over time. + */ + duration( + query?: TimeseriesGroupDurationParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + duration(options?: Core.RequestOptions): Core.APIPromise; + duration( + query: TimeseriesGroupDurationParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.duration({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/timeseries_groups/duration', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupDurationResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a timeseries of the percentage distribution of network protocols in Layer + * 3/4 attacks. + */ + get( + query?: TimeseriesGroupGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(options?: Core.RequestOptions): Core.APIPromise; + get( + query: TimeseriesGroupGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/timeseries_groups', { query, ...options }) as Core.APIPromise<{ + result: TimeseriesGroupGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by industry used over time. + */ + industry( + query?: TimeseriesGroupIndustryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + industry(options?: Core.RequestOptions): Core.APIPromise; + industry( + query: TimeseriesGroupIndustryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.industry({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/timeseries_groups/industry', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupIndustryResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by ip version used over time. + */ + ipVersion( + query?: TimeseriesGroupIPVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + ipVersion(options?: Core.RequestOptions): Core.APIPromise; + ipVersion( + query: TimeseriesGroupIPVersionParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.ipVersion({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/timeseries_groups/ip_version', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupIPVersionResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by protocol used over time. + */ + protocol( + query?: TimeseriesGroupProtocolParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + protocol(options?: Core.RequestOptions): Core.APIPromise; + protocol( + query: TimeseriesGroupProtocolParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.protocol({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/timeseries_groups/protocol', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupProtocolResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by vector used over time. + */ + vector( + query?: TimeseriesGroupVectorParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + vector(options?: Core.RequestOptions): Core.APIPromise; + vector( + query: TimeseriesGroupVectorParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.vector({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/timeseries_groups/vector', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupVectorResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of attacks by vertical used over time. + */ + vertical( + query?: TimeseriesGroupVerticalParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + vertical(options?: Core.RequestOptions): Core.APIPromise; + vertical( + query: TimeseriesGroupVerticalParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.vertical({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/timeseries_groups/vertical', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupVerticalResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TimeseriesGroupBitrateResponse { + meta: unknown; + + serie_0: TimeseriesGroupBitrateResponse.Serie0; +} + +export namespace TimeseriesGroupBitrateResponse { + export interface Serie0 { + _1_GBPS_TO_10_GBPS: Array; + + _10_GBPS_TO_100_GBPS: Array; + + _500_MBPS_TO_1_GBPS: Array; + + OVER_100_GBPS: Array; + + timestamps: Array; + + UNDER_500_MBPS: Array; + } +} + +export interface TimeseriesGroupDurationResponse { + meta: unknown; + + serie_0: TimeseriesGroupDurationResponse.Serie0; +} + +export namespace TimeseriesGroupDurationResponse { + export interface Serie0 { + _1_HOUR_TO_3_HOURS: Array; + + _10_MINS_TO_20_MINS: Array; + + _20_MINS_TO_40_MINS: Array; + + _40_MINS_TO_1_HOUR: Array; + + OVER_3_HOURS: Array; + + timestamps: Array; + + UNDER_10_MINS: Array; + } +} + +export interface TimeseriesGroupGetResponse { + meta: TimeseriesGroupGetResponse.Meta; + + serie_0: TimeseriesGroupGetResponse.Serie0; +} + +export namespace TimeseriesGroupGetResponse { + export interface Meta { + aggInterval: string; + + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Serie0 { + gre: Array; + + icmp: Array; + + tcp: Array; + + timestamps: Array; + + udp: Array; + } +} + +export interface TimeseriesGroupIndustryResponse { + meta: unknown; + + serie_0: TimeseriesGroupIndustryResponse.Serie0; +} + +export namespace TimeseriesGroupIndustryResponse { + export interface Serie0 { + timestamps: Array; + [k: string]: Array; + } +} + +export interface TimeseriesGroupIPVersionResponse { + meta: unknown; + + serie_0: TimeseriesGroupIPVersionResponse.Serie0; +} + +export namespace TimeseriesGroupIPVersionResponse { + export interface Serie0 { + IPv4: Array; + + IPv6: Array; + + timestamps: Array; + } +} + +export interface TimeseriesGroupProtocolResponse { + meta: unknown; + + serie_0: TimeseriesGroupProtocolResponse.Serie0; +} + +export namespace TimeseriesGroupProtocolResponse { + export interface Serie0 { + GRE: Array; + + ICMP: Array; + + TCP: Array; + + timestamps: Array; + + UDP: Array; + } +} + +export interface TimeseriesGroupVectorResponse { + meta: unknown; + + serie_0: TimeseriesGroupVectorResponse.Serie0; +} + +export namespace TimeseriesGroupVectorResponse { + export interface Serie0 { + timestamps: Array; + [k: string]: Array; + } +} + +export interface TimeseriesGroupVerticalResponse { + meta: unknown; + + serie_0: TimeseriesGroupVerticalResponse.Serie0; +} + +export namespace TimeseriesGroupVerticalResponse { + export interface Serie0 { + timestamps: Array; + [k: string]: Array; + } +} + +export interface TimeseriesGroupBitrateParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Normalization method applied. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface TimeseriesGroupDurationParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Normalization method applied. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface TimeseriesGroupGetParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface TimeseriesGroupIndustryParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects (eg browsers, verticals, etc) to the top items over + * the time range. + */ + limitPerGroup?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Normalization method applied. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; +} + +export interface TimeseriesGroupIPVersionParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Normalization method applied. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface TimeseriesGroupProtocolParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Normalization method applied. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; +} + +export interface TimeseriesGroupVectorParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects (eg browsers, verticals, etc) to the top items over + * the time range. + */ + limitPerGroup?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Normalization method applied. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface TimeseriesGroupVerticalParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Together with the `location` parameter, will apply the filter to origin or + * target location. + */ + direction?: 'ORIGIN' | 'TARGET'; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects (eg browsers, verticals, etc) to the top items over + * the time range. + */ + limitPerGroup?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Normalization method applied. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; +} + +export namespace TimeseriesGroups { + export import TimeseriesGroupBitrateResponse = TimeseriesGroupsAPI.TimeseriesGroupBitrateResponse; + export import TimeseriesGroupDurationResponse = TimeseriesGroupsAPI.TimeseriesGroupDurationResponse; + export import TimeseriesGroupGetResponse = TimeseriesGroupsAPI.TimeseriesGroupGetResponse; + export import TimeseriesGroupIndustryResponse = TimeseriesGroupsAPI.TimeseriesGroupIndustryResponse; + export import TimeseriesGroupIPVersionResponse = TimeseriesGroupsAPI.TimeseriesGroupIPVersionResponse; + export import TimeseriesGroupProtocolResponse = TimeseriesGroupsAPI.TimeseriesGroupProtocolResponse; + export import TimeseriesGroupVectorResponse = TimeseriesGroupsAPI.TimeseriesGroupVectorResponse; + export import TimeseriesGroupVerticalResponse = TimeseriesGroupsAPI.TimeseriesGroupVerticalResponse; + export import TimeseriesGroupBitrateParams = TimeseriesGroupsAPI.TimeseriesGroupBitrateParams; + export import TimeseriesGroupDurationParams = TimeseriesGroupsAPI.TimeseriesGroupDurationParams; + export import TimeseriesGroupGetParams = TimeseriesGroupsAPI.TimeseriesGroupGetParams; + export import TimeseriesGroupIndustryParams = TimeseriesGroupsAPI.TimeseriesGroupIndustryParams; + export import TimeseriesGroupIPVersionParams = TimeseriesGroupsAPI.TimeseriesGroupIPVersionParams; + export import TimeseriesGroupProtocolParams = TimeseriesGroupsAPI.TimeseriesGroupProtocolParams; + export import TimeseriesGroupVectorParams = TimeseriesGroupsAPI.TimeseriesGroupVectorParams; + export import TimeseriesGroupVerticalParams = TimeseriesGroupsAPI.TimeseriesGroupVerticalParams; +} diff --git a/src/resources/radar/attacks/layer7/top/index.ts b/src/resources/radar/attacks/layer7/top/index.ts new file mode 100644 index 0000000000..bb58406b48 --- /dev/null +++ b/src/resources/radar/attacks/layer7/top/index.ts @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec by Stainless. + +export { + LocationOriginResponse, + LocationTargetResponse, + LocationOriginParams, + LocationTargetParams, + Locations, +} from './locations'; +export { + TopAttacksResponse, + TopIndustryResponse, + TopVerticalResponse, + TopAttacksParams, + TopIndustryParams, + TopVerticalParams, + Top, +} from './top'; diff --git a/src/resources/radar/attacks/layer7/top/locations.ts b/src/resources/radar/attacks/layer7/top/locations.ts new file mode 100644 index 0000000000..6f4ef7834b --- /dev/null +++ b/src/resources/radar/attacks/layer7/top/locations.ts @@ -0,0 +1,323 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as LocationsAPI from 'cloudflare/resources/radar/attacks/layer7/top/locations'; + +export class Locations extends APIResource { + /** + * Get the origin locations of attacks. + */ + origin( + query?: LocationOriginParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + origin(options?: Core.RequestOptions): Core.APIPromise; + origin( + query: LocationOriginParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.origin({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/top/locations/origin', { + query, + ...options, + }) as Core.APIPromise<{ result: LocationOriginResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get the target locations of attacks. + */ + target( + query?: LocationTargetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + target(options?: Core.RequestOptions): Core.APIPromise; + target( + query: LocationTargetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.target({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/top/locations/target', { + query, + ...options, + }) as Core.APIPromise<{ result: LocationTargetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface LocationOriginResponse { + meta: LocationOriginResponse.Meta; + + top_0: Array; +} + +export namespace LocationOriginResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + originCountryAlpha2: string; + + originCountryName: string; + + rank: number; + + value: string; + } +} + +export interface LocationTargetResponse { + meta: LocationTargetResponse.Meta; + + top_0: Array; +} + +export namespace LocationTargetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + rank: number; + + targetCountryAlpha2: string; + + targetCountryName: string; + + value: string; + } +} + +export interface LocationOriginParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface LocationTargetParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export namespace Locations { + export import LocationOriginResponse = LocationsAPI.LocationOriginResponse; + export import LocationTargetResponse = LocationsAPI.LocationTargetResponse; + export import LocationOriginParams = LocationsAPI.LocationOriginParams; + export import LocationTargetParams = LocationsAPI.LocationTargetParams; +} diff --git a/src/resources/radar/attacks/layer7/top/top.ts b/src/resources/radar/attacks/layer7/top/top.ts new file mode 100644 index 0000000000..23568c1efb --- /dev/null +++ b/src/resources/radar/attacks/layer7/top/top.ts @@ -0,0 +1,481 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as TopAPI from 'cloudflare/resources/radar/attacks/layer7/top/top'; +import * as LocationsAPI from 'cloudflare/resources/radar/attacks/layer7/top/locations'; + +export class Top extends APIResource { + locations: LocationsAPI.Locations = new LocationsAPI.Locations(this._client); + + /** + * Get the top attacks from origin to target location. Values are a percentage out + * of the total layer 3 attacks (with billing country). You can optionally limit + * the number of attacks per origin/target location (useful if all the top attacks + * are from or to the same location). + */ + attacks(query?: TopAttacksParams, options?: Core.RequestOptions): Core.APIPromise; + attacks(options?: Core.RequestOptions): Core.APIPromise; + attacks( + query: TopAttacksParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.attacks({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/top/attacks', { query, ...options }) as Core.APIPromise<{ + result: TopAttacksResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get the Industry of attacks. + */ + industry(query?: TopIndustryParams, options?: Core.RequestOptions): Core.APIPromise; + industry(options?: Core.RequestOptions): Core.APIPromise; + industry( + query: TopIndustryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.industry({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/top/industry', { query, ...options }) as Core.APIPromise<{ + result: TopIndustryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get the Verticals of attacks. + */ + vertical(query?: TopVerticalParams, options?: Core.RequestOptions): Core.APIPromise; + vertical(options?: Core.RequestOptions): Core.APIPromise; + vertical( + query: TopVerticalParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.vertical({}, query); + } + return ( + this._client.get('/radar/attacks/layer3/top/vertical', { query, ...options }) as Core.APIPromise<{ + result: TopVerticalResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TopAttacksResponse { + meta: TopAttacksResponse.Meta; + + top_0: Array; +} + +export namespace TopAttacksResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + originCountryAlpha2: string; + + originCountryName: string; + + value: string; + } +} + +export interface TopIndustryResponse { + meta: TopIndustryResponse.Meta; + + top_0: Array; +} + +export namespace TopIndustryResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + name: string; + + value: string; + } +} + +export interface TopVerticalResponse { + meta: TopVerticalResponse.Meta; + + top_0: Array; +} + +export namespace TopVerticalResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + name: string; + + value: string; + } +} + +export interface TopAttacksParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of attack origin/target location attack limits. Together with + * `limitPerLocation`, limits how many objects will be fetched per origin/target + * location. + */ + limitDirection?: 'ORIGIN' | 'TARGET'; + + /** + * Limit the number of attacks per origin/target (refer to `limitDirection` + * parameter) location. + */ + limitPerLocation?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface TopIndustryParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export interface TopVerticalParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of L3/4 attack types. + */ + protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; +} + +export namespace Top { + export import TopAttacksResponse = TopAPI.TopAttacksResponse; + export import TopIndustryResponse = TopAPI.TopIndustryResponse; + export import TopVerticalResponse = TopAPI.TopVerticalResponse; + export import TopAttacksParams = TopAPI.TopAttacksParams; + export import TopIndustryParams = TopAPI.TopIndustryParams; + export import TopVerticalParams = TopAPI.TopVerticalParams; + export import Locations = LocationsAPI.Locations; + export import LocationOriginResponse = LocationsAPI.LocationOriginResponse; + export import LocationTargetResponse = LocationsAPI.LocationTargetResponse; + export import LocationOriginParams = LocationsAPI.LocationOriginParams; + export import LocationTargetParams = LocationsAPI.LocationTargetParams; +} diff --git a/src/resources/radar/bgp/bgp.ts b/src/resources/radar/bgp/bgp.ts index 72c462c20a..89a224bc43 100644 --- a/src/resources/radar/bgp/bgp.ts +++ b/src/resources/radar/bgp/bgp.ts @@ -1,29 +1,191 @@ // File generated from our OpenAPI spec by Stainless. +import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as BGPAPI from 'cloudflare/resources/radar/bgp/bgp'; import * as HijacksAPI from 'cloudflare/resources/radar/bgp/hijacks'; -import * as TimeseriesAPI from 'cloudflare/resources/radar/bgp/timeseries'; -import * as LeaksAPI from 'cloudflare/resources/radar/bgp/leaks/leaks'; -import * as RoutesAPI from 'cloudflare/resources/radar/bgp/routes/routes'; +import * as LeaksAPI from 'cloudflare/resources/radar/bgp/leaks'; +import * as RoutesAPI from 'cloudflare/resources/radar/bgp/routes'; import * as TopsAPI from 'cloudflare/resources/radar/bgp/tops/tops'; export class BGP extends APIResource { leaks: LeaksAPI.Leaks = new LeaksAPI.Leaks(this._client); - timeseries: TimeseriesAPI.Timeseries = new TimeseriesAPI.Timeseries(this._client); tops: TopsAPI.Tops = new TopsAPI.Tops(this._client); hijacks: HijacksAPI.Hijacks = new HijacksAPI.Hijacks(this._client); routes: RoutesAPI.Routes = new RoutesAPI.Routes(this._client); + + /** + * Gets BGP updates change over time. Raw values are returned. When requesting + * updates of an autonomous system (AS), only BGP updates of type announcement are + * returned. + */ + timeseries( + query?: BGPTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: BGPTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/bgp/timeseries', { query, ...options }) as Core.APIPromise<{ + result: BGPTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface BGPTimeseriesResponse { + meta: BGPTimeseriesResponse.Meta; + + serie_0: BGPTimeseriesResponse.Serie0; +} + +export namespace BGPTimeseriesResponse { + export interface Meta { + aggInterval: string; + + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Serie0 { + timestamps: Array; + + values: Array; + } +} + +export interface BGPTimeseriesParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of BGP network prefixes. + */ + prefix?: Array; + + /** + * Array of BGP update types. + */ + updateType?: Array<'ANNOUNCEMENT' | 'WITHDRAWAL'>; } export namespace BGP { + export import BGPTimeseriesResponse = BGPAPI.BGPTimeseriesResponse; + export import BGPTimeseriesParams = BGPAPI.BGPTimeseriesParams; export import Leaks = LeaksAPI.Leaks; - export import Timeseries = TimeseriesAPI.Timeseries; - export import TimeseryListResponse = TimeseriesAPI.TimeseryListResponse; - export import TimeseryListParams = TimeseriesAPI.TimeseryListParams; + export import LeakEventsResponse = LeaksAPI.LeakEventsResponse; + export import LeakEventsParams = LeaksAPI.LeakEventsParams; export import Tops = TopsAPI.Tops; export import Hijacks = HijacksAPI.Hijacks; - export import HijackListResponse = HijacksAPI.HijackListResponse; - export import HijackListResponsesV4PagePagination = HijacksAPI.HijackListResponsesV4PagePagination; - export import HijackListParams = HijacksAPI.HijackListParams; + export import HijackEventsResponse = HijacksAPI.HijackEventsResponse; + export import HijackEventsParams = HijacksAPI.HijackEventsParams; export import Routes = RoutesAPI.Routes; + export import RouteMoasResponse = RoutesAPI.RouteMoasResponse; + export import RoutePfx2asResponse = RoutesAPI.RoutePfx2asResponse; + export import RouteStatsResponse = RoutesAPI.RouteStatsResponse; + export import RouteMoasParams = RoutesAPI.RouteMoasParams; + export import RoutePfx2asParams = RoutesAPI.RoutePfx2asParams; + export import RouteStatsParams = RoutesAPI.RouteStatsParams; } diff --git a/src/resources/radar/bgp/hijacks.ts b/src/resources/radar/bgp/hijacks.ts index d7e36fd636..750a98db7a 100644 --- a/src/resources/radar/bgp/hijacks.ts +++ b/src/resources/radar/bgp/hijacks.ts @@ -4,120 +4,93 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import { isRequestOptions } from 'cloudflare/core'; import * as HijacksAPI from 'cloudflare/resources/radar/bgp/hijacks'; -import { V4PagePagination, type V4PagePaginationParams } from 'cloudflare/pagination'; export class Hijacks extends APIResource { /** * Get the BGP hijack events. (Beta) */ - list( - query?: HijackListParams, + events(query?: HijackEventsParams, options?: Core.RequestOptions): Core.APIPromise; + events(options?: Core.RequestOptions): Core.APIPromise; + events( + query: HijackEventsParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.PagePromise; - list( - options?: Core.RequestOptions, - ): Core.PagePromise; - list( - query: HijackListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.list({}, query); + return this.events({}, query); } - return this._client.getAPIList('/radar/bgp/hijacks/events', HijackListResponsesV4PagePagination, { - query, - ...options, - }); + return ( + this._client.get('/radar/bgp/hijacks/events', { query, ...options }) as Core.APIPromise<{ + result: HijackEventsResponse; + }> + )._thenUnwrap((obj) => obj.result); } } -export class HijackListResponsesV4PagePagination extends V4PagePagination {} - -export interface HijackListResponse { - result: HijackListResponse.Result; +export interface HijackEventsResponse { + asn_info: Array; - result_info: HijackListResponse.ResultInfo; + events: Array; - success: boolean; + total_monitors: number; } -export namespace HijackListResponse { - export interface Result { - asn_info: Array; +export namespace HijackEventsResponse { + export interface AsnInfo { + asn: number; - events: Array; + country_code: string; - total_monitors: number; + org_name: string; } - export namespace Result { - export interface AsnInfo { - asn: number; - - country_code: string; - - org_name: string; - } - - export interface Event { - id: number; - - confidence_score: number; + export interface Event { + id: number; - duration: number; + confidence_score: number; - event_type: number; + duration: number; - hijack_msgs_count: number; + event_type: number; - hijacker_asn: number; + hijack_msgs_count: number; - hijacker_country: string; + hijacker_asn: number; - is_stale: boolean; + hijacker_country: string; - max_hijack_ts: string; + is_stale: boolean; - max_msg_ts: string; + max_hijack_ts: string; - min_hijack_ts: string; + max_msg_ts: string; - on_going_count: number; + min_hijack_ts: string; - peer_asns: Array; + on_going_count: number; - peer_ip_count: number; + peer_asns: Array; - prefixes: Array; + peer_ip_count: number; - tags: Array; + prefixes: Array; - victim_asns: Array; - - victim_countries: Array; - } + tags: Array; - export namespace Event { - export interface Tag { - name: string; + victim_asns: Array; - score: number; - } - } + victim_countries: Array; } - export interface ResultInfo { - count: number; - - page: number; - - per_page: number; + export namespace Event { + export interface Tag { + name: string; - total_count: number; + score: number; + } } } -export interface HijackListParams extends V4PagePaginationParams { +export interface HijackEventsParams { /** * End of the date range (inclusive). */ @@ -184,6 +157,16 @@ export interface HijackListParams extends V4PagePaginationParams { */ minConfidence?: number; + /** + * Current page number, starting from 1 + */ + page?: number; + + /** + * Number of entries per page + */ + per_page?: number; + /** * The prefix hijacked during a BGP hijack event */ @@ -206,7 +189,6 @@ export interface HijackListParams extends V4PagePaginationParams { } export namespace Hijacks { - export import HijackListResponse = HijacksAPI.HijackListResponse; - export import HijackListResponsesV4PagePagination = HijacksAPI.HijackListResponsesV4PagePagination; - export import HijackListParams = HijacksAPI.HijackListParams; + export import HijackEventsResponse = HijacksAPI.HijackEventsResponse; + export import HijackEventsParams = HijacksAPI.HijackEventsParams; } diff --git a/src/resources/radar/bgp/index.ts b/src/resources/radar/bgp/index.ts index 9c67b1703c..e02bcf5ce3 100644 --- a/src/resources/radar/bgp/index.ts +++ b/src/resources/radar/bgp/index.ts @@ -1,13 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -export { BGP } from './bgp'; +export { BGPTimeseriesResponse, BGPTimeseriesParams, BGP } from './bgp'; +export { HijackEventsResponse, HijackEventsParams, Hijacks } from './hijacks'; +export { LeakEventsResponse, LeakEventsParams, Leaks } from './leaks'; export { - HijackListResponse, - HijackListParams, - HijackListResponsesV4PagePagination, - Hijacks, -} from './hijacks'; -export { Leaks } from './leaks/index'; -export { Routes } from './routes/index'; -export { TimeseryListResponse, TimeseryListParams, Timeseries } from './timeseries'; + RouteMoasResponse, + RoutePfx2asResponse, + RouteStatsResponse, + RouteMoasParams, + RoutePfx2asParams, + RouteStatsParams, + Routes, +} from './routes'; export { Tops } from './tops/index'; diff --git a/src/resources/radar/bgp/leaks.ts b/src/resources/radar/bgp/leaks.ts new file mode 100644 index 0000000000..d6a2015405 --- /dev/null +++ b/src/resources/radar/bgp/leaks.ts @@ -0,0 +1,154 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as LeaksAPI from 'cloudflare/resources/radar/bgp/leaks'; + +export class Leaks extends APIResource { + /** + * Get the BGP route leak events (Beta). + */ + events(query?: LeakEventsParams, options?: Core.RequestOptions): Core.APIPromise; + events(options?: Core.RequestOptions): Core.APIPromise; + events( + query: LeakEventsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.events({}, query); + } + return ( + this._client.get('/radar/bgp/leaks/events', { query, ...options }) as Core.APIPromise<{ + result: LeakEventsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface LeakEventsResponse { + asn_info: Array; + + events: Array; +} + +export namespace LeakEventsResponse { + export interface AsnInfo { + asn: number; + + country_code: string; + + org_name: string; + } + + export interface Event { + id: number; + + countries: Array; + + detected_ts: string; + + finished: boolean; + + leak_asn: number; + + leak_count: number; + + leak_seg: Array; + + leak_type: number; + + max_ts: string; + + min_ts: string; + + origin_count: number; + + peer_count: number; + + prefix_count: number; + } +} + +export interface LeakEventsParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: string; + + /** + * Shorthand date ranges for the last X days - use when you don't need specific + * start and end dates. + */ + dateRange?: + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl'; + + /** + * Start of the date range (inclusive). + */ + dateStart?: string; + + /** + * The unique identifier of a event + */ + eventId?: number; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * ASN that is causing or affected by a route leak event + */ + involvedAsn?: number; + + /** + * Country code of a involved ASN in a route leak event + */ + involvedCountry?: string; + + /** + * The leaking AS of a route leak event + */ + leakAsn?: number; + + /** + * Current page number, starting from 1 + */ + page?: number; + + /** + * Number of entries per page + */ + per_page?: number; + + /** + * Sort events by field + */ + sortBy?: 'ID' | 'LEAKS' | 'PEERS' | 'PREFIXES' | 'ORIGINS' | 'TIME'; + + /** + * Sort order + */ + sortOrder?: 'ASC' | 'DESC'; +} + +export namespace Leaks { + export import LeakEventsResponse = LeaksAPI.LeakEventsResponse; + export import LeakEventsParams = LeaksAPI.LeakEventsParams; +} diff --git a/src/resources/radar/bgp/leaks/events.ts b/src/resources/radar/bgp/leaks/events.ts deleted file mode 100644 index d739d4672f..0000000000 --- a/src/resources/radar/bgp/leaks/events.ts +++ /dev/null @@ -1,172 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as EventsAPI from 'cloudflare/resources/radar/bgp/leaks/events'; -import { V4PagePagination, type V4PagePaginationParams } from 'cloudflare/pagination'; - -export class Events extends APIResource { - /** - * Get the BGP route leak events (Beta). - */ - list( - query?: EventListParams, - options?: Core.RequestOptions, - ): Core.PagePromise; - list( - options?: Core.RequestOptions, - ): Core.PagePromise; - list( - query: EventListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.PagePromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return this._client.getAPIList('/radar/bgp/leaks/events', EventListResponsesV4PagePagination, { - query, - ...options, - }); - } -} - -export class EventListResponsesV4PagePagination extends V4PagePagination {} - -export interface EventListResponse { - result: EventListResponse.Result; - - result_info: EventListResponse.ResultInfo; - - success: boolean; -} - -export namespace EventListResponse { - export interface Result { - asn_info: Array; - - events: Array; - } - - export namespace Result { - export interface AsnInfo { - asn: number; - - country_code: string; - - org_name: string; - } - - export interface Event { - id: number; - - countries: Array; - - detected_ts: string; - - finished: boolean; - - leak_asn: number; - - leak_count: number; - - leak_seg: Array; - - leak_type: number; - - max_ts: string; - - min_ts: string; - - origin_count: number; - - peer_count: number; - - prefix_count: number; - } - } - - export interface ResultInfo { - count: number; - - page: number; - - per_page: number; - - total_count: number; - } -} - -export interface EventListParams extends V4PagePaginationParams { - /** - * End of the date range (inclusive). - */ - dateEnd?: string; - - /** - * Shorthand date ranges for the last X days - use when you don't need specific - * start and end dates. - */ - dateRange?: - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl'; - - /** - * Start of the date range (inclusive). - */ - dateStart?: string; - - /** - * The unique identifier of a event - */ - eventId?: number; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * ASN that is causing or affected by a route leak event - */ - involvedAsn?: number; - - /** - * Country code of a involved ASN in a route leak event - */ - involvedCountry?: string; - - /** - * The leaking AS of a route leak event - */ - leakAsn?: number; - - /** - * Sort events by field - */ - sortBy?: 'ID' | 'LEAKS' | 'PEERS' | 'PREFIXES' | 'ORIGINS' | 'TIME'; - - /** - * Sort order - */ - sortOrder?: 'ASC' | 'DESC'; -} - -export namespace Events { - export import EventListResponse = EventsAPI.EventListResponse; - export import EventListResponsesV4PagePagination = EventsAPI.EventListResponsesV4PagePagination; - export import EventListParams = EventsAPI.EventListParams; -} diff --git a/src/resources/radar/bgp/leaks/index.ts b/src/resources/radar/bgp/leaks/index.ts deleted file mode 100644 index 076005c2e8..0000000000 --- a/src/resources/radar/bgp/leaks/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { EventListResponse, EventListParams, EventListResponsesV4PagePagination, Events } from './events'; -export { Leaks } from './leaks'; diff --git a/src/resources/radar/bgp/leaks/leaks.ts b/src/resources/radar/bgp/leaks/leaks.ts deleted file mode 100644 index 4195d1e837..0000000000 --- a/src/resources/radar/bgp/leaks/leaks.ts +++ /dev/null @@ -1,15 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import { APIResource } from 'cloudflare/resource'; -import * as EventsAPI from 'cloudflare/resources/radar/bgp/leaks/events'; - -export class Leaks extends APIResource { - events: EventsAPI.Events = new EventsAPI.Events(this._client); -} - -export namespace Leaks { - export import Events = EventsAPI.Events; - export import EventListResponse = EventsAPI.EventListResponse; - export import EventListResponsesV4PagePagination = EventsAPI.EventListResponsesV4PagePagination; - export import EventListParams = EventsAPI.EventListParams; -} diff --git a/src/resources/radar/bgp/routes.ts b/src/resources/radar/bgp/routes.ts new file mode 100644 index 0000000000..915695b583 --- /dev/null +++ b/src/resources/radar/bgp/routes.ts @@ -0,0 +1,247 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as RoutesAPI from 'cloudflare/resources/radar/bgp/routes'; + +export class Routes extends APIResource { + /** + * List all Multi-origin AS (MOAS) prefixes on the global routing tables. + */ + moas(query?: RouteMoasParams, options?: Core.RequestOptions): Core.APIPromise; + moas(options?: Core.RequestOptions): Core.APIPromise; + moas( + query: RouteMoasParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.moas({}, query); + } + return ( + this._client.get('/radar/bgp/routes/moas', { query, ...options }) as Core.APIPromise<{ + result: RouteMoasResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Lookup prefix-to-origin mapping on global routing tables. + */ + pfx2as(query?: RoutePfx2asParams, options?: Core.RequestOptions): Core.APIPromise; + pfx2as(options?: Core.RequestOptions): Core.APIPromise; + pfx2as( + query: RoutePfx2asParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.pfx2as({}, query); + } + return ( + this._client.get('/radar/bgp/routes/pfx2as', { query, ...options }) as Core.APIPromise<{ + result: RoutePfx2asResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get the BGP routing table stats (Beta). + */ + stats(query?: RouteStatsParams, options?: Core.RequestOptions): Core.APIPromise; + stats(options?: Core.RequestOptions): Core.APIPromise; + stats( + query: RouteStatsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.stats({}, query); + } + return ( + this._client.get('/radar/bgp/routes/stats', { query, ...options }) as Core.APIPromise<{ + result: RouteStatsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface RouteMoasResponse { + meta: RouteMoasResponse.Meta; + + moas: Array; +} + +export namespace RouteMoasResponse { + export interface Meta { + data_time: string; + + query_time: string; + + total_peers: number; + } + + export interface Moa { + origins: Array; + + prefix: string; + } + + export namespace Moa { + export interface Origin { + origin: number; + + peer_count: number; + + rpki_validation: string; + } + } +} + +export interface RoutePfx2asResponse { + meta: RoutePfx2asResponse.Meta; + + prefix_origins: Array; +} + +export namespace RoutePfx2asResponse { + export interface Meta { + data_time: string; + + query_time: string; + + total_peers: number; + } + + export interface PrefixOrigin { + origin: number; + + peer_count: number; + + prefix: string; + + rpki_validation: string; + } +} + +export interface RouteStatsResponse { + meta: RouteStatsResponse.Meta; + + stats: RouteStatsResponse.Stats; +} + +export namespace RouteStatsResponse { + export interface Meta { + data_time: string; + + query_time: string; + + total_peers: number; + } + + export interface Stats { + distinct_origins: number; + + distinct_origins_ipv4: number; + + distinct_origins_ipv6: number; + + distinct_prefixes: number; + + distinct_prefixes_ipv4: number; + + distinct_prefixes_ipv6: number; + + routes_invalid: number; + + routes_invalid_ipv4: number; + + routes_invalid_ipv6: number; + + routes_total: number; + + routes_total_ipv4: number; + + routes_total_ipv6: number; + + routes_unknown: number; + + routes_unknown_ipv4: number; + + routes_unknown_ipv6: number; + + routes_valid: number; + + routes_valid_ipv4: number; + + routes_valid_ipv6: number; + } +} + +export interface RouteMoasParams { + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Lookup only RPKI invalid MOASes + */ + invalid_only?: boolean; + + /** + * Lookup MOASes originated by the given ASN + */ + origin?: number; + + /** + * Lookup MOASes by prefix + */ + prefix?: string; +} + +export interface RoutePfx2asParams { + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Lookup prefixes originated by the given ASN + */ + origin?: number; + + /** + * Lookup origins of the given prefix + */ + prefix?: string; + + /** + * Return only results with matching rpki status: valid, invalid or unknown + */ + rpkiStatus?: 'VALID' | 'INVALID' | 'UNKNOWN'; +} + +export interface RouteStatsParams { + /** + * Single ASN as integer. + */ + asn?: number; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Location Alpha2 code. + */ + location?: string; +} + +export namespace Routes { + export import RouteMoasResponse = RoutesAPI.RouteMoasResponse; + export import RoutePfx2asResponse = RoutesAPI.RoutePfx2asResponse; + export import RouteStatsResponse = RoutesAPI.RouteStatsResponse; + export import RouteMoasParams = RoutesAPI.RouteMoasParams; + export import RoutePfx2asParams = RoutesAPI.RoutePfx2asParams; + export import RouteStatsParams = RoutesAPI.RouteStatsParams; +} diff --git a/src/resources/radar/bgp/routes/index.ts b/src/resources/radar/bgp/routes/index.ts deleted file mode 100644 index 7b74b764d1..0000000000 --- a/src/resources/radar/bgp/routes/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { MoaListResponse, MoaListParams, Moas } from './moas'; -export { Pfx2aListResponse, Pfx2aListParams, Pfx2as } from './pfx2as'; -export { Routes } from './routes'; -export { StatListResponse, StatListParams, Stats } from './stats'; diff --git a/src/resources/radar/bgp/routes/moas.ts b/src/resources/radar/bgp/routes/moas.ts deleted file mode 100644 index 428bcc4ae8..0000000000 --- a/src/resources/radar/bgp/routes/moas.ts +++ /dev/null @@ -1,86 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as MoasAPI from 'cloudflare/resources/radar/bgp/routes/moas'; - -export class Moas extends APIResource { - /** - * List all Multi-origin AS (MOAS) prefixes on the global routing tables. - */ - list(query?: MoaListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: MoaListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/bgp/routes/moas', { query, ...options }) as Core.APIPromise<{ - result: MoaListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface MoaListResponse { - meta: MoaListResponse.Meta; - - moas: Array; -} - -export namespace MoaListResponse { - export interface Meta { - data_time: string; - - query_time: string; - - total_peers: number; - } - - export interface Moa { - origins: Array; - - prefix: string; - } - - export namespace Moa { - export interface Origin { - origin: number; - - peer_count: number; - - rpki_validation: string; - } - } -} - -export interface MoaListParams { - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Lookup only RPKI invalid MOASes - */ - invalid_only?: boolean; - - /** - * Lookup MOASes originated by the given ASN - */ - origin?: number; - - /** - * Lookup MOASes by prefix - */ - prefix?: string; -} - -export namespace Moas { - export import MoaListResponse = MoasAPI.MoaListResponse; - export import MoaListParams = MoasAPI.MoaListParams; -} diff --git a/src/resources/radar/bgp/routes/pfx2as.ts b/src/resources/radar/bgp/routes/pfx2as.ts deleted file mode 100644 index 3450801355..0000000000 --- a/src/resources/radar/bgp/routes/pfx2as.ts +++ /dev/null @@ -1,80 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as Pfx2asAPI from 'cloudflare/resources/radar/bgp/routes/pfx2as'; - -export class Pfx2as extends APIResource { - /** - * Lookup prefix-to-origin mapping on global routing tables. - */ - list(query?: Pfx2aListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: Pfx2aListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/bgp/routes/pfx2as', { query, ...options }) as Core.APIPromise<{ - result: Pfx2aListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface Pfx2aListResponse { - meta: Pfx2aListResponse.Meta; - - prefix_origins: Array; -} - -export namespace Pfx2aListResponse { - export interface Meta { - data_time: string; - - query_time: string; - - total_peers: number; - } - - export interface PrefixOrigin { - origin: number; - - peer_count: number; - - prefix: string; - - rpki_validation: string; - } -} - -export interface Pfx2aListParams { - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Lookup prefixes originated by the given ASN - */ - origin?: number; - - /** - * Lookup origins of the given prefix - */ - prefix?: string; - - /** - * Return only results with matching rpki status: valid, invalid or unknown - */ - rpkiStatus?: 'VALID' | 'INVALID' | 'UNKNOWN'; -} - -export namespace Pfx2as { - export import Pfx2aListResponse = Pfx2asAPI.Pfx2aListResponse; - export import Pfx2aListParams = Pfx2asAPI.Pfx2aListParams; -} diff --git a/src/resources/radar/bgp/routes/routes.ts b/src/resources/radar/bgp/routes/routes.ts deleted file mode 100644 index 5f16bc091e..0000000000 --- a/src/resources/radar/bgp/routes/routes.ts +++ /dev/null @@ -1,24 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import { APIResource } from 'cloudflare/resource'; -import * as MoasAPI from 'cloudflare/resources/radar/bgp/routes/moas'; -import * as Pfx2asAPI from 'cloudflare/resources/radar/bgp/routes/pfx2as'; -import * as StatsAPI from 'cloudflare/resources/radar/bgp/routes/stats'; - -export class Routes extends APIResource { - moas: MoasAPI.Moas = new MoasAPI.Moas(this._client); - pfx2as: Pfx2asAPI.Pfx2as = new Pfx2asAPI.Pfx2as(this._client); - stats: StatsAPI.Stats = new StatsAPI.Stats(this._client); -} - -export namespace Routes { - export import Moas = MoasAPI.Moas; - export import MoaListResponse = MoasAPI.MoaListResponse; - export import MoaListParams = MoasAPI.MoaListParams; - export import Pfx2as = Pfx2asAPI.Pfx2as; - export import Pfx2aListResponse = Pfx2asAPI.Pfx2aListResponse; - export import Pfx2aListParams = Pfx2asAPI.Pfx2aListParams; - export import Stats = StatsAPI.Stats; - export import StatListResponse = StatsAPI.StatListResponse; - export import StatListParams = StatsAPI.StatListParams; -} diff --git a/src/resources/radar/bgp/routes/stats.ts b/src/resources/radar/bgp/routes/stats.ts deleted file mode 100644 index 21fb4bd958..0000000000 --- a/src/resources/radar/bgp/routes/stats.ts +++ /dev/null @@ -1,103 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as StatsAPI from 'cloudflare/resources/radar/bgp/routes/stats'; - -export class Stats extends APIResource { - /** - * Get the BGP routing table stats (Beta). - */ - list(query?: StatListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: StatListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/bgp/routes/stats', { query, ...options }) as Core.APIPromise<{ - result: StatListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface StatListResponse { - meta: StatListResponse.Meta; - - stats: StatListResponse.Stats; -} - -export namespace StatListResponse { - export interface Meta { - data_time: string; - - query_time: string; - - total_peers: number; - } - - export interface Stats { - distinct_origins: number; - - distinct_origins_ipv4: number; - - distinct_origins_ipv6: number; - - distinct_prefixes: number; - - distinct_prefixes_ipv4: number; - - distinct_prefixes_ipv6: number; - - routes_invalid: number; - - routes_invalid_ipv4: number; - - routes_invalid_ipv6: number; - - routes_total: number; - - routes_total_ipv4: number; - - routes_total_ipv6: number; - - routes_unknown: number; - - routes_unknown_ipv4: number; - - routes_unknown_ipv6: number; - - routes_valid: number; - - routes_valid_ipv4: number; - - routes_valid_ipv6: number; - } -} - -export interface StatListParams { - /** - * Single ASN as integer. - */ - asn?: number; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Location Alpha2 code. - */ - location?: string; -} - -export namespace Stats { - export import StatListResponse = StatsAPI.StatListResponse; - export import StatListParams = StatsAPI.StatListParams; -} diff --git a/src/resources/radar/bgp/timeseries.ts b/src/resources/radar/bgp/timeseries.ts deleted file mode 100644 index 6df9b16411..0000000000 --- a/src/resources/radar/bgp/timeseries.ts +++ /dev/null @@ -1,165 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as TimeseriesAPI from 'cloudflare/resources/radar/bgp/timeseries'; - -export class Timeseries extends APIResource { - /** - * Gets BGP updates change over time. Raw values are returned. When requesting - * updates of an autonomous system (AS), only BGP updates of type announcement are - * returned. - */ - list(query?: TimeseryListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: TimeseryListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/bgp/timeseries', { query, ...options }) as Core.APIPromise<{ - result: TimeseryListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface TimeseryListResponse { - meta: TimeseryListResponse.Meta; - - serie_0: TimeseryListResponse.Serie0; -} - -export namespace TimeseryListResponse { - export interface Meta { - aggInterval: string; - - dateRange: Array; - - lastUpdated: string; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Serie0 { - timestamps: Array; - - values: Array; - } -} - -export interface TimeseryListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Array of BGP network prefixes. - */ - prefix?: Array; - - /** - * Array of BGP update types. - */ - updateType?: Array<'ANNOUNCEMENT' | 'WITHDRAWAL'>; -} - -export namespace Timeseries { - export import TimeseryListResponse = TimeseriesAPI.TimeseryListResponse; - export import TimeseryListParams = TimeseriesAPI.TimeseryListParams; -} diff --git a/src/resources/radar/bgp/tops/ases/prefixes.ts b/src/resources/radar/bgp/tops/ases.ts similarity index 56% rename from src/resources/radar/bgp/tops/ases/prefixes.ts rename to src/resources/radar/bgp/tops/ases.ts index 6dd8730a08..3fbfff0102 100644 --- a/src/resources/radar/bgp/tops/ases/prefixes.ts +++ b/src/resources/radar/bgp/tops/ases.ts @@ -3,38 +3,38 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import { isRequestOptions } from 'cloudflare/core'; -import * as PrefixesAPI from 'cloudflare/resources/radar/bgp/tops/ases/prefixes'; +import * as AsesAPI from 'cloudflare/resources/radar/bgp/tops/ases'; -export class Prefixes extends APIResource { +export class Ases extends APIResource { /** * Get the full list of autonomous systems on the global routing table ordered by * announced prefixes count. The data comes from public BGP MRT data archives and * updates every 2 hours. */ - list(query?: PrefixListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: PrefixListParams | Core.RequestOptions = {}, + prefixes(query?: AsePrefixesParams, options?: Core.RequestOptions): Core.APIPromise; + prefixes(options?: Core.RequestOptions): Core.APIPromise; + prefixes( + query: AsePrefixesParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.list({}, query); + return this.prefixes({}, query); } return ( this._client.get('/radar/bgp/top/ases/prefixes', { query, ...options }) as Core.APIPromise<{ - result: PrefixListResponse; + result: AsePrefixesResponse; }> )._thenUnwrap((obj) => obj.result); } } -export interface PrefixListResponse { - asns: Array; +export interface AsePrefixesResponse { + asns: Array; - meta: PrefixListResponse.Meta; + meta: AsePrefixesResponse.Meta; } -export namespace PrefixListResponse { +export namespace AsePrefixesResponse { export interface Asn { asn: number; @@ -54,7 +54,7 @@ export namespace PrefixListResponse { } } -export interface PrefixListParams { +export interface AsePrefixesParams { /** * Alpha-2 country code. */ @@ -71,7 +71,7 @@ export interface PrefixListParams { limit?: number; } -export namespace Prefixes { - export import PrefixListResponse = PrefixesAPI.PrefixListResponse; - export import PrefixListParams = PrefixesAPI.PrefixListParams; +export namespace Ases { + export import AsePrefixesResponse = AsesAPI.AsePrefixesResponse; + export import AsePrefixesParams = AsesAPI.AsePrefixesParams; } diff --git a/src/resources/radar/bgp/tops/ases/ases.ts b/src/resources/radar/bgp/tops/ases/ases.ts deleted file mode 100644 index 14490162a7..0000000000 --- a/src/resources/radar/bgp/tops/ases/ases.ts +++ /dev/null @@ -1,144 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as AsesAPI from 'cloudflare/resources/radar/bgp/tops/ases/ases'; -import * as PrefixesAPI from 'cloudflare/resources/radar/bgp/tops/ases/prefixes'; - -export class Ases extends APIResource { - prefixes: PrefixesAPI.Prefixes = new PrefixesAPI.Prefixes(this._client); - - /** - * Get the top autonomous systems (AS) by BGP updates (announcements only). Values - * are a percentage out of the total updates. - */ - list(query?: AseListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: AseListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/bgp/top/ases', { query, ...options }) as Core.APIPromise<{ - result: AseListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface AseListResponse { - meta: AseListResponse.Meta; - - top_0: Array; -} - -export namespace AseListResponse { - export interface Meta { - dateRange: Array; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - } - - export interface Top0 { - asn: number; - - ASName: string; - - /** - * Percentage of updates by this AS out of the total updates by all autonomous - * systems. - */ - value: string; - } -} - -export interface AseListParams { - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limit the number of objects in the response. - */ - limit?: number; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Array of BGP network prefixes. - */ - prefix?: Array; - - /** - * Array of BGP update types. - */ - updateType?: Array<'ANNOUNCEMENT' | 'WITHDRAWAL'>; -} - -export namespace Ases { - export import AseListResponse = AsesAPI.AseListResponse; - export import AseListParams = AsesAPI.AseListParams; - export import Prefixes = PrefixesAPI.Prefixes; - export import PrefixListResponse = PrefixesAPI.PrefixListResponse; - export import PrefixListParams = PrefixesAPI.PrefixListParams; -} diff --git a/src/resources/radar/bgp/tops/ases/index.ts b/src/resources/radar/bgp/tops/ases/index.ts deleted file mode 100644 index acd572633e..0000000000 --- a/src/resources/radar/bgp/tops/ases/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { AseListResponse, AseListParams, Ases } from './ases'; -export { PrefixListResponse, PrefixListParams, Prefixes } from './prefixes'; diff --git a/src/resources/radar/bgp/tops/index.ts b/src/resources/radar/bgp/tops/index.ts index 8767fc2958..9670979e66 100644 --- a/src/resources/radar/bgp/tops/index.ts +++ b/src/resources/radar/bgp/tops/index.ts @@ -1,5 +1,4 @@ // File generated from our OpenAPI spec by Stainless. -export { AseListResponse, AseListParams, Ases } from './ases/index'; -export { PrefixListResponse, PrefixListParams, Prefixes } from './prefixes'; +export { AsePrefixesResponse, AsePrefixesParams, Ases } from './ases'; export { Tops } from './tops'; diff --git a/src/resources/radar/bgp/tops/prefixes.ts b/src/resources/radar/bgp/tops/prefixes.ts deleted file mode 100644 index c07a4beb16..0000000000 --- a/src/resources/radar/bgp/tops/prefixes.ts +++ /dev/null @@ -1,127 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as PrefixesAPI from 'cloudflare/resources/radar/bgp/tops/prefixes'; - -export class Prefixes extends APIResource { - /** - * Get the top network prefixes by BGP updates. Values are a percentage out of the - * total BGP updates. - */ - list(query?: PrefixListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: PrefixListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/bgp/top/prefixes', { query, ...options }) as Core.APIPromise<{ - result: PrefixListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface PrefixListResponse { - meta: PrefixListResponse.Meta; - - top_0: Array; -} - -export namespace PrefixListResponse { - export interface Meta { - dateRange: Array; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - } - - export interface Top0 { - prefix: string; - - value: string; - } -} - -export interface PrefixListParams { - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limit the number of objects in the response. - */ - limit?: number; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Array of BGP update types. - */ - updateType?: Array<'ANNOUNCEMENT' | 'WITHDRAWAL'>; -} - -export namespace Prefixes { - export import PrefixListResponse = PrefixesAPI.PrefixListResponse; - export import PrefixListParams = PrefixesAPI.PrefixListParams; -} diff --git a/src/resources/radar/bgp/tops/tops.ts b/src/resources/radar/bgp/tops/tops.ts index 73ff772e31..f9cd1467d5 100644 --- a/src/resources/radar/bgp/tops/tops.ts +++ b/src/resources/radar/bgp/tops/tops.ts @@ -1,19 +1,14 @@ // File generated from our OpenAPI spec by Stainless. import { APIResource } from 'cloudflare/resource'; -import * as PrefixesAPI from 'cloudflare/resources/radar/bgp/tops/prefixes'; -import * as AsesAPI from 'cloudflare/resources/radar/bgp/tops/ases/ases'; +import * as AsesAPI from 'cloudflare/resources/radar/bgp/tops/ases'; export class Tops extends APIResource { ases: AsesAPI.Ases = new AsesAPI.Ases(this._client); - prefixes: PrefixesAPI.Prefixes = new PrefixesAPI.Prefixes(this._client); } export namespace Tops { export import Ases = AsesAPI.Ases; - export import AseListResponse = AsesAPI.AseListResponse; - export import AseListParams = AsesAPI.AseListParams; - export import Prefixes = PrefixesAPI.Prefixes; - export import PrefixListResponse = PrefixesAPI.PrefixListResponse; - export import PrefixListParams = PrefixesAPI.PrefixListParams; + export import AsePrefixesResponse = AsesAPI.AsePrefixesResponse; + export import AsePrefixesParams = AsesAPI.AsePrefixesParams; } diff --git a/src/resources/radar/connection-tampering.ts b/src/resources/radar/connection-tampering.ts new file mode 100644 index 0000000000..97b331fceb --- /dev/null +++ b/src/resources/radar/connection-tampering.ts @@ -0,0 +1,361 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as ConnectionTamperingAPI from 'cloudflare/resources/radar/connection-tampering'; + +export class ConnectionTampering extends APIResource { + /** + * Distribution of connection tampering types over a given time period. + */ + summary( + query?: ConnectionTamperingSummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + summary(options?: Core.RequestOptions): Core.APIPromise; + summary( + query: ConnectionTamperingSummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary({}, query); + } + return ( + this._client.get('/radar/connection_tampering/summary', { query, ...options }) as Core.APIPromise<{ + result: ConnectionTamperingSummaryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Distribution of connection tampering types over time. + */ + timeseriesGroups( + query?: ConnectionTamperingTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + query: ConnectionTamperingTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups({}, query); + } + return ( + this._client.get('/radar/connection_tampering/timeseries_groups', { + query, + ...options, + }) as Core.APIPromise<{ result: ConnectionTamperingTimeseriesGroupsResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface ConnectionTamperingSummaryResponse { + meta: ConnectionTamperingSummaryResponse.Meta; + + summary_0: ConnectionTamperingSummaryResponse.Summary0; +} + +export namespace ConnectionTamperingSummaryResponse { + export interface Meta { + dateRange: Array; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + /** + * Connections matching signatures for tampering later in the connection, after the + * transfer of multiple data packets. + */ + later_in_flow: string; + + /** + * Connections that do not match any tampering signatures. + */ + no_match: string; + + /** + * Connections matching signatures for tampering after the receipt of a SYN packet + * and ACK packet, meaning the TCP connection was successfully established but the + * server did not receive any subsequent packets. + */ + post_ack: string; + + /** + * Connections matching signatures for tampering after the receipt of a packet with + * PSH flag set, following connection establishment. + */ + post_psh: string; + + /** + * Connections matching signatures for tampering after the receipt of only a single + * SYN packet, and before the handshake completes. + */ + post_syn: string; + } +} + +export interface ConnectionTamperingTimeseriesGroupsResponse { + meta: ConnectionTamperingTimeseriesGroupsResponse.Meta; + + serie_0: ConnectionTamperingTimeseriesGroupsResponse.Serie0; +} + +export namespace ConnectionTamperingTimeseriesGroupsResponse { + export interface Meta { + aggInterval: string; + + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Serie0 { + /** + * Connections matching signatures for tampering later in the connection, after the + * transfer of multiple data packets. + */ + later_in_flow: Array; + + /** + * Connections that do not match any tampering signatures. + */ + no_match: Array; + + /** + * Connections matching signatures for tampering after the receipt of a SYN packet + * and ACK packet, meaning the TCP connection was successfully established but the + * server did not receive any subsequent packets. + */ + post_ack: Array; + + /** + * Connections matching signatures for tampering after the receipt of a packet with + * PSH flag set, following connection establishment. + */ + post_psh: Array; + + /** + * Connections matching signatures for tampering after the receipt of only a single + * SYN packet, and before the handshake completes. + */ + post_syn: Array; + + timestamps: Array; + } +} + +export interface ConnectionTamperingSummaryParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface ConnectionTamperingTimeseriesGroupsParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export namespace ConnectionTampering { + export import ConnectionTamperingSummaryResponse = ConnectionTamperingAPI.ConnectionTamperingSummaryResponse; + export import ConnectionTamperingTimeseriesGroupsResponse = ConnectionTamperingAPI.ConnectionTamperingTimeseriesGroupsResponse; + export import ConnectionTamperingSummaryParams = ConnectionTamperingAPI.ConnectionTamperingSummaryParams; + export import ConnectionTamperingTimeseriesGroupsParams = ConnectionTamperingAPI.ConnectionTamperingTimeseriesGroupsParams; +} diff --git a/src/resources/radar/connection-tampering/connection-tampering.ts b/src/resources/radar/connection-tampering/connection-tampering.ts deleted file mode 100644 index 7d3591bf55..0000000000 --- a/src/resources/radar/connection-tampering/connection-tampering.ts +++ /dev/null @@ -1,186 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as ConnectionTamperingAPI from 'cloudflare/resources/radar/connection-tampering/connection-tampering'; -import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/connection-tampering/timeseries-groups'; - -export class ConnectionTampering extends APIResource { - timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( - this._client, - ); - - /** - * Distribution of connection tampering types over a given time period. - */ - list( - query?: ConnectionTamperingListParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: ConnectionTamperingListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/connection_tampering/summary', { query, ...options }) as Core.APIPromise<{ - result: ConnectionTamperingListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface ConnectionTamperingListResponse { - meta: ConnectionTamperingListResponse.Meta; - - summary_0: ConnectionTamperingListResponse.Summary0; -} - -export namespace ConnectionTamperingListResponse { - export interface Meta { - dateRange: Array; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Summary0 { - /** - * Connections matching signatures for tampering later in the connection, after the - * transfer of multiple data packets. - */ - later_in_flow: string; - - /** - * Connections that do not match any tampering signatures. - */ - no_match: string; - - /** - * Connections matching signatures for tampering after the receipt of a SYN packet - * and ACK packet, meaning the TCP connection was successfully established but the - * server did not receive any subsequent packets. - */ - post_ack: string; - - /** - * Connections matching signatures for tampering after the receipt of a packet with - * PSH flag set, following connection establishment. - */ - post_psh: string; - - /** - * Connections matching signatures for tampering after the receipt of only a single - * SYN packet, and before the handshake completes. - */ - post_syn: string; - } -} - -export interface ConnectionTamperingListParams { - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; -} - -export namespace ConnectionTampering { - export import ConnectionTamperingListResponse = ConnectionTamperingAPI.ConnectionTamperingListResponse; - export import ConnectionTamperingListParams = ConnectionTamperingAPI.ConnectionTamperingListParams; - export import TimeseriesGroups = TimeseriesGroupsAPI.TimeseriesGroups; - export import TimeseriesGroupListResponse = TimeseriesGroupsAPI.TimeseriesGroupListResponse; - export import TimeseriesGroupListParams = TimeseriesGroupsAPI.TimeseriesGroupListParams; -} diff --git a/src/resources/radar/connection-tampering/index.ts b/src/resources/radar/connection-tampering/index.ts deleted file mode 100644 index c177e5e506..0000000000 --- a/src/resources/radar/connection-tampering/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { - ConnectionTamperingListResponse, - ConnectionTamperingListParams, - ConnectionTampering, -} from './connection-tampering'; -export { - TimeseriesGroupListResponse, - TimeseriesGroupListParams, - TimeseriesGroups, -} from './timeseries-groups'; diff --git a/src/resources/radar/connection-tampering/timeseries-groups.ts b/src/resources/radar/connection-tampering/timeseries-groups.ts deleted file mode 100644 index c75dda0d9b..0000000000 --- a/src/resources/radar/connection-tampering/timeseries-groups.ts +++ /dev/null @@ -1,192 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/connection-tampering/timeseries-groups'; - -export class TimeseriesGroups extends APIResource { - /** - * Distribution of connection tampering types over time. - */ - list( - query?: TimeseriesGroupListParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: TimeseriesGroupListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/connection_tampering/timeseries_groups', { - query, - ...options, - }) as Core.APIPromise<{ result: TimeseriesGroupListResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface TimeseriesGroupListResponse { - meta: TimeseriesGroupListResponse.Meta; - - serie_0: TimeseriesGroupListResponse.Serie0; -} - -export namespace TimeseriesGroupListResponse { - export interface Meta { - aggInterval: string; - - dateRange: Array; - - lastUpdated: string; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Serie0 { - /** - * Connections matching signatures for tampering later in the connection, after the - * transfer of multiple data packets. - */ - later_in_flow: Array; - - /** - * Connections that do not match any tampering signatures. - */ - no_match: Array; - - /** - * Connections matching signatures for tampering after the receipt of a SYN packet - * and ACK packet, meaning the TCP connection was successfully established but the - * server did not receive any subsequent packets. - */ - post_ack: Array; - - /** - * Connections matching signatures for tampering after the receipt of a packet with - * PSH flag set, following connection establishment. - */ - post_psh: Array; - - /** - * Connections matching signatures for tampering after the receipt of only a single - * SYN packet, and before the handshake completes. - */ - post_syn: Array; - - timestamps: Array; - } -} - -export interface TimeseriesGroupListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; -} - -export namespace TimeseriesGroups { - export import TimeseriesGroupListResponse = TimeseriesGroupsAPI.TimeseriesGroupListResponse; - export import TimeseriesGroupListParams = TimeseriesGroupsAPI.TimeseriesGroupListParams; -} diff --git a/src/resources/radar/datasets/datasets.ts b/src/resources/radar/datasets.ts similarity index 74% rename from src/resources/radar/datasets/datasets.ts rename to src/resources/radar/datasets.ts index 163965d841..4f2c867b50 100644 --- a/src/resources/radar/datasets/datasets.ts +++ b/src/resources/radar/datasets.ts @@ -3,12 +3,9 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import { isRequestOptions } from 'cloudflare/core'; -import * as DatasetsAPI from 'cloudflare/resources/radar/datasets/datasets'; -import * as DownloadsAPI from 'cloudflare/resources/radar/datasets/downloads'; +import * as DatasetsAPI from 'cloudflare/resources/radar/datasets'; export class Datasets extends APIResource { - downloads: DownloadsAPI.Downloads = new DownloadsAPI.Downloads(this._client); - /** * Get a list of datasets. */ @@ -28,6 +25,23 @@ export class Datasets extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Get a url to download a single dataset. + */ + download( + params: DatasetDownloadParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { format, ...body } = params; + return ( + this._client.post('/radar/datasets/download', { + query: { format }, + body, + ...options, + }) as Core.APIPromise<{ result: DatasetDownloadResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Get the csv content of a given dataset by alias or id. When getting the content * by alias the latest dataset is returned, optionally filtered by the latest @@ -71,6 +85,16 @@ export namespace DatasetListResponse { } } +export interface DatasetDownloadResponse { + dataset: DatasetDownloadResponse.Dataset; +} + +export namespace DatasetDownloadResponse { + export interface Dataset { + url: string; + } +} + export type DatasetGetResponse = string; export interface DatasetListParams { @@ -95,6 +119,18 @@ export interface DatasetListParams { offset?: number; } +export interface DatasetDownloadParams { + /** + * Body param: + */ + datasetId: number; + + /** + * Query param: Format results are returned in. + */ + format?: 'JSON' | 'CSV'; +} + export interface DatasetGetParams { /** * Filter dataset alias by date @@ -104,10 +140,9 @@ export interface DatasetGetParams { export namespace Datasets { export import DatasetListResponse = DatasetsAPI.DatasetListResponse; + export import DatasetDownloadResponse = DatasetsAPI.DatasetDownloadResponse; export import DatasetGetResponse = DatasetsAPI.DatasetGetResponse; export import DatasetListParams = DatasetsAPI.DatasetListParams; + export import DatasetDownloadParams = DatasetsAPI.DatasetDownloadParams; export import DatasetGetParams = DatasetsAPI.DatasetGetParams; - export import Downloads = DownloadsAPI.Downloads; - export import DownloadCreateResponse = DownloadsAPI.DownloadCreateResponse; - export import DownloadCreateParams = DownloadsAPI.DownloadCreateParams; } diff --git a/src/resources/radar/datasets/downloads.ts b/src/resources/radar/datasets/downloads.ts deleted file mode 100644 index 6dbdf9a21f..0000000000 --- a/src/resources/radar/datasets/downloads.ts +++ /dev/null @@ -1,51 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as DownloadsAPI from 'cloudflare/resources/radar/datasets/downloads'; - -export class Downloads extends APIResource { - /** - * Get a url to download a single dataset. - */ - create( - params: DownloadCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { format, ...body } = params; - return ( - this._client.post('/radar/datasets/download', { - query: { format }, - body, - ...options, - }) as Core.APIPromise<{ result: DownloadCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface DownloadCreateResponse { - dataset: DownloadCreateResponse.Dataset; -} - -export namespace DownloadCreateResponse { - export interface Dataset { - url: string; - } -} - -export interface DownloadCreateParams { - /** - * Body param: - */ - datasetId: number; - - /** - * Query param: Format results are returned in. - */ - format?: 'JSON' | 'CSV'; -} - -export namespace Downloads { - export import DownloadCreateResponse = DownloadsAPI.DownloadCreateResponse; - export import DownloadCreateParams = DownloadsAPI.DownloadCreateParams; -} diff --git a/src/resources/radar/datasets/index.ts b/src/resources/radar/datasets/index.ts deleted file mode 100644 index fad0e8b3d8..0000000000 --- a/src/resources/radar/datasets/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { - DatasetListResponse, - DatasetGetResponse, - DatasetListParams, - DatasetGetParams, - Datasets, -} from './datasets'; -export { DownloadCreateResponse, DownloadCreateParams, Downloads } from './downloads'; diff --git a/src/resources/radar/dns/dns.ts b/src/resources/radar/dns/dns.ts index 2c23404389..e263865b8c 100644 --- a/src/resources/radar/dns/dns.ts +++ b/src/resources/radar/dns/dns.ts @@ -1,12 +1,16 @@ // File generated from our OpenAPI spec by Stainless. import { APIResource } from 'cloudflare/resource'; -import * as TopsAPI from 'cloudflare/resources/radar/dns/tops/tops'; +import * as TopAPI from 'cloudflare/resources/radar/dns/top'; export class DNS extends APIResource { - tops: TopsAPI.Tops = new TopsAPI.Tops(this._client); + top: TopAPI.Top = new TopAPI.Top(this._client); } export namespace DNS { - export import Tops = TopsAPI.Tops; + export import Top = TopAPI.Top; + export import TopAsesResponse = TopAPI.TopAsesResponse; + export import TopLocationsResponse = TopAPI.TopLocationsResponse; + export import TopAsesParams = TopAPI.TopAsesParams; + export import TopLocationsParams = TopAPI.TopLocationsParams; } diff --git a/src/resources/radar/dns/index.ts b/src/resources/radar/dns/index.ts index a125e1ca95..a195d1d566 100644 --- a/src/resources/radar/dns/index.ts +++ b/src/resources/radar/dns/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. export { DNS } from './dns'; -export { Tops } from './tops/index'; +export { TopAsesResponse, TopLocationsResponse, TopAsesParams, TopLocationsParams, Top } from './top'; diff --git a/src/resources/radar/dns/top.ts b/src/resources/radar/dns/top.ts new file mode 100644 index 0000000000..b4d2ef0d6a --- /dev/null +++ b/src/resources/radar/dns/top.ts @@ -0,0 +1,295 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import * as TopAPI from 'cloudflare/resources/radar/dns/top'; + +export class Top extends APIResource { + /** + * Get top autonomous systems by DNS queries made to Cloudflare's public DNS + * resolver. + */ + ases(query: TopAsesParams, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.get('/radar/dns/top/ases', { query, ...options }) as Core.APIPromise<{ + result: TopAsesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get top locations by DNS queries made to Cloudflare's public DNS resolver. + */ + locations(query: TopLocationsParams, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.get('/radar/dns/top/locations', { query, ...options }) as Core.APIPromise<{ + result: TopLocationsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TopAsesResponse { + meta: TopAsesResponse.Meta; + + top_0: Array; +} + +export namespace TopAsesResponse { + export interface Meta { + dateRange: Array; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientASN: number; + + clientASName: string; + + value: string; + } +} + +export interface TopLocationsResponse { + meta: TopLocationsResponse.Meta; + + top_0: Array; +} + +export namespace TopLocationsResponse { + export interface Meta { + dateRange: Array; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface TopAsesParams { + /** + * Array of domain names. + */ + domain: Array; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface TopLocationsParams { + /** + * Array of domain names. + */ + domain: Array; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export namespace Top { + export import TopAsesResponse = TopAPI.TopAsesResponse; + export import TopLocationsResponse = TopAPI.TopLocationsResponse; + export import TopAsesParams = TopAPI.TopAsesParams; + export import TopLocationsParams = TopAPI.TopLocationsParams; +} diff --git a/src/resources/radar/dns/tops/ases.ts b/src/resources/radar/dns/tops/ases.ts deleted file mode 100644 index 079868d2ef..0000000000 --- a/src/resources/radar/dns/tops/ases.ts +++ /dev/null @@ -1,153 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as AsesAPI from 'cloudflare/resources/radar/dns/tops/ases'; - -export class Ases extends APIResource { - /** - * Get top autonomous systems by DNS queries made to Cloudflare's public DNS - * resolver. - */ - list(query: AseListParams, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.get('/radar/dns/top/ases', { query, ...options }) as Core.APIPromise<{ - result: AseListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface AseListResponse { - meta: AseListResponse.Meta; - - top_0: Array; -} - -export namespace AseListResponse { - export interface Meta { - dateRange: Array; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Top0 { - clientASN: number; - - clientASName: string; - - value: string; - } -} - -export interface AseListParams { - /** - * Array of domain names. - */ - domain: Array; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limit the number of objects in the response. - */ - limit?: number; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; -} - -export namespace Ases { - export import AseListResponse = AsesAPI.AseListResponse; - export import AseListParams = AsesAPI.AseListParams; -} diff --git a/src/resources/radar/dns/tops/index.ts b/src/resources/radar/dns/tops/index.ts deleted file mode 100644 index a20f97e17b..0000000000 --- a/src/resources/radar/dns/tops/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { AseListResponse, AseListParams, Ases } from './ases'; -export { LocationListResponse, LocationListParams, Locations } from './locations'; -export { Tops } from './tops'; diff --git a/src/resources/radar/dns/tops/locations.ts b/src/resources/radar/dns/tops/locations.ts deleted file mode 100644 index 34f926bb1a..0000000000 --- a/src/resources/radar/dns/tops/locations.ts +++ /dev/null @@ -1,152 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as LocationsAPI from 'cloudflare/resources/radar/dns/tops/locations'; - -export class Locations extends APIResource { - /** - * Get top locations by DNS queries made to Cloudflare's public DNS resolver. - */ - list(query: LocationListParams, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.get('/radar/dns/top/locations', { query, ...options }) as Core.APIPromise<{ - result: LocationListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface LocationListResponse { - meta: LocationListResponse.Meta; - - top_0: Array; -} - -export namespace LocationListResponse { - export interface Meta { - dateRange: Array; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Top0 { - clientCountryAlpha2: string; - - clientCountryName: string; - - value: string; - } -} - -export interface LocationListParams { - /** - * Array of domain names. - */ - domain: Array; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limit the number of objects in the response. - */ - limit?: number; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; -} - -export namespace Locations { - export import LocationListResponse = LocationsAPI.LocationListResponse; - export import LocationListParams = LocationsAPI.LocationListParams; -} diff --git a/src/resources/radar/dns/tops/tops.ts b/src/resources/radar/dns/tops/tops.ts deleted file mode 100644 index 4e77a7d78c..0000000000 --- a/src/resources/radar/dns/tops/tops.ts +++ /dev/null @@ -1,19 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import { APIResource } from 'cloudflare/resource'; -import * as AsesAPI from 'cloudflare/resources/radar/dns/tops/ases'; -import * as LocationsAPI from 'cloudflare/resources/radar/dns/tops/locations'; - -export class Tops extends APIResource { - ases: AsesAPI.Ases = new AsesAPI.Ases(this._client); - locations: LocationsAPI.Locations = new LocationsAPI.Locations(this._client); -} - -export namespace Tops { - export import Ases = AsesAPI.Ases; - export import AseListResponse = AsesAPI.AseListResponse; - export import AseListParams = AsesAPI.AseListParams; - export import Locations = LocationsAPI.Locations; - export import LocationListResponse = LocationsAPI.LocationListResponse; - export import LocationListParams = LocationsAPI.LocationListParams; -} diff --git a/src/resources/radar/email/security/index.ts b/src/resources/radar/email/security/index.ts index 846c467731..0f1c040757 100644 --- a/src/resources/radar/email/security/index.ts +++ b/src/resources/radar/email/security/index.ts @@ -1,5 +1,27 @@ // File generated from our OpenAPI spec by Stainless. export { Security } from './security'; -export { Summaries } from './summaries/index'; -export { TimeseriesGroups } from './timeseries-groups/index'; +export { + SummaryArcResponse, + SummaryDKIMResponse, + SummaryDmarcResponse, + SummaryMaliciousResponse, + SummarySpamResponse, + SummarySPFResponse, + SummaryThreatCategoryResponse, + SummaryArcParams, + SummaryDKIMParams, + SummaryDmarcParams, + SummaryMaliciousParams, + SummarySpamParams, + SummarySPFParams, + SummaryThreatCategoryParams, + Summary, +} from './summary'; +export { + TimeseriesGroupArcResponse, + TimeseriesGroupDKIMResponse, + TimeseriesGroupArcParams, + TimeseriesGroupDKIMParams, + TimeseriesGroups, +} from './timeseries-groups'; diff --git a/src/resources/radar/email/security/security.ts b/src/resources/radar/email/security/security.ts index f143261390..f0fd4dae1a 100644 --- a/src/resources/radar/email/security/security.ts +++ b/src/resources/radar/email/security/security.ts @@ -1,17 +1,35 @@ // File generated from our OpenAPI spec by Stainless. import { APIResource } from 'cloudflare/resource'; -import * as SummariesAPI from 'cloudflare/resources/radar/email/security/summaries/summaries'; -import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/email/security/timeseries-groups/timeseries-groups'; +import * as SummaryAPI from 'cloudflare/resources/radar/email/security/summary'; +import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/email/security/timeseries-groups'; export class Security extends APIResource { - summaries: SummariesAPI.Summaries = new SummariesAPI.Summaries(this._client); + summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( this._client, ); } export namespace Security { - export import Summaries = SummariesAPI.Summaries; + export import Summary = SummaryAPI.Summary; + export import SummaryArcResponse = SummaryAPI.SummaryArcResponse; + export import SummaryDKIMResponse = SummaryAPI.SummaryDKIMResponse; + export import SummaryDmarcResponse = SummaryAPI.SummaryDmarcResponse; + export import SummaryMaliciousResponse = SummaryAPI.SummaryMaliciousResponse; + export import SummarySpamResponse = SummaryAPI.SummarySpamResponse; + export import SummarySPFResponse = SummaryAPI.SummarySPFResponse; + export import SummaryThreatCategoryResponse = SummaryAPI.SummaryThreatCategoryResponse; + export import SummaryArcParams = SummaryAPI.SummaryArcParams; + export import SummaryDKIMParams = SummaryAPI.SummaryDKIMParams; + export import SummaryDmarcParams = SummaryAPI.SummaryDmarcParams; + export import SummaryMaliciousParams = SummaryAPI.SummaryMaliciousParams; + export import SummarySpamParams = SummaryAPI.SummarySpamParams; + export import SummarySPFParams = SummaryAPI.SummarySPFParams; + export import SummaryThreatCategoryParams = SummaryAPI.SummaryThreatCategoryParams; export import TimeseriesGroups = TimeseriesGroupsAPI.TimeseriesGroups; + export import TimeseriesGroupArcResponse = TimeseriesGroupsAPI.TimeseriesGroupArcResponse; + export import TimeseriesGroupDKIMResponse = TimeseriesGroupsAPI.TimeseriesGroupDKIMResponse; + export import TimeseriesGroupArcParams = TimeseriesGroupsAPI.TimeseriesGroupArcParams; + export import TimeseriesGroupDKIMParams = TimeseriesGroupsAPI.TimeseriesGroupDKIMParams; } diff --git a/src/resources/radar/email/security/summaries/arcs.ts b/src/resources/radar/email/security/summaries/arcs.ts deleted file mode 100644 index fcecfe8a3c..0000000000 --- a/src/resources/radar/email/security/summaries/arcs.ts +++ /dev/null @@ -1,170 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as ArcsAPI from 'cloudflare/resources/radar/email/security/summaries/arcs'; - -export class Arcs extends APIResource { - /** - * Percentage distribution of emails classified per ARC validation. - */ - list(query?: ArcListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: ArcListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/email/security/summary/arc', { query, ...options }) as Core.APIPromise<{ - result: ArcListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface ArcListResponse { - meta: ArcListResponse.Meta; - - summary_0: ArcListResponse.Summary0; -} - -export namespace ArcListResponse { - export interface Meta { - dateRange: Array; - - lastUpdated: string; - - normalization: string; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Summary0 { - FAIL: string; - - NONE: string; - - PASS: string; - } -} - -export interface ArcListParams { - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Filter for dkim. - */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Filter for dmarc. - */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Filter for spf. - */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; -} - -export namespace Arcs { - export import ArcListResponse = ArcsAPI.ArcListResponse; - export import ArcListParams = ArcsAPI.ArcListParams; -} diff --git a/src/resources/radar/email/security/summaries/dkims.ts b/src/resources/radar/email/security/summaries/dkims.ts deleted file mode 100644 index 3cecca16c9..0000000000 --- a/src/resources/radar/email/security/summaries/dkims.ts +++ /dev/null @@ -1,170 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as DKIMsAPI from 'cloudflare/resources/radar/email/security/summaries/dkims'; - -export class DKIMs extends APIResource { - /** - * Percentage distribution of emails classified per DKIM validation. - */ - list(query?: DKIMListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: DKIMListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/email/security/summary/dkim', { query, ...options }) as Core.APIPromise<{ - result: DKIMListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface DKIMListResponse { - meta: DKIMListResponse.Meta; - - summary_0: DKIMListResponse.Summary0; -} - -export namespace DKIMListResponse { - export interface Meta { - dateRange: Array; - - lastUpdated: string; - - normalization: string; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Summary0 { - FAIL: string; - - NONE: string; - - PASS: string; - } -} - -export interface DKIMListParams { - /** - * Filter for arc (Authenticated Received Chain). - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Filter for dmarc. - */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Filter for spf. - */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; -} - -export namespace DKIMs { - export import DKIMListResponse = DKIMsAPI.DKIMListResponse; - export import DKIMListParams = DKIMsAPI.DKIMListParams; -} diff --git a/src/resources/radar/email/security/summaries/dmarcs.ts b/src/resources/radar/email/security/summaries/dmarcs.ts deleted file mode 100644 index 449e328e2a..0000000000 --- a/src/resources/radar/email/security/summaries/dmarcs.ts +++ /dev/null @@ -1,170 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as DmarcsAPI from 'cloudflare/resources/radar/email/security/summaries/dmarcs'; - -export class Dmarcs extends APIResource { - /** - * Percentage distribution of emails classified per DMARC validation. - */ - list(query?: DmarcListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: DmarcListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/email/security/summary/dmarc', { query, ...options }) as Core.APIPromise<{ - result: DmarcListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface DmarcListResponse { - meta: DmarcListResponse.Meta; - - summary_0: DmarcListResponse.Summary0; -} - -export namespace DmarcListResponse { - export interface Meta { - dateRange: Array; - - lastUpdated: string; - - normalization: string; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Summary0 { - FAIL: string; - - NONE: string; - - PASS: string; - } -} - -export interface DmarcListParams { - /** - * Filter for arc (Authenticated Received Chain). - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Filter for dkim. - */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Filter for spf. - */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; -} - -export namespace Dmarcs { - export import DmarcListResponse = DmarcsAPI.DmarcListResponse; - export import DmarcListParams = DmarcsAPI.DmarcListParams; -} diff --git a/src/resources/radar/email/security/summaries/index.ts b/src/resources/radar/email/security/summaries/index.ts deleted file mode 100644 index ba890d9bda..0000000000 --- a/src/resources/radar/email/security/summaries/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { ArcListResponse, ArcListParams, Arcs } from './arcs'; -export { DKIMListResponse, DKIMListParams, DKIMs } from './dkims'; -export { DmarcListResponse, DmarcListParams, Dmarcs } from './dmarcs'; -export { MaliciousListResponse, MaliciousListParams, Malicious } from './malicious'; -export { SPFListResponse, SPFListParams, SPFs } from './spfs'; -export { SpamListResponse, SpamListParams, Spams } from './spams'; -export { Summaries } from './summaries'; -export { ThreatCategoryListResponse, ThreatCategoryListParams, ThreatCategories } from './threat-categories'; diff --git a/src/resources/radar/email/security/summaries/malicious.ts b/src/resources/radar/email/security/summaries/malicious.ts deleted file mode 100644 index 5f8351983c..0000000000 --- a/src/resources/radar/email/security/summaries/malicious.ts +++ /dev/null @@ -1,173 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as MaliciousAPI from 'cloudflare/resources/radar/email/security/summaries/malicious'; - -export class Malicious extends APIResource { - /** - * Percentage distribution of emails classified as MALICIOUS. - */ - list(query?: MaliciousListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: MaliciousListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/email/security/summary/malicious', { query, ...options }) as Core.APIPromise<{ - result: MaliciousListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface MaliciousListResponse { - meta: MaliciousListResponse.Meta; - - summary_0: MaliciousListResponse.Summary0; -} - -export namespace MaliciousListResponse { - export interface Meta { - dateRange: Array; - - lastUpdated: string; - - normalization: string; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Summary0 { - MALICIOUS: string; - - NOT_MALICIOUS: string; - } -} - -export interface MaliciousListParams { - /** - * Filter for arc (Authenticated Received Chain). - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Filter for dkim. - */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Filter for dmarc. - */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Filter for spf. - */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; -} - -export namespace Malicious { - export import MaliciousListResponse = MaliciousAPI.MaliciousListResponse; - export import MaliciousListParams = MaliciousAPI.MaliciousListParams; -} diff --git a/src/resources/radar/email/security/summaries/spams.ts b/src/resources/radar/email/security/summaries/spams.ts deleted file mode 100644 index 29f4e0743a..0000000000 --- a/src/resources/radar/email/security/summaries/spams.ts +++ /dev/null @@ -1,173 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as SpamsAPI from 'cloudflare/resources/radar/email/security/summaries/spams'; - -export class Spams extends APIResource { - /** - * Proportion of emails categorized as either spam or legitimate (non-spam). - */ - list(query?: SpamListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: SpamListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/email/security/summary/spam', { query, ...options }) as Core.APIPromise<{ - result: SpamListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface SpamListResponse { - meta: SpamListResponse.Meta; - - summary_0: SpamListResponse.Summary0; -} - -export namespace SpamListResponse { - export interface Meta { - dateRange: Array; - - lastUpdated: string; - - normalization: string; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Summary0 { - NOT_SPAM: string; - - SPAM: string; - } -} - -export interface SpamListParams { - /** - * Filter for arc (Authenticated Received Chain). - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Filter for dkim. - */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Filter for dmarc. - */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Filter for spf. - */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; -} - -export namespace Spams { - export import SpamListResponse = SpamsAPI.SpamListResponse; - export import SpamListParams = SpamsAPI.SpamListParams; -} diff --git a/src/resources/radar/email/security/summaries/spfs.ts b/src/resources/radar/email/security/summaries/spfs.ts deleted file mode 100644 index aa7b89c18a..0000000000 --- a/src/resources/radar/email/security/summaries/spfs.ts +++ /dev/null @@ -1,170 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as SPFsAPI from 'cloudflare/resources/radar/email/security/summaries/spfs'; - -export class SPFs extends APIResource { - /** - * Percentage distribution of emails classified per SPF validation. - */ - list(query?: SPFListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: SPFListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/email/security/summary/spf', { query, ...options }) as Core.APIPromise<{ - result: SPFListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface SPFListResponse { - meta: SPFListResponse.Meta; - - summary_0: SPFListResponse.Summary0; -} - -export namespace SPFListResponse { - export interface Meta { - dateRange: Array; - - lastUpdated: string; - - normalization: string; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Summary0 { - FAIL: string; - - NONE: string; - - PASS: string; - } -} - -export interface SPFListParams { - /** - * Filter for arc (Authenticated Received Chain). - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Filter for dkim. - */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Filter for dmarc. - */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; -} - -export namespace SPFs { - export import SPFListResponse = SPFsAPI.SPFListResponse; - export import SPFListParams = SPFsAPI.SPFListParams; -} diff --git a/src/resources/radar/email/security/summaries/summaries.ts b/src/resources/radar/email/security/summaries/summaries.ts deleted file mode 100644 index cd24de6b87..0000000000 --- a/src/resources/radar/email/security/summaries/summaries.ts +++ /dev/null @@ -1,46 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import { APIResource } from 'cloudflare/resource'; -import * as ArcsAPI from 'cloudflare/resources/radar/email/security/summaries/arcs'; -import * as DKIMsAPI from 'cloudflare/resources/radar/email/security/summaries/dkims'; -import * as DmarcsAPI from 'cloudflare/resources/radar/email/security/summaries/dmarcs'; -import * as MaliciousAPI from 'cloudflare/resources/radar/email/security/summaries/malicious'; -import * as SpamsAPI from 'cloudflare/resources/radar/email/security/summaries/spams'; -import * as SPFsAPI from 'cloudflare/resources/radar/email/security/summaries/spfs'; -import * as ThreatCategoriesAPI from 'cloudflare/resources/radar/email/security/summaries/threat-categories'; - -export class Summaries extends APIResource { - arcs: ArcsAPI.Arcs = new ArcsAPI.Arcs(this._client); - dkims: DKIMsAPI.DKIMs = new DKIMsAPI.DKIMs(this._client); - dmarcs: DmarcsAPI.Dmarcs = new DmarcsAPI.Dmarcs(this._client); - malicious: MaliciousAPI.Malicious = new MaliciousAPI.Malicious(this._client); - spams: SpamsAPI.Spams = new SpamsAPI.Spams(this._client); - spfs: SPFsAPI.SPFs = new SPFsAPI.SPFs(this._client); - threatCategories: ThreatCategoriesAPI.ThreatCategories = new ThreatCategoriesAPI.ThreatCategories( - this._client, - ); -} - -export namespace Summaries { - export import Arcs = ArcsAPI.Arcs; - export import ArcListResponse = ArcsAPI.ArcListResponse; - export import ArcListParams = ArcsAPI.ArcListParams; - export import DKIMs = DKIMsAPI.DKIMs; - export import DKIMListResponse = DKIMsAPI.DKIMListResponse; - export import DKIMListParams = DKIMsAPI.DKIMListParams; - export import Dmarcs = DmarcsAPI.Dmarcs; - export import DmarcListResponse = DmarcsAPI.DmarcListResponse; - export import DmarcListParams = DmarcsAPI.DmarcListParams; - export import Malicious = MaliciousAPI.Malicious; - export import MaliciousListResponse = MaliciousAPI.MaliciousListResponse; - export import MaliciousListParams = MaliciousAPI.MaliciousListParams; - export import Spams = SpamsAPI.Spams; - export import SpamListResponse = SpamsAPI.SpamListResponse; - export import SpamListParams = SpamsAPI.SpamListParams; - export import SPFs = SPFsAPI.SPFs; - export import SPFListResponse = SPFsAPI.SPFListResponse; - export import SPFListParams = SPFsAPI.SPFListParams; - export import ThreatCategories = ThreatCategoriesAPI.ThreatCategories; - export import ThreatCategoryListResponse = ThreatCategoriesAPI.ThreatCategoryListResponse; - export import ThreatCategoryListParams = ThreatCategoriesAPI.ThreatCategoryListParams; -} diff --git a/src/resources/radar/email/security/summary.ts b/src/resources/radar/email/security/summary.ts new file mode 100644 index 0000000000..f65d0636f4 --- /dev/null +++ b/src/resources/radar/email/security/summary.ts @@ -0,0 +1,1144 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as SummaryAPI from 'cloudflare/resources/radar/email/security/summary'; + +export class Summary extends APIResource { + /** + * Percentage distribution of emails classified per ARC validation. + */ + arc(query?: SummaryArcParams, options?: Core.RequestOptions): Core.APIPromise; + arc(options?: Core.RequestOptions): Core.APIPromise; + arc( + query: SummaryArcParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.arc({}, query); + } + return ( + this._client.get('/radar/email/security/summary/arc', { query, ...options }) as Core.APIPromise<{ + result: SummaryArcResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of emails classified per DKIM validation. + */ + dkim(query?: SummaryDKIMParams, options?: Core.RequestOptions): Core.APIPromise; + dkim(options?: Core.RequestOptions): Core.APIPromise; + dkim( + query: SummaryDKIMParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.dkim({}, query); + } + return ( + this._client.get('/radar/email/security/summary/dkim', { query, ...options }) as Core.APIPromise<{ + result: SummaryDKIMResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of emails classified per DMARC validation. + */ + dmarc(query?: SummaryDmarcParams, options?: Core.RequestOptions): Core.APIPromise; + dmarc(options?: Core.RequestOptions): Core.APIPromise; + dmarc( + query: SummaryDmarcParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.dmarc({}, query); + } + return ( + this._client.get('/radar/email/security/summary/dmarc', { query, ...options }) as Core.APIPromise<{ + result: SummaryDmarcResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of emails classified as MALICIOUS. + */ + malicious( + query?: SummaryMaliciousParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + malicious(options?: Core.RequestOptions): Core.APIPromise; + malicious( + query: SummaryMaliciousParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.malicious({}, query); + } + return ( + this._client.get('/radar/email/security/summary/malicious', { query, ...options }) as Core.APIPromise<{ + result: SummaryMaliciousResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Proportion of emails categorized as either spam or legitimate (non-spam). + */ + spam(query?: SummarySpamParams, options?: Core.RequestOptions): Core.APIPromise; + spam(options?: Core.RequestOptions): Core.APIPromise; + spam( + query: SummarySpamParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.spam({}, query); + } + return ( + this._client.get('/radar/email/security/summary/spam', { query, ...options }) as Core.APIPromise<{ + result: SummarySpamResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of emails classified per SPF validation. + */ + spf(query?: SummarySPFParams, options?: Core.RequestOptions): Core.APIPromise; + spf(options?: Core.RequestOptions): Core.APIPromise; + spf( + query: SummarySPFParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.spf({}, query); + } + return ( + this._client.get('/radar/email/security/summary/spf', { query, ...options }) as Core.APIPromise<{ + result: SummarySPFResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of emails classified in Threat Categories. + */ + threatCategory( + query?: SummaryThreatCategoryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + threatCategory(options?: Core.RequestOptions): Core.APIPromise; + threatCategory( + query: SummaryThreatCategoryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.threatCategory({}, query); + } + return ( + this._client.get('/radar/email/security/summary/threat_category', { + query, + ...options, + }) as Core.APIPromise<{ result: SummaryThreatCategoryResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SummaryArcResponse { + meta: SummaryArcResponse.Meta; + + summary_0: SummaryArcResponse.Summary0; +} + +export namespace SummaryArcResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + FAIL: string; + + NONE: string; + + PASS: string; + } +} + +export interface SummaryDKIMResponse { + meta: SummaryDKIMResponse.Meta; + + summary_0: SummaryDKIMResponse.Summary0; +} + +export namespace SummaryDKIMResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + FAIL: string; + + NONE: string; + + PASS: string; + } +} + +export interface SummaryDmarcResponse { + meta: SummaryDmarcResponse.Meta; + + summary_0: SummaryDmarcResponse.Summary0; +} + +export namespace SummaryDmarcResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + FAIL: string; + + NONE: string; + + PASS: string; + } +} + +export interface SummaryMaliciousResponse { + meta: SummaryMaliciousResponse.Meta; + + summary_0: SummaryMaliciousResponse.Summary0; +} + +export namespace SummaryMaliciousResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + MALICIOUS: string; + + NOT_MALICIOUS: string; + } +} + +export interface SummarySpamResponse { + meta: SummarySpamResponse.Meta; + + summary_0: SummarySpamResponse.Summary0; +} + +export namespace SummarySpamResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + NOT_SPAM: string; + + SPAM: string; + } +} + +export interface SummarySPFResponse { + meta: SummarySPFResponse.Meta; + + summary_0: SummarySPFResponse.Summary0; +} + +export namespace SummarySPFResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + FAIL: string; + + NONE: string; + + PASS: string; + } +} + +export interface SummaryThreatCategoryResponse { + meta: SummaryThreatCategoryResponse.Meta; + + summary_0: SummaryThreatCategoryResponse.Summary0; +} + +export namespace SummaryThreatCategoryResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + BrandImpersonation: string; + + CredentialHarvester: string; + + IdentityDeception: string; + + Link: string; + } +} + +export interface SummaryArcParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export interface SummaryDKIMParams { + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export interface SummaryDmarcParams { + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export interface SummaryMaliciousParams { + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export interface SummarySpamParams { + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export interface SummarySPFParams { + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface SummaryThreatCategoryParams { + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export namespace Summary { + export import SummaryArcResponse = SummaryAPI.SummaryArcResponse; + export import SummaryDKIMResponse = SummaryAPI.SummaryDKIMResponse; + export import SummaryDmarcResponse = SummaryAPI.SummaryDmarcResponse; + export import SummaryMaliciousResponse = SummaryAPI.SummaryMaliciousResponse; + export import SummarySpamResponse = SummaryAPI.SummarySpamResponse; + export import SummarySPFResponse = SummaryAPI.SummarySPFResponse; + export import SummaryThreatCategoryResponse = SummaryAPI.SummaryThreatCategoryResponse; + export import SummaryArcParams = SummaryAPI.SummaryArcParams; + export import SummaryDKIMParams = SummaryAPI.SummaryDKIMParams; + export import SummaryDmarcParams = SummaryAPI.SummaryDmarcParams; + export import SummaryMaliciousParams = SummaryAPI.SummaryMaliciousParams; + export import SummarySpamParams = SummaryAPI.SummarySpamParams; + export import SummarySPFParams = SummaryAPI.SummarySPFParams; + export import SummaryThreatCategoryParams = SummaryAPI.SummaryThreatCategoryParams; +} diff --git a/src/resources/radar/email/security/timeseries-groups.ts b/src/resources/radar/email/security/timeseries-groups.ts new file mode 100644 index 0000000000..f2293493fd --- /dev/null +++ b/src/resources/radar/email/security/timeseries-groups.ts @@ -0,0 +1,255 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/email/security/timeseries-groups'; + +export class TimeseriesGroups extends APIResource { + /** + * Percentage distribution of emails classified per Arc validation over time. + */ + arc( + query?: TimeseriesGroupArcParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + arc(options?: Core.RequestOptions): Core.APIPromise; + arc( + query: TimeseriesGroupArcParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.arc({}, query); + } + return ( + this._client.get('/radar/email/security/timeseries_groups/arc', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupArcResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of emails classified per DKIM validation over time. + */ + dkim( + query?: TimeseriesGroupDKIMParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + dkim(options?: Core.RequestOptions): Core.APIPromise; + dkim( + query: TimeseriesGroupDKIMParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.dkim({}, query); + } + return ( + this._client.get('/radar/email/security/timeseries_groups/dkim', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupDKIMResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TimeseriesGroupArcResponse { + meta: unknown; + + serie_0: TimeseriesGroupArcResponse.Serie0; +} + +export namespace TimeseriesGroupArcResponse { + export interface Serie0 { + FAIL: Array; + + NONE: Array; + + PASS: Array; + } +} + +export interface TimeseriesGroupDKIMResponse { + meta: unknown; + + serie_0: TimeseriesGroupDKIMResponse.Serie0; +} + +export namespace TimeseriesGroupDKIMResponse { + export interface Serie0 { + FAIL: Array; + + NONE: Array; + + PASS: Array; + } +} + +export interface TimeseriesGroupArcParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export interface TimeseriesGroupDKIMParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export namespace TimeseriesGroups { + export import TimeseriesGroupArcResponse = TimeseriesGroupsAPI.TimeseriesGroupArcResponse; + export import TimeseriesGroupDKIMResponse = TimeseriesGroupsAPI.TimeseriesGroupDKIMResponse; + export import TimeseriesGroupArcParams = TimeseriesGroupsAPI.TimeseriesGroupArcParams; + export import TimeseriesGroupDKIMParams = TimeseriesGroupsAPI.TimeseriesGroupDKIMParams; +} diff --git a/src/resources/radar/email/security/timeseries-groups/arcs.ts b/src/resources/radar/email/security/timeseries-groups/arcs.ts deleted file mode 100644 index cf410c0f09..0000000000 --- a/src/resources/radar/email/security/timeseries-groups/arcs.ts +++ /dev/null @@ -1,130 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as ArcsAPI from 'cloudflare/resources/radar/email/security/timeseries-groups/arcs'; - -export class Arcs extends APIResource { - /** - * Percentage distribution of emails classified per Arc validation over time. - */ - list(query?: ArcListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: ArcListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/email/security/timeseries_groups/arc', { - query, - ...options, - }) as Core.APIPromise<{ result: ArcListResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface ArcListResponse { - meta: unknown; - - serie_0: ArcListResponse.Serie0; -} - -export namespace ArcListResponse { - export interface Serie0 { - FAIL: Array; - - NONE: Array; - - PASS: Array; - } -} - -export interface ArcListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Filter for dkim. - */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Filter for dmarc. - */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Filter for spf. - */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; -} - -export namespace Arcs { - export import ArcListResponse = ArcsAPI.ArcListResponse; - export import ArcListParams = ArcsAPI.ArcListParams; -} diff --git a/src/resources/radar/email/security/timeseries-groups/dkims.ts b/src/resources/radar/email/security/timeseries-groups/dkims.ts deleted file mode 100644 index 3a3e608ceb..0000000000 --- a/src/resources/radar/email/security/timeseries-groups/dkims.ts +++ /dev/null @@ -1,130 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as DKIMsAPI from 'cloudflare/resources/radar/email/security/timeseries-groups/dkims'; - -export class DKIMs extends APIResource { - /** - * Percentage distribution of emails classified per DKIM validation over time. - */ - list(query?: DKIMListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: DKIMListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/email/security/timeseries_groups/dkim', { - query, - ...options, - }) as Core.APIPromise<{ result: DKIMListResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface DKIMListResponse { - meta: unknown; - - serie_0: DKIMListResponse.Serie0; -} - -export namespace DKIMListResponse { - export interface Serie0 { - FAIL: Array; - - NONE: Array; - - PASS: Array; - } -} - -export interface DKIMListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filter for arc (Authenticated Received Chain). - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Filter for dmarc. - */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Filter for spf. - */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; -} - -export namespace DKIMs { - export import DKIMListResponse = DKIMsAPI.DKIMListResponse; - export import DKIMListParams = DKIMsAPI.DKIMListParams; -} diff --git a/src/resources/radar/email/security/timeseries-groups/index.ts b/src/resources/radar/email/security/timeseries-groups/index.ts deleted file mode 100644 index a8b63e72e7..0000000000 --- a/src/resources/radar/email/security/timeseries-groups/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { ArcListResponse, ArcListParams, Arcs } from './arcs'; -export { DKIMListResponse, DKIMListParams, DKIMs } from './dkims'; -export { TimeseriesGroups } from './timeseries-groups'; diff --git a/src/resources/radar/email/security/timeseries-groups/timeseries-groups.ts b/src/resources/radar/email/security/timeseries-groups/timeseries-groups.ts deleted file mode 100644 index 764adfaa49..0000000000 --- a/src/resources/radar/email/security/timeseries-groups/timeseries-groups.ts +++ /dev/null @@ -1,19 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import { APIResource } from 'cloudflare/resource'; -import * as ArcsAPI from 'cloudflare/resources/radar/email/security/timeseries-groups/arcs'; -import * as DKIMsAPI from 'cloudflare/resources/radar/email/security/timeseries-groups/dkims'; - -export class TimeseriesGroups extends APIResource { - arcs: ArcsAPI.Arcs = new ArcsAPI.Arcs(this._client); - dkims: DKIMsAPI.DKIMs = new DKIMsAPI.DKIMs(this._client); -} - -export namespace TimeseriesGroups { - export import Arcs = ArcsAPI.Arcs; - export import ArcListResponse = ArcsAPI.ArcListResponse; - export import ArcListParams = ArcsAPI.ArcListParams; - export import DKIMs = DKIMsAPI.DKIMs; - export import DKIMListResponse = DKIMsAPI.DKIMListResponse; - export import DKIMListParams = DKIMsAPI.DKIMListParams; -} diff --git a/src/resources/radar/emails/security/dmarc.ts b/src/resources/radar/emails/security/dmarc.ts deleted file mode 100644 index 3cc7fc85f5..0000000000 --- a/src/resources/radar/emails/security/dmarc.ts +++ /dev/null @@ -1,130 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as DmarcAPI from 'cloudflare/resources/radar/emails/security/dmarc'; - -export class Dmarc extends APIResource { - /** - * Percentage distribution of emails classified per DMARC validation over time. - */ - list(query?: DmarcListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: DmarcListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/email/security/timeseries_groups/dmarc', { - query, - ...options, - }) as Core.APIPromise<{ result: DmarcListResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface DmarcListResponse { - meta: unknown; - - serie_0: DmarcListResponse.Serie0; -} - -export namespace DmarcListResponse { - export interface Serie0 { - FAIL: Array; - - NONE: Array; - - PASS: Array; - } -} - -export interface DmarcListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filter for arc (Authenticated Received Chain). - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Filter for dkim. - */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Filter for spf. - */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; -} - -export namespace Dmarc { - export import DmarcListResponse = DmarcAPI.DmarcListResponse; - export import DmarcListParams = DmarcAPI.DmarcListParams; -} diff --git a/src/resources/radar/emails/security/index.ts b/src/resources/radar/emails/security/index.ts index 9c67499f1d..5031c73774 100644 --- a/src/resources/radar/emails/security/index.ts +++ b/src/resources/radar/emails/security/index.ts @@ -1,9 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -export { DmarcListResponse, DmarcListParams, Dmarc } from './dmarc'; -export { MaliciousListResponse, MaliciousListParams, Malicious } from './malicious'; -export { SPFListResponse, SPFListParams, SPF } from './spf'; export { Security } from './security'; -export { SpamListResponse, SpamListParams, Spam } from './spam'; -export { ThreatCategoryListResponse, ThreatCategoryListParams, ThreatCategory } from './threat-category'; -export { Top } from './top/index'; +export { + TimeseriesGroupDmarcResponse, + TimeseriesGroupMaliciousResponse, + TimeseriesGroupSpamResponse, + TimeseriesGroupSPFResponse, + TimeseriesGroupThreatCategoryResponse, + TimeseriesGroupDmarcParams, + TimeseriesGroupMaliciousParams, + TimeseriesGroupSpamParams, + TimeseriesGroupSPFParams, + TimeseriesGroupThreatCategoryParams, + TimeseriesGroups, +} from './timeseries-groups'; diff --git a/src/resources/radar/emails/security/malicious.ts b/src/resources/radar/emails/security/malicious.ts deleted file mode 100644 index 021e87caf2..0000000000 --- a/src/resources/radar/emails/security/malicious.ts +++ /dev/null @@ -1,133 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as MaliciousAPI from 'cloudflare/resources/radar/emails/security/malicious'; - -export class Malicious extends APIResource { - /** - * Percentage distribution of emails classified as MALICIOUS over time. - */ - list(query?: MaliciousListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: MaliciousListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/email/security/timeseries_groups/malicious', { - query, - ...options, - }) as Core.APIPromise<{ result: MaliciousListResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface MaliciousListResponse { - meta: unknown; - - serie_0: MaliciousListResponse.Serie0; -} - -export namespace MaliciousListResponse { - export interface Serie0 { - MALICIOUS: Array; - - NOT_MALICIOUS: Array; - } -} - -export interface MaliciousListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filter for arc (Authenticated Received Chain). - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Filter for dkim. - */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Filter for dmarc. - */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Filter for spf. - */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; -} - -export namespace Malicious { - export import MaliciousListResponse = MaliciousAPI.MaliciousListResponse; - export import MaliciousListParams = MaliciousAPI.MaliciousListParams; -} diff --git a/src/resources/radar/emails/security/security.ts b/src/resources/radar/emails/security/security.ts index c07eea39fa..a12bec863c 100644 --- a/src/resources/radar/emails/security/security.ts +++ b/src/resources/radar/emails/security/security.ts @@ -1,37 +1,24 @@ // File generated from our OpenAPI spec by Stainless. import { APIResource } from 'cloudflare/resource'; -import * as DmarcAPI from 'cloudflare/resources/radar/emails/security/dmarc'; -import * as MaliciousAPI from 'cloudflare/resources/radar/emails/security/malicious'; -import * as SpamAPI from 'cloudflare/resources/radar/emails/security/spam'; -import * as SPFAPI from 'cloudflare/resources/radar/emails/security/spf'; -import * as ThreatCategoryAPI from 'cloudflare/resources/radar/emails/security/threat-category'; -import * as TopAPI from 'cloudflare/resources/radar/emails/security/top/top'; +import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/emails/security/timeseries-groups'; export class Security extends APIResource { - dmarc: DmarcAPI.Dmarc = new DmarcAPI.Dmarc(this._client); - malicious: MaliciousAPI.Malicious = new MaliciousAPI.Malicious(this._client); - spam: SpamAPI.Spam = new SpamAPI.Spam(this._client); - spf: SPFAPI.SPF = new SPFAPI.SPF(this._client); - threatCategory: ThreatCategoryAPI.ThreatCategory = new ThreatCategoryAPI.ThreatCategory(this._client); - top: TopAPI.Top = new TopAPI.Top(this._client); + timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( + this._client, + ); } export namespace Security { - export import Dmarc = DmarcAPI.Dmarc; - export import DmarcListResponse = DmarcAPI.DmarcListResponse; - export import DmarcListParams = DmarcAPI.DmarcListParams; - export import Malicious = MaliciousAPI.Malicious; - export import MaliciousListResponse = MaliciousAPI.MaliciousListResponse; - export import MaliciousListParams = MaliciousAPI.MaliciousListParams; - export import Spam = SpamAPI.Spam; - export import SpamListResponse = SpamAPI.SpamListResponse; - export import SpamListParams = SpamAPI.SpamListParams; - export import SPF = SPFAPI.SPF; - export import SPFListResponse = SPFAPI.SPFListResponse; - export import SPFListParams = SPFAPI.SPFListParams; - export import ThreatCategory = ThreatCategoryAPI.ThreatCategory; - export import ThreatCategoryListResponse = ThreatCategoryAPI.ThreatCategoryListResponse; - export import ThreatCategoryListParams = ThreatCategoryAPI.ThreatCategoryListParams; - export import Top = TopAPI.Top; + export import TimeseriesGroups = TimeseriesGroupsAPI.TimeseriesGroups; + export import TimeseriesGroupDmarcResponse = TimeseriesGroupsAPI.TimeseriesGroupDmarcResponse; + export import TimeseriesGroupMaliciousResponse = TimeseriesGroupsAPI.TimeseriesGroupMaliciousResponse; + export import TimeseriesGroupSpamResponse = TimeseriesGroupsAPI.TimeseriesGroupSpamResponse; + export import TimeseriesGroupSPFResponse = TimeseriesGroupsAPI.TimeseriesGroupSPFResponse; + export import TimeseriesGroupThreatCategoryResponse = TimeseriesGroupsAPI.TimeseriesGroupThreatCategoryResponse; + export import TimeseriesGroupDmarcParams = TimeseriesGroupsAPI.TimeseriesGroupDmarcParams; + export import TimeseriesGroupMaliciousParams = TimeseriesGroupsAPI.TimeseriesGroupMaliciousParams; + export import TimeseriesGroupSpamParams = TimeseriesGroupsAPI.TimeseriesGroupSpamParams; + export import TimeseriesGroupSPFParams = TimeseriesGroupsAPI.TimeseriesGroupSPFParams; + export import TimeseriesGroupThreatCategoryParams = TimeseriesGroupsAPI.TimeseriesGroupThreatCategoryParams; } diff --git a/src/resources/radar/emails/security/spam.ts b/src/resources/radar/emails/security/spam.ts deleted file mode 100644 index 2cfeebb6b5..0000000000 --- a/src/resources/radar/emails/security/spam.ts +++ /dev/null @@ -1,133 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as SpamAPI from 'cloudflare/resources/radar/emails/security/spam'; - -export class Spam extends APIResource { - /** - * Percentage distribution of emails classified as SPAM over time. - */ - list(query?: SpamListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: SpamListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/email/security/timeseries_groups/spam', { - query, - ...options, - }) as Core.APIPromise<{ result: SpamListResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface SpamListResponse { - meta: unknown; - - serie_0: SpamListResponse.Serie0; -} - -export namespace SpamListResponse { - export interface Serie0 { - NOT_SPAM: Array; - - SPAM: Array; - } -} - -export interface SpamListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filter for arc (Authenticated Received Chain). - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Filter for dkim. - */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Filter for dmarc. - */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Filter for spf. - */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; -} - -export namespace Spam { - export import SpamListResponse = SpamAPI.SpamListResponse; - export import SpamListParams = SpamAPI.SpamListParams; -} diff --git a/src/resources/radar/emails/security/spf.ts b/src/resources/radar/emails/security/spf.ts deleted file mode 100644 index f1882a525d..0000000000 --- a/src/resources/radar/emails/security/spf.ts +++ /dev/null @@ -1,130 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as SPFAPI from 'cloudflare/resources/radar/emails/security/spf'; - -export class SPF extends APIResource { - /** - * Percentage distribution of emails classified per SPF validation over time. - */ - list(query?: SPFListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: SPFListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/email/security/timeseries_groups/spf', { - query, - ...options, - }) as Core.APIPromise<{ result: SPFListResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface SPFListResponse { - meta: unknown; - - serie_0: SPFListResponse.Serie0; -} - -export namespace SPFListResponse { - export interface Serie0 { - FAIL: Array; - - NONE: Array; - - PASS: Array; - } -} - -export interface SPFListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filter for arc (Authenticated Received Chain). - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Filter for dkim. - */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Filter for dmarc. - */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; -} - -export namespace SPF { - export import SPFListResponse = SPFAPI.SPFListResponse; - export import SPFListParams = SPFAPI.SPFListParams; -} diff --git a/src/resources/radar/emails/security/threat-category.ts b/src/resources/radar/emails/security/threat-category.ts deleted file mode 100644 index 684902ecf5..0000000000 --- a/src/resources/radar/emails/security/threat-category.ts +++ /dev/null @@ -1,140 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as ThreatCategoryAPI from 'cloudflare/resources/radar/emails/security/threat-category'; - -export class ThreatCategory extends APIResource { - /** - * Percentage distribution of emails classified in Threat Categories over time. - */ - list( - query?: ThreatCategoryListParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: ThreatCategoryListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/email/security/timeseries_groups/threat_category', { - query, - ...options, - }) as Core.APIPromise<{ result: ThreatCategoryListResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface ThreatCategoryListResponse { - meta: unknown; - - serie_0: ThreatCategoryListResponse.Serie0; -} - -export namespace ThreatCategoryListResponse { - export interface Serie0 { - BrandImpersonation: Array; - - CredentialHarvester: Array; - - IdentityDeception: Array; - - Link: Array; - } -} - -export interface ThreatCategoryListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filter for arc (Authenticated Received Chain). - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Filter for dkim. - */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Filter for dmarc. - */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Filter for spf. - */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; -} - -export namespace ThreatCategory { - export import ThreatCategoryListResponse = ThreatCategoryAPI.ThreatCategoryListResponse; - export import ThreatCategoryListParams = ThreatCategoryAPI.ThreatCategoryListParams; -} diff --git a/src/resources/radar/emails/security/timeseries-groups.ts b/src/resources/radar/emails/security/timeseries-groups.ts new file mode 100644 index 0000000000..783a959e03 --- /dev/null +++ b/src/resources/radar/emails/security/timeseries-groups.ts @@ -0,0 +1,634 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/emails/security/timeseries-groups'; + +export class TimeseriesGroups extends APIResource { + /** + * Percentage distribution of emails classified per DMARC validation over time. + */ + dmarc( + query?: TimeseriesGroupDmarcParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + dmarc(options?: Core.RequestOptions): Core.APIPromise; + dmarc( + query: TimeseriesGroupDmarcParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.dmarc({}, query); + } + return ( + this._client.get('/radar/email/security/timeseries_groups/dmarc', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupDmarcResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of emails classified as MALICIOUS over time. + */ + malicious( + query?: TimeseriesGroupMaliciousParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + malicious(options?: Core.RequestOptions): Core.APIPromise; + malicious( + query: TimeseriesGroupMaliciousParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.malicious({}, query); + } + return ( + this._client.get('/radar/email/security/timeseries_groups/malicious', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupMaliciousResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of emails classified as SPAM over time. + */ + spam( + query?: TimeseriesGroupSpamParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + spam(options?: Core.RequestOptions): Core.APIPromise; + spam( + query: TimeseriesGroupSpamParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.spam({}, query); + } + return ( + this._client.get('/radar/email/security/timeseries_groups/spam', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupSpamResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of emails classified per SPF validation over time. + */ + spf( + query?: TimeseriesGroupSPFParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + spf(options?: Core.RequestOptions): Core.APIPromise; + spf( + query: TimeseriesGroupSPFParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.spf({}, query); + } + return ( + this._client.get('/radar/email/security/timeseries_groups/spf', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupSPFResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of emails classified in Threat Categories over time. + */ + threatCategory( + query?: TimeseriesGroupThreatCategoryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + threatCategory(options?: Core.RequestOptions): Core.APIPromise; + threatCategory( + query: TimeseriesGroupThreatCategoryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.threatCategory({}, query); + } + return ( + this._client.get('/radar/email/security/timeseries_groups/threat_category', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupThreatCategoryResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TimeseriesGroupDmarcResponse { + meta: unknown; + + serie_0: TimeseriesGroupDmarcResponse.Serie0; +} + +export namespace TimeseriesGroupDmarcResponse { + export interface Serie0 { + FAIL: Array; + + NONE: Array; + + PASS: Array; + } +} + +export interface TimeseriesGroupMaliciousResponse { + meta: unknown; + + serie_0: TimeseriesGroupMaliciousResponse.Serie0; +} + +export namespace TimeseriesGroupMaliciousResponse { + export interface Serie0 { + MALICIOUS: Array; + + NOT_MALICIOUS: Array; + } +} + +export interface TimeseriesGroupSpamResponse { + meta: unknown; + + serie_0: TimeseriesGroupSpamResponse.Serie0; +} + +export namespace TimeseriesGroupSpamResponse { + export interface Serie0 { + NOT_SPAM: Array; + + SPAM: Array; + } +} + +export interface TimeseriesGroupSPFResponse { + meta: unknown; + + serie_0: TimeseriesGroupSPFResponse.Serie0; +} + +export namespace TimeseriesGroupSPFResponse { + export interface Serie0 { + FAIL: Array; + + NONE: Array; + + PASS: Array; + } +} + +export interface TimeseriesGroupThreatCategoryResponse { + meta: unknown; + + serie_0: TimeseriesGroupThreatCategoryResponse.Serie0; +} + +export namespace TimeseriesGroupThreatCategoryResponse { + export interface Serie0 { + BrandImpersonation: Array; + + CredentialHarvester: Array; + + IdentityDeception: Array; + + Link: Array; + } +} + +export interface TimeseriesGroupDmarcParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export interface TimeseriesGroupMaliciousParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export interface TimeseriesGroupSpamParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export interface TimeseriesGroupSPFParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface TimeseriesGroupThreatCategoryParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export namespace TimeseriesGroups { + export import TimeseriesGroupDmarcResponse = TimeseriesGroupsAPI.TimeseriesGroupDmarcResponse; + export import TimeseriesGroupMaliciousResponse = TimeseriesGroupsAPI.TimeseriesGroupMaliciousResponse; + export import TimeseriesGroupSpamResponse = TimeseriesGroupsAPI.TimeseriesGroupSpamResponse; + export import TimeseriesGroupSPFResponse = TimeseriesGroupsAPI.TimeseriesGroupSPFResponse; + export import TimeseriesGroupThreatCategoryResponse = TimeseriesGroupsAPI.TimeseriesGroupThreatCategoryResponse; + export import TimeseriesGroupDmarcParams = TimeseriesGroupsAPI.TimeseriesGroupDmarcParams; + export import TimeseriesGroupMaliciousParams = TimeseriesGroupsAPI.TimeseriesGroupMaliciousParams; + export import TimeseriesGroupSpamParams = TimeseriesGroupsAPI.TimeseriesGroupSpamParams; + export import TimeseriesGroupSPFParams = TimeseriesGroupsAPI.TimeseriesGroupSPFParams; + export import TimeseriesGroupThreatCategoryParams = TimeseriesGroupsAPI.TimeseriesGroupThreatCategoryParams; +} diff --git a/src/resources/radar/emails/security/top/ases/index.ts b/src/resources/radar/emails/security/top/ases/index.ts deleted file mode 100644 index 8771199a04..0000000000 --- a/src/resources/radar/emails/security/top/ases/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { ArcGetResponse, ArcGetParams, Arc } from './arc'; -export { AseListResponse, AseListParams, Ases } from './ases'; -export { DKIMGetResponse, DKIMGetParams, DKIM } from './dkim'; -export { DmarcGetResponse, DmarcGetParams, Dmarc } from './dmarc'; diff --git a/src/resources/radar/emails/security/top/index.ts b/src/resources/radar/emails/security/top/index.ts deleted file mode 100644 index abeeb512fa..0000000000 --- a/src/resources/radar/emails/security/top/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { AseListResponse, AseListParams, Ases } from './ases/index'; -export { Top } from './top'; diff --git a/src/resources/radar/emails/security/top/top.ts b/src/resources/radar/emails/security/top/top.ts deleted file mode 100644 index f91df9c565..0000000000 --- a/src/resources/radar/emails/security/top/top.ts +++ /dev/null @@ -1,14 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import { APIResource } from 'cloudflare/resource'; -import * as AsesAPI from 'cloudflare/resources/radar/emails/security/top/ases/ases'; - -export class Top extends APIResource { - ases: AsesAPI.Ases = new AsesAPI.Ases(this._client); -} - -export namespace Top { - export import Ases = AsesAPI.Ases; - export import AseListResponse = AsesAPI.AseListResponse; - export import AseListParams = AsesAPI.AseListParams; -} diff --git a/src/resources/radar/entities/asns.ts b/src/resources/radar/entities/asns.ts index 995dfb1d16..b4dfe25ec9 100644 --- a/src/resources/radar/entities/asns.ts +++ b/src/resources/radar/entities/asns.ts @@ -6,6 +6,60 @@ import { isRequestOptions } from 'cloudflare/core'; import * as AsnsAPI from 'cloudflare/resources/radar/entities/asns'; export class Asns extends APIResource { + /** + * Gets a list of autonomous systems (AS). + */ + list(query?: AsnListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: AsnListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/entities/asns', { query, ...options }) as Core.APIPromise<{ + result: AsnListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get the requested autonomous system information. A confidence level below `5` + * indicates a low level of confidence in the traffic data - normally this happens + * because Cloudflare has a small amount of traffic from/to this AS). Population + * estimates come from APNIC (refer to https://labs.apnic.net/?p=526). + */ + get(asn: number, query?: AsnGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(asn: number, options?: Core.RequestOptions): Core.APIPromise; + get( + asn: number, + query: AsnGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(asn, {}, query); + } + return ( + this._client.get(`/radar/entities/asns/${asn}`, { query, ...options }) as Core.APIPromise<{ + result: AsnGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get the requested autonomous system information based on IP address. Population + * estimates come from APNIC (refer to https://labs.apnic.net/?p=526). + */ + ip(query: AsnIPParams, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.get('/radar/entities/asns/ip', { query, ...options }) as Core.APIPromise<{ + result: AsnIPResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Get AS-level relationship for given networks. */ @@ -27,6 +81,181 @@ export class Asns extends APIResource { } } +export interface AsnListResponse { + asns: Array; +} + +export namespace AsnListResponse { + export interface Asn { + asn: number; + + country: string; + + countryName: string; + + name: string; + + aka?: string; + + /** + * Deprecated field. Please use 'aka'. + */ + nameLong?: string; + + orgName?: string; + + website?: string; + } +} + +export interface AsnGetResponse { + asn: AsnGetResponse.Asn; +} + +export namespace AsnGetResponse { + export interface Asn { + asn: number; + + confidenceLevel: number; + + country: string; + + countryName: string; + + estimatedUsers: Asn.EstimatedUsers; + + name: string; + + orgName: string; + + related: Array; + + /** + * Regional Internet Registry + */ + source: string; + + website: string; + + aka?: string; + + /** + * Deprecated field. Please use 'aka'. + */ + nameLong?: string; + } + + export namespace Asn { + export interface EstimatedUsers { + locations: Array; + + /** + * Total estimated users + */ + estimatedUsers?: number; + } + + export namespace EstimatedUsers { + export interface Location { + locationAlpha2: string; + + locationName: string; + + /** + * Estimated users per location + */ + estimatedUsers?: number; + } + } + + export interface Related { + asn: number; + + name: string; + + aka?: string; + + /** + * Total estimated users + */ + estimatedUsers?: number; + } + } +} + +export interface AsnIPResponse { + asn: AsnIPResponse.Asn; +} + +export namespace AsnIPResponse { + export interface Asn { + asn: number; + + country: string; + + countryName: string; + + estimatedUsers: Asn.EstimatedUsers; + + name: string; + + orgName: string; + + related: Array; + + /** + * Regional Internet Registry + */ + source: string; + + website: string; + + aka?: string; + + /** + * Deprecated field. Please use 'aka'. + */ + nameLong?: string; + } + + export namespace Asn { + export interface EstimatedUsers { + locations: Array; + + /** + * Total estimated users + */ + estimatedUsers?: number; + } + + export namespace EstimatedUsers { + export interface Location { + locationAlpha2: string; + + locationName: string; + + /** + * Estimated users per location + */ + estimatedUsers?: number; + } + } + + export interface Related { + asn: number; + + name: string; + + aka?: string; + + /** + * Total estimated users + */ + estimatedUsers?: number; + } + } +} + export interface AsnRelResponse { meta: AsnRelResponse.Meta; @@ -59,6 +288,57 @@ export namespace AsnRelResponse { } } +export interface AsnListParams { + /** + * Comma separated list of ASNs. + */ + asn?: string; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Location Alpha2 to filter results. + */ + location?: string; + + /** + * Number of objects to skip before grabbing results. + */ + offset?: number; + + /** + * Order asn list. + */ + orderBy?: 'ASN' | 'POPULATION'; +} + +export interface AsnGetParams { + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; +} + +export interface AsnIPParams { + /** + * IP address. + */ + ip: string; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; +} + export interface AsnRelParams { /** * Get the AS relationship of ASN2 with respect to the given ASN @@ -72,6 +352,12 @@ export interface AsnRelParams { } export namespace Asns { + export import AsnListResponse = AsnsAPI.AsnListResponse; + export import AsnGetResponse = AsnsAPI.AsnGetResponse; + export import AsnIPResponse = AsnsAPI.AsnIPResponse; export import AsnRelResponse = AsnsAPI.AsnRelResponse; + export import AsnListParams = AsnsAPI.AsnListParams; + export import AsnGetParams = AsnsAPI.AsnGetParams; + export import AsnIPParams = AsnsAPI.AsnIPParams; export import AsnRelParams = AsnsAPI.AsnRelParams; } diff --git a/src/resources/radar/entities/entities.ts b/src/resources/radar/entities/entities.ts index 61c890e4b7..5c2c4a3344 100644 --- a/src/resources/radar/entities/entities.ts +++ b/src/resources/radar/entities/entities.ts @@ -4,27 +4,29 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import * as EntitiesAPI from 'cloudflare/resources/radar/entities/entities'; import * as AsnsAPI from 'cloudflare/resources/radar/entities/asns'; +import * as LocationsAPI from 'cloudflare/resources/radar/entities/locations'; export class Entities extends APIResource { asns: AsnsAPI.Asns = new AsnsAPI.Asns(this._client); + locations: LocationsAPI.Locations = new LocationsAPI.Locations(this._client); /** * Get IP address information. */ - list(query: EntityListParams, options?: Core.RequestOptions): Core.APIPromise { + get(query: EntityGetParams, options?: Core.RequestOptions): Core.APIPromise { return ( this._client.get('/radar/entities/ip', { query, ...options }) as Core.APIPromise<{ - result: EntityListResponse; + result: EntityGetResponse; }> )._thenUnwrap((obj) => obj.result); } } -export interface EntityListResponse { - ip: EntityListResponse.IP; +export interface EntityGetResponse { + ip: EntityGetResponse.IP; } -export namespace EntityListResponse { +export namespace EntityGetResponse { export interface IP { asn: string; @@ -44,7 +46,7 @@ export namespace EntityListResponse { } } -export interface EntityListParams { +export interface EntityGetParams { /** * IP address. */ @@ -57,9 +59,20 @@ export interface EntityListParams { } export namespace Entities { - export import EntityListResponse = EntitiesAPI.EntityListResponse; - export import EntityListParams = EntitiesAPI.EntityListParams; + export import EntityGetResponse = EntitiesAPI.EntityGetResponse; + export import EntityGetParams = EntitiesAPI.EntityGetParams; export import Asns = AsnsAPI.Asns; + export import AsnListResponse = AsnsAPI.AsnListResponse; + export import AsnGetResponse = AsnsAPI.AsnGetResponse; + export import AsnIPResponse = AsnsAPI.AsnIPResponse; export import AsnRelResponse = AsnsAPI.AsnRelResponse; + export import AsnListParams = AsnsAPI.AsnListParams; + export import AsnGetParams = AsnsAPI.AsnGetParams; + export import AsnIPParams = AsnsAPI.AsnIPParams; export import AsnRelParams = AsnsAPI.AsnRelParams; + export import Locations = LocationsAPI.Locations; + export import LocationListResponse = LocationsAPI.LocationListResponse; + export import LocationGetResponse = LocationsAPI.LocationGetResponse; + export import LocationListParams = LocationsAPI.LocationListParams; + export import LocationGetParams = LocationsAPI.LocationGetParams; } diff --git a/src/resources/radar/entities/index.ts b/src/resources/radar/entities/index.ts index 5021a03931..08be36fed7 100644 --- a/src/resources/radar/entities/index.ts +++ b/src/resources/radar/entities/index.ts @@ -1,4 +1,21 @@ // File generated from our OpenAPI spec by Stainless. -export { AsnRelResponse, AsnRelParams, Asns } from './asns'; -export { EntityListResponse, EntityListParams, Entities } from './entities'; +export { + AsnListResponse, + AsnGetResponse, + AsnIPResponse, + AsnRelResponse, + AsnListParams, + AsnGetParams, + AsnIPParams, + AsnRelParams, + Asns, +} from './asns'; +export { EntityGetResponse, EntityGetParams, Entities } from './entities'; +export { + LocationListResponse, + LocationGetResponse, + LocationListParams, + LocationGetParams, + Locations, +} from './locations'; diff --git a/src/resources/radar/entities/locations.ts b/src/resources/radar/entities/locations.ts new file mode 100644 index 0000000000..f7914b27c3 --- /dev/null +++ b/src/resources/radar/entities/locations.ts @@ -0,0 +1,127 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as LocationsAPI from 'cloudflare/resources/radar/entities/locations'; + +export class Locations extends APIResource { + /** + * Get a list of locations. + */ + list(query?: LocationListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: LocationListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/entities/locations', { query, ...options }) as Core.APIPromise<{ + result: LocationListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get the requested location information. A confidence level below `5` indicates a + * low level of confidence in the traffic data - normally this happens because + * Cloudflare has a small amount of traffic from/to this location). + */ + get( + location: string, + query?: LocationGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(location: string, options?: Core.RequestOptions): Core.APIPromise; + get( + location: string, + query: LocationGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(location, {}, query); + } + return ( + this._client.get(`/radar/entities/locations/${location}`, { query, ...options }) as Core.APIPromise<{ + result: LocationGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface LocationListResponse { + locations: Array; +} + +export namespace LocationListResponse { + export interface Location { + alpha2: string; + + latitude: string; + + longitude: string; + + name: string; + } +} + +export interface LocationGetResponse { + location: LocationGetResponse.Location; +} + +export namespace LocationGetResponse { + export interface Location { + alpha2: string; + + confidenceLevel: number; + + latitude: string; + + longitude: string; + + name: string; + + region: string; + + subregion: string; + } +} + +export interface LocationListParams { + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Comma separated list of locations. + */ + location?: string; + + /** + * Number of objects to skip before grabbing results. + */ + offset?: number; +} + +export interface LocationGetParams { + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; +} + +export namespace Locations { + export import LocationListResponse = LocationsAPI.LocationListResponse; + export import LocationGetResponse = LocationsAPI.LocationGetResponse; + export import LocationListParams = LocationsAPI.LocationListParams; + export import LocationGetParams = LocationsAPI.LocationGetParams; +} diff --git a/src/resources/radar/http/ases/ases.ts b/src/resources/radar/http/ases/ases.ts new file mode 100644 index 0000000000..8fe25f0aa8 --- /dev/null +++ b/src/resources/radar/http/ases/ases.ts @@ -0,0 +1,231 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as AsesAPI from 'cloudflare/resources/radar/http/ases/ases'; +import * as BotClassAPI from 'cloudflare/resources/radar/http/ases/bot-class'; +import * as DeviceTypeAPI from 'cloudflare/resources/radar/http/ases/device-type'; +import * as HTTPMethodAPI from 'cloudflare/resources/radar/http/ases/http-method'; +import * as HTTPProtocolAPI from 'cloudflare/resources/radar/http/ases/http-protocol'; +import * as IPVersionAPI from 'cloudflare/resources/radar/http/ases/ip-version'; +import * as OsAPI from 'cloudflare/resources/radar/http/ases/os'; +import * as TLSVersionAPI from 'cloudflare/resources/radar/http/ases/tls-version'; + +export class Ases extends APIResource { + botClass: BotClassAPI.BotClass = new BotClassAPI.BotClass(this._client); + deviceType: DeviceTypeAPI.DeviceType = new DeviceTypeAPI.DeviceType(this._client); + httpProtocol: HTTPProtocolAPI.HTTPProtocol = new HTTPProtocolAPI.HTTPProtocol(this._client); + httpMethod: HTTPMethodAPI.HTTPMethod = new HTTPMethodAPI.HTTPMethod(this._client); + ipVersion: IPVersionAPI.IPVersion = new IPVersionAPI.IPVersion(this._client); + os: OsAPI.Os = new OsAPI.Os(this._client); + tlsVersion: TLSVersionAPI.TLSVersion = new TLSVersionAPI.TLSVersion(this._client); + + /** + * Get the top autonomous systems by HTTP traffic. Values are a percentage out of + * the total traffic. + */ + get(query?: AseGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(options?: Core.RequestOptions): Core.APIPromise; + get( + query: AseGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get({}, query); + } + return ( + this._client.get('/radar/http/top/ases', { query, ...options }) as Core.APIPromise<{ + result: AseGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface AseGetResponse { + meta: AseGetResponse.Meta; + + top_0: Array; +} + +export namespace AseGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientASN: number; + + clientASName: string; + + value: string; + } +} + +export interface AseGetParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export namespace Ases { + export import AseGetResponse = AsesAPI.AseGetResponse; + export import AseGetParams = AsesAPI.AseGetParams; + export import BotClass = BotClassAPI.BotClass; + export import BotClassGetResponse = BotClassAPI.BotClassGetResponse; + export import BotClassGetParams = BotClassAPI.BotClassGetParams; + export import DeviceType = DeviceTypeAPI.DeviceType; + export import DeviceTypeGetResponse = DeviceTypeAPI.DeviceTypeGetResponse; + export import DeviceTypeGetParams = DeviceTypeAPI.DeviceTypeGetParams; + export import HTTPProtocol = HTTPProtocolAPI.HTTPProtocol; + export import HTTPProtocolGetResponse = HTTPProtocolAPI.HTTPProtocolGetResponse; + export import HTTPProtocolGetParams = HTTPProtocolAPI.HTTPProtocolGetParams; + export import HTTPMethod = HTTPMethodAPI.HTTPMethod; + export import HTTPMethodGetResponse = HTTPMethodAPI.HTTPMethodGetResponse; + export import HTTPMethodGetParams = HTTPMethodAPI.HTTPMethodGetParams; + export import IPVersion = IPVersionAPI.IPVersion; + export import IPVersionGetResponse = IPVersionAPI.IPVersionGetResponse; + export import IPVersionGetParams = IPVersionAPI.IPVersionGetParams; + export import Os = OsAPI.Os; + export import OGetResponse = OsAPI.OGetResponse; + export import OGetParams = OsAPI.OGetParams; + export import TLSVersion = TLSVersionAPI.TLSVersion; + export import TLSVersionGetResponse = TLSVersionAPI.TLSVersionGetResponse; + export import TLSVersionGetParams = TLSVersionAPI.TLSVersionGetParams; +} diff --git a/src/resources/radar/emails/security/top/ases/ases.ts b/src/resources/radar/http/ases/bot-class.ts similarity index 55% rename from src/resources/radar/emails/security/top/ases/ases.ts rename to src/resources/radar/http/ases/bot-class.ts index b66ca29789..9d4f05bff9 100644 --- a/src/resources/radar/emails/security/top/ases/ases.ts +++ b/src/resources/radar/http/ases/bot-class.ts @@ -3,44 +3,48 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import { isRequestOptions } from 'cloudflare/core'; -import * as AsesAPI from 'cloudflare/resources/radar/emails/security/top/ases/ases'; -import * as ArcAPI from 'cloudflare/resources/radar/emails/security/top/ases/arc'; -import * as DKIMAPI from 'cloudflare/resources/radar/emails/security/top/ases/dkim'; -import * as DmarcAPI from 'cloudflare/resources/radar/emails/security/top/ases/dmarc'; - -export class Ases extends APIResource { - arc: ArcAPI.Arc = new ArcAPI.Arc(this._client); - dkim: DKIMAPI.DKIM = new DKIMAPI.DKIM(this._client); - dmarc: DmarcAPI.Dmarc = new DmarcAPI.Dmarc(this._client); +import * as BotClassAPI from 'cloudflare/resources/radar/http/ases/bot-class'; +export class BotClass extends APIResource { /** - * Get the top autonomous systems (AS) by email messages. Values are a percentage - * out of the total emails. + * Get the top autonomous systems (AS), by HTTP traffic, of the requested bot + * class. These two categories use Cloudflare's bot score - refer to + * [Bot Scores](https://developers.cloudflare.com/bots/concepts/bot-score) for more + * information. Values are a percentage out of the total traffic. */ - list(query?: AseListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: AseListParams | Core.RequestOptions = {}, + get( + botClass: 'LIKELY_AUTOMATED' | 'LIKELY_HUMAN', + query?: BotClassGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + botClass: 'LIKELY_AUTOMATED' | 'LIKELY_HUMAN', + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + botClass: 'LIKELY_AUTOMATED' | 'LIKELY_HUMAN', + query: BotClassGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.list({}, query); + return this.get(botClass, {}, query); } return ( - this._client.get('/radar/email/security/top/ases', { query, ...options }) as Core.APIPromise<{ - result: AseListResponse; - }> + this._client.get(`/radar/http/top/ases/bot_class/${botClass}`, { + query, + ...options, + }) as Core.APIPromise<{ result: BotClassGetResponse }> )._thenUnwrap((obj) => obj.result); } } -export interface AseListResponse { - meta: AseListResponse.Meta; +export interface BotClassGetResponse { + meta: BotClassGetResponse.Meta; - top_0: Array; + top_0: Array; } -export namespace AseListResponse { +export namespace BotClassGetResponse { export interface Meta { dateRange: Array; @@ -96,12 +100,7 @@ export namespace AseListResponse { } } -export interface AseListParams { - /** - * Filter for arc (Authenticated Received Chain). - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - +export interface BotClassGetParams { /** * Array of comma separated list of ASNs, start with `-` to exclude from results. * For example, `-174, 3356` excludes results from AS174, but includes results from @@ -143,19 +142,29 @@ export interface AseListParams { dateStart?: Array; /** - * Filter for dkim. + * Filter for device type. */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; /** - * Filter for dmarc. + * Format results are returned in. */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + format?: 'JSON' | 'CSV'; /** - * Format results are returned in. + * Filter for http protocol. */ - format?: 'JSON' | 'CSV'; + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; /** * Limit the number of objects in the response. @@ -175,21 +184,17 @@ export interface AseListParams { name?: Array; /** - * Filter for spf. + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; } -export namespace Ases { - export import AseListResponse = AsesAPI.AseListResponse; - export import AseListParams = AsesAPI.AseListParams; - export import Arc = ArcAPI.Arc; - export import ArcGetResponse = ArcAPI.ArcGetResponse; - export import ArcGetParams = ArcAPI.ArcGetParams; - export import DKIM = DKIMAPI.DKIM; - export import DKIMGetResponse = DKIMAPI.DKIMGetResponse; - export import DKIMGetParams = DKIMAPI.DKIMGetParams; - export import Dmarc = DmarcAPI.Dmarc; - export import DmarcGetResponse = DmarcAPI.DmarcGetResponse; - export import DmarcGetParams = DmarcAPI.DmarcGetParams; +export namespace BotClass { + export import BotClassGetResponse = BotClassAPI.BotClassGetResponse; + export import BotClassGetParams = BotClassAPI.BotClassGetParams; } diff --git a/src/resources/radar/emails/security/top/ases/arc.ts b/src/resources/radar/http/ases/device-type.ts similarity index 58% rename from src/resources/radar/emails/security/top/ases/arc.ts rename to src/resources/radar/http/ases/device-type.ts index 6c714243da..4c371f841c 100644 --- a/src/resources/radar/emails/security/top/ases/arc.ts +++ b/src/resources/radar/http/ases/device-type.ts @@ -3,42 +3,46 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import { isRequestOptions } from 'cloudflare/core'; -import * as ArcAPI from 'cloudflare/resources/radar/emails/security/top/ases/arc'; +import * as DeviceTypeAPI from 'cloudflare/resources/radar/http/ases/device-type'; -export class Arc extends APIResource { +export class DeviceType extends APIResource { /** - * Get the top autonomous systems (AS) by emails ARC validation. + * Get the top autonomous systems (AS), by HTTP traffic, of the requested device + * type. Values are a percentage out of the total traffic. */ get( - arc: 'PASS' | 'NONE' | 'FAIL', - query?: ArcGetParams, + deviceType: 'DESKTOP' | 'MOBILE' | 'OTHER', + query?: DeviceTypeGetParams, options?: Core.RequestOptions, - ): Core.APIPromise; - get(arc: 'PASS' | 'NONE' | 'FAIL', options?: Core.RequestOptions): Core.APIPromise; + ): Core.APIPromise; get( - arc: 'PASS' | 'NONE' | 'FAIL', - query: ArcGetParams | Core.RequestOptions = {}, + deviceType: 'DESKTOP' | 'MOBILE' | 'OTHER', options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise; + get( + deviceType: 'DESKTOP' | 'MOBILE' | 'OTHER', + query: DeviceTypeGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.get(arc, {}, query); + return this.get(deviceType, {}, query); } return ( - this._client.get(`/radar/email/security/top/ases/arc/${arc}`, { + this._client.get(`/radar/http/top/ases/device_type/${deviceType}`, { query, ...options, - }) as Core.APIPromise<{ result: ArcGetResponse }> + }) as Core.APIPromise<{ result: DeviceTypeGetResponse }> )._thenUnwrap((obj) => obj.result); } } -export interface ArcGetResponse { - meta: ArcGetResponse.Meta; +export interface DeviceTypeGetResponse { + meta: DeviceTypeGetResponse.Meta; - top_0: Array; + top_0: Array; } -export namespace ArcGetResponse { +export namespace DeviceTypeGetResponse { export interface Meta { dateRange: Array; @@ -94,7 +98,7 @@ export namespace ArcGetResponse { } } -export interface ArcGetParams { +export interface DeviceTypeGetParams { /** * Array of comma separated list of ASNs, start with `-` to exclude from results. * For example, `-174, 3356` excludes results from AS174, but includes results from @@ -102,6 +106,12 @@ export interface ArcGetParams { */ asn?: Array; + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + /** * End of the date range (inclusive). */ @@ -136,19 +146,24 @@ export interface ArcGetParams { dateStart?: Array; /** - * Filter for dkim. + * Format results are returned in. */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + format?: 'JSON' | 'CSV'; /** - * Filter for dmarc. + * Filter for http protocol. */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + httpProtocol?: Array<'HTTP' | 'HTTPS'>; /** - * Format results are returned in. + * Filter for http version. */ - format?: 'JSON' | 'CSV'; + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; /** * Limit the number of objects in the response. @@ -168,12 +183,17 @@ export interface ArcGetParams { name?: Array; /** - * Filter for spf. + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; } -export namespace Arc { - export import ArcGetResponse = ArcAPI.ArcGetResponse; - export import ArcGetParams = ArcAPI.ArcGetParams; +export namespace DeviceType { + export import DeviceTypeGetResponse = DeviceTypeAPI.DeviceTypeGetResponse; + export import DeviceTypeGetParams = DeviceTypeAPI.DeviceTypeGetParams; } diff --git a/src/resources/radar/http/ases/http-method.ts b/src/resources/radar/http/ases/http-method.ts new file mode 100644 index 0000000000..0999b3e15d --- /dev/null +++ b/src/resources/radar/http/ases/http-method.ts @@ -0,0 +1,199 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as HTTPMethodAPI from 'cloudflare/resources/radar/http/ases/http-method'; + +export class HTTPMethod extends APIResource { + /** + * Get the top autonomous systems (AS), by HTTP traffic, of the requested HTTP + * protocol version. Values are a percentage out of the total traffic. + */ + get( + httpVersion: 'HTTPv1' | 'HTTPv2' | 'HTTPv3', + query?: HTTPMethodGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + httpVersion: 'HTTPv1' | 'HTTPv2' | 'HTTPv3', + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + httpVersion: 'HTTPv1' | 'HTTPv2' | 'HTTPv3', + query: HTTPMethodGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(httpVersion, {}, query); + } + return ( + this._client.get(`/radar/http/top/ases/http_version/${httpVersion}`, { + query, + ...options, + }) as Core.APIPromise<{ result: HTTPMethodGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface HTTPMethodGetResponse { + meta: HTTPMethodGetResponse.Meta; + + top_0: Array; +} + +export namespace HTTPMethodGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientASN: number; + + clientASName: string; + + value: string; + } +} + +export interface HTTPMethodGetParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export namespace HTTPMethod { + export import HTTPMethodGetResponse = HTTPMethodAPI.HTTPMethodGetResponse; + export import HTTPMethodGetParams = HTTPMethodAPI.HTTPMethodGetParams; +} diff --git a/src/resources/radar/http/ases/http-protocol.ts b/src/resources/radar/http/ases/http-protocol.ts new file mode 100644 index 0000000000..8e28cbdf67 --- /dev/null +++ b/src/resources/radar/http/ases/http-protocol.ts @@ -0,0 +1,199 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as HTTPProtocolAPI from 'cloudflare/resources/radar/http/ases/http-protocol'; + +export class HTTPProtocol extends APIResource { + /** + * Get the top autonomous systems (AS), by HTTP traffic, of the requested HTTP + * protocol. Values are a percentage out of the total traffic. + */ + get( + httpProtocol: 'HTTP' | 'HTTPS', + query?: HTTPProtocolGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + httpProtocol: 'HTTP' | 'HTTPS', + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + httpProtocol: 'HTTP' | 'HTTPS', + query: HTTPProtocolGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(httpProtocol, {}, query); + } + return ( + this._client.get(`/radar/http/top/ases/http_protocol/${httpProtocol}`, { + query, + ...options, + }) as Core.APIPromise<{ result: HTTPProtocolGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface HTTPProtocolGetResponse { + meta: HTTPProtocolGetResponse.Meta; + + top_0: Array; +} + +export namespace HTTPProtocolGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientASN: number; + + clientASName: string; + + value: string; + } +} + +export interface HTTPProtocolGetParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export namespace HTTPProtocol { + export import HTTPProtocolGetResponse = HTTPProtocolAPI.HTTPProtocolGetResponse; + export import HTTPProtocolGetParams = HTTPProtocolAPI.HTTPProtocolGetParams; +} diff --git a/src/resources/radar/http/ases/index.ts b/src/resources/radar/http/ases/index.ts new file mode 100644 index 0000000000..b217cb0b6a --- /dev/null +++ b/src/resources/radar/http/ases/index.ts @@ -0,0 +1,10 @@ +// File generated from our OpenAPI spec by Stainless. + +export { AseGetResponse, AseGetParams, Ases } from './ases'; +export { BotClassGetResponse, BotClassGetParams, BotClass } from './bot-class'; +export { DeviceTypeGetResponse, DeviceTypeGetParams, DeviceType } from './device-type'; +export { HTTPMethodGetResponse, HTTPMethodGetParams, HTTPMethod } from './http-method'; +export { HTTPProtocolGetResponse, HTTPProtocolGetParams, HTTPProtocol } from './http-protocol'; +export { IPVersionGetResponse, IPVersionGetParams, IPVersion } from './ip-version'; +export { OGetResponse, OGetParams, Os } from './os'; +export { TLSVersionGetResponse, TLSVersionGetParams, TLSVersion } from './tls-version'; diff --git a/src/resources/radar/emails/security/top/ases/dkim.ts b/src/resources/radar/http/ases/ip-version.ts similarity index 59% rename from src/resources/radar/emails/security/top/ases/dkim.ts rename to src/resources/radar/http/ases/ip-version.ts index de186917eb..1ea51508b0 100644 --- a/src/resources/radar/emails/security/top/ases/dkim.ts +++ b/src/resources/radar/http/ases/ip-version.ts @@ -3,42 +3,43 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import { isRequestOptions } from 'cloudflare/core'; -import * as DKIMAPI from 'cloudflare/resources/radar/emails/security/top/ases/dkim'; +import * as IPVersionAPI from 'cloudflare/resources/radar/http/ases/ip-version'; -export class DKIM extends APIResource { +export class IPVersion extends APIResource { /** - * Get the top autonomous systems (AS), by email DKIM validation. + * Get the top autonomous systems, by HTTP traffic, of the requested IP protocol + * version. Values are a percentage out of the total traffic. */ get( - dkim: 'PASS' | 'NONE' | 'FAIL', - query?: DKIMGetParams, + ipVersion: 'IPv4' | 'IPv6', + query?: IPVersionGetParams, options?: Core.RequestOptions, - ): Core.APIPromise; - get(dkim: 'PASS' | 'NONE' | 'FAIL', options?: Core.RequestOptions): Core.APIPromise; + ): Core.APIPromise; + get(ipVersion: 'IPv4' | 'IPv6', options?: Core.RequestOptions): Core.APIPromise; get( - dkim: 'PASS' | 'NONE' | 'FAIL', - query: DKIMGetParams | Core.RequestOptions = {}, + ipVersion: 'IPv4' | 'IPv6', + query: IPVersionGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.get(dkim, {}, query); + return this.get(ipVersion, {}, query); } return ( - this._client.get(`/radar/email/security/top/ases/dkim/${dkim}`, { + this._client.get(`/radar/http/top/ases/ip_version/${ipVersion}`, { query, ...options, - }) as Core.APIPromise<{ result: DKIMGetResponse }> + }) as Core.APIPromise<{ result: IPVersionGetResponse }> )._thenUnwrap((obj) => obj.result); } } -export interface DKIMGetResponse { - meta: DKIMGetResponse.Meta; +export interface IPVersionGetResponse { + meta: IPVersionGetResponse.Meta; - top_0: Array; + top_0: Array; } -export namespace DKIMGetResponse { +export namespace IPVersionGetResponse { export interface Meta { dateRange: Array; @@ -94,12 +95,7 @@ export namespace DKIMGetResponse { } } -export interface DKIMGetParams { - /** - * Filter for arc (Authenticated Received Chain). - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - +export interface IPVersionGetParams { /** * Array of comma separated list of ASNs, start with `-` to exclude from results. * For example, `-174, 3356` excludes results from AS174, but includes results from @@ -107,6 +103,12 @@ export interface DKIMGetParams { */ asn?: Array; + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + /** * End of the date range (inclusive). */ @@ -141,15 +143,25 @@ export interface DKIMGetParams { dateStart?: Array; /** - * Filter for dmarc. + * Filter for device type. */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; /** * Format results are returned in. */ format?: 'JSON' | 'CSV'; + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + /** * Limit the number of objects in the response. */ @@ -168,12 +180,17 @@ export interface DKIMGetParams { name?: Array; /** - * Filter for spf. + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; } -export namespace DKIM { - export import DKIMGetResponse = DKIMAPI.DKIMGetResponse; - export import DKIMGetParams = DKIMAPI.DKIMGetParams; +export namespace IPVersion { + export import IPVersionGetResponse = IPVersionAPI.IPVersionGetResponse; + export import IPVersionGetParams = IPVersionAPI.IPVersionGetParams; } diff --git a/src/resources/radar/emails/security/top/ases/dmarc.ts b/src/resources/radar/http/ases/os.ts similarity index 59% rename from src/resources/radar/emails/security/top/ases/dmarc.ts rename to src/resources/radar/http/ases/os.ts index 73bcd95d99..6e1403304d 100644 --- a/src/resources/radar/emails/security/top/ases/dmarc.ts +++ b/src/resources/radar/http/ases/os.ts @@ -3,42 +3,45 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import { isRequestOptions } from 'cloudflare/core'; -import * as DmarcAPI from 'cloudflare/resources/radar/emails/security/top/ases/dmarc'; +import * as OsAPI from 'cloudflare/resources/radar/http/ases/os'; -export class Dmarc extends APIResource { +export class Os extends APIResource { /** - * Get the top autonomous systems (AS) by emails DMARC validation. + * Get the top autonomous systems, by HTTP traffic, of the requested operating + * systems. Values are a percentage out of the total traffic. */ get( - dmarc: 'PASS' | 'NONE' | 'FAIL', - query?: DmarcGetParams, + os: 'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV', + query?: OGetParams, options?: Core.RequestOptions, - ): Core.APIPromise; - get(dmarc: 'PASS' | 'NONE' | 'FAIL', options?: Core.RequestOptions): Core.APIPromise; + ): Core.APIPromise; get( - dmarc: 'PASS' | 'NONE' | 'FAIL', - query: DmarcGetParams | Core.RequestOptions = {}, + os: 'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV', options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise; + get( + os: 'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV', + query: OGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.get(dmarc, {}, query); + return this.get(os, {}, query); } return ( - this._client.get(`/radar/email/security/top/ases/dmarc/${dmarc}`, { - query, - ...options, - }) as Core.APIPromise<{ result: DmarcGetResponse }> + this._client.get(`/radar/http/top/ases/os/${os}`, { query, ...options }) as Core.APIPromise<{ + result: OGetResponse; + }> )._thenUnwrap((obj) => obj.result); } } -export interface DmarcGetResponse { - meta: DmarcGetResponse.Meta; +export interface OGetResponse { + meta: OGetResponse.Meta; - top_0: Array; + top_0: Array; } -export namespace DmarcGetResponse { +export namespace OGetResponse { export interface Meta { dateRange: Array; @@ -94,12 +97,7 @@ export namespace DmarcGetResponse { } } -export interface DmarcGetParams { - /** - * Filter for arc (Authenticated Received Chain). - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - +export interface OGetParams { /** * Array of comma separated list of ASNs, start with `-` to exclude from results. * For example, `-174, 3356` excludes results from AS174, but includes results from @@ -107,6 +105,12 @@ export interface DmarcGetParams { */ asn?: Array; + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + /** * End of the date range (inclusive). */ @@ -141,15 +145,30 @@ export interface DmarcGetParams { dateStart?: Array; /** - * Filter for dkim. + * Filter for device type. */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; /** * Format results are returned in. */ format?: 'JSON' | 'CSV'; + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + /** * Limit the number of objects in the response. */ @@ -168,12 +187,12 @@ export interface DmarcGetParams { name?: Array; /** - * Filter for spf. + * Filter for tls version. */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; } -export namespace Dmarc { - export import DmarcGetResponse = DmarcAPI.DmarcGetResponse; - export import DmarcGetParams = DmarcAPI.DmarcGetParams; +export namespace Os { + export import OGetResponse = OsAPI.OGetResponse; + export import OGetParams = OsAPI.OGetParams; } diff --git a/src/resources/radar/http/ases/tls-version.ts b/src/resources/radar/http/ases/tls-version.ts new file mode 100644 index 0000000000..d9f9687afa --- /dev/null +++ b/src/resources/radar/http/ases/tls-version.ts @@ -0,0 +1,199 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as TLSVersionAPI from 'cloudflare/resources/radar/http/ases/tls-version'; + +export class TLSVersion extends APIResource { + /** + * Get the top autonomous systems (AS), by HTTP traffic, of the requested TLS + * protocol version. Values are a percentage out of the total traffic. + */ + get( + tlsVersion: 'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC', + query?: TLSVersionGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + tlsVersion: 'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC', + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + tlsVersion: 'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC', + query: TLSVersionGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(tlsVersion, {}, query); + } + return ( + this._client.get(`/radar/http/top/ases/tls_version/${tlsVersion}`, { + query, + ...options, + }) as Core.APIPromise<{ result: TLSVersionGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TLSVersionGetResponse { + meta: TLSVersionGetResponse.Meta; + + top_0: Array; +} + +export namespace TLSVersionGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientASN: number; + + clientASName: string; + + value: string; + } +} + +export interface TLSVersionGetParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; +} + +export namespace TLSVersion { + export import TLSVersionGetResponse = TLSVersionAPI.TLSVersionGetResponse; + export import TLSVersionGetParams = TLSVersionAPI.TLSVersionGetParams; +} diff --git a/src/resources/radar/http/http.ts b/src/resources/radar/http/http.ts index ee35b9f154..a4569f9314 100644 --- a/src/resources/radar/http/http.ts +++ b/src/resources/radar/http/http.ts @@ -1,14 +1,66 @@ // File generated from our OpenAPI spec by Stainless. import { APIResource } from 'cloudflare/resource'; -import * as TLSVersionAPI from 'cloudflare/resources/radar/http/tls-version'; +import * as SummaryAPI from 'cloudflare/resources/radar/http/summary'; +import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/http/timeseries-groups'; +import * as TopAPI from 'cloudflare/resources/radar/http/top'; +import * as AsesAPI from 'cloudflare/resources/radar/http/ases/ases'; +import * as LocationsAPI from 'cloudflare/resources/radar/http/locations/locations'; export class HTTP extends APIResource { - tlsVersion: TLSVersionAPI.TLSVersion = new TLSVersionAPI.TLSVersion(this._client); + top: TopAPI.Top = new TopAPI.Top(this._client); + locations: LocationsAPI.Locations = new LocationsAPI.Locations(this._client); + ases: AsesAPI.Ases = new AsesAPI.Ases(this._client); + summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); + timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( + this._client, + ); } export namespace HTTP { - export import TLSVersion = TLSVersionAPI.TLSVersion; - export import TLSVersionListResponse = TLSVersionAPI.TLSVersionListResponse; - export import TLSVersionListParams = TLSVersionAPI.TLSVersionListParams; + export import Top = TopAPI.Top; + export import TopBrowserFamiliesResponse = TopAPI.TopBrowserFamiliesResponse; + export import TopBrowsersResponse = TopAPI.TopBrowsersResponse; + export import TopBrowserFamiliesParams = TopAPI.TopBrowserFamiliesParams; + export import TopBrowsersParams = TopAPI.TopBrowsersParams; + export import Locations = LocationsAPI.Locations; + export import LocationGetResponse = LocationsAPI.LocationGetResponse; + export import LocationGetParams = LocationsAPI.LocationGetParams; + export import Ases = AsesAPI.Ases; + export import AseGetResponse = AsesAPI.AseGetResponse; + export import AseGetParams = AsesAPI.AseGetParams; + export import Summary = SummaryAPI.Summary; + export import SummaryBotClassResponse = SummaryAPI.SummaryBotClassResponse; + export import SummaryDeviceTypeResponse = SummaryAPI.SummaryDeviceTypeResponse; + export import SummaryHTTPProtocolResponse = SummaryAPI.SummaryHTTPProtocolResponse; + export import SummaryHTTPVersionResponse = SummaryAPI.SummaryHTTPVersionResponse; + export import SummaryIPVersionResponse = SummaryAPI.SummaryIPVersionResponse; + export import SummaryOsResponse = SummaryAPI.SummaryOsResponse; + export import SummaryTLSVersionResponse = SummaryAPI.SummaryTLSVersionResponse; + export import SummaryBotClassParams = SummaryAPI.SummaryBotClassParams; + export import SummaryDeviceTypeParams = SummaryAPI.SummaryDeviceTypeParams; + export import SummaryHTTPProtocolParams = SummaryAPI.SummaryHTTPProtocolParams; + export import SummaryHTTPVersionParams = SummaryAPI.SummaryHTTPVersionParams; + export import SummaryIPVersionParams = SummaryAPI.SummaryIPVersionParams; + export import SummaryOsParams = SummaryAPI.SummaryOsParams; + export import SummaryTLSVersionParams = SummaryAPI.SummaryTLSVersionParams; + export import TimeseriesGroups = TimeseriesGroupsAPI.TimeseriesGroups; + export import TimeseriesGroupBotClassResponse = TimeseriesGroupsAPI.TimeseriesGroupBotClassResponse; + export import TimeseriesGroupBrowserResponse = TimeseriesGroupsAPI.TimeseriesGroupBrowserResponse; + export import TimeseriesGroupBrowserFamilyResponse = TimeseriesGroupsAPI.TimeseriesGroupBrowserFamilyResponse; + export import TimeseriesGroupDeviceTypeResponse = TimeseriesGroupsAPI.TimeseriesGroupDeviceTypeResponse; + export import TimeseriesGroupHTTPProtocolResponse = TimeseriesGroupsAPI.TimeseriesGroupHTTPProtocolResponse; + export import TimeseriesGroupHTTPVersionResponse = TimeseriesGroupsAPI.TimeseriesGroupHTTPVersionResponse; + export import TimeseriesGroupIPVersionResponse = TimeseriesGroupsAPI.TimeseriesGroupIPVersionResponse; + export import TimeseriesGroupOsResponse = TimeseriesGroupsAPI.TimeseriesGroupOsResponse; + export import TimeseriesGroupTLSVersionResponse = TimeseriesGroupsAPI.TimeseriesGroupTLSVersionResponse; + export import TimeseriesGroupBotClassParams = TimeseriesGroupsAPI.TimeseriesGroupBotClassParams; + export import TimeseriesGroupBrowserParams = TimeseriesGroupsAPI.TimeseriesGroupBrowserParams; + export import TimeseriesGroupBrowserFamilyParams = TimeseriesGroupsAPI.TimeseriesGroupBrowserFamilyParams; + export import TimeseriesGroupDeviceTypeParams = TimeseriesGroupsAPI.TimeseriesGroupDeviceTypeParams; + export import TimeseriesGroupHTTPProtocolParams = TimeseriesGroupsAPI.TimeseriesGroupHTTPProtocolParams; + export import TimeseriesGroupHTTPVersionParams = TimeseriesGroupsAPI.TimeseriesGroupHTTPVersionParams; + export import TimeseriesGroupIPVersionParams = TimeseriesGroupsAPI.TimeseriesGroupIPVersionParams; + export import TimeseriesGroupOsParams = TimeseriesGroupsAPI.TimeseriesGroupOsParams; + export import TimeseriesGroupTLSVersionParams = TimeseriesGroupsAPI.TimeseriesGroupTLSVersionParams; } diff --git a/src/resources/radar/http/index.ts b/src/resources/radar/http/index.ts index 163b0faab3..fb23ddae05 100644 --- a/src/resources/radar/http/index.ts +++ b/src/resources/radar/http/index.ts @@ -1,4 +1,50 @@ // File generated from our OpenAPI spec by Stainless. +export { AseGetResponse, AseGetParams, Ases } from './ases/index'; export { HTTP } from './http'; -export { TLSVersionListResponse, TLSVersionListParams, TLSVersion } from './tls-version'; +export { LocationGetResponse, LocationGetParams, Locations } from './locations/index'; +export { + SummaryBotClassResponse, + SummaryDeviceTypeResponse, + SummaryHTTPProtocolResponse, + SummaryHTTPVersionResponse, + SummaryIPVersionResponse, + SummaryOsResponse, + SummaryTLSVersionResponse, + SummaryBotClassParams, + SummaryDeviceTypeParams, + SummaryHTTPProtocolParams, + SummaryHTTPVersionParams, + SummaryIPVersionParams, + SummaryOsParams, + SummaryTLSVersionParams, + Summary, +} from './summary'; +export { + TimeseriesGroupBotClassResponse, + TimeseriesGroupBrowserResponse, + TimeseriesGroupBrowserFamilyResponse, + TimeseriesGroupDeviceTypeResponse, + TimeseriesGroupHTTPProtocolResponse, + TimeseriesGroupHTTPVersionResponse, + TimeseriesGroupIPVersionResponse, + TimeseriesGroupOsResponse, + TimeseriesGroupTLSVersionResponse, + TimeseriesGroupBotClassParams, + TimeseriesGroupBrowserParams, + TimeseriesGroupBrowserFamilyParams, + TimeseriesGroupDeviceTypeParams, + TimeseriesGroupHTTPProtocolParams, + TimeseriesGroupHTTPVersionParams, + TimeseriesGroupIPVersionParams, + TimeseriesGroupOsParams, + TimeseriesGroupTLSVersionParams, + TimeseriesGroups, +} from './timeseries-groups'; +export { + TopBrowserFamiliesResponse, + TopBrowsersResponse, + TopBrowserFamiliesParams, + TopBrowsersParams, + Top, +} from './top'; diff --git a/src/resources/radar/http/locations/bot-class.ts b/src/resources/radar/http/locations/bot-class.ts new file mode 100644 index 0000000000..36d24f7d2e --- /dev/null +++ b/src/resources/radar/http/locations/bot-class.ts @@ -0,0 +1,200 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as BotClassAPI from 'cloudflare/resources/radar/http/locations/bot-class'; + +export class BotClass extends APIResource { + /** + * Get the top locations, by HTTP traffic, of the requested bot class. These two + * categories use Cloudflare's bot score - refer to [Bot + * scores])https://developers.cloudflare.com/bots/concepts/bot-score). Values are a + * percentage out of the total traffic. + */ + get( + botClass: 'LIKELY_AUTOMATED' | 'LIKELY_HUMAN', + query?: BotClassGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + botClass: 'LIKELY_AUTOMATED' | 'LIKELY_HUMAN', + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + botClass: 'LIKELY_AUTOMATED' | 'LIKELY_HUMAN', + query: BotClassGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(botClass, {}, query); + } + return ( + this._client.get(`/radar/http/top/locations/bot_class/${botClass}`, { + query, + ...options, + }) as Core.APIPromise<{ result: BotClassGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface BotClassGetResponse { + meta: BotClassGetResponse.Meta; + + top_0: Array; +} + +export namespace BotClassGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface BotClassGetParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export namespace BotClass { + export import BotClassGetResponse = BotClassAPI.BotClassGetResponse; + export import BotClassGetParams = BotClassAPI.BotClassGetParams; +} diff --git a/src/resources/radar/http/locations/device-type.ts b/src/resources/radar/http/locations/device-type.ts new file mode 100644 index 0000000000..899b757d62 --- /dev/null +++ b/src/resources/radar/http/locations/device-type.ts @@ -0,0 +1,199 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as DeviceTypeAPI from 'cloudflare/resources/radar/http/locations/device-type'; + +export class DeviceType extends APIResource { + /** + * Get the top locations, by HTTP traffic, of the requested device type. Values are + * a percentage out of the total traffic. + */ + get( + deviceType: 'DESKTOP' | 'MOBILE' | 'OTHER', + query?: DeviceTypeGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + deviceType: 'DESKTOP' | 'MOBILE' | 'OTHER', + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + deviceType: 'DESKTOP' | 'MOBILE' | 'OTHER', + query: DeviceTypeGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(deviceType, {}, query); + } + return ( + this._client.get(`/radar/http/top/locations/device_type/${deviceType}`, { + query, + ...options, + }) as Core.APIPromise<{ result: DeviceTypeGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface DeviceTypeGetResponse { + meta: DeviceTypeGetResponse.Meta; + + top_0: Array; +} + +export namespace DeviceTypeGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface DeviceTypeGetParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export namespace DeviceType { + export import DeviceTypeGetResponse = DeviceTypeAPI.DeviceTypeGetResponse; + export import DeviceTypeGetParams = DeviceTypeAPI.DeviceTypeGetParams; +} diff --git a/src/resources/radar/http/locations/http-method.ts b/src/resources/radar/http/locations/http-method.ts new file mode 100644 index 0000000000..578ab923eb --- /dev/null +++ b/src/resources/radar/http/locations/http-method.ts @@ -0,0 +1,199 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as HTTPMethodAPI from 'cloudflare/resources/radar/http/locations/http-method'; + +export class HTTPMethod extends APIResource { + /** + * Get the top locations, by HTTP traffic, of the requested HTTP protocol. Values + * are a percentage out of the total traffic. + */ + get( + httpVersion: 'HTTPv1' | 'HTTPv2' | 'HTTPv3', + query?: HTTPMethodGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + httpVersion: 'HTTPv1' | 'HTTPv2' | 'HTTPv3', + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + httpVersion: 'HTTPv1' | 'HTTPv2' | 'HTTPv3', + query: HTTPMethodGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(httpVersion, {}, query); + } + return ( + this._client.get(`/radar/http/top/locations/http_version/${httpVersion}`, { + query, + ...options, + }) as Core.APIPromise<{ result: HTTPMethodGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface HTTPMethodGetResponse { + meta: HTTPMethodGetResponse.Meta; + + top_0: Array; +} + +export namespace HTTPMethodGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface HTTPMethodGetParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export namespace HTTPMethod { + export import HTTPMethodGetResponse = HTTPMethodAPI.HTTPMethodGetResponse; + export import HTTPMethodGetParams = HTTPMethodAPI.HTTPMethodGetParams; +} diff --git a/src/resources/radar/http/locations/http-protocol.ts b/src/resources/radar/http/locations/http-protocol.ts new file mode 100644 index 0000000000..d592421757 --- /dev/null +++ b/src/resources/radar/http/locations/http-protocol.ts @@ -0,0 +1,199 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as HTTPProtocolAPI from 'cloudflare/resources/radar/http/locations/http-protocol'; + +export class HTTPProtocol extends APIResource { + /** + * Get the top locations, by HTTP traffic, of the requested HTTP protocol. Values + * are a percentage out of the total traffic. + */ + get( + httpProtocol: 'HTTP' | 'HTTPS', + query?: HTTPProtocolGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + httpProtocol: 'HTTP' | 'HTTPS', + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + httpProtocol: 'HTTP' | 'HTTPS', + query: HTTPProtocolGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(httpProtocol, {}, query); + } + return ( + this._client.get(`/radar/http/top/locations/http_protocol/${httpProtocol}`, { + query, + ...options, + }) as Core.APIPromise<{ result: HTTPProtocolGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface HTTPProtocolGetResponse { + meta: HTTPProtocolGetResponse.Meta; + + top_0: Array; +} + +export namespace HTTPProtocolGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface HTTPProtocolGetParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export namespace HTTPProtocol { + export import HTTPProtocolGetResponse = HTTPProtocolAPI.HTTPProtocolGetResponse; + export import HTTPProtocolGetParams = HTTPProtocolAPI.HTTPProtocolGetParams; +} diff --git a/src/resources/radar/http/locations/index.ts b/src/resources/radar/http/locations/index.ts new file mode 100644 index 0000000000..2e5a2a015f --- /dev/null +++ b/src/resources/radar/http/locations/index.ts @@ -0,0 +1,10 @@ +// File generated from our OpenAPI spec by Stainless. + +export { BotClassGetResponse, BotClassGetParams, BotClass } from './bot-class'; +export { DeviceTypeGetResponse, DeviceTypeGetParams, DeviceType } from './device-type'; +export { HTTPMethodGetResponse, HTTPMethodGetParams, HTTPMethod } from './http-method'; +export { HTTPProtocolGetResponse, HTTPProtocolGetParams, HTTPProtocol } from './http-protocol'; +export { IPVersionGetResponse, IPVersionGetParams, IPVersion } from './ip-version'; +export { LocationGetResponse, LocationGetParams, Locations } from './locations'; +export { OGetResponse, OGetParams, Os } from './os'; +export { TLSVersionGetResponse, TLSVersionGetParams, TLSVersion } from './tls-version'; diff --git a/src/resources/radar/email/security/summaries/threat-categories.ts b/src/resources/radar/http/locations/ip-version.ts similarity index 55% rename from src/resources/radar/email/security/summaries/threat-categories.ts rename to src/resources/radar/http/locations/ip-version.ts index ff4523ea8d..e74f197767 100644 --- a/src/resources/radar/email/security/summaries/threat-categories.ts +++ b/src/resources/radar/http/locations/ip-version.ts @@ -3,47 +3,48 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import { isRequestOptions } from 'cloudflare/core'; -import * as ThreatCategoriesAPI from 'cloudflare/resources/radar/email/security/summaries/threat-categories'; +import * as IPVersionAPI from 'cloudflare/resources/radar/http/locations/ip-version'; -export class ThreatCategories extends APIResource { +export class IPVersion extends APIResource { /** - * Percentage distribution of emails classified in Threat Categories. + * Get the top locations, by HTTP traffic, of the requested IP protocol version. + * Values are a percentage out of the total traffic. */ - list( - query?: ThreatCategoryListParams, + get( + ipVersion: 'IPv4' | 'IPv6', + query?: IPVersionGetParams, options?: Core.RequestOptions, - ): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: ThreatCategoryListParams | Core.RequestOptions = {}, + ): Core.APIPromise; + get(ipVersion: 'IPv4' | 'IPv6', options?: Core.RequestOptions): Core.APIPromise; + get( + ipVersion: 'IPv4' | 'IPv6', + query: IPVersionGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.list({}, query); + return this.get(ipVersion, {}, query); } return ( - this._client.get('/radar/email/security/summary/threat_category', { + this._client.get(`/radar/http/top/locations/ip_version/${ipVersion}`, { query, ...options, - }) as Core.APIPromise<{ result: ThreatCategoryListResponse }> + }) as Core.APIPromise<{ result: IPVersionGetResponse }> )._thenUnwrap((obj) => obj.result); } } -export interface ThreatCategoryListResponse { - meta: ThreatCategoryListResponse.Meta; +export interface IPVersionGetResponse { + meta: IPVersionGetResponse.Meta; - summary_0: ThreatCategoryListResponse.Summary0; + top_0: Array; } -export namespace ThreatCategoryListResponse { +export namespace IPVersionGetResponse { export interface Meta { dateRange: Array; lastUpdated: string; - normalization: string; - confidenceInfo?: Meta.ConfidenceInfo; } @@ -85,23 +86,16 @@ export namespace ThreatCategoryListResponse { } } - export interface Summary0 { - BrandImpersonation: string; - - CredentialHarvester: string; + export interface Top0 { + clientCountryAlpha2: string; - IdentityDeception: string; + clientCountryName: string; - Link: string; + value: string; } } -export interface ThreatCategoryListParams { - /** - * Filter for arc (Authenticated Received Chain). - */ - arc?: Array<'PASS' | 'NONE' | 'FAIL'>; - +export interface IPVersionGetParams { /** * Array of comma separated list of ASNs, start with `-` to exclude from results. * For example, `-174, 3356` excludes results from AS174, but includes results from @@ -109,6 +103,12 @@ export interface ThreatCategoryListParams { */ asn?: Array; + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + /** * End of the date range (inclusive). */ @@ -143,19 +143,29 @@ export interface ThreatCategoryListParams { dateStart?: Array; /** - * Filter for dkim. + * Filter for device type. */ - dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; /** - * Filter for dmarc. + * Format results are returned in. */ - dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + format?: 'JSON' | 'CSV'; /** - * Format results are returned in. + * Filter for http protocol. */ - format?: 'JSON' | 'CSV'; + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; /** * Array of comma separated list of locations (alpha-2 country codes). Start with @@ -170,12 +180,17 @@ export interface ThreatCategoryListParams { name?: Array; /** - * Filter for spf. + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. */ - spf?: Array<'PASS' | 'NONE' | 'FAIL'>; + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; } -export namespace ThreatCategories { - export import ThreatCategoryListResponse = ThreatCategoriesAPI.ThreatCategoryListResponse; - export import ThreatCategoryListParams = ThreatCategoriesAPI.ThreatCategoryListParams; +export namespace IPVersion { + export import IPVersionGetResponse = IPVersionAPI.IPVersionGetResponse; + export import IPVersionGetParams = IPVersionAPI.IPVersionGetParams; } diff --git a/src/resources/radar/http/locations/locations.ts b/src/resources/radar/http/locations/locations.ts new file mode 100644 index 0000000000..61a760cce2 --- /dev/null +++ b/src/resources/radar/http/locations/locations.ts @@ -0,0 +1,231 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as LocationsAPI from 'cloudflare/resources/radar/http/locations/locations'; +import * as BotClassAPI from 'cloudflare/resources/radar/http/locations/bot-class'; +import * as DeviceTypeAPI from 'cloudflare/resources/radar/http/locations/device-type'; +import * as HTTPMethodAPI from 'cloudflare/resources/radar/http/locations/http-method'; +import * as HTTPProtocolAPI from 'cloudflare/resources/radar/http/locations/http-protocol'; +import * as IPVersionAPI from 'cloudflare/resources/radar/http/locations/ip-version'; +import * as OsAPI from 'cloudflare/resources/radar/http/locations/os'; +import * as TLSVersionAPI from 'cloudflare/resources/radar/http/locations/tls-version'; + +export class Locations extends APIResource { + botClass: BotClassAPI.BotClass = new BotClassAPI.BotClass(this._client); + deviceType: DeviceTypeAPI.DeviceType = new DeviceTypeAPI.DeviceType(this._client); + httpProtocol: HTTPProtocolAPI.HTTPProtocol = new HTTPProtocolAPI.HTTPProtocol(this._client); + httpMethod: HTTPMethodAPI.HTTPMethod = new HTTPMethodAPI.HTTPMethod(this._client); + ipVersion: IPVersionAPI.IPVersion = new IPVersionAPI.IPVersion(this._client); + os: OsAPI.Os = new OsAPI.Os(this._client); + tlsVersion: TLSVersionAPI.TLSVersion = new TLSVersionAPI.TLSVersion(this._client); + + /** + * Get the top locations by HTTP traffic. Values are a percentage out of the total + * traffic. + */ + get(query?: LocationGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(options?: Core.RequestOptions): Core.APIPromise; + get( + query: LocationGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get({}, query); + } + return ( + this._client.get('/radar/http/top/locations', { query, ...options }) as Core.APIPromise<{ + result: LocationGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface LocationGetResponse { + meta: LocationGetResponse.Meta; + + top_0: Array; +} + +export namespace LocationGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface LocationGetParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export namespace Locations { + export import LocationGetResponse = LocationsAPI.LocationGetResponse; + export import LocationGetParams = LocationsAPI.LocationGetParams; + export import BotClass = BotClassAPI.BotClass; + export import BotClassGetResponse = BotClassAPI.BotClassGetResponse; + export import BotClassGetParams = BotClassAPI.BotClassGetParams; + export import DeviceType = DeviceTypeAPI.DeviceType; + export import DeviceTypeGetResponse = DeviceTypeAPI.DeviceTypeGetResponse; + export import DeviceTypeGetParams = DeviceTypeAPI.DeviceTypeGetParams; + export import HTTPProtocol = HTTPProtocolAPI.HTTPProtocol; + export import HTTPProtocolGetResponse = HTTPProtocolAPI.HTTPProtocolGetResponse; + export import HTTPProtocolGetParams = HTTPProtocolAPI.HTTPProtocolGetParams; + export import HTTPMethod = HTTPMethodAPI.HTTPMethod; + export import HTTPMethodGetResponse = HTTPMethodAPI.HTTPMethodGetResponse; + export import HTTPMethodGetParams = HTTPMethodAPI.HTTPMethodGetParams; + export import IPVersion = IPVersionAPI.IPVersion; + export import IPVersionGetResponse = IPVersionAPI.IPVersionGetResponse; + export import IPVersionGetParams = IPVersionAPI.IPVersionGetParams; + export import Os = OsAPI.Os; + export import OGetResponse = OsAPI.OGetResponse; + export import OGetParams = OsAPI.OGetParams; + export import TLSVersion = TLSVersionAPI.TLSVersion; + export import TLSVersionGetResponse = TLSVersionAPI.TLSVersionGetResponse; + export import TLSVersionGetParams = TLSVersionAPI.TLSVersionGetParams; +} diff --git a/src/resources/radar/verified-bots/tops/bots.ts b/src/resources/radar/http/locations/os.ts similarity index 56% rename from src/resources/radar/verified-bots/tops/bots.ts rename to src/resources/radar/http/locations/os.ts index eb1ce5fbc0..ceb27ad109 100644 --- a/src/resources/radar/verified-bots/tops/bots.ts +++ b/src/resources/radar/http/locations/os.ts @@ -3,39 +3,50 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import { isRequestOptions } from 'cloudflare/core'; -import * as BotsAPI from 'cloudflare/resources/radar/verified-bots/tops/bots'; +import * as OsAPI from 'cloudflare/resources/radar/http/locations/os'; -export class Bots extends APIResource { +export class Os extends APIResource { /** - * Get top verified bots by HTTP requests, with owner and category. + * Get the top locations, by HTTP traffic, of the requested operating systems. + * Values are a percentage out of the total traffic. */ - list(query?: BotListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: BotListParams | Core.RequestOptions = {}, + get( + os: 'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV', + query?: OGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise; + get( + os: 'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV', + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + os: 'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV', + query: OGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.list({}, query); + return this.get(os, {}, query); } return ( - this._client.get('/radar/verified_bots/top/bots', { query, ...options }) as Core.APIPromise<{ - result: BotListResponse; + this._client.get(`/radar/http/top/locations/os/${os}`, { query, ...options }) as Core.APIPromise<{ + result: OGetResponse; }> )._thenUnwrap((obj) => obj.result); } } -export interface BotListResponse { - meta: BotListResponse.Meta; +export interface OGetResponse { + meta: OGetResponse.Meta; - top_0: Array; + top_0: Array; } -export namespace BotListResponse { +export namespace OGetResponse { export interface Meta { dateRange: Array; + lastUpdated: string; + confidenceInfo?: Meta.ConfidenceInfo; } @@ -78,17 +89,15 @@ export namespace BotListResponse { } export interface Top0 { - botCategory: string; + clientCountryAlpha2: string; - botName: string; - - botOwner: string; + clientCountryName: string; value: string; } } -export interface BotListParams { +export interface OGetParams { /** * Array of comma separated list of ASNs, start with `-` to exclude from results. * For example, `-174, 3356` excludes results from AS174, but includes results from @@ -96,6 +105,12 @@ export interface BotListParams { */ asn?: Array; + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + /** * End of the date range (inclusive). */ @@ -129,11 +144,31 @@ export interface BotListParams { */ dateStart?: Array; + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + /** * Format results are returned in. */ format?: 'JSON' | 'CSV'; + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + /** * Limit the number of objects in the response. */ @@ -150,9 +185,14 @@ export interface BotListParams { * Array of names that will be used to name the series in responses. */ name?: Array; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; } -export namespace Bots { - export import BotListResponse = BotsAPI.BotListResponse; - export import BotListParams = BotsAPI.BotListParams; +export namespace Os { + export import OGetResponse = OsAPI.OGetResponse; + export import OGetParams = OsAPI.OGetParams; } diff --git a/src/resources/radar/http/locations/tls-version.ts b/src/resources/radar/http/locations/tls-version.ts new file mode 100644 index 0000000000..29c509c2d8 --- /dev/null +++ b/src/resources/radar/http/locations/tls-version.ts @@ -0,0 +1,199 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as TLSVersionAPI from 'cloudflare/resources/radar/http/locations/tls-version'; + +export class TLSVersion extends APIResource { + /** + * Get the top locations, by HTTP traffic, of the requested TLS protocol version. + * Values are a percentage out of the total traffic. + */ + get( + tlsVersion: 'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC', + query?: TLSVersionGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + tlsVersion: 'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC', + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + tlsVersion: 'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC', + query: TLSVersionGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(tlsVersion, {}, query); + } + return ( + this._client.get(`/radar/http/top/locations/tls_version/${tlsVersion}`, { + query, + ...options, + }) as Core.APIPromise<{ result: TLSVersionGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TLSVersionGetResponse { + meta: TLSVersionGetResponse.Meta; + + top_0: Array; +} + +export namespace TLSVersionGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface TLSVersionGetParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; +} + +export namespace TLSVersion { + export import TLSVersionGetResponse = TLSVersionAPI.TLSVersionGetResponse; + export import TLSVersionGetParams = TLSVersionAPI.TLSVersionGetParams; +} diff --git a/src/resources/radar/http/summary.ts b/src/resources/radar/http/summary.ts new file mode 100644 index 0000000000..d53e1df165 --- /dev/null +++ b/src/resources/radar/http/summary.ts @@ -0,0 +1,1257 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as SummaryAPI from 'cloudflare/resources/radar/http/summary'; + +export class Summary extends APIResource { + /** + * Percentage distribution of bot-generated traffic to genuine human traffic, as + * classified by Cloudflare. Visit + * https://developers.cloudflare.com/radar/concepts/bot-classes/ for more + * information. + */ + botClass( + query?: SummaryBotClassParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + botClass(options?: Core.RequestOptions): Core.APIPromise; + botClass( + query: SummaryBotClassParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.botClass({}, query); + } + return ( + this._client.get('/radar/http/summary/bot_class', { query, ...options }) as Core.APIPromise<{ + result: SummaryBotClassResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage of Internet traffic generated by mobile, desktop, and other types of + * devices, over a given time period. + */ + deviceType( + query?: SummaryDeviceTypeParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + deviceType(options?: Core.RequestOptions): Core.APIPromise; + deviceType( + query: SummaryDeviceTypeParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.deviceType({}, query); + } + return ( + this._client.get('/radar/http/summary/device_type', { query, ...options }) as Core.APIPromise<{ + result: SummaryDeviceTypeResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of traffic per HTTP protocol over a given time period. + */ + httpProtocol( + query?: SummaryHTTPProtocolParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + httpProtocol(options?: Core.RequestOptions): Core.APIPromise; + httpProtocol( + query: SummaryHTTPProtocolParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.httpProtocol({}, query); + } + return ( + this._client.get('/radar/http/summary/http_protocol', { query, ...options }) as Core.APIPromise<{ + result: SummaryHTTPProtocolResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of traffic per HTTP protocol version over a given time + * period. + */ + httpVersion( + query?: SummaryHTTPVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + httpVersion(options?: Core.RequestOptions): Core.APIPromise; + httpVersion( + query: SummaryHTTPVersionParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.httpVersion({}, query); + } + return ( + this._client.get('/radar/http/summary/http_version', { query, ...options }) as Core.APIPromise<{ + result: SummaryHTTPVersionResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of Internet traffic based on IP protocol versions, such + * as IPv4 and IPv6, over a given time period. + */ + ipVersion( + query?: SummaryIPVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + ipVersion(options?: Core.RequestOptions): Core.APIPromise; + ipVersion( + query: SummaryIPVersionParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.ipVersion({}, query); + } + return ( + this._client.get('/radar/http/summary/ip_version', { query, ...options }) as Core.APIPromise<{ + result: SummaryIPVersionResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of Internet traffic generated by different operating + * systems like Windows, macOS, Android, iOS, and others, over a given time period. + */ + os(query?: SummaryOsParams, options?: Core.RequestOptions): Core.APIPromise; + os(options?: Core.RequestOptions): Core.APIPromise; + os( + query: SummaryOsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.os({}, query); + } + return ( + this._client.get('/radar/http/summary/os', { query, ...options }) as Core.APIPromise<{ + result: SummaryOsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Percentage distribution of traffic per TLS protocol version, over a given time + * period. + */ + tlsVersion( + query?: SummaryTLSVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + tlsVersion(options?: Core.RequestOptions): Core.APIPromise; + tlsVersion( + query: SummaryTLSVersionParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.tlsVersion({}, query); + } + return ( + this._client.get('/radar/http/summary/tls_version', { query, ...options }) as Core.APIPromise<{ + result: SummaryTLSVersionResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SummaryBotClassResponse { + meta: SummaryBotClassResponse.Meta; + + summary_0: SummaryBotClassResponse.Summary0; +} + +export namespace SummaryBotClassResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + bot: string; + + human: string; + } +} + +export interface SummaryDeviceTypeResponse { + meta: SummaryDeviceTypeResponse.Meta; + + summary_0: SummaryDeviceTypeResponse.Summary0; +} + +export namespace SummaryDeviceTypeResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + desktop: string; + + mobile: string; + + other: string; + } +} + +export interface SummaryHTTPProtocolResponse { + meta: SummaryHTTPProtocolResponse.Meta; + + summary_0: SummaryHTTPProtocolResponse.Summary0; +} + +export namespace SummaryHTTPProtocolResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + http: string; + + https: string; + } +} + +export interface SummaryHTTPVersionResponse { + meta: SummaryHTTPVersionResponse.Meta; + + summary_0: SummaryHTTPVersionResponse.Summary0; +} + +export namespace SummaryHTTPVersionResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + 'HTTP/1.x': string; + + 'HTTP/2': string; + + 'HTTP/3': string; + } +} + +export interface SummaryIPVersionResponse { + meta: SummaryIPVersionResponse.Meta; + + summary_0: SummaryIPVersionResponse.Summary0; +} + +export namespace SummaryIPVersionResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + IPv4: string; + + IPv6: string; + } +} + +export interface SummaryOsResponse { + meta: SummaryOsResponse.Meta; + + summary_0: SummaryOsResponse.Summary0; +} + +export namespace SummaryOsResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + ANDROID: string; + + IOS: string; + } +} + +export interface SummaryTLSVersionResponse { + meta: SummaryTLSVersionResponse.Meta; + + summary_0: SummaryTLSVersionResponse.Summary0; +} + +export namespace SummaryTLSVersionResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + 'TLS 1.0': string; + + 'TLS 1.1': string; + + 'TLS 1.2': string; + + 'TLS 1.3': string; + + 'TLS QUIC': string; + } +} + +export interface SummaryBotClassParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export interface SummaryDeviceTypeParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export interface SummaryHTTPProtocolParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export interface SummaryHTTPVersionParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export interface SummaryIPVersionParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export interface SummaryOsParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export interface SummaryTLSVersionParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; +} + +export namespace Summary { + export import SummaryBotClassResponse = SummaryAPI.SummaryBotClassResponse; + export import SummaryDeviceTypeResponse = SummaryAPI.SummaryDeviceTypeResponse; + export import SummaryHTTPProtocolResponse = SummaryAPI.SummaryHTTPProtocolResponse; + export import SummaryHTTPVersionResponse = SummaryAPI.SummaryHTTPVersionResponse; + export import SummaryIPVersionResponse = SummaryAPI.SummaryIPVersionResponse; + export import SummaryOsResponse = SummaryAPI.SummaryOsResponse; + export import SummaryTLSVersionResponse = SummaryAPI.SummaryTLSVersionResponse; + export import SummaryBotClassParams = SummaryAPI.SummaryBotClassParams; + export import SummaryDeviceTypeParams = SummaryAPI.SummaryDeviceTypeParams; + export import SummaryHTTPProtocolParams = SummaryAPI.SummaryHTTPProtocolParams; + export import SummaryHTTPVersionParams = SummaryAPI.SummaryHTTPVersionParams; + export import SummaryIPVersionParams = SummaryAPI.SummaryIPVersionParams; + export import SummaryOsParams = SummaryAPI.SummaryOsParams; + export import SummaryTLSVersionParams = SummaryAPI.SummaryTLSVersionParams; +} diff --git a/src/resources/radar/http/timeseries-groups.ts b/src/resources/radar/http/timeseries-groups.ts new file mode 100644 index 0000000000..fee55cfbcd --- /dev/null +++ b/src/resources/radar/http/timeseries-groups.ts @@ -0,0 +1,1274 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/http/timeseries-groups'; + +export class TimeseriesGroups extends APIResource { + /** + * Get a time series of the percentage distribution of traffic classified as + * automated or human. Visit + * https://developers.cloudflare.com/radar/concepts/bot-classes/ for more + * information. + */ + botClass( + query?: TimeseriesGroupBotClassParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + botClass(options?: Core.RequestOptions): Core.APIPromise; + botClass( + query: TimeseriesGroupBotClassParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.botClass({}, query); + } + return ( + this._client.get('/radar/http/timeseries_groups/bot_class', { query, ...options }) as Core.APIPromise<{ + result: TimeseriesGroupBotClassResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a time series of the percentage distribution of traffic of the top user + * agents. + */ + browser( + query?: TimeseriesGroupBrowserParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + browser(options?: Core.RequestOptions): Core.APIPromise; + browser( + query: TimeseriesGroupBrowserParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.browser({}, query); + } + return ( + this._client.get('/radar/http/timeseries_groups/browser', { query, ...options }) as Core.APIPromise<{ + result: TimeseriesGroupBrowserResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a time series of the percentage distribution of traffic of the top user + * agents aggregated in families. + */ + browserFamily( + query?: TimeseriesGroupBrowserFamilyParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + browserFamily(options?: Core.RequestOptions): Core.APIPromise; + browserFamily( + query: TimeseriesGroupBrowserFamilyParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.browserFamily({}, query); + } + return ( + this._client.get('/radar/http/timeseries_groups/browser_family', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupBrowserFamilyResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a time series of the percentage distribution of traffic per device type. + */ + deviceType( + query?: TimeseriesGroupDeviceTypeParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + deviceType(options?: Core.RequestOptions): Core.APIPromise; + deviceType( + query: TimeseriesGroupDeviceTypeParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.deviceType({}, query); + } + return ( + this._client.get('/radar/http/timeseries_groups/device_type', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupDeviceTypeResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a time series of the percentage distribution of traffic per HTTP protocol. + */ + httpProtocol( + query?: TimeseriesGroupHTTPProtocolParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + httpProtocol(options?: Core.RequestOptions): Core.APIPromise; + httpProtocol( + query: TimeseriesGroupHTTPProtocolParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.httpProtocol({}, query); + } + return ( + this._client.get('/radar/http/timeseries_groups/http_protocol', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupHTTPProtocolResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a time series of the percentage distribution of traffic per HTTP protocol + * version. + */ + httpVersion( + query?: TimeseriesGroupHTTPVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + httpVersion(options?: Core.RequestOptions): Core.APIPromise; + httpVersion( + query: TimeseriesGroupHTTPVersionParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.httpVersion({}, query); + } + return ( + this._client.get('/radar/http/timeseries_groups/http_version', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupHTTPVersionResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a time series of the percentage distribution of traffic per IP protocol + * version. + */ + ipVersion( + query?: TimeseriesGroupIPVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + ipVersion(options?: Core.RequestOptions): Core.APIPromise; + ipVersion( + query: TimeseriesGroupIPVersionParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.ipVersion({}, query); + } + return ( + this._client.get('/radar/http/timeseries_groups/ip_version', { query, ...options }) as Core.APIPromise<{ + result: TimeseriesGroupIPVersionResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a time series of the percentage distribution of traffic of the top operating + * systems. + */ + os( + query?: TimeseriesGroupOsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + os(options?: Core.RequestOptions): Core.APIPromise; + os( + query: TimeseriesGroupOsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.os({}, query); + } + return ( + this._client.get('/radar/http/timeseries_groups/os', { query, ...options }) as Core.APIPromise<{ + result: TimeseriesGroupOsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a time series of the percentage distribution of traffic per TLS protocol + * version. + */ + tlsVersion( + query?: TimeseriesGroupTLSVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + tlsVersion(options?: Core.RequestOptions): Core.APIPromise; + tlsVersion( + query: TimeseriesGroupTLSVersionParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.tlsVersion({}, query); + } + return ( + this._client.get('/radar/http/timeseries_groups/tls_version', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupTLSVersionResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TimeseriesGroupBotClassResponse { + meta: unknown; + + serie_0: TimeseriesGroupBotClassResponse.Serie0; +} + +export namespace TimeseriesGroupBotClassResponse { + export interface Serie0 { + bot: Array; + + human: Array; + + timestamps: Array; + } +} + +export interface TimeseriesGroupBrowserResponse { + meta: unknown; + + serie_0: TimeseriesGroupBrowserResponse.Serie0; +} + +export namespace TimeseriesGroupBrowserResponse { + export interface Serie0 { + timestamps: Array; + [k: string]: Array; + } +} + +export interface TimeseriesGroupBrowserFamilyResponse { + meta: unknown; + + serie_0: TimeseriesGroupBrowserFamilyResponse.Serie0; +} + +export namespace TimeseriesGroupBrowserFamilyResponse { + export interface Serie0 { + timestamps: Array; + [k: string]: Array; + } +} + +export interface TimeseriesGroupDeviceTypeResponse { + meta: unknown; + + serie_0: TimeseriesGroupDeviceTypeResponse.Serie0; +} + +export namespace TimeseriesGroupDeviceTypeResponse { + export interface Serie0 { + desktop: Array; + + mobile: Array; + + other: Array; + + timestamps: Array; + } +} + +export interface TimeseriesGroupHTTPProtocolResponse { + meta: unknown; + + serie_0: TimeseriesGroupHTTPProtocolResponse.Serie0; +} + +export namespace TimeseriesGroupHTTPProtocolResponse { + export interface Serie0 { + http: Array; + + https: Array; + + timestamps: Array; + } +} + +export interface TimeseriesGroupHTTPVersionResponse { + meta: unknown; + + serie_0: TimeseriesGroupHTTPVersionResponse.Serie0; +} + +export namespace TimeseriesGroupHTTPVersionResponse { + export interface Serie0 { + 'HTTP/1.x': Array; + + 'HTTP/2': Array; + + 'HTTP/3': Array; + + timestamps: Array; + } +} + +export interface TimeseriesGroupIPVersionResponse { + meta: unknown; + + serie_0: TimeseriesGroupIPVersionResponse.Serie0; +} + +export namespace TimeseriesGroupIPVersionResponse { + export interface Serie0 { + IPv4: Array; + + IPv6: Array; + + timestamps: Array; + } +} + +export interface TimeseriesGroupOsResponse { + meta: unknown; + + serie_0: TimeseriesGroupOsResponse.Serie0; +} + +export namespace TimeseriesGroupOsResponse { + export interface Serie0 { + timestamps: Array; + [k: string]: Array; + } +} + +export interface TimeseriesGroupTLSVersionResponse { + meta: unknown; + + serie_0: TimeseriesGroupTLSVersionResponse.Serie0; +} + +export namespace TimeseriesGroupTLSVersionResponse { + export interface Serie0 { + timestamps: Array; + + 'TLS 1.0': Array; + + 'TLS 1.1': Array; + + 'TLS 1.2': Array; + + 'TLS 1.3': Array; + + 'TLS QUIC': Array; + } +} + +export interface TimeseriesGroupBotClassParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export interface TimeseriesGroupBrowserParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects (eg browsers, verticals, etc) to the top items over + * the time range. + */ + limitPerGroup?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export interface TimeseriesGroupBrowserFamilyParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export interface TimeseriesGroupDeviceTypeParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export interface TimeseriesGroupHTTPProtocolParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export interface TimeseriesGroupHTTPVersionParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export interface TimeseriesGroupIPVersionParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export interface TimeseriesGroupOsParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export interface TimeseriesGroupTLSVersionParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; +} + +export namespace TimeseriesGroups { + export import TimeseriesGroupBotClassResponse = TimeseriesGroupsAPI.TimeseriesGroupBotClassResponse; + export import TimeseriesGroupBrowserResponse = TimeseriesGroupsAPI.TimeseriesGroupBrowserResponse; + export import TimeseriesGroupBrowserFamilyResponse = TimeseriesGroupsAPI.TimeseriesGroupBrowserFamilyResponse; + export import TimeseriesGroupDeviceTypeResponse = TimeseriesGroupsAPI.TimeseriesGroupDeviceTypeResponse; + export import TimeseriesGroupHTTPProtocolResponse = TimeseriesGroupsAPI.TimeseriesGroupHTTPProtocolResponse; + export import TimeseriesGroupHTTPVersionResponse = TimeseriesGroupsAPI.TimeseriesGroupHTTPVersionResponse; + export import TimeseriesGroupIPVersionResponse = TimeseriesGroupsAPI.TimeseriesGroupIPVersionResponse; + export import TimeseriesGroupOsResponse = TimeseriesGroupsAPI.TimeseriesGroupOsResponse; + export import TimeseriesGroupTLSVersionResponse = TimeseriesGroupsAPI.TimeseriesGroupTLSVersionResponse; + export import TimeseriesGroupBotClassParams = TimeseriesGroupsAPI.TimeseriesGroupBotClassParams; + export import TimeseriesGroupBrowserParams = TimeseriesGroupsAPI.TimeseriesGroupBrowserParams; + export import TimeseriesGroupBrowserFamilyParams = TimeseriesGroupsAPI.TimeseriesGroupBrowserFamilyParams; + export import TimeseriesGroupDeviceTypeParams = TimeseriesGroupsAPI.TimeseriesGroupDeviceTypeParams; + export import TimeseriesGroupHTTPProtocolParams = TimeseriesGroupsAPI.TimeseriesGroupHTTPProtocolParams; + export import TimeseriesGroupHTTPVersionParams = TimeseriesGroupsAPI.TimeseriesGroupHTTPVersionParams; + export import TimeseriesGroupIPVersionParams = TimeseriesGroupsAPI.TimeseriesGroupIPVersionParams; + export import TimeseriesGroupOsParams = TimeseriesGroupsAPI.TimeseriesGroupOsParams; + export import TimeseriesGroupTLSVersionParams = TimeseriesGroupsAPI.TimeseriesGroupTLSVersionParams; +} diff --git a/src/resources/radar/http/tls-version.ts b/src/resources/radar/http/tls-version.ts deleted file mode 100644 index 7edb016487..0000000000 --- a/src/resources/radar/http/tls-version.ts +++ /dev/null @@ -1,153 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as TLSVersionAPI from 'cloudflare/resources/radar/http/tls-version'; - -export class TLSVersion extends APIResource { - /** - * Get a time series of the percentage distribution of traffic per TLS protocol - * version. - */ - list(query?: TLSVersionListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: TLSVersionListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/http/timeseries_groups/tls_version', { - query, - ...options, - }) as Core.APIPromise<{ result: TLSVersionListResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface TLSVersionListResponse { - meta: unknown; - - serie_0: TLSVersionListResponse.Serie0; -} - -export namespace TLSVersionListResponse { - export interface Serie0 { - timestamps: Array; - - 'TLS 1.0': Array; - - 'TLS 1.1': Array; - - 'TLS 1.2': Array; - - 'TLS 1.3': Array; - - 'TLS QUIC': Array; - } -} - -export interface TLSVersionListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * Filter for bot class. Refer to - * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - */ - botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Filter for device type. - */ - deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filter for http protocol. - */ - httpProtocol?: Array<'HTTP' | 'HTTPS'>; - - /** - * Filter for http version. - */ - httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; - - /** - * Filter for ip version. - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Filter for os name. - */ - os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; -} - -export namespace TLSVersion { - export import TLSVersionListResponse = TLSVersionAPI.TLSVersionListResponse; - export import TLSVersionListParams = TLSVersionAPI.TLSVersionListParams; -} diff --git a/src/resources/radar/http/top.ts b/src/resources/radar/http/top.ts new file mode 100644 index 0000000000..5d7c7a4858 --- /dev/null +++ b/src/resources/radar/http/top.ts @@ -0,0 +1,378 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as TopAPI from 'cloudflare/resources/radar/http/top'; + +export class Top extends APIResource { + /** + * Get the top user agents aggregated in families by HTTP traffic. Values are a + * percentage out of the total traffic. + */ + browserFamilies( + query?: TopBrowserFamiliesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + browserFamilies(options?: Core.RequestOptions): Core.APIPromise; + browserFamilies( + query: TopBrowserFamiliesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.browserFamilies({}, query); + } + return ( + this._client.get('/radar/http/top/browser_families', { query, ...options }) as Core.APIPromise<{ + result: TopBrowserFamiliesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get the top user agents by HTTP traffic. Values are a percentage out of the + * total traffic. + */ + browsers(query?: TopBrowsersParams, options?: Core.RequestOptions): Core.APIPromise; + browsers(options?: Core.RequestOptions): Core.APIPromise; + browsers( + query: TopBrowsersParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.browsers({}, query); + } + return ( + this._client.get('/radar/http/top/browsers', { query, ...options }) as Core.APIPromise<{ + result: TopBrowsersResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TopBrowserFamiliesResponse { + meta: TopBrowserFamiliesResponse.Meta; + + top_0: Array; +} + +export namespace TopBrowserFamiliesResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + name: string; + + value: string; + } +} + +export interface TopBrowsersResponse { + meta: TopBrowsersResponse.Meta; + + top_0: Array; +} + +export namespace TopBrowsersResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + name: string; + + value: string; + } +} + +export interface TopBrowserFamiliesParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export interface TopBrowsersParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Filter for bot class. Refer to + * [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + */ + botClass?: Array<'LIKELY_AUTOMATED' | 'LIKELY_HUMAN'>; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for device type. + */ + deviceType?: Array<'DESKTOP' | 'MOBILE' | 'OTHER'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http protocol. + */ + httpProtocol?: Array<'HTTP' | 'HTTPS'>; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for os name. + */ + os?: Array<'WINDOWS' | 'MACOSX' | 'IOS' | 'ANDROID' | 'CHROMEOS' | 'LINUX' | 'SMART_TV'>; + + /** + * Filter for tls version. + */ + tlsVersion?: Array<'TLSv1_0' | 'TLSv1_1' | 'TLSv1_2' | 'TLSv1_3' | 'TLSvQUIC'>; +} + +export namespace Top { + export import TopBrowserFamiliesResponse = TopAPI.TopBrowserFamiliesResponse; + export import TopBrowsersResponse = TopAPI.TopBrowsersResponse; + export import TopBrowserFamiliesParams = TopAPI.TopBrowserFamiliesParams; + export import TopBrowsersParams = TopAPI.TopBrowsersParams; +} diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index 5fa74a7ac3..7b2314fcc0 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -1,34 +1,38 @@ // File generated from our OpenAPI spec by Stainless. export { Annotations } from './annotations/index'; -export { As112 } from './as112/index'; +export { As112TimeseriesResponse, As112TimeseriesParams, As112 } from './as112/index'; export { Attacks } from './attacks/index'; -export { BGP } from './bgp/index'; +export { BGPTimeseriesResponse, BGPTimeseriesParams, BGP } from './bgp/index'; export { - ConnectionTamperingListResponse, - ConnectionTamperingListParams, + ConnectionTamperingSummaryResponse, + ConnectionTamperingTimeseriesGroupsResponse, + ConnectionTamperingSummaryParams, + ConnectionTamperingTimeseriesGroupsParams, ConnectionTampering, -} from './connection-tampering/index'; +} from './connection-tampering'; export { DNS } from './dns/index'; export { DatasetListResponse, + DatasetDownloadResponse, DatasetGetResponse, DatasetListParams, + DatasetDownloadParams, DatasetGetParams, Datasets, -} from './datasets/index'; +} from './datasets'; export { Email } from './email/index'; export { Emails } from './emails/index'; -export { EntityListResponse, EntityListParams, Entities } from './entities/index'; +export { EntityGetResponse, EntityGetParams, Entities } from './entities/index'; export { HTTP } from './http/index'; -export { Netflows } from './netflows/index'; +export { NetflowTimeseriesResponse, NetflowTimeseriesParams, Netflows } from './netflows/index'; export { Quality } from './quality/index'; export { Radar } from './radar'; -export { Ranking } from './ranking/index'; -export { Searches } from './searches/index'; +export { RankingTimeseriesGroupsResponse, RankingTimeseriesGroupsParams, Ranking } from './ranking/index'; +export { SearchGlobalResponse, SearchGlobalParams, Search } from './search'; export { - TrafficAnomalyListResponse, - TrafficAnomalyListParams, + TrafficAnomalyGetResponse, + TrafficAnomalyGetParams, TrafficAnomalies, } from './traffic-anomalies/index'; export { VerifiedBots } from './verified-bots/index'; diff --git a/src/resources/radar/netflows/index.ts b/src/resources/radar/netflows/index.ts index d00174c8a0..9d909b2998 100644 --- a/src/resources/radar/netflows/index.ts +++ b/src/resources/radar/netflows/index.ts @@ -1,5 +1,4 @@ // File generated from our OpenAPI spec by Stainless. -export { Netflows } from './netflows'; -export { TimeseryListResponse, TimeseryListParams, Timeseries } from './timeseries'; -export { Tops } from './tops/index'; +export { NetflowTimeseriesResponse, NetflowTimeseriesParams, Netflows } from './netflows'; +export { TopAsesResponse, TopLocationsResponse, TopAsesParams, TopLocationsParams, Top } from './top'; diff --git a/src/resources/radar/netflows/netflows.ts b/src/resources/radar/netflows/netflows.ts index d2f81dd1d4..dc31f0ad87 100644 --- a/src/resources/radar/netflows/netflows.ts +++ b/src/resources/radar/netflows/netflows.ts @@ -1,17 +1,183 @@ // File generated from our OpenAPI spec by Stainless. +import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as TimeseriesAPI from 'cloudflare/resources/radar/netflows/timeseries'; -import * as TopsAPI from 'cloudflare/resources/radar/netflows/tops/tops'; +import { isRequestOptions } from 'cloudflare/core'; +import * as NetflowsAPI from 'cloudflare/resources/radar/netflows/netflows'; +import * as TopAPI from 'cloudflare/resources/radar/netflows/top'; export class Netflows extends APIResource { - timeseries: TimeseriesAPI.Timeseries = new TimeseriesAPI.Timeseries(this._client); - tops: TopsAPI.Tops = new TopsAPI.Tops(this._client); + top: TopAPI.Top = new TopAPI.Top(this._client); + + /** + * Get network traffic change over time. Visit + * https://en.wikipedia.org/wiki/NetFlow for more information on NetFlows. + */ + timeseries( + query?: NetflowTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: NetflowTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/netflows/timeseries', { query, ...options }) as Core.APIPromise<{ + result: NetflowTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface NetflowTimeseriesResponse { + meta: NetflowTimeseriesResponse.Meta; + + serie_0: NetflowTimeseriesResponse.Serie0; +} + +export namespace NetflowTimeseriesResponse { + export interface Meta { + aggInterval: string; + + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Serie0 { + timestamps: Array; + + values: Array; + } +} + +export interface NetflowTimeseriesParams { + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Normalization method applied. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; + + /** + * Array of network traffic product types. + */ + product?: Array<'HTTP' | 'ALL'>; } export namespace Netflows { - export import Timeseries = TimeseriesAPI.Timeseries; - export import TimeseryListResponse = TimeseriesAPI.TimeseryListResponse; - export import TimeseryListParams = TimeseriesAPI.TimeseryListParams; - export import Tops = TopsAPI.Tops; + export import NetflowTimeseriesResponse = NetflowsAPI.NetflowTimeseriesResponse; + export import NetflowTimeseriesParams = NetflowsAPI.NetflowTimeseriesParams; + export import Top = TopAPI.Top; + export import TopAsesResponse = TopAPI.TopAsesResponse; + export import TopLocationsResponse = TopAPI.TopLocationsResponse; + export import TopAsesParams = TopAPI.TopAsesParams; + export import TopLocationsParams = TopAPI.TopLocationsParams; } diff --git a/src/resources/radar/netflows/timeseries.ts b/src/resources/radar/netflows/timeseries.ts deleted file mode 100644 index c9c7c25c7f..0000000000 --- a/src/resources/radar/netflows/timeseries.ts +++ /dev/null @@ -1,172 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as TimeseriesAPI from 'cloudflare/resources/radar/netflows/timeseries'; - -export class Timeseries extends APIResource { - /** - * Get network traffic change over time. Visit - * https://en.wikipedia.org/wiki/NetFlow for more information on NetFlows. - */ - list(query?: TimeseryListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: TimeseryListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/netflows/timeseries', { query, ...options }) as Core.APIPromise<{ - result: TimeseryListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface TimeseryListResponse { - meta: TimeseryListResponse.Meta; - - serie_0: TimeseryListResponse.Serie0; -} - -export namespace TimeseryListResponse { - export interface Meta { - aggInterval: string; - - dateRange: Array; - - lastUpdated: string; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Serie0 { - timestamps: Array; - - values: Array; - } -} - -export interface TimeseryListParams { - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Normalization method applied. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; - - /** - * Array of network traffic product types. - */ - product?: Array<'HTTP' | 'ALL'>; -} - -export namespace Timeseries { - export import TimeseryListResponse = TimeseriesAPI.TimeseryListResponse; - export import TimeseryListParams = TimeseriesAPI.TimeseryListParams; -} diff --git a/src/resources/radar/netflows/top.ts b/src/resources/radar/netflows/top.ts new file mode 100644 index 0000000000..b7dab1bf0b --- /dev/null +++ b/src/resources/radar/netflows/top.ts @@ -0,0 +1,211 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as TopAPI from 'cloudflare/resources/radar/netflows/top'; + +export class Top extends APIResource { + /** + * Get the top autonomous systems (AS) by network traffic (NetFlows) over a given + * time period. Visit https://en.wikipedia.org/wiki/NetFlow for more information. + */ + ases(query?: TopAsesParams, options?: Core.RequestOptions): Core.APIPromise; + ases(options?: Core.RequestOptions): Core.APIPromise; + ases( + query: TopAsesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.ases({}, query); + } + return ( + this._client.get('/radar/netflows/top/ases', { query, ...options }) as Core.APIPromise<{ + result: TopAsesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get the top locations by network traffic (NetFlows) over a given time period. + * Visit https://en.wikipedia.org/wiki/NetFlow for more information. + */ + locations(query?: TopLocationsParams, options?: Core.RequestOptions): Core.APIPromise; + locations(options?: Core.RequestOptions): Core.APIPromise; + locations( + query: TopLocationsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.locations({}, query); + } + return ( + this._client.get('/radar/netflows/top/locations', { query, ...options }) as Core.APIPromise<{ + result: TopLocationsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TopAsesResponse { + top_0: Array; +} + +export namespace TopAsesResponse { + export interface Top0 { + clientASN: number; + + clientASName: string; + + value: string; + } +} + +export interface TopLocationsResponse { + top_0: Array; +} + +export namespace TopLocationsResponse { + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface TopAsesParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface TopLocationsParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export namespace Top { + export import TopAsesResponse = TopAPI.TopAsesResponse; + export import TopLocationsResponse = TopAPI.TopLocationsResponse; + export import TopAsesParams = TopAPI.TopAsesParams; + export import TopLocationsParams = TopAPI.TopLocationsParams; +} diff --git a/src/resources/radar/netflows/tops/ases.ts b/src/resources/radar/netflows/tops/ases.ts deleted file mode 100644 index 830af105d7..0000000000 --- a/src/resources/radar/netflows/tops/ases.ts +++ /dev/null @@ -1,111 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as AsesAPI from 'cloudflare/resources/radar/netflows/tops/ases'; - -export class Ases extends APIResource { - /** - * Get the top autonomous systems (AS) by network traffic (NetFlows) over a given - * time period. Visit https://en.wikipedia.org/wiki/NetFlow for more information. - */ - list(query?: AseListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: AseListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/netflows/top/ases', { query, ...options }) as Core.APIPromise<{ - result: AseListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface AseListResponse { - top_0: Array; -} - -export namespace AseListResponse { - export interface Top0 { - clientASN: number; - - clientASName: string; - - value: string; - } -} - -export interface AseListParams { - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limit the number of objects in the response. - */ - limit?: number; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; -} - -export namespace Ases { - export import AseListResponse = AsesAPI.AseListResponse; - export import AseListParams = AsesAPI.AseListParams; -} diff --git a/src/resources/radar/netflows/tops/index.ts b/src/resources/radar/netflows/tops/index.ts deleted file mode 100644 index a20f97e17b..0000000000 --- a/src/resources/radar/netflows/tops/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { AseListResponse, AseListParams, Ases } from './ases'; -export { LocationListResponse, LocationListParams, Locations } from './locations'; -export { Tops } from './tops'; diff --git a/src/resources/radar/netflows/tops/locations.ts b/src/resources/radar/netflows/tops/locations.ts deleted file mode 100644 index 2da529452f..0000000000 --- a/src/resources/radar/netflows/tops/locations.ts +++ /dev/null @@ -1,111 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as LocationsAPI from 'cloudflare/resources/radar/netflows/tops/locations'; - -export class Locations extends APIResource { - /** - * Get the top locations by network traffic (NetFlows) over a given time period. - * Visit https://en.wikipedia.org/wiki/NetFlow for more information. - */ - list(query?: LocationListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: LocationListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/netflows/top/locations', { query, ...options }) as Core.APIPromise<{ - result: LocationListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface LocationListResponse { - top_0: Array; -} - -export namespace LocationListResponse { - export interface Top0 { - clientCountryAlpha2: string; - - clientCountryName: string; - - value: string; - } -} - -export interface LocationListParams { - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limit the number of objects in the response. - */ - limit?: number; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; -} - -export namespace Locations { - export import LocationListResponse = LocationsAPI.LocationListResponse; - export import LocationListParams = LocationsAPI.LocationListParams; -} diff --git a/src/resources/radar/netflows/tops/tops.ts b/src/resources/radar/netflows/tops/tops.ts deleted file mode 100644 index f017eaf225..0000000000 --- a/src/resources/radar/netflows/tops/tops.ts +++ /dev/null @@ -1,19 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import { APIResource } from 'cloudflare/resource'; -import * as AsesAPI from 'cloudflare/resources/radar/netflows/tops/ases'; -import * as LocationsAPI from 'cloudflare/resources/radar/netflows/tops/locations'; - -export class Tops extends APIResource { - ases: AsesAPI.Ases = new AsesAPI.Ases(this._client); - locations: LocationsAPI.Locations = new LocationsAPI.Locations(this._client); -} - -export namespace Tops { - export import Ases = AsesAPI.Ases; - export import AseListResponse = AsesAPI.AseListResponse; - export import AseListParams = AsesAPI.AseListParams; - export import Locations = LocationsAPI.Locations; - export import LocationListResponse = LocationsAPI.LocationListResponse; - export import LocationListParams = LocationsAPI.LocationListParams; -} diff --git a/src/resources/radar/quality/index.ts b/src/resources/radar/quality/index.ts index 80f4da6357..dc25ffb68f 100644 --- a/src/resources/radar/quality/index.ts +++ b/src/resources/radar/quality/index.ts @@ -1,5 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -export { IqiListResponse, IqiListParams, Iqi } from './iqi/index'; +export { IqiSummaryResponse, IqiSummaryParams, Iqi } from './iqi'; export { Quality } from './quality'; -export { Speed } from './speed/index'; +export { + SpeedHistogramResponse, + SpeedSummaryResponse, + SpeedHistogramParams, + SpeedSummaryParams, + Speed, +} from './speed/index'; diff --git a/src/resources/radar/quality/iqi/iqi.ts b/src/resources/radar/quality/iqi.ts similarity index 76% rename from src/resources/radar/quality/iqi/iqi.ts rename to src/resources/radar/quality/iqi.ts index 9a159af6fe..aa36657a36 100644 --- a/src/resources/radar/quality/iqi/iqi.ts +++ b/src/resources/radar/quality/iqi.ts @@ -2,34 +2,29 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as IqiAPI from 'cloudflare/resources/radar/quality/iqi/iqi'; -import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/quality/iqi/timeseries-groups'; +import * as IqiAPI from 'cloudflare/resources/radar/quality/iqi'; export class Iqi extends APIResource { - timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( - this._client, - ); - /** * Get a summary (percentiles) of bandwidth, latency or DNS response time from the * Radar Internet Quality Index (IQI). */ - list(query: IqiListParams, options?: Core.RequestOptions): Core.APIPromise { + summary(query: IqiSummaryParams, options?: Core.RequestOptions): Core.APIPromise { return ( this._client.get('/radar/quality/iqi/summary', { query, ...options }) as Core.APIPromise<{ - result: IqiListResponse; + result: IqiSummaryResponse; }> )._thenUnwrap((obj) => obj.result); } } -export interface IqiListResponse { - meta: IqiListResponse.Meta; +export interface IqiSummaryResponse { + meta: IqiSummaryResponse.Meta; - summary_0: IqiListResponse.Summary0; + summary_0: IqiSummaryResponse.Summary0; } -export namespace IqiListResponse { +export namespace IqiSummaryResponse { export interface Meta { dateRange: Array; @@ -87,7 +82,7 @@ export namespace IqiListResponse { } } -export interface IqiListParams { +export interface IqiSummaryParams { /** * Which metric to return: bandwidth, latency or DNS response time. */ @@ -159,9 +154,6 @@ export interface IqiListParams { } export namespace Iqi { - export import IqiListResponse = IqiAPI.IqiListResponse; - export import IqiListParams = IqiAPI.IqiListParams; - export import TimeseriesGroups = TimeseriesGroupsAPI.TimeseriesGroups; - export import TimeseriesGroupListResponse = TimeseriesGroupsAPI.TimeseriesGroupListResponse; - export import TimeseriesGroupListParams = TimeseriesGroupsAPI.TimeseriesGroupListParams; + export import IqiSummaryResponse = IqiAPI.IqiSummaryResponse; + export import IqiSummaryParams = IqiAPI.IqiSummaryParams; } diff --git a/src/resources/radar/quality/iqi/index.ts b/src/resources/radar/quality/iqi/index.ts deleted file mode 100644 index 716e1f7893..0000000000 --- a/src/resources/radar/quality/iqi/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { IqiListResponse, IqiListParams, Iqi } from './iqi'; -export { - TimeseriesGroupListResponse, - TimeseriesGroupListParams, - TimeseriesGroups, -} from './timeseries-groups'; diff --git a/src/resources/radar/quality/iqi/timeseries-groups.ts b/src/resources/radar/quality/iqi/timeseries-groups.ts deleted file mode 100644 index 02f5c686cc..0000000000 --- a/src/resources/radar/quality/iqi/timeseries-groups.ts +++ /dev/null @@ -1,128 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/quality/iqi/timeseries-groups'; - -export class TimeseriesGroups extends APIResource { - /** - * Get a time series (percentiles) of bandwidth, latency or DNS response time from - * the Radar Internet Quality Index (IQI). - */ - list( - query: TimeseriesGroupListParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.get('/radar/quality/iqi/timeseries_groups', { query, ...options }) as Core.APIPromise<{ - result: TimeseriesGroupListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface TimeseriesGroupListResponse { - meta: unknown; - - serie_0: TimeseriesGroupListResponse.Serie0; -} - -export namespace TimeseriesGroupListResponse { - export interface Serie0 { - p25: Array; - - p50: Array; - - p75: Array; - - timestamps: Array; - } -} - -export interface TimeseriesGroupListParams { - /** - * Which metric to return: bandwidth, latency or DNS response time. - */ - metric: 'BANDWIDTH' | 'DNS' | 'LATENCY'; - - /** - * Aggregation interval results should be returned in (for example, in 15 minutes - * or 1 hour intervals). Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * Array of comma separated list of continents (alpha-2 continent codes). Start - * with `-` to exclude from results. For example, `-EU,NA` excludes results from - * Europe, but includes results from North America. - */ - continent?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Enable interpolation for all series (using the average). - */ - interpolation?: boolean; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; -} - -export namespace TimeseriesGroups { - export import TimeseriesGroupListResponse = TimeseriesGroupsAPI.TimeseriesGroupListResponse; - export import TimeseriesGroupListParams = TimeseriesGroupsAPI.TimeseriesGroupListParams; -} diff --git a/src/resources/radar/quality/quality.ts b/src/resources/radar/quality/quality.ts index ec00ee40c4..67d74fa3fa 100644 --- a/src/resources/radar/quality/quality.ts +++ b/src/resources/radar/quality/quality.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. import { APIResource } from 'cloudflare/resource'; -import * as IqiAPI from 'cloudflare/resources/radar/quality/iqi/iqi'; +import * as IqiAPI from 'cloudflare/resources/radar/quality/iqi'; import * as SpeedAPI from 'cloudflare/resources/radar/quality/speed/speed'; export class Quality extends APIResource { @@ -11,7 +11,11 @@ export class Quality extends APIResource { export namespace Quality { export import Iqi = IqiAPI.Iqi; - export import IqiListResponse = IqiAPI.IqiListResponse; - export import IqiListParams = IqiAPI.IqiListParams; + export import IqiSummaryResponse = IqiAPI.IqiSummaryResponse; + export import IqiSummaryParams = IqiAPI.IqiSummaryParams; export import Speed = SpeedAPI.Speed; + export import SpeedHistogramResponse = SpeedAPI.SpeedHistogramResponse; + export import SpeedSummaryResponse = SpeedAPI.SpeedSummaryResponse; + export import SpeedHistogramParams = SpeedAPI.SpeedHistogramParams; + export import SpeedSummaryParams = SpeedAPI.SpeedSummaryParams; } diff --git a/src/resources/radar/quality/speed/histogram.ts b/src/resources/radar/quality/speed/histogram.ts deleted file mode 100644 index 4539b2f8c5..0000000000 --- a/src/resources/radar/quality/speed/histogram.ts +++ /dev/null @@ -1,90 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as HistogramAPI from 'cloudflare/resources/radar/quality/speed/histogram'; - -export class Histogram extends APIResource { - /** - * Get an histogram from the previous 90 days of Cloudflare Speed Test data, split - * into fixed bandwidth (Mbps), latency (ms) or jitter (ms) buckets. - */ - list(query?: HistogramListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: HistogramListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/quality/speed/histogram', { query, ...options }) as Core.APIPromise<{ - result: HistogramListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface HistogramListResponse { - histogram_0: HistogramListResponse.Histogram0; - - meta: unknown; -} - -export namespace HistogramListResponse { - export interface Histogram0 { - bandwidthDownload: Array; - - bandwidthUpload: Array; - - bucketMin: Array; - } -} - -export interface HistogramListParams { - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * The width for every bucket in the histogram. - */ - bucketSize?: number; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Metrics to be returned. - */ - metricGroup?: 'BANDWIDTH' | 'LATENCY' | 'JITTER'; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; -} - -export namespace Histogram { - export import HistogramListResponse = HistogramAPI.HistogramListResponse; - export import HistogramListParams = HistogramAPI.HistogramListParams; -} diff --git a/src/resources/radar/quality/speed/index.ts b/src/resources/radar/quality/speed/index.ts index a96fea2774..acd1ec8ff9 100644 --- a/src/resources/radar/quality/speed/index.ts +++ b/src/resources/radar/quality/speed/index.ts @@ -1,6 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -export { HistogramListResponse, HistogramListParams, Histogram } from './histogram'; -export { Speed } from './speed'; -export { SummaryListResponse, SummaryListParams, Summary } from './summary'; -export { Top } from './top/index'; +export { + SpeedHistogramResponse, + SpeedSummaryResponse, + SpeedHistogramParams, + SpeedSummaryParams, + Speed, +} from './speed'; +export { TopAsesResponse, TopLocationsResponse, TopAsesParams, TopLocationsParams, Top } from './top'; diff --git a/src/resources/radar/quality/speed/speed.ts b/src/resources/radar/quality/speed/speed.ts index 36e80ed117..5dd111a5c6 100644 --- a/src/resources/radar/quality/speed/speed.ts +++ b/src/resources/radar/quality/speed/speed.ts @@ -1,22 +1,226 @@ // File generated from our OpenAPI spec by Stainless. +import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as HistogramAPI from 'cloudflare/resources/radar/quality/speed/histogram'; -import * as SummaryAPI from 'cloudflare/resources/radar/quality/speed/summary'; -import * as TopAPI from 'cloudflare/resources/radar/quality/speed/top/top'; +import { isRequestOptions } from 'cloudflare/core'; +import * as SpeedAPI from 'cloudflare/resources/radar/quality/speed/speed'; +import * as TopAPI from 'cloudflare/resources/radar/quality/speed/top'; export class Speed extends APIResource { - histogram: HistogramAPI.Histogram = new HistogramAPI.Histogram(this._client); - summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); top: TopAPI.Top = new TopAPI.Top(this._client); + + /** + * Get an histogram from the previous 90 days of Cloudflare Speed Test data, split + * into fixed bandwidth (Mbps), latency (ms) or jitter (ms) buckets. + */ + histogram( + query?: SpeedHistogramParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + histogram(options?: Core.RequestOptions): Core.APIPromise; + histogram( + query: SpeedHistogramParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.histogram({}, query); + } + return ( + this._client.get('/radar/quality/speed/histogram', { query, ...options }) as Core.APIPromise<{ + result: SpeedHistogramResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a summary of bandwidth, latency, jitter and packet loss, from the previous + * 90 days of Cloudflare Speed Test data. + */ + summary(query?: SpeedSummaryParams, options?: Core.RequestOptions): Core.APIPromise; + summary(options?: Core.RequestOptions): Core.APIPromise; + summary( + query: SpeedSummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary({}, query); + } + return ( + this._client.get('/radar/quality/speed/summary', { query, ...options }) as Core.APIPromise<{ + result: SpeedSummaryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SpeedHistogramResponse { + histogram_0: SpeedHistogramResponse.Histogram0; + + meta: unknown; +} + +export namespace SpeedHistogramResponse { + export interface Histogram0 { + bandwidthDownload: Array; + + bandwidthUpload: Array; + + bucketMin: Array; + } +} + +export interface SpeedSummaryResponse { + meta: SpeedSummaryResponse.Meta; + + summary_0: SpeedSummaryResponse.Summary0; +} + +export namespace SpeedSummaryResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + normalization: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Summary0 { + bandwidthDownload: string; + + bandwidthUpload: string; + + jitterIdle: string; + + jitterLoaded: string; + + latencyIdle: string; + + latencyLoaded: string; + + packetLoss: string; + } +} + +export interface SpeedHistogramParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * The width for every bucket in the histogram. + */ + bucketSize?: number; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Metrics to be returned. + */ + metricGroup?: 'BANDWIDTH' | 'LATENCY' | 'JITTER'; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface SpeedSummaryParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; } export namespace Speed { - export import Histogram = HistogramAPI.Histogram; - export import HistogramListResponse = HistogramAPI.HistogramListResponse; - export import HistogramListParams = HistogramAPI.HistogramListParams; - export import Summary = SummaryAPI.Summary; - export import SummaryListResponse = SummaryAPI.SummaryListResponse; - export import SummaryListParams = SummaryAPI.SummaryListParams; + export import SpeedHistogramResponse = SpeedAPI.SpeedHistogramResponse; + export import SpeedSummaryResponse = SpeedAPI.SpeedSummaryResponse; + export import SpeedHistogramParams = SpeedAPI.SpeedHistogramParams; + export import SpeedSummaryParams = SpeedAPI.SpeedSummaryParams; export import Top = TopAPI.Top; + export import TopAsesResponse = TopAPI.TopAsesResponse; + export import TopLocationsResponse = TopAPI.TopLocationsResponse; + export import TopAsesParams = TopAPI.TopAsesParams; + export import TopLocationsParams = TopAPI.TopLocationsParams; } diff --git a/src/resources/radar/quality/speed/summary.ts b/src/resources/radar/quality/speed/summary.ts deleted file mode 100644 index f816119bbe..0000000000 --- a/src/resources/radar/quality/speed/summary.ts +++ /dev/null @@ -1,136 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as SummaryAPI from 'cloudflare/resources/radar/quality/speed/summary'; - -export class Summary extends APIResource { - /** - * Get a summary of bandwidth, latency, jitter and packet loss, from the previous - * 90 days of Cloudflare Speed Test data. - */ - list(query?: SummaryListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: SummaryListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/quality/speed/summary', { query, ...options }) as Core.APIPromise<{ - result: SummaryListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface SummaryListResponse { - meta: SummaryListResponse.Meta; - - summary_0: SummaryListResponse.Summary0; -} - -export namespace SummaryListResponse { - export interface Meta { - dateRange: Array; - - lastUpdated: string; - - normalization: string; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Summary0 { - bandwidthDownload: string; - - bandwidthUpload: string; - - jitterIdle: string; - - jitterLoaded: string; - - latencyIdle: string; - - latencyLoaded: string; - - packetLoss: string; - } -} - -export interface SummaryListParams { - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; -} - -export namespace Summary { - export import SummaryListResponse = SummaryAPI.SummaryListResponse; - export import SummaryListParams = SummaryAPI.SummaryListParams; -} diff --git a/src/resources/radar/quality/speed/top.ts b/src/resources/radar/quality/speed/top.ts new file mode 100644 index 0000000000..304b446ec2 --- /dev/null +++ b/src/resources/radar/quality/speed/top.ts @@ -0,0 +1,311 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as TopAPI from 'cloudflare/resources/radar/quality/speed/top'; + +export class Top extends APIResource { + /** + * Get the top autonomous systems by bandwidth, latency, jitter or packet loss, + * from the previous 90 days of Cloudflare Speed Test data. + */ + ases(query?: TopAsesParams, options?: Core.RequestOptions): Core.APIPromise; + ases(options?: Core.RequestOptions): Core.APIPromise; + ases( + query: TopAsesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.ases({}, query); + } + return ( + this._client.get('/radar/quality/speed/top/ases', { query, ...options }) as Core.APIPromise<{ + result: TopAsesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get the top locations by bandwidth, latency, jitter or packet loss, from the + * previous 90 days of Cloudflare Speed Test data. + */ + locations(query?: TopLocationsParams, options?: Core.RequestOptions): Core.APIPromise; + locations(options?: Core.RequestOptions): Core.APIPromise; + locations( + query: TopLocationsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.locations({}, query); + } + return ( + this._client.get('/radar/quality/speed/top/locations', { query, ...options }) as Core.APIPromise<{ + result: TopLocationsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TopAsesResponse { + meta: TopAsesResponse.Meta; + + top_0: Array; +} + +export namespace TopAsesResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + bandwidthDownload: string; + + bandwidthUpload: string; + + clientASN: number; + + clientASName: string; + + jitterIdle: string; + + jitterLoaded: string; + + latencyIdle: string; + + latencyLoaded: string; + + numTests: number; + + rankPower: number; + } +} + +export interface TopLocationsResponse { + meta: TopLocationsResponse.Meta; + + top_0: Array; +} + +export namespace TopLocationsResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + bandwidthDownload: string; + + bandwidthUpload: string; + + clientCountryAlpha2: string; + + clientCountryName: string; + + jitterIdle: string; + + jitterLoaded: string; + + latencyIdle: string; + + latencyLoaded: string; + + numTests: number; + + rankPower: number; + } +} + +export interface TopAsesParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Metric to order the results by. + */ + orderBy?: + | 'BANDWIDTH_DOWNLOAD' + | 'BANDWIDTH_UPLOAD' + | 'LATENCY_IDLE' + | 'LATENCY_LOADED' + | 'JITTER_IDLE' + | 'JITTER_LOADED'; + + /** + * Reverse the order of results. + */ + reverse?: boolean; +} + +export interface TopLocationsParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Metric to order the results by. + */ + orderBy?: + | 'BANDWIDTH_DOWNLOAD' + | 'BANDWIDTH_UPLOAD' + | 'LATENCY_IDLE' + | 'LATENCY_LOADED' + | 'JITTER_IDLE' + | 'JITTER_LOADED'; + + /** + * Reverse the order of results. + */ + reverse?: boolean; +} + +export namespace Top { + export import TopAsesResponse = TopAPI.TopAsesResponse; + export import TopLocationsResponse = TopAPI.TopLocationsResponse; + export import TopAsesParams = TopAPI.TopAsesParams; + export import TopLocationsParams = TopAPI.TopLocationsParams; +} diff --git a/src/resources/radar/quality/speed/top/ases.ts b/src/resources/radar/quality/speed/top/ases.ts deleted file mode 100644 index 77f8b5aee5..0000000000 --- a/src/resources/radar/quality/speed/top/ases.ts +++ /dev/null @@ -1,161 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as AsesAPI from 'cloudflare/resources/radar/quality/speed/top/ases'; - -export class Ases extends APIResource { - /** - * Get the top autonomous systems by bandwidth, latency, jitter or packet loss, - * from the previous 90 days of Cloudflare Speed Test data. - */ - list(query?: AseListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: AseListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/quality/speed/top/ases', { query, ...options }) as Core.APIPromise<{ - result: AseListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface AseListResponse { - meta: AseListResponse.Meta; - - top_0: Array; -} - -export namespace AseListResponse { - export interface Meta { - dateRange: Array; - - lastUpdated: string; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Top0 { - bandwidthDownload: string; - - bandwidthUpload: string; - - clientASN: number; - - clientASName: string; - - jitterIdle: string; - - jitterLoaded: string; - - latencyIdle: string; - - latencyLoaded: string; - - numTests: number; - - rankPower: number; - } -} - -export interface AseListParams { - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limit the number of objects in the response. - */ - limit?: number; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Metric to order the results by. - */ - orderBy?: - | 'BANDWIDTH_DOWNLOAD' - | 'BANDWIDTH_UPLOAD' - | 'LATENCY_IDLE' - | 'LATENCY_LOADED' - | 'JITTER_IDLE' - | 'JITTER_LOADED'; - - /** - * Reverse the order of results. - */ - reverse?: boolean; -} - -export namespace Ases { - export import AseListResponse = AsesAPI.AseListResponse; - export import AseListParams = AsesAPI.AseListParams; -} diff --git a/src/resources/radar/quality/speed/top/index.ts b/src/resources/radar/quality/speed/top/index.ts deleted file mode 100644 index 69ef654710..0000000000 --- a/src/resources/radar/quality/speed/top/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { AseListResponse, AseListParams, Ases } from './ases'; -export { LocationListResponse, LocationListParams, Locations } from './locations'; -export { Top } from './top'; diff --git a/src/resources/radar/quality/speed/top/locations.ts b/src/resources/radar/quality/speed/top/locations.ts deleted file mode 100644 index 941a908902..0000000000 --- a/src/resources/radar/quality/speed/top/locations.ts +++ /dev/null @@ -1,161 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as LocationsAPI from 'cloudflare/resources/radar/quality/speed/top/locations'; - -export class Locations extends APIResource { - /** - * Get the top locations by bandwidth, latency, jitter or packet loss, from the - * previous 90 days of Cloudflare Speed Test data. - */ - list(query?: LocationListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: LocationListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/quality/speed/top/locations', { query, ...options }) as Core.APIPromise<{ - result: LocationListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface LocationListResponse { - meta: LocationListResponse.Meta; - - top_0: Array; -} - -export namespace LocationListResponse { - export interface Meta { - dateRange: Array; - - lastUpdated: string; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Top0 { - bandwidthDownload: string; - - bandwidthUpload: string; - - clientCountryAlpha2: string; - - clientCountryName: string; - - jitterIdle: string; - - jitterLoaded: string; - - latencyIdle: string; - - latencyLoaded: string; - - numTests: number; - - rankPower: number; - } -} - -export interface LocationListParams { - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limit the number of objects in the response. - */ - limit?: number; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * Metric to order the results by. - */ - orderBy?: - | 'BANDWIDTH_DOWNLOAD' - | 'BANDWIDTH_UPLOAD' - | 'LATENCY_IDLE' - | 'LATENCY_LOADED' - | 'JITTER_IDLE' - | 'JITTER_LOADED'; - - /** - * Reverse the order of results. - */ - reverse?: boolean; -} - -export namespace Locations { - export import LocationListResponse = LocationsAPI.LocationListResponse; - export import LocationListParams = LocationsAPI.LocationListParams; -} diff --git a/src/resources/radar/quality/speed/top/top.ts b/src/resources/radar/quality/speed/top/top.ts deleted file mode 100644 index cf8149b965..0000000000 --- a/src/resources/radar/quality/speed/top/top.ts +++ /dev/null @@ -1,19 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import { APIResource } from 'cloudflare/resource'; -import * as AsesAPI from 'cloudflare/resources/radar/quality/speed/top/ases'; -import * as LocationsAPI from 'cloudflare/resources/radar/quality/speed/top/locations'; - -export class Top extends APIResource { - ases: AsesAPI.Ases = new AsesAPI.Ases(this._client); - locations: LocationsAPI.Locations = new LocationsAPI.Locations(this._client); -} - -export namespace Top { - export import Ases = AsesAPI.Ases; - export import AseListResponse = AsesAPI.AseListResponse; - export import AseListParams = AsesAPI.AseListParams; - export import Locations = LocationsAPI.Locations; - export import LocationListResponse = LocationsAPI.LocationListResponse; - export import LocationListParams = LocationsAPI.LocationListParams; -} diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 9f785e1d15..750cff1aca 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -1,12 +1,13 @@ // File generated from our OpenAPI spec by Stainless. import { APIResource } from 'cloudflare/resource'; +import * as ConnectionTamperingAPI from 'cloudflare/resources/radar/connection-tampering'; +import * as DatasetsAPI from 'cloudflare/resources/radar/datasets'; +import * as SearchAPI from 'cloudflare/resources/radar/search'; import * as AnnotationsAPI from 'cloudflare/resources/radar/annotations/annotations'; import * as As112API from 'cloudflare/resources/radar/as112/as112'; import * as AttacksAPI from 'cloudflare/resources/radar/attacks/attacks'; import * as BGPAPI from 'cloudflare/resources/radar/bgp/bgp'; -import * as ConnectionTamperingAPI from 'cloudflare/resources/radar/connection-tampering/connection-tampering'; -import * as DatasetsAPI from 'cloudflare/resources/radar/datasets/datasets'; import * as DNSAPI from 'cloudflare/resources/radar/dns/dns'; import * as EmailAPI from 'cloudflare/resources/radar/email/email'; import * as EmailsAPI from 'cloudflare/resources/radar/emails/emails'; @@ -15,7 +16,6 @@ import * as HTTPAPI from 'cloudflare/resources/radar/http/http'; import * as NetflowsAPI from 'cloudflare/resources/radar/netflows/netflows'; import * as QualityAPI from 'cloudflare/resources/radar/quality/quality'; import * as RankingAPI from 'cloudflare/resources/radar/ranking/ranking'; -import * as SearchesAPI from 'cloudflare/resources/radar/searches/searches'; import * as TrafficAnomaliesAPI from 'cloudflare/resources/radar/traffic-anomalies/traffic-anomalies'; import * as VerifiedBotsAPI from 'cloudflare/resources/radar/verified-bots/verified-bots'; @@ -25,7 +25,7 @@ export class Radar extends APIResource { datasets: DatasetsAPI.Datasets = new DatasetsAPI.Datasets(this._client); dns: DNSAPI.DNS = new DNSAPI.DNS(this._client); netflows: NetflowsAPI.Netflows = new NetflowsAPI.Netflows(this._client); - searches: SearchesAPI.Searches = new SearchesAPI.Searches(this._client); + search: SearchAPI.Search = new SearchAPI.Search(this._client); verifiedBots: VerifiedBotsAPI.VerifiedBots = new VerifiedBotsAPI.VerifiedBots(this._client); as112: As112API.As112 = new As112API.As112(this._client); connectionTampering: ConnectionTamperingAPI.ConnectionTampering = @@ -45,29 +45,43 @@ export class Radar extends APIResource { export namespace Radar { export import Annotations = AnnotationsAPI.Annotations; export import BGP = BGPAPI.BGP; + export import BGPTimeseriesResponse = BGPAPI.BGPTimeseriesResponse; + export import BGPTimeseriesParams = BGPAPI.BGPTimeseriesParams; export import Datasets = DatasetsAPI.Datasets; export import DatasetListResponse = DatasetsAPI.DatasetListResponse; + export import DatasetDownloadResponse = DatasetsAPI.DatasetDownloadResponse; export import DatasetGetResponse = DatasetsAPI.DatasetGetResponse; export import DatasetListParams = DatasetsAPI.DatasetListParams; + export import DatasetDownloadParams = DatasetsAPI.DatasetDownloadParams; export import DatasetGetParams = DatasetsAPI.DatasetGetParams; export import DNS = DNSAPI.DNS; export import Netflows = NetflowsAPI.Netflows; - export import Searches = SearchesAPI.Searches; + export import NetflowTimeseriesResponse = NetflowsAPI.NetflowTimeseriesResponse; + export import NetflowTimeseriesParams = NetflowsAPI.NetflowTimeseriesParams; + export import Search = SearchAPI.Search; + export import SearchGlobalResponse = SearchAPI.SearchGlobalResponse; + export import SearchGlobalParams = SearchAPI.SearchGlobalParams; export import VerifiedBots = VerifiedBotsAPI.VerifiedBots; export import As112 = As112API.As112; + export import As112TimeseriesResponse = As112API.As112TimeseriesResponse; + export import As112TimeseriesParams = As112API.As112TimeseriesParams; export import ConnectionTampering = ConnectionTamperingAPI.ConnectionTampering; - export import ConnectionTamperingListResponse = ConnectionTamperingAPI.ConnectionTamperingListResponse; - export import ConnectionTamperingListParams = ConnectionTamperingAPI.ConnectionTamperingListParams; + export import ConnectionTamperingSummaryResponse = ConnectionTamperingAPI.ConnectionTamperingSummaryResponse; + export import ConnectionTamperingTimeseriesGroupsResponse = ConnectionTamperingAPI.ConnectionTamperingTimeseriesGroupsResponse; + export import ConnectionTamperingSummaryParams = ConnectionTamperingAPI.ConnectionTamperingSummaryParams; + export import ConnectionTamperingTimeseriesGroupsParams = ConnectionTamperingAPI.ConnectionTamperingTimeseriesGroupsParams; export import Email = EmailAPI.Email; export import Attacks = AttacksAPI.Attacks; export import Emails = EmailsAPI.Emails; export import Entities = EntitiesAPI.Entities; - export import EntityListResponse = EntitiesAPI.EntityListResponse; - export import EntityListParams = EntitiesAPI.EntityListParams; + export import EntityGetResponse = EntitiesAPI.EntityGetResponse; + export import EntityGetParams = EntitiesAPI.EntityGetParams; export import HTTP = HTTPAPI.HTTP; export import Quality = QualityAPI.Quality; export import Ranking = RankingAPI.Ranking; + export import RankingTimeseriesGroupsResponse = RankingAPI.RankingTimeseriesGroupsResponse; + export import RankingTimeseriesGroupsParams = RankingAPI.RankingTimeseriesGroupsParams; export import TrafficAnomalies = TrafficAnomaliesAPI.TrafficAnomalies; - export import TrafficAnomalyListResponse = TrafficAnomaliesAPI.TrafficAnomalyListResponse; - export import TrafficAnomalyListParams = TrafficAnomaliesAPI.TrafficAnomalyListParams; + export import TrafficAnomalyGetResponse = TrafficAnomaliesAPI.TrafficAnomalyGetResponse; + export import TrafficAnomalyGetParams = TrafficAnomaliesAPI.TrafficAnomalyGetParams; } diff --git a/src/resources/radar/ranking/index.ts b/src/resources/radar/ranking/index.ts index e1b7570886..b7d5174487 100644 --- a/src/resources/radar/ranking/index.ts +++ b/src/resources/radar/ranking/index.ts @@ -1,8 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -export { Ranking } from './ranking'; export { - TimeseriesGroupListResponse, - TimeseriesGroupListParams, - TimeseriesGroups, -} from './timeseries-groups'; + RankingGetResponse, + RankingTopResponse, + RankingGetParams, + RankingTopParams, + Ranking, +} from './ranking'; +export { RankingTimeseriesGroupsResponse, RankingTimeseriesGroupsParams, Ranking } from './ranking'; diff --git a/src/resources/radar/ranking/ranking.ts b/src/resources/radar/ranking/ranking.ts index b59b02bb9c..c16710569a 100644 --- a/src/resources/radar/ranking/ranking.ts +++ b/src/resources/radar/ranking/ranking.ts @@ -1,16 +1,139 @@ // File generated from our OpenAPI spec by Stainless. +import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/ranking/timeseries-groups'; +import { isRequestOptions } from 'cloudflare/core'; +import { Ranking } from './ranking'; +import * as RankingAPI from 'cloudflare/resources/radar/ranking/ranking'; export class Ranking extends APIResource { - timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( - this._client, - ); + ranking: Ranking = new Ranking(this._client); + + /** + * Gets Domains Rank updates change over time. Raw values are returned. + */ + timeseriesGroups( + query?: RankingTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups(options?: Core.RequestOptions): Core.APIPromise; + timeseriesGroups( + query: RankingTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups({}, query); + } + return ( + this._client.get('/radar/ranking/timeseries_groups', { query, ...options }) as Core.APIPromise<{ + result: RankingTimeseriesGroupsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface RankingTimeseriesGroupsResponse { + meta: RankingTimeseriesGroupsResponse.Meta; + + serie_0: RankingTimeseriesGroupsResponse.Serie0; +} + +export namespace RankingTimeseriesGroupsResponse { + export interface Meta { + dateRange: Array; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + } + + export interface Serie0 { + timestamps: Array; + [k: string]: Array; + } +} + +export interface RankingTimeseriesGroupsParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Array of comma separated list of domains names. + */ + domains?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of locations (alpha-2 country codes). + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * The ranking type. + */ + rankingType?: 'POPULAR' | 'TRENDING_RISE' | 'TRENDING_STEADY'; } export namespace Ranking { - export import TimeseriesGroups = TimeseriesGroupsAPI.TimeseriesGroups; - export import TimeseriesGroupListResponse = TimeseriesGroupsAPI.TimeseriesGroupListResponse; - export import TimeseriesGroupListParams = TimeseriesGroupsAPI.TimeseriesGroupListParams; + export import RankingTimeseriesGroupsResponse = RankingAPI.RankingTimeseriesGroupsResponse; + export import RankingTimeseriesGroupsParams = RankingAPI.RankingTimeseriesGroupsParams; + export import Ranking = RankingAPI.Ranking; + export import RankingGetResponse = RankingAPI.RankingGetResponse; + export import RankingTopResponse = RankingAPI.RankingTopResponse; + export import RankingGetParams = RankingAPI.RankingGetParams; + export import RankingTopParams = RankingAPI.RankingTopParams; } diff --git a/src/resources/radar/ranking/timeseries-groups.ts b/src/resources/radar/ranking/timeseries-groups.ts deleted file mode 100644 index 88ec9f51e1..0000000000 --- a/src/resources/radar/ranking/timeseries-groups.ts +++ /dev/null @@ -1,131 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/ranking/timeseries-groups'; - -export class TimeseriesGroups extends APIResource { - /** - * Gets Domains Rank updates change over time. Raw values are returned. - */ - list( - query?: TimeseriesGroupListParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: TimeseriesGroupListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/ranking/timeseries_groups', { query, ...options }) as Core.APIPromise<{ - result: TimeseriesGroupListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface TimeseriesGroupListResponse { - meta: TimeseriesGroupListResponse.Meta; - - serie_0: TimeseriesGroupListResponse.Serie0; -} - -export namespace TimeseriesGroupListResponse { - export interface Meta { - dateRange: Array; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - } - - export interface Serie0 { - timestamps: Array; - [k: string]: Array; - } -} - -export interface TimeseriesGroupListParams { - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Array of comma separated list of domains names. - */ - domains?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limit the number of objects in the response. - */ - limit?: number; - - /** - * Array of locations (alpha-2 country codes). - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; - - /** - * The ranking type. - */ - rankingType?: 'POPULAR' | 'TRENDING_RISE' | 'TRENDING_STEADY'; -} - -export namespace TimeseriesGroups { - export import TimeseriesGroupListResponse = TimeseriesGroupsAPI.TimeseriesGroupListResponse; - export import TimeseriesGroupListParams = TimeseriesGroupsAPI.TimeseriesGroupListParams; -} diff --git a/src/resources/radar/searches/globals.ts b/src/resources/radar/search.ts similarity index 65% rename from src/resources/radar/searches/globals.ts rename to src/resources/radar/search.ts index 20beea973e..e889e668d2 100644 --- a/src/resources/radar/searches/globals.ts +++ b/src/resources/radar/search.ts @@ -2,26 +2,26 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as GlobalsAPI from 'cloudflare/resources/radar/searches/globals'; +import * as SearchAPI from 'cloudflare/resources/radar/search'; -export class Globals extends APIResource { +export class Search extends APIResource { /** * Lets you search for locations, autonomous systems (AS) and reports. */ - list(query: GlobalListParams, options?: Core.RequestOptions): Core.APIPromise { + global(query: SearchGlobalParams, options?: Core.RequestOptions): Core.APIPromise { return ( this._client.get('/radar/search/global', { query, ...options }) as Core.APIPromise<{ - result: GlobalListResponse; + result: SearchGlobalResponse; }> )._thenUnwrap((obj) => obj.result); } } -export interface GlobalListResponse { - search: Array; +export interface SearchGlobalResponse { + search: Array; } -export namespace GlobalListResponse { +export namespace SearchGlobalResponse { export interface Search { code: string; @@ -31,7 +31,7 @@ export namespace GlobalListResponse { } } -export interface GlobalListParams { +export interface SearchGlobalParams { /** * Search for locations, AS and reports. */ @@ -63,7 +63,7 @@ export interface GlobalListParams { limitPerGroup?: number; } -export namespace Globals { - export import GlobalListResponse = GlobalsAPI.GlobalListResponse; - export import GlobalListParams = GlobalsAPI.GlobalListParams; +export namespace Search { + export import SearchGlobalResponse = SearchAPI.SearchGlobalResponse; + export import SearchGlobalParams = SearchAPI.SearchGlobalParams; } diff --git a/src/resources/radar/searches/index.ts b/src/resources/radar/searches/index.ts deleted file mode 100644 index 32cacebc7b..0000000000 --- a/src/resources/radar/searches/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { GlobalListResponse, GlobalListParams, Globals } from './globals'; -export { Searches } from './searches'; diff --git a/src/resources/radar/searches/searches.ts b/src/resources/radar/searches/searches.ts deleted file mode 100644 index 1d3f1a44d0..0000000000 --- a/src/resources/radar/searches/searches.ts +++ /dev/null @@ -1,14 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import { APIResource } from 'cloudflare/resource'; -import * as GlobalsAPI from 'cloudflare/resources/radar/searches/globals'; - -export class Searches extends APIResource { - globals: GlobalsAPI.Globals = new GlobalsAPI.Globals(this._client); -} - -export namespace Searches { - export import Globals = GlobalsAPI.Globals; - export import GlobalListResponse = GlobalsAPI.GlobalListResponse; - export import GlobalListParams = GlobalsAPI.GlobalListParams; -} diff --git a/src/resources/radar/traffic-anomalies/index.ts b/src/resources/radar/traffic-anomalies/index.ts index b21a2fbc3d..2049ec8c15 100644 --- a/src/resources/radar/traffic-anomalies/index.ts +++ b/src/resources/radar/traffic-anomalies/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. -export { LocationListResponse, LocationListParams, Locations } from './locations'; -export { TrafficAnomalyListResponse, TrafficAnomalyListParams, TrafficAnomalies } from './traffic-anomalies'; +export { LocationGetResponse, LocationGetParams, Locations } from './locations'; +export { TrafficAnomalyGetResponse, TrafficAnomalyGetParams, TrafficAnomalies } from './traffic-anomalies'; diff --git a/src/resources/radar/traffic-anomalies/locations.ts b/src/resources/radar/traffic-anomalies/locations.ts index f7979f5667..349ad06180 100644 --- a/src/resources/radar/traffic-anomalies/locations.ts +++ b/src/resources/radar/traffic-anomalies/locations.ts @@ -11,28 +11,28 @@ export class Locations extends APIResource { * alerts are automatically detected by Radar and then manually verified by our * team. This endpoint returns the sum of alerts grouped by location. */ - list(query?: LocationListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: LocationListParams | Core.RequestOptions = {}, + get(query?: LocationGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(options?: Core.RequestOptions): Core.APIPromise; + get( + query: LocationGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.list({}, query); + return this.get({}, query); } return ( this._client.get('/radar/traffic_anomalies/locations', { query, ...options }) as Core.APIPromise<{ - result: LocationListResponse; + result: LocationGetResponse; }> )._thenUnwrap((obj) => obj.result); } } -export interface LocationListResponse { - trafficAnomalies: Array; +export interface LocationGetResponse { + trafficAnomalies: Array; } -export namespace LocationListResponse { +export namespace LocationGetResponse { export interface TrafficAnomaly { clientCountryAlpha2: string; @@ -42,7 +42,7 @@ export namespace LocationListResponse { } } -export interface LocationListParams { +export interface LocationGetParams { /** * End of the date range (inclusive). */ @@ -88,6 +88,6 @@ export interface LocationListParams { } export namespace Locations { - export import LocationListResponse = LocationsAPI.LocationListResponse; - export import LocationListParams = LocationsAPI.LocationListParams; + export import LocationGetResponse = LocationsAPI.LocationGetResponse; + export import LocationGetParams = LocationsAPI.LocationGetParams; } diff --git a/src/resources/radar/traffic-anomalies/traffic-anomalies.ts b/src/resources/radar/traffic-anomalies/traffic-anomalies.ts index b936803bb8..82c1d88853 100644 --- a/src/resources/radar/traffic-anomalies/traffic-anomalies.ts +++ b/src/resources/radar/traffic-anomalies/traffic-anomalies.ts @@ -14,31 +14,31 @@ export class TrafficAnomalies extends APIResource { * alerts are automatically detected by Radar and then manually verified by our * team. This endpoint returns the latest alerts. */ - list( - query?: TrafficAnomalyListParams, + get( + query?: TrafficAnomalyGetParams, options?: Core.RequestOptions, - ): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: TrafficAnomalyListParams | Core.RequestOptions = {}, + ): Core.APIPromise; + get(options?: Core.RequestOptions): Core.APIPromise; + get( + query: TrafficAnomalyGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.list({}, query); + return this.get({}, query); } return ( this._client.get('/radar/traffic_anomalies', { query, ...options }) as Core.APIPromise<{ - result: TrafficAnomalyListResponse; + result: TrafficAnomalyGetResponse; }> )._thenUnwrap((obj) => obj.result); } } -export interface TrafficAnomalyListResponse { - trafficAnomalies: Array; +export interface TrafficAnomalyGetResponse { + trafficAnomalies: Array; } -export namespace TrafficAnomalyListResponse { +export namespace TrafficAnomalyGetResponse { export interface TrafficAnomaly { startDate: string; @@ -82,7 +82,7 @@ export namespace TrafficAnomalyListResponse { } } -export interface TrafficAnomalyListParams { +export interface TrafficAnomalyGetParams { /** * Single ASN as integer. */ @@ -143,9 +143,9 @@ export interface TrafficAnomalyListParams { } export namespace TrafficAnomalies { - export import TrafficAnomalyListResponse = TrafficAnomaliesAPI.TrafficAnomalyListResponse; - export import TrafficAnomalyListParams = TrafficAnomaliesAPI.TrafficAnomalyListParams; + export import TrafficAnomalyGetResponse = TrafficAnomaliesAPI.TrafficAnomalyGetResponse; + export import TrafficAnomalyGetParams = TrafficAnomaliesAPI.TrafficAnomalyGetParams; export import Locations = LocationsAPI.Locations; - export import LocationListResponse = LocationsAPI.LocationListResponse; - export import LocationListParams = LocationsAPI.LocationListParams; + export import LocationGetResponse = LocationsAPI.LocationGetResponse; + export import LocationGetParams = LocationsAPI.LocationGetParams; } diff --git a/src/resources/radar/verified-bots/index.ts b/src/resources/radar/verified-bots/index.ts index 1e174593a3..08c02e41dd 100644 --- a/src/resources/radar/verified-bots/index.ts +++ b/src/resources/radar/verified-bots/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. -export { Tops } from './tops/index'; +export { TopBotsResponse, TopCategoriesResponse, TopBotsParams, TopCategoriesParams, Top } from './top'; export { VerifiedBots } from './verified-bots'; diff --git a/src/resources/radar/verified-bots/top.ts b/src/resources/radar/verified-bots/top.ts new file mode 100644 index 0000000000..65646f1deb --- /dev/null +++ b/src/resources/radar/verified-bots/top.ts @@ -0,0 +1,305 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as TopAPI from 'cloudflare/resources/radar/verified-bots/top'; + +export class Top extends APIResource { + /** + * Get top verified bots by HTTP requests, with owner and category. + */ + bots(query?: TopBotsParams, options?: Core.RequestOptions): Core.APIPromise; + bots(options?: Core.RequestOptions): Core.APIPromise; + bots( + query: TopBotsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.bots({}, query); + } + return ( + this._client.get('/radar/verified_bots/top/bots', { query, ...options }) as Core.APIPromise<{ + result: TopBotsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get top verified bot categories by HTTP requests, along with their corresponding + * percentage, over the total verified bot HTTP requests. + */ + categories( + query?: TopCategoriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + categories(options?: Core.RequestOptions): Core.APIPromise; + categories( + query: TopCategoriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.categories({}, query); + } + return ( + this._client.get('/radar/verified_bots/top/categories', { query, ...options }) as Core.APIPromise<{ + result: TopCategoriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TopBotsResponse { + meta: TopBotsResponse.Meta; + + top_0: Array; +} + +export namespace TopBotsResponse { + export interface Meta { + dateRange: Array; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + botCategory: string; + + botName: string; + + botOwner: string; + + value: string; + } +} + +export interface TopCategoriesResponse { + meta: TopCategoriesResponse.Meta; + + top_0: Array; +} + +export namespace TopCategoriesResponse { + export interface Meta { + dateRange: Array; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + botCategory: string; + + value: string; + } +} + +export interface TopBotsParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export interface TopCategoriesParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * 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< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export namespace Top { + export import TopBotsResponse = TopAPI.TopBotsResponse; + export import TopCategoriesResponse = TopAPI.TopCategoriesResponse; + export import TopBotsParams = TopAPI.TopBotsParams; + export import TopCategoriesParams = TopAPI.TopCategoriesParams; +} diff --git a/src/resources/radar/verified-bots/tops/categories.ts b/src/resources/radar/verified-bots/tops/categories.ts deleted file mode 100644 index d01bba2929..0000000000 --- a/src/resources/radar/verified-bots/tops/categories.ts +++ /dev/null @@ -1,155 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as CategoriesAPI from 'cloudflare/resources/radar/verified-bots/tops/categories'; - -export class Categories extends APIResource { - /** - * Get top verified bot categories by HTTP requests, along with their corresponding - * percentage, over the total verified bot HTTP requests. - */ - list(query?: CategoryListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: CategoryListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/verified_bots/top/categories', { query, ...options }) as Core.APIPromise<{ - result: CategoryListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface CategoryListResponse { - meta: CategoryListResponse.Meta; - - top_0: Array; -} - -export namespace CategoryListResponse { - export interface Meta { - dateRange: Array; - - confidenceInfo?: Meta.ConfidenceInfo; - } - - export namespace Meta { - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface ConfidenceInfo { - annotations?: Array; - - level?: number; - } - - export namespace ConfidenceInfo { - export interface Annotation { - dataSource: string; - - description: string; - - eventType: string; - - isInstantaneous: unknown; - - endTime?: string; - - linkedUrl?: string; - - startTime?: string; - } - } - } - - export interface Top0 { - botCategory: string; - - value: string; - } -} - -export interface CategoryListParams { - /** - * Array of comma separated list of ASNs, start with `-` to exclude from results. - * For example, `-174, 3356` excludes results from AS174, but includes results from - * AS3356. - */ - asn?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * 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< - | '1d' - | '2d' - | '7d' - | '14d' - | '28d' - | '12w' - | '24w' - | '52w' - | '1dControl' - | '2dControl' - | '7dControl' - | '14dControl' - | '28dControl' - | '12wControl' - | '24wControl' - >; - - /** - * Array of datetimes to filter the start of a series. - */ - dateStart?: Array; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limit the number of objects in the response. - */ - limit?: number; - - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - - /** - * Array of names that will be used to name the series in responses. - */ - name?: Array; -} - -export namespace Categories { - export import CategoryListResponse = CategoriesAPI.CategoryListResponse; - export import CategoryListParams = CategoriesAPI.CategoryListParams; -} diff --git a/src/resources/radar/verified-bots/tops/index.ts b/src/resources/radar/verified-bots/tops/index.ts deleted file mode 100644 index 0daed875d9..0000000000 --- a/src/resources/radar/verified-bots/tops/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { BotListResponse, BotListParams, Bots } from './bots'; -export { CategoryListResponse, CategoryListParams, Categories } from './categories'; -export { Tops } from './tops'; diff --git a/src/resources/radar/verified-bots/tops/tops.ts b/src/resources/radar/verified-bots/tops/tops.ts deleted file mode 100644 index 6a56fa4ab4..0000000000 --- a/src/resources/radar/verified-bots/tops/tops.ts +++ /dev/null @@ -1,19 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import { APIResource } from 'cloudflare/resource'; -import * as BotsAPI from 'cloudflare/resources/radar/verified-bots/tops/bots'; -import * as CategoriesAPI from 'cloudflare/resources/radar/verified-bots/tops/categories'; - -export class Tops extends APIResource { - bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); - categories: CategoriesAPI.Categories = new CategoriesAPI.Categories(this._client); -} - -export namespace Tops { - export import Bots = BotsAPI.Bots; - export import BotListResponse = BotsAPI.BotListResponse; - export import BotListParams = BotsAPI.BotListParams; - export import Categories = CategoriesAPI.Categories; - export import CategoryListResponse = CategoriesAPI.CategoryListResponse; - export import CategoryListParams = CategoriesAPI.CategoryListParams; -} diff --git a/src/resources/radar/verified-bots/verified-bots.ts b/src/resources/radar/verified-bots/verified-bots.ts index 4c4c8eee2b..9c32340c51 100644 --- a/src/resources/radar/verified-bots/verified-bots.ts +++ b/src/resources/radar/verified-bots/verified-bots.ts @@ -1,12 +1,16 @@ // File generated from our OpenAPI spec by Stainless. import { APIResource } from 'cloudflare/resource'; -import * as TopsAPI from 'cloudflare/resources/radar/verified-bots/tops/tops'; +import * as TopAPI from 'cloudflare/resources/radar/verified-bots/top'; export class VerifiedBots extends APIResource { - tops: TopsAPI.Tops = new TopsAPI.Tops(this._client); + top: TopAPI.Top = new TopAPI.Top(this._client); } export namespace VerifiedBots { - export import Tops = TopsAPI.Tops; + export import Top = TopAPI.Top; + export import TopBotsResponse = TopAPI.TopBotsResponse; + export import TopCategoriesResponse = TopAPI.TopCategoriesResponse; + export import TopBotsParams = TopAPI.TopBotsParams; + export import TopCategoriesParams = TopAPI.TopCategoriesParams; } diff --git a/src/resources/rulesets/index.ts b/src/resources/rulesets/index.ts index cab525c3b1..2fd243ccf1 100644 --- a/src/resources/rulesets/index.ts +++ b/src/resources/rulesets/index.ts @@ -1,11 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -export { PhaseGetResponse, Phases } from './phases'; +export { PhaseGetResponse, PhaseGetParams, Phases } from './phases'; export { RuleCreateResponse, RuleDeleteResponse, RuleEditResponse, RuleCreateParams, + RuleDeleteParams, RuleEditParams, Rules, } from './rules'; @@ -16,6 +17,16 @@ export { RulesetGetResponse, RulesetCreateParams, RulesetUpdateParams, + RulesetListParams, + RulesetDeleteParams, + RulesetGetParams, Rulesets, } from './rulesets'; -export { VersionListResponse, VersionGetResponse, Versions } from './versions/index'; +export { + VersionListResponse, + VersionGetResponse, + VersionListParams, + VersionDeleteParams, + VersionGetParams, + Versions, +} from './versions/index'; diff --git a/src/resources/rulesets/phases.ts b/src/resources/rulesets/phases.ts index 5b7f85b9e9..34d7bec435 100644 --- a/src/resources/rulesets/phases.ts +++ b/src/resources/rulesets/phases.ts @@ -10,8 +10,6 @@ export class Phases extends APIResource { * given phase. */ get( - accountOrZone: string, - accountOrZoneId: string, rulesetPhase: | 'ddos_l4' | 'ddos_l7' @@ -36,11 +34,13 @@ export class Phases extends APIResource { | 'magic_transit' | 'magic_transit_ids_managed' | 'magic_transit_managed', + params: PhaseGetParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( this._client.get( - `/${accountOrZone}/${accountOrZoneId}/rulesets/phases/${rulesetPhase}/entrypoint`, + `/${account_id}/${zone_id}/rulesets/phases/${rulesetPhase}/entrypoint`, options, ) as Core.APIPromise<{ result: PhaseGetResponse }> )._thenUnwrap((obj) => obj.result); @@ -611,6 +611,19 @@ export namespace PhaseGetResponse { } } +export interface PhaseGetParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + export namespace Phases { export import PhaseGetResponse = PhasesAPI.PhaseGetResponse; + export import PhaseGetParams = PhasesAPI.PhaseGetParams; } diff --git a/src/resources/rulesets/rules.ts b/src/resources/rulesets/rules.ts index 1812b410be..45bdf0745c 100644 --- a/src/resources/rulesets/rules.ts +++ b/src/resources/rulesets/rules.ts @@ -10,14 +10,13 @@ export class Rules extends APIResource { * of the existing list of rules in the ruleset by default. */ create( - accountOrZone: string, - accountOrZoneId: string, rulesetId: string, - body: RuleCreateParams, + params: RuleCreateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.post(`/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}/rules`, { + this._client.post(`/${account_id}/${zone_id}/rulesets/${rulesetId}/rules`, { body, ...options, }) as Core.APIPromise<{ result: RuleCreateResponse }> @@ -28,15 +27,15 @@ export class Rules extends APIResource { * Deletes an existing rule from an account or zone ruleset. */ delete( - accountOrZone: string, - accountOrZoneId: string, rulesetId: string, ruleId: string, + params: RuleDeleteParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( this._client.delete( - `/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}/rules/${ruleId}`, + `/${account_id}/${zone_id}/rulesets/${rulesetId}/rules/${ruleId}`, options, ) as Core.APIPromise<{ result: RuleDeleteResponse }> )._thenUnwrap((obj) => obj.result); @@ -1753,897 +1752,114 @@ export namespace RuleEditResponse { } } -export type RuleCreateParams = - | RuleCreateParams.RulesetsBlockRule - | RuleCreateParams.RulesetsExecuteRule - | RuleCreateParams.RulesetsLogRule - | RuleCreateParams.RulesetsSkipRule; - -export namespace RuleCreateParams { - export interface RulesetsBlockRule { - /** - * The unique ID of the rule. - */ - id?: string; - - /** - * The action to perform when the rule matches. - */ - action?: 'block'; - - /** - * The parameters configuring the rule's action. - */ - action_parameters?: RuleCreateParams.RulesetsBlockRule.ActionParameters; - - /** - * An informative description of the rule. - */ - description?: string; - - /** - * Whether the rule should be executed. - */ - enabled?: boolean; - - /** - * The expression defining which traffic will match the rule. - */ - expression?: string; - - /** - * An object configuring the rule's logging behavior. - */ - logging?: RuleCreateParams.RulesetsBlockRule.Logging; - - /** - * The reference of the rule (the rule ID by default). - */ - ref?: string; - } - - export namespace RulesetsBlockRule { - /** - * The parameters configuring the rule's action. - */ - export interface ActionParameters { - /** - * The response to show when the block is applied. - */ - response?: ActionParameters.Response; - } - - export namespace ActionParameters { - /** - * The response to show when the block is applied. - */ - export interface Response { - /** - * The content to return. - */ - content: string; - - /** - * The type of the content to return. - */ - content_type: string; - - /** - * The status code to return. - */ - status_code: number; - } - } - - /** - * An object configuring the rule's logging behavior. - */ - export interface Logging { - /** - * Whether to generate a log when the rule matches. - */ - enabled: boolean; - } - } - - export interface RulesetsExecuteRule { - /** - * The unique ID of the rule. - */ - id?: string; - - /** - * The action to perform when the rule matches. - */ - action?: 'execute'; - - /** - * The parameters configuring the rule's action. - */ - action_parameters?: RuleCreateParams.RulesetsExecuteRule.ActionParameters; - - /** - * An informative description of the rule. - */ - description?: string; - - /** - * Whether the rule should be executed. - */ - enabled?: boolean; - - /** - * The expression defining which traffic will match the rule. - */ - expression?: string; - - /** - * An object configuring the rule's logging behavior. - */ - logging?: RuleCreateParams.RulesetsExecuteRule.Logging; - - /** - * The reference of the rule (the rule ID by default). - */ - ref?: string; - } - - export namespace RulesetsExecuteRule { - /** - * The parameters configuring the rule's action. - */ - export interface ActionParameters { - /** - * The ID of the ruleset to execute. - */ - id: string; - - /** - * The configuration to use for matched data logging. - */ - matched_data?: ActionParameters.MatchedData; - - /** - * A set of overrides to apply to the target ruleset. - */ - overrides?: ActionParameters.Overrides; - } - - export namespace ActionParameters { - /** - * The configuration to use for matched data logging. - */ - export interface MatchedData { - /** - * The public key to encrypt matched data logs with. - */ - public_key: string; - } - - /** - * A set of overrides to apply to the target ruleset. - */ - export interface Overrides { - /** - * An action to override all rules with. This option has lower precedence than rule - * and category overrides. - */ - action?: string; - - /** - * A list of category-level overrides. This option has the second-highest - * precedence after rule-level overrides. - */ - categories?: Array; - - /** - * Whether to enable execution of all rules. This option has lower precedence than - * rule and category overrides. - */ - enabled?: boolean; - - /** - * A list of rule-level overrides. This option has the highest precedence. - */ - rules?: Array; - - /** - * A sensitivity level to set for all rules. This option has lower precedence than - * rule and category overrides and is only applicable for DDoS phases. - */ - sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff'; - } - - export namespace Overrides { - /** - * A category-level override - */ - export interface Category { - /** - * The name of the category to override. - */ - category: string; - - /** - * The action to override rules in the category with. - */ - action?: string; - - /** - * Whether to enable execution of rules in the category. - */ - enabled?: boolean; - - /** - * The sensitivity level to use for rules in the category. - */ - sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff'; - } - - /** - * A rule-level override - */ - export interface Rule { - /** - * The ID of the rule to override. - */ - id: string; - - /** - * The action to override the rule with. - */ - action?: string; - - /** - * Whether to enable execution of the rule. - */ - enabled?: boolean; - - /** - * The score threshold to use for the rule. - */ - score_threshold?: number; - - /** - * The sensitivity level to use for the rule. - */ - sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff'; - } - } - } - - /** - * An object configuring the rule's logging behavior. - */ - export interface Logging { - /** - * Whether to generate a log when the rule matches. - */ - enabled: boolean; - } - } - - export interface RulesetsLogRule { - /** - * The unique ID of the rule. - */ - id?: string; - - /** - * The action to perform when the rule matches. - */ - action?: 'log'; - - /** - * The parameters configuring the rule's action. - */ - action_parameters?: unknown; - - /** - * An informative description of the rule. - */ - description?: string; - - /** - * Whether the rule should be executed. - */ - enabled?: boolean; - - /** - * The expression defining which traffic will match the rule. - */ - expression?: string; - - /** - * An object configuring the rule's logging behavior. - */ - logging?: RuleCreateParams.RulesetsLogRule.Logging; - - /** - * The reference of the rule (the rule ID by default). - */ - ref?: string; - } - - export namespace RulesetsLogRule { - /** - * An object configuring the rule's logging behavior. - */ - export interface Logging { - /** - * Whether to generate a log when the rule matches. - */ - enabled: boolean; - } - } - - export interface RulesetsSkipRule { - /** - * The unique ID of the rule. - */ - id?: string; - - /** - * The action to perform when the rule matches. - */ - action?: 'skip'; - - /** - * The parameters configuring the rule's action. - */ - action_parameters?: RuleCreateParams.RulesetsSkipRule.ActionParameters; - - /** - * An informative description of the rule. - */ - description?: string; - - /** - * Whether the rule should be executed. - */ - enabled?: boolean; - - /** - * The expression defining which traffic will match the rule. - */ - expression?: string; - - /** - * An object configuring the rule's logging behavior. - */ - logging?: RuleCreateParams.RulesetsSkipRule.Logging; - - /** - * The reference of the rule (the rule ID by default). - */ - ref?: string; - } - - export namespace RulesetsSkipRule { - /** - * The parameters configuring the rule's action. - */ - export interface ActionParameters { - /** - * A list of phases to skip the execution of. This option is incompatible with the - * ruleset and rulesets options. - */ - phases?: Array< - | 'ddos_l4' - | 'ddos_l7' - | 'http_config_settings' - | 'http_custom_errors' - | 'http_log_custom_fields' - | 'http_ratelimit' - | 'http_request_cache_settings' - | 'http_request_dynamic_redirect' - | 'http_request_firewall_custom' - | 'http_request_firewall_managed' - | 'http_request_late_transform' - | 'http_request_origin' - | 'http_request_redirect' - | 'http_request_sanitize' - | 'http_request_sbfm' - | 'http_request_select_configuration' - | 'http_request_transform' - | 'http_response_compression' - | 'http_response_firewall_managed' - | 'http_response_headers_transform' - | 'magic_transit' - | 'magic_transit_ids_managed' - | 'magic_transit_managed' - >; - - /** - * A list of legacy security products to skip the execution of. - */ - products?: Array<'bic' | 'hot' | 'rateLimit' | 'securityLevel' | 'uaBlock' | 'waf' | 'zoneLockdown'>; - - /** - * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the - * execution of. This option is incompatible with the ruleset option. - */ - rules?: Record>; - - /** - * A ruleset to skip the execution of. This option is incompatible with the - * rulesets, rules and phases options. - */ - ruleset?: 'current'; - - /** - * A list of ruleset IDs to skip the execution of. This option is incompatible with - * the ruleset and phases options. - */ - rulesets?: Array; - } - - /** - * An object configuring the rule's logging behavior. - */ - export interface Logging { - /** - * Whether to generate a log when the rule matches. - */ - enabled: boolean; - } - } -} - -export type RuleEditParams = - | RuleEditParams.RulesetsBlockRule - | RuleEditParams.RulesetsExecuteRule - | RuleEditParams.RulesetsLogRule - | RuleEditParams.RulesetsSkipRule; - -export namespace RuleEditParams { - export interface RulesetsBlockRule { - /** - * Path param: The unique ID of the account. - */ - account_id: string; - - /** - * Body param: The unique ID of the rule. - */ - id?: string; - - /** - * Body param: The action to perform when the rule matches. - */ - action?: 'block'; - - /** - * Body param: The parameters configuring the rule's action. - */ - action_parameters?: RuleEditParams.RulesetsBlockRule.ActionParameters; - - /** - * Body param: An informative description of the rule. - */ - description?: string; - - /** - * Body param: Whether the rule should be executed. - */ - enabled?: boolean; - - /** - * Body param: The expression defining which traffic will match the rule. - */ - expression?: string; - - /** - * Body param: An object configuring the rule's logging behavior. - */ - logging?: RuleEditParams.RulesetsBlockRule.Logging; - - /** - * Body param: The reference of the rule (the rule ID by default). - */ - ref?: string; - } - - export namespace RulesetsBlockRule { - /** - * The parameters configuring the rule's action. - */ - export interface ActionParameters { - /** - * The response to show when the block is applied. - */ - response?: ActionParameters.Response; - } - - export namespace ActionParameters { - /** - * The response to show when the block is applied. - */ - export interface Response { - /** - * The content to return. - */ - content: string; - - /** - * The type of the content to return. - */ - content_type: string; - - /** - * The status code to return. - */ - status_code: number; - } - } - - /** - * An object configuring the rule's logging behavior. - */ - export interface Logging { - /** - * Whether to generate a log when the rule matches. - */ - enabled: boolean; - } - } - - export interface RulesetsExecuteRule { - /** - * Path param: The unique ID of the account. - */ - account_id: string; - - /** - * Body param: The unique ID of the rule. - */ - id?: string; - - /** - * Body param: The action to perform when the rule matches. - */ - action?: 'execute'; - - /** - * Body param: The parameters configuring the rule's action. - */ - action_parameters?: RuleEditParams.RulesetsExecuteRule.ActionParameters; - - /** - * Body param: An informative description of the rule. - */ - description?: string; - - /** - * Body param: Whether the rule should be executed. - */ - enabled?: boolean; - - /** - * Body param: The expression defining which traffic will match the rule. - */ - expression?: string; - - /** - * Body param: An object configuring the rule's logging behavior. - */ - logging?: RuleEditParams.RulesetsExecuteRule.Logging; - - /** - * Body param: The reference of the rule (the rule ID by default). - */ - ref?: string; - } - - export namespace RulesetsExecuteRule { - /** - * The parameters configuring the rule's action. - */ - export interface ActionParameters { - /** - * The ID of the ruleset to execute. - */ - id: string; - - /** - * The configuration to use for matched data logging. - */ - matched_data?: ActionParameters.MatchedData; - - /** - * A set of overrides to apply to the target ruleset. - */ - overrides?: ActionParameters.Overrides; - } - - export namespace ActionParameters { - /** - * The configuration to use for matched data logging. - */ - export interface MatchedData { - /** - * The public key to encrypt matched data logs with. - */ - public_key: string; - } - - /** - * A set of overrides to apply to the target ruleset. - */ - export interface Overrides { - /** - * An action to override all rules with. This option has lower precedence than rule - * and category overrides. - */ - action?: string; - - /** - * A list of category-level overrides. This option has the second-highest - * precedence after rule-level overrides. - */ - categories?: Array; - - /** - * Whether to enable execution of all rules. This option has lower precedence than - * rule and category overrides. - */ - enabled?: boolean; - - /** - * A list of rule-level overrides. This option has the highest precedence. - */ - rules?: Array; - - /** - * A sensitivity level to set for all rules. This option has lower precedence than - * rule and category overrides and is only applicable for DDoS phases. - */ - sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff'; - } - - export namespace Overrides { - /** - * A category-level override - */ - export interface Category { - /** - * The name of the category to override. - */ - category: string; - - /** - * The action to override rules in the category with. - */ - action?: string; - - /** - * Whether to enable execution of rules in the category. - */ - enabled?: boolean; - - /** - * The sensitivity level to use for rules in the category. - */ - sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff'; - } - - /** - * A rule-level override - */ - export interface Rule { - /** - * The ID of the rule to override. - */ - id: string; - - /** - * The action to override the rule with. - */ - action?: string; - - /** - * Whether to enable execution of the rule. - */ - enabled?: boolean; +export interface RuleCreateParams { + /** + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; - /** - * The score threshold to use for the rule. - */ - score_threshold?: number; + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; - /** - * The sensitivity level to use for the rule. - */ - sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff'; - } - } - } + /** + * Body param: An object configuring where the rule will be placed. + */ + position?: RuleCreateParams.Position | RuleCreateParams.Position | RuleCreateParams.Position; +} +export namespace RuleCreateParams { + /** + * An object configuring where the rule will be placed. + */ + export interface Position { /** - * An object configuring the rule's logging behavior. + * The ID of another rule to place the rule before. An empty value causes the rule + * to be placed at the top. */ - export interface Logging { - /** - * Whether to generate a log when the rule matches. - */ - enabled: boolean; - } + before?: string; } - export interface RulesetsLogRule { - /** - * Path param: The unique ID of the account. - */ - account_id: string; - - /** - * Body param: The unique ID of the rule. - */ - id?: string; - - /** - * Body param: The action to perform when the rule matches. - */ - action?: 'log'; - - /** - * Body param: The parameters configuring the rule's action. - */ - action_parameters?: unknown; - - /** - * Body param: An informative description of the rule. - */ - description?: string; - - /** - * Body param: Whether the rule should be executed. - */ - enabled?: boolean; - - /** - * Body param: The expression defining which traffic will match the rule. - */ - expression?: string; - - /** - * Body param: An object configuring the rule's logging behavior. - */ - logging?: RuleEditParams.RulesetsLogRule.Logging; - + /** + * An object configuring where the rule will be placed. + */ + export interface Position { /** - * Body param: The reference of the rule (the rule ID by default). + * The ID of another rule to place the rule after. An empty value causes the rule + * to be placed at the bottom. */ - ref?: string; + after?: string; } - export namespace RulesetsLogRule { + /** + * An object configuring where the rule will be placed. + */ + export interface Position { /** - * An object configuring the rule's logging behavior. + * An index at which to place the rule, where index 1 is the first rule. */ - export interface Logging { - /** - * Whether to generate a log when the rule matches. - */ - enabled: boolean; - } + index?: number; } +} - export interface RulesetsSkipRule { - /** - * Path param: The unique ID of the account. - */ - account_id: string; - - /** - * Body param: The unique ID of the rule. - */ - id?: string; - - /** - * Body param: The action to perform when the rule matches. - */ - action?: 'skip'; - - /** - * Body param: The parameters configuring the rule's action. - */ - action_parameters?: RuleEditParams.RulesetsSkipRule.ActionParameters; - - /** - * Body param: An informative description of the rule. - */ - description?: string; +export interface RuleDeleteParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; - /** - * Body param: Whether the rule should be executed. - */ - enabled?: boolean; + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} - /** - * Body param: The expression defining which traffic will match the rule. - */ - expression?: string; +export interface RuleEditParams { + /** + * Path param: The unique ID of the account. + */ + account_id: string; - /** - * Body param: An object configuring the rule's logging behavior. - */ - logging?: RuleEditParams.RulesetsSkipRule.Logging; + /** + * Body param: An object configuring where the rule will be placed. + */ + position?: RuleEditParams.Position | RuleEditParams.Position | RuleEditParams.Position; +} +export namespace RuleEditParams { + /** + * An object configuring where the rule will be placed. + */ + export interface Position { /** - * Body param: The reference of the rule (the rule ID by default). + * The ID of another rule to place the rule before. An empty value causes the rule + * to be placed at the top. */ - ref?: string; + before?: string; } - export namespace RulesetsSkipRule { + /** + * An object configuring where the rule will be placed. + */ + export interface Position { /** - * The parameters configuring the rule's action. + * The ID of another rule to place the rule after. An empty value causes the rule + * to be placed at the bottom. */ - export interface ActionParameters { - /** - * A list of phases to skip the execution of. This option is incompatible with the - * ruleset and rulesets options. - */ - phases?: Array< - | 'ddos_l4' - | 'ddos_l7' - | 'http_config_settings' - | 'http_custom_errors' - | 'http_log_custom_fields' - | 'http_ratelimit' - | 'http_request_cache_settings' - | 'http_request_dynamic_redirect' - | 'http_request_firewall_custom' - | 'http_request_firewall_managed' - | 'http_request_late_transform' - | 'http_request_origin' - | 'http_request_redirect' - | 'http_request_sanitize' - | 'http_request_sbfm' - | 'http_request_select_configuration' - | 'http_request_transform' - | 'http_response_compression' - | 'http_response_firewall_managed' - | 'http_response_headers_transform' - | 'magic_transit' - | 'magic_transit_ids_managed' - | 'magic_transit_managed' - >; - - /** - * A list of legacy security products to skip the execution of. - */ - products?: Array<'bic' | 'hot' | 'rateLimit' | 'securityLevel' | 'uaBlock' | 'waf' | 'zoneLockdown'>; - - /** - * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the - * execution of. This option is incompatible with the ruleset option. - */ - rules?: Record>; - - /** - * A ruleset to skip the execution of. This option is incompatible with the - * rulesets, rules and phases options. - */ - ruleset?: 'current'; - - /** - * A list of ruleset IDs to skip the execution of. This option is incompatible with - * the ruleset and phases options. - */ - rulesets?: Array; - } + after?: string; + } + /** + * An object configuring where the rule will be placed. + */ + export interface Position { /** - * An object configuring the rule's logging behavior. + * An index at which to place the rule, where index 1 is the first rule. */ - export interface Logging { - /** - * Whether to generate a log when the rule matches. - */ - enabled: boolean; - } + index?: number; } } @@ -2652,5 +1868,6 @@ export namespace Rules { export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; export import RuleEditResponse = RulesAPI.RuleEditResponse; export import RuleCreateParams = RulesAPI.RuleCreateParams; + export import RuleDeleteParams = RulesAPI.RuleDeleteParams; export import RuleEditParams = RulesAPI.RuleEditParams; } diff --git a/src/resources/rulesets/rulesets.ts b/src/resources/rulesets/rulesets.ts index 88b98eddd7..8ea9b2fa58 100644 --- a/src/resources/rulesets/rulesets.ts +++ b/src/resources/rulesets/rulesets.ts @@ -15,17 +15,12 @@ export class Rulesets extends APIResource { /** * Creates a ruleset. */ - create( - accountOrZone: string, - accountOrZoneId: string, - body: RulesetCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + create(params: RulesetCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.post(`/${accountOrZone}/${accountOrZoneId}/rulesets`, { - body, - ...options, - }) as Core.APIPromise<{ result: RulesetCreateResponse }> + this._client.post(`/${account_id}/${zone_id}/rulesets`, { body, ...options }) as Core.APIPromise<{ + result: RulesetCreateResponse; + }> )._thenUnwrap((obj) => obj.result); } @@ -33,14 +28,13 @@ export class Rulesets extends APIResource { * Updates an account or zone ruleset, creating a new version. */ update( - accountOrZone: string, - accountOrZoneId: string, rulesetId: string, - body: RulesetUpdateParams, + params: RulesetUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id, ...body } = params; return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}`, { + this._client.put(`/${account_id}/${zone_id}/rulesets/${rulesetId}`, { body, ...options, }) as Core.APIPromise<{ result: RulesetUpdateResponse }> @@ -50,13 +44,10 @@ export class Rulesets extends APIResource { /** * Fetches all rulesets. */ - list( - accountOrZone: string, - accountOrZoneId: string, - options?: Core.RequestOptions, - ): Core.APIPromise { + list(params: RulesetListParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.get(`/${accountOrZone}/${accountOrZoneId}/rulesets`, options) as Core.APIPromise<{ + this._client.get(`/${account_id}/${zone_id}/rulesets`, options) as Core.APIPromise<{ result: RulesetListResponse; }> )._thenUnwrap((obj) => obj.result); @@ -66,12 +57,12 @@ export class Rulesets extends APIResource { * Deletes all versions of an existing account or zone ruleset. */ delete( - accountOrZone: string, - accountOrZoneId: string, rulesetId: string, + params: RulesetDeleteParams, options?: Core.RequestOptions, ): Core.APIPromise { - return this._client.delete(`/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}`, { + const { account_id, zone_id } = params; + return this._client.delete(`/${account_id}/${zone_id}/rulesets/${rulesetId}`, { ...options, headers: { Accept: '*/*', ...options?.headers }, }); @@ -81,16 +72,15 @@ export class Rulesets extends APIResource { * Fetches the latest version of an account or zone ruleset. */ get( - accountOrZone: string, - accountOrZoneId: string, rulesetId: string, + params: RulesetGetParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( - this._client.get( - `/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}`, - options, - ) as Core.APIPromise<{ result: RulesetGetResponse }> + this._client.get(`/${account_id}/${zone_id}/rulesets/${rulesetId}`, options) as Core.APIPromise<{ + result: RulesetGetResponse; + }> )._thenUnwrap((obj) => obj.result); } } @@ -1859,17 +1849,29 @@ export namespace RulesetGetResponse { export interface RulesetCreateParams { /** - * The kind of the ruleset. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: The kind of the ruleset. */ kind: 'managed' | 'custom' | 'root' | 'zone'; /** - * The human-readable name of the ruleset. + * Body param: The human-readable name of the ruleset. */ name: string; /** - * The phase of the ruleset. + * Body param: The phase of the ruleset. */ phase: | 'ddos_l4' @@ -1897,7 +1899,7 @@ export interface RulesetCreateParams { | 'magic_transit_managed'; /** - * The list of rules in the ruleset. + * Body param: The list of rules in the ruleset. */ rules: Array< | RulesetCreateParams.RulesetsBlockRule @@ -1907,7 +1909,7 @@ export interface RulesetCreateParams { >; /** - * An informative description of the ruleset. + * Body param: An informative description of the ruleset. */ description?: string; } @@ -2345,12 +2347,24 @@ export namespace RulesetCreateParams { export interface RulesetUpdateParams { /** - * The unique ID of the ruleset. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id: string; + + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id: string; + + /** + * Body param: The unique ID of the ruleset. */ id: string; /** - * The list of rules in the ruleset. + * Body param: The list of rules in the ruleset. */ rules: Array< | RulesetUpdateParams.RulesetsBlockRule @@ -2360,22 +2374,22 @@ export interface RulesetUpdateParams { >; /** - * An informative description of the ruleset. + * Body param: An informative description of the ruleset. */ description?: string; /** - * The kind of the ruleset. + * Body param: The kind of the ruleset. */ kind?: 'managed' | 'custom' | 'root' | 'zone'; /** - * The human-readable name of the ruleset. + * Body param: The human-readable name of the ruleset. */ name?: string; /** - * The phase of the ruleset. + * Body param: The phase of the ruleset. */ phase?: | 'ddos_l4' @@ -2834,6 +2848,42 @@ export namespace RulesetUpdateParams { } } +export interface RulesetListParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + +export interface RulesetDeleteParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + +export interface RulesetGetParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + export namespace Rulesets { export import RulesetCreateResponse = RulesetsAPI.RulesetCreateResponse; export import RulesetUpdateResponse = RulesetsAPI.RulesetUpdateResponse; @@ -2841,15 +2891,23 @@ export namespace Rulesets { export import RulesetGetResponse = RulesetsAPI.RulesetGetResponse; export import RulesetCreateParams = RulesetsAPI.RulesetCreateParams; export import RulesetUpdateParams = RulesetsAPI.RulesetUpdateParams; + export import RulesetListParams = RulesetsAPI.RulesetListParams; + export import RulesetDeleteParams = RulesetsAPI.RulesetDeleteParams; + export import RulesetGetParams = RulesetsAPI.RulesetGetParams; export import Phases = PhasesAPI.Phases; export import PhaseGetResponse = PhasesAPI.PhaseGetResponse; + export import PhaseGetParams = PhasesAPI.PhaseGetParams; export import Rules = RulesAPI.Rules; export import RuleCreateResponse = RulesAPI.RuleCreateResponse; export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; export import RuleEditResponse = RulesAPI.RuleEditResponse; export import RuleCreateParams = RulesAPI.RuleCreateParams; + export import RuleDeleteParams = RulesAPI.RuleDeleteParams; export import RuleEditParams = RulesAPI.RuleEditParams; export import Versions = VersionsAPI.Versions; export import VersionListResponse = VersionsAPI.VersionListResponse; export import VersionGetResponse = VersionsAPI.VersionGetResponse; + export import VersionListParams = VersionsAPI.VersionListParams; + export import VersionDeleteParams = VersionsAPI.VersionDeleteParams; + export import VersionGetParams = VersionsAPI.VersionGetParams; } diff --git a/src/resources/rulesets/versions/index.ts b/src/resources/rulesets/versions/index.ts index 9e307820ce..88a443b95c 100644 --- a/src/resources/rulesets/versions/index.ts +++ b/src/resources/rulesets/versions/index.ts @@ -1,4 +1,11 @@ // File generated from our OpenAPI spec by Stainless. export { ByTagGetResponse, ByTags } from './by-tags'; -export { VersionListResponse, VersionGetResponse, Versions } from './versions'; +export { + VersionListResponse, + VersionGetResponse, + VersionListParams, + VersionDeleteParams, + VersionGetParams, + Versions, +} from './versions'; diff --git a/src/resources/rulesets/versions/versions.ts b/src/resources/rulesets/versions/versions.ts index 1792e6edc7..3e3a4fa28e 100644 --- a/src/resources/rulesets/versions/versions.ts +++ b/src/resources/rulesets/versions/versions.ts @@ -12,14 +12,14 @@ export class Versions extends APIResource { * Fetches the versions of an account or zone ruleset. */ list( - accountOrZone: string, - accountOrZoneId: string, rulesetId: string, + params: VersionListParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( this._client.get( - `/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}/versions`, + `/${account_id}/${zone_id}/rulesets/${rulesetId}/versions`, options, ) as Core.APIPromise<{ result: VersionListResponse }> )._thenUnwrap((obj) => obj.result); @@ -29,31 +29,31 @@ export class Versions extends APIResource { * Deletes an existing version of an account or zone ruleset. */ delete( - accountOrZone: string, - accountOrZoneId: string, rulesetId: string, rulesetVersion: string, + params: VersionDeleteParams, options?: Core.RequestOptions, ): Core.APIPromise { - return this._client.delete( - `/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}/versions/${rulesetVersion}`, - { ...options, headers: { Accept: '*/*', ...options?.headers } }, - ); + const { account_id, zone_id } = params; + return this._client.delete(`/${account_id}/${zone_id}/rulesets/${rulesetId}/versions/${rulesetVersion}`, { + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); } /** * Fetches a specific version of an account or zone ruleset. */ get( - accountOrZone: string, - accountOrZoneId: string, rulesetId: string, rulesetVersion: string, + params: VersionGetParams, options?: Core.RequestOptions, ): Core.APIPromise { + const { account_id, zone_id } = params; return ( this._client.get( - `/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}/versions/${rulesetVersion}`, + `/${account_id}/${zone_id}/rulesets/${rulesetId}/versions/${rulesetVersion}`, options, ) as Core.APIPromise<{ result: VersionGetResponse }> )._thenUnwrap((obj) => obj.result); @@ -694,9 +694,48 @@ export namespace VersionGetResponse { } } +export interface VersionListParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + +export interface VersionDeleteParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + +export interface VersionGetParams { + /** + * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + */ + account_id: string; + + /** + * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + */ + zone_id: string; +} + export namespace Versions { export import VersionListResponse = VersionsAPI.VersionListResponse; export import VersionGetResponse = VersionsAPI.VersionGetResponse; + export import VersionListParams = VersionsAPI.VersionListParams; + export import VersionDeleteParams = VersionsAPI.VersionDeleteParams; + export import VersionGetParams = VersionsAPI.VersionGetParams; export import ByTags = ByTagsAPI.ByTags; export import ByTagGetResponse = ByTagsAPI.ByTagGetResponse; } diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index 35acc75f96..174e5adf29 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -216,111 +216,183 @@ export namespace ScriptListResponse { } } -export type ScriptUpdateParams = ScriptUpdateParams.Variant0 | ScriptUpdateParams.Variant1; +export interface ScriptUpdateParams { + /** + * Query param: Rollback to provided deployment based on deployment ID. Request + * body will only parse a "message" part. You can learn more about deployments + * [here](https://developers.cloudflare.com/workers/platform/deployments/). + */ + rollback_to?: string; + + /** + * Body param: A module comprising a Worker script, often a javascript file. + * Multiple modules may be provided as separate named parts, but at least one + * module must be present and referenced in the metadata as `main_module` or + * `body_part` by part name. + */ + ''?: Array; + + /** + * Body param: Rollback message to be associated with this deployment. Only parsed + * when query param `"rollback_to"` is present. + */ + message?: string; + + /** + * Body param: JSON encoded metadata about the uploaded parts and Worker + * configuration. + */ + metadata?: ScriptUpdateParams.Metadata; +} export namespace ScriptUpdateParams { - export interface Variant0 { + /** + * JSON encoded metadata about the uploaded parts and Worker configuration. + */ + export interface Metadata { + /** + * List of bindings available to the worker. + */ + bindings?: Array; + + /** + * Name of the part in the multipart request that contains the script (e.g. the + * file adding a listener to the `fetch` event). Indicates a + * `service worker syntax` Worker. + */ + body_part?: string; + + /** + * Date indicating targeted support in the Workers runtime. Backwards incompatible + * fixes to the runtime following this date will not affect this Worker. + */ + compatibility_date?: string; + + /** + * Flags that enable or disable certain features in the Workers runtime. Used to + * enable upcoming features or opt in or out of specific changes not included in a + * `compatibility_date`. + */ + compatibility_flags?: Array; + + /** + * List of binding types to keep from previous_upload. + */ + keep_bindings?: Array; + /** - * Query param: Rollback to provided deployment based on deployment ID. Request - * body will only parse a "message" part. You can learn more about deployments - * [here](https://developers.cloudflare.com/workers/platform/deployments/). + * Whether Logpush is turned on for the Worker. + */ + logpush?: boolean; + + /** + * Name of the part in the multipart request that contains the main module (e.g. + * the file exporting a `fetch` handler). Indicates a `module syntax` Worker. */ - rollback_to?: string; + main_module?: string; /** - * Body param: A module comprising a Worker script, often a javascript file. - * Multiple modules may be provided as separate named parts, but at least one - * module must be present and referenced in the metadata as `main_module` or - * `body_part` by part name. + * Migrations to apply for Durable Objects associated with this Worker. */ - ''?: Array; + migrations?: Metadata.WorkersSingleStepMigrations | Metadata.WorkersSteppedMigrations; + + placement?: Metadata.Placement; /** - * Body param: JSON encoded metadata about the uploaded parts and Worker - * configuration. + * List of strings to use as tags for this Worker */ - metadata?: ScriptUpdateParams.Variant0.Metadata; + tags?: Array; + + /** + * List of Workers that will consume logs from the attached Worker. + */ + tail_consumers?: Array; + + /** + * Usage model to apply to invocations. + */ + usage_model?: 'bundled' | 'unbound'; + + /** + * Key-value pairs to use as tags for this version of this Worker + */ + version_tags?: unknown; } - export namespace Variant0 { + export namespace Metadata { /** - * JSON encoded metadata about the uploaded parts and Worker configuration. + * A single set of migrations to apply. */ - export interface Metadata { + export interface WorkersSingleStepMigrations { /** - * List of bindings available to the worker. + * A list of classes to delete Durable Object namespaces from. */ - bindings?: Array; + deleted_classes?: Array; /** - * Name of the part in the multipart request that contains the script (e.g. the - * file adding a listener to the `fetch` event). Indicates a - * `service worker syntax` Worker. + * A list of classes to create Durable Object namespaces from. */ - body_part?: string; + new_classes?: Array; /** - * Date indicating targeted support in the Workers runtime. Backwards incompatible - * fixes to the runtime following this date will not affect this Worker. + * Tag to set as the latest migration tag. */ - compatibility_date?: string; + new_tag?: string; /** - * Flags that enable or disable certain features in the Workers runtime. Used to - * enable upcoming features or opt in or out of specific changes not included in a - * `compatibility_date`. + * Tag used to verify against the latest migration tag for this Worker. If they + * don't match, the upload is rejected. */ - compatibility_flags?: Array; + old_tag?: string; /** - * List of binding types to keep from previous_upload. + * A list of classes with Durable Object namespaces that were renamed. */ - keep_bindings?: Array; + renamed_classes?: Array; /** - * Whether Logpush is turned on for the Worker. + * A list of transfers for Durable Object namespaces from a different Worker and + * class to a class defined in this Worker. */ - logpush?: boolean; + transferred_classes?: Array; + } - /** - * Name of the part in the multipart request that contains the main module (e.g. - * the file exporting a `fetch` handler). Indicates a `module syntax` Worker. - */ - main_module?: string; + export namespace WorkersSingleStepMigrations { + export interface RenamedClass { + from?: string; - /** - * Migrations to apply for Durable Objects associated with this Worker. - */ - migrations?: Metadata.WorkersSingleStepMigrations | Metadata.WorkersSteppedMigrations; + to?: string; + } - placement?: Metadata.Placement; + export interface TransferredClass { + from?: string; - /** - * List of strings to use as tags for this Worker - */ - tags?: Array; + from_script?: string; + to?: string; + } + } + + export interface WorkersSteppedMigrations { /** - * List of Workers that will consume logs from the attached Worker. + * Tag to set as the latest migration tag. */ - tail_consumers?: Array; + new_tag?: string; /** - * Usage model to apply to invocations. + * Tag used to verify against the latest migration tag for this Worker. If they + * don't match, the upload is rejected. */ - usage_model?: 'bundled' | 'unbound'; + old_tag?: string; /** - * Key-value pairs to use as tags for this version of this Worker + * Migrations to apply in order. */ - version_tags?: unknown; + steps?: Array; } - export namespace Metadata { - /** - * A single set of migrations to apply. - */ - export interface WorkersSingleStepMigrations { + export namespace WorkersSteppedMigrations { + export interface Step { /** * A list of classes to delete Durable Object namespaces from. */ @@ -331,30 +403,19 @@ export namespace ScriptUpdateParams { */ new_classes?: Array; - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - /** * A list of classes with Durable Object namespaces that were renamed. */ - renamed_classes?: Array; + renamed_classes?: Array; /** * A list of transfers for Durable Object namespaces from a different Worker and * class to a class defined in this Worker. */ - transferred_classes?: Array; + transferred_classes?: Array; } - export namespace WorkersSingleStepMigrations { + export namespace Step { export interface RenamedClass { from?: string; @@ -369,110 +430,36 @@ export namespace ScriptUpdateParams { to?: string; } } + } - export interface WorkersSteppedMigrations { - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - - /** - * Migrations to apply in order. - */ - steps?: Array; - } - - export namespace WorkersSteppedMigrations { - export interface Step { - /** - * A list of classes to delete Durable Object namespaces from. - */ - deleted_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces from. - */ - new_classes?: Array; - - /** - * A list of classes with Durable Object namespaces that were renamed. - */ - renamed_classes?: Array; - - /** - * A list of transfers for Durable Object namespaces from a different Worker and - * class to a class defined in this Worker. - */ - transferred_classes?: Array; - } - - export namespace Step { - export interface RenamedClass { - from?: string; - - to?: string; - } - - export interface TransferredClass { - from?: string; - - from_script?: string; - - to?: string; - } - } - } - - export interface Placement { - /** - * Enables - * [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - * Only `"smart"` is currently supported - */ - mode?: 'smart'; - } - + export interface Placement { /** - * A reference to a script that will consume logs from the attached Worker. + * Enables + * [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + * Only `"smart"` is currently supported */ - export interface TailConsumer { - /** - * Name of Worker that is to be the consumer. - */ - service: string; - - /** - * Optional environment if the Worker utilizes one. - */ - environment?: string; - - /** - * Optional dispatch namespace the script belongs to. - */ - namespace?: string; - } + mode?: 'smart'; } - } - export interface Variant1 { /** - * Query param: Rollback to provided deployment based on deployment ID. Request - * body will only parse a "message" part. You can learn more about deployments - * [here](https://developers.cloudflare.com/workers/platform/deployments/). + * A reference to a script that will consume logs from the attached Worker. */ - rollback_to?: string; + export interface TailConsumer { + /** + * Name of Worker that is to be the consumer. + */ + service: string; - /** - * Body param: Rollback message to be associated with this deployment. Only parsed - * when query param `"rollback_to"` is present. - */ - message?: string; + /** + * Optional environment if the Worker utilizes one. + */ + environment?: string; + + /** + * Optional dispatch namespace the script belongs to. + */ + namespace?: string; + } } } diff --git a/tests/api-resources/access/applications/applications.test.ts b/tests/api-resources/access/applications/applications.test.ts index 893de62aaa..5b2291c6e5 100644 --- a/tests/api-resources/access/applications/applications.test.ts +++ b/tests/api-resources/access/applications/applications.test.ts @@ -5,20 +5,20 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource applications', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.access.applications.create( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { domain: 'test.example.com/admin', type: 'self_hosted' }, - ); + const responsePromise = cloudflare.access.applications.create({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -30,61 +30,74 @@ describe('resource applications', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.access.applications.create( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { - domain: 'test.example.com/admin', - type: 'self_hosted', - allow_authenticate_via_warp: true, - allowed_idps: [ - '699d98642c564d2e855e9661899b7252', - '699d98642c564d2e855e9661899b7252', - '699d98642c564d2e855e9661899b7252', - ], - app_launcher_visible: true, - auto_redirect_to_identity: true, - cors_headers: { - allow_all_headers: true, - allow_all_methods: true, - allow_all_origins: true, - allow_credentials: true, - allowed_headers: [{}, {}, {}], - allowed_methods: ['GET'], - allowed_origins: ['https://example.com'], - max_age: -1, + const response = await cloudflare.access.applications.create({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + allow_authenticate_via_warp: true, + allowed_idps: [ + '699d98642c564d2e855e9661899b7252', + '699d98642c564d2e855e9661899b7252', + '699d98642c564d2e855e9661899b7252', + ], + app_launcher_visible: {}, + auto_redirect_to_identity: true, + cors_headers: { + allow_all_headers: true, + allow_all_methods: true, + allow_all_origins: true, + allow_credentials: true, + allowed_headers: [{}, {}, {}], + allowed_methods: ['GET'], + allowed_origins: ['https://example.com'], + max_age: -1, + }, + custom_deny_message: 'string', + custom_deny_url: 'string', + custom_non_identity_deny_url: 'string', + custom_pages: [ + '699d98642c564d2e855e9661899b7252', + '699d98642c564d2e855e9661899b7252', + '699d98642c564d2e855e9661899b7252', + ], + domain: 'https://mybookmark.com', + enable_binding_cookie: true, + http_only_cookie_attribute: true, + logo_url: 'https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg', + name: 'Admin Site', + path_cookie_attribute: true, + saas_app: { + auth_type: 'saml', + consumer_service_url: 'https://example.com', + custom_attributes: { + name: 'family_name', + name_format: 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic', + source: { name: 'last_name' }, }, - custom_deny_message: 'string', - custom_deny_url: 'string', - custom_non_identity_deny_url: 'string', - custom_pages: [ - '699d98642c564d2e855e9661899b7252', - '699d98642c564d2e855e9661899b7252', - '699d98642c564d2e855e9661899b7252', - ], - enable_binding_cookie: true, - http_only_cookie_attribute: true, - logo_url: 'https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg', - name: 'Admin Site', - path_cookie_attribute: true, - same_site_cookie_attribute: 'strict', - self_hosted_domains: ['test.example.com/admin', 'test.anotherexample.com/staff'], - service_auth_401_redirect: true, - session_duration: '24h', - skip_interstitial: true, - tags: ['engineers', 'engineers', 'engineers'], + default_relay_state: 'https://example.com', + idp_entity_id: 'https://example.cloudflareaccess.com', + name_id_format: 'id', + name_id_transform_jsonata: "$substringBefore(email, '@') & '+sandbox@' & $substringAfter(email, '@')", + public_key: 'example unique name', + sp_entity_id: 'example unique name', + sso_endpoint: + 'https://example.cloudflareaccess.com/cdn-cgi/access/sso/saml/b3f58a2b414e0b51d45c8c2af26fccca0e27c63763c426fa52f98dcf0b3b3bfd', }, - ); + same_site_cookie_attribute: 'strict', + self_hosted_domains: ['test.example.com/admin', 'test.anotherexample.com/staff'], + service_auth_401_redirect: true, + session_duration: '24h', + skip_interstitial: true, + tags: ['engineers', 'engineers', 'engineers'], + type: 'bookmark', + }); }); // skipped: tests are disabled for the time being test.skip('update: only required params', async () => { - const responsePromise = cloudflare.access.applications.update( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { domain: 'test.example.com/admin', type: 'self_hosted' }, - ); + const responsePromise = cloudflare.access.applications.update('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -96,57 +109,74 @@ describe('resource applications', () => { // skipped: tests are disabled for the time being test.skip('update: required and optional params', async () => { - const response = await cloudflare.access.applications.update( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { - domain: 'test.example.com/admin', - type: 'self_hosted', - allow_authenticate_via_warp: true, - allowed_idps: [ - '699d98642c564d2e855e9661899b7252', - '699d98642c564d2e855e9661899b7252', - '699d98642c564d2e855e9661899b7252', - ], - app_launcher_visible: true, - auto_redirect_to_identity: true, - cors_headers: { - allow_all_headers: true, - allow_all_methods: true, - allow_all_origins: true, - allow_credentials: true, - allowed_headers: [{}, {}, {}], - allowed_methods: ['GET'], - allowed_origins: ['https://example.com'], - max_age: -1, + const response = await cloudflare.access.applications.update('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + allow_authenticate_via_warp: true, + allowed_idps: [ + '699d98642c564d2e855e9661899b7252', + '699d98642c564d2e855e9661899b7252', + '699d98642c564d2e855e9661899b7252', + ], + app_launcher_visible: {}, + auto_redirect_to_identity: true, + cors_headers: { + allow_all_headers: true, + allow_all_methods: true, + allow_all_origins: true, + allow_credentials: true, + allowed_headers: [{}, {}, {}], + allowed_methods: ['GET'], + allowed_origins: ['https://example.com'], + max_age: -1, + }, + custom_deny_message: 'string', + custom_deny_url: 'string', + custom_non_identity_deny_url: 'string', + custom_pages: [ + '699d98642c564d2e855e9661899b7252', + '699d98642c564d2e855e9661899b7252', + '699d98642c564d2e855e9661899b7252', + ], + domain: 'https://mybookmark.com', + enable_binding_cookie: true, + http_only_cookie_attribute: true, + logo_url: 'https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg', + name: 'Admin Site', + path_cookie_attribute: true, + saas_app: { + auth_type: 'saml', + consumer_service_url: 'https://example.com', + custom_attributes: { + name: 'family_name', + name_format: 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic', + source: { name: 'last_name' }, }, - custom_deny_message: 'string', - custom_deny_url: 'string', - custom_non_identity_deny_url: 'string', - custom_pages: [ - '699d98642c564d2e855e9661899b7252', - '699d98642c564d2e855e9661899b7252', - '699d98642c564d2e855e9661899b7252', - ], - enable_binding_cookie: true, - http_only_cookie_attribute: true, - logo_url: 'https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg', - name: 'Admin Site', - path_cookie_attribute: true, - same_site_cookie_attribute: 'strict', - self_hosted_domains: ['test.example.com/admin', 'test.anotherexample.com/staff'], - service_auth_401_redirect: true, - session_duration: '24h', - skip_interstitial: true, - tags: ['engineers', 'engineers', 'engineers'], + default_relay_state: 'https://example.com', + idp_entity_id: 'https://example.cloudflareaccess.com', + name_id_format: 'id', + name_id_transform_jsonata: "$substringBefore(email, '@') & '+sandbox@' & $substringAfter(email, '@')", + public_key: 'example unique name', + sp_entity_id: 'example unique name', + sso_endpoint: + 'https://example.cloudflareaccess.com/cdn-cgi/access/sso/saml/b3f58a2b414e0b51d45c8c2af26fccca0e27c63763c426fa52f98dcf0b3b3bfd', }, - ); + same_site_cookie_attribute: 'strict', + self_hosted_domains: ['test.example.com/admin', 'test.anotherexample.com/staff'], + service_auth_401_redirect: true, + session_duration: '24h', + skip_interstitial: true, + tags: ['engineers', 'engineers', 'engineers'], + type: 'bookmark', + }); }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.access.applications.list('string', '023e105f4ecef8ad9ca31a8372d0c353'); + test.skip('list: only required params', async () => { + const responsePromise = cloudflare.access.applications.list({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -157,22 +187,19 @@ describe('resource applications', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.applications.list('string', '023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('list: required and optional params', async () => { + const response = await cloudflare.access.applications.list({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.access.applications.delete( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - ); + test.skip('delete: only required params', async () => { + const responsePromise = cloudflare.access.applications.delete('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -183,25 +210,19 @@ describe('resource applications', () => { }); // skipped: tests are disabled for the time being - test.skip('delete: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.applications.delete( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('delete: required and optional params', async () => { + const response = await cloudflare.access.applications.delete('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.access.applications.get( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - ); + test.skip('get: only required params', async () => { + const responsePromise = cloudflare.access.applications.get('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -212,25 +233,19 @@ describe('resource applications', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.applications.get( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('get: required and optional params', async () => { + const response = await cloudflare.access.applications.get('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // skipped: tests are disabled for the time being - test.skip('revokeTokens', async () => { - const responsePromise = cloudflare.access.applications.revokeTokens( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - ); + test.skip('revokeTokens: only required params', async () => { + const responsePromise = cloudflare.access.applications.revokeTokens('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -241,15 +256,10 @@ describe('resource applications', () => { }); // skipped: tests are disabled for the time being - test.skip('revokeTokens: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.applications.revokeTokens( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('revokeTokens: required and optional params', async () => { + const response = await cloudflare.access.applications.revokeTokens('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); }); diff --git a/tests/api-resources/access/applications/cas.test.ts b/tests/api-resources/access/applications/cas.test.ts index 89a43c5e02..e01261a1d2 100644 --- a/tests/api-resources/access/applications/cas.test.ts +++ b/tests/api-resources/access/applications/cas.test.ts @@ -5,19 +5,19 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource cas', () => { // skipped: tests are disabled for the time being - test.skip('create', async () => { + test.skip('create: only required params', async () => { const responsePromise = cloudflare.access.applications.cas.create( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: 'string', zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -29,24 +29,19 @@ describe('resource cas', () => { }); // skipped: tests are disabled for the time being - test.skip('create: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.applications.cas.create( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('create: required and optional params', async () => { + const response = await cloudflare.access.applications.cas.create('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.access.applications.cas.list( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - ); + test.skip('list: only required params', async () => { + const responsePromise = cloudflare.access.applications.cas.list({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -57,21 +52,18 @@ describe('resource cas', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.applications.cas.list('string', '023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('list: required and optional params', async () => { + const response = await cloudflare.access.applications.cas.list({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // skipped: tests are disabled for the time being - test.skip('delete', async () => { + test.skip('delete: only required params', async () => { const responsePromise = cloudflare.access.applications.cas.delete( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: 'string', zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -83,25 +75,19 @@ describe('resource cas', () => { }); // skipped: tests are disabled for the time being - test.skip('delete: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.applications.cas.delete( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('delete: required and optional params', async () => { + const response = await cloudflare.access.applications.cas.delete('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.access.applications.cas.get( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - ); + test.skip('get: only required params', async () => { + const responsePromise = cloudflare.access.applications.cas.get('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -112,15 +98,10 @@ describe('resource cas', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.applications.cas.get( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('get: required and optional params', async () => { + const response = await cloudflare.access.applications.cas.get('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); }); diff --git a/tests/api-resources/access/applications/policies.test.ts b/tests/api-resources/access/applications/policies.test.ts index d2b775a677..205c5a5a62 100644 --- a/tests/api-resources/access/applications/policies.test.ts +++ b/tests/api-resources/access/applications/policies.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); @@ -15,10 +16,10 @@ describe('resource policies', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { const responsePromise = cloudflare.access.applications.policies.create( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', decision: 'allow', include: [ { email: { email: 'test@example.com' } }, @@ -40,10 +41,10 @@ describe('resource policies', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { const response = await cloudflare.access.applications.policies.create( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', decision: 'allow', include: [ { email: { email: 'test@example.com' } }, @@ -86,11 +87,11 @@ describe('resource policies', () => { // skipped: tests are disabled for the time being test.skip('update: only required params', async () => { const responsePromise = cloudflare.access.applications.policies.update( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', decision: 'allow', include: [ { email: { email: 'test@example.com' } }, @@ -112,11 +113,11 @@ describe('resource policies', () => { // skipped: tests are disabled for the time being test.skip('update: required and optional params', async () => { const response = await cloudflare.access.applications.policies.update( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', decision: 'allow', include: [ { email: { email: 'test@example.com' } }, @@ -157,11 +158,10 @@ describe('resource policies', () => { }); // skipped: tests are disabled for the time being - test.skip('list', async () => { + test.skip('list: only required params', async () => { const responsePromise = cloudflare.access.applications.policies.list( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: 'string', zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -173,25 +173,19 @@ describe('resource policies', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.applications.policies.list( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('list: required and optional params', async () => { + const response = await cloudflare.access.applications.policies.list( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: 'string', zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); }); // skipped: tests are disabled for the time being - test.skip('delete', async () => { + test.skip('delete: only required params', async () => { const responsePromise = cloudflare.access.applications.policies.delete( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: 'string', zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -203,26 +197,20 @@ describe('resource policies', () => { }); // skipped: tests are disabled for the time being - test.skip('delete: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.applications.policies.delete( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('delete: required and optional params', async () => { + const response = await cloudflare.access.applications.policies.delete( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: 'string', zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); }); // skipped: tests are disabled for the time being - test.skip('get', async () => { + test.skip('get: only required params', async () => { const responsePromise = cloudflare.access.applications.policies.get( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: 'string', zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -234,16 +222,11 @@ describe('resource policies', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.applications.policies.get( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('get: required and optional params', async () => { + const response = await cloudflare.access.applications.policies.get( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: 'string', zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); }); }); diff --git a/tests/api-resources/access/applications/user-policy-checks.test.ts b/tests/api-resources/access/applications/user-policy-checks.test.ts index 084e8d62bd..1c82859561 100644 --- a/tests/api-resources/access/applications/user-policy-checks.test.ts +++ b/tests/api-resources/access/applications/user-policy-checks.test.ts @@ -5,19 +5,19 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource userPolicyChecks', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { + test.skip('list: only required params', async () => { const responsePromise = cloudflare.access.applications.userPolicyChecks.list( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', + { account_id: 'string', zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -29,15 +29,10 @@ describe('resource userPolicyChecks', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.applications.userPolicyChecks.list( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('list: required and optional params', async () => { + const response = await cloudflare.access.applications.userPolicyChecks.list( + '023e105f4ecef8ad9ca31a8372d0c353', + { account_id: 'string', zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); }); }); diff --git a/tests/api-resources/access/bookmarks.test.ts b/tests/api-resources/access/bookmarks.test.ts index fbcec33675..5b6fc5c03d 100644 --- a/tests/api-resources/access/bookmarks.test.ts +++ b/tests/api-resources/access/bookmarks.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/access/certificates/certificates.test.ts b/tests/api-resources/access/certificates/certificates.test.ts index 817ac66ece..340fe0a421 100644 --- a/tests/api-resources/access/certificates/certificates.test.ts +++ b/tests/api-resources/access/certificates/certificates.test.ts @@ -5,24 +5,23 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource certificates', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.access.certificates.create( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { - certificate: - '-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----', - name: 'Allow devs', - }, - ); + const responsePromise = cloudflare.access.certificates.create({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + certificate: + '-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----', + name: 'Allow devs', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -34,26 +33,23 @@ describe('resource certificates', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.access.certificates.create( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { - certificate: - '-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----', - name: 'Allow devs', - associated_hostnames: ['admin.example.com', 'admin.example.com', 'admin.example.com'], - }, - ); + const response = await cloudflare.access.certificates.create({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + certificate: + '-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----', + name: 'Allow devs', + associated_hostnames: ['admin.example.com', 'admin.example.com', 'admin.example.com'], + }); }); // skipped: tests are disabled for the time being test.skip('update: only required params', async () => { - const responsePromise = cloudflare.access.certificates.update( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { associated_hostnames: ['admin.example.com', 'admin.example.com', 'admin.example.com'] }, - ); + const responsePromise = cloudflare.access.certificates.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + associated_hostnames: ['admin.example.com', 'admin.example.com', 'admin.example.com'], + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -65,20 +61,20 @@ describe('resource certificates', () => { // skipped: tests are disabled for the time being test.skip('update: required and optional params', async () => { - const response = await cloudflare.access.certificates.update( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { - associated_hostnames: ['admin.example.com', 'admin.example.com', 'admin.example.com'], - name: 'Allow devs', - }, - ); + const response = await cloudflare.access.certificates.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + associated_hostnames: ['admin.example.com', 'admin.example.com', 'admin.example.com'], + name: 'Allow devs', + }); }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.access.certificates.list('string', '023e105f4ecef8ad9ca31a8372d0c353'); + test.skip('list: only required params', async () => { + const responsePromise = cloudflare.access.certificates.list({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -89,22 +85,19 @@ describe('resource certificates', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.certificates.list('string', '023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('list: required and optional params', async () => { + const response = await cloudflare.access.certificates.list({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.access.certificates.delete( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - ); + test.skip('delete: only required params', async () => { + const responsePromise = cloudflare.access.certificates.delete('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -115,25 +108,19 @@ describe('resource certificates', () => { }); // skipped: tests are disabled for the time being - test.skip('delete: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.certificates.delete( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('delete: required and optional params', async () => { + const response = await cloudflare.access.certificates.delete('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.access.certificates.get( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - ); + test.skip('get: only required params', async () => { + const responsePromise = cloudflare.access.certificates.get('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -144,15 +131,10 @@ describe('resource certificates', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.certificates.get( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('get: required and optional params', async () => { + const response = await cloudflare.access.certificates.get('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); }); diff --git a/tests/api-resources/access/certificates/settings.test.ts b/tests/api-resources/access/certificates/settings.test.ts index ae98a9ee86..3875c04d85 100644 --- a/tests/api-resources/access/certificates/settings.test.ts +++ b/tests/api-resources/access/certificates/settings.test.ts @@ -5,26 +5,25 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource settings', () => { // skipped: tests are disabled for the time being test.skip('update: only required params', async () => { - const responsePromise = cloudflare.access.certificates.settings.update( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { - settings: [ - { china_network: false, client_certificate_forwarding: true, hostname: 'admin.example.com' }, - { china_network: false, client_certificate_forwarding: true, hostname: 'admin.example.com' }, - { china_network: false, client_certificate_forwarding: true, hostname: 'admin.example.com' }, - ], - }, - ); + const responsePromise = cloudflare.access.certificates.settings.update({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + settings: [ + { china_network: false, client_certificate_forwarding: true, hostname: 'admin.example.com' }, + { china_network: false, client_certificate_forwarding: true, hostname: 'admin.example.com' }, + { china_network: false, client_certificate_forwarding: true, hostname: 'admin.example.com' }, + ], + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -36,25 +35,23 @@ describe('resource settings', () => { // skipped: tests are disabled for the time being test.skip('update: required and optional params', async () => { - const response = await cloudflare.access.certificates.settings.update( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { - settings: [ - { china_network: false, client_certificate_forwarding: true, hostname: 'admin.example.com' }, - { china_network: false, client_certificate_forwarding: true, hostname: 'admin.example.com' }, - { china_network: false, client_certificate_forwarding: true, hostname: 'admin.example.com' }, - ], - }, - ); + const response = await cloudflare.access.certificates.settings.update({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + settings: [ + { china_network: false, client_certificate_forwarding: true, hostname: 'admin.example.com' }, + { china_network: false, client_certificate_forwarding: true, hostname: 'admin.example.com' }, + { china_network: false, client_certificate_forwarding: true, hostname: 'admin.example.com' }, + ], + }); }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.access.certificates.settings.list( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - ); + test.skip('list: only required params', async () => { + const responsePromise = cloudflare.access.certificates.settings.list({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -65,12 +62,10 @@ describe('resource settings', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.certificates.settings.list('string', '023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('list: required and optional params', async () => { + const response = await cloudflare.access.certificates.settings.list({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); }); diff --git a/tests/api-resources/access/custom-pages.test.ts b/tests/api-resources/access/custom-pages.test.ts index 4926b9fe33..360ce5132b 100644 --- a/tests/api-resources/access/custom-pages.test.ts +++ b/tests/api-resources/access/custom-pages.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/access/groups.test.ts b/tests/api-resources/access/groups.test.ts index b287d87163..755f276514 100644 --- a/tests/api-resources/access/groups.test.ts +++ b/tests/api-resources/access/groups.test.ts @@ -5,16 +5,19 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource groups', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.access.groups.create('string', '023e105f4ecef8ad9ca31a8372d0c353', { + const responsePromise = cloudflare.access.groups.create({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', include: [ { email: { email: 'test@example.com' } }, { email: { email: 'test@example.com' } }, @@ -33,7 +36,9 @@ describe('resource groups', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.access.groups.create('string', '023e105f4ecef8ad9ca31a8372d0c353', { + const response = await cloudflare.access.groups.create({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', include: [ { email: { email: 'test@example.com' } }, { email: { email: 'test@example.com' } }, @@ -56,19 +61,16 @@ describe('resource groups', () => { // skipped: tests are disabled for the time being test.skip('update: only required params', async () => { - const responsePromise = cloudflare.access.groups.update( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { - include: [ - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - ], - name: 'Allow devs', - }, - ); + const responsePromise = cloudflare.access.groups.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + include: [ + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + ], + name: 'Allow devs', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -80,35 +82,35 @@ describe('resource groups', () => { // skipped: tests are disabled for the time being test.skip('update: required and optional params', async () => { - const response = await cloudflare.access.groups.update( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { - include: [ - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - ], - name: 'Allow devs', - exclude: [ - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - ], - is_default: true, - require: [ - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - ], - }, - ); + const response = await cloudflare.access.groups.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + include: [ + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + ], + name: 'Allow devs', + exclude: [ + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + ], + is_default: true, + require: [ + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + ], + }); }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.access.groups.list('string', '023e105f4ecef8ad9ca31a8372d0c353'); + test.skip('list: only required params', async () => { + const responsePromise = cloudflare.access.groups.list({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -119,22 +121,19 @@ describe('resource groups', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.groups.list('string', '023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('list: required and optional params', async () => { + const response = await cloudflare.access.groups.list({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.access.groups.delete( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - ); + test.skip('delete: only required params', async () => { + const responsePromise = cloudflare.access.groups.delete('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -145,25 +144,19 @@ describe('resource groups', () => { }); // skipped: tests are disabled for the time being - test.skip('delete: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.groups.delete( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('delete: required and optional params', async () => { + const response = await cloudflare.access.groups.delete('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.access.groups.get( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - ); + test.skip('get: only required params', async () => { + const responsePromise = cloudflare.access.groups.get('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -174,15 +167,10 @@ describe('resource groups', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.groups.get( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('get: required and optional params', async () => { + const response = await cloudflare.access.groups.get('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); }); diff --git a/tests/api-resources/access/identity-providers.test.ts b/tests/api-resources/access/identity-providers.test.ts index 00d59dda49..b3b9733748 100644 --- a/tests/api-resources/access/identity-providers.test.ts +++ b/tests/api-resources/access/identity-providers.test.ts @@ -5,20 +5,23 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource identityProviders', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.access.identityProviders.create( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { config: {}, name: 'Widget Corps IDP', type: 'onetimepin' }, - ); + const responsePromise = cloudflare.access.identityProviders.create({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + config: {}, + name: 'Widget Corps IDP', + type: 'onetimepin', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -30,39 +33,63 @@ describe('resource identityProviders', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.access.identityProviders.create( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { - config: { - client_id: '', - client_secret: '', - claims: ['email_verified', 'preferred_username', 'custom_claim_name'], - email_claim_name: 'custom_claim_name', - conditional_access_enabled: true, - directory_id: '', - support_groups: true, - }, - name: 'Widget Corps IDP', - type: 'onetimepin', - scim_config: { - enabled: true, - group_member_deprovision: true, - seat_deprovision: true, - secret: 'string', - user_deprovision: true, - }, + const response = await cloudflare.access.identityProviders.create({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + config: { + client_id: '', + client_secret: '', + claims: ['email_verified', 'preferred_username', 'custom_claim_name'], + email_claim_name: 'custom_claim_name', + conditional_access_enabled: true, + directory_id: '', + support_groups: true, + centrify_account: 'https://abc123.my.centrify.com/', + centrify_app_id: 'exampleapp', + apps_domain: 'mycompany.com', + auth_url: 'https://accounts.google.com/o/oauth2/auth', + certs_url: 'https://www.googleapis.com/oauth2/v3/certs', + scopes: ['openid', 'email', 'profile'], + token_url: 'https://accounts.google.com/o/oauth2/token', + authorization_server_id: 'aus9o8wzkhckw9TLa0h7z', + okta_account: 'https://dev-abc123.oktapreview.com', + onelogin_account: 'https://mycompany.onelogin.com', + ping_env_id: '342b5660-0c32-4936-a5a4-ce21fae57b0a', + attributes: ['group', 'department_code', 'divison'], + email_attribute_name: 'Email', + header_attributes: [ + { attribute_name: 'string', header_name: 'string' }, + { attribute_name: 'string', header_name: 'string' }, + { attribute_name: 'string', header_name: 'string' }, + ], + idp_public_certs: ['string', 'string', 'string'], + issuer_url: 'https://whoami.com', + sign_request: true, + sso_target_url: 'https://edgeaccess.org/idp/saml/login', }, - ); + name: 'Widget Corps IDP', + type: 'onetimepin', + scim_config: { + enabled: true, + group_member_deprovision: true, + seat_deprovision: true, + secret: 'string', + user_deprovision: true, + }, + }); }); // skipped: tests are disabled for the time being test.skip('update: only required params', async () => { const responsePromise = cloudflare.access.identityProviders.update( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { config: {}, name: 'Widget Corps IDP', type: 'onetimepin' }, + { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + config: {}, + name: 'Widget Corps IDP', + type: 'onetimepin', + }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -76,10 +103,10 @@ describe('resource identityProviders', () => { // skipped: tests are disabled for the time being test.skip('update: required and optional params', async () => { const response = await cloudflare.access.identityProviders.update( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', config: { client_id: '', client_secret: '', @@ -88,6 +115,28 @@ describe('resource identityProviders', () => { conditional_access_enabled: true, directory_id: '', support_groups: true, + centrify_account: 'https://abc123.my.centrify.com/', + centrify_app_id: 'exampleapp', + apps_domain: 'mycompany.com', + auth_url: 'https://accounts.google.com/o/oauth2/auth', + certs_url: 'https://www.googleapis.com/oauth2/v3/certs', + scopes: ['openid', 'email', 'profile'], + token_url: 'https://accounts.google.com/o/oauth2/token', + authorization_server_id: 'aus9o8wzkhckw9TLa0h7z', + okta_account: 'https://dev-abc123.oktapreview.com', + onelogin_account: 'https://mycompany.onelogin.com', + ping_env_id: '342b5660-0c32-4936-a5a4-ce21fae57b0a', + attributes: ['group', 'department_code', 'divison'], + email_attribute_name: 'Email', + header_attributes: [ + { attribute_name: 'string', header_name: 'string' }, + { attribute_name: 'string', header_name: 'string' }, + { attribute_name: 'string', header_name: 'string' }, + ], + idp_public_certs: ['string', 'string', 'string'], + issuer_url: 'https://whoami.com', + sign_request: true, + sso_target_url: 'https://edgeaccess.org/idp/saml/login', }, name: 'Widget Corps IDP', type: 'onetimepin', @@ -103,11 +152,11 @@ describe('resource identityProviders', () => { }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.access.identityProviders.list( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - ); + test.skip('list: only required params', async () => { + const responsePromise = cloudflare.access.identityProviders.list({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -118,21 +167,18 @@ describe('resource identityProviders', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.identityProviders.list('string', '023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('list: required and optional params', async () => { + const response = await cloudflare.access.identityProviders.list({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // skipped: tests are disabled for the time being - test.skip('delete', async () => { + test.skip('delete: only required params', async () => { const responsePromise = cloudflare.access.identityProviders.delete( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: 'string', zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -144,25 +190,19 @@ describe('resource identityProviders', () => { }); // skipped: tests are disabled for the time being - test.skip('delete: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.identityProviders.delete( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('delete: required and optional params', async () => { + const response = await cloudflare.access.identityProviders.delete( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: 'string', zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); }); // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.access.identityProviders.get( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - ); + test.skip('get: only required params', async () => { + const responsePromise = cloudflare.access.identityProviders.get('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -173,15 +213,10 @@ describe('resource identityProviders', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.identityProviders.get( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('get: required and optional params', async () => { + const response = await cloudflare.access.identityProviders.get('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); }); diff --git a/tests/api-resources/access/keys.test.ts b/tests/api-resources/access/keys.test.ts index 1ccbcc5ffb..b5dca5aa4b 100644 --- a/tests/api-resources/access/keys.test.ts +++ b/tests/api-resources/access/keys.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/access/logs/access-requests.test.ts b/tests/api-resources/access/logs/access-requests.test.ts index 82d0491185..599bc9a543 100644 --- a/tests/api-resources/access/logs/access-requests.test.ts +++ b/tests/api-resources/access/logs/access-requests.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/access/organizations.test.ts b/tests/api-resources/access/organizations.test.ts index 0ec09010c8..785e891ac5 100644 --- a/tests/api-resources/access/organizations.test.ts +++ b/tests/api-resources/access/organizations.test.ts @@ -5,20 +5,22 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource organizations', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.access.organizations.create( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { auth_domain: 'test.cloudflareaccess.com', name: 'Widget Corps Internal Applications' }, - ); + const responsePromise = cloudflare.access.organizations.create({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + auth_domain: 'test.cloudflareaccess.com', + name: 'Widget Corps Internal Applications', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -30,37 +32,34 @@ describe('resource organizations', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.access.organizations.create( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { - auth_domain: 'test.cloudflareaccess.com', - name: 'Widget Corps Internal Applications', - allow_authenticate_via_warp: true, - auto_redirect_to_identity: true, - is_ui_read_only: true, - login_design: { - background_color: '#c5ed1b', - footer_text: 'This is an example description.', - header_text: 'This is an example description.', - logo_path: 'https://example.com/logo.png', - text_color: '#c5ed1b', - }, - session_duration: '24h', - ui_read_only_toggle_reason: 'Temporarily turn off the UI read only lock to make a change via the UI', - user_seat_expiration_inactive_time: '720h', - warp_auth_session_duration: '24h', + const response = await cloudflare.access.organizations.create({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + auth_domain: 'test.cloudflareaccess.com', + name: 'Widget Corps Internal Applications', + allow_authenticate_via_warp: true, + auto_redirect_to_identity: true, + is_ui_read_only: true, + login_design: { + background_color: '#c5ed1b', + footer_text: 'This is an example description.', + header_text: 'This is an example description.', + logo_path: 'https://example.com/logo.png', + text_color: '#c5ed1b', }, - ); + session_duration: '24h', + ui_read_only_toggle_reason: 'Temporarily turn off the UI read only lock to make a change via the UI', + user_seat_expiration_inactive_time: '720h', + warp_auth_session_duration: '24h', + }); }); // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.access.organizations.update( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - {}, - ); + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.access.organizations.update({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -71,11 +70,39 @@ describe('resource organizations', () => { }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.access.organizations.list( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - ); + test.skip('update: required and optional params', async () => { + const response = await cloudflare.access.organizations.update({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + allow_authenticate_via_warp: true, + auth_domain: 'test.cloudflareaccess.com', + auto_redirect_to_identity: true, + custom_pages: { + forbidden: '699d98642c564d2e855e9661899b7252', + identity_denied: '699d98642c564d2e855e9661899b7252', + }, + is_ui_read_only: true, + login_design: { + background_color: '#c5ed1b', + footer_text: 'This is an example description.', + header_text: 'This is an example description.', + logo_path: 'https://example.com/logo.png', + text_color: '#c5ed1b', + }, + name: 'Widget Corps Internal Applications', + session_duration: '24h', + ui_read_only_toggle_reason: 'Temporarily turn off the UI read only lock to make a change via the UI', + user_seat_expiration_inactive_time: '720h', + warp_auth_session_duration: '24h', + }); + }); + + // skipped: tests are disabled for the time being + test.skip('list: only required params', async () => { + const responsePromise = cloudflare.access.organizations.list({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -86,22 +113,20 @@ describe('resource organizations', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.organizations.list('string', '023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('list: required and optional params', async () => { + const response = await cloudflare.access.organizations.list({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // skipped: tests are disabled for the time being test.skip('revokeUsers: only required params', async () => { - const responsePromise = cloudflare.access.organizations.revokeUsers( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { email: 'test@example.com' }, - ); + const responsePromise = cloudflare.access.organizations.revokeUsers({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + email: 'test@example.com', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -113,10 +138,10 @@ describe('resource organizations', () => { // skipped: tests are disabled for the time being test.skip('revokeUsers: required and optional params', async () => { - const response = await cloudflare.access.organizations.revokeUsers( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { email: 'test@example.com' }, - ); + const response = await cloudflare.access.organizations.revokeUsers({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + email: 'test@example.com', + }); }); }); diff --git a/tests/api-resources/access/seats.test.ts b/tests/api-resources/access/seats.test.ts index bda2b01163..8d9e5be770 100644 --- a/tests/api-resources/access/seats.test.ts +++ b/tests/api-resources/access/seats.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/access/service-tokens.test.ts b/tests/api-resources/access/service-tokens.test.ts index 0a00495114..fe388f8642 100644 --- a/tests/api-resources/access/service-tokens.test.ts +++ b/tests/api-resources/access/service-tokens.test.ts @@ -5,20 +5,21 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource serviceTokens', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.access.serviceTokens.create( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { name: 'CI/CD token' }, - ); + const responsePromise = cloudflare.access.serviceTokens.create({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'CI/CD token', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -30,21 +31,20 @@ describe('resource serviceTokens', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.access.serviceTokens.create( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { name: 'CI/CD token', duration: '60m' }, - ); + const response = await cloudflare.access.serviceTokens.create({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'CI/CD token', + duration: '60m', + }); }); // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.access.serviceTokens.update( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - {}, - ); + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.access.serviceTokens.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -55,11 +55,21 @@ describe('resource serviceTokens', () => { }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.access.serviceTokens.list( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - ); + test.skip('update: required and optional params', async () => { + const response = await cloudflare.access.serviceTokens.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + duration: '60m', + name: 'CI/CD token', + }); + }); + + // skipped: tests are disabled for the time being + test.skip('list: only required params', async () => { + const responsePromise = cloudflare.access.serviceTokens.list({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -70,22 +80,19 @@ describe('resource serviceTokens', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.serviceTokens.list('string', '023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('list: required and optional params', async () => { + const response = await cloudflare.access.serviceTokens.list({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.access.serviceTokens.delete( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - ); + test.skip('delete: only required params', async () => { + const responsePromise = cloudflare.access.serviceTokens.delete('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -96,16 +103,11 @@ describe('resource serviceTokens', () => { }); // skipped: tests are disabled for the time being - test.skip('delete: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.serviceTokens.delete( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('delete: required and optional params', async () => { + const response = await cloudflare.access.serviceTokens.delete('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // skipped: tests are disabled for the time being diff --git a/tests/api-resources/access/tags.test.ts b/tests/api-resources/access/tags.test.ts index 1358c56fe6..70aa3d144b 100644 --- a/tests/api-resources/access/tags.test.ts +++ b/tests/api-resources/access/tags.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/access/users/active-sessions.test.ts b/tests/api-resources/access/users/active-sessions.test.ts index 71013f4e3b..e476a99353 100644 --- a/tests/api-resources/access/users/active-sessions.test.ts +++ b/tests/api-resources/access/users/active-sessions.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/access/users/failed-logins.test.ts b/tests/api-resources/access/users/failed-logins.test.ts index d025d39190..0ca965a198 100644 --- a/tests/api-resources/access/users/failed-logins.test.ts +++ b/tests/api-resources/access/users/failed-logins.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/access/users/last-seen-identity.test.ts b/tests/api-resources/access/users/last-seen-identity.test.ts index 1d1b6fd324..b0eaac3fab 100644 --- a/tests/api-resources/access/users/last-seen-identity.test.ts +++ b/tests/api-resources/access/users/last-seen-identity.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/access/users/users.test.ts b/tests/api-resources/access/users/users.test.ts index bbcd778714..ca7bf5e40b 100644 --- a/tests/api-resources/access/users/users.test.ts +++ b/tests/api-resources/access/users/users.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/account-members.test.ts b/tests/api-resources/account-members.test.ts index d9fdcb52a1..2e0b260761 100644 --- a/tests/api-resources/account-members.test.ts +++ b/tests/api-resources/account-members.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/accounts.test.ts b/tests/api-resources/accounts.test.ts index 1c5afb32f1..7d4b37023a 100644 --- a/tests/api-resources/accounts.test.ts +++ b/tests/api-resources/accounts.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/acm/total-tls.test.ts b/tests/api-resources/acm/total-tls.test.ts index f5056d044e..1d2d5de25f 100644 --- a/tests/api-resources/acm/total-tls.test.ts +++ b/tests/api-resources/acm/total-tls.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/activation-checks.test.ts b/tests/api-resources/activation-checks.test.ts index 8fde3ecd31..8f00c6ad3f 100644 --- a/tests/api-resources/activation-checks.test.ts +++ b/tests/api-resources/activation-checks.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/addresses/address-maps/accounts.test.ts b/tests/api-resources/addresses/address-maps/accounts.test.ts index ba0d890e52..46664a3076 100644 --- a/tests/api-resources/addresses/address-maps/accounts.test.ts +++ b/tests/api-resources/addresses/address-maps/accounts.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/addresses/address-maps/address-maps.test.ts b/tests/api-resources/addresses/address-maps/address-maps.test.ts index 3d6610e759..30160213a6 100644 --- a/tests/api-resources/addresses/address-maps/address-maps.test.ts +++ b/tests/api-resources/addresses/address-maps/address-maps.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/addresses/address-maps/ips.test.ts b/tests/api-resources/addresses/address-maps/ips.test.ts index 624e75d216..eda3f8a81f 100644 --- a/tests/api-resources/addresses/address-maps/ips.test.ts +++ b/tests/api-resources/addresses/address-maps/ips.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/addresses/address-maps/zones.test.ts b/tests/api-resources/addresses/address-maps/zones.test.ts index 9fa055157f..cb0ab57d5a 100644 --- a/tests/api-resources/addresses/address-maps/zones.test.ts +++ b/tests/api-resources/addresses/address-maps/zones.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/addresses/loa-documents/downloads.test.ts b/tests/api-resources/addresses/loa-documents/downloads.test.ts index 8711259fd5..9758cf9d46 100644 --- a/tests/api-resources/addresses/loa-documents/downloads.test.ts +++ b/tests/api-resources/addresses/loa-documents/downloads.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/addresses/loa-documents/loa-documents.test.ts b/tests/api-resources/addresses/loa-documents/loa-documents.test.ts index 2e74e86997..475ea0860f 100644 --- a/tests/api-resources/addresses/loa-documents/loa-documents.test.ts +++ b/tests/api-resources/addresses/loa-documents/loa-documents.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/addresses/prefixes/bgps/statuses.test.ts b/tests/api-resources/addresses/prefixes/bgps/statuses.test.ts index d64c4f52c7..1aa86c3f40 100644 --- a/tests/api-resources/addresses/prefixes/bgps/statuses.test.ts +++ b/tests/api-resources/addresses/prefixes/bgps/statuses.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/addresses/prefixes/delegations.test.ts b/tests/api-resources/addresses/prefixes/delegations.test.ts index ba7144a16a..f332e1c88d 100644 --- a/tests/api-resources/addresses/prefixes/delegations.test.ts +++ b/tests/api-resources/addresses/prefixes/delegations.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/addresses/prefixes/prefixes.test.ts b/tests/api-resources/addresses/prefixes/prefixes.test.ts index 3820e963d3..fa3ba5b506 100644 --- a/tests/api-resources/addresses/prefixes/prefixes.test.ts +++ b/tests/api-resources/addresses/prefixes/prefixes.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/addressing/prefixes/bgp-prefixes.test.ts b/tests/api-resources/addressing/prefixes/bgp-prefixes.test.ts index bd35c7bf5b..02f2462fcd 100644 --- a/tests/api-resources/addressing/prefixes/bgp-prefixes.test.ts +++ b/tests/api-resources/addressing/prefixes/bgp-prefixes.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/addressing/prefixes/bindings.test.ts b/tests/api-resources/addressing/prefixes/bindings.test.ts index ecaf32b445..638f946a25 100644 --- a/tests/api-resources/addressing/prefixes/bindings.test.ts +++ b/tests/api-resources/addressing/prefixes/bindings.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/addressing/services.test.ts b/tests/api-resources/addressing/services.test.ts index 2f0cba94ef..8817f3121a 100644 --- a/tests/api-resources/addressing/services.test.ts +++ b/tests/api-resources/addressing/services.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/ai.test.ts b/tests/api-resources/ai.test.ts index 5e61de3ffa..0589ca0130 100644 --- a/tests/api-resources/ai.test.ts +++ b/tests/api-resources/ai.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/alerting/v3/destinations/eligible.test.ts b/tests/api-resources/alerting/v3/destinations/eligible.test.ts index 83472fc942..c20e43b036 100644 --- a/tests/api-resources/alerting/v3/destinations/eligible.test.ts +++ b/tests/api-resources/alerting/v3/destinations/eligible.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/alerting/v3/destinations/pagerduty.test.ts b/tests/api-resources/alerting/v3/destinations/pagerduty.test.ts index ca7f1bc46c..7ac7df0c51 100644 --- a/tests/api-resources/alerting/v3/destinations/pagerduty.test.ts +++ b/tests/api-resources/alerting/v3/destinations/pagerduty.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/alerting/v3/destinations/webhooks.test.ts b/tests/api-resources/alerting/v3/destinations/webhooks.test.ts index 26e5306376..6fe803263c 100644 --- a/tests/api-resources/alerting/v3/destinations/webhooks.test.ts +++ b/tests/api-resources/alerting/v3/destinations/webhooks.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/alerting/v3/histories.test.ts b/tests/api-resources/alerting/v3/histories.test.ts index 715e0c50ad..0af4dfd5fd 100644 --- a/tests/api-resources/alerting/v3/histories.test.ts +++ b/tests/api-resources/alerting/v3/histories.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/alerting/v3/policies.test.ts b/tests/api-resources/alerting/v3/policies.test.ts index d5dce0f0a9..9a5ed96879 100644 --- a/tests/api-resources/alerting/v3/policies.test.ts +++ b/tests/api-resources/alerting/v3/policies.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/alerting/v3/v3.test.ts b/tests/api-resources/alerting/v3/v3.test.ts index 690e6b2ebe..103eb474cc 100644 --- a/tests/api-resources/alerting/v3/v3.test.ts +++ b/tests/api-resources/alerting/v3/v3.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/argo/smart-routing.test.ts b/tests/api-resources/argo/smart-routing.test.ts index e8f5400948..a0a017970d 100644 --- a/tests/api-resources/argo/smart-routing.test.ts +++ b/tests/api-resources/argo/smart-routing.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/argo/tiered-caching.test.ts b/tests/api-resources/argo/tiered-caching.test.ts index cff0fb85a8..5cc99bd00a 100644 --- a/tests/api-resources/argo/tiered-caching.test.ts +++ b/tests/api-resources/argo/tiered-caching.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/audit-logs.test.ts b/tests/api-resources/audit-logs.test.ts index 6ee7b0ca47..f1634d85f6 100644 --- a/tests/api-resources/audit-logs.test.ts +++ b/tests/api-resources/audit-logs.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/available-plans.test.ts b/tests/api-resources/available-plans.test.ts index 59c575fff9..7664a0eb67 100644 --- a/tests/api-resources/available-plans.test.ts +++ b/tests/api-resources/available-plans.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/available-rate-plans.test.ts b/tests/api-resources/available-rate-plans.test.ts index 0991384aa8..d14c6fe707 100644 --- a/tests/api-resources/available-rate-plans.test.ts +++ b/tests/api-resources/available-rate-plans.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/billings/profiles.test.ts b/tests/api-resources/billings/profiles.test.ts index d4aac27028..ebb477bbce 100644 --- a/tests/api-resources/billings/profiles.test.ts +++ b/tests/api-resources/billings/profiles.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/bot-management.test.ts b/tests/api-resources/bot-management.test.ts index 327a733abc..8fdb1a00c1 100644 --- a/tests/api-resources/bot-management.test.ts +++ b/tests/api-resources/bot-management.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/brand-protection/submits.test.ts b/tests/api-resources/brand-protection/submits.test.ts index 2ed2d02347..677155635d 100644 --- a/tests/api-resources/brand-protection/submits.test.ts +++ b/tests/api-resources/brand-protection/submits.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/brand-protection/url-infos.test.ts b/tests/api-resources/brand-protection/url-infos.test.ts index 68a50cc2d0..62766c5abd 100644 --- a/tests/api-resources/brand-protection/url-infos.test.ts +++ b/tests/api-resources/brand-protection/url-infos.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/cache-reserve.test.ts b/tests/api-resources/cache-reserve.test.ts deleted file mode 100644 index 44eece07ef..0000000000 --- a/tests/api-resources/cache-reserve.test.ts +++ /dev/null @@ -1,46 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource cacheReserve', () => { - // skipped: tests are disabled for the time being - test.skip('create', async () => { - const responsePromise = cloudflare.cacheReserve.create('023e105f4ecef8ad9ca31a8372d0c353'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.cacheReserve.get('023e105f4ecef8ad9ca31a8372d0c353'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.cacheReserve.get('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/cache/cache-reserves.test.ts b/tests/api-resources/cache/cache-reserve.test.ts similarity index 75% rename from tests/api-resources/cache/cache-reserves.test.ts rename to tests/api-resources/cache/cache-reserve.test.ts index ff438a695e..f8b2ab43c5 100644 --- a/tests/api-resources/cache/cache-reserves.test.ts +++ b/tests/api-resources/cache/cache-reserve.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource cacheReserves', () => { +describe('resource cacheReserve', () => { // skipped: tests are disabled for the time being test.skip('list', async () => { - const responsePromise = cloudflare.cache.cacheReserves.list('023e105f4ecef8ad9ca31a8372d0c353'); + const responsePromise = cloudflare.cache.cacheReserve.list('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -28,7 +29,7 @@ describe('resource cacheReserves', () => { test.skip('list: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.cache.cacheReserves.list('023e105f4ecef8ad9ca31a8372d0c353', { + cloudflare.cache.cacheReserve.list('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path', }), ).rejects.toThrow(Cloudflare.NotFoundError); @@ -36,7 +37,7 @@ describe('resource cacheReserves', () => { // skipped: tests are disabled for the time being test.skip('edit: only required params', async () => { - const responsePromise = cloudflare.cache.cacheReserves.edit('023e105f4ecef8ad9ca31a8372d0c353', { + const responsePromise = cloudflare.cache.cacheReserve.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -50,7 +51,7 @@ describe('resource cacheReserves', () => { // skipped: tests are disabled for the time being test.skip('edit: required and optional params', async () => { - const response = await cloudflare.cache.cacheReserves.edit('023e105f4ecef8ad9ca31a8372d0c353', { + const response = await cloudflare.cache.cacheReserve.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/cache/cache.test.ts b/tests/api-resources/cache/cache.test.ts index 828786b36b..6fb47b58b9 100644 --- a/tests/api-resources/cache/cache.test.ts +++ b/tests/api-resources/cache/cache.test.ts @@ -5,15 +5,16 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource cache', () => { // skipped: tests are disabled for the time being - test.skip('purge', async () => { + test.skip('purge: only required params', async () => { const responsePromise = cloudflare.cache.purge('string', {}); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -23,4 +24,9 @@ describe('resource cache', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); + + // skipped: tests are disabled for the time being + test.skip('purge: required and optional params', async () => { + const response = await cloudflare.cache.purge('string', { tags: ['some-tag', 'another-tag'] }); + }); }); diff --git a/tests/api-resources/cache/regional-tiered-cache.test.ts b/tests/api-resources/cache/regional-tiered-cache.test.ts index 3947c87912..88ac171307 100644 --- a/tests/api-resources/cache/regional-tiered-cache.test.ts +++ b/tests/api-resources/cache/regional-tiered-cache.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/cache/tiered-cache-smart-topology.test.ts b/tests/api-resources/cache/tiered-cache-smart-topology.test.ts index bf650d18cf..4443343a23 100644 --- a/tests/api-resources/cache/tiered-cache-smart-topology.test.ts +++ b/tests/api-resources/cache/tiered-cache-smart-topology.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/cache/variants.test.ts b/tests/api-resources/cache/variants.test.ts index f59e1662a2..124019c01d 100644 --- a/tests/api-resources/cache/variants.test.ts +++ b/tests/api-resources/cache/variants.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/calls.test.ts b/tests/api-resources/calls.test.ts index 512b468952..4ba3f30ab4 100644 --- a/tests/api-resources/calls.test.ts +++ b/tests/api-resources/calls.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/certificate-authorities/hostname-associations.test.ts b/tests/api-resources/certificate-authorities/hostname-associations.test.ts index 0d586e55aa..89f01d8545 100644 --- a/tests/api-resources/certificate-authorities/hostname-associations.test.ts +++ b/tests/api-resources/certificate-authorities/hostname-associations.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/certificates.test.ts b/tests/api-resources/certificates.test.ts index 0c63b6035f..d04262520f 100644 --- a/tests/api-resources/certificates.test.ts +++ b/tests/api-resources/certificates.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/challenges/widgets.test.ts b/tests/api-resources/challenges/widgets.test.ts index 59b77b1949..fe3802843c 100644 --- a/tests/api-resources/challenges/widgets.test.ts +++ b/tests/api-resources/challenges/widgets.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/client-certificates.test.ts b/tests/api-resources/client-certificates.test.ts index c55ba3d318..b1af9f88d7 100644 --- a/tests/api-resources/client-certificates.test.ts +++ b/tests/api-resources/client-certificates.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/custom-certificates/custom-certificates.test.ts b/tests/api-resources/custom-certificates/custom-certificates.test.ts index a1ea7b1f03..f6a224d1eb 100644 --- a/tests/api-resources/custom-certificates/custom-certificates.test.ts +++ b/tests/api-resources/custom-certificates/custom-certificates.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/custom-certificates/prioritize.test.ts b/tests/api-resources/custom-certificates/prioritize.test.ts index b220c4c90b..bb49f43072 100644 --- a/tests/api-resources/custom-certificates/prioritize.test.ts +++ b/tests/api-resources/custom-certificates/prioritize.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/custom-hostnames/custom-hostnames.test.ts b/tests/api-resources/custom-hostnames/custom-hostnames.test.ts index d02b34246e..08899ee348 100644 --- a/tests/api-resources/custom-hostnames/custom-hostnames.test.ts +++ b/tests/api-resources/custom-hostnames/custom-hostnames.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/custom-hostnames/fallback-origin.test.ts b/tests/api-resources/custom-hostnames/fallback-origin.test.ts index 2cbb73da7b..3feed1273e 100644 --- a/tests/api-resources/custom-hostnames/fallback-origin.test.ts +++ b/tests/api-resources/custom-hostnames/fallback-origin.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/custom-nameservers.test.ts b/tests/api-resources/custom-nameservers.test.ts index 2ad3174577..897809f21c 100644 --- a/tests/api-resources/custom-nameservers.test.ts +++ b/tests/api-resources/custom-nameservers.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/d1/database.test.ts b/tests/api-resources/d1/database.test.ts index b162bde6c4..409a3bf476 100644 --- a/tests/api-resources/d1/database.test.ts +++ b/tests/api-resources/d1/database.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/d1/databases.test.ts b/tests/api-resources/d1/databases.test.ts index 9795e3150f..34494cef75 100644 --- a/tests/api-resources/d1/databases.test.ts +++ b/tests/api-resources/d1/databases.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dcv-delegation/uuid.test.ts b/tests/api-resources/dcv-delegation/uuid.test.ts index e7d23260dd..4526f21a1d 100644 --- a/tests/api-resources/dcv-delegation/uuid.test.ts +++ b/tests/api-resources/dcv-delegation/uuid.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/devices/devices.test.ts b/tests/api-resources/devices/devices.test.ts index 219674ae54..7c9d1bcb8d 100644 --- a/tests/api-resources/devices/devices.test.ts +++ b/tests/api-resources/devices/devices.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/devices/dex-tests.test.ts b/tests/api-resources/devices/dex-tests.test.ts index 8db83a7510..bd89eda344 100644 --- a/tests/api-resources/devices/dex-tests.test.ts +++ b/tests/api-resources/devices/dex-tests.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/devices/networks.test.ts b/tests/api-resources/devices/networks.test.ts index 6d8d771c34..5fea6c03b1 100644 --- a/tests/api-resources/devices/networks.test.ts +++ b/tests/api-resources/devices/networks.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/devices/override-codes.test.ts b/tests/api-resources/devices/override-codes.test.ts index 49f80c2b40..4109c75965 100644 --- a/tests/api-resources/devices/override-codes.test.ts +++ b/tests/api-resources/devices/override-codes.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/devices/policies/default-policy.test.ts b/tests/api-resources/devices/policies/default-policy.test.ts index d6c88b01f7..b5d6cc8d8b 100644 --- a/tests/api-resources/devices/policies/default-policy.test.ts +++ b/tests/api-resources/devices/policies/default-policy.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/devices/policies/excludes.test.ts b/tests/api-resources/devices/policies/excludes.test.ts index 6e5069dba8..34cb9e7671 100644 --- a/tests/api-resources/devices/policies/excludes.test.ts +++ b/tests/api-resources/devices/policies/excludes.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/devices/policies/fallback-domains.test.ts b/tests/api-resources/devices/policies/fallback-domains.test.ts index ceb756ce90..2b81f1fb6f 100644 --- a/tests/api-resources/devices/policies/fallback-domains.test.ts +++ b/tests/api-resources/devices/policies/fallback-domains.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/devices/policies/includes.test.ts b/tests/api-resources/devices/policies/includes.test.ts index ad8b4d6a01..2304edfe2f 100644 --- a/tests/api-resources/devices/policies/includes.test.ts +++ b/tests/api-resources/devices/policies/includes.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/devices/policies/policies.test.ts b/tests/api-resources/devices/policies/policies.test.ts index a91e8b5c43..b7aafa0f97 100644 --- a/tests/api-resources/devices/policies/policies.test.ts +++ b/tests/api-resources/devices/policies/policies.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/devices/postures/integrations.test.ts b/tests/api-resources/devices/postures/integrations.test.ts index 39ef3e60fa..5fd333b189 100644 --- a/tests/api-resources/devices/postures/integrations.test.ts +++ b/tests/api-resources/devices/postures/integrations.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/devices/postures/postures.test.ts b/tests/api-resources/devices/postures/postures.test.ts index ebac038d94..5c8cf45d06 100644 --- a/tests/api-resources/devices/postures/postures.test.ts +++ b/tests/api-resources/devices/postures/postures.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/devices/revokes.test.ts b/tests/api-resources/devices/revokes.test.ts index 6ded101c84..5c4774b0bd 100644 --- a/tests/api-resources/devices/revokes.test.ts +++ b/tests/api-resources/devices/revokes.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/devices/settings.test.ts b/tests/api-resources/devices/settings.test.ts index 94016bdf12..090f6f1450 100644 --- a/tests/api-resources/devices/settings.test.ts +++ b/tests/api-resources/devices/settings.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/devices/unrevokes.test.ts b/tests/api-resources/devices/unrevokes.test.ts index ea7eeab4a6..cff34e11b9 100644 --- a/tests/api-resources/devices/unrevokes.test.ts +++ b/tests/api-resources/devices/unrevokes.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dex/colos.test.ts b/tests/api-resources/dex/colos.test.ts index ff72c5277f..ab793ea612 100644 --- a/tests/api-resources/dex/colos.test.ts +++ b/tests/api-resources/dex/colos.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dex/fleet-status/devices.test.ts b/tests/api-resources/dex/fleet-status/devices.test.ts index 790945b7ba..e9ba484a3e 100644 --- a/tests/api-resources/dex/fleet-status/devices.test.ts +++ b/tests/api-resources/dex/fleet-status/devices.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dex/fleet-status/live.test.ts b/tests/api-resources/dex/fleet-status/live.test.ts index 6dc4176471..283c54012a 100644 --- a/tests/api-resources/dex/fleet-status/live.test.ts +++ b/tests/api-resources/dex/fleet-status/live.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dex/fleet-status/over-time.test.ts b/tests/api-resources/dex/fleet-status/over-time.test.ts index d843719e97..7843af7241 100644 --- a/tests/api-resources/dex/fleet-status/over-time.test.ts +++ b/tests/api-resources/dex/fleet-status/over-time.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dex/http-tests/http-tests.test.ts b/tests/api-resources/dex/http-tests/http-tests.test.ts index 0ec13f649f..d947dacd0f 100644 --- a/tests/api-resources/dex/http-tests/http-tests.test.ts +++ b/tests/api-resources/dex/http-tests/http-tests.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dex/http-tests/percentiles.test.ts b/tests/api-resources/dex/http-tests/percentiles.test.ts index eea3020adc..ee6c2625be 100644 --- a/tests/api-resources/dex/http-tests/percentiles.test.ts +++ b/tests/api-resources/dex/http-tests/percentiles.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dex/tests/tests.test.ts b/tests/api-resources/dex/tests/tests.test.ts index c3a3d86593..e1ecd2d52f 100644 --- a/tests/api-resources/dex/tests/tests.test.ts +++ b/tests/api-resources/dex/tests/tests.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dex/tests/unique-devices.test.ts b/tests/api-resources/dex/tests/unique-devices.test.ts index 1493ee931d..137d896b15 100644 --- a/tests/api-resources/dex/tests/unique-devices.test.ts +++ b/tests/api-resources/dex/tests/unique-devices.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dex/traceroute-test-results/network-path.test.ts b/tests/api-resources/dex/traceroute-test-results/network-path.test.ts index f6201d32aa..1bbbef9031 100644 --- a/tests/api-resources/dex/traceroute-test-results/network-path.test.ts +++ b/tests/api-resources/dex/traceroute-test-results/network-path.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dex/traceroute-tests.test.ts b/tests/api-resources/dex/traceroute-tests.test.ts index 3becd1ccee..e1caaeb9a8 100644 --- a/tests/api-resources/dex/traceroute-tests.test.ts +++ b/tests/api-resources/dex/traceroute-tests.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/diagnostics/traceroutes.test.ts b/tests/api-resources/diagnostics/traceroutes.test.ts index 0098eb60dd..081e6b79d7 100644 --- a/tests/api-resources/diagnostics/traceroutes.test.ts +++ b/tests/api-resources/diagnostics/traceroutes.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dispatchers/scripts.test.ts b/tests/api-resources/dispatchers/scripts.test.ts index 11194d4138..9e9a8f82f0 100644 --- a/tests/api-resources/dispatchers/scripts.test.ts +++ b/tests/api-resources/dispatchers/scripts.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dlp/datasets/datasets.test.ts b/tests/api-resources/dlp/datasets/datasets.test.ts index e871e73a07..66d8720d07 100644 --- a/tests/api-resources/dlp/datasets/datasets.test.ts +++ b/tests/api-resources/dlp/datasets/datasets.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dlp/datasets/upload.test.ts b/tests/api-resources/dlp/datasets/upload.test.ts index aa1c3acf0c..5faebc7eee 100644 --- a/tests/api-resources/dlp/datasets/upload.test.ts +++ b/tests/api-resources/dlp/datasets/upload.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dlp/patterns.test.ts b/tests/api-resources/dlp/patterns.test.ts index 26ca870b3d..a53f42189d 100644 --- a/tests/api-resources/dlp/patterns.test.ts +++ b/tests/api-resources/dlp/patterns.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dlp/payload-logs.test.ts b/tests/api-resources/dlp/payload-logs.test.ts index 622706802b..9ba37c4e89 100644 --- a/tests/api-resources/dlp/payload-logs.test.ts +++ b/tests/api-resources/dlp/payload-logs.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dlp/profiles/customs.test.ts b/tests/api-resources/dlp/profiles/customs.test.ts index 9f975a4672..6ee7b7237c 100644 --- a/tests/api-resources/dlp/profiles/customs.test.ts +++ b/tests/api-resources/dlp/profiles/customs.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dlp/profiles/predefineds.test.ts b/tests/api-resources/dlp/profiles/predefineds.test.ts index 33779aeeaf..a055768239 100644 --- a/tests/api-resources/dlp/profiles/predefineds.test.ts +++ b/tests/api-resources/dlp/profiles/predefineds.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dlp/profiles/profiles.test.ts b/tests/api-resources/dlp/profiles/profiles.test.ts index 7d2859a85f..da7f78e152 100644 --- a/tests/api-resources/dlp/profiles/profiles.test.ts +++ b/tests/api-resources/dlp/profiles/profiles.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dns-analytics/reports/bytimes.test.ts b/tests/api-resources/dns-analytics/reports/bytimes.test.ts index f27c9ce83b..5d0641b05d 100644 --- a/tests/api-resources/dns-analytics/reports/bytimes.test.ts +++ b/tests/api-resources/dns-analytics/reports/bytimes.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dns-analytics/reports/reports.test.ts b/tests/api-resources/dns-analytics/reports/reports.test.ts index c326ca4532..0adf9d884d 100644 --- a/tests/api-resources/dns-analytics/reports/reports.test.ts +++ b/tests/api-resources/dns-analytics/reports/reports.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dns-firewall/dns-analytics/reports/bytimes.test.ts b/tests/api-resources/dns-firewall/dns-analytics/reports/bytimes.test.ts index 450e790400..ecfccd4a09 100644 --- a/tests/api-resources/dns-firewall/dns-analytics/reports/bytimes.test.ts +++ b/tests/api-resources/dns-firewall/dns-analytics/reports/bytimes.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dns-firewall/dns-analytics/reports/reports.test.ts b/tests/api-resources/dns-firewall/dns-analytics/reports/reports.test.ts index 11f6c41eeb..064d6973cf 100644 --- a/tests/api-resources/dns-firewall/dns-analytics/reports/reports.test.ts +++ b/tests/api-resources/dns-firewall/dns-analytics/reports/reports.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dns-firewall/dns-firewall.test.ts b/tests/api-resources/dns-firewall/dns-firewall.test.ts index 5fd749cc5a..e53389e95a 100644 --- a/tests/api-resources/dns-firewall/dns-firewall.test.ts +++ b/tests/api-resources/dns-firewall/dns-firewall.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/dns-records.test.ts b/tests/api-resources/dns-records.test.ts index 8b8a261cee..f7b157f7a4 100644 --- a/tests/api-resources/dns-records.test.ts +++ b/tests/api-resources/dns-records.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); @@ -15,9 +16,8 @@ describe('resource dnsRecords', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { const responsePromise = cloudflare.dnsRecords.create('023e105f4ecef8ad9ca31a8372d0c353', { - content: '198.51.100.4', name: 'example.com', - type: 'A', + type: 'URI', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -31,10 +31,52 @@ describe('resource dnsRecords', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { const response = await cloudflare.dnsRecords.create('023e105f4ecef8ad9ca31a8372d0c353', { - content: '198.51.100.4', name: 'example.com', - type: 'A', + type: 'URI', comment: 'Domain verification record', + data: { + flags: 'string', + tag: 'issue', + value: 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + algorithm: 2, + certificate: 'string', + key_tag: 1, + type: 1, + protocol: 3, + public_key: 'string', + digest: 'string', + digest_type: 1, + priority: 1, + target: '.', + altitude: 0, + lat_degrees: 37, + lat_direction: 'N', + lat_minutes: 46, + lat_seconds: 46, + long_degrees: 122, + long_direction: 'W', + long_minutes: 23, + long_seconds: 35, + precision_horz: 0, + precision_vert: 0, + size: 100, + order: 100, + preference: 10, + regex: 'string', + replacement: 'string', + service: '_sip', + matching_type: 1, + selector: 0, + usage: 0, + name: 'example.com', + port: 8806, + proto: '_tcp', + weight: 20, + fingerprint: 'string', + content: 'http://example.com/example.html', + }, + meta: { auto_added: true, source: 'primary' }, + priority: 10, proxied: false, tags: ['owner:dns-team', 'owner:dns-team', 'owner:dns-team'], ttl: 3600, @@ -46,7 +88,7 @@ describe('resource dnsRecords', () => { const responsePromise = cloudflare.dnsRecords.update( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', - { content: '198.51.100.4', name: 'example.com', type: 'A' }, + { name: 'example.com', type: 'URI' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -63,10 +105,52 @@ describe('resource dnsRecords', () => { '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { - content: '198.51.100.4', name: 'example.com', - type: 'A', + type: 'URI', comment: 'Domain verification record', + data: { + flags: 'string', + tag: 'issue', + value: 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + algorithm: 2, + certificate: 'string', + key_tag: 1, + type: 1, + protocol: 3, + public_key: 'string', + digest: 'string', + digest_type: 1, + priority: 1, + target: '.', + altitude: 0, + lat_degrees: 37, + lat_direction: 'N', + lat_minutes: 46, + lat_seconds: 46, + long_degrees: 122, + long_direction: 'W', + long_minutes: 23, + long_seconds: 35, + precision_horz: 0, + precision_vert: 0, + size: 100, + order: 100, + preference: 10, + regex: 'string', + replacement: 'string', + service: '_sip', + matching_type: 1, + selector: 0, + usage: 0, + name: 'example.com', + port: 8806, + proto: '_tcp', + weight: 20, + fingerprint: 'string', + content: 'http://example.com/example.html', + }, + meta: { auto_added: true, source: 'primary' }, + priority: 10, proxied: false, tags: ['owner:dns-team', 'owner:dns-team', 'owner:dns-team'], ttl: 3600, diff --git a/tests/api-resources/dnssec.test.ts b/tests/api-resources/dnssec.test.ts index 8a19111cc4..8577a3e98f 100644 --- a/tests/api-resources/dnssec.test.ts +++ b/tests/api-resources/dnssec.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/emails/routing/addresses.test.ts b/tests/api-resources/emails/routing/addresses.test.ts index db30e30453..4f6d78eac5 100644 --- a/tests/api-resources/emails/routing/addresses.test.ts +++ b/tests/api-resources/emails/routing/addresses.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/emails/routing/disables.test.ts b/tests/api-resources/emails/routing/disables.test.ts index da2bd9d008..603235a331 100644 --- a/tests/api-resources/emails/routing/disables.test.ts +++ b/tests/api-resources/emails/routing/disables.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/emails/routing/dns.test.ts b/tests/api-resources/emails/routing/dns.test.ts index 7b82d88f29..374c15207b 100644 --- a/tests/api-resources/emails/routing/dns.test.ts +++ b/tests/api-resources/emails/routing/dns.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/emails/routing/enables.test.ts b/tests/api-resources/emails/routing/enables.test.ts index 7bfc8f50aa..f5a826ab9c 100644 --- a/tests/api-resources/emails/routing/enables.test.ts +++ b/tests/api-resources/emails/routing/enables.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/emails/routing/routing.test.ts b/tests/api-resources/emails/routing/routing.test.ts index 7c3e5e756e..e356e1bad9 100644 --- a/tests/api-resources/emails/routing/routing.test.ts +++ b/tests/api-resources/emails/routing/routing.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/emails/routing/rules/catch-alls.test.ts b/tests/api-resources/emails/routing/rules/catch-alls.test.ts index e8c8a671d9..6a10bb5187 100644 --- a/tests/api-resources/emails/routing/rules/catch-alls.test.ts +++ b/tests/api-resources/emails/routing/rules/catch-alls.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/emails/routing/rules/rules.test.ts b/tests/api-resources/emails/routing/rules/rules.test.ts index 210b4fa1ff..971d2fc608 100644 --- a/tests/api-resources/emails/routing/rules/rules.test.ts +++ b/tests/api-resources/emails/routing/rules/rules.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/filters.test.ts b/tests/api-resources/filters.test.ts index 75ef5c9bbf..3e2db27e89 100644 --- a/tests/api-resources/filters.test.ts +++ b/tests/api-resources/filters.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/firewall/waf/packages/groups.test.ts b/tests/api-resources/firewall/waf/packages/groups.test.ts index 87317dd293..a6b429fa88 100644 --- a/tests/api-resources/firewall/waf/packages/groups.test.ts +++ b/tests/api-resources/firewall/waf/packages/groups.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/firewall/waf/packages/rules.test.ts b/tests/api-resources/firewall/waf/packages/rules.test.ts index dacccab64d..6ffe51643d 100644 --- a/tests/api-resources/firewall/waf/packages/rules.test.ts +++ b/tests/api-resources/firewall/waf/packages/rules.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/firewalls/access-rules.test.ts b/tests/api-resources/firewalls/access-rules.test.ts index 6861a785fc..9b7e1b0032 100644 --- a/tests/api-resources/firewalls/access-rules.test.ts +++ b/tests/api-resources/firewalls/access-rules.test.ts @@ -5,20 +5,22 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource accessRules', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.firewalls.accessRules.create( - 'string', - {}, - { configuration: {}, mode: 'challenge' }, - ); + const responsePromise = cloudflare.firewalls.accessRules.create({ + account_id: 'string', + zone_id: {}, + configuration: {}, + mode: 'challenge', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -30,20 +32,18 @@ describe('resource accessRules', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.firewalls.accessRules.create( - 'string', - {}, - { - configuration: { target: 'ip', value: '198.51.100.4' }, - mode: 'challenge', - notes: 'This rule is enabled because of an event that occurred on date X.', - }, - ); + const response = await cloudflare.firewalls.accessRules.create({ + account_id: 'string', + zone_id: {}, + configuration: { target: 'ip', value: '198.51.100.4' }, + mode: 'challenge', + notes: 'This rule is enabled because of an event that occurred on date X.', + }); }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.firewalls.accessRules.list('string', {}); + test.skip('list: only required params', async () => { + const responsePromise = cloudflare.firewalls.accessRules.list({ account_id: 'string', zone_id: {} }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -54,42 +54,31 @@ describe('resource accessRules', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.firewalls.accessRules.list('string', {}, { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.firewalls.accessRules.list( - 'string', - {}, - { - direction: 'desc', - 'egs-pagination': { json: { page: 1, per_page: 1 } }, - filters: { - 'configuration.target': 'ip', - 'configuration.value': '198.51.100.4', - match: 'any', - mode: 'challenge', - notes: 'my note', - }, - order: 'mode', - page: 1, - per_page: 20, - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('list: required and optional params', async () => { + const response = await cloudflare.firewalls.accessRules.list({ + account_id: 'string', + zone_id: {}, + direction: 'desc', + 'egs-pagination': { json: { page: 1, per_page: 1 } }, + filters: { + 'configuration.target': 'ip', + 'configuration.value': '198.51.100.4', + match: 'any', + mode: 'challenge', + notes: 'my note', + }, + order: 'mode', + page: 1, + per_page: 20, + }); }); // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.firewalls.accessRules.delete('string', {}, {}); + test.skip('delete: only required params', async () => { + const responsePromise = cloudflare.firewalls.accessRules.delete( + {}, + { account_id: 'string', zone_id: {} }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -99,6 +88,11 @@ describe('resource accessRules', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('delete: required and optional params', async () => { + const response = await cloudflare.firewalls.accessRules.delete({}, { account_id: 'string', zone_id: {} }); + }); + // skipped: tests are disabled for the time being test.skip('edit: only required params', async () => { const responsePromise = cloudflare.firewalls.accessRules.edit( @@ -128,8 +122,8 @@ describe('resource accessRules', () => { }); // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.firewalls.accessRules.get('string', {}, {}); + test.skip('get: only required params', async () => { + const responsePromise = cloudflare.firewalls.accessRules.get({}, { account_id: 'string', zone_id: {} }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -140,10 +134,7 @@ describe('resource accessRules', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.firewalls.accessRules.get('string', {}, {}, { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('get: required and optional params', async () => { + const response = await cloudflare.firewalls.accessRules.get({}, { account_id: 'string', zone_id: {} }); }); }); diff --git a/tests/api-resources/firewalls/lockdowns.test.ts b/tests/api-resources/firewalls/lockdowns.test.ts index 3b26b529cc..bdc0f9a219 100644 --- a/tests/api-resources/firewalls/lockdowns.test.ts +++ b/tests/api-resources/firewalls/lockdowns.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/firewalls/rules.test.ts b/tests/api-resources/firewalls/rules.test.ts index f47a84a741..d17fa9005d 100644 --- a/tests/api-resources/firewalls/rules.test.ts +++ b/tests/api-resources/firewalls/rules.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/firewalls/ua-rules.test.ts b/tests/api-resources/firewalls/ua-rules.test.ts index b2ba9e42f0..89d71bcc95 100644 --- a/tests/api-resources/firewalls/ua-rules.test.ts +++ b/tests/api-resources/firewalls/ua-rules.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/firewalls/waf/overrides.test.ts b/tests/api-resources/firewalls/waf/overrides.test.ts index e897e2c3df..2839300be0 100644 --- a/tests/api-resources/firewalls/waf/overrides.test.ts +++ b/tests/api-resources/firewalls/waf/overrides.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/firewalls/waf/packages/groups.test.ts b/tests/api-resources/firewalls/waf/packages/groups.test.ts index 676e6821ac..aef587ea1e 100644 --- a/tests/api-resources/firewalls/waf/packages/groups.test.ts +++ b/tests/api-resources/firewalls/waf/packages/groups.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/firewalls/waf/packages/packages.test.ts b/tests/api-resources/firewalls/waf/packages/packages.test.ts index ad19c0bfe4..f289252ff4 100644 --- a/tests/api-resources/firewalls/waf/packages/packages.test.ts +++ b/tests/api-resources/firewalls/waf/packages/packages.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/firewalls/waf/packages/rules.test.ts b/tests/api-resources/firewalls/waf/packages/rules.test.ts index 85ed8cdbfd..4108e60e82 100644 --- a/tests/api-resources/firewalls/waf/packages/rules.test.ts +++ b/tests/api-resources/firewalls/waf/packages/rules.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/gateways/app-types.test.ts b/tests/api-resources/gateways/app-types.test.ts index 2a417805db..e2eb28daaa 100644 --- a/tests/api-resources/gateways/app-types.test.ts +++ b/tests/api-resources/gateways/app-types.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/gateways/audit-ssh-settings.test.ts b/tests/api-resources/gateways/audit-ssh-settings.test.ts index 426196651e..0e725fa6a7 100644 --- a/tests/api-resources/gateways/audit-ssh-settings.test.ts +++ b/tests/api-resources/gateways/audit-ssh-settings.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/gateways/categories.test.ts b/tests/api-resources/gateways/categories.test.ts index bd3364d1c2..d2bfbd5e07 100644 --- a/tests/api-resources/gateways/categories.test.ts +++ b/tests/api-resources/gateways/categories.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/gateways/configurations.test.ts b/tests/api-resources/gateways/configurations.test.ts index bbc1849c20..e4cff030e2 100644 --- a/tests/api-resources/gateways/configurations.test.ts +++ b/tests/api-resources/gateways/configurations.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/gateways/gateways.test.ts b/tests/api-resources/gateways/gateways.test.ts index 4e4cac6b00..34051d5fec 100644 --- a/tests/api-resources/gateways/gateways.test.ts +++ b/tests/api-resources/gateways/gateways.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/gateways/lists/items.test.ts b/tests/api-resources/gateways/lists/items.test.ts index 204429edb4..9a2c748f54 100644 --- a/tests/api-resources/gateways/lists/items.test.ts +++ b/tests/api-resources/gateways/lists/items.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/gateways/lists/lists.test.ts b/tests/api-resources/gateways/lists/lists.test.ts index 43b2a9365f..4e567917f9 100644 --- a/tests/api-resources/gateways/lists/lists.test.ts +++ b/tests/api-resources/gateways/lists/lists.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/gateways/locations.test.ts b/tests/api-resources/gateways/locations.test.ts index 1c7a5a393c..f2b456d44e 100644 --- a/tests/api-resources/gateways/locations.test.ts +++ b/tests/api-resources/gateways/locations.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/gateways/loggings.test.ts b/tests/api-resources/gateways/loggings.test.ts index 96e585c9a1..be0d9d6148 100644 --- a/tests/api-resources/gateways/loggings.test.ts +++ b/tests/api-resources/gateways/loggings.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/gateways/proxy-endpoints.test.ts b/tests/api-resources/gateways/proxy-endpoints.test.ts index 879d016f77..3c75d59698 100644 --- a/tests/api-resources/gateways/proxy-endpoints.test.ts +++ b/tests/api-resources/gateways/proxy-endpoints.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/gateways/rules.test.ts b/tests/api-resources/gateways/rules.test.ts index f4cf30ee45..89a3764248 100644 --- a/tests/api-resources/gateways/rules.test.ts +++ b/tests/api-resources/gateways/rules.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/healthchecks/healthchecks.test.ts b/tests/api-resources/healthchecks/healthchecks.test.ts index 6bb983739d..b214ccf40a 100644 --- a/tests/api-resources/healthchecks/healthchecks.test.ts +++ b/tests/api-resources/healthchecks/healthchecks.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/healthchecks/previews.test.ts b/tests/api-resources/healthchecks/previews.test.ts index 9601703c9e..ade280f14f 100644 --- a/tests/api-resources/healthchecks/previews.test.ts +++ b/tests/api-resources/healthchecks/previews.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/hostnames/settings/tls.test.ts b/tests/api-resources/hostnames/settings/tls.test.ts index 32f8a5efd6..2f99d4840a 100644 --- a/tests/api-resources/hostnames/settings/tls.test.ts +++ b/tests/api-resources/hostnames/settings/tls.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/hyperdrive/configs.test.ts b/tests/api-resources/hyperdrive/configs.test.ts index 2bd68bccfc..03799e4ce1 100644 --- a/tests/api-resources/hyperdrive/configs.test.ts +++ b/tests/api-resources/hyperdrive/configs.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/images/v1s/blobs.test.ts b/tests/api-resources/images/v1s/blobs.test.ts index 1f1d2cc567..86ac6120ae 100644 --- a/tests/api-resources/images/v1s/blobs.test.ts +++ b/tests/api-resources/images/v1s/blobs.test.ts @@ -4,9 +4,10 @@ import Cloudflare from 'cloudflare'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/images/v1s/keys.test.ts b/tests/api-resources/images/v1s/keys.test.ts index 3facb90880..fd42bf6f92 100644 --- a/tests/api-resources/images/v1s/keys.test.ts +++ b/tests/api-resources/images/v1s/keys.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/images/v1s/stats.test.ts b/tests/api-resources/images/v1s/stats.test.ts index 05519eb11d..5e4b100650 100644 --- a/tests/api-resources/images/v1s/stats.test.ts +++ b/tests/api-resources/images/v1s/stats.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/images/v1s/v1s.test.ts b/tests/api-resources/images/v1s/v1s.test.ts index cc9769214e..a68a14fcf4 100644 --- a/tests/api-resources/images/v1s/v1s.test.ts +++ b/tests/api-resources/images/v1s/v1s.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource v1s', () => { // skipped: tests are disabled for the time being - test.skip('create: only required params', async () => { - const responsePromise = cloudflare.images.v1s.create('023e105f4ecef8ad9ca31a8372d0c353', { file: {} }); + test.skip('create', async () => { + const responsePromise = cloudflare.images.v1s.create('023e105f4ecef8ad9ca31a8372d0c353', {}); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -24,11 +25,6 @@ describe('resource v1s', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being - test.skip('create: required and optional params', async () => { - const response = await cloudflare.images.v1s.create('023e105f4ecef8ad9ca31a8372d0c353', { file: {} }); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.images.v1s.list('023e105f4ecef8ad9ca31a8372d0c353'); diff --git a/tests/api-resources/images/v1s/variants.test.ts b/tests/api-resources/images/v1s/variants.test.ts index befaaecd79..4ea4aa8bab 100644 --- a/tests/api-resources/images/v1s/variants.test.ts +++ b/tests/api-resources/images/v1s/variants.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/images/v2s/direct-uploads.test.ts b/tests/api-resources/images/v2s/direct-uploads.test.ts index 465cfce1fd..9fcc02872c 100644 --- a/tests/api-resources/images/v2s/direct-uploads.test.ts +++ b/tests/api-resources/images/v2s/direct-uploads.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/images/v2s/v2s.test.ts b/tests/api-resources/images/v2s/v2s.test.ts index 1295d66e68..95a483f50d 100644 --- a/tests/api-resources/images/v2s/v2s.test.ts +++ b/tests/api-resources/images/v2s/v2s.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/intel/asn/asn.test.ts b/tests/api-resources/intel/asn/asn.test.ts index 453fee3fc3..b4554c9abc 100644 --- a/tests/api-resources/intel/asn/asn.test.ts +++ b/tests/api-resources/intel/asn/asn.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/intel/asn/subnets.test.ts b/tests/api-resources/intel/asn/subnets.test.ts index 2e25a19eac..f97d77dfaa 100644 --- a/tests/api-resources/intel/asn/subnets.test.ts +++ b/tests/api-resources/intel/asn/subnets.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/intel/dns.test.ts b/tests/api-resources/intel/dns.test.ts index fef0335e8c..b519fec61f 100644 --- a/tests/api-resources/intel/dns.test.ts +++ b/tests/api-resources/intel/dns.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/intel/domain-histories.test.ts b/tests/api-resources/intel/domain-histories.test.ts index 7fb07c683e..4828cc2acd 100644 --- a/tests/api-resources/intel/domain-histories.test.ts +++ b/tests/api-resources/intel/domain-histories.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/intel/domains/bulks.test.ts b/tests/api-resources/intel/domains/bulks.test.ts index 90e43ce460..895d91cd41 100644 --- a/tests/api-resources/intel/domains/bulks.test.ts +++ b/tests/api-resources/intel/domains/bulks.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/intel/domains/domains.test.ts b/tests/api-resources/intel/domains/domains.test.ts index 95c90a5c5d..6e0d952126 100644 --- a/tests/api-resources/intel/domains/domains.test.ts +++ b/tests/api-resources/intel/domains/domains.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/intel/indicator-feeds/indicator-feeds.test.ts b/tests/api-resources/intel/indicator-feeds/indicator-feeds.test.ts index 64f01fed5d..475ababd86 100644 --- a/tests/api-resources/intel/indicator-feeds/indicator-feeds.test.ts +++ b/tests/api-resources/intel/indicator-feeds/indicator-feeds.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/intel/indicator-feeds/permissions.test.ts b/tests/api-resources/intel/indicator-feeds/permissions.test.ts index bd0f78c14b..37d451fd1f 100644 --- a/tests/api-resources/intel/indicator-feeds/permissions.test.ts +++ b/tests/api-resources/intel/indicator-feeds/permissions.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/intel/ip-lists.test.ts b/tests/api-resources/intel/ip-lists.test.ts index 41e5c2d01b..ce356fd577 100644 --- a/tests/api-resources/intel/ip-lists.test.ts +++ b/tests/api-resources/intel/ip-lists.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/intel/ips.test.ts b/tests/api-resources/intel/ips.test.ts index 2b34c50073..3c5b28888f 100644 --- a/tests/api-resources/intel/ips.test.ts +++ b/tests/api-resources/intel/ips.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/intel/miscategorizations.test.ts b/tests/api-resources/intel/miscategorizations.test.ts index 07a9e06c10..1e92a4ef02 100644 --- a/tests/api-resources/intel/miscategorizations.test.ts +++ b/tests/api-resources/intel/miscategorizations.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/intel/sinkholes.test.ts b/tests/api-resources/intel/sinkholes.test.ts index c312bb99a2..d2d7adc42a 100644 --- a/tests/api-resources/intel/sinkholes.test.ts +++ b/tests/api-resources/intel/sinkholes.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/intel/whois.test.ts b/tests/api-resources/intel/whois.test.ts index 30661a55d4..c6faea802b 100644 --- a/tests/api-resources/intel/whois.test.ts +++ b/tests/api-resources/intel/whois.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/ips.test.ts b/tests/api-resources/ips.test.ts index fa1af40839..72e853ba10 100644 --- a/tests/api-resources/ips.test.ts +++ b/tests/api-resources/ips.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/keyless-certificates.test.ts b/tests/api-resources/keyless-certificates.test.ts index 61ad720498..df0631cb3e 100644 --- a/tests/api-resources/keyless-certificates.test.ts +++ b/tests/api-resources/keyless-certificates.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/load-balancers/load-balancers.test.ts b/tests/api-resources/load-balancers/load-balancers.test.ts index f8f2bdea0e..56fd42fc0c 100644 --- a/tests/api-resources/load-balancers/load-balancers.test.ts +++ b/tests/api-resources/load-balancers/load-balancers.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/load-balancers/monitors/monitors.test.ts b/tests/api-resources/load-balancers/monitors/monitors.test.ts index ef1584feca..52aff2d0c5 100644 --- a/tests/api-resources/load-balancers/monitors/monitors.test.ts +++ b/tests/api-resources/load-balancers/monitors/monitors.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/load-balancers/monitors/previews.test.ts b/tests/api-resources/load-balancers/monitors/previews.test.ts index 2bcc0f6e48..48603a7cbf 100644 --- a/tests/api-resources/load-balancers/monitors/previews.test.ts +++ b/tests/api-resources/load-balancers/monitors/previews.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/load-balancers/monitors/references.test.ts b/tests/api-resources/load-balancers/monitors/references.test.ts index 63e9f8d25c..cee35fc30b 100644 --- a/tests/api-resources/load-balancers/monitors/references.test.ts +++ b/tests/api-resources/load-balancers/monitors/references.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/load-balancers/pools/health.test.ts b/tests/api-resources/load-balancers/pools/health.test.ts index 3a9e1af18b..07a73cc15c 100644 --- a/tests/api-resources/load-balancers/pools/health.test.ts +++ b/tests/api-resources/load-balancers/pools/health.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/load-balancers/pools/pools.test.ts b/tests/api-resources/load-balancers/pools/pools.test.ts index c6c2082fae..1b0c966f36 100644 --- a/tests/api-resources/load-balancers/pools/pools.test.ts +++ b/tests/api-resources/load-balancers/pools/pools.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/load-balancers/pools/references.test.ts b/tests/api-resources/load-balancers/pools/references.test.ts index 73f0fade7a..e4e70f933d 100644 --- a/tests/api-resources/load-balancers/pools/references.test.ts +++ b/tests/api-resources/load-balancers/pools/references.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/load-balancers/previews.test.ts b/tests/api-resources/load-balancers/previews.test.ts index e43201238d..357e2b235f 100644 --- a/tests/api-resources/load-balancers/previews.test.ts +++ b/tests/api-resources/load-balancers/previews.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/load-balancers/regions.test.ts b/tests/api-resources/load-balancers/regions.test.ts index 53968ab880..8bfa1be328 100644 --- a/tests/api-resources/load-balancers/regions.test.ts +++ b/tests/api-resources/load-balancers/regions.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/load-balancers/searches.test.ts b/tests/api-resources/load-balancers/searches.test.ts index 1cf08c2340..07e7aa98d8 100644 --- a/tests/api-resources/load-balancers/searches.test.ts +++ b/tests/api-resources/load-balancers/searches.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/logpush/datasets/fields.test.ts b/tests/api-resources/logpush/datasets/fields.test.ts index b1bd28d113..e4c9b1fcbf 100644 --- a/tests/api-resources/logpush/datasets/fields.test.ts +++ b/tests/api-resources/logpush/datasets/fields.test.ts @@ -5,20 +5,20 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource fields', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.logpush.datasets.fields.list( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'http_requests', - ); + test.skip('list: only required params', async () => { + const responsePromise = cloudflare.logpush.datasets.fields.list('http_requests', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -29,12 +29,10 @@ describe('resource fields', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.logpush.datasets.fields.list('string', '023e105f4ecef8ad9ca31a8372d0c353', 'http_requests', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('list: required and optional params', async () => { + const response = await cloudflare.logpush.datasets.fields.list('http_requests', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); }); diff --git a/tests/api-resources/logpush/datasets/jobs.test.ts b/tests/api-resources/logpush/datasets/jobs.test.ts index 7608e42d0e..a3966d0add 100644 --- a/tests/api-resources/logpush/datasets/jobs.test.ts +++ b/tests/api-resources/logpush/datasets/jobs.test.ts @@ -5,20 +5,20 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource jobs', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.logpush.datasets.jobs.list( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'http_requests', - ); + test.skip('list: only required params', async () => { + const responsePromise = cloudflare.logpush.datasets.jobs.list('http_requests', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -29,12 +29,10 @@ describe('resource jobs', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.logpush.datasets.jobs.list('string', '023e105f4ecef8ad9ca31a8372d0c353', 'http_requests', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('list: required and optional params', async () => { + const response = await cloudflare.logpush.datasets.jobs.list('http_requests', { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); }); diff --git a/tests/api-resources/logpush/edge.test.ts b/tests/api-resources/logpush/edge.test.ts index b69d27244c..488ac074ef 100644 --- a/tests/api-resources/logpush/edge.test.ts +++ b/tests/api-resources/logpush/edge.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/logpush/jobs.test.ts b/tests/api-resources/logpush/jobs.test.ts index 111823c5c8..7c455b8ab4 100644 --- a/tests/api-resources/logpush/jobs.test.ts +++ b/tests/api-resources/logpush/jobs.test.ts @@ -5,16 +5,19 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource jobs', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.logpush.jobs.create('string', '023e105f4ecef8ad9ca31a8372d0c353', { + const responsePromise = cloudflare.logpush.jobs.create({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', destination_conf: 's3://mybucket/logs?region=us-west-2', }); const rawResponse = await responsePromise.asResponse(); @@ -28,7 +31,9 @@ describe('resource jobs', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.logpush.jobs.create('string', '023e105f4ecef8ad9ca31a8372d0c353', { + const response = await cloudflare.logpush.jobs.create({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', destination_conf: 's3://mybucket/logs?region=us-west-2', dataset: 'http_requests', enabled: false, @@ -54,13 +59,11 @@ describe('resource jobs', () => { }); // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.logpush.jobs.update( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 1, - {}, - ); + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.logpush.jobs.update(1, { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -71,8 +74,38 @@ describe('resource jobs', () => { }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.logpush.jobs.list('string', '023e105f4ecef8ad9ca31a8372d0c353'); + test.skip('update: required and optional params', async () => { + const response = await cloudflare.logpush.jobs.update(1, { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + destination_conf: 's3://mybucket/logs?region=us-west-2', + enabled: false, + frequency: 'high', + logpull_options: 'fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339', + output_options: { + 'CVE-2021-4428': true, + batch_prefix: 'string', + batch_suffix: 'string', + field_delimiter: 'string', + field_names: ['ClientIP', 'EdgeStartTimestamp', 'RayID'], + output_type: 'ndjson', + record_delimiter: 'string', + record_prefix: 'string', + record_suffix: 'string', + record_template: 'string', + sample_rate: 0, + timestamp_format: 'unixnano', + }, + ownership_challenge: '00000000000000000000', + }); + }); + + // skipped: tests are disabled for the time being + test.skip('list: only required params', async () => { + const responsePromise = cloudflare.logpush.jobs.list({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -83,18 +116,19 @@ describe('resource jobs', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.logpush.jobs.list('string', '023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('list: required and optional params', async () => { + const response = await cloudflare.logpush.jobs.list({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.logpush.jobs.delete('string', '023e105f4ecef8ad9ca31a8372d0c353', 1); + test.skip('delete: only required params', async () => { + const responsePromise = cloudflare.logpush.jobs.delete(1, { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -105,8 +139,19 @@ describe('resource jobs', () => { }); // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.logpush.jobs.get('string', '023e105f4ecef8ad9ca31a8372d0c353', 1); + test.skip('delete: required and optional params', async () => { + const response = await cloudflare.logpush.jobs.delete(1, { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); + + // skipped: tests are disabled for the time being + test.skip('get: only required params', async () => { + const responsePromise = cloudflare.logpush.jobs.get(1, { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -117,12 +162,10 @@ describe('resource jobs', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.logpush.jobs.get('string', '023e105f4ecef8ad9ca31a8372d0c353', 1, { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('get: required and optional params', async () => { + const response = await cloudflare.logpush.jobs.get(1, { + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); }); diff --git a/tests/api-resources/logpush/ownership.test.ts b/tests/api-resources/logpush/ownership.test.ts index 8019e12c60..ba1c105955 100644 --- a/tests/api-resources/logpush/ownership.test.ts +++ b/tests/api-resources/logpush/ownership.test.ts @@ -5,20 +5,21 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource ownership', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.logpush.ownership.create( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { destination_conf: 's3://mybucket/logs?region=us-west-2' }, - ); + const responsePromise = cloudflare.logpush.ownership.create({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + destination_conf: 's3://mybucket/logs?region=us-west-2', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -30,21 +31,21 @@ describe('resource ownership', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.logpush.ownership.create('string', '023e105f4ecef8ad9ca31a8372d0c353', { + const response = await cloudflare.logpush.ownership.create({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', destination_conf: 's3://mybucket/logs?region=us-west-2', }); }); // skipped: tests are disabled for the time being test.skip('validate: only required params', async () => { - const responsePromise = cloudflare.logpush.ownership.validate( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { - destination_conf: 's3://mybucket/logs?region=us-west-2', - ownership_challenge: '00000000000000000000', - }, - ); + const responsePromise = cloudflare.logpush.ownership.validate({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + destination_conf: 's3://mybucket/logs?region=us-west-2', + ownership_challenge: '00000000000000000000', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -56,13 +57,11 @@ describe('resource ownership', () => { // skipped: tests are disabled for the time being test.skip('validate: required and optional params', async () => { - const response = await cloudflare.logpush.ownership.validate( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { - destination_conf: 's3://mybucket/logs?region=us-west-2', - ownership_challenge: '00000000000000000000', - }, - ); + const response = await cloudflare.logpush.ownership.validate({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + destination_conf: 's3://mybucket/logs?region=us-west-2', + ownership_challenge: '00000000000000000000', + }); }); }); diff --git a/tests/api-resources/logpush/validate.test.ts b/tests/api-resources/logpush/validate.test.ts index adfa5bd490..bce44e9268 100644 --- a/tests/api-resources/logpush/validate.test.ts +++ b/tests/api-resources/logpush/validate.test.ts @@ -5,20 +5,21 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource validate', () => { // skipped: tests are disabled for the time being test.skip('destination: only required params', async () => { - const responsePromise = cloudflare.logpush.validate.destination( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { destination_conf: 's3://mybucket/logs?region=us-west-2' }, - ); + const responsePromise = cloudflare.logpush.validate.destination({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + destination_conf: 's3://mybucket/logs?region=us-west-2', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -30,16 +31,18 @@ describe('resource validate', () => { // skipped: tests are disabled for the time being test.skip('destination: required and optional params', async () => { - const response = await cloudflare.logpush.validate.destination( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { destination_conf: 's3://mybucket/logs?region=us-west-2' }, - ); + const response = await cloudflare.logpush.validate.destination({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + destination_conf: 's3://mybucket/logs?region=us-west-2', + }); }); // skipped: tests are disabled for the time being test.skip('origin: only required params', async () => { - const responsePromise = cloudflare.logpush.validate.origin('string', '023e105f4ecef8ad9ca31a8372d0c353', { + const responsePromise = cloudflare.logpush.validate.origin({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', logpull_options: 'fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339', }); const rawResponse = await responsePromise.asResponse(); @@ -53,7 +56,9 @@ describe('resource validate', () => { // skipped: tests are disabled for the time being test.skip('origin: required and optional params', async () => { - const response = await cloudflare.logpush.validate.origin('string', '023e105f4ecef8ad9ca31a8372d0c353', { + const response = await cloudflare.logpush.validate.origin({ + account_id: 'string', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', logpull_options: 'fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339', }); }); diff --git a/tests/api-resources/logs/controls/cmb/config.test.ts b/tests/api-resources/logs/controls/cmb/config.test.ts index 3e568bdd19..8d749a6778 100644 --- a/tests/api-resources/logs/controls/cmb/config.test.ts +++ b/tests/api-resources/logs/controls/cmb/config.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/logs/controls/retentions/flags.test.ts b/tests/api-resources/logs/controls/retentions/flags.test.ts index 2eae62d3af..9f87cf5425 100644 --- a/tests/api-resources/logs/controls/retentions/flags.test.ts +++ b/tests/api-resources/logs/controls/retentions/flags.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/logs/rayids.test.ts b/tests/api-resources/logs/rayids.test.ts index 1d8c495685..a3d0a8a322 100644 --- a/tests/api-resources/logs/rayids.test.ts +++ b/tests/api-resources/logs/rayids.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/logs/received/fields.test.ts b/tests/api-resources/logs/received/fields.test.ts index d1b0d79b78..c166740171 100644 --- a/tests/api-resources/logs/received/fields.test.ts +++ b/tests/api-resources/logs/received/fields.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/logs/received/received.test.ts b/tests/api-resources/logs/received/received.test.ts index 812903eedf..a793ad6622 100644 --- a/tests/api-resources/logs/received/received.test.ts +++ b/tests/api-resources/logs/received/received.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/magics/cf-interconnects.test.ts b/tests/api-resources/magics/cf-interconnects.test.ts index f41bcec9f3..2152d0cb0f 100644 --- a/tests/api-resources/magics/cf-interconnects.test.ts +++ b/tests/api-resources/magics/cf-interconnects.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/magics/gre-tunnels.test.ts b/tests/api-resources/magics/gre-tunnels.test.ts index 9b32ccbf0a..d773b1bce1 100644 --- a/tests/api-resources/magics/gre-tunnels.test.ts +++ b/tests/api-resources/magics/gre-tunnels.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/magics/ipsec-tunnels/ipsec-tunnels.test.ts b/tests/api-resources/magics/ipsec-tunnels/ipsec-tunnels.test.ts index 01c2e5feb2..1a748f2460 100644 --- a/tests/api-resources/magics/ipsec-tunnels/ipsec-tunnels.test.ts +++ b/tests/api-resources/magics/ipsec-tunnels/ipsec-tunnels.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/magics/ipsec-tunnels/psk-generates.test.ts b/tests/api-resources/magics/ipsec-tunnels/psk-generates.test.ts index abe59cb557..373bd1c0e5 100644 --- a/tests/api-resources/magics/ipsec-tunnels/psk-generates.test.ts +++ b/tests/api-resources/magics/ipsec-tunnels/psk-generates.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/magics/routes.test.ts b/tests/api-resources/magics/routes.test.ts index aa151cfc7c..77202588c1 100644 --- a/tests/api-resources/magics/routes.test.ts +++ b/tests/api-resources/magics/routes.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/managed-headers.test.ts b/tests/api-resources/managed-headers.test.ts index dd732b7caf..8965a85e1b 100644 --- a/tests/api-resources/managed-headers.test.ts +++ b/tests/api-resources/managed-headers.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/memberships.test.ts b/tests/api-resources/memberships.test.ts index 97aba18129..8118404df7 100644 --- a/tests/api-resources/memberships.test.ts +++ b/tests/api-resources/memberships.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/mnms/configs/configs.test.ts b/tests/api-resources/mnms/configs/configs.test.ts index 0b6cf6f60d..298407c532 100644 --- a/tests/api-resources/mnms/configs/configs.test.ts +++ b/tests/api-resources/mnms/configs/configs.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/mnms/configs/fulls.test.ts b/tests/api-resources/mnms/configs/fulls.test.ts index 0979fac455..d555c84bc6 100644 --- a/tests/api-resources/mnms/configs/fulls.test.ts +++ b/tests/api-resources/mnms/configs/fulls.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/mnms/rules/advertisements.test.ts b/tests/api-resources/mnms/rules/advertisements.test.ts index 32437916c4..196b7160ea 100644 --- a/tests/api-resources/mnms/rules/advertisements.test.ts +++ b/tests/api-resources/mnms/rules/advertisements.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/mnms/rules/rules.test.ts b/tests/api-resources/mnms/rules/rules.test.ts index b09d5234ba..bb8376d0b7 100644 --- a/tests/api-resources/mnms/rules/rules.test.ts +++ b/tests/api-resources/mnms/rules/rules.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/mtls-certificates/associations.test.ts b/tests/api-resources/mtls-certificates/associations.test.ts index 895151ac91..72e0f100f9 100644 --- a/tests/api-resources/mtls-certificates/associations.test.ts +++ b/tests/api-resources/mtls-certificates/associations.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/mtls-certificates/mtls-certificates.test.ts b/tests/api-resources/mtls-certificates/mtls-certificates.test.ts index 950d3b5eb0..5ab3fbc339 100644 --- a/tests/api-resources/mtls-certificates/mtls-certificates.test.ts +++ b/tests/api-resources/mtls-certificates/mtls-certificates.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/origin-post-quantum-encryption.test.ts b/tests/api-resources/origin-post-quantum-encryption.test.ts index 08b4bf83cb..ffc117d499 100644 --- a/tests/api-resources/origin-post-quantum-encryption.test.ts +++ b/tests/api-resources/origin-post-quantum-encryption.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/origin-tls-client-auth/hostnames/certificates.test.ts b/tests/api-resources/origin-tls-client-auth/hostnames/certificates.test.ts index 9a7350d41e..c3f8922954 100644 --- a/tests/api-resources/origin-tls-client-auth/hostnames/certificates.test.ts +++ b/tests/api-resources/origin-tls-client-auth/hostnames/certificates.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/origin-tls-client-auth/hostnames/hostnames.test.ts b/tests/api-resources/origin-tls-client-auth/hostnames/hostnames.test.ts index d9ba7fe0e7..2115dd613b 100644 --- a/tests/api-resources/origin-tls-client-auth/hostnames/hostnames.test.ts +++ b/tests/api-resources/origin-tls-client-auth/hostnames/hostnames.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/origin-tls-client-auth/origin-tls-client-auth.test.ts b/tests/api-resources/origin-tls-client-auth/origin-tls-client-auth.test.ts index cb838e278a..c773e8d4e3 100644 --- a/tests/api-resources/origin-tls-client-auth/origin-tls-client-auth.test.ts +++ b/tests/api-resources/origin-tls-client-auth/origin-tls-client-auth.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/origin-tls-client-auth/settings.test.ts b/tests/api-resources/origin-tls-client-auth/settings.test.ts index 2b39795937..049c78c14a 100644 --- a/tests/api-resources/origin-tls-client-auth/settings.test.ts +++ b/tests/api-resources/origin-tls-client-auth/settings.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/page-shield/connections.test.ts b/tests/api-resources/page-shield/connections.test.ts index f9a872bb0b..3c1e496b82 100644 --- a/tests/api-resources/page-shield/connections.test.ts +++ b/tests/api-resources/page-shield/connections.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/page-shield/page-shield.test.ts b/tests/api-resources/page-shield/page-shield.test.ts index 80a7e2e28c..84a06bf9ad 100644 --- a/tests/api-resources/page-shield/page-shield.test.ts +++ b/tests/api-resources/page-shield/page-shield.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/page-shield/policies.test.ts b/tests/api-resources/page-shield/policies.test.ts index ff40e20295..4685325fd6 100644 --- a/tests/api-resources/page-shield/policies.test.ts +++ b/tests/api-resources/page-shield/policies.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/page-shield/scripts.test.ts b/tests/api-resources/page-shield/scripts.test.ts index ea0a372be3..c4819b7562 100644 --- a/tests/api-resources/page-shield/scripts.test.ts +++ b/tests/api-resources/page-shield/scripts.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/pagerules/pagerules.test.ts b/tests/api-resources/pagerules/pagerules.test.ts index f7c3ceddad..83ebe24417 100644 --- a/tests/api-resources/pagerules/pagerules.test.ts +++ b/tests/api-resources/pagerules/pagerules.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/pagerules/settings.test.ts b/tests/api-resources/pagerules/settings.test.ts index df5ec0f9fb..a05f84d942 100644 --- a/tests/api-resources/pagerules/settings.test.ts +++ b/tests/api-resources/pagerules/settings.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/pages/projects/deployments/deployments.test.ts b/tests/api-resources/pages/projects/deployments/deployments.test.ts index 1568821184..f56e270994 100644 --- a/tests/api-resources/pages/projects/deployments/deployments.test.ts +++ b/tests/api-resources/pages/projects/deployments/deployments.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/pages/projects/deployments/history/logs.test.ts b/tests/api-resources/pages/projects/deployments/history/logs.test.ts index 443daad7ad..eb84141a17 100644 --- a/tests/api-resources/pages/projects/deployments/history/logs.test.ts +++ b/tests/api-resources/pages/projects/deployments/history/logs.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/pages/projects/domains.test.ts b/tests/api-resources/pages/projects/domains.test.ts index c54eb0c381..f565a9d7e0 100644 --- a/tests/api-resources/pages/projects/domains.test.ts +++ b/tests/api-resources/pages/projects/domains.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/pages/projects/projects.test.ts b/tests/api-resources/pages/projects/projects.test.ts index 534aaa7527..e5d0ba83c0 100644 --- a/tests/api-resources/pages/projects/projects.test.ts +++ b/tests/api-resources/pages/projects/projects.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/pcaps/downloads.test.ts b/tests/api-resources/pcaps/downloads.test.ts index aadee92aea..5907e07345 100644 --- a/tests/api-resources/pcaps/downloads.test.ts +++ b/tests/api-resources/pcaps/downloads.test.ts @@ -4,9 +4,10 @@ import Cloudflare from 'cloudflare'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/pcaps/ownerships.test.ts b/tests/api-resources/pcaps/ownerships.test.ts index 5d4283a888..98175d458c 100644 --- a/tests/api-resources/pcaps/ownerships.test.ts +++ b/tests/api-resources/pcaps/ownerships.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/pcaps/pcaps.test.ts b/tests/api-resources/pcaps/pcaps.test.ts index 31d6f9c1df..fd7445f0ed 100644 --- a/tests/api-resources/pcaps/pcaps.test.ts +++ b/tests/api-resources/pcaps/pcaps.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); @@ -15,7 +16,6 @@ describe('resource pcaps', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { const responsePromise = cloudflare.pcaps.create('023e105f4ecef8ad9ca31a8372d0c353', { - packet_limit: 10000, system: 'magic-transit', time_limit: 300, type: 'simple', @@ -32,10 +32,12 @@ describe('resource pcaps', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { const response = await cloudflare.pcaps.create('023e105f4ecef8ad9ca31a8372d0c353', { - packet_limit: 10000, system: 'magic-transit', time_limit: 300, type: 'simple', + byte_limit: 500000, + colo_name: 'ord02', + destination_conf: 's3://pcaps-bucket?region=us-east-1', filter_v1: { destination_address: '1.2.3.4', destination_port: 80, @@ -43,6 +45,7 @@ describe('resource pcaps', () => { source_address: '1.2.3.4', source_port: 123, }, + packet_limit: 10000, }); }); diff --git a/tests/api-resources/r2/buckets.test.ts b/tests/api-resources/r2/buckets.test.ts index 6e0c232df9..f80198b81b 100644 --- a/tests/api-resources/r2/buckets.test.ts +++ b/tests/api-resources/r2/buckets.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/r2/sippy.test.ts b/tests/api-resources/r2/sippy.test.ts new file mode 100644 index 0000000000..25c766104d --- /dev/null +++ b/tests/api-resources/r2/sippy.test.ts @@ -0,0 +1,75 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource sippy', () => { + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.r2.sippy.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'example-bucket', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('delete', async () => { + const responsePromise = cloudflare.r2.sippy.delete('023e105f4ecef8ad9ca31a8372d0c353', 'example-bucket'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('delete: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.r2.sippy.delete('023e105f4ecef8ad9ca31a8372d0c353', 'example-bucket', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.r2.sippy.get('023e105f4ecef8ad9ca31a8372d0c353', 'example-bucket'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.r2.sippy.get('023e105f4ecef8ad9ca31a8372d0c353', 'example-bucket', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/annotations/outages/outages.test.ts b/tests/api-resources/radar/annotations/outages.test.ts similarity index 72% rename from tests/api-resources/radar/annotations/outages/outages.test.ts rename to tests/api-resources/radar/annotations/outages.test.ts index e416a573dd..78b53460f4 100644 --- a/tests/api-resources/radar/annotations/outages/outages.test.ts +++ b/tests/api-resources/radar/annotations/outages.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource outages', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.annotations.outages.list(); + test.skip('locations', async () => { + const responsePromise = cloudflare.radar.annotations.outages.locations(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,27 +26,24 @@ describe('resource outages', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { + test.skip('locations: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.annotations.outages.list({ path: '/_stainless_unknown_path' }), + cloudflare.radar.annotations.outages.locations({ path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { + test.skip('locations: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.annotations.outages.list( + cloudflare.radar.annotations.outages.locations( { - asn: 0, dateEnd: '2023-09-01T11:41:33.782Z', dateRange: '7d', dateStart: '2023-09-01T11:41:33.782Z', format: 'JSON', limit: 5, - location: 'US', - offset: 0, }, { path: '/_stainless_unknown_path' }, ), diff --git a/tests/api-resources/radar/annotations/outages/locations.test.ts b/tests/api-resources/radar/annotations/outages/locations.test.ts deleted file mode 100644 index f01aebf41c..0000000000 --- a/tests/api-resources/radar/annotations/outages/locations.test.ts +++ /dev/null @@ -1,51 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource locations', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.annotations.outages.locations.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.annotations.outages.locations.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.annotations.outages.locations.list( - { - dateEnd: '2023-09-01T11:41:33.782Z', - dateRange: '7d', - dateStart: '2023-09-01T11:41:33.782Z', - format: 'JSON', - limit: 5, - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/as112/timeseries-groups/edns.test.ts b/tests/api-resources/radar/as112/as112.test.ts similarity index 70% rename from tests/api-resources/radar/as112/timeseries-groups/edns.test.ts rename to tests/api-resources/radar/as112/as112.test.ts index 4ded027105..6db8b44cd8 100644 --- a/tests/api-resources/radar/as112/timeseries-groups/edns.test.ts +++ b/tests/api-resources/radar/as112/as112.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource edns', () => { +describe('resource as112', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.as112.timeseriesGroups.edns.list(); + test.skip('timeseries', async () => { + const responsePromise = cloudflare.radar.as112.timeseries(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,18 +26,18 @@ describe('resource edns', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { + test.skip('timeseries: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.as112.timeseriesGroups.edns.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); + await expect(cloudflare.radar.as112.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); }); // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { + test.skip('timeseries: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.as112.timeseriesGroups.edns.list( + cloudflare.radar.as112.timeseries( { aggInterval: '1h', asn: ['string', 'string', 'string'], diff --git a/tests/api-resources/radar/as112/summary.test.ts b/tests/api-resources/radar/as112/summary.test.ts new file mode 100644 index 0000000000..7d96cb9585 --- /dev/null +++ b/tests/api-resources/radar/as112/summary.test.ts @@ -0,0 +1,249 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource summary', () => { + // skipped: tests are disabled for the time being + test.skip('dnssec', async () => { + const responsePromise = cloudflare.radar.as112.summary.dnssec(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('dnssec: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(cloudflare.radar.as112.summary.dnssec({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + // skipped: tests are disabled for the time being + test.skip('dnssec: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.summary.dnssec( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('edns', async () => { + const responsePromise = cloudflare.radar.as112.summary.edns(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('edns: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(cloudflare.radar.as112.summary.edns({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + // skipped: tests are disabled for the time being + test.skip('edns: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.summary.edns( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion', async () => { + const responsePromise = cloudflare.radar.as112.summary.ipVersion(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.summary.ipVersion({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.summary.ipVersion( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('protocol', async () => { + const responsePromise = cloudflare.radar.as112.summary.protocol(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('protocol: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.summary.protocol({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('protocol: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.summary.protocol( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('queryType', async () => { + const responsePromise = cloudflare.radar.as112.summary.queryType(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('queryType: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.summary.queryType({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('queryType: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.summary.queryType( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('responseCodes', async () => { + const responsePromise = cloudflare.radar.as112.summary.responseCodes(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('responseCodes: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.summary.responseCodes({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('responseCodes: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.summary.responseCodes( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/as112/timeseries-groups.test.ts b/tests/api-resources/radar/as112/timeseries-groups.test.ts new file mode 100644 index 0000000000..d4129526fb --- /dev/null +++ b/tests/api-resources/radar/as112/timeseries-groups.test.ts @@ -0,0 +1,255 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource timeseriesGroups', () => { + // skipped: tests are disabled for the time being + test.skip('dnssec', async () => { + const responsePromise = cloudflare.radar.as112.timeseriesGroups.dnssec(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('dnssec: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.timeseriesGroups.dnssec({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('dnssec: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.timeseriesGroups.dnssec( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('edns', async () => { + const responsePromise = cloudflare.radar.as112.timeseriesGroups.edns(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('edns: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.timeseriesGroups.edns({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('edns: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.timeseriesGroups.edns( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion', async () => { + const responsePromise = cloudflare.radar.as112.timeseriesGroups.ipVersion(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.timeseriesGroups.ipVersion({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.timeseriesGroups.ipVersion( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('protocol', async () => { + const responsePromise = cloudflare.radar.as112.timeseriesGroups.protocol(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('protocol: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.timeseriesGroups.protocol({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('protocol: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.timeseriesGroups.protocol( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('queryType', async () => { + const responsePromise = cloudflare.radar.as112.timeseriesGroups.queryType(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('queryType: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.timeseriesGroups.queryType({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('queryType: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.timeseriesGroups.queryType( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('responseCodes', async () => { + const responsePromise = cloudflare.radar.as112.timeseriesGroups.responseCodes(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('responseCodes: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.timeseriesGroups.responseCodes({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('responseCodes: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.timeseriesGroups.responseCodes( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/as112/timeseries-groups/dnssec.test.ts b/tests/api-resources/radar/as112/timeseries-groups/dnssec.test.ts deleted file mode 100644 index bb5bcf76d6..0000000000 --- a/tests/api-resources/radar/as112/timeseries-groups/dnssec.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource dnssec', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.as112.timeseriesGroups.dnssec.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.as112.timeseriesGroups.dnssec.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.as112.timeseriesGroups.dnssec.list( - { - aggInterval: '1h', - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/as112/timeseries-groups/ip-version.test.ts b/tests/api-resources/radar/as112/timeseries-groups/ip-version.test.ts deleted file mode 100644 index 17a88b71c6..0000000000 --- a/tests/api-resources/radar/as112/timeseries-groups/ip-version.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource ipVersion', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.as112.timeseriesGroups.ipVersion.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.as112.timeseriesGroups.ipVersion.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.as112.timeseriesGroups.ipVersion.list( - { - aggInterval: '1h', - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/as112/top.test.ts b/tests/api-resources/radar/as112/top.test.ts new file mode 100644 index 0000000000..dbfc7b5d9d --- /dev/null +++ b/tests/api-resources/radar/as112/top.test.ts @@ -0,0 +1,178 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource top', () => { + // skipped: tests are disabled for the time being + test.skip('dnssec', async () => { + const responsePromise = cloudflare.radar.as112.top.dnssec('SUPPORTED'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('dnssec: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.top.dnssec('SUPPORTED', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('dnssec: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.top.dnssec( + 'SUPPORTED', + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('edns', async () => { + const responsePromise = cloudflare.radar.as112.top.edns('SUPPORTED'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('edns: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.top.edns('SUPPORTED', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('edns: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.top.edns( + 'SUPPORTED', + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion', async () => { + const responsePromise = cloudflare.radar.as112.top.ipVersion('IPv4'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.top.ipVersion('IPv4', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.top.ipVersion( + 'IPv4', + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('locations', async () => { + const responsePromise = cloudflare.radar.as112.top.locations(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('locations: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(cloudflare.radar.as112.top.locations({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + // skipped: tests are disabled for the time being + test.skip('locations: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.as112.top.locations( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/attacks/layer3/timeseries-groups/vector.test.ts b/tests/api-resources/radar/attacks/layer3/layer3.test.ts similarity index 72% rename from tests/api-resources/radar/attacks/layer3/timeseries-groups/vector.test.ts rename to tests/api-resources/radar/attacks/layer3/layer3.test.ts index c4482392df..ae5fba82e3 100644 --- a/tests/api-resources/radar/attacks/layer3/timeseries-groups/vector.test.ts +++ b/tests/api-resources/radar/attacks/layer3/layer3.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource vector', () => { +describe('resource layer3', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.attacks.layer3.timeseriesGroups.vector.list(); + test.skip('timeseries', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.timeseries(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,30 +26,31 @@ describe('resource vector', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { + test.skip('timeseries: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer3.timeseriesGroups.vector.list({ path: '/_stainless_unknown_path' }), + cloudflare.radar.attacks.layer3.timeseries({ path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { + test.skip('timeseries: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer3.timeseriesGroups.vector.list( + cloudflare.radar.attacks.layer3.timeseries( { aggInterval: '1h', + asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], direction: 'ORIGIN', format: 'JSON', ipVersion: ['IPv4', 'IPv6'], - limitPerGroup: 4, location: ['string', 'string', 'string'], + metric: 'BYTES', name: ['string', 'string', 'string'], - normalization: 'PERCENTAGE', + normalization: 'MIN0_MAX', protocol: ['UDP', 'TCP', 'ICMP'], }, { path: '/_stainless_unknown_path' }, diff --git a/tests/api-resources/radar/attacks/layer3/summary.test.ts b/tests/api-resources/radar/attacks/layer3/summary.test.ts new file mode 100644 index 0000000000..e60ca9fdfc --- /dev/null +++ b/tests/api-resources/radar/attacks/layer3/summary.test.ts @@ -0,0 +1,257 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource summary', () => { + // skipped: tests are disabled for the time being + test.skip('bitrate', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.summary.bitrate(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('bitrate: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.summary.bitrate({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('bitrate: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.summary.bitrate( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('duration', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.summary.duration(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('duration: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.summary.duration({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('duration: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.summary.duration( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.summary.get(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.summary.get({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.summary.get( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.summary.ipVersion(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.summary.ipVersion({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.summary.ipVersion( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('protocol', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.summary.protocol(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('protocol: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.summary.protocol({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('protocol: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.summary.protocol( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('vector', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.summary.vector(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('vector: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.summary.vector({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('vector: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.summary.vector( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/attacks/layer3/timeseries-groups.test.ts b/tests/api-resources/radar/attacks/layer3/timeseries-groups.test.ts new file mode 100644 index 0000000000..11aa335d5d --- /dev/null +++ b/tests/api-resources/radar/attacks/layer3/timeseries-groups.test.ts @@ -0,0 +1,355 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource timeseriesGroups', () => { + // skipped: tests are disabled for the time being + test.skip('bitrate', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.timeseriesGroups.bitrate(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('bitrate: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.timeseriesGroups.bitrate({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('bitrate: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.timeseriesGroups.bitrate( + { + aggInterval: '1h', + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + normalization: 'PERCENTAGE', + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('duration', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.timeseriesGroups.duration(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('duration: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.timeseriesGroups.duration({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('duration: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.timeseriesGroups.duration( + { + aggInterval: '1h', + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + normalization: 'PERCENTAGE', + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.timeseriesGroups.get(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.timeseriesGroups.get({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.timeseriesGroups.get( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('industry', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.timeseriesGroups.industry(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('industry: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.timeseriesGroups.industry({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('industry: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.timeseriesGroups.industry( + { + aggInterval: '1h', + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + limitPerGroup: 4, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + normalization: 'PERCENTAGE', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.timeseriesGroups.ipVersion(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.timeseriesGroups.ipVersion({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.timeseriesGroups.ipVersion( + { + aggInterval: '1h', + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + normalization: 'PERCENTAGE', + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('protocol', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.timeseriesGroups.protocol(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('protocol: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.timeseriesGroups.protocol({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('protocol: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.timeseriesGroups.protocol( + { + aggInterval: '1h', + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + normalization: 'PERCENTAGE', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('vector', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.timeseriesGroups.vector(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('vector: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.timeseriesGroups.vector({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('vector: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.timeseriesGroups.vector( + { + aggInterval: '1h', + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + limitPerGroup: 4, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + normalization: 'PERCENTAGE', + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('vertical', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.timeseriesGroups.vertical(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('vertical: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.timeseriesGroups.vertical({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('vertical: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.timeseriesGroups.vertical( + { + aggInterval: '1h', + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + limitPerGroup: 4, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + normalization: 'PERCENTAGE', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/attacks/layer3/timeseries-groups/industry.test.ts b/tests/api-resources/radar/attacks/layer3/timeseries-groups/industry.test.ts deleted file mode 100644 index d685c07089..0000000000 --- a/tests/api-resources/radar/attacks/layer3/timeseries-groups/industry.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource industry', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.attacks.layer3.timeseriesGroups.industry.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.attacks.layer3.timeseriesGroups.industry.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.attacks.layer3.timeseriesGroups.industry.list( - { - aggInterval: '1h', - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - direction: 'ORIGIN', - format: 'JSON', - ipVersion: ['IPv4', 'IPv6'], - limitPerGroup: 4, - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - normalization: 'PERCENTAGE', - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/attacks/layer3/timeseries-groups/protocol.test.ts b/tests/api-resources/radar/attacks/layer3/timeseries-groups/protocol.test.ts deleted file mode 100644 index 8936b2456b..0000000000 --- a/tests/api-resources/radar/attacks/layer3/timeseries-groups/protocol.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource protocol', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.attacks.layer3.timeseriesGroups.protocol.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.attacks.layer3.timeseriesGroups.protocol.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.attacks.layer3.timeseriesGroups.protocol.list( - { - aggInterval: '1h', - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - direction: 'ORIGIN', - format: 'JSON', - ipVersion: ['IPv4', 'IPv6'], - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - normalization: 'PERCENTAGE', - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/attacks/layer3/timeseries-groups/vertical.test.ts b/tests/api-resources/radar/attacks/layer3/timeseries-groups/vertical.test.ts deleted file mode 100644 index 6842ca1c15..0000000000 --- a/tests/api-resources/radar/attacks/layer3/timeseries-groups/vertical.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource vertical', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.attacks.layer3.timeseriesGroups.vertical.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.attacks.layer3.timeseriesGroups.vertical.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.attacks.layer3.timeseriesGroups.vertical.list( - { - aggInterval: '1h', - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - direction: 'ORIGIN', - format: 'JSON', - ipVersion: ['IPv4', 'IPv6'], - limitPerGroup: 4, - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - normalization: 'PERCENTAGE', - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/attacks/layer3/top/attacks.test.ts b/tests/api-resources/radar/attacks/layer3/top/attacks.test.ts deleted file mode 100644 index 73b2532ffb..0000000000 --- a/tests/api-resources/radar/attacks/layer3/top/attacks.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource attacks', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.attacks.layer3.top.attacks.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.attacks.layer3.top.attacks.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.attacks.layer3.top.attacks.list( - { - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - ipVersion: ['IPv4', 'IPv6'], - limit: 5, - limitDirection: 'ORIGIN', - limitPerLocation: 10, - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - protocol: ['UDP', 'TCP', 'ICMP'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/attacks/layer3/top/industry.test.ts b/tests/api-resources/radar/attacks/layer3/top/industry.test.ts deleted file mode 100644 index 92748177f0..0000000000 --- a/tests/api-resources/radar/attacks/layer3/top/industry.test.ts +++ /dev/null @@ -1,55 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource industry', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.attacks.layer3.top.industry.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.attacks.layer3.top.industry.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.attacks.layer3.top.industry.list( - { - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - ipVersion: ['IPv4', 'IPv6'], - limit: 5, - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - protocol: ['UDP', 'TCP', 'ICMP'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/attacks/layer3/top/locations.test.ts b/tests/api-resources/radar/attacks/layer3/top/locations.test.ts new file mode 100644 index 0000000000..553fa206ae --- /dev/null +++ b/tests/api-resources/radar/attacks/layer3/top/locations.test.ts @@ -0,0 +1,97 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource locations', () => { + // skipped: tests are disabled for the time being + test.skip('origin', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.top.locations.origin(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('origin: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.top.locations.origin({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('origin: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.top.locations.origin( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('target', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.top.locations.target(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('target: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.top.locations.target({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('target: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.top.locations.target( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/attacks/layer3/top/locations/origin.test.ts b/tests/api-resources/radar/attacks/layer3/top/locations/origin.test.ts deleted file mode 100644 index 519b76d127..0000000000 --- a/tests/api-resources/radar/attacks/layer3/top/locations/origin.test.ts +++ /dev/null @@ -1,55 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource origin', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.attacks.layer3.top.locations.origin.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.attacks.layer3.top.locations.origin.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.attacks.layer3.top.locations.origin.list( - { - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - ipVersion: ['IPv4', 'IPv6'], - limit: 5, - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - protocol: ['UDP', 'TCP', 'ICMP'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/attacks/layer3/top/locations/target.test.ts b/tests/api-resources/radar/attacks/layer3/top/locations/target.test.ts deleted file mode 100644 index 6244460174..0000000000 --- a/tests/api-resources/radar/attacks/layer3/top/locations/target.test.ts +++ /dev/null @@ -1,55 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource target', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.attacks.layer3.top.locations.target.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.attacks.layer3.top.locations.target.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.attacks.layer3.top.locations.target.list( - { - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - ipVersion: ['IPv4', 'IPv6'], - limit: 5, - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - protocol: ['UDP', 'TCP', 'ICMP'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/attacks/layer3/top/top.test.ts b/tests/api-resources/radar/attacks/layer3/top/top.test.ts new file mode 100644 index 0000000000..c726a86a5a --- /dev/null +++ b/tests/api-resources/radar/attacks/layer3/top/top.test.ts @@ -0,0 +1,140 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource top', () => { + // skipped: tests are disabled for the time being + test.skip('attacks', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.top.attacks(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('attacks: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.top.attacks({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('attacks: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.top.attacks( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + limitDirection: 'ORIGIN', + limitPerLocation: 10, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('industry', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.top.industry(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('industry: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.top.industry({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('industry: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.top.industry( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('vertical', async () => { + const responsePromise = cloudflare.radar.attacks.layer3.top.vertical(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('vertical: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.top.vertical({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('vertical: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer3.top.vertical( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/attacks/layer3/top/vertical.test.ts b/tests/api-resources/radar/attacks/layer3/top/vertical.test.ts deleted file mode 100644 index 6acf531842..0000000000 --- a/tests/api-resources/radar/attacks/layer3/top/vertical.test.ts +++ /dev/null @@ -1,55 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource vertical', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.attacks.layer3.top.vertical.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.attacks.layer3.top.vertical.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.attacks.layer3.top.vertical.list( - { - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - ipVersion: ['IPv4', 'IPv6'], - limit: 5, - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - protocol: ['UDP', 'TCP', 'ICMP'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/attacks/layer3/timeseries-groups/ip-version.test.ts b/tests/api-resources/radar/attacks/layer7/layer7.test.ts similarity index 68% rename from tests/api-resources/radar/attacks/layer3/timeseries-groups/ip-version.test.ts rename to tests/api-resources/radar/attacks/layer7/layer7.test.ts index be6c386d35..6169295a8f 100644 --- a/tests/api-resources/radar/attacks/layer3/timeseries-groups/ip-version.test.ts +++ b/tests/api-resources/radar/attacks/layer7/layer7.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource ipVersion', () => { +describe('resource layer7', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.attacks.layer3.timeseriesGroups.ipVersion.list(); + test.skip('timeseries', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.timeseries(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,28 +26,31 @@ describe('resource ipVersion', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { + test.skip('timeseries: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer3.timeseriesGroups.ipVersion.list({ path: '/_stainless_unknown_path' }), + cloudflare.radar.attacks.layer7.timeseries({ path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { + test.skip('timeseries: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer3.timeseriesGroups.ipVersion.list( + cloudflare.radar.attacks.layer7.timeseries( { aggInterval: '1h', + asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], direction: 'ORIGIN', format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], location: ['string', 'string', 'string'], + metric: 'BYTES', name: ['string', 'string', 'string'], - normalization: 'PERCENTAGE', + normalization: 'MIN0_MAX', protocol: ['UDP', 'TCP', 'ICMP'], }, { path: '/_stainless_unknown_path' }, diff --git a/tests/api-resources/radar/attacks/layer7/summary.test.ts b/tests/api-resources/radar/attacks/layer7/summary.test.ts new file mode 100644 index 0000000000..7479d456c6 --- /dev/null +++ b/tests/api-resources/radar/attacks/layer7/summary.test.ts @@ -0,0 +1,257 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource summary', () => { + // skipped: tests are disabled for the time being + test.skip('bitrate', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.summary.bitrate(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('bitrate: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.summary.bitrate({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('bitrate: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.summary.bitrate( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('duration', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.summary.duration(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('duration: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.summary.duration({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('duration: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.summary.duration( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.summary.get(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.summary.get({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.summary.get( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.summary.ipVersion(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.summary.ipVersion({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.summary.ipVersion( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('protocol', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.summary.protocol(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('protocol: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.summary.protocol({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('protocol: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.summary.protocol( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('vector', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.summary.vector(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('vector: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.summary.vector({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('vector: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.summary.vector( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/attacks/layer7/timeseries-groups.test.ts b/tests/api-resources/radar/attacks/layer7/timeseries-groups.test.ts new file mode 100644 index 0000000000..67d4ba8c55 --- /dev/null +++ b/tests/api-resources/radar/attacks/layer7/timeseries-groups.test.ts @@ -0,0 +1,355 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource timeseriesGroups', () => { + // skipped: tests are disabled for the time being + test.skip('bitrate', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.timeseriesGroups.bitrate(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('bitrate: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.timeseriesGroups.bitrate({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('bitrate: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.timeseriesGroups.bitrate( + { + aggInterval: '1h', + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + normalization: 'PERCENTAGE', + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('duration', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.timeseriesGroups.duration(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('duration: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.timeseriesGroups.duration({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('duration: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.timeseriesGroups.duration( + { + aggInterval: '1h', + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + normalization: 'PERCENTAGE', + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.timeseriesGroups.get(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.timeseriesGroups.get({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.timeseriesGroups.get( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('industry', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.timeseriesGroups.industry(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('industry: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.timeseriesGroups.industry({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('industry: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.timeseriesGroups.industry( + { + aggInterval: '1h', + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + limitPerGroup: 4, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + normalization: 'PERCENTAGE', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.timeseriesGroups.ipVersion(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.timeseriesGroups.ipVersion({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.timeseriesGroups.ipVersion( + { + aggInterval: '1h', + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + normalization: 'PERCENTAGE', + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('protocol', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.timeseriesGroups.protocol(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('protocol: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.timeseriesGroups.protocol({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('protocol: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.timeseriesGroups.protocol( + { + aggInterval: '1h', + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + normalization: 'PERCENTAGE', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('vector', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.timeseriesGroups.vector(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('vector: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.timeseriesGroups.vector({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('vector: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.timeseriesGroups.vector( + { + aggInterval: '1h', + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + limitPerGroup: 4, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + normalization: 'PERCENTAGE', + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('vertical', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.timeseriesGroups.vertical(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('vertical: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.timeseriesGroups.vertical({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('vertical: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.timeseriesGroups.vertical( + { + aggInterval: '1h', + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + direction: 'ORIGIN', + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + limitPerGroup: 4, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + normalization: 'PERCENTAGE', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/attacks/layer7/top/locations.test.ts b/tests/api-resources/radar/attacks/layer7/top/locations.test.ts new file mode 100644 index 0000000000..2854d88933 --- /dev/null +++ b/tests/api-resources/radar/attacks/layer7/top/locations.test.ts @@ -0,0 +1,97 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource locations', () => { + // skipped: tests are disabled for the time being + test.skip('origin', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.top.locations.origin(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('origin: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.top.locations.origin({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('origin: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.top.locations.origin( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('target', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.top.locations.target(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('target: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.top.locations.target({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('target: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.top.locations.target( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/attacks/layer7/top/top.test.ts b/tests/api-resources/radar/attacks/layer7/top/top.test.ts new file mode 100644 index 0000000000..95153e8140 --- /dev/null +++ b/tests/api-resources/radar/attacks/layer7/top/top.test.ts @@ -0,0 +1,140 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource top', () => { + // skipped: tests are disabled for the time being + test.skip('attacks', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.top.attacks(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('attacks: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.top.attacks({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('attacks: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.top.attacks( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + limitDirection: 'ORIGIN', + limitPerLocation: 10, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('industry', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.top.industry(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('industry: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.top.industry({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('industry: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.top.industry( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('vertical', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.top.vertical(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('vertical: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.top.vertical({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('vertical: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.top.vertical( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + protocol: ['UDP', 'TCP', 'ICMP'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/bgp/timeseries.test.ts b/tests/api-resources/radar/bgp/bgp.test.ts similarity index 72% rename from tests/api-resources/radar/bgp/timeseries.test.ts rename to tests/api-resources/radar/bgp/bgp.test.ts index faeb600131..dd75e86ce0 100644 --- a/tests/api-resources/radar/bgp/timeseries.test.ts +++ b/tests/api-resources/radar/bgp/bgp.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource timeseries', () => { +describe('resource bgp', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.bgp.timeseries.list(); + test.skip('timeseries', async () => { + const responsePromise = cloudflare.radar.bgp.timeseries(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,18 +26,18 @@ describe('resource timeseries', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { + test.skip('timeseries: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(cloudflare.radar.bgp.timeseries.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + await expect(cloudflare.radar.bgp.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( Cloudflare.NotFoundError, ); }); // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { + test.skip('timeseries: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.bgp.timeseries.list( + cloudflare.radar.bgp.timeseries( { aggInterval: '1h', asn: ['string', 'string', 'string'], diff --git a/tests/api-resources/radar/bgp/hijacks.test.ts b/tests/api-resources/radar/bgp/hijacks.test.ts index b80b5bb5e0..8ad7529324 100644 --- a/tests/api-resources/radar/bgp/hijacks.test.ts +++ b/tests/api-resources/radar/bgp/hijacks.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource hijacks', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.bgp.hijacks.list(); + test.skip('events', async () => { + const responsePromise = cloudflare.radar.bgp.hijacks.events(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,18 +26,18 @@ describe('resource hijacks', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { + test.skip('events: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(cloudflare.radar.bgp.hijacks.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + await expect(cloudflare.radar.bgp.hijacks.events({ path: '/_stainless_unknown_path' })).rejects.toThrow( Cloudflare.NotFoundError, ); }); // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { + test.skip('events: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.bgp.hijacks.list( + cloudflare.radar.bgp.hijacks.events( { dateEnd: '2023-09-01T11:41:33.782Z', dateRange: '7d', diff --git a/tests/api-resources/radar/bgp/leaks/events.test.ts b/tests/api-resources/radar/bgp/leaks.test.ts similarity index 69% rename from tests/api-resources/radar/bgp/leaks/events.test.ts rename to tests/api-resources/radar/bgp/leaks.test.ts index 6ba93958de..42b4955fea 100644 --- a/tests/api-resources/radar/bgp/leaks/events.test.ts +++ b/tests/api-resources/radar/bgp/leaks.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource events', () => { +describe('resource leaks', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.bgp.leaks.events.list(); + test.skip('events', async () => { + const responsePromise = cloudflare.radar.bgp.leaks.events(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,18 +26,18 @@ describe('resource events', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { + test.skip('events: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.bgp.leaks.events.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); + await expect(cloudflare.radar.bgp.leaks.events({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); }); // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { + test.skip('events: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.bgp.leaks.events.list( + cloudflare.radar.bgp.leaks.events( { dateEnd: '2023-09-01T11:41:33.782Z', dateRange: '7d', diff --git a/tests/api-resources/radar/bgp/routes.test.ts b/tests/api-resources/radar/bgp/routes.test.ts new file mode 100644 index 0000000000..600a04cdf4 --- /dev/null +++ b/tests/api-resources/radar/bgp/routes.test.ts @@ -0,0 +1,108 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource routes', () => { + // skipped: tests are disabled for the time being + test.skip('moas', async () => { + const responsePromise = cloudflare.radar.bgp.routes.moas(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('moas: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(cloudflare.radar.bgp.routes.moas({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + // skipped: tests are disabled for the time being + test.skip('moas: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.bgp.routes.moas( + { format: 'JSON', invalid_only: true, origin: 0, prefix: 'string' }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('pfx2as', async () => { + const responsePromise = cloudflare.radar.bgp.routes.pfx2as(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('pfx2as: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(cloudflare.radar.bgp.routes.pfx2as({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + // skipped: tests are disabled for the time being + test.skip('pfx2as: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.bgp.routes.pfx2as( + { format: 'JSON', origin: 0, prefix: '1.1.1.0/24', rpkiStatus: 'INVALID' }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('stats', async () => { + const responsePromise = cloudflare.radar.bgp.routes.stats(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('stats: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(cloudflare.radar.bgp.routes.stats({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + // skipped: tests are disabled for the time being + test.skip('stats: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.bgp.routes.stats( + { asn: 0, format: 'JSON', location: 'US' }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/bgp/routes/moas.test.ts b/tests/api-resources/radar/bgp/routes/moas.test.ts deleted file mode 100644 index f4bbdc13b1..0000000000 --- a/tests/api-resources/radar/bgp/routes/moas.test.ts +++ /dev/null @@ -1,45 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource moas', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.bgp.routes.moas.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(cloudflare.radar.bgp.routes.moas.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.bgp.routes.moas.list( - { format: 'JSON', invalid_only: true, origin: 0, prefix: 'string' }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/bgp/routes/pfx2as.test.ts b/tests/api-resources/radar/bgp/routes/pfx2as.test.ts deleted file mode 100644 index 7c6ce22f46..0000000000 --- a/tests/api-resources/radar/bgp/routes/pfx2as.test.ts +++ /dev/null @@ -1,45 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource pfx2as', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.bgp.routes.pfx2as.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.bgp.routes.pfx2as.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.bgp.routes.pfx2as.list( - { format: 'JSON', origin: 0, prefix: '1.1.1.0/24', rpkiStatus: 'INVALID' }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/bgp/routes/stats.test.ts b/tests/api-resources/radar/bgp/routes/stats.test.ts deleted file mode 100644 index d4f7c4a0b9..0000000000 --- a/tests/api-resources/radar/bgp/routes/stats.test.ts +++ /dev/null @@ -1,45 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource stats', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.bgp.routes.stats.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.bgp.routes.stats.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.bgp.routes.stats.list( - { asn: 0, format: 'JSON', location: 'US' }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/bgp/tops/ases/prefixes.test.ts b/tests/api-resources/radar/bgp/tops/ases.test.ts similarity index 69% rename from tests/api-resources/radar/bgp/tops/ases/prefixes.test.ts rename to tests/api-resources/radar/bgp/tops/ases.test.ts index 80dce214d8..4d00eb1586 100644 --- a/tests/api-resources/radar/bgp/tops/ases/prefixes.test.ts +++ b/tests/api-resources/radar/bgp/tops/ases.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource prefixes', () => { +describe('resource ases', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.bgp.tops.ases.prefixes.list(); + test.skip('prefixes', async () => { + const responsePromise = cloudflare.radar.bgp.tops.ases.prefixes(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,18 +26,18 @@ describe('resource prefixes', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { + test.skip('prefixes: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.bgp.tops.ases.prefixes.list({ path: '/_stainless_unknown_path' }), + cloudflare.radar.bgp.tops.ases.prefixes({ path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { + test.skip('prefixes: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.bgp.tops.ases.prefixes.list( + cloudflare.radar.bgp.tops.ases.prefixes( { country: 'NZ', format: 'JSON', limit: 10 }, { path: '/_stainless_unknown_path' }, ), diff --git a/tests/api-resources/radar/bgp/tops/ases/ases.test.ts b/tests/api-resources/radar/bgp/tops/ases/ases.test.ts deleted file mode 100644 index b550a82514..0000000000 --- a/tests/api-resources/radar/bgp/tops/ases/ases.test.ts +++ /dev/null @@ -1,55 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource ases', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.bgp.tops.ases.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(cloudflare.radar.bgp.tops.ases.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.bgp.tops.ases.list( - { - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - limit: 5, - name: ['string', 'string', 'string'], - prefix: ['string', 'string', 'string'], - updateType: ['ANNOUNCEMENT', 'WITHDRAWAL'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/bgp/tops/prefixes.test.ts b/tests/api-resources/radar/bgp/tops/prefixes.test.ts deleted file mode 100644 index d2bb2c2280..0000000000 --- a/tests/api-resources/radar/bgp/tops/prefixes.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource prefixes', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.bgp.tops.prefixes.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.bgp.tops.prefixes.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.bgp.tops.prefixes.list( - { - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - limit: 5, - name: ['string', 'string', 'string'], - updateType: ['ANNOUNCEMENT', 'WITHDRAWAL'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/connection-tampering.test.ts b/tests/api-resources/radar/connection-tampering.test.ts new file mode 100644 index 0000000000..79b984dc89 --- /dev/null +++ b/tests/api-resources/radar/connection-tampering.test.ts @@ -0,0 +1,94 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource connectionTampering', () => { + // skipped: tests are disabled for the time being + test.skip('summary', async () => { + const responsePromise = cloudflare.radar.connectionTampering.summary(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('summary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.connectionTampering.summary({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('summary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.connectionTampering.summary( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('timeseriesGroups', async () => { + const responsePromise = cloudflare.radar.connectionTampering.timeseriesGroups(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('timeseriesGroups: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.connectionTampering.timeseriesGroups({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('timeseriesGroups: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.connectionTampering.timeseriesGroups( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/connection-tampering/connection-tampering.test.ts b/tests/api-resources/radar/connection-tampering/connection-tampering.test.ts deleted file mode 100644 index deda0f4229..0000000000 --- a/tests/api-resources/radar/connection-tampering/connection-tampering.test.ts +++ /dev/null @@ -1,53 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource connectionTampering', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.connectionTampering.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.connectionTampering.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.connectionTampering.list( - { - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/connection-tampering/timeseries-groups.test.ts b/tests/api-resources/radar/connection-tampering/timeseries-groups.test.ts deleted file mode 100644 index 0b7a677923..0000000000 --- a/tests/api-resources/radar/connection-tampering/timeseries-groups.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource timeseriesGroups', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.connectionTampering.timeseriesGroups.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.connectionTampering.timeseriesGroups.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.connectionTampering.timeseriesGroups.list( - { - aggInterval: '1h', - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/datasets/datasets.test.ts b/tests/api-resources/radar/datasets.test.ts similarity index 76% rename from tests/api-resources/radar/datasets/datasets.test.ts rename to tests/api-resources/radar/datasets.test.ts index b16a05d0c0..1950c13dab 100644 --- a/tests/api-resources/radar/datasets/datasets.test.ts +++ b/tests/api-resources/radar/datasets.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); @@ -43,6 +44,23 @@ describe('resource datasets', () => { ).rejects.toThrow(Cloudflare.NotFoundError); }); + // skipped: tests are disabled for the time being + test.skip('download: only required params', async () => { + const responsePromise = cloudflare.radar.datasets.download({ datasetId: 3 }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('download: required and optional params', async () => { + const response = await cloudflare.radar.datasets.download({ datasetId: 3, format: 'JSON' }); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.radar.datasets.get('ranking_top_1000'); diff --git a/tests/api-resources/radar/datasets/downloads.test.ts b/tests/api-resources/radar/datasets/downloads.test.ts deleted file mode 100644 index df873cb03f..0000000000 --- a/tests/api-resources/radar/datasets/downloads.test.ts +++ /dev/null @@ -1,31 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource downloads', () => { - // skipped: tests are disabled for the time being - test.skip('create: only required params', async () => { - const responsePromise = cloudflare.radar.datasets.downloads.create({ datasetId: 3 }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('create: required and optional params', async () => { - const response = await cloudflare.radar.datasets.downloads.create({ datasetId: 3, format: 'JSON' }); - }); -}); diff --git a/tests/api-resources/radar/dns/top.test.ts b/tests/api-resources/radar/dns/top.test.ts new file mode 100644 index 0000000000..96c4c6ad51 --- /dev/null +++ b/tests/api-resources/radar/dns/top.test.ts @@ -0,0 +1,69 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource top', () => { + // skipped: tests are disabled for the time being + test.skip('ases: only required params', async () => { + const responsePromise = cloudflare.radar.dns.top.ases({ domain: ['string', 'string', 'string'] }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('ases: required and optional params', async () => { + const response = await cloudflare.radar.dns.top.ases({ + domain: ['string', 'string', 'string'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }); + }); + + // skipped: tests are disabled for the time being + test.skip('locations: only required params', async () => { + const responsePromise = cloudflare.radar.dns.top.locations({ domain: ['string', 'string', 'string'] }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('locations: required and optional params', async () => { + const response = await cloudflare.radar.dns.top.locations({ + domain: ['string', 'string', 'string'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }); + }); +}); diff --git a/tests/api-resources/radar/dns/tops/ases.test.ts b/tests/api-resources/radar/dns/tops/ases.test.ts deleted file mode 100644 index abac03bdde..0000000000 --- a/tests/api-resources/radar/dns/tops/ases.test.ts +++ /dev/null @@ -1,41 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource ases', () => { - // skipped: tests are disabled for the time being - test.skip('list: only required params', async () => { - const responsePromise = cloudflare.radar.dns.tops.ases.list({ domain: ['string', 'string', 'string'] }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: required and optional params', async () => { - const response = await cloudflare.radar.dns.tops.ases.list({ - domain: ['string', 'string', 'string'], - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - limit: 5, - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - }); - }); -}); diff --git a/tests/api-resources/radar/dns/tops/locations.test.ts b/tests/api-resources/radar/dns/tops/locations.test.ts deleted file mode 100644 index f7bb43b374..0000000000 --- a/tests/api-resources/radar/dns/tops/locations.test.ts +++ /dev/null @@ -1,43 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource locations', () => { - // skipped: tests are disabled for the time being - test.skip('list: only required params', async () => { - const responsePromise = cloudflare.radar.dns.tops.locations.list({ - domain: ['string', 'string', 'string'], - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: required and optional params', async () => { - const response = await cloudflare.radar.dns.tops.locations.list({ - domain: ['string', 'string', 'string'], - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - limit: 5, - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - }); - }); -}); diff --git a/tests/api-resources/radar/email/security/summaries/arcs.test.ts b/tests/api-resources/radar/email/security/summaries/arcs.test.ts deleted file mode 100644 index a478587e42..0000000000 --- a/tests/api-resources/radar/email/security/summaries/arcs.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource arcs', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.email.security.summaries.arcs.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.email.security.summaries.arcs.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.email.security.summaries.arcs.list( - { - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dkim: ['PASS', 'NONE', 'FAIL'], - dmarc: ['PASS', 'NONE', 'FAIL'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - spf: ['PASS', 'NONE', 'FAIL'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/email/security/summaries/dkims.test.ts b/tests/api-resources/radar/email/security/summaries/dkims.test.ts deleted file mode 100644 index b97fdff0ab..0000000000 --- a/tests/api-resources/radar/email/security/summaries/dkims.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource dkims', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.email.security.summaries.dkims.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.email.security.summaries.dkims.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.email.security.summaries.dkims.list( - { - arc: ['PASS', 'NONE', 'FAIL'], - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dmarc: ['PASS', 'NONE', 'FAIL'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - spf: ['PASS', 'NONE', 'FAIL'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/email/security/summaries/dmarcs.test.ts b/tests/api-resources/radar/email/security/summaries/dmarcs.test.ts deleted file mode 100644 index a6a1afe356..0000000000 --- a/tests/api-resources/radar/email/security/summaries/dmarcs.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource dmarcs', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.email.security.summaries.dmarcs.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.email.security.summaries.dmarcs.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.email.security.summaries.dmarcs.list( - { - arc: ['PASS', 'NONE', 'FAIL'], - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dkim: ['PASS', 'NONE', 'FAIL'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - spf: ['PASS', 'NONE', 'FAIL'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/email/security/summaries/malicious.test.ts b/tests/api-resources/radar/email/security/summaries/malicious.test.ts deleted file mode 100644 index ca33713f93..0000000000 --- a/tests/api-resources/radar/email/security/summaries/malicious.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource malicious', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.email.security.summaries.malicious.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.email.security.summaries.malicious.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.email.security.summaries.malicious.list( - { - arc: ['PASS', 'NONE', 'FAIL'], - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dkim: ['PASS', 'NONE', 'FAIL'], - dmarc: ['PASS', 'NONE', 'FAIL'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - spf: ['PASS', 'NONE', 'FAIL'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/email/security/summaries/spams.test.ts b/tests/api-resources/radar/email/security/summaries/spams.test.ts deleted file mode 100644 index cc3bfbaf59..0000000000 --- a/tests/api-resources/radar/email/security/summaries/spams.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource spams', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.email.security.summaries.spams.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.email.security.summaries.spams.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.email.security.summaries.spams.list( - { - arc: ['PASS', 'NONE', 'FAIL'], - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dkim: ['PASS', 'NONE', 'FAIL'], - dmarc: ['PASS', 'NONE', 'FAIL'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - spf: ['PASS', 'NONE', 'FAIL'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/email/security/summaries/spfs.test.ts b/tests/api-resources/radar/email/security/summaries/spfs.test.ts deleted file mode 100644 index 2866c6335c..0000000000 --- a/tests/api-resources/radar/email/security/summaries/spfs.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource spfs', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.email.security.summaries.spfs.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.email.security.summaries.spfs.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.email.security.summaries.spfs.list( - { - arc: ['PASS', 'NONE', 'FAIL'], - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dkim: ['PASS', 'NONE', 'FAIL'], - dmarc: ['PASS', 'NONE', 'FAIL'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/email/security/summaries/threat-categories.test.ts b/tests/api-resources/radar/email/security/summaries/threat-categories.test.ts deleted file mode 100644 index 1824a7c609..0000000000 --- a/tests/api-resources/radar/email/security/summaries/threat-categories.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource threatCategories', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.email.security.summaries.threatCategories.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.email.security.summaries.threatCategories.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.email.security.summaries.threatCategories.list( - { - arc: ['PASS', 'NONE', 'FAIL'], - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dkim: ['PASS', 'NONE', 'FAIL'], - dmarc: ['PASS', 'NONE', 'FAIL'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - spf: ['PASS', 'NONE', 'FAIL'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/email/security/summary.test.ts b/tests/api-resources/radar/email/security/summary.test.ts new file mode 100644 index 0000000000..45b99b395f --- /dev/null +++ b/tests/api-resources/radar/email/security/summary.test.ts @@ -0,0 +1,312 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource summary', () => { + // skipped: tests are disabled for the time being + test.skip('arc', async () => { + const responsePromise = cloudflare.radar.email.security.summary.arc(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('arc: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.summary.arc({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('arc: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.summary.arc( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('dkim', async () => { + const responsePromise = cloudflare.radar.email.security.summary.dkim(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('dkim: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.summary.dkim({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('dkim: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.summary.dkim( + { + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('dmarc', async () => { + const responsePromise = cloudflare.radar.email.security.summary.dmarc(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('dmarc: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.summary.dmarc({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('dmarc: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.summary.dmarc( + { + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('malicious', async () => { + const responsePromise = cloudflare.radar.email.security.summary.malicious(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('malicious: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.summary.malicious({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('malicious: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.summary.malicious( + { + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('spam', async () => { + const responsePromise = cloudflare.radar.email.security.summary.spam(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('spam: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.summary.spam({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('spam: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.summary.spam( + { + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('spf', async () => { + const responsePromise = cloudflare.radar.email.security.summary.spf(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('spf: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.summary.spf({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('spf: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.summary.spf( + { + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('threatCategory', async () => { + const responsePromise = cloudflare.radar.email.security.summary.threatCategory(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('threatCategory: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.summary.threatCategory({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('threatCategory: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.summary.threatCategory( + { + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/email/security/timeseries-groups.test.ts b/tests/api-resources/radar/email/security/timeseries-groups.test.ts new file mode 100644 index 0000000000..7275863a78 --- /dev/null +++ b/tests/api-resources/radar/email/security/timeseries-groups.test.ts @@ -0,0 +1,101 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource timeseriesGroups', () => { + // skipped: tests are disabled for the time being + test.skip('arc', async () => { + const responsePromise = cloudflare.radar.email.security.timeseriesGroups.arc(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('arc: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.timeseriesGroups.arc({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('arc: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.timeseriesGroups.arc( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('dkim', async () => { + const responsePromise = cloudflare.radar.email.security.timeseriesGroups.dkim(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('dkim: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.timeseriesGroups.dkim({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('dkim: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.timeseriesGroups.dkim( + { + aggInterval: '1h', + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/email/security/timeseries-groups/arcs.test.ts b/tests/api-resources/radar/email/security/timeseries-groups/arcs.test.ts deleted file mode 100644 index 067cbf885a..0000000000 --- a/tests/api-resources/radar/email/security/timeseries-groups/arcs.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource arcs', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.email.security.timeseriesGroups.arcs.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.email.security.timeseriesGroups.arcs.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.email.security.timeseriesGroups.arcs.list( - { - aggInterval: '1h', - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dkim: ['PASS', 'NONE', 'FAIL'], - dmarc: ['PASS', 'NONE', 'FAIL'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - spf: ['PASS', 'NONE', 'FAIL'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/email/security/timeseries-groups/dkims.test.ts b/tests/api-resources/radar/email/security/timeseries-groups/dkims.test.ts deleted file mode 100644 index 2f9573d47b..0000000000 --- a/tests/api-resources/radar/email/security/timeseries-groups/dkims.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource dkims', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.email.security.timeseriesGroups.dkims.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.email.security.timeseriesGroups.dkims.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.email.security.timeseriesGroups.dkims.list( - { - aggInterval: '1h', - arc: ['PASS', 'NONE', 'FAIL'], - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dmarc: ['PASS', 'NONE', 'FAIL'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - spf: ['PASS', 'NONE', 'FAIL'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/emails/security/dmarc.test.ts b/tests/api-resources/radar/emails/security/dmarc.test.ts deleted file mode 100644 index 13eabc81bb..0000000000 --- a/tests/api-resources/radar/emails/security/dmarc.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource dmarc', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.emails.security.dmarc.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.emails.security.dmarc.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.emails.security.dmarc.list( - { - aggInterval: '1h', - arc: ['PASS', 'NONE', 'FAIL'], - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dkim: ['PASS', 'NONE', 'FAIL'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - spf: ['PASS', 'NONE', 'FAIL'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/emails/security/malicious.test.ts b/tests/api-resources/radar/emails/security/malicious.test.ts deleted file mode 100644 index 8f247a41ae..0000000000 --- a/tests/api-resources/radar/emails/security/malicious.test.ts +++ /dev/null @@ -1,58 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource malicious', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.emails.security.malicious.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.emails.security.malicious.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.emails.security.malicious.list( - { - aggInterval: '1h', - arc: ['PASS', 'NONE', 'FAIL'], - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dkim: ['PASS', 'NONE', 'FAIL'], - dmarc: ['PASS', 'NONE', 'FAIL'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - spf: ['PASS', 'NONE', 'FAIL'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/emails/security/spam.test.ts b/tests/api-resources/radar/emails/security/spam.test.ts deleted file mode 100644 index e3e42483f1..0000000000 --- a/tests/api-resources/radar/emails/security/spam.test.ts +++ /dev/null @@ -1,58 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource spam', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.emails.security.spam.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.emails.security.spam.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.emails.security.spam.list( - { - aggInterval: '1h', - arc: ['PASS', 'NONE', 'FAIL'], - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dkim: ['PASS', 'NONE', 'FAIL'], - dmarc: ['PASS', 'NONE', 'FAIL'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - spf: ['PASS', 'NONE', 'FAIL'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/emails/security/spf.test.ts b/tests/api-resources/radar/emails/security/spf.test.ts deleted file mode 100644 index 707a83b381..0000000000 --- a/tests/api-resources/radar/emails/security/spf.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource spf', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.emails.security.spf.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.emails.security.spf.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.emails.security.spf.list( - { - aggInterval: '1h', - arc: ['PASS', 'NONE', 'FAIL'], - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dkim: ['PASS', 'NONE', 'FAIL'], - dmarc: ['PASS', 'NONE', 'FAIL'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/emails/security/threat-category.test.ts b/tests/api-resources/radar/emails/security/threat-category.test.ts deleted file mode 100644 index c9d4ec7f07..0000000000 --- a/tests/api-resources/radar/emails/security/threat-category.test.ts +++ /dev/null @@ -1,58 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource threatCategory', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.emails.security.threatCategory.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.emails.security.threatCategory.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.emails.security.threatCategory.list( - { - aggInterval: '1h', - arc: ['PASS', 'NONE', 'FAIL'], - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dkim: ['PASS', 'NONE', 'FAIL'], - dmarc: ['PASS', 'NONE', 'FAIL'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - spf: ['PASS', 'NONE', 'FAIL'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/emails/security/timeseries-groups.test.ts b/tests/api-resources/radar/emails/security/timeseries-groups.test.ts new file mode 100644 index 0000000000..9114f073ea --- /dev/null +++ b/tests/api-resources/radar/emails/security/timeseries-groups.test.ts @@ -0,0 +1,233 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource timeseriesGroups', () => { + // skipped: tests are disabled for the time being + test.skip('dmarc', async () => { + const responsePromise = cloudflare.radar.emails.security.timeseriesGroups.dmarc(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('dmarc: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.emails.security.timeseriesGroups.dmarc({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('dmarc: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.emails.security.timeseriesGroups.dmarc( + { + aggInterval: '1h', + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('malicious', async () => { + const responsePromise = cloudflare.radar.emails.security.timeseriesGroups.malicious(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('malicious: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.emails.security.timeseriesGroups.malicious({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('malicious: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.emails.security.timeseriesGroups.malicious( + { + aggInterval: '1h', + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('spam', async () => { + const responsePromise = cloudflare.radar.emails.security.timeseriesGroups.spam(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('spam: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.emails.security.timeseriesGroups.spam({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('spam: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.emails.security.timeseriesGroups.spam( + { + aggInterval: '1h', + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('spf', async () => { + const responsePromise = cloudflare.radar.emails.security.timeseriesGroups.spf(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('spf: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.emails.security.timeseriesGroups.spf({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('spf: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.emails.security.timeseriesGroups.spf( + { + aggInterval: '1h', + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('threatCategory', async () => { + const responsePromise = cloudflare.radar.emails.security.timeseriesGroups.threatCategory(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('threatCategory: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.emails.security.timeseriesGroups.threatCategory({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('threatCategory: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.emails.security.timeseriesGroups.threatCategory( + { + aggInterval: '1h', + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/emails/security/top/ases/ases.test.ts b/tests/api-resources/radar/emails/security/top/ases/ases.test.ts deleted file mode 100644 index fb3ba21d7c..0000000000 --- a/tests/api-resources/radar/emails/security/top/ases/ases.test.ts +++ /dev/null @@ -1,58 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource ases', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.emails.security.top.ases.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.emails.security.top.ases.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.emails.security.top.ases.list( - { - arc: ['PASS', 'NONE', 'FAIL'], - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dkim: ['PASS', 'NONE', 'FAIL'], - dmarc: ['PASS', 'NONE', 'FAIL'], - format: 'JSON', - limit: 5, - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - spf: ['PASS', 'NONE', 'FAIL'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/entities/asns.test.ts b/tests/api-resources/radar/entities/asns.test.ts index c48e85a7b4..75b4ce55b8 100644 --- a/tests/api-resources/radar/entities/asns.test.ts +++ b/tests/api-resources/radar/entities/asns.test.ts @@ -5,13 +5,90 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource asns', () => { + // skipped: tests are disabled for the time being + test.skip('list', async () => { + const responsePromise = cloudflare.radar.entities.asns.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(cloudflare.radar.entities.asns.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + // skipped: tests are disabled for the time being + test.skip('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.entities.asns.list( + { asn: '174,7922', format: 'JSON', limit: 5, location: 'US', offset: 0, orderBy: 'ASN' }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.entities.asns.get(3); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(cloudflare.radar.entities.asns.get(3, { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.entities.asns.get(3, { format: 'JSON' }, { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ip: only required params', async () => { + const responsePromise = cloudflare.radar.entities.asns.ip({ ip: '8.8.8.8' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('ip: required and optional params', async () => { + const response = await cloudflare.radar.entities.asns.ip({ ip: '8.8.8.8', format: 'JSON' }); + }); + // skipped: tests are disabled for the time being test.skip('rel', async () => { const responsePromise = cloudflare.radar.entities.asns.rel(3); diff --git a/tests/api-resources/radar/entities/entities.test.ts b/tests/api-resources/radar/entities/entities.test.ts index 2332f07dc3..2900a6ae19 100644 --- a/tests/api-resources/radar/entities/entities.test.ts +++ b/tests/api-resources/radar/entities/entities.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource entities', () => { // skipped: tests are disabled for the time being - test.skip('list: only required params', async () => { - const responsePromise = cloudflare.radar.entities.list({ ip: '8.8.8.8' }); + test.skip('get: only required params', async () => { + const responsePromise = cloudflare.radar.entities.get({ ip: '8.8.8.8' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,7 +26,7 @@ describe('resource entities', () => { }); // skipped: tests are disabled for the time being - test.skip('list: required and optional params', async () => { - const response = await cloudflare.radar.entities.list({ ip: '8.8.8.8', format: 'JSON' }); + test.skip('get: required and optional params', async () => { + const response = await cloudflare.radar.entities.get({ ip: '8.8.8.8', format: 'JSON' }); }); }); diff --git a/tests/api-resources/radar/entities/locations.test.ts b/tests/api-resources/radar/entities/locations.test.ts new file mode 100644 index 0000000000..b295ad2dd5 --- /dev/null +++ b/tests/api-resources/radar/entities/locations.test.ts @@ -0,0 +1,74 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource locations', () => { + // skipped: tests are disabled for the time being + test.skip('list', async () => { + const responsePromise = cloudflare.radar.entities.locations.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.entities.locations.list({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.entities.locations.list( + { format: 'JSON', limit: 5, location: 'US,CA', offset: 0 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.entities.locations.get('US'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.entities.locations.get('US', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.entities.locations.get('US', { format: 'JSON' }, { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/http/tls-version.test.ts b/tests/api-resources/radar/http/ases/ases.test.ts similarity index 73% rename from tests/api-resources/radar/http/tls-version.test.ts rename to tests/api-resources/radar/http/ases/ases.test.ts index 5e819c4908..97863245c7 100644 --- a/tests/api-resources/radar/http/tls-version.test.ts +++ b/tests/api-resources/radar/http/ases/ases.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource tlsVersion', () => { +describe('resource ases', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.http.tlsVersion.list(); + test.skip('get', async () => { + const responsePromise = cloudflare.radar.http.ases.get(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,20 +26,19 @@ describe('resource tlsVersion', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { + test.skip('get: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(cloudflare.radar.http.tlsVersion.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + await expect(cloudflare.radar.http.ases.get({ path: '/_stainless_unknown_path' })).rejects.toThrow( Cloudflare.NotFoundError, ); }); // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { + test.skip('get: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.http.tlsVersion.list( + cloudflare.radar.http.ases.get( { - aggInterval: '1h', asn: ['string', 'string', 'string'], botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], @@ -49,9 +49,11 @@ describe('resource tlsVersion', () => { httpProtocol: ['HTTP', 'HTTPS'], httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], ipVersion: ['IPv4', 'IPv6'], + limit: 5, location: ['string', 'string', 'string'], name: ['string', 'string', 'string'], os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], }, { path: '/_stainless_unknown_path' }, ), diff --git a/tests/api-resources/radar/emails/security/top/ases/dmarc.test.ts b/tests/api-resources/radar/http/ases/bot-class.test.ts similarity index 72% rename from tests/api-resources/radar/emails/security/top/ases/dmarc.test.ts rename to tests/api-resources/radar/http/ases/bot-class.test.ts index e4e06d811d..f770c704f4 100644 --- a/tests/api-resources/radar/emails/security/top/ases/dmarc.test.ts +++ b/tests/api-resources/radar/http/ases/bot-class.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource dmarc', () => { +describe('resource botClass', () => { // skipped: tests are disabled for the time being test.skip('get', async () => { - const responsePromise = cloudflare.radar.emails.security.top.ases.dmarc.get('PASS'); + const responsePromise = cloudflare.radar.http.ases.botClass.get('LIKELY_AUTOMATED'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -28,7 +29,7 @@ describe('resource dmarc', () => { test.skip('get: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.emails.security.top.ases.dmarc.get('PASS', { path: '/_stainless_unknown_path' }), + cloudflare.radar.http.ases.botClass.get('LIKELY_AUTOMATED', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); @@ -36,20 +37,23 @@ describe('resource dmarc', () => { test.skip('get: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.emails.security.top.ases.dmarc.get( - 'PASS', + cloudflare.radar.http.ases.botClass.get( + 'LIKELY_AUTOMATED', { - arc: ['PASS', 'NONE', 'FAIL'], asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dkim: ['PASS', 'NONE', 'FAIL'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], limit: 5, location: ['string', 'string', 'string'], name: ['string', 'string', 'string'], - spf: ['PASS', 'NONE', 'FAIL'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], }, { path: '/_stainless_unknown_path' }, ), diff --git a/tests/api-resources/radar/http/ases/device-type.test.ts b/tests/api-resources/radar/http/ases/device-type.test.ts new file mode 100644 index 0000000000..ca589ef69a --- /dev/null +++ b/tests/api-resources/radar/http/ases/device-type.test.ts @@ -0,0 +1,62 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource deviceType', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.http.ases.deviceType.get('DESKTOP'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.ases.deviceType.get('DESKTOP', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.ases.deviceType.get( + 'DESKTOP', + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/http/ases/http-method.test.ts b/tests/api-resources/radar/http/ases/http-method.test.ts new file mode 100644 index 0000000000..c74c55d2a2 --- /dev/null +++ b/tests/api-resources/radar/http/ases/http-method.test.ts @@ -0,0 +1,62 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource httpMethod', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.http.ases.httpMethod.get('HTTPv1'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.ases.httpMethod.get('HTTPv1', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.ases.httpMethod.get( + 'HTTPv1', + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/http/ases/http-protocol.test.ts b/tests/api-resources/radar/http/ases/http-protocol.test.ts new file mode 100644 index 0000000000..70590b68df --- /dev/null +++ b/tests/api-resources/radar/http/ases/http-protocol.test.ts @@ -0,0 +1,62 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource httpProtocol', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.http.ases.httpProtocol.get('HTTP'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.ases.httpProtocol.get('HTTP', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.ases.httpProtocol.get( + 'HTTP', + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/http/ases/ip-version.test.ts b/tests/api-resources/radar/http/ases/ip-version.test.ts new file mode 100644 index 0000000000..d5afd2de02 --- /dev/null +++ b/tests/api-resources/radar/http/ases/ip-version.test.ts @@ -0,0 +1,62 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource ipVersion', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.http.ases.ipVersion.get('IPv4'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.ases.ipVersion.get('IPv4', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.ases.ipVersion.get( + 'IPv4', + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/emails/security/top/ases/dkim.test.ts b/tests/api-resources/radar/http/ases/os.test.ts similarity index 71% rename from tests/api-resources/radar/emails/security/top/ases/dkim.test.ts rename to tests/api-resources/radar/http/ases/os.test.ts index bc834ec981..32159f4772 100644 --- a/tests/api-resources/radar/emails/security/top/ases/dkim.test.ts +++ b/tests/api-resources/radar/http/ases/os.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource dkim', () => { +describe('resource os', () => { // skipped: tests are disabled for the time being test.skip('get', async () => { - const responsePromise = cloudflare.radar.emails.security.top.ases.dkim.get('PASS'); + const responsePromise = cloudflare.radar.http.ases.os.get('WINDOWS'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -28,7 +29,7 @@ describe('resource dkim', () => { test.skip('get: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.emails.security.top.ases.dkim.get('PASS', { path: '/_stainless_unknown_path' }), + cloudflare.radar.http.ases.os.get('WINDOWS', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); @@ -36,20 +37,23 @@ describe('resource dkim', () => { test.skip('get: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.emails.security.top.ases.dkim.get( - 'PASS', + cloudflare.radar.http.ases.os.get( + 'WINDOWS', { - arc: ['PASS', 'NONE', 'FAIL'], asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dmarc: ['PASS', 'NONE', 'FAIL'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], limit: 5, location: ['string', 'string', 'string'], name: ['string', 'string', 'string'], - spf: ['PASS', 'NONE', 'FAIL'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], }, { path: '/_stainless_unknown_path' }, ), diff --git a/tests/api-resources/radar/http/ases/tls-version.test.ts b/tests/api-resources/radar/http/ases/tls-version.test.ts new file mode 100644 index 0000000000..f5d7dd4535 --- /dev/null +++ b/tests/api-resources/radar/http/ases/tls-version.test.ts @@ -0,0 +1,62 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource tlsVersion', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.http.ases.tlsVersion.get('TLSv1_0'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.ases.tlsVersion.get('TLSv1_0', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.ases.tlsVersion.get( + 'TLSv1_0', + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/http/locations/bot-class.test.ts b/tests/api-resources/radar/http/locations/bot-class.test.ts new file mode 100644 index 0000000000..2f6f65050a --- /dev/null +++ b/tests/api-resources/radar/http/locations/bot-class.test.ts @@ -0,0 +1,62 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource botClass', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.http.locations.botClass.get('LIKELY_AUTOMATED'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.locations.botClass.get('LIKELY_AUTOMATED', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.locations.botClass.get( + 'LIKELY_AUTOMATED', + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/http/locations/device-type.test.ts b/tests/api-resources/radar/http/locations/device-type.test.ts new file mode 100644 index 0000000000..d019dc885e --- /dev/null +++ b/tests/api-resources/radar/http/locations/device-type.test.ts @@ -0,0 +1,62 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource deviceType', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.http.locations.deviceType.get('DESKTOP'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.locations.deviceType.get('DESKTOP', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.locations.deviceType.get( + 'DESKTOP', + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/http/locations/http-method.test.ts b/tests/api-resources/radar/http/locations/http-method.test.ts new file mode 100644 index 0000000000..43b7fc63f5 --- /dev/null +++ b/tests/api-resources/radar/http/locations/http-method.test.ts @@ -0,0 +1,62 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource httpMethod', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.http.locations.httpMethod.get('HTTPv1'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.locations.httpMethod.get('HTTPv1', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.locations.httpMethod.get( + 'HTTPv1', + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/http/locations/http-protocol.test.ts b/tests/api-resources/radar/http/locations/http-protocol.test.ts new file mode 100644 index 0000000000..83eaf9c995 --- /dev/null +++ b/tests/api-resources/radar/http/locations/http-protocol.test.ts @@ -0,0 +1,62 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource httpProtocol', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.http.locations.httpProtocol.get('HTTP'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.locations.httpProtocol.get('HTTP', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.locations.httpProtocol.get( + 'HTTP', + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/http/locations/ip-version.test.ts b/tests/api-resources/radar/http/locations/ip-version.test.ts new file mode 100644 index 0000000000..fb9ddabdc4 --- /dev/null +++ b/tests/api-resources/radar/http/locations/ip-version.test.ts @@ -0,0 +1,62 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource ipVersion', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.http.locations.ipVersion.get('IPv4'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.locations.ipVersion.get('IPv4', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.locations.ipVersion.get( + 'IPv4', + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/http/locations/locations.test.ts b/tests/api-resources/radar/http/locations/locations.test.ts new file mode 100644 index 0000000000..36c10f2f9f --- /dev/null +++ b/tests/api-resources/radar/http/locations/locations.test.ts @@ -0,0 +1,62 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource locations', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.http.locations.get(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(cloudflare.radar.http.locations.get({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.locations.get( + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/http/locations/os.test.ts b/tests/api-resources/radar/http/locations/os.test.ts new file mode 100644 index 0000000000..7163ab6356 --- /dev/null +++ b/tests/api-resources/radar/http/locations/os.test.ts @@ -0,0 +1,62 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource os', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.http.locations.os.get('WINDOWS'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.locations.os.get('WINDOWS', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.locations.os.get( + 'WINDOWS', + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/emails/security/top/ases/arc.test.ts b/tests/api-resources/radar/http/locations/tls-version.test.ts similarity index 72% rename from tests/api-resources/radar/emails/security/top/ases/arc.test.ts rename to tests/api-resources/radar/http/locations/tls-version.test.ts index 9d7f8fe823..1ccd270f9a 100644 --- a/tests/api-resources/radar/emails/security/top/ases/arc.test.ts +++ b/tests/api-resources/radar/http/locations/tls-version.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource arc', () => { +describe('resource tlsVersion', () => { // skipped: tests are disabled for the time being test.skip('get', async () => { - const responsePromise = cloudflare.radar.emails.security.top.ases.arc.get('PASS'); + const responsePromise = cloudflare.radar.http.locations.tlsVersion.get('TLSv1_0'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -28,7 +29,7 @@ describe('resource arc', () => { test.skip('get: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.emails.security.top.ases.arc.get('PASS', { path: '/_stainless_unknown_path' }), + cloudflare.radar.http.locations.tlsVersion.get('TLSv1_0', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); @@ -36,20 +37,23 @@ describe('resource arc', () => { test.skip('get: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.emails.security.top.ases.arc.get( - 'PASS', + cloudflare.radar.http.locations.tlsVersion.get( + 'TLSv1_0', { asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dkim: ['PASS', 'NONE', 'FAIL'], - dmarc: ['PASS', 'NONE', 'FAIL'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], limit: 5, location: ['string', 'string', 'string'], name: ['string', 'string', 'string'], - spf: ['PASS', 'NONE', 'FAIL'], + os: ['WINDOWS', 'MACOSX', 'IOS'], }, { path: '/_stainless_unknown_path' }, ), diff --git a/tests/api-resources/radar/http/summary.test.ts b/tests/api-resources/radar/http/summary.test.ts new file mode 100644 index 0000000000..abdd5ba8ba --- /dev/null +++ b/tests/api-resources/radar/http/summary.test.ts @@ -0,0 +1,330 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource summary', () => { + // skipped: tests are disabled for the time being + test.skip('botClass', async () => { + const responsePromise = cloudflare.radar.http.summary.botClass(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('botClass: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.summary.botClass({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('botClass: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.summary.botClass( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('deviceType', async () => { + const responsePromise = cloudflare.radar.http.summary.deviceType(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('deviceType: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.summary.deviceType({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('deviceType: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.summary.deviceType( + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('httpProtocol', async () => { + const responsePromise = cloudflare.radar.http.summary.httpProtocol(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('httpProtocol: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.summary.httpProtocol({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('httpProtocol: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.summary.httpProtocol( + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('httpVersion', async () => { + const responsePromise = cloudflare.radar.http.summary.httpVersion(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('httpVersion: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.summary.httpVersion({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('httpVersion: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.summary.httpVersion( + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion', async () => { + const responsePromise = cloudflare.radar.http.summary.ipVersion(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.summary.ipVersion({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.summary.ipVersion( + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('os', async () => { + const responsePromise = cloudflare.radar.http.summary.os(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('os: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(cloudflare.radar.http.summary.os({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + // skipped: tests are disabled for the time being + test.skip('os: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.summary.os( + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('tlsVersion', async () => { + const responsePromise = cloudflare.radar.http.summary.tlsVersion(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('tlsVersion: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.summary.tlsVersion({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('tlsVersion: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.summary.tlsVersion( + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/http/timeseries-groups.test.ts b/tests/api-resources/radar/http/timeseries-groups.test.ts new file mode 100644 index 0000000000..57392e3301 --- /dev/null +++ b/tests/api-resources/radar/http/timeseries-groups.test.ts @@ -0,0 +1,432 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource timeseriesGroups', () => { + // skipped: tests are disabled for the time being + test.skip('botClass', async () => { + const responsePromise = cloudflare.radar.http.timeseriesGroups.botClass(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('botClass: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.timeseriesGroups.botClass({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('botClass: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.timeseriesGroups.botClass( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('browser', async () => { + const responsePromise = cloudflare.radar.http.timeseriesGroups.browser(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('browser: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.timeseriesGroups.browser({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('browser: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.timeseriesGroups.browser( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + limitPerGroup: 4, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('browserFamily', async () => { + const responsePromise = cloudflare.radar.http.timeseriesGroups.browserFamily(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('browserFamily: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.timeseriesGroups.browserFamily({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('browserFamily: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.timeseriesGroups.browserFamily( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('deviceType', async () => { + const responsePromise = cloudflare.radar.http.timeseriesGroups.deviceType(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('deviceType: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.timeseriesGroups.deviceType({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('deviceType: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.timeseriesGroups.deviceType( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('httpProtocol', async () => { + const responsePromise = cloudflare.radar.http.timeseriesGroups.httpProtocol(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('httpProtocol: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.timeseriesGroups.httpProtocol({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('httpProtocol: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.timeseriesGroups.httpProtocol( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('httpVersion', async () => { + const responsePromise = cloudflare.radar.http.timeseriesGroups.httpVersion(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('httpVersion: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.timeseriesGroups.httpVersion({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('httpVersion: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.timeseriesGroups.httpVersion( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion', async () => { + const responsePromise = cloudflare.radar.http.timeseriesGroups.ipVersion(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.timeseriesGroups.ipVersion({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ipVersion: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.timeseriesGroups.ipVersion( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('os', async () => { + const responsePromise = cloudflare.radar.http.timeseriesGroups.os(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('os: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.timeseriesGroups.os({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('os: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.timeseriesGroups.os( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('tlsVersion', async () => { + const responsePromise = cloudflare.radar.http.timeseriesGroups.tlsVersion(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('tlsVersion: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.timeseriesGroups.tlsVersion({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('tlsVersion: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.timeseriesGroups.tlsVersion( + { + aggInterval: '1h', + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/http/top.test.ts b/tests/api-resources/radar/http/top.test.ts new file mode 100644 index 0000000000..17f34a7d09 --- /dev/null +++ b/tests/api-resources/radar/http/top.test.ts @@ -0,0 +1,109 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource top', () => { + // skipped: tests are disabled for the time being + test.skip('browserFamilies', async () => { + const responsePromise = cloudflare.radar.http.top.browserFamilies(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('browserFamilies: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.top.browserFamilies({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('browserFamilies: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.top.browserFamilies( + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('browsers', async () => { + const responsePromise = cloudflare.radar.http.top.browsers(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('browsers: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(cloudflare.radar.http.top.browsers({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + // skipped: tests are disabled for the time being + test.skip('browsers: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.http.top.browsers( + { + asn: ['string', 'string', 'string'], + botClass: ['LIKELY_AUTOMATED', 'LIKELY_HUMAN'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + deviceType: ['DESKTOP', 'MOBILE', 'OTHER'], + format: 'JSON', + httpProtocol: ['HTTP', 'HTTPS'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], + ipVersion: ['IPv4', 'IPv6'], + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + os: ['WINDOWS', 'MACOSX', 'IOS'], + tlsVersion: ['TLSv1_0', 'TLSv1_1', 'TLSv1_2'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/netflows/timeseries.test.ts b/tests/api-resources/radar/netflows/netflows.test.ts similarity index 73% rename from tests/api-resources/radar/netflows/timeseries.test.ts rename to tests/api-resources/radar/netflows/netflows.test.ts index 0d86f341b7..97594e323e 100644 --- a/tests/api-resources/radar/netflows/timeseries.test.ts +++ b/tests/api-resources/radar/netflows/netflows.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource timeseries', () => { +describe('resource netflows', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.netflows.timeseries.list(); + test.skip('timeseries', async () => { + const responsePromise = cloudflare.radar.netflows.timeseries(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,18 +26,18 @@ describe('resource timeseries', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { + test.skip('timeseries: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.netflows.timeseries.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); + await expect(cloudflare.radar.netflows.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); }); // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { + test.skip('timeseries: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.netflows.timeseries.list( + cloudflare.radar.netflows.timeseries( { aggInterval: '1h', asn: ['string', 'string', 'string'], diff --git a/tests/api-resources/radar/netflows/top.test.ts b/tests/api-resources/radar/netflows/top.test.ts new file mode 100644 index 0000000000..b2a404dfb8 --- /dev/null +++ b/tests/api-resources/radar/netflows/top.test.ts @@ -0,0 +1,95 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource top', () => { + // skipped: tests are disabled for the time being + test.skip('ases', async () => { + const responsePromise = cloudflare.radar.netflows.top.ases(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('ases: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(cloudflare.radar.netflows.top.ases({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + // skipped: tests are disabled for the time being + test.skip('ases: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.netflows.top.ases( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('locations', async () => { + const responsePromise = cloudflare.radar.netflows.top.locations(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('locations: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.netflows.top.locations({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('locations: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.netflows.top.locations( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/netflows/tops/ases.test.ts b/tests/api-resources/radar/netflows/tops/ases.test.ts deleted file mode 100644 index c531cf3cc0..0000000000 --- a/tests/api-resources/radar/netflows/tops/ases.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource ases', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.netflows.tops.ases.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.netflows.tops.ases.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.netflows.tops.ases.list( - { - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - limit: 5, - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/netflows/tops/locations.test.ts b/tests/api-resources/radar/netflows/tops/locations.test.ts deleted file mode 100644 index e846547c1c..0000000000 --- a/tests/api-resources/radar/netflows/tops/locations.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource locations', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.netflows.tops.locations.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.netflows.tops.locations.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.netflows.tops.locations.list( - { - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - limit: 5, - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/quality/iqi/iqi.test.ts b/tests/api-resources/radar/quality/iqi.test.ts similarity index 72% rename from tests/api-resources/radar/quality/iqi/iqi.test.ts rename to tests/api-resources/radar/quality/iqi.test.ts index e61f9f9012..118457f358 100644 --- a/tests/api-resources/radar/quality/iqi/iqi.test.ts +++ b/tests/api-resources/radar/quality/iqi.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource iqi', () => { // skipped: tests are disabled for the time being - test.skip('list: only required params', async () => { - const responsePromise = cloudflare.radar.quality.iqi.list({ metric: 'BANDWIDTH' }); + test.skip('summary: only required params', async () => { + const responsePromise = cloudflare.radar.quality.iqi.summary({ metric: 'BANDWIDTH' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,8 +26,8 @@ describe('resource iqi', () => { }); // skipped: tests are disabled for the time being - test.skip('list: required and optional params', async () => { - const response = await cloudflare.radar.quality.iqi.list({ + test.skip('summary: required and optional params', async () => { + const response = await cloudflare.radar.quality.iqi.summary({ metric: 'BANDWIDTH', asn: ['string', 'string', 'string'], continent: ['string', 'string', 'string'], diff --git a/tests/api-resources/radar/quality/iqi/timeseries-groups.test.ts b/tests/api-resources/radar/quality/iqi/timeseries-groups.test.ts deleted file mode 100644 index 9b03a4c802..0000000000 --- a/tests/api-resources/radar/quality/iqi/timeseries-groups.test.ts +++ /dev/null @@ -1,43 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource timeseriesGroups', () => { - // skipped: tests are disabled for the time being - test.skip('list: only required params', async () => { - const responsePromise = cloudflare.radar.quality.iqi.timeseriesGroups.list({ metric: 'BANDWIDTH' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: required and optional params', async () => { - const response = await cloudflare.radar.quality.iqi.timeseriesGroups.list({ - metric: 'BANDWIDTH', - aggInterval: '1h', - asn: ['string', 'string', 'string'], - continent: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - interpolation: true, - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - }); - }); -}); diff --git a/tests/api-resources/radar/quality/speed/histogram.test.ts b/tests/api-resources/radar/quality/speed/histogram.test.ts deleted file mode 100644 index 2fcf58edef..0000000000 --- a/tests/api-resources/radar/quality/speed/histogram.test.ts +++ /dev/null @@ -1,53 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource histogram', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.quality.speed.histogram.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.quality.speed.histogram.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.quality.speed.histogram.list( - { - asn: ['string', 'string', 'string'], - bucketSize: 0, - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - location: ['string', 'string', 'string'], - metricGroup: 'BANDWIDTH', - name: ['string', 'string', 'string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/quality/speed/speed.test.ts b/tests/api-resources/radar/quality/speed/speed.test.ts new file mode 100644 index 0000000000..adddeadc98 --- /dev/null +++ b/tests/api-resources/radar/quality/speed/speed.test.ts @@ -0,0 +1,91 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource speed', () => { + // skipped: tests are disabled for the time being + test.skip('histogram', async () => { + const responsePromise = cloudflare.radar.quality.speed.histogram(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('histogram: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.quality.speed.histogram({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('histogram: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.quality.speed.histogram( + { + asn: ['string', 'string', 'string'], + bucketSize: 0, + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + metricGroup: 'BANDWIDTH', + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('summary', async () => { + const responsePromise = cloudflare.radar.quality.speed.summary(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('summary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.quality.speed.summary({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('summary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.quality.speed.summary( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/quality/speed/summary.test.ts b/tests/api-resources/radar/quality/speed/summary.test.ts deleted file mode 100644 index 64644449be..0000000000 --- a/tests/api-resources/radar/quality/speed/summary.test.ts +++ /dev/null @@ -1,51 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource summary', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.quality.speed.summary.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.quality.speed.summary.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.quality.speed.summary.list( - { - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/quality/speed/top.test.ts b/tests/api-resources/radar/quality/speed/top.test.ts new file mode 100644 index 0000000000..b140383c7e --- /dev/null +++ b/tests/api-resources/radar/quality/speed/top.test.ts @@ -0,0 +1,95 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource top', () => { + // skipped: tests are disabled for the time being + test.skip('ases', async () => { + const responsePromise = cloudflare.radar.quality.speed.top.ases(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('ases: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.quality.speed.top.ases({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('ases: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.quality.speed.top.ases( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + orderBy: 'BANDWIDTH_DOWNLOAD', + reverse: true, + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('locations', async () => { + const responsePromise = cloudflare.radar.quality.speed.top.locations(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('locations: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.quality.speed.top.locations({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('locations: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.quality.speed.top.locations( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + orderBy: 'BANDWIDTH_DOWNLOAD', + reverse: true, + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/quality/speed/top/ases.test.ts b/tests/api-resources/radar/quality/speed/top/ases.test.ts deleted file mode 100644 index 9e18c09a6f..0000000000 --- a/tests/api-resources/radar/quality/speed/top/ases.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource ases', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.quality.speed.top.ases.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.quality.speed.top.ases.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.quality.speed.top.ases.list( - { - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - limit: 5, - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - orderBy: 'BANDWIDTH_DOWNLOAD', - reverse: true, - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/quality/speed/top/locations.test.ts b/tests/api-resources/radar/quality/speed/top/locations.test.ts deleted file mode 100644 index ee27ead64a..0000000000 --- a/tests/api-resources/radar/quality/speed/top/locations.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource locations', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.quality.speed.top.locations.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.quality.speed.top.locations.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.quality.speed.top.locations.list( - { - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - limit: 5, - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - orderBy: 'BANDWIDTH_DOWNLOAD', - reverse: true, - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ranking/timeseries-groups.test.ts b/tests/api-resources/radar/ranking/ranking.test.ts similarity index 74% rename from tests/api-resources/radar/ranking/timeseries-groups.test.ts rename to tests/api-resources/radar/ranking/ranking.test.ts index 410f065553..8697823cb8 100644 --- a/tests/api-resources/radar/ranking/timeseries-groups.test.ts +++ b/tests/api-resources/radar/ranking/ranking.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource timeseriesGroups', () => { +describe('resource ranking', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.ranking.timeseriesGroups.list(); + test.skip('timeseriesGroups', async () => { + const responsePromise = cloudflare.radar.ranking.timeseriesGroups(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,18 +26,18 @@ describe('resource timeseriesGroups', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { + test.skip('timeseriesGroups: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.ranking.timeseriesGroups.list({ path: '/_stainless_unknown_path' }), + cloudflare.radar.ranking.timeseriesGroups({ path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { + test.skip('timeseriesGroups: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.ranking.timeseriesGroups.list( + cloudflare.radar.ranking.timeseriesGroups( { dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], diff --git a/tests/api-resources/radar/searches/globals.test.ts b/tests/api-resources/radar/search.test.ts similarity index 66% rename from tests/api-resources/radar/searches/globals.test.ts rename to tests/api-resources/radar/search.test.ts index ff71064e1c..aa0ec4f2da 100644 --- a/tests/api-resources/radar/searches/globals.test.ts +++ b/tests/api-resources/radar/search.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource globals', () => { +describe('resource search', () => { // skipped: tests are disabled for the time being - test.skip('list: only required params', async () => { - const responsePromise = cloudflare.radar.searches.globals.list({ query: 'United' }); + test.skip('global: only required params', async () => { + const responsePromise = cloudflare.radar.search.global({ query: 'United' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,8 +26,8 @@ describe('resource globals', () => { }); // skipped: tests are disabled for the time being - test.skip('list: required and optional params', async () => { - const response = await cloudflare.radar.searches.globals.list({ + test.skip('global: required and optional params', async () => { + const response = await cloudflare.radar.search.global({ query: 'United', exclude: ['SPECIAL_EVENTS', 'NOTEBOOKS', 'LOCATIONS'], format: 'JSON', diff --git a/tests/api-resources/radar/traffic-anomalies/locations.test.ts b/tests/api-resources/radar/traffic-anomalies/locations.test.ts index 70c1d3737e..50a706ab4b 100644 --- a/tests/api-resources/radar/traffic-anomalies/locations.test.ts +++ b/tests/api-resources/radar/traffic-anomalies/locations.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource locations', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.trafficAnomalies.locations.list(); + test.skip('get', async () => { + const responsePromise = cloudflare.radar.trafficAnomalies.locations.get(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,18 +26,18 @@ describe('resource locations', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { + test.skip('get: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.trafficAnomalies.locations.list({ path: '/_stainless_unknown_path' }), + cloudflare.radar.trafficAnomalies.locations.get({ path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { + test.skip('get: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.trafficAnomalies.locations.list( + cloudflare.radar.trafficAnomalies.locations.get( { dateEnd: '2023-09-01T11:41:33.782Z', dateRange: '7d', diff --git a/tests/api-resources/radar/traffic-anomalies/traffic-anomalies.test.ts b/tests/api-resources/radar/traffic-anomalies/traffic-anomalies.test.ts index 4da30b7f03..027e946b52 100644 --- a/tests/api-resources/radar/traffic-anomalies/traffic-anomalies.test.ts +++ b/tests/api-resources/radar/traffic-anomalies/traffic-anomalies.test.ts @@ -5,16 +5,17 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource trafficAnomalies', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.trafficAnomalies.list(); + test.skip('get', async () => { + const responsePromise = cloudflare.radar.trafficAnomalies.get(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,18 +26,18 @@ describe('resource trafficAnomalies', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { + test.skip('get: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.trafficAnomalies.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); + await expect(cloudflare.radar.trafficAnomalies.get({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); }); // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { + test.skip('get: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.trafficAnomalies.list( + cloudflare.radar.trafficAnomalies.get( { asn: 0, dateEnd: '2023-09-01T11:41:33.782Z', diff --git a/tests/api-resources/radar/verified-bots/top.test.ts b/tests/api-resources/radar/verified-bots/top.test.ts new file mode 100644 index 0000000000..9035595a78 --- /dev/null +++ b/tests/api-resources/radar/verified-bots/top.test.ts @@ -0,0 +1,95 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource top', () => { + // skipped: tests are disabled for the time being + test.skip('bots', async () => { + const responsePromise = cloudflare.radar.verifiedBots.top.bots(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('bots: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.verifiedBots.top.bots({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('bots: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.verifiedBots.top.bots( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('categories', async () => { + const responsePromise = cloudflare.radar.verifiedBots.top.categories(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('categories: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.verifiedBots.top.categories({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('categories: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.verifiedBots.top.categories( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/verified-bots/tops/bots.test.ts b/tests/api-resources/radar/verified-bots/tops/bots.test.ts deleted file mode 100644 index f3009d1a2f..0000000000 --- a/tests/api-resources/radar/verified-bots/tops/bots.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource bots', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.verifiedBots.tops.bots.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.verifiedBots.tops.bots.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.verifiedBots.tops.bots.list( - { - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - limit: 5, - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/verified-bots/tops/categories.test.ts b/tests/api-resources/radar/verified-bots/tops/categories.test.ts deleted file mode 100644 index 2c65cc7342..0000000000 --- a/tests/api-resources/radar/verified-bots/tops/categories.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', - apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource categories', () => { - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.radar.verifiedBots.tops.categories.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.verifiedBots.tops.categories.list({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.verifiedBots.tops.categories.list( - { - asn: ['string', 'string', 'string'], - dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - dateRange: ['1d', '2d', '7d'], - dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - format: 'JSON', - limit: 5, - location: ['string', 'string', 'string'], - name: ['string', 'string', 'string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/rate-limits.test.ts b/tests/api-resources/rate-limits.test.ts index 4a1a9a7dc0..5c6a6ff7eb 100644 --- a/tests/api-resources/rate-limits.test.ts +++ b/tests/api-resources/rate-limits.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/registrar/domains.test.ts b/tests/api-resources/registrar/domains.test.ts index 9a518f3140..95bc0b56e6 100644 --- a/tests/api-resources/registrar/domains.test.ts +++ b/tests/api-resources/registrar/domains.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/request-tracers/traces.test.ts b/tests/api-resources/request-tracers/traces.test.ts index ae8ffbd964..e4f33ddfa2 100644 --- a/tests/api-resources/request-tracers/traces.test.ts +++ b/tests/api-resources/request-tracers/traces.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/roles.test.ts b/tests/api-resources/roles.test.ts index 916c57fc6a..3be4a6297f 100644 --- a/tests/api-resources/roles.test.ts +++ b/tests/api-resources/roles.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/rules/lists/bulk-operations.test.ts b/tests/api-resources/rules/lists/bulk-operations.test.ts index 5c2b537813..4c69925319 100644 --- a/tests/api-resources/rules/lists/bulk-operations.test.ts +++ b/tests/api-resources/rules/lists/bulk-operations.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/rules/lists/items.test.ts b/tests/api-resources/rules/lists/items.test.ts index cc7c9ff9e1..49ca1a7e6d 100644 --- a/tests/api-resources/rules/lists/items.test.ts +++ b/tests/api-resources/rules/lists/items.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/rules/lists/lists.test.ts b/tests/api-resources/rules/lists/lists.test.ts index 99dfbf9468..14c8f8df42 100644 --- a/tests/api-resources/rules/lists/lists.test.ts +++ b/tests/api-resources/rules/lists/lists.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/rulesets/phases.test.ts b/tests/api-resources/rulesets/phases.test.ts index fa653135cc..7947881fa2 100644 --- a/tests/api-resources/rulesets/phases.test.ts +++ b/tests/api-resources/rulesets/phases.test.ts @@ -5,20 +5,20 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource phases', () => { // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.rulesets.phases.get( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - 'http_request_firewall_custom', - ); + test.skip('get: only required params', async () => { + const responsePromise = cloudflare.rulesets.phases.get('http_request_firewall_custom', { + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -29,15 +29,10 @@ describe('resource phases', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.rulesets.phases.get( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - 'http_request_firewall_custom', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('get: required and optional params', async () => { + const response = await cloudflare.rulesets.phases.get('http_request_firewall_custom', { + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', + }); }); }); diff --git a/tests/api-resources/rulesets/rules.test.ts b/tests/api-resources/rulesets/rules.test.ts index 0254210148..77969a356f 100644 --- a/tests/api-resources/rulesets/rules.test.ts +++ b/tests/api-resources/rulesets/rules.test.ts @@ -5,21 +5,20 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource rules', () => { // skipped: tests are disabled for the time being - test.skip('create', async () => { - const responsePromise = cloudflare.rulesets.rules.create( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - '2f2feab2026849078ba485f918791bdc', - {}, - ); + test.skip('create: only required params', async () => { + const responsePromise = cloudflare.rulesets.rules.create('2f2feab2026849078ba485f918791bdc', { + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -30,12 +29,20 @@ describe('resource rules', () => { }); // skipped: tests are disabled for the time being - test.skip('delete', async () => { + test.skip('create: required and optional params', async () => { + const response = await cloudflare.rulesets.rules.create('2f2feab2026849078ba485f918791bdc', { + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', + position: { before: 'da5e8e506c8e7877fe06cdf4c41add54' }, + }); + }); + + // skipped: tests are disabled for the time being + test.skip('delete: only required params', async () => { const responsePromise = cloudflare.rulesets.rules.delete( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', '2f2feab2026849078ba485f918791bdc', '3a03d665bac047339bb530ecb439a90d', + { account_id: 'string', zone_id: 'abf9b32d38c5f572afde3336ec0ce302' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -47,17 +54,12 @@ describe('resource rules', () => { }); // skipped: tests are disabled for the time being - test.skip('delete: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.rulesets.rules.delete( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - '2f2feab2026849078ba485f918791bdc', - '3a03d665bac047339bb530ecb439a90d', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('delete: required and optional params', async () => { + const response = await cloudflare.rulesets.rules.delete( + '2f2feab2026849078ba485f918791bdc', + '3a03d665bac047339bb530ecb439a90d', + { account_id: 'string', zone_id: 'abf9b32d38c5f572afde3336ec0ce302' }, + ); }); // skipped: tests are disabled for the time being @@ -83,20 +85,7 @@ describe('resource rules', () => { '3a03d665bac047339bb530ecb439a90d', { account_id: 'abf9b32d38c5f572afde3336ec0ce302', - id: '3a03d665bac047339bb530ecb439a90d', - action: 'block', - action_parameters: { - response: { - content: '{\n "success": false,\n "error": "you have been blocked"\n}', - content_type: 'application/json', - status_code: 400, - }, - }, - description: 'Block when the IP address is not 1.1.1.1', - enabled: true, - expression: 'ip.src ne 1.1.1.1', - logging: { enabled: true }, - ref: 'my_ref', + position: { before: 'da5e8e506c8e7877fe06cdf4c41add54' }, }, ); }); diff --git a/tests/api-resources/rulesets/rulesets.test.ts b/tests/api-resources/rulesets/rulesets.test.ts index 5def20e0a8..b01984a06e 100644 --- a/tests/api-resources/rulesets/rulesets.test.ts +++ b/tests/api-resources/rulesets/rulesets.test.ts @@ -5,16 +5,19 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource rulesets', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.rulesets.create('string', 'abf9b32d38c5f572afde3336ec0ce302', { + const responsePromise = cloudflare.rulesets.create({ + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', kind: 'root', name: 'My ruleset', phase: 'http_request_firewall_custom', @@ -31,7 +34,9 @@ describe('resource rulesets', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.rulesets.create('string', 'abf9b32d38c5f572afde3336ec0ce302', { + const response = await cloudflare.rulesets.create({ + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', kind: 'root', name: 'My ruleset', phase: 'http_request_firewall_custom', @@ -91,12 +96,12 @@ describe('resource rulesets', () => { // skipped: tests are disabled for the time being test.skip('update: only required params', async () => { - const responsePromise = cloudflare.rulesets.update( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - '2f2feab2026849078ba485f918791bdc', - { id: '2f2feab2026849078ba485f918791bdc', rules: [{}, {}, {}] }, - ); + const responsePromise = cloudflare.rulesets.update('2f2feab2026849078ba485f918791bdc', { + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', + id: '2f2feab2026849078ba485f918791bdc', + rules: [{}, {}, {}], + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -108,73 +113,73 @@ describe('resource rulesets', () => { // skipped: tests are disabled for the time being test.skip('update: required and optional params', async () => { - const response = await cloudflare.rulesets.update( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - '2f2feab2026849078ba485f918791bdc', - { - id: '2f2feab2026849078ba485f918791bdc', - rules: [ - { - action: 'block', - action_parameters: { - response: { - content: '{\n "success": false,\n "error": "you have been blocked"\n}', - content_type: 'application/json', - status_code: 400, - }, + const response = await cloudflare.rulesets.update('2f2feab2026849078ba485f918791bdc', { + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', + id: '2f2feab2026849078ba485f918791bdc', + rules: [ + { + action: 'block', + action_parameters: { + response: { + content: '{\n "success": false,\n "error": "you have been blocked"\n}', + content_type: 'application/json', + status_code: 400, }, - description: 'Block when the IP address is not 1.1.1.1', - enabled: true, - expression: 'ip.src ne 1.1.1.1', - id: '3a03d665bac047339bb530ecb439a90d', - logging: { enabled: true }, - ref: 'my_ref', }, - { - action: 'block', - action_parameters: { - response: { - content: '{\n "success": false,\n "error": "you have been blocked"\n}', - content_type: 'application/json', - status_code: 400, - }, + description: 'Block when the IP address is not 1.1.1.1', + enabled: true, + expression: 'ip.src ne 1.1.1.1', + id: '3a03d665bac047339bb530ecb439a90d', + logging: { enabled: true }, + ref: 'my_ref', + }, + { + action: 'block', + action_parameters: { + response: { + content: '{\n "success": false,\n "error": "you have been blocked"\n}', + content_type: 'application/json', + status_code: 400, }, - description: 'Block when the IP address is not 1.1.1.1', - enabled: true, - expression: 'ip.src ne 1.1.1.1', - id: '3a03d665bac047339bb530ecb439a90d', - logging: { enabled: true }, - ref: 'my_ref', }, - { - action: 'block', - action_parameters: { - response: { - content: '{\n "success": false,\n "error": "you have been blocked"\n}', - content_type: 'application/json', - status_code: 400, - }, + description: 'Block when the IP address is not 1.1.1.1', + enabled: true, + expression: 'ip.src ne 1.1.1.1', + id: '3a03d665bac047339bb530ecb439a90d', + logging: { enabled: true }, + ref: 'my_ref', + }, + { + action: 'block', + action_parameters: { + response: { + content: '{\n "success": false,\n "error": "you have been blocked"\n}', + content_type: 'application/json', + status_code: 400, }, - description: 'Block when the IP address is not 1.1.1.1', - enabled: true, - expression: 'ip.src ne 1.1.1.1', - id: '3a03d665bac047339bb530ecb439a90d', - logging: { enabled: true }, - ref: 'my_ref', }, - ], - description: 'My ruleset to execute managed rulesets', - kind: 'root', - name: 'My ruleset', - phase: 'http_request_firewall_custom', - }, - ); + description: 'Block when the IP address is not 1.1.1.1', + enabled: true, + expression: 'ip.src ne 1.1.1.1', + id: '3a03d665bac047339bb530ecb439a90d', + logging: { enabled: true }, + ref: 'my_ref', + }, + ], + description: 'My ruleset to execute managed rulesets', + kind: 'root', + name: 'My ruleset', + phase: 'http_request_firewall_custom', + }); }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.rulesets.list('string', 'abf9b32d38c5f572afde3336ec0ce302'); + test.skip('list: only required params', async () => { + const responsePromise = cloudflare.rulesets.list({ + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -185,22 +190,19 @@ describe('resource rulesets', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.rulesets.list('string', 'abf9b32d38c5f572afde3336ec0ce302', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('list: required and optional params', async () => { + const response = await cloudflare.rulesets.list({ + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', + }); }); // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.rulesets.delete( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - '2f2feab2026849078ba485f918791bdc', - ); + test.skip('delete: only required params', async () => { + const responsePromise = cloudflare.rulesets.delete('2f2feab2026849078ba485f918791bdc', { + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -211,25 +213,19 @@ describe('resource rulesets', () => { }); // skipped: tests are disabled for the time being - test.skip('delete: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.rulesets.delete( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - '2f2feab2026849078ba485f918791bdc', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('delete: required and optional params', async () => { + const response = await cloudflare.rulesets.delete('2f2feab2026849078ba485f918791bdc', { + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', + }); }); // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.rulesets.get( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - '2f2feab2026849078ba485f918791bdc', - ); + test.skip('get: only required params', async () => { + const responsePromise = cloudflare.rulesets.get('2f2feab2026849078ba485f918791bdc', { + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -240,15 +236,10 @@ describe('resource rulesets', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.rulesets.get( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - '2f2feab2026849078ba485f918791bdc', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('get: required and optional params', async () => { + const response = await cloudflare.rulesets.get('2f2feab2026849078ba485f918791bdc', { + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', + }); }); }); diff --git a/tests/api-resources/rulesets/versions/by-tags.test.ts b/tests/api-resources/rulesets/versions/by-tags.test.ts index f19fdd93f9..82dfc14e3f 100644 --- a/tests/api-resources/rulesets/versions/by-tags.test.ts +++ b/tests/api-resources/rulesets/versions/by-tags.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/rulesets/versions/versions.test.ts b/tests/api-resources/rulesets/versions/versions.test.ts index 4923c4a344..39e4e773b4 100644 --- a/tests/api-resources/rulesets/versions/versions.test.ts +++ b/tests/api-resources/rulesets/versions/versions.test.ts @@ -5,20 +5,20 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource versions', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.rulesets.versions.list( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - '2f2feab2026849078ba485f918791bdc', - ); + test.skip('list: only required params', async () => { + const responsePromise = cloudflare.rulesets.versions.list('2f2feab2026849078ba485f918791bdc', { + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -29,26 +29,19 @@ describe('resource versions', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.rulesets.versions.list( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - '2f2feab2026849078ba485f918791bdc', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('list: required and optional params', async () => { + const response = await cloudflare.rulesets.versions.list('2f2feab2026849078ba485f918791bdc', { + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', + }); }); // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.rulesets.versions.delete( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - '2f2feab2026849078ba485f918791bdc', - '1', - ); + test.skip('delete: only required params', async () => { + const responsePromise = cloudflare.rulesets.versions.delete('2f2feab2026849078ba485f918791bdc', '1', { + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -59,27 +52,19 @@ describe('resource versions', () => { }); // skipped: tests are disabled for the time being - test.skip('delete: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.rulesets.versions.delete( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - '2f2feab2026849078ba485f918791bdc', - '1', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('delete: required and optional params', async () => { + const response = await cloudflare.rulesets.versions.delete('2f2feab2026849078ba485f918791bdc', '1', { + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', + }); }); // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.rulesets.versions.get( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - '2f2feab2026849078ba485f918791bdc', - '1', - ); + test.skip('get: only required params', async () => { + const responsePromise = cloudflare.rulesets.versions.get('2f2feab2026849078ba485f918791bdc', '1', { + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -90,16 +75,10 @@ describe('resource versions', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.rulesets.versions.get( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - '2f2feab2026849078ba485f918791bdc', - '1', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('get: required and optional params', async () => { + const response = await cloudflare.rulesets.versions.get('2f2feab2026849078ba485f918791bdc', '1', { + account_id: 'string', + zone_id: 'abf9b32d38c5f572afde3336ec0ce302', + }); }); }); diff --git a/tests/api-resources/rum/rules.test.ts b/tests/api-resources/rum/rules.test.ts index 038d891901..c3040d2869 100644 --- a/tests/api-resources/rum/rules.test.ts +++ b/tests/api-resources/rum/rules.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/rum/site-infos.test.ts b/tests/api-resources/rum/site-infos.test.ts index 4716c1f891..862cd00791 100644 --- a/tests/api-resources/rum/site-infos.test.ts +++ b/tests/api-resources/rum/site-infos.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/secondary-dns/acls.test.ts b/tests/api-resources/secondary-dns/acls.test.ts index 63c1ede884..cbd2216436 100644 --- a/tests/api-resources/secondary-dns/acls.test.ts +++ b/tests/api-resources/secondary-dns/acls.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/secondary-dns/force-axfrs.test.ts b/tests/api-resources/secondary-dns/force-axfrs.test.ts index a5d18c6d46..5f4f77827a 100644 --- a/tests/api-resources/secondary-dns/force-axfrs.test.ts +++ b/tests/api-resources/secondary-dns/force-axfrs.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/secondary-dns/incoming.test.ts b/tests/api-resources/secondary-dns/incoming.test.ts index c8ae0a5ff8..f4a7ef981b 100644 --- a/tests/api-resources/secondary-dns/incoming.test.ts +++ b/tests/api-resources/secondary-dns/incoming.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/secondary-dns/outgoing/outgoing.test.ts b/tests/api-resources/secondary-dns/outgoing/outgoing.test.ts index 72b0200f71..02dab6127d 100644 --- a/tests/api-resources/secondary-dns/outgoing/outgoing.test.ts +++ b/tests/api-resources/secondary-dns/outgoing/outgoing.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/secondary-dns/outgoing/status.test.ts b/tests/api-resources/secondary-dns/outgoing/status.test.ts index 5ec97788fb..f4d61e901c 100644 --- a/tests/api-resources/secondary-dns/outgoing/status.test.ts +++ b/tests/api-resources/secondary-dns/outgoing/status.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/secondary-dns/peers.test.ts b/tests/api-resources/secondary-dns/peers.test.ts index fb2fc374df..e11154921c 100644 --- a/tests/api-resources/secondary-dns/peers.test.ts +++ b/tests/api-resources/secondary-dns/peers.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/secondary-dns/tsigs.test.ts b/tests/api-resources/secondary-dns/tsigs.test.ts index 9ba2ba7442..193178c815 100644 --- a/tests/api-resources/secondary-dns/tsigs.test.ts +++ b/tests/api-resources/secondary-dns/tsigs.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/advanced-ddos.test.ts b/tests/api-resources/settings/advanced-ddos.test.ts index 09e80a65d6..1014b00031 100644 --- a/tests/api-resources/settings/advanced-ddos.test.ts +++ b/tests/api-resources/settings/advanced-ddos.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/always-online.test.ts b/tests/api-resources/settings/always-online.test.ts index a02c5ed5a9..4817669c14 100644 --- a/tests/api-resources/settings/always-online.test.ts +++ b/tests/api-resources/settings/always-online.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/always-use-https.test.ts b/tests/api-resources/settings/always-use-https.test.ts index eda8e8f027..124f6c7374 100644 --- a/tests/api-resources/settings/always-use-https.test.ts +++ b/tests/api-resources/settings/always-use-https.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/automatic-https-rewrites.test.ts b/tests/api-resources/settings/automatic-https-rewrites.test.ts index f1b5393be8..cf70b8cbbb 100644 --- a/tests/api-resources/settings/automatic-https-rewrites.test.ts +++ b/tests/api-resources/settings/automatic-https-rewrites.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/automatic-platform-optimization.test.ts b/tests/api-resources/settings/automatic-platform-optimization.test.ts index 6d99a58c5a..4c3006a3c8 100644 --- a/tests/api-resources/settings/automatic-platform-optimization.test.ts +++ b/tests/api-resources/settings/automatic-platform-optimization.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/brotli.test.ts b/tests/api-resources/settings/brotli.test.ts index a03c699f4a..c86ab48b6d 100644 --- a/tests/api-resources/settings/brotli.test.ts +++ b/tests/api-resources/settings/brotli.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/browser-cache-ttl.test.ts b/tests/api-resources/settings/browser-cache-ttl.test.ts index 15bc229250..bfe4e9b731 100644 --- a/tests/api-resources/settings/browser-cache-ttl.test.ts +++ b/tests/api-resources/settings/browser-cache-ttl.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/browser-check.test.ts b/tests/api-resources/settings/browser-check.test.ts index 7b042eec57..53958cd288 100644 --- a/tests/api-resources/settings/browser-check.test.ts +++ b/tests/api-resources/settings/browser-check.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/cache-level.test.ts b/tests/api-resources/settings/cache-level.test.ts index 974580aff4..39573b574f 100644 --- a/tests/api-resources/settings/cache-level.test.ts +++ b/tests/api-resources/settings/cache-level.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/challenge-ttl.test.ts b/tests/api-resources/settings/challenge-ttl.test.ts index de4eb90370..d3a94bb2ec 100644 --- a/tests/api-resources/settings/challenge-ttl.test.ts +++ b/tests/api-resources/settings/challenge-ttl.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/ciphers.test.ts b/tests/api-resources/settings/ciphers.test.ts index 8d2b23f4dd..3ba404ae75 100644 --- a/tests/api-resources/settings/ciphers.test.ts +++ b/tests/api-resources/settings/ciphers.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/development-mode.test.ts b/tests/api-resources/settings/development-mode.test.ts index 2629fff251..556e5e005e 100644 --- a/tests/api-resources/settings/development-mode.test.ts +++ b/tests/api-resources/settings/development-mode.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/early-hints.test.ts b/tests/api-resources/settings/early-hints.test.ts index aa5a71c641..3caec4bbb0 100644 --- a/tests/api-resources/settings/early-hints.test.ts +++ b/tests/api-resources/settings/early-hints.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/email-obfuscation.test.ts b/tests/api-resources/settings/email-obfuscation.test.ts index c74b7ef632..685a1ae7a6 100644 --- a/tests/api-resources/settings/email-obfuscation.test.ts +++ b/tests/api-resources/settings/email-obfuscation.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/font-settings.test.ts b/tests/api-resources/settings/font-settings.test.ts index 1f7388ca4f..c1c7c92db7 100644 --- a/tests/api-resources/settings/font-settings.test.ts +++ b/tests/api-resources/settings/font-settings.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/h2-prioritization.test.ts b/tests/api-resources/settings/h2-prioritization.test.ts index 331229945a..2a85572101 100644 --- a/tests/api-resources/settings/h2-prioritization.test.ts +++ b/tests/api-resources/settings/h2-prioritization.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/hotlink-protection.test.ts b/tests/api-resources/settings/hotlink-protection.test.ts index 5c855f7b69..f1bbddc748 100644 --- a/tests/api-resources/settings/hotlink-protection.test.ts +++ b/tests/api-resources/settings/hotlink-protection.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/http2.test.ts b/tests/api-resources/settings/http2.test.ts index 855efae589..3196672d9f 100644 --- a/tests/api-resources/settings/http2.test.ts +++ b/tests/api-resources/settings/http2.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/http3.test.ts b/tests/api-resources/settings/http3.test.ts index 72ce9aff87..b3e81cc48d 100644 --- a/tests/api-resources/settings/http3.test.ts +++ b/tests/api-resources/settings/http3.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/image-resizing.test.ts b/tests/api-resources/settings/image-resizing.test.ts index 7c28871e4c..b53023882e 100644 --- a/tests/api-resources/settings/image-resizing.test.ts +++ b/tests/api-resources/settings/image-resizing.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/ip-geolocation.test.ts b/tests/api-resources/settings/ip-geolocation.test.ts index 720965cc1f..f638d484ed 100644 --- a/tests/api-resources/settings/ip-geolocation.test.ts +++ b/tests/api-resources/settings/ip-geolocation.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/ipv6.test.ts b/tests/api-resources/settings/ipv6.test.ts index a3f0c2a21e..7f021a6f1e 100644 --- a/tests/api-resources/settings/ipv6.test.ts +++ b/tests/api-resources/settings/ipv6.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/min-tls-version.test.ts b/tests/api-resources/settings/min-tls-version.test.ts index 99aa5bcfb8..d82d777428 100644 --- a/tests/api-resources/settings/min-tls-version.test.ts +++ b/tests/api-resources/settings/min-tls-version.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/minify.test.ts b/tests/api-resources/settings/minify.test.ts index 9513e28fdf..f0711a196b 100644 --- a/tests/api-resources/settings/minify.test.ts +++ b/tests/api-resources/settings/minify.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/mirage.test.ts b/tests/api-resources/settings/mirage.test.ts index 9ee0a62e4b..9ad132107d 100644 --- a/tests/api-resources/settings/mirage.test.ts +++ b/tests/api-resources/settings/mirage.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/mobile-redirect.test.ts b/tests/api-resources/settings/mobile-redirect.test.ts index 534884144a..9d5d8952f5 100644 --- a/tests/api-resources/settings/mobile-redirect.test.ts +++ b/tests/api-resources/settings/mobile-redirect.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/nel.test.ts b/tests/api-resources/settings/nel.test.ts index e541b1e0c8..6c29b7e37b 100644 --- a/tests/api-resources/settings/nel.test.ts +++ b/tests/api-resources/settings/nel.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/opportunistic-encryption.test.ts b/tests/api-resources/settings/opportunistic-encryption.test.ts index 48a219ce0d..e85a44a3ce 100644 --- a/tests/api-resources/settings/opportunistic-encryption.test.ts +++ b/tests/api-resources/settings/opportunistic-encryption.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/opportunistic-onion.test.ts b/tests/api-resources/settings/opportunistic-onion.test.ts index a96f7a0aee..7baf2caf1c 100644 --- a/tests/api-resources/settings/opportunistic-onion.test.ts +++ b/tests/api-resources/settings/opportunistic-onion.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/orange-to-orange.test.ts b/tests/api-resources/settings/orange-to-orange.test.ts index c0f659140d..3f3753b54d 100644 --- a/tests/api-resources/settings/orange-to-orange.test.ts +++ b/tests/api-resources/settings/orange-to-orange.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/origin-error-page-pass-thru.test.ts b/tests/api-resources/settings/origin-error-page-pass-thru.test.ts index 63c0ed6001..0d4d109fc6 100644 --- a/tests/api-resources/settings/origin-error-page-pass-thru.test.ts +++ b/tests/api-resources/settings/origin-error-page-pass-thru.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/origin-max-http-version.test.ts b/tests/api-resources/settings/origin-max-http-version.test.ts index 057caed221..b19bae7e0a 100644 --- a/tests/api-resources/settings/origin-max-http-version.test.ts +++ b/tests/api-resources/settings/origin-max-http-version.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/polish.test.ts b/tests/api-resources/settings/polish.test.ts index 6cce39c628..f98cdee150 100644 --- a/tests/api-resources/settings/polish.test.ts +++ b/tests/api-resources/settings/polish.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/prefetch-preload.test.ts b/tests/api-resources/settings/prefetch-preload.test.ts index ed073faf99..4986926895 100644 --- a/tests/api-resources/settings/prefetch-preload.test.ts +++ b/tests/api-resources/settings/prefetch-preload.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/proxy-read-timeout.test.ts b/tests/api-resources/settings/proxy-read-timeout.test.ts index 6340d090b7..61b62e3ec8 100644 --- a/tests/api-resources/settings/proxy-read-timeout.test.ts +++ b/tests/api-resources/settings/proxy-read-timeout.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/pseudo-ipv4.test.ts b/tests/api-resources/settings/pseudo-ipv4.test.ts index df4dc0850b..189c42927b 100644 --- a/tests/api-resources/settings/pseudo-ipv4.test.ts +++ b/tests/api-resources/settings/pseudo-ipv4.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/response-buffering.test.ts b/tests/api-resources/settings/response-buffering.test.ts index 2c5ca548b0..715dea9ce7 100644 --- a/tests/api-resources/settings/response-buffering.test.ts +++ b/tests/api-resources/settings/response-buffering.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/rocket-loader.test.ts b/tests/api-resources/settings/rocket-loader.test.ts index 418ce40b07..af5d84b17b 100644 --- a/tests/api-resources/settings/rocket-loader.test.ts +++ b/tests/api-resources/settings/rocket-loader.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/security-headers.test.ts b/tests/api-resources/settings/security-headers.test.ts index 647c945c8c..a9c75fe7fd 100644 --- a/tests/api-resources/settings/security-headers.test.ts +++ b/tests/api-resources/settings/security-headers.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/security-level.test.ts b/tests/api-resources/settings/security-level.test.ts index 140109694a..f830ba739d 100644 --- a/tests/api-resources/settings/security-level.test.ts +++ b/tests/api-resources/settings/security-level.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/server-side-excludes.test.ts b/tests/api-resources/settings/server-side-excludes.test.ts index a582a54e77..f84b1b733a 100644 --- a/tests/api-resources/settings/server-side-excludes.test.ts +++ b/tests/api-resources/settings/server-side-excludes.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/settings.test.ts b/tests/api-resources/settings/settings.test.ts index 836700c4b4..0f102c842b 100644 --- a/tests/api-resources/settings/settings.test.ts +++ b/tests/api-resources/settings/settings.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/sort-query-string-for-cache.test.ts b/tests/api-resources/settings/sort-query-string-for-cache.test.ts index 5d6bc1c641..f2a28b701a 100644 --- a/tests/api-resources/settings/sort-query-string-for-cache.test.ts +++ b/tests/api-resources/settings/sort-query-string-for-cache.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/ssl-recommender.test.ts b/tests/api-resources/settings/ssl-recommender.test.ts index 8f53e0f3ee..2afddc02cf 100644 --- a/tests/api-resources/settings/ssl-recommender.test.ts +++ b/tests/api-resources/settings/ssl-recommender.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/ssl.test.ts b/tests/api-resources/settings/ssl.test.ts index 570db1bb74..ce242e6dbc 100644 --- a/tests/api-resources/settings/ssl.test.ts +++ b/tests/api-resources/settings/ssl.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/tls-1-3.test.ts b/tests/api-resources/settings/tls-1-3.test.ts index d0c0836646..72272e55c3 100644 --- a/tests/api-resources/settings/tls-1-3.test.ts +++ b/tests/api-resources/settings/tls-1-3.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/tls-client-auth.test.ts b/tests/api-resources/settings/tls-client-auth.test.ts index ec85f02f40..aae34d14ad 100644 --- a/tests/api-resources/settings/tls-client-auth.test.ts +++ b/tests/api-resources/settings/tls-client-auth.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/true-client-ip-header.test.ts b/tests/api-resources/settings/true-client-ip-header.test.ts index 09d9c53a91..73e925b0e0 100644 --- a/tests/api-resources/settings/true-client-ip-header.test.ts +++ b/tests/api-resources/settings/true-client-ip-header.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/waf.test.ts b/tests/api-resources/settings/waf.test.ts index 4530941465..7c05fe24c1 100644 --- a/tests/api-resources/settings/waf.test.ts +++ b/tests/api-resources/settings/waf.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/webp.test.ts b/tests/api-resources/settings/webp.test.ts index 4fabf55fdf..276a1610ee 100644 --- a/tests/api-resources/settings/webp.test.ts +++ b/tests/api-resources/settings/webp.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/websocket.test.ts b/tests/api-resources/settings/websocket.test.ts index 05209b76eb..e8de19cb1a 100644 --- a/tests/api-resources/settings/websocket.test.ts +++ b/tests/api-resources/settings/websocket.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/settings/zero-rtt.test.ts b/tests/api-resources/settings/zero-rtt.test.ts index 7d55b2c0af..9e959aed35 100644 --- a/tests/api-resources/settings/zero-rtt.test.ts +++ b/tests/api-resources/settings/zero-rtt.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/snippets/content.test.ts b/tests/api-resources/snippets/content.test.ts index 451304c427..eaba9bc92d 100644 --- a/tests/api-resources/snippets/content.test.ts +++ b/tests/api-resources/snippets/content.test.ts @@ -4,9 +4,10 @@ import Cloudflare from 'cloudflare'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/snippets/snippet-rules.test.ts b/tests/api-resources/snippets/snippet-rules.test.ts index bd2c195eaf..355117c08d 100644 --- a/tests/api-resources/snippets/snippet-rules.test.ts +++ b/tests/api-resources/snippets/snippet-rules.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/snippets/snippets.test.ts b/tests/api-resources/snippets/snippets.test.ts index 791c202a4d..a23cd2d87e 100644 --- a/tests/api-resources/snippets/snippets.test.ts +++ b/tests/api-resources/snippets/snippets.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/spectrum/analytics/aggregates/currents.test.ts b/tests/api-resources/spectrum/analytics/aggregates/currents.test.ts index dc91fdef72..8055c5f916 100644 --- a/tests/api-resources/spectrum/analytics/aggregates/currents.test.ts +++ b/tests/api-resources/spectrum/analytics/aggregates/currents.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/spectrum/analytics/events/bytimes.test.ts b/tests/api-resources/spectrum/analytics/events/bytimes.test.ts index b0a31da7e7..da034939b2 100644 --- a/tests/api-resources/spectrum/analytics/events/bytimes.test.ts +++ b/tests/api-resources/spectrum/analytics/events/bytimes.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/spectrum/analytics/events/summaries.test.ts b/tests/api-resources/spectrum/analytics/events/summaries.test.ts index 1719dfb1d4..bd81c528b8 100644 --- a/tests/api-resources/spectrum/analytics/events/summaries.test.ts +++ b/tests/api-resources/spectrum/analytics/events/summaries.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/spectrum/apps.test.ts b/tests/api-resources/spectrum/apps.test.ts index 484d87ea4c..ad6aa23bec 100644 --- a/tests/api-resources/spectrum/apps.test.ts +++ b/tests/api-resources/spectrum/apps.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/speed/availabilities.test.ts b/tests/api-resources/speed/availabilities.test.ts index bf8b0861d2..df5b0f59d0 100644 --- a/tests/api-resources/speed/availabilities.test.ts +++ b/tests/api-resources/speed/availabilities.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/speed/pages.test.ts b/tests/api-resources/speed/pages.test.ts index 1f56f4bfab..36f4bdb934 100644 --- a/tests/api-resources/speed/pages.test.ts +++ b/tests/api-resources/speed/pages.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/speed/schedule.test.ts b/tests/api-resources/speed/schedule.test.ts index 14e1e0744b..3ba52c60d4 100644 --- a/tests/api-resources/speed/schedule.test.ts +++ b/tests/api-resources/speed/schedule.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/speed/speed.test.ts b/tests/api-resources/speed/speed.test.ts index 2851473b48..85b1f6458e 100644 --- a/tests/api-resources/speed/speed.test.ts +++ b/tests/api-resources/speed/speed.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/speed/tests.test.ts b/tests/api-resources/speed/tests.test.ts index f5f9857495..da418cdf35 100644 --- a/tests/api-resources/speed/tests.test.ts +++ b/tests/api-resources/speed/tests.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/ssl/analyze.test.ts b/tests/api-resources/ssl/analyze.test.ts index 98b1ab6f90..00bebe78d8 100644 --- a/tests/api-resources/ssl/analyze.test.ts +++ b/tests/api-resources/ssl/analyze.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/ssl/certificate-packs/certificate-packs.test.ts b/tests/api-resources/ssl/certificate-packs/certificate-packs.test.ts index 47fbae1196..54213e159e 100644 --- a/tests/api-resources/ssl/certificate-packs/certificate-packs.test.ts +++ b/tests/api-resources/ssl/certificate-packs/certificate-packs.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/ssl/certificate-packs/order.test.ts b/tests/api-resources/ssl/certificate-packs/order.test.ts index 9886fa1a24..f3ee3f8177 100644 --- a/tests/api-resources/ssl/certificate-packs/order.test.ts +++ b/tests/api-resources/ssl/certificate-packs/order.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/ssl/certificate-packs/quota.test.ts b/tests/api-resources/ssl/certificate-packs/quota.test.ts index f55eec0f4b..2cd37394a8 100644 --- a/tests/api-resources/ssl/certificate-packs/quota.test.ts +++ b/tests/api-resources/ssl/certificate-packs/quota.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/ssl/recommendations.test.ts b/tests/api-resources/ssl/recommendations.test.ts index d1375f5c69..80bf7f822c 100644 --- a/tests/api-resources/ssl/recommendations.test.ts +++ b/tests/api-resources/ssl/recommendations.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/ssl/universal/settings.test.ts b/tests/api-resources/ssl/universal/settings.test.ts index d4f19d885d..ff9da7cb04 100644 --- a/tests/api-resources/ssl/universal/settings.test.ts +++ b/tests/api-resources/ssl/universal/settings.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/ssl/verification.test.ts b/tests/api-resources/ssl/verification.test.ts index 46f462bae7..eab6806460 100644 --- a/tests/api-resources/ssl/verification.test.ts +++ b/tests/api-resources/ssl/verification.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/storage/analytics.test.ts b/tests/api-resources/storage/analytics.test.ts index 8ba41cbd82..a38f1827ac 100644 --- a/tests/api-resources/storage/analytics.test.ts +++ b/tests/api-resources/storage/analytics.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/storage/kv/namespaces/bulk.test.ts b/tests/api-resources/storage/kv/namespaces/bulk.test.ts index d567b991ed..8ec34d846b 100644 --- a/tests/api-resources/storage/kv/namespaces/bulk.test.ts +++ b/tests/api-resources/storage/kv/namespaces/bulk.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/storage/kv/namespaces/keys.test.ts b/tests/api-resources/storage/kv/namespaces/keys.test.ts index 3363a53f6a..d7cded59b3 100644 --- a/tests/api-resources/storage/kv/namespaces/keys.test.ts +++ b/tests/api-resources/storage/kv/namespaces/keys.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/storage/kv/namespaces/metadata.test.ts b/tests/api-resources/storage/kv/namespaces/metadata.test.ts index 4e8bd0467d..f336b13a41 100644 --- a/tests/api-resources/storage/kv/namespaces/metadata.test.ts +++ b/tests/api-resources/storage/kv/namespaces/metadata.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/storage/kv/namespaces/namespaces.test.ts b/tests/api-resources/storage/kv/namespaces/namespaces.test.ts index e3b6afb299..343f44cfaf 100644 --- a/tests/api-resources/storage/kv/namespaces/namespaces.test.ts +++ b/tests/api-resources/storage/kv/namespaces/namespaces.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/storage/kv/namespaces/values.test.ts b/tests/api-resources/storage/kv/namespaces/values.test.ts index 05315caa63..b4035fa429 100644 --- a/tests/api-resources/storage/kv/namespaces/values.test.ts +++ b/tests/api-resources/storage/kv/namespaces/values.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/stream/audio-tracks.test.ts b/tests/api-resources/stream/audio-tracks.test.ts index ca93d4bc9c..55d948877c 100644 --- a/tests/api-resources/stream/audio-tracks.test.ts +++ b/tests/api-resources/stream/audio-tracks.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/stream/captions.test.ts b/tests/api-resources/stream/captions.test.ts index a591ba5afe..12ab5f78e0 100644 --- a/tests/api-resources/stream/captions.test.ts +++ b/tests/api-resources/stream/captions.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/stream/clips.test.ts b/tests/api-resources/stream/clips.test.ts index 99502daddf..25e247aca9 100644 --- a/tests/api-resources/stream/clips.test.ts +++ b/tests/api-resources/stream/clips.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/stream/copies.test.ts b/tests/api-resources/stream/copies.test.ts index ba0ca8da91..eb2b3473e9 100644 --- a/tests/api-resources/stream/copies.test.ts +++ b/tests/api-resources/stream/copies.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/stream/direct-uploads.test.ts b/tests/api-resources/stream/direct-uploads.test.ts index 84100a964a..f4cd406f29 100644 --- a/tests/api-resources/stream/direct-uploads.test.ts +++ b/tests/api-resources/stream/direct-uploads.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/stream/downloads.test.ts b/tests/api-resources/stream/downloads.test.ts index b0be5ceaf0..a7cf7b7a68 100644 --- a/tests/api-resources/stream/downloads.test.ts +++ b/tests/api-resources/stream/downloads.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/stream/embeds.test.ts b/tests/api-resources/stream/embeds.test.ts index 4b5e0e647b..f7aed0338a 100644 --- a/tests/api-resources/stream/embeds.test.ts +++ b/tests/api-resources/stream/embeds.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/stream/keys.test.ts b/tests/api-resources/stream/keys.test.ts index 31d7d3a4ff..3b384de87a 100644 --- a/tests/api-resources/stream/keys.test.ts +++ b/tests/api-resources/stream/keys.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/stream/live-inputs/live-inputs.test.ts b/tests/api-resources/stream/live-inputs/live-inputs.test.ts index 3b14b7bb86..3b0522c72b 100644 --- a/tests/api-resources/stream/live-inputs/live-inputs.test.ts +++ b/tests/api-resources/stream/live-inputs/live-inputs.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/stream/live-inputs/outputs.test.ts b/tests/api-resources/stream/live-inputs/outputs.test.ts index e5796c019b..b985e5b0de 100644 --- a/tests/api-resources/stream/live-inputs/outputs.test.ts +++ b/tests/api-resources/stream/live-inputs/outputs.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/stream/stream.test.ts b/tests/api-resources/stream/stream.test.ts index cb956af3b2..ec835da874 100644 --- a/tests/api-resources/stream/stream.test.ts +++ b/tests/api-resources/stream/stream.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/stream/tokens.test.ts b/tests/api-resources/stream/tokens.test.ts index c5af4ecb3a..6cc01a9b36 100644 --- a/tests/api-resources/stream/tokens.test.ts +++ b/tests/api-resources/stream/tokens.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/stream/videos.test.ts b/tests/api-resources/stream/videos.test.ts index 720883e735..8516fbaea5 100644 --- a/tests/api-resources/stream/videos.test.ts +++ b/tests/api-resources/stream/videos.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/stream/watermarks.test.ts b/tests/api-resources/stream/watermarks.test.ts index 41bd594bbd..fa2e9a0e28 100644 --- a/tests/api-resources/stream/watermarks.test.ts +++ b/tests/api-resources/stream/watermarks.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/stream/webhooks.test.ts b/tests/api-resources/stream/webhooks.test.ts index 549aa9aa79..03800539b7 100644 --- a/tests/api-resources/stream/webhooks.test.ts +++ b/tests/api-resources/stream/webhooks.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/subscriptions.test.ts b/tests/api-resources/subscriptions.test.ts index 4d395d61e3..44f880a323 100644 --- a/tests/api-resources/subscriptions.test.ts +++ b/tests/api-resources/subscriptions.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/teamnet/routes.test.ts b/tests/api-resources/teamnet/routes.test.ts index c006f7e150..176e8101a1 100644 --- a/tests/api-resources/teamnet/routes.test.ts +++ b/tests/api-resources/teamnet/routes.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/teamnets/routes/ips.test.ts b/tests/api-resources/teamnets/routes/ips.test.ts index 4668793fbf..a152640658 100644 --- a/tests/api-resources/teamnets/routes/ips.test.ts +++ b/tests/api-resources/teamnets/routes/ips.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/teamnets/routes/networks.test.ts b/tests/api-resources/teamnets/routes/networks.test.ts index 410e3d9812..0a89fb293f 100644 --- a/tests/api-resources/teamnets/routes/networks.test.ts +++ b/tests/api-resources/teamnets/routes/networks.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/teamnets/routes/routes.test.ts b/tests/api-resources/teamnets/routes/routes.test.ts index 5322ad948d..51aceb6694 100644 --- a/tests/api-resources/teamnets/routes/routes.test.ts +++ b/tests/api-resources/teamnets/routes/routes.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/teamnets/virtual-networks.test.ts b/tests/api-resources/teamnets/virtual-networks.test.ts index 5497ee3812..0e8cad6821 100644 --- a/tests/api-resources/teamnets/virtual-networks.test.ts +++ b/tests/api-resources/teamnets/virtual-networks.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/tunnels/configurations.test.ts b/tests/api-resources/tunnels/configurations.test.ts index 71a20ca1a7..eac8250e51 100644 --- a/tests/api-resources/tunnels/configurations.test.ts +++ b/tests/api-resources/tunnels/configurations.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/tunnels/connections.test.ts b/tests/api-resources/tunnels/connections.test.ts index 77561c8834..34fb594cad 100644 --- a/tests/api-resources/tunnels/connections.test.ts +++ b/tests/api-resources/tunnels/connections.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/tunnels/connectors.test.ts b/tests/api-resources/tunnels/connectors.test.ts index e1ab39f61e..234eeebff3 100644 --- a/tests/api-resources/tunnels/connectors.test.ts +++ b/tests/api-resources/tunnels/connectors.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/tunnels/management.test.ts b/tests/api-resources/tunnels/management.test.ts index c784e5da6e..9b02fd4b7f 100644 --- a/tests/api-resources/tunnels/management.test.ts +++ b/tests/api-resources/tunnels/management.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/tunnels/tokens.test.ts b/tests/api-resources/tunnels/tokens.test.ts index c39ffb587a..b1f188bf07 100644 --- a/tests/api-resources/tunnels/tokens.test.ts +++ b/tests/api-resources/tunnels/tokens.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/tunnels/tunnels.test.ts b/tests/api-resources/tunnels/tunnels.test.ts index f24e958f96..811cb2dcad 100644 --- a/tests/api-resources/tunnels/tunnels.test.ts +++ b/tests/api-resources/tunnels/tunnels.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/url-normalizations.test.ts b/tests/api-resources/url-normalizations.test.ts index 257c496db8..54922ad48c 100644 --- a/tests/api-resources/url-normalizations.test.ts +++ b/tests/api-resources/url-normalizations.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/url-scanner/scans.test.ts b/tests/api-resources/url-scanner/scans.test.ts index 09cb602708..d75b19434d 100644 --- a/tests/api-resources/url-scanner/scans.test.ts +++ b/tests/api-resources/url-scanner/scans.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/url-scanner/url-scanner.test.ts b/tests/api-resources/url-scanner/url-scanner.test.ts index 078570d44f..7851288289 100644 --- a/tests/api-resources/url-scanner/url-scanner.test.ts +++ b/tests/api-resources/url-scanner/url-scanner.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/audit-logs.test.ts b/tests/api-resources/users/audit-logs.test.ts index 069cafe70b..745a250f31 100644 --- a/tests/api-resources/users/audit-logs.test.ts +++ b/tests/api-resources/users/audit-logs.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/billings/history.test.ts b/tests/api-resources/users/billings/history.test.ts index 57a856c68c..28c9cf502b 100644 --- a/tests/api-resources/users/billings/history.test.ts +++ b/tests/api-resources/users/billings/history.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/billings/profiles.test.ts b/tests/api-resources/users/billings/profiles.test.ts index 416b9c142c..2a391b8a74 100644 --- a/tests/api-resources/users/billings/profiles.test.ts +++ b/tests/api-resources/users/billings/profiles.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/firewall/access-rules/rules.test.ts b/tests/api-resources/users/firewall/access-rules/rules.test.ts index 1eda0664bd..8e6701c5bc 100644 --- a/tests/api-resources/users/firewall/access-rules/rules.test.ts +++ b/tests/api-resources/users/firewall/access-rules/rules.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/invites.test.ts b/tests/api-resources/users/invites.test.ts index 18ece0a90d..74acb91b1c 100644 --- a/tests/api-resources/users/invites.test.ts +++ b/tests/api-resources/users/invites.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/load-balancers/monitors/monitors.test.ts b/tests/api-resources/users/load-balancers/monitors/monitors.test.ts index dffb12ccc8..915f037c19 100644 --- a/tests/api-resources/users/load-balancers/monitors/monitors.test.ts +++ b/tests/api-resources/users/load-balancers/monitors/monitors.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/load-balancers/monitors/previews.test.ts b/tests/api-resources/users/load-balancers/monitors/previews.test.ts index 2bd546f28f..486ed65cb6 100644 --- a/tests/api-resources/users/load-balancers/monitors/previews.test.ts +++ b/tests/api-resources/users/load-balancers/monitors/previews.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/load-balancers/monitors/references.test.ts b/tests/api-resources/users/load-balancers/monitors/references.test.ts index a138849e12..c13b655665 100644 --- a/tests/api-resources/users/load-balancers/monitors/references.test.ts +++ b/tests/api-resources/users/load-balancers/monitors/references.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/load-balancers/pools/health.test.ts b/tests/api-resources/users/load-balancers/pools/health.test.ts index f934721bca..122b19d287 100644 --- a/tests/api-resources/users/load-balancers/pools/health.test.ts +++ b/tests/api-resources/users/load-balancers/pools/health.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/load-balancers/pools/pools.test.ts b/tests/api-resources/users/load-balancers/pools/pools.test.ts index dbf5a7de9a..c90c5f758b 100644 --- a/tests/api-resources/users/load-balancers/pools/pools.test.ts +++ b/tests/api-resources/users/load-balancers/pools/pools.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/load-balancers/pools/previews.test.ts b/tests/api-resources/users/load-balancers/pools/previews.test.ts index 48cc6eb300..f086025823 100644 --- a/tests/api-resources/users/load-balancers/pools/previews.test.ts +++ b/tests/api-resources/users/load-balancers/pools/previews.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/load-balancers/pools/references.test.ts b/tests/api-resources/users/load-balancers/pools/references.test.ts index bc9126ca66..1fd024eb80 100644 --- a/tests/api-resources/users/load-balancers/pools/references.test.ts +++ b/tests/api-resources/users/load-balancers/pools/references.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/load-balancers/previews.test.ts b/tests/api-resources/users/load-balancers/previews.test.ts index be2524fd0a..fdfa7f256d 100644 --- a/tests/api-resources/users/load-balancers/previews.test.ts +++ b/tests/api-resources/users/load-balancers/previews.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/load-balancing-analytics/events.test.ts b/tests/api-resources/users/load-balancing-analytics/events.test.ts index c52a838e08..931fcc48c9 100644 --- a/tests/api-resources/users/load-balancing-analytics/events.test.ts +++ b/tests/api-resources/users/load-balancing-analytics/events.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/organizations.test.ts b/tests/api-resources/users/organizations.test.ts index ff18d4fe30..f19bf3f769 100644 --- a/tests/api-resources/users/organizations.test.ts +++ b/tests/api-resources/users/organizations.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/subscriptions.test.ts b/tests/api-resources/users/subscriptions.test.ts index 675ba08062..738cb520b6 100644 --- a/tests/api-resources/users/subscriptions.test.ts +++ b/tests/api-resources/users/subscriptions.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/tokens/permission-groups.test.ts b/tests/api-resources/users/tokens/permission-groups.test.ts index 6bb5d1b6df..7731ae06a2 100644 --- a/tests/api-resources/users/tokens/permission-groups.test.ts +++ b/tests/api-resources/users/tokens/permission-groups.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/tokens/tokens.test.ts b/tests/api-resources/users/tokens/tokens.test.ts index 2a79cd9cbc..6ffd81d822 100644 --- a/tests/api-resources/users/tokens/tokens.test.ts +++ b/tests/api-resources/users/tokens/tokens.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/tokens/values.test.ts b/tests/api-resources/users/tokens/values.test.ts index 37ab27225b..6a8caf611b 100644 --- a/tests/api-resources/users/tokens/values.test.ts +++ b/tests/api-resources/users/tokens/values.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/users/users.test.ts b/tests/api-resources/users/users.test.ts index dd2a680eac..7257e08714 100644 --- a/tests/api-resources/users/users.test.ts +++ b/tests/api-resources/users/users.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/vectorize/indexes.test.ts b/tests/api-resources/vectorize/indexes.test.ts index db92e98ec1..4562b7f8ed 100644 --- a/tests/api-resources/vectorize/indexes.test.ts +++ b/tests/api-resources/vectorize/indexes.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/waiting-rooms/events/details.test.ts b/tests/api-resources/waiting-rooms/events/details.test.ts index a19cc1a59a..79aa576961 100644 --- a/tests/api-resources/waiting-rooms/events/details.test.ts +++ b/tests/api-resources/waiting-rooms/events/details.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/waiting-rooms/events/events.test.ts b/tests/api-resources/waiting-rooms/events/events.test.ts index 1bdc2a7225..01ec5d18c1 100644 --- a/tests/api-resources/waiting-rooms/events/events.test.ts +++ b/tests/api-resources/waiting-rooms/events/events.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/waiting-rooms/rules.test.ts b/tests/api-resources/waiting-rooms/rules.test.ts index 3094b7d481..6ee19343af 100644 --- a/tests/api-resources/waiting-rooms/rules.test.ts +++ b/tests/api-resources/waiting-rooms/rules.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/waiting-rooms/settings.test.ts b/tests/api-resources/waiting-rooms/settings.test.ts index 642b348265..a9c5fab8c8 100644 --- a/tests/api-resources/waiting-rooms/settings.test.ts +++ b/tests/api-resources/waiting-rooms/settings.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/waiting-rooms/statuses.test.ts b/tests/api-resources/waiting-rooms/statuses.test.ts index f87964bc39..66e7159313 100644 --- a/tests/api-resources/waiting-rooms/statuses.test.ts +++ b/tests/api-resources/waiting-rooms/statuses.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/waiting-rooms/waiting-rooms.test.ts b/tests/api-resources/waiting-rooms/waiting-rooms.test.ts index bd79a80f97..f3f1321b46 100644 --- a/tests/api-resources/waiting-rooms/waiting-rooms.test.ts +++ b/tests/api-resources/waiting-rooms/waiting-rooms.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/warp-connector.test.ts b/tests/api-resources/warp-connector.test.ts index 3d31730573..12c4a74cc6 100644 --- a/tests/api-resources/warp-connector.test.ts +++ b/tests/api-resources/warp-connector.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/web3/hostnames/hostnames.test.ts b/tests/api-resources/web3/hostnames/hostnames.test.ts index 2418a5fc22..75284c3757 100644 --- a/tests/api-resources/web3/hostnames/hostnames.test.ts +++ b/tests/api-resources/web3/hostnames/hostnames.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/web3/hostnames/ipfs-universal-paths/content-lists/content-lists.test.ts b/tests/api-resources/web3/hostnames/ipfs-universal-paths/content-lists/content-lists.test.ts index 8892c7acb5..8d684f8fc8 100644 --- a/tests/api-resources/web3/hostnames/ipfs-universal-paths/content-lists/content-lists.test.ts +++ b/tests/api-resources/web3/hostnames/ipfs-universal-paths/content-lists/content-lists.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/web3/hostnames/ipfs-universal-paths/content-lists/entries.test.ts b/tests/api-resources/web3/hostnames/ipfs-universal-paths/content-lists/entries.test.ts index ff6f86a463..d18deacba6 100644 --- a/tests/api-resources/web3/hostnames/ipfs-universal-paths/content-lists/entries.test.ts +++ b/tests/api-resources/web3/hostnames/ipfs-universal-paths/content-lists/entries.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/worker-domains.test.ts b/tests/api-resources/worker-domains.test.ts index bb62744ff9..0d0cb453df 100644 --- a/tests/api-resources/worker-domains.test.ts +++ b/tests/api-resources/worker-domains.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/worker-scripts/content-v2.test.ts b/tests/api-resources/worker-scripts/content-v2.test.ts index 270881dc17..74b551a097 100644 --- a/tests/api-resources/worker-scripts/content-v2.test.ts +++ b/tests/api-resources/worker-scripts/content-v2.test.ts @@ -4,9 +4,10 @@ import Cloudflare from 'cloudflare'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/worker-scripts/content.test.ts b/tests/api-resources/worker-scripts/content.test.ts index e9cc4b1a64..b7fce08829 100644 --- a/tests/api-resources/worker-scripts/content.test.ts +++ b/tests/api-resources/worker-scripts/content.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/worker-scripts/settings.test.ts b/tests/api-resources/worker-scripts/settings.test.ts index d543dda3e1..73072d45ab 100644 --- a/tests/api-resources/worker-scripts/settings.test.ts +++ b/tests/api-resources/worker-scripts/settings.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content.test.ts b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content.test.ts index 5cc4e53815..f160961bfe 100644 --- a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content.test.ts +++ b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/settings.test.ts b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/settings.test.ts index 243a219472..1a7792f080 100644 --- a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/settings.test.ts +++ b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/settings.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/account-settings.test.ts b/tests/api-resources/workers/account-settings.test.ts index 899517f98c..0b8200fd50 100644 --- a/tests/api-resources/workers/account-settings.test.ts +++ b/tests/api-resources/workers/account-settings.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/deployments-by-script.test.ts b/tests/api-resources/workers/deployments-by-script.test.ts index 2035daa244..5b08dafb16 100644 --- a/tests/api-resources/workers/deployments-by-script.test.ts +++ b/tests/api-resources/workers/deployments-by-script.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/deployments/by-scripts.test.ts b/tests/api-resources/workers/deployments/by-scripts.test.ts index 1a9c622cc5..c1346ceb9b 100644 --- a/tests/api-resources/workers/deployments/by-scripts.test.ts +++ b/tests/api-resources/workers/deployments/by-scripts.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/domains.test.ts b/tests/api-resources/workers/domains.test.ts index 61278e2c16..0103de3711 100644 --- a/tests/api-resources/workers/domains.test.ts +++ b/tests/api-resources/workers/domains.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/durable-objects/namespaces/namespaces.test.ts b/tests/api-resources/workers/durable-objects/namespaces/namespaces.test.ts index 7d18f3d174..46647eee8b 100644 --- a/tests/api-resources/workers/durable-objects/namespaces/namespaces.test.ts +++ b/tests/api-resources/workers/durable-objects/namespaces/namespaces.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/durable-objects/namespaces/objects.test.ts b/tests/api-resources/workers/durable-objects/namespaces/objects.test.ts index 0117c5c333..a5b0bbe3ae 100644 --- a/tests/api-resources/workers/durable-objects/namespaces/objects.test.ts +++ b/tests/api-resources/workers/durable-objects/namespaces/objects.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/filters.test.ts b/tests/api-resources/workers/filters.test.ts index 302a23e99e..1fe7a6989e 100644 --- a/tests/api-resources/workers/filters.test.ts +++ b/tests/api-resources/workers/filters.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/queues/consumers.test.ts b/tests/api-resources/workers/queues/consumers.test.ts index f9e1de1316..14b6c7c6ed 100644 --- a/tests/api-resources/workers/queues/consumers.test.ts +++ b/tests/api-resources/workers/queues/consumers.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/queues/queues.test.ts b/tests/api-resources/workers/queues/queues.test.ts index a5a32d2726..1ecb551462 100644 --- a/tests/api-resources/workers/queues/queues.test.ts +++ b/tests/api-resources/workers/queues/queues.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/routes.test.ts b/tests/api-resources/workers/routes.test.ts index 6363acf72c..5412ea5ad3 100644 --- a/tests/api-resources/workers/routes.test.ts +++ b/tests/api-resources/workers/routes.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/script.test.ts b/tests/api-resources/workers/script.test.ts index b5eddfa1fe..5da5a27ed9 100644 --- a/tests/api-resources/workers/script.test.ts +++ b/tests/api-resources/workers/script.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/scripts/bindings.test.ts b/tests/api-resources/workers/scripts/bindings.test.ts index f8762d01e5..7a6f73c6b4 100644 --- a/tests/api-resources/workers/scripts/bindings.test.ts +++ b/tests/api-resources/workers/scripts/bindings.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/scripts/schedules.test.ts b/tests/api-resources/workers/scripts/schedules.test.ts index 6037e07a85..b08e0b28db 100644 --- a/tests/api-resources/workers/scripts/schedules.test.ts +++ b/tests/api-resources/workers/scripts/schedules.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/scripts/scripts.test.ts b/tests/api-resources/workers/scripts/scripts.test.ts index 38d24a87c7..b39c537e12 100644 --- a/tests/api-resources/workers/scripts/scripts.test.ts +++ b/tests/api-resources/workers/scripts/scripts.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/scripts/tail.test.ts b/tests/api-resources/workers/scripts/tail.test.ts index bc9d749977..bf69205d50 100644 --- a/tests/api-resources/workers/scripts/tail.test.ts +++ b/tests/api-resources/workers/scripts/tail.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/scripts/usage-model.test.ts b/tests/api-resources/workers/scripts/usage-model.test.ts index 261411314b..f447588976 100644 --- a/tests/api-resources/workers/scripts/usage-model.test.ts +++ b/tests/api-resources/workers/scripts/usage-model.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/services/environments/content.test.ts b/tests/api-resources/workers/services/environments/content.test.ts index bcc33a7099..4096a07dab 100644 --- a/tests/api-resources/workers/services/environments/content.test.ts +++ b/tests/api-resources/workers/services/environments/content.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/services/environments/settings.test.ts b/tests/api-resources/workers/services/environments/settings.test.ts index 76d14baa2e..60e05359de 100644 --- a/tests/api-resources/workers/services/environments/settings.test.ts +++ b/tests/api-resources/workers/services/environments/settings.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/workers/subdomains.test.ts b/tests/api-resources/workers/subdomains.test.ts index b2cbbdba97..4e640c2fb0 100644 --- a/tests/api-resources/workers/subdomains.test.ts +++ b/tests/api-resources/workers/subdomains.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/zaraz/config.test.ts b/tests/api-resources/zaraz/config.test.ts index d424e29adf..f099376fee 100644 --- a/tests/api-resources/zaraz/config.test.ts +++ b/tests/api-resources/zaraz/config.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/zaraz/default.test.ts b/tests/api-resources/zaraz/default.test.ts index 6b756e1170..986a3d8089 100644 --- a/tests/api-resources/zaraz/default.test.ts +++ b/tests/api-resources/zaraz/default.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/zaraz/export.test.ts b/tests/api-resources/zaraz/export.test.ts index c02049407e..a66a41380a 100644 --- a/tests/api-resources/zaraz/export.test.ts +++ b/tests/api-resources/zaraz/export.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/zaraz/history/configs.test.ts b/tests/api-resources/zaraz/history/configs.test.ts index 69677dda8f..1025094f2a 100644 --- a/tests/api-resources/zaraz/history/configs.test.ts +++ b/tests/api-resources/zaraz/history/configs.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/zaraz/history/history.test.ts b/tests/api-resources/zaraz/history/history.test.ts index c7c43497ab..c613e39446 100644 --- a/tests/api-resources/zaraz/history/history.test.ts +++ b/tests/api-resources/zaraz/history/history.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/zaraz/publish.test.ts b/tests/api-resources/zaraz/publish.test.ts index 979d5d2e62..89f75944ac 100644 --- a/tests/api-resources/zaraz/publish.test.ts +++ b/tests/api-resources/zaraz/publish.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/zaraz/workflow.test.ts b/tests/api-resources/zaraz/workflow.test.ts index adec956c1b..da8921319c 100644 --- a/tests/api-resources/zaraz/workflow.test.ts +++ b/tests/api-resources/zaraz/workflow.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/zaraz/zaraz.test.ts b/tests/api-resources/zaraz/zaraz.test.ts index 627271ef86..e5f351ca78 100644 --- a/tests/api-resources/zaraz/zaraz.test.ts +++ b/tests/api-resources/zaraz/zaraz.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/zerotrust/connectivity-settings.test.ts b/tests/api-resources/zerotrust/connectivity-settings.test.ts index 022b2d985f..a0442b1e76 100644 --- a/tests/api-resources/zerotrust/connectivity-settings.test.ts +++ b/tests/api-resources/zerotrust/connectivity-settings.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/zones/holds.test.ts b/tests/api-resources/zones/holds.test.ts index 1f9596b693..bff0fbab4c 100644 --- a/tests/api-resources/zones/holds.test.ts +++ b/tests/api-resources/zones/holds.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/api-resources/zones/zones.test.ts b/tests/api-resources/zones/zones.test.ts index 5d362278d3..da853dfda6 100644 --- a/tests/api-resources/zones/zones.test.ts +++ b/tests/api-resources/zones/zones.test.ts @@ -5,9 +5,10 @@ import { Response } from 'node-fetch'; const cloudflare = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); diff --git a/tests/index.test.ts b/tests/index.test.ts index 0af979c046..57dd2f7d8d 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -24,9 +24,10 @@ describe('instantiate client', () => { baseURL: 'http://localhost:5000/', defaultHeaders: { 'X-My-Default-Header': '2' }, apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', }); test('they are used in the request', () => { @@ -59,9 +60,10 @@ describe('instantiate client', () => { baseURL: 'http://localhost:5000/', defaultQuery: { apiVersion: 'foo' }, apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', }); expect(client.buildURL('/foo', null)).toEqual('http://localhost:5000/foo?apiVersion=foo'); }); @@ -71,9 +73,10 @@ describe('instantiate client', () => { baseURL: 'http://localhost:5000/', defaultQuery: { apiVersion: 'foo', hello: 'world' }, apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', }); expect(client.buildURL('/foo', null)).toEqual('http://localhost:5000/foo?apiVersion=foo&hello=world'); }); @@ -83,9 +86,10 @@ describe('instantiate client', () => { baseURL: 'http://localhost:5000/', defaultQuery: { hello: 'world' }, apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', }); expect(client.buildURL('/foo', { hello: undefined })).toEqual('http://localhost:5000/foo'); }); @@ -95,9 +99,10 @@ describe('instantiate client', () => { const client = new Cloudflare({ baseURL: 'http://localhost:5000/', apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', fetch: (url) => { return Promise.resolve( new Response(JSON.stringify({ url, custom: true }), { @@ -115,9 +120,10 @@ describe('instantiate client', () => { const client = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', fetch: (...args) => { return new Promise((resolve, reject) => setTimeout( @@ -145,9 +151,10 @@ describe('instantiate client', () => { const client = new Cloudflare({ baseURL: 'http://localhost:5000/custom/path/', apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', }); expect(client.buildURL('/foo', null)).toEqual('http://localhost:5000/custom/path/foo'); }); @@ -156,9 +163,10 @@ describe('instantiate client', () => { const client = new Cloudflare({ baseURL: 'http://localhost:5000/custom/path', apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', }); expect(client.buildURL('/foo', null)).toEqual('http://localhost:5000/custom/path/foo'); }); @@ -171,9 +179,10 @@ describe('instantiate client', () => { const client = new Cloudflare({ baseURL: 'https://example.com', apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', }); expect(client.baseURL).toEqual('https://example.com'); }); @@ -182,9 +191,10 @@ describe('instantiate client', () => { process.env['CLOUDFLARE_BASE_URL'] = 'https://example.com/from_env'; const client = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', }); expect(client.baseURL).toEqual('https://example.com/from_env'); }); @@ -193,9 +203,10 @@ describe('instantiate client', () => { process.env['CLOUDFLARE_BASE_URL'] = ''; // empty const client = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', }); expect(client.baseURL).toEqual('https://api.cloudflare.com/client/v4'); }); @@ -204,9 +215,10 @@ describe('instantiate client', () => { process.env['CLOUDFLARE_BASE_URL'] = ' '; // blank const client = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', }); expect(client.baseURL).toEqual('https://api.cloudflare.com/client/v4'); }); @@ -216,18 +228,20 @@ describe('instantiate client', () => { const client = new Cloudflare({ maxRetries: 4, apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', }); expect(client.maxRetries).toEqual(4); // default const client2 = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', }); expect(client2.maxRetries).toEqual(2); }); @@ -235,41 +249,49 @@ describe('instantiate client', () => { test('with environment variable arguments', () => { // set options via env var process.env['CLOUDFLARE_API_KEY'] = '144c9defac04969c7bfad8efaa8ea194'; - process.env['CLOUDFLARE_EMAIL'] = 'dev@cloudflare.com'; + process.env['CLOUDFLARE_EMAIL'] = 'user@example.com'; process.env['CLOUDFLARE_API_TOKEN'] = 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY'; - process.env['CLOUDFLARE_API_USER_SERVICE_KEY'] = 'My User Service Key'; + process.env['CLOUDFLARE_API_USER_SERVICE_KEY'] = + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719'; const client = new Cloudflare(); expect(client.apiKey).toBe('144c9defac04969c7bfad8efaa8ea194'); - expect(client.apiEmail).toBe('dev@cloudflare.com'); + expect(client.apiEmail).toBe('user@example.com'); expect(client.apiToken).toBe('Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY'); - expect(client.userServiceKey).toBe('My User Service Key'); + expect(client.userServiceKey).toBe( + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + ); }); test('with overriden environment variable arguments', () => { // set options via env var process.env['CLOUDFLARE_API_KEY'] = 'another 144c9defac04969c7bfad8efaa8ea194'; - process.env['CLOUDFLARE_EMAIL'] = 'another dev@cloudflare.com'; + process.env['CLOUDFLARE_EMAIL'] = 'another user@example.com'; process.env['CLOUDFLARE_API_TOKEN'] = 'another Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY'; - process.env['CLOUDFLARE_API_USER_SERVICE_KEY'] = 'another My User Service Key'; + process.env['CLOUDFLARE_API_USER_SERVICE_KEY'] = + 'another v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719'; const client = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', }); expect(client.apiKey).toBe('144c9defac04969c7bfad8efaa8ea194'); - expect(client.apiEmail).toBe('dev@cloudflare.com'); + expect(client.apiEmail).toBe('user@example.com'); expect(client.apiToken).toBe('Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY'); - expect(client.userServiceKey).toBe('My User Service Key'); + expect(client.userServiceKey).toBe( + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + ); }); }); describe('request building', () => { const client = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', }); describe('Content-Length', () => { @@ -314,9 +336,10 @@ describe('retries', () => { const client = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', timeout: 10, fetch: testFetch, }); @@ -348,9 +371,10 @@ describe('retries', () => { const client = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', fetch: testFetch, }); @@ -381,9 +405,10 @@ describe('retries', () => { const client = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'dev@cloudflare.com', + apiEmail: 'user@example.com', apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', - userServiceKey: 'My User Service Key', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', fetch: testFetch, });