Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit d33d2e9

Browse files
Fix IncomingRequestCfPropertiesGeographicInformation (#310)
* Update index.d.ts Fix to make IncomingRequestCfPropertiesGeographicInformation work. * Prettified changes
1 parent 7bf98e8 commit d33d2e9

File tree

1 file changed

+75
-82
lines changed

1 file changed

+75
-82
lines changed

index.d.ts

Lines changed: 75 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -2270,88 +2270,81 @@ interface IncomingRequestCfPropertiesExportedAuthenticatorMetadata {
22702270
/**
22712271
* Geographic data about the request's origin.
22722272
*/
2273-
type IncomingRequestCfPropertiesGeographicInformation =
2274-
| {
2275-
/* No geographic data was found for the incoming request. */
2276-
}
2277-
| {
2278-
/** The country code `"T1"` is used for requests originating on TOR */
2279-
country: "T1";
2280-
}
2281-
| {
2282-
/**
2283-
* The [ISO 3166-1 Alpha 2](https://www.iso.org/iso-3166-country-codes.html) country code the request originated from.
2284-
*
2285-
* If your worker is [configured to accept TOR connections](https://support.cloudflare.com/hc/en-us/articles/203306930-Understanding-Cloudflare-Tor-support-and-Onion-Routing), this may also be `"T1"`, indicating a request that originated over TOR.
2286-
*
2287-
* If Cloudflare is unable to determine where the request originated this property is omitted.
2288-
*
2289-
* @example "GB"
2290-
*/
2291-
country: Iso3166Alpha2Code;
2292-
/**
2293-
* If present, this property indicates that the request originated in the EU
2294-
*
2295-
* @example "1"
2296-
*/
2297-
isEUCountry?: "1";
2298-
/**
2299-
* A two-letter code indicating the continent the request originated from.
2300-
*
2301-
* @example "AN"
2302-
*/
2303-
continent: ContinentCode;
2304-
/**
2305-
* The city the request originated from
2306-
*
2307-
* @example "Austin"
2308-
*/
2309-
city?: string;
2310-
/**
2311-
* Postal code of the incoming request
2312-
*
2313-
* @example "78701"
2314-
*/
2315-
postalCode?: string;
2316-
/**
2317-
* Latitude of the incoming request
2318-
*
2319-
* @example "30.27130"
2320-
*/
2321-
latitude?: string;
2322-
/**
2323-
* Longitude of the incoming request
2324-
*
2325-
* @example "-97.74260"
2326-
*/
2327-
longitude?: string;
2328-
/**
2329-
* Timezone of the incoming request
2330-
*
2331-
* @example "America/Chicago"
2332-
*/
2333-
timezone?: string;
2334-
/**
2335-
* If known, the ISO 3166-2 name for the first level region associated with
2336-
* the IP address of the incoming request
2337-
*
2338-
* @example "Texas"
2339-
*/
2340-
region?: string;
2341-
/**
2342-
* If known, the ISO 3166-2 code for the first-level region associated with
2343-
* the IP address of the incoming request
2344-
*
2345-
* @example "TX"
2346-
*/
2347-
regionCode?: string;
2348-
/**
2349-
* Metro code (DMA) of the incoming request
2350-
*
2351-
* @example "635"
2352-
*/
2353-
metroCode?: string;
2354-
};
2273+
type IncomingRequestCfPropertiesGeographicInformation = Partial<{
2274+
/**
2275+
* The [ISO 3166-1 Alpha 2](https://www.iso.org/iso-3166-country-codes.html) country code the request originated from.
2276+
*
2277+
* If your worker is [configured to accept TOR connections](https://support.cloudflare.com/hc/en-us/articles/203306930-Understanding-Cloudflare-Tor-support-and-Onion-Routing), this may also be `"T1"`, indicating a request that originated over TOR.
2278+
*
2279+
* If Cloudflare is unable to determine where the request originated this property is omitted.
2280+
*
2281+
* @example "GB"
2282+
*
2283+
*/
2284+
country: Iso3166Alpha2Code | "T1";
2285+
/**
2286+
* If present, this property indicates that the request originated in the EU
2287+
*
2288+
* @example "1"
2289+
*/
2290+
isEUCountry?: "1";
2291+
/**
2292+
* A two-letter code indicating the continent the request originated from.
2293+
*
2294+
* @example "AN"
2295+
*/
2296+
continent: ContinentCode;
2297+
/**
2298+
* The city the request originated from
2299+
*
2300+
* @example "Austin"
2301+
*/
2302+
city?: string;
2303+
/**
2304+
* Postal code of the incoming request
2305+
*
2306+
* @example "78701"
2307+
*/
2308+
postalCode?: string;
2309+
/**
2310+
* Latitude of the incoming request
2311+
*
2312+
* @example "30.27130"
2313+
*/
2314+
latitude?: string;
2315+
/**
2316+
* Longitude of the incoming request
2317+
*
2318+
* @example "-97.74260"
2319+
*/
2320+
longitude?: string;
2321+
/**
2322+
* Timezone of the incoming request
2323+
*
2324+
* @example "America/Chicago"
2325+
*/
2326+
timezone?: string;
2327+
/**
2328+
* If known, the ISO 3166-2 name for the first level region associated with
2329+
* the IP address of the incoming request
2330+
*
2331+
* @example "Texas"
2332+
*/
2333+
region?: string;
2334+
/**
2335+
* If known, the ISO 3166-2 code for the first-level region associated with
2336+
* the IP address of the incoming request
2337+
*
2338+
* @example "TX"
2339+
*/
2340+
regionCode?: string;
2341+
/**
2342+
* Metro code (DMA) of the incoming request
2343+
*
2344+
* @example "635"
2345+
*/
2346+
metroCode?: string;
2347+
}>;
23552348

23562349
/** Data about the incoming request's TLS certificate */
23572350
interface IncomingRequestCfPropertiesTLSClientAuth {

0 commit comments

Comments
 (0)