@parseapi/sdk 1.10.6 → 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -5
- package/dist/index.cjs +84 -14
- package/dist/index.d.cts +224 -77
- package/dist/index.d.ts +224 -77
- package/dist/index.js +84 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -178,7 +178,6 @@ await parse.mx('example.com');
|
|
|
178
178
|
await parse.dns('example.com');
|
|
179
179
|
await parse.dns('_dmarc.example.com', { type: 'TXT' });
|
|
180
180
|
await parse.useragent(uaString);
|
|
181
|
-
await parse.vehicle('1HGCM82633A004352');
|
|
182
181
|
await parse.industry('541511');
|
|
183
182
|
await parse.industry.search('coffee shop', { limit: 5 });
|
|
184
183
|
await parse.tariff('8471.30.01.00');
|
|
@@ -273,7 +272,7 @@ const place = await parse.postal('28202', { country: 'US', deep: true });
|
|
|
273
272
|
const propertyTax = place.deep?.property_tax;
|
|
274
273
|
```
|
|
275
274
|
|
|
276
|
-
Read `
|
|
275
|
+
Read `population` as the source’s count for that place boundary. Keep missing or null values unknown and preserve a known zero. State district lists include each district’s population. Postal nearby and distance detail remains metropolitan associations only. Continent population stays in core.
|
|
277
276
|
|
|
278
277
|
Point returns the timezone ID with the core location. Its optional deep detail adds terrain and compact nearest-city context on every plan. A nearest city is null when none is within 200 km.
|
|
279
278
|
|
|
@@ -340,7 +339,7 @@ Choose enrichment for the question you need answered.
|
|
|
340
339
|
| Phone, Time, Date, Currency, Language, Emoji, Bank, Point | Optional detail in the same pooled request on every plan. |
|
|
341
340
|
| Country, State, District, City, Postal | The place profile on paid plans, including demographic and tax facts where held. |
|
|
342
341
|
| Name, Industry | Name evidence or the industry definition profile on paid plans. |
|
|
343
|
-
|
|
|
342
|
+
| Tariff, Company (national number) | The complete product detail bag on paid plans. |
|
|
344
343
|
| Company directory | Profile detail in the same pooled request on every plan. Search detail belongs to each company result. |
|
|
345
344
|
| Weather | Specialist current measurements and the existing forecast, alert, air and history bag on paid plans. |
|
|
346
345
|
| Carrier, HLR | Optional diagnostic detail within the same metered core unit, including Free allowance units. No second gate or additional check. |
|
|
@@ -452,8 +451,6 @@ Successful checks may be reused for up to 24 hours. `pretty` optionally formats
|
|
|
452
451
|
|
|
453
452
|
Stack defaults to 35 seconds per attempt so a first scan has time to finish. Other lookups retain their 10-second default. An explicit client timeout applies to every operation; JavaScript also supports a per-call `timeoutMs` override.
|
|
454
453
|
|
|
455
|
-
Vehicle lookups use `vin` as the input and response field. Existing VIN methods remain available for compatibility.
|
|
456
|
-
|
|
457
454
|
## Emoji catalog additions
|
|
458
455
|
|
|
459
456
|
Resolve Unicode emoji or a named shortcode, search or browse a bounded catalog,
|
|
@@ -485,3 +482,37 @@ A device's emoji font remains the ordinary display.
|
|
|
485
482
|
|
|
486
483
|
These additions are a local release candidate until the matching SDK and
|
|
487
484
|
backend are published. Existing lookup and search contracts are preserved.
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
## Canonical City operations
|
|
488
|
+
|
|
489
|
+
Classic lookup, search, nearest and named-nearby methods retain their default envelopes and required-field models. Browse and coordinate-nearby use canonical lists: `object`, `data` and nullable `next_cursor` (camelCase properties in Swift/Kotlin). Keep all query options unchanged when continuing a page; no client fetches pages automatically.
|
|
490
|
+
|
|
491
|
+
```js
|
|
492
|
+
const page = await parse.city.search('Viena', {
|
|
493
|
+
format: 'list', match: 'fuzzy', maxDistance: 1,
|
|
494
|
+
});
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
Select `format=resource` for one City or `format=list` for a collection. Country inclusion/exclusion sets, timezone sets, inclusive population and meter-elevation bounds, stored-center `bbox` and signed multi-key sorting are available for collections. Unknown numeric facts do not match range filters.
|
|
498
|
+
|
|
499
|
+
Search defaults to prefix matching. Exact and fuzzy matching are explicit; fuzzy accepts maximum edit distance 1 or 2 and returns `match` evidence (`type`, `source`, `value`, `language`, `edit_distance`). Review a fuzzy choice before storing its ID.
|
|
500
|
+
|
|
501
|
+
Reviewed children, ancestors and siblings use canonical lists with partial relationship coverage. Empty data does not prove there are no geographic relatives. Children/siblings accept page controls; ancestors do not. Distance reports great-circle kilometers and miles between stored centers: zero is known zero, null is unknown, and it does not imply travel time or containment.
|
|
502
|
+
|
|
503
|
+
Strict `ambiguity=error` can return HTTP 409 `ambiguous_city` with up to two safe candidate identities. The existing error constructor and unrelated error metadata are preserved; candidates are retained only for that status/code and never contain Deep. GeoJSON is available through HTTP; these typed City list methods do not return GeoJSON.
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
Reviewed name forms:
|
|
508
|
+
|
|
509
|
+
```js
|
|
510
|
+
const city = await parse.city.id('city_7aj899nvwyku', { format: 'resource', romanized: true });
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
Coverage by country and available fields is described at https://parseapi.com/city#coverage.
|
|
514
|
+
|
|
515
|
+
`romanized=true` requests reviewed official name forms as `name_romanized` and `romanization_language` (camelCase in Swift/Kotlin). Current reviewed forms cover 20 Japanese whole-city aliases in ja-Latn. Missing or conflicting forms stay null; ASCII folding is not substituted for an official form.
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
Conditional `If-None-Match` reads and GeoJSON currently use HTTP directly. A matching City ETag returns 304 without a body; ordinary billing and rate limits apply. These JSON client methods do not supply conditional-cache handling.
|
package/dist/index.cjs
CHANGED
|
@@ -285,7 +285,7 @@ var EmojiCatalog = class {
|
|
|
285
285
|
};
|
|
286
286
|
|
|
287
287
|
// src/index.ts
|
|
288
|
-
var VERSION = "1.
|
|
288
|
+
var VERSION = "1.11.1";
|
|
289
289
|
var API_VERSION = "2.0.0";
|
|
290
290
|
var DEFAULT_BASE_URL = "https://api.parseapi.com";
|
|
291
291
|
var DEFAULT_TIMEOUT_MS = 1e4;
|
|
@@ -444,7 +444,7 @@ function parseAPI(apiKey, options = {}) {
|
|
|
444
444
|
controller.signal.throwIfAborted();
|
|
445
445
|
}
|
|
446
446
|
signal?.throwIfAborted();
|
|
447
|
-
|
|
447
|
+
const error = new ParseAPIError(
|
|
448
448
|
res.status,
|
|
449
449
|
typeof body2.code === "string" ? body2.code : "unknown_error",
|
|
450
450
|
typeof body2.message === "string" ? body2.message : `Request failed with status ${res.status}`,
|
|
@@ -452,6 +452,11 @@ function parseAPI(apiKey, options = {}) {
|
|
|
452
452
|
typeof body2.request_id === "string" ? body2.request_id : null,
|
|
453
453
|
res.headers.get("Retry-After")
|
|
454
454
|
);
|
|
455
|
+
if (error.status === 409 && error.code === "ambiguous_city") {
|
|
456
|
+
const candidates = cityErrorCandidates(body2.candidates);
|
|
457
|
+
if (candidates) error.candidates = candidates;
|
|
458
|
+
}
|
|
459
|
+
throw error;
|
|
455
460
|
}
|
|
456
461
|
} finally {
|
|
457
462
|
clearTimeout(timer);
|
|
@@ -524,19 +529,52 @@ function parseAPI(apiKey, options = {}) {
|
|
|
524
529
|
),
|
|
525
530
|
district: (code, opts) => request(`/district/${enc(code)}`, { country: opts?.country, state: opts?.state, ...deepQuery(opts) }, void 0, opts),
|
|
526
531
|
city: Object.assign(
|
|
527
|
-
(name, opts) => request(`/city/${enc(name)}`, {
|
|
532
|
+
((name, opts) => request(`/city/${enc(name)}`, { ...cityScopeQuery(opts), ...cityResponseQuery(opts), aliases: opts?.aliases ? "true" : void 0, ambiguity: opts?.ambiguity, ...deepQuery(opts) }, void 0, opts)),
|
|
528
533
|
{
|
|
529
|
-
id: (id, opts) => request(`/city/id/${enc(id)}`, deepQuery(opts), void 0, opts),
|
|
530
|
-
search: (query, opts) =>
|
|
531
|
-
|
|
532
|
-
|
|
534
|
+
id: ((id, opts) => request(`/city/id/${enc(id)}`, { hierarchy: opts?.hierarchy ? "true" : void 0, ...cityResponseQuery(opts), ...deepQuery(opts) }, void 0, opts)),
|
|
535
|
+
search: (async (query, opts) => {
|
|
536
|
+
const spelling = opts?.match !== void 0 || opts?.maxDistance !== void 0;
|
|
537
|
+
const result = await request(spelling ? "/city/search" : "/city", { q: query, match: opts?.match, max_distance: opts?.maxDistance, ...cityScopeQuery(opts), ...cityCollectionQuery(opts), ...cityResponseQuery(opts), aliases: opts?.aliases ? "true" : void 0, limit: opts?.limit, ...deepQuery(opts) }, void 0, opts);
|
|
538
|
+
if (spelling && opts?.format !== "list") {
|
|
539
|
+
const list = result;
|
|
540
|
+
return { q: query, ...opts?.country ? { country: opts.country } : {}, ...opts?.state ? { state: opts.state } : {}, cities: list.data, next_cursor: list.next_cursor };
|
|
541
|
+
}
|
|
542
|
+
return result;
|
|
543
|
+
}),
|
|
544
|
+
/** Canonical list resource. Reuse next_cursor with exactly the same options. */
|
|
545
|
+
list: (opts) => request("/city", { browse: "true", ...cityScopeQuery(opts), ...cityCollectionQuery(opts), ...cityResponseQuery(opts), format: "list", limit: opts?.limit, ...deepQuery(opts) }, void 0, opts),
|
|
546
|
+
nearbyCoordinates: (lat, lon, opts) => request("/city", {
|
|
547
|
+
lat,
|
|
548
|
+
lon,
|
|
549
|
+
nearby: "true",
|
|
533
550
|
radius: opts?.radius,
|
|
534
551
|
unit: opts?.unit,
|
|
535
|
-
|
|
536
|
-
|
|
552
|
+
...cityScopeQuery(opts),
|
|
553
|
+
...cityCollectionQuery(opts),
|
|
554
|
+
...cityResponseQuery(opts),
|
|
555
|
+
format: "list",
|
|
537
556
|
limit: opts?.limit,
|
|
538
557
|
...deepQuery(opts)
|
|
539
|
-
}, void 0, opts)
|
|
558
|
+
}, void 0, opts),
|
|
559
|
+
nearest: ((lat, lon, opts) => request("/city", { lat, lon, ...cityScopeQuery(opts), ...cityResponseQuery(opts), ...deepQuery(opts) }, void 0, opts)),
|
|
560
|
+
nearby: ((name, opts) => request(`/city/${enc(name)}/nearby`, {
|
|
561
|
+
radius: opts?.radius,
|
|
562
|
+
unit: opts?.unit,
|
|
563
|
+
...cityScopeQuery(opts),
|
|
564
|
+
...cityCollectionQuery(opts),
|
|
565
|
+
...cityResponseQuery(opts),
|
|
566
|
+
aliases: opts?.aliases ? "true" : void 0,
|
|
567
|
+
ambiguity: opts?.ambiguity,
|
|
568
|
+
limit: opts?.limit,
|
|
569
|
+
...deepQuery(opts)
|
|
570
|
+
}, void 0, opts)),
|
|
571
|
+
/** Reviewed immediate children; coverage is partial. */
|
|
572
|
+
children: (id, opts) => request(`/city/id/${enc(id)}/children`, { limit: opts?.limit, cursor: opts?.cursor, ...cityResponseQuery(opts), hierarchy: opts?.hierarchy ? "true" : void 0, ...deepQuery(opts) }, void 0, opts),
|
|
573
|
+
/** Immediate parent first, following only reviewed parent facts. */
|
|
574
|
+
ancestors: (id, opts) => request(`/city/id/${enc(id)}/ancestors`, { ...cityResponseQuery(opts), hierarchy: opts?.hierarchy ? "true" : void 0, ...deepQuery(opts) }, void 0, opts),
|
|
575
|
+
siblings: (id, opts) => request(`/city/id/${enc(id)}/siblings`, { limit: opts?.limit, cursor: opts?.cursor, ...cityResponseQuery(opts), hierarchy: opts?.hierarchy ? "true" : void 0, ...deepQuery(opts) }, void 0, opts),
|
|
576
|
+
/** Great-circle distance between stored centers, not travel distance or containment. */
|
|
577
|
+
distance: (from, to, opts) => request(`/city/id/${enc(from)}/distance/${enc(to)}`, void 0, void 0, opts)
|
|
540
578
|
}
|
|
541
579
|
),
|
|
542
580
|
/** Look up a postal area. Pass country when known. Check nullable latitude/longitude before another location lookup. */
|
|
@@ -630,10 +668,6 @@ function parseAPI(apiKey, options = {}) {
|
|
|
630
668
|
dns: (domain, opts) => request(`/dns/${enc(domain)}`, { type: opts?.type }, void 0, opts),
|
|
631
669
|
mx: (domain, opts) => request(`/mx/${enc(domain)}`, void 0, void 0, opts),
|
|
632
670
|
useragent: (ua, opts) => request("/useragent", deepQuery(opts), { "User-Agent": ua }, opts),
|
|
633
|
-
/** Identify a vehicle by VIN. Paid deep adds specifications and model-level recall campaigns. */
|
|
634
|
-
vehicle: (vin, opts) => request(`/vehicle/${enc(vin)}`, deepQuery(opts), void 0, opts),
|
|
635
|
-
/** Compatibility entry for VIN callers. */
|
|
636
|
-
vin: (vin, opts) => request(`/vin/${enc(vin)}`, deepQuery(opts), void 0, opts),
|
|
637
671
|
/** US NAICS 2022 definitions and hierarchy. */
|
|
638
672
|
industry,
|
|
639
673
|
/** Compatibility name for industry. */
|
|
@@ -732,6 +766,42 @@ function timeTargets(targets, to) {
|
|
|
732
766
|
}
|
|
733
767
|
return targets.join(",");
|
|
734
768
|
}
|
|
769
|
+
function cityErrorCandidates(input) {
|
|
770
|
+
if (!Array.isArray(input)) return void 0;
|
|
771
|
+
const fields = ["name", "name_local", "country", "country_name", "state", "state_name", "type"];
|
|
772
|
+
return input.slice(0, 2).flatMap((row) => {
|
|
773
|
+
if (!row || typeof row !== "object" || typeof row.id !== "string" || !/^city_[23456789abcdefghjkmnpqrstuvwxyz]{12}$/.test(row.id)) return [];
|
|
774
|
+
const candidate = { id: row.id, object: "city" };
|
|
775
|
+
for (const field of fields) if (Object.hasOwn(row, field) && (row[field] === null || typeof row[field] === "string" && row[field].length <= 255)) candidate[field] = row[field];
|
|
776
|
+
return [candidate];
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
function cityCsv(value) {
|
|
780
|
+
return typeof value === "string" ? value : value?.join(",");
|
|
781
|
+
}
|
|
782
|
+
function cityResponseQuery(opts) {
|
|
783
|
+
return { format: opts?.format, romanized: opts?.romanized ? "true" : void 0 };
|
|
784
|
+
}
|
|
785
|
+
function cityScopeQuery(opts) {
|
|
786
|
+
return { country: opts?.country, state: opts?.state, type: opts?.type, grain: opts?.grain, hierarchy: opts?.hierarchy ? "true" : void 0 };
|
|
787
|
+
}
|
|
788
|
+
function cityCollectionQuery(opts) {
|
|
789
|
+
return {
|
|
790
|
+
min_population: opts?.minPopulation,
|
|
791
|
+
max_population: opts?.maxPopulation,
|
|
792
|
+
min_elevation: opts?.minElevation,
|
|
793
|
+
max_elevation: opts?.maxElevation,
|
|
794
|
+
countries: cityCsv(opts?.countries),
|
|
795
|
+
exclude_countries: cityCsv(opts?.excludeCountries),
|
|
796
|
+
timezones: cityCsv(opts?.timezones),
|
|
797
|
+
timezone: opts?.timezone,
|
|
798
|
+
bbox: opts?.bbox,
|
|
799
|
+
page: opts?.page ? "true" : void 0,
|
|
800
|
+
cursor: opts?.cursor,
|
|
801
|
+
sort: opts?.sort,
|
|
802
|
+
order: opts?.order
|
|
803
|
+
};
|
|
804
|
+
}
|
|
735
805
|
// Annotate the CommonJS export names for ESM import in node:
|
|
736
806
|
0 && (module.exports = {
|
|
737
807
|
EmojiCatalog,
|
package/dist/index.d.cts
CHANGED
|
@@ -58,7 +58,7 @@ interface Continent {
|
|
|
58
58
|
region: string;
|
|
59
59
|
subregion: string;
|
|
60
60
|
population: number | null;
|
|
61
|
-
/**
|
|
61
|
+
/** @deprecated No longer returned. Retained for source compatibility. */
|
|
62
62
|
population_period?: string | null;
|
|
63
63
|
area: number | null;
|
|
64
64
|
emoji: string;
|
|
@@ -135,7 +135,7 @@ interface StateDistrictItem {
|
|
|
135
135
|
}
|
|
136
136
|
interface StateDistrictDeep {
|
|
137
137
|
population: number | null;
|
|
138
|
-
/**
|
|
138
|
+
/** @deprecated No longer returned. Retained for source compatibility. */
|
|
139
139
|
population_period?: string | null;
|
|
140
140
|
}
|
|
141
141
|
interface StateDistricts {
|
|
@@ -160,8 +160,12 @@ interface District {
|
|
|
160
160
|
deep?: Deep<DistrictDeep>;
|
|
161
161
|
}
|
|
162
162
|
interface City {
|
|
163
|
+
/** Present for explicit search matching when the server returns suggestion evidence. */
|
|
164
|
+
match?: CityMatch;
|
|
163
165
|
name: string;
|
|
164
166
|
name_local: string | null;
|
|
167
|
+
name_romanized?: string | null;
|
|
168
|
+
romanization_language?: string | null;
|
|
165
169
|
type: string | null;
|
|
166
170
|
state: string | null;
|
|
167
171
|
state_name: string | null;
|
|
@@ -174,6 +178,10 @@ interface City {
|
|
|
174
178
|
timezone: string | null;
|
|
175
179
|
/** Minted parse id (`city_` + 12 chars). Stable pin via `/city/id/{id}`. */
|
|
176
180
|
id: string;
|
|
181
|
+
/** Returned with hierarchy=true. Null means the layer has not been reviewed. */
|
|
182
|
+
grain?: CityGrain | null;
|
|
183
|
+
/** Reviewed immediate parent; null when no reviewed relationship exists. */
|
|
184
|
+
parent?: CityParent | null;
|
|
177
185
|
deep?: Deep<CityDeep>;
|
|
178
186
|
}
|
|
179
187
|
/** Nearest-city lookups add the distance from the query point. */
|
|
@@ -185,7 +193,12 @@ interface CitySearch {
|
|
|
185
193
|
q: string;
|
|
186
194
|
country?: string;
|
|
187
195
|
state?: string;
|
|
196
|
+
type?: string;
|
|
197
|
+
grain?: CityGrain;
|
|
198
|
+
aliases?: boolean;
|
|
188
199
|
cities: City[];
|
|
200
|
+
/** Present with page=true or a continuation cursor; null when this is the last page. */
|
|
201
|
+
next_cursor?: string | null;
|
|
189
202
|
}
|
|
190
203
|
interface CityNearby {
|
|
191
204
|
city: string;
|
|
@@ -194,6 +207,7 @@ interface CityNearby {
|
|
|
194
207
|
radius: number;
|
|
195
208
|
unit: string;
|
|
196
209
|
nearby: CityNearest[];
|
|
210
|
+
next_cursor?: string | null;
|
|
197
211
|
}
|
|
198
212
|
/** An area's share of ZIP addresses, with category shares measured independently. */
|
|
199
213
|
interface PostalMetro {
|
|
@@ -522,50 +536,6 @@ interface TariffSearch {
|
|
|
522
536
|
/** Up to 20 tariff lines, best match first. */
|
|
523
537
|
lines: TariffSearchHit[];
|
|
524
538
|
}
|
|
525
|
-
interface VinRecall {
|
|
526
|
-
/** Government campaign number. */
|
|
527
|
-
campaign: string;
|
|
528
|
-
/** Report date, ISO YYYY-MM-DD. */
|
|
529
|
-
date: string | null;
|
|
530
|
-
component: string | null;
|
|
531
|
-
/** The filed summary verbatim. */
|
|
532
|
-
summary: string | null;
|
|
533
|
-
}
|
|
534
|
-
interface VinDeep {
|
|
535
|
-
/** Recall campaigns for the decoded year, make and model. [] when none, null when the registry did not answer. */
|
|
536
|
-
recalls?: VinRecall[] | null;
|
|
537
|
-
series: string | null;
|
|
538
|
-
doors: number | null;
|
|
539
|
-
cylinders: number | null;
|
|
540
|
-
/** Engine displacement in liters. */
|
|
541
|
-
displacement: number | null;
|
|
542
|
-
fuel: string | null;
|
|
543
|
-
horsepower: number | null;
|
|
544
|
-
/** fwd, rwd, awd, 4wd. */
|
|
545
|
-
drive: string | null;
|
|
546
|
-
/** automatic, manual, cvt. */
|
|
547
|
-
transmission: string | null;
|
|
548
|
-
manufacturer: string | null;
|
|
549
|
-
plant_city: string | null;
|
|
550
|
-
plant_state: string | null;
|
|
551
|
-
plant_country: string | null;
|
|
552
|
-
/** Gross vehicle weight rating class as filed. */
|
|
553
|
-
gvwr: string | null;
|
|
554
|
-
}
|
|
555
|
-
interface Vin {
|
|
556
|
-
/** Normalized VIN, uppercase, no spaces. Invalid input still echoes the fold. */
|
|
557
|
-
vin: string | null;
|
|
558
|
-
valid: boolean;
|
|
559
|
-
year: number | null;
|
|
560
|
-
make: string | null;
|
|
561
|
-
model: string | null;
|
|
562
|
-
trim: string | null;
|
|
563
|
-
/** Body style (sedan, coupe, suv, pickup). */
|
|
564
|
-
body: string | null;
|
|
565
|
-
/** Vehicle type (passenger car, truck, motorcycle, bus, trailer). */
|
|
566
|
-
type: string | null;
|
|
567
|
-
deep?: Deep<VinDeep>;
|
|
568
|
-
}
|
|
569
539
|
interface Phone {
|
|
570
540
|
phone: string | null;
|
|
571
541
|
valid: boolean;
|
|
@@ -1486,7 +1456,7 @@ interface CountryDeep {
|
|
|
1486
1456
|
region: string | null;
|
|
1487
1457
|
subregion: string | null;
|
|
1488
1458
|
population: number | null;
|
|
1489
|
-
/**
|
|
1459
|
+
/** @deprecated No longer returned. Retained for source compatibility. */
|
|
1490
1460
|
population_period?: string | null;
|
|
1491
1461
|
area: number | null;
|
|
1492
1462
|
/** Land area in km2. */
|
|
@@ -1531,7 +1501,7 @@ interface CountryElevationPoint {
|
|
|
1531
1501
|
}
|
|
1532
1502
|
interface StateDeep {
|
|
1533
1503
|
population: number | null;
|
|
1534
|
-
/**
|
|
1504
|
+
/** @deprecated No longer returned. Retained for source compatibility. */
|
|
1535
1505
|
population_period?: string | null;
|
|
1536
1506
|
/** Total area in km2. */
|
|
1537
1507
|
area: number | null;
|
|
@@ -1545,7 +1515,7 @@ interface StateDeep {
|
|
|
1545
1515
|
}
|
|
1546
1516
|
interface DistrictDeep {
|
|
1547
1517
|
population: number | null;
|
|
1548
|
-
/**
|
|
1518
|
+
/** @deprecated No longer returned. Retained for source compatibility. */
|
|
1549
1519
|
population_period?: string | null;
|
|
1550
1520
|
/** Total area in km2 (land + water, or the official total). */
|
|
1551
1521
|
area: number | null;
|
|
@@ -1563,8 +1533,12 @@ interface CityDeep {
|
|
|
1563
1533
|
elevation: number | null;
|
|
1564
1534
|
elevation_ft: number | null;
|
|
1565
1535
|
population: number | null;
|
|
1566
|
-
/**
|
|
1536
|
+
/** @deprecated No longer returned. Retained for source compatibility. */
|
|
1567
1537
|
population_period?: string | null;
|
|
1538
|
+
/** Exact observation date for a reviewed same-grain count; omitted for legacy undated counts. */
|
|
1539
|
+
population_observed_on?: string;
|
|
1540
|
+
/** Published population basis, for example registered_population. */
|
|
1541
|
+
population_basis?: string;
|
|
1568
1542
|
/** Total area in km2 (land + water, or the official total). */
|
|
1569
1543
|
area: number | null;
|
|
1570
1544
|
/** Land area in km2. Null when the source publishes total only. */
|
|
@@ -1576,7 +1550,7 @@ interface PostalDeep {
|
|
|
1576
1550
|
elevation: number | null;
|
|
1577
1551
|
elevation_ft: number | null;
|
|
1578
1552
|
population: number | null;
|
|
1579
|
-
/**
|
|
1553
|
+
/** @deprecated No longer returned. Retained for source compatibility. */
|
|
1580
1554
|
population_period?: string | null;
|
|
1581
1555
|
/** Total area in km2. Null when the source has no water split. */
|
|
1582
1556
|
area: number | null;
|
|
@@ -1796,9 +1770,6 @@ type IndustryExclusion = NaicsExclusion;
|
|
|
1796
1770
|
type IndustryMatch = NaicsMatch;
|
|
1797
1771
|
type IndustrySearch = NaicsSearch;
|
|
1798
1772
|
type IndustrySearchItem = NaicsSearchItem;
|
|
1799
|
-
type Vehicle = Vin;
|
|
1800
|
-
type VehicleDeep = VinDeep;
|
|
1801
|
-
type VehicleRecall = VinRecall;
|
|
1802
1773
|
interface Iban {
|
|
1803
1774
|
iban: string | null;
|
|
1804
1775
|
valid: boolean;
|
|
@@ -1886,6 +1857,79 @@ interface EmojiConversion {
|
|
|
1886
1857
|
text: string;
|
|
1887
1858
|
unresolved: EmojiUnresolved[];
|
|
1888
1859
|
}
|
|
1860
|
+
type CityGrain = 'municipality' | 'subdivision' | 'locality' | 'metropolitan_area';
|
|
1861
|
+
interface CityParent {
|
|
1862
|
+
id: string;
|
|
1863
|
+
name: string | null;
|
|
1864
|
+
name_local: string | null;
|
|
1865
|
+
country: string;
|
|
1866
|
+
state: string | null;
|
|
1867
|
+
type: string | null;
|
|
1868
|
+
grain: CityGrain | null;
|
|
1869
|
+
}
|
|
1870
|
+
interface CityMatch {
|
|
1871
|
+
type: string;
|
|
1872
|
+
source: string;
|
|
1873
|
+
value: string;
|
|
1874
|
+
language: string | null;
|
|
1875
|
+
edit_distance: number | null;
|
|
1876
|
+
}
|
|
1877
|
+
interface CityAmbiguityCandidate {
|
|
1878
|
+
id: string;
|
|
1879
|
+
object: 'city';
|
|
1880
|
+
name?: string | null;
|
|
1881
|
+
name_local?: string | null;
|
|
1882
|
+
country?: string | null;
|
|
1883
|
+
country_name?: string | null;
|
|
1884
|
+
state?: string | null;
|
|
1885
|
+
state_name?: string | null;
|
|
1886
|
+
type?: string | null;
|
|
1887
|
+
}
|
|
1888
|
+
type CityResource = City & {
|
|
1889
|
+
object: 'city';
|
|
1890
|
+
distance?: number;
|
|
1891
|
+
distance_mi?: number;
|
|
1892
|
+
};
|
|
1893
|
+
interface CityCollection {
|
|
1894
|
+
object: 'list';
|
|
1895
|
+
data: CityResource[];
|
|
1896
|
+
has_more?: boolean;
|
|
1897
|
+
url?: string;
|
|
1898
|
+
/** Opaque, query-bound continuation. Keep the same options on the next call. */
|
|
1899
|
+
next_cursor: string | null;
|
|
1900
|
+
q?: string;
|
|
1901
|
+
country?: string;
|
|
1902
|
+
state?: string | null;
|
|
1903
|
+
type?: string;
|
|
1904
|
+
grain?: CityGrain;
|
|
1905
|
+
aliases?: boolean;
|
|
1906
|
+
city?: string;
|
|
1907
|
+
radius?: number;
|
|
1908
|
+
unit?: string;
|
|
1909
|
+
}
|
|
1910
|
+
interface CityList extends CityCollection {
|
|
1911
|
+
}
|
|
1912
|
+
interface CityRelations extends CityCollection {
|
|
1913
|
+
city_id: string;
|
|
1914
|
+
relationship: 'children' | 'ancestors' | 'siblings';
|
|
1915
|
+
coverage: 'partial';
|
|
1916
|
+
parent_id?: string | null;
|
|
1917
|
+
}
|
|
1918
|
+
interface CityDistance {
|
|
1919
|
+
object: 'city_distance';
|
|
1920
|
+
from: string;
|
|
1921
|
+
to: string;
|
|
1922
|
+
/** Great-circle kilometers between stored centers; null when coordinates are unknown. */
|
|
1923
|
+
distance: number | null;
|
|
1924
|
+
distance_mi: number | null;
|
|
1925
|
+
method: 'great_circle';
|
|
1926
|
+
}
|
|
1927
|
+
interface CityNearbyCoordinates extends CityCollection {
|
|
1928
|
+
latitude: number;
|
|
1929
|
+
longitude: number;
|
|
1930
|
+
radius: number;
|
|
1931
|
+
unit: string;
|
|
1932
|
+
}
|
|
1889
1933
|
|
|
1890
1934
|
/** A proposed task contains operation counts, never lookup inputs. */
|
|
1891
1935
|
interface PreflightOperation {
|
|
@@ -2124,6 +2168,7 @@ declare class ParseAPIError extends Error {
|
|
|
2124
2168
|
readonly requestId: string | null;
|
|
2125
2169
|
/** Original Retry-After response header, when supplied. */
|
|
2126
2170
|
readonly retryAfter: string | null;
|
|
2171
|
+
candidates?: CityAmbiguityCandidate[];
|
|
2127
2172
|
constructor(status: number, code: string, message: string, docs: string | null, requestId: string | null, retryAfter?: string | null);
|
|
2128
2173
|
}
|
|
2129
2174
|
/** Optional output language for supported display fields. Input parsing stays unchanged. */
|
|
@@ -2167,23 +2212,34 @@ type DistrictOptions = LanguageOption & {
|
|
|
2167
2212
|
country?: string;
|
|
2168
2213
|
state?: string;
|
|
2169
2214
|
} & DeepOption & RequestOptions;
|
|
2170
|
-
type CityOptions = LanguageOption & {
|
|
2171
|
-
|
|
2172
|
-
|
|
2215
|
+
type CityOptions = LanguageOption & CityScopeOptions & CityResponseOptions & {
|
|
2216
|
+
format?: 'resource';
|
|
2217
|
+
aliases?: boolean;
|
|
2218
|
+
ambiguity?: 'error';
|
|
2173
2219
|
} & DeepOption & RequestOptions;
|
|
2174
|
-
type CityIdOptions = LanguageOption &
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2220
|
+
type CityIdOptions = LanguageOption & CityResponseOptions & {
|
|
2221
|
+
format?: 'resource';
|
|
2222
|
+
hierarchy?: boolean;
|
|
2223
|
+
} & DeepOption & RequestOptions;
|
|
2224
|
+
type CitySearchOptions = LanguageOption & CityScopeOptions & CityCollectionFilters & CityPagingOptions & CityResponseOptions & {
|
|
2225
|
+
format?: 'list';
|
|
2226
|
+
aliases?: boolean;
|
|
2178
2227
|
limit?: number;
|
|
2228
|
+
sort?: CitySort;
|
|
2229
|
+
match?: 'exact' | 'prefix' | 'fuzzy';
|
|
2230
|
+
maxDistance?: 1 | 2;
|
|
2231
|
+
} & DeepOption & RequestOptions;
|
|
2232
|
+
type CityNearestOptions = LanguageOption & CityScopeOptions & CityResponseOptions & {
|
|
2233
|
+
format?: 'resource';
|
|
2179
2234
|
} & DeepOption & RequestOptions;
|
|
2180
|
-
type
|
|
2181
|
-
|
|
2235
|
+
type CityNearbyOptions = LanguageOption & CityScopeOptions & CityCollectionFilters & CityPagingOptions & CityResponseOptions & {
|
|
2236
|
+
format?: 'list';
|
|
2237
|
+
aliases?: boolean;
|
|
2238
|
+
ambiguity?: 'error';
|
|
2182
2239
|
radius?: number;
|
|
2183
2240
|
unit?: 'km' | 'mi';
|
|
2184
|
-
country?: string;
|
|
2185
|
-
state?: string;
|
|
2186
2241
|
limit?: number;
|
|
2242
|
+
sort?: CitySort;
|
|
2187
2243
|
} & DeepOption & RequestOptions;
|
|
2188
2244
|
/** Pass country when known. Codes shared by multiple countries need it. */
|
|
2189
2245
|
type PostalOptions = LanguageOption & {
|
|
@@ -2295,8 +2351,6 @@ type DnsOptions = {
|
|
|
2295
2351
|
} & RequestOptions;
|
|
2296
2352
|
type MxOptions = RequestOptions;
|
|
2297
2353
|
type UseragentOptions = DeepOption & RequestOptions;
|
|
2298
|
-
type VinOptions = DeepOption & RequestOptions;
|
|
2299
|
-
type VehicleOptions = VinOptions;
|
|
2300
2354
|
/** US NAICS 2022 code lookup, using pooled requests. */
|
|
2301
2355
|
type IndustryOptions = DeepOption & RequestOptions;
|
|
2302
2356
|
/** Keyword search. Limit defaults to 10 and accepts 1-50. */
|
|
@@ -2452,11 +2506,21 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
2452
2506
|
districts: (code: string, opts?: StateDistrictsOptions) => Promise<StateDistricts>;
|
|
2453
2507
|
};
|
|
2454
2508
|
district: (code: string, opts?: DistrictOptions) => Promise<District>;
|
|
2455
|
-
city:
|
|
2456
|
-
id:
|
|
2457
|
-
search:
|
|
2458
|
-
|
|
2459
|
-
|
|
2509
|
+
city: CityLookupCall & {
|
|
2510
|
+
id: CityIdCall;
|
|
2511
|
+
search: CitySearchCall;
|
|
2512
|
+
/** Canonical list resource. Reuse next_cursor with exactly the same options. */
|
|
2513
|
+
list: (opts?: CityListOptions) => Promise<CityList>;
|
|
2514
|
+
nearbyCoordinates: (lat: number, lon: number, opts?: CityNearbyCoordinatesOptions) => Promise<CityNearbyCoordinates>;
|
|
2515
|
+
nearest: CityNearestCall;
|
|
2516
|
+
nearby: CityNearbyCall;
|
|
2517
|
+
/** Reviewed immediate children; coverage is partial. */
|
|
2518
|
+
children: (id: string, opts?: CityRelationsOptions) => Promise<CityRelations>;
|
|
2519
|
+
/** Immediate parent first, following only reviewed parent facts. */
|
|
2520
|
+
ancestors: (id: string, opts?: CityAncestorsOptions) => Promise<CityRelations>;
|
|
2521
|
+
siblings: (id: string, opts?: CityRelationsOptions) => Promise<CityRelations>;
|
|
2522
|
+
/** Great-circle distance between stored centers, not travel distance or containment. */
|
|
2523
|
+
distance: (from: string, to: string, opts?: CityDistanceOptions) => Promise<CityDistance>;
|
|
2460
2524
|
};
|
|
2461
2525
|
/** Look up a postal area. Pass country when known. Check nullable latitude/longitude before another location lookup. */
|
|
2462
2526
|
postal: ((code: string, opts?: PostalOptions) => Promise<Postal>) & {
|
|
@@ -2517,10 +2581,6 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
2517
2581
|
dns: (domain: string, opts?: DnsOptions) => Promise<Dns>;
|
|
2518
2582
|
mx: (domain: string, opts?: MxOptions) => Promise<Mx>;
|
|
2519
2583
|
useragent: (ua: string, opts?: UseragentOptions) => Promise<Useragent>;
|
|
2520
|
-
/** Identify a vehicle by VIN. Paid deep adds specifications and model-level recall campaigns. */
|
|
2521
|
-
vehicle: (vin: string, opts?: VehicleOptions) => Promise<Vehicle>;
|
|
2522
|
-
/** Compatibility entry for VIN callers. */
|
|
2523
|
-
vin: (vin: string, opts?: VinOptions) => Promise<Vin>;
|
|
2524
2584
|
/** US NAICS 2022 definitions and hierarchy. */
|
|
2525
2585
|
industry: ((code: string, opts?: IndustryOptions) => Promise<Industry>) & {
|
|
2526
2586
|
search: (query: string, opts?: IndustrySearchOptions) => Promise<IndustrySearch>;
|
|
@@ -2583,5 +2643,92 @@ type IbanOptions = {
|
|
|
2583
2643
|
} & DeepOption & RequestOptions;
|
|
2584
2644
|
type NpiOptions = LanguageOption & DeepOption & RequestOptions;
|
|
2585
2645
|
type BinOptions = DeepOption & RequestOptions;
|
|
2646
|
+
type CityScopeOptions = {
|
|
2647
|
+
country?: string;
|
|
2648
|
+
state?: string;
|
|
2649
|
+
type?: string;
|
|
2650
|
+
grain?: CityGrain;
|
|
2651
|
+
hierarchy?: boolean;
|
|
2652
|
+
};
|
|
2653
|
+
type CityResponseOptions = {
|
|
2654
|
+
romanized?: boolean;
|
|
2655
|
+
};
|
|
2656
|
+
type CityCollectionFilters = {
|
|
2657
|
+
minPopulation?: number;
|
|
2658
|
+
maxPopulation?: number;
|
|
2659
|
+
minElevation?: number;
|
|
2660
|
+
maxElevation?: number;
|
|
2661
|
+
countries?: string | readonly string[];
|
|
2662
|
+
excludeCountries?: string | readonly string[];
|
|
2663
|
+
timezone?: string;
|
|
2664
|
+
timezones?: string | readonly string[];
|
|
2665
|
+
/** Center-coordinate box: west,south,east,north. West > east crosses the date line. */
|
|
2666
|
+
bbox?: string;
|
|
2667
|
+
};
|
|
2668
|
+
type CityPagingOptions = {
|
|
2669
|
+
page?: boolean;
|
|
2670
|
+
cursor?: string;
|
|
2671
|
+
order?: 'asc' | 'desc';
|
|
2672
|
+
};
|
|
2673
|
+
type CitySort = string;
|
|
2674
|
+
type CityListOptions = LanguageOption & CityScopeOptions & CityCollectionFilters & CityResponseOptions & {
|
|
2675
|
+
limit?: number;
|
|
2676
|
+
cursor?: string;
|
|
2677
|
+
sort?: CitySort;
|
|
2678
|
+
order?: 'asc' | 'desc';
|
|
2679
|
+
} & DeepOption & RequestOptions;
|
|
2680
|
+
type CityNearbyCoordinatesOptions = LanguageOption & CityScopeOptions & CityCollectionFilters & CityResponseOptions & {
|
|
2681
|
+
radius?: number;
|
|
2682
|
+
unit?: 'km' | 'mi';
|
|
2683
|
+
limit?: number;
|
|
2684
|
+
cursor?: string;
|
|
2685
|
+
sort?: CitySort;
|
|
2686
|
+
order?: 'asc' | 'desc';
|
|
2687
|
+
} & DeepOption & RequestOptions;
|
|
2688
|
+
type CityRelationsOptions = LanguageOption & CityResponseOptions & {
|
|
2689
|
+
limit?: number;
|
|
2690
|
+
cursor?: string;
|
|
2691
|
+
hierarchy?: boolean;
|
|
2692
|
+
} & DeepOption & RequestOptions;
|
|
2693
|
+
type CityAncestorsOptions = Omit<CityRelationsOptions, 'limit' | 'cursor'>;
|
|
2694
|
+
type CityDistanceOptions = RequestOptions;
|
|
2695
|
+
type ClassicCityOptions<T> = T & {
|
|
2696
|
+
format?: never;
|
|
2697
|
+
};
|
|
2698
|
+
interface CityLookupCall {
|
|
2699
|
+
(name: string, opts?: ClassicCityOptions<CityOptions>): Promise<City>;
|
|
2700
|
+
(name: string, opts: CityOptions & {
|
|
2701
|
+
format: 'resource';
|
|
2702
|
+
}): Promise<CityResource>;
|
|
2703
|
+
(name: string, opts: CityOptions): Promise<City>;
|
|
2704
|
+
}
|
|
2705
|
+
interface CityIdCall {
|
|
2706
|
+
(id: string, opts?: ClassicCityOptions<CityIdOptions>): Promise<City>;
|
|
2707
|
+
(id: string, opts: CityIdOptions & {
|
|
2708
|
+
format: 'resource';
|
|
2709
|
+
}): Promise<CityResource>;
|
|
2710
|
+
(id: string, opts: CityIdOptions): Promise<City>;
|
|
2711
|
+
}
|
|
2712
|
+
interface CityNearestCall {
|
|
2713
|
+
(lat: number, lon: number, opts?: ClassicCityOptions<CityNearestOptions>): Promise<CityNearest>;
|
|
2714
|
+
(lat: number, lon: number, opts: CityNearestOptions & {
|
|
2715
|
+
format: 'resource';
|
|
2716
|
+
}): Promise<CityResource & Pick<CityNearest, 'distance' | 'distance_mi'>>;
|
|
2717
|
+
(lat: number, lon: number, opts: CityNearestOptions): Promise<CityNearest>;
|
|
2718
|
+
}
|
|
2719
|
+
interface CitySearchCall {
|
|
2720
|
+
(query: string, opts?: ClassicCityOptions<CitySearchOptions>): Promise<CitySearch>;
|
|
2721
|
+
(query: string, opts: CitySearchOptions & {
|
|
2722
|
+
format: 'list';
|
|
2723
|
+
}): Promise<CityCollection>;
|
|
2724
|
+
(query: string, opts: CitySearchOptions): Promise<CitySearch | CityCollection>;
|
|
2725
|
+
}
|
|
2726
|
+
interface CityNearbyCall {
|
|
2727
|
+
(name: string, opts?: ClassicCityOptions<CityNearbyOptions>): Promise<CityNearby>;
|
|
2728
|
+
(name: string, opts: CityNearbyOptions & {
|
|
2729
|
+
format: 'list';
|
|
2730
|
+
}): Promise<CityCollection>;
|
|
2731
|
+
(name: string, opts: CityNearbyOptions): Promise<CityNearby | CityCollection>;
|
|
2732
|
+
}
|
|
2586
2733
|
|
|
2587
|
-
export { type Address, type AddressOptions, type AddressSearch, type AddressSearchOptions, type AddressSuggestion, type AgentTask, type AgentTaskInput, type AgentTaskLookupInput, type AgentTaskResult, type Asn, type AsnOptions, type Bank, type BankChecks, type BankDeep, type BankDirectory, type BankIssue, type BankOptions, type BankRequirementField, type BankRequirements, type BankRequirementsOptions, type BankUsAch, type BankUsAchChecks, type BankUsAchInput, type Bin, type BinOptions, type Bloc, type BlocCountries, type BlocCountriesOptions, type BlocCountryItem, type BlocOptions, type Caller, type CallerOptions, type Card, type CardDeep, type CardOptions, type Carrier, type CarrierDeep, type CarrierOptions, type City, type CityDeep, type CityIdOptions, type CityNearby, type CityNearbyOptions, type CityNearest, type CityNearestOptions, type CityOptions, type CitySearch, type CitySearchOptions, type Company, type CompanyCandidate, type CompanyCountry, type CompanyCoverage, type CompanyCoverageOptions, type CompanyDeep, type CompanyEmailAddress, type CompanyIdOptions, type CompanyMatch, type CompanyOptions, type CompanyPhoneNumber, type CompanyProfile, type CompanyProfileAddress, type CompanyProfileDeep, type CompanyProfileDomain, type CompanyProfileEmail, type CompanyProfileEmployees, type CompanyProfileFounding, type CompanyProfileIdentifier, type CompanyProfileIndustry, type CompanyProfileJurisdiction, type CompanyProfileListing, type CompanyProfilePhone, type CompanyProfileRegistration, type CompanyProfileRegistrationAddress, type CompanyProfileRegistrationLegalForm, type CompanyProfileSource, type CompanyProfileWebsite, type CompanySearch, type CompanySearchOptions, type CompanySocialProfile, type Continent, type ContinentCountries, type ContinentCountriesOptions, type ContinentCountryItem, type ContinentOptions, type Country, type CountryDeep, type CountryElevationPoint, type CountryEmergency, type CountryOptions, type CountryStateItem, type CountryStates, type CountryStatesOptions, type Currency, type CurrencyDeep, type CurrencyOptions, type CurrencyRate, type CurrencyRateOptions, type DateInfo, type DateInfoDeep, type DateOptions, type DateTodayOptions, type Deep, type District, type DistrictDeep, type DistrictOptions, type Dns, type DnsOptions, type DnsRecord, type Domain, type DomainDeep, type DomainOptions, type DomainRegistration, type Elevation, type ElevationLocations, type ElevationOptions, type Email, type EmailDeep, type EmailOptions, type Emoji, type EmojiArtwork, type EmojiArtworkSource, type EmojiBrowse, type EmojiBrowseOptions, EmojiCatalog, type EmojiCatalogConvertOptions, type EmojiCatalogData, EmojiCatalogError, type EmojiCatalogLocalization, type EmojiCatalogLookupOptions, type EmojiCatalogOptions, type EmojiCatalogParseOptions, type EmojiCatalogRegexOptions, type EmojiCatalogScope, type EmojiCatalogSearchFacts, type EmojiCatalogSearchOptions, type EmojiCategories, type EmojiCategory, type EmojiConversion, type EmojiConvertOptions, type EmojiDeep, type EmojiMetadata, type EmojiNativeSearchFacts, type EmojiNotice, type EmojiOptions, type EmojiParse, type EmojiParseOptions, type EmojiPosition, type EmojiSearch, type EmojiSearchOptions, type EmojiShortcodeSourceMetadata, type EmojiSkin, type EmojiSource, type EmojiUnresolved, type EmojiVariant, type Hlr, type HlrDeep, type HlrOptions, type Holiday, type HolidayDate, type HolidayDateOptions, type HolidayOptions, type HolidayYear, type Iban, type IbanDeep, type IbanOptions, type Industry, type IndustryChild, type IndustryCorrection, type IndustryDeep, type IndustryExclusion, type IndustryMatch, type IndustryOptions, type IndustrySearch, type IndustrySearchItem, type IndustrySearchOptions, type Ip, type IpDeep, type IpOptions, type IpSelfOptions, type Language, type LanguageDeep, type LanguageOption, type LanguageOptions, type Mac, type MacOptions, type Measure, type MeasureChoice, type MeasureOptions, type MeasureUnit, type MeasureUnits, type MeasureUnitsOptions, type Mx, type MxOptions, type MxRecord, type Naics, type NaicsChild, type NaicsCorrection, type NaicsDeep, type NaicsExclusion, type NaicsMatch, type NaicsOptions, type NaicsSearch, type NaicsSearchItem, type NaicsSearchOptions, type Name, type NameDeep, type NameOptions, type Npi, type NpiDeep, type NpiEnrollment, type NpiOptions, type ParseAPIClient, ParseAPIError, type ParseAPIOptions, type Phone, type PhoneDeep, type PhoneOptions, type Point, type PointCity, type PointDeep, type PointOptions, type Postal, type PostalDeep, type PostalDistance, type PostalDistanceEnd, type PostalDistanceOptions, type PostalLocality, type PostalMetro, type PostalMetrosDeep, type PostalNearby, type PostalNearbyItem, type PostalNearbyOptions, type PostalOptions, type Preflight, type PreflightCost, type PreflightEmailCapacity, type PreflightOperation, type PreflightOperationEstimate, type PreflightPooledCapacity, type PreflightSpendCapacity, type PreflightTask, type PropertyTax, type Provider, type ProviderDeep, type ProviderEnrollment, type ProviderOptions, type ProviderSource, type ProviderSources, type ProviderTaxonomy, type RequestOptions, type Stack, type StackOptions, type StackTechnology, type State, type StateDeep, type StateDistrictDeep, type StateDistrictItem, type StateDistricts, type StateDistrictsOptions, type StateOptions, type Tariff, type TariffDeep, type TariffMeasure, type TariffOptions, type TariffSearch, type TariffSearchHit, type TariffSearchOptions, type Time, type TimeAtOptions, type TimeLocation, type TimeLocationCandidate, type TimeLocationInput, type TimeOptions, type TimeResolution, type TimeResolutionAlternative, type TimeSeason, type TimeTransition, type TimeTransitionState, type TimeZoneEntry, type TimeZones, type TimeZonesOptions, type Timezone, type TimezoneAtOptions, type TimezoneConversionTarget, type TimezoneConversionTargetDeep, type TimezoneDeep, type TimezoneNextDst, type TimezoneOptions, type Useragent, type UseragentBrowserBrand, type UseragentBrowserDeep, type UseragentDeep, type UseragentDeviceDeep, type UseragentEngineDeep, type UseragentOptions, type UseragentOsDeep, type Vat, type VatAddress, type VatDeep, type VatOptions, type
|
|
2734
|
+
export { type Address, type AddressOptions, type AddressSearch, type AddressSearchOptions, type AddressSuggestion, type AgentTask, type AgentTaskInput, type AgentTaskLookupInput, type AgentTaskResult, type Asn, type AsnOptions, type Bank, type BankChecks, type BankDeep, type BankDirectory, type BankIssue, type BankOptions, type BankRequirementField, type BankRequirements, type BankRequirementsOptions, type BankUsAch, type BankUsAchChecks, type BankUsAchInput, type Bin, type BinOptions, type Bloc, type BlocCountries, type BlocCountriesOptions, type BlocCountryItem, type BlocOptions, type Caller, type CallerOptions, type Card, type CardDeep, type CardOptions, type Carrier, type CarrierDeep, type CarrierOptions, type City, type CityAmbiguityCandidate, type CityAncestorsOptions, type CityCollection, type CityCollectionFilters, type CityDeep, type CityDistance, type CityDistanceOptions, type CityGrain, type CityIdCall, type CityIdOptions, type CityList, type CityListOptions, type CityLookupCall, type CityMatch, type CityNearby, type CityNearbyCall, type CityNearbyCoordinates, type CityNearbyCoordinatesOptions, type CityNearbyOptions, type CityNearest, type CityNearestCall, type CityNearestOptions, type CityOptions, type CityPagingOptions, type CityParent, type CityRelations, type CityRelationsOptions, type CityResource, type CityResponseOptions, type CityScopeOptions, type CitySearch, type CitySearchCall, type CitySearchOptions, type CitySort, type Company, type CompanyCandidate, type CompanyCountry, type CompanyCoverage, type CompanyCoverageOptions, type CompanyDeep, type CompanyEmailAddress, type CompanyIdOptions, type CompanyMatch, type CompanyOptions, type CompanyPhoneNumber, type CompanyProfile, type CompanyProfileAddress, type CompanyProfileDeep, type CompanyProfileDomain, type CompanyProfileEmail, type CompanyProfileEmployees, type CompanyProfileFounding, type CompanyProfileIdentifier, type CompanyProfileIndustry, type CompanyProfileJurisdiction, type CompanyProfileListing, type CompanyProfilePhone, type CompanyProfileRegistration, type CompanyProfileRegistrationAddress, type CompanyProfileRegistrationLegalForm, type CompanyProfileSource, type CompanyProfileWebsite, type CompanySearch, type CompanySearchOptions, type CompanySocialProfile, type Continent, type ContinentCountries, type ContinentCountriesOptions, type ContinentCountryItem, type ContinentOptions, type Country, type CountryDeep, type CountryElevationPoint, type CountryEmergency, type CountryOptions, type CountryStateItem, type CountryStates, type CountryStatesOptions, type Currency, type CurrencyDeep, type CurrencyOptions, type CurrencyRate, type CurrencyRateOptions, type DateInfo, type DateInfoDeep, type DateOptions, type DateTodayOptions, type Deep, type District, type DistrictDeep, type DistrictOptions, type Dns, type DnsOptions, type DnsRecord, type Domain, type DomainDeep, type DomainOptions, type DomainRegistration, type Elevation, type ElevationLocations, type ElevationOptions, type Email, type EmailDeep, type EmailOptions, type Emoji, type EmojiArtwork, type EmojiArtworkSource, type EmojiBrowse, type EmojiBrowseOptions, EmojiCatalog, type EmojiCatalogConvertOptions, type EmojiCatalogData, EmojiCatalogError, type EmojiCatalogLocalization, type EmojiCatalogLookupOptions, type EmojiCatalogOptions, type EmojiCatalogParseOptions, type EmojiCatalogRegexOptions, type EmojiCatalogScope, type EmojiCatalogSearchFacts, type EmojiCatalogSearchOptions, type EmojiCategories, type EmojiCategory, type EmojiConversion, type EmojiConvertOptions, type EmojiDeep, type EmojiMetadata, type EmojiNativeSearchFacts, type EmojiNotice, type EmojiOptions, type EmojiParse, type EmojiParseOptions, type EmojiPosition, type EmojiSearch, type EmojiSearchOptions, type EmojiShortcodeSourceMetadata, type EmojiSkin, type EmojiSource, type EmojiUnresolved, type EmojiVariant, type Hlr, type HlrDeep, type HlrOptions, type Holiday, type HolidayDate, type HolidayDateOptions, type HolidayOptions, type HolidayYear, type Iban, type IbanDeep, type IbanOptions, type Industry, type IndustryChild, type IndustryCorrection, type IndustryDeep, type IndustryExclusion, type IndustryMatch, type IndustryOptions, type IndustrySearch, type IndustrySearchItem, type IndustrySearchOptions, type Ip, type IpDeep, type IpOptions, type IpSelfOptions, type Language, type LanguageDeep, type LanguageOption, type LanguageOptions, type Mac, type MacOptions, type Measure, type MeasureChoice, type MeasureOptions, type MeasureUnit, type MeasureUnits, type MeasureUnitsOptions, type Mx, type MxOptions, type MxRecord, type Naics, type NaicsChild, type NaicsCorrection, type NaicsDeep, type NaicsExclusion, type NaicsMatch, type NaicsOptions, type NaicsSearch, type NaicsSearchItem, type NaicsSearchOptions, type Name, type NameDeep, type NameOptions, type Npi, type NpiDeep, type NpiEnrollment, type NpiOptions, type ParseAPIClient, ParseAPIError, type ParseAPIOptions, type Phone, type PhoneDeep, type PhoneOptions, type Point, type PointCity, type PointDeep, type PointOptions, type Postal, type PostalDeep, type PostalDistance, type PostalDistanceEnd, type PostalDistanceOptions, type PostalLocality, type PostalMetro, type PostalMetrosDeep, type PostalNearby, type PostalNearbyItem, type PostalNearbyOptions, type PostalOptions, type Preflight, type PreflightCost, type PreflightEmailCapacity, type PreflightOperation, type PreflightOperationEstimate, type PreflightPooledCapacity, type PreflightSpendCapacity, type PreflightTask, type PropertyTax, type Provider, type ProviderDeep, type ProviderEnrollment, type ProviderOptions, type ProviderSource, type ProviderSources, type ProviderTaxonomy, type RequestOptions, type Stack, type StackOptions, type StackTechnology, type State, type StateDeep, type StateDistrictDeep, type StateDistrictItem, type StateDistricts, type StateDistrictsOptions, type StateOptions, type Tariff, type TariffDeep, type TariffMeasure, type TariffOptions, type TariffSearch, type TariffSearchHit, type TariffSearchOptions, type Time, type TimeAtOptions, type TimeLocation, type TimeLocationCandidate, type TimeLocationInput, type TimeOptions, type TimeResolution, type TimeResolutionAlternative, type TimeSeason, type TimeTransition, type TimeTransitionState, type TimeZoneEntry, type TimeZones, type TimeZonesOptions, type Timezone, type TimezoneAtOptions, type TimezoneConversionTarget, type TimezoneConversionTargetDeep, type TimezoneDeep, type TimezoneNextDst, type TimezoneOptions, type Useragent, type UseragentBrowserBrand, type UseragentBrowserDeep, type UseragentDeep, type UseragentDeviceDeep, type UseragentEngineDeep, type UseragentOptions, type UseragentOsDeep, type Vat, type VatAddress, type VatDeep, type VatOptions, type Weather, type WeatherAir, type WeatherAlert, type WeatherCurrent, type WeatherCurrentDeep, type WeatherDay, type WeatherDeep, type WeatherForecastPeriod, type WeatherHistory, type WeatherHour, type WeatherMinute, type WeatherOptions, type WeatherStation, parseAPI };
|
package/dist/index.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ interface Continent {
|
|
|
58
58
|
region: string;
|
|
59
59
|
subregion: string;
|
|
60
60
|
population: number | null;
|
|
61
|
-
/**
|
|
61
|
+
/** @deprecated No longer returned. Retained for source compatibility. */
|
|
62
62
|
population_period?: string | null;
|
|
63
63
|
area: number | null;
|
|
64
64
|
emoji: string;
|
|
@@ -135,7 +135,7 @@ interface StateDistrictItem {
|
|
|
135
135
|
}
|
|
136
136
|
interface StateDistrictDeep {
|
|
137
137
|
population: number | null;
|
|
138
|
-
/**
|
|
138
|
+
/** @deprecated No longer returned. Retained for source compatibility. */
|
|
139
139
|
population_period?: string | null;
|
|
140
140
|
}
|
|
141
141
|
interface StateDistricts {
|
|
@@ -160,8 +160,12 @@ interface District {
|
|
|
160
160
|
deep?: Deep<DistrictDeep>;
|
|
161
161
|
}
|
|
162
162
|
interface City {
|
|
163
|
+
/** Present for explicit search matching when the server returns suggestion evidence. */
|
|
164
|
+
match?: CityMatch;
|
|
163
165
|
name: string;
|
|
164
166
|
name_local: string | null;
|
|
167
|
+
name_romanized?: string | null;
|
|
168
|
+
romanization_language?: string | null;
|
|
165
169
|
type: string | null;
|
|
166
170
|
state: string | null;
|
|
167
171
|
state_name: string | null;
|
|
@@ -174,6 +178,10 @@ interface City {
|
|
|
174
178
|
timezone: string | null;
|
|
175
179
|
/** Minted parse id (`city_` + 12 chars). Stable pin via `/city/id/{id}`. */
|
|
176
180
|
id: string;
|
|
181
|
+
/** Returned with hierarchy=true. Null means the layer has not been reviewed. */
|
|
182
|
+
grain?: CityGrain | null;
|
|
183
|
+
/** Reviewed immediate parent; null when no reviewed relationship exists. */
|
|
184
|
+
parent?: CityParent | null;
|
|
177
185
|
deep?: Deep<CityDeep>;
|
|
178
186
|
}
|
|
179
187
|
/** Nearest-city lookups add the distance from the query point. */
|
|
@@ -185,7 +193,12 @@ interface CitySearch {
|
|
|
185
193
|
q: string;
|
|
186
194
|
country?: string;
|
|
187
195
|
state?: string;
|
|
196
|
+
type?: string;
|
|
197
|
+
grain?: CityGrain;
|
|
198
|
+
aliases?: boolean;
|
|
188
199
|
cities: City[];
|
|
200
|
+
/** Present with page=true or a continuation cursor; null when this is the last page. */
|
|
201
|
+
next_cursor?: string | null;
|
|
189
202
|
}
|
|
190
203
|
interface CityNearby {
|
|
191
204
|
city: string;
|
|
@@ -194,6 +207,7 @@ interface CityNearby {
|
|
|
194
207
|
radius: number;
|
|
195
208
|
unit: string;
|
|
196
209
|
nearby: CityNearest[];
|
|
210
|
+
next_cursor?: string | null;
|
|
197
211
|
}
|
|
198
212
|
/** An area's share of ZIP addresses, with category shares measured independently. */
|
|
199
213
|
interface PostalMetro {
|
|
@@ -522,50 +536,6 @@ interface TariffSearch {
|
|
|
522
536
|
/** Up to 20 tariff lines, best match first. */
|
|
523
537
|
lines: TariffSearchHit[];
|
|
524
538
|
}
|
|
525
|
-
interface VinRecall {
|
|
526
|
-
/** Government campaign number. */
|
|
527
|
-
campaign: string;
|
|
528
|
-
/** Report date, ISO YYYY-MM-DD. */
|
|
529
|
-
date: string | null;
|
|
530
|
-
component: string | null;
|
|
531
|
-
/** The filed summary verbatim. */
|
|
532
|
-
summary: string | null;
|
|
533
|
-
}
|
|
534
|
-
interface VinDeep {
|
|
535
|
-
/** Recall campaigns for the decoded year, make and model. [] when none, null when the registry did not answer. */
|
|
536
|
-
recalls?: VinRecall[] | null;
|
|
537
|
-
series: string | null;
|
|
538
|
-
doors: number | null;
|
|
539
|
-
cylinders: number | null;
|
|
540
|
-
/** Engine displacement in liters. */
|
|
541
|
-
displacement: number | null;
|
|
542
|
-
fuel: string | null;
|
|
543
|
-
horsepower: number | null;
|
|
544
|
-
/** fwd, rwd, awd, 4wd. */
|
|
545
|
-
drive: string | null;
|
|
546
|
-
/** automatic, manual, cvt. */
|
|
547
|
-
transmission: string | null;
|
|
548
|
-
manufacturer: string | null;
|
|
549
|
-
plant_city: string | null;
|
|
550
|
-
plant_state: string | null;
|
|
551
|
-
plant_country: string | null;
|
|
552
|
-
/** Gross vehicle weight rating class as filed. */
|
|
553
|
-
gvwr: string | null;
|
|
554
|
-
}
|
|
555
|
-
interface Vin {
|
|
556
|
-
/** Normalized VIN, uppercase, no spaces. Invalid input still echoes the fold. */
|
|
557
|
-
vin: string | null;
|
|
558
|
-
valid: boolean;
|
|
559
|
-
year: number | null;
|
|
560
|
-
make: string | null;
|
|
561
|
-
model: string | null;
|
|
562
|
-
trim: string | null;
|
|
563
|
-
/** Body style (sedan, coupe, suv, pickup). */
|
|
564
|
-
body: string | null;
|
|
565
|
-
/** Vehicle type (passenger car, truck, motorcycle, bus, trailer). */
|
|
566
|
-
type: string | null;
|
|
567
|
-
deep?: Deep<VinDeep>;
|
|
568
|
-
}
|
|
569
539
|
interface Phone {
|
|
570
540
|
phone: string | null;
|
|
571
541
|
valid: boolean;
|
|
@@ -1486,7 +1456,7 @@ interface CountryDeep {
|
|
|
1486
1456
|
region: string | null;
|
|
1487
1457
|
subregion: string | null;
|
|
1488
1458
|
population: number | null;
|
|
1489
|
-
/**
|
|
1459
|
+
/** @deprecated No longer returned. Retained for source compatibility. */
|
|
1490
1460
|
population_period?: string | null;
|
|
1491
1461
|
area: number | null;
|
|
1492
1462
|
/** Land area in km2. */
|
|
@@ -1531,7 +1501,7 @@ interface CountryElevationPoint {
|
|
|
1531
1501
|
}
|
|
1532
1502
|
interface StateDeep {
|
|
1533
1503
|
population: number | null;
|
|
1534
|
-
/**
|
|
1504
|
+
/** @deprecated No longer returned. Retained for source compatibility. */
|
|
1535
1505
|
population_period?: string | null;
|
|
1536
1506
|
/** Total area in km2. */
|
|
1537
1507
|
area: number | null;
|
|
@@ -1545,7 +1515,7 @@ interface StateDeep {
|
|
|
1545
1515
|
}
|
|
1546
1516
|
interface DistrictDeep {
|
|
1547
1517
|
population: number | null;
|
|
1548
|
-
/**
|
|
1518
|
+
/** @deprecated No longer returned. Retained for source compatibility. */
|
|
1549
1519
|
population_period?: string | null;
|
|
1550
1520
|
/** Total area in km2 (land + water, or the official total). */
|
|
1551
1521
|
area: number | null;
|
|
@@ -1563,8 +1533,12 @@ interface CityDeep {
|
|
|
1563
1533
|
elevation: number | null;
|
|
1564
1534
|
elevation_ft: number | null;
|
|
1565
1535
|
population: number | null;
|
|
1566
|
-
/**
|
|
1536
|
+
/** @deprecated No longer returned. Retained for source compatibility. */
|
|
1567
1537
|
population_period?: string | null;
|
|
1538
|
+
/** Exact observation date for a reviewed same-grain count; omitted for legacy undated counts. */
|
|
1539
|
+
population_observed_on?: string;
|
|
1540
|
+
/** Published population basis, for example registered_population. */
|
|
1541
|
+
population_basis?: string;
|
|
1568
1542
|
/** Total area in km2 (land + water, or the official total). */
|
|
1569
1543
|
area: number | null;
|
|
1570
1544
|
/** Land area in km2. Null when the source publishes total only. */
|
|
@@ -1576,7 +1550,7 @@ interface PostalDeep {
|
|
|
1576
1550
|
elevation: number | null;
|
|
1577
1551
|
elevation_ft: number | null;
|
|
1578
1552
|
population: number | null;
|
|
1579
|
-
/**
|
|
1553
|
+
/** @deprecated No longer returned. Retained for source compatibility. */
|
|
1580
1554
|
population_period?: string | null;
|
|
1581
1555
|
/** Total area in km2. Null when the source has no water split. */
|
|
1582
1556
|
area: number | null;
|
|
@@ -1796,9 +1770,6 @@ type IndustryExclusion = NaicsExclusion;
|
|
|
1796
1770
|
type IndustryMatch = NaicsMatch;
|
|
1797
1771
|
type IndustrySearch = NaicsSearch;
|
|
1798
1772
|
type IndustrySearchItem = NaicsSearchItem;
|
|
1799
|
-
type Vehicle = Vin;
|
|
1800
|
-
type VehicleDeep = VinDeep;
|
|
1801
|
-
type VehicleRecall = VinRecall;
|
|
1802
1773
|
interface Iban {
|
|
1803
1774
|
iban: string | null;
|
|
1804
1775
|
valid: boolean;
|
|
@@ -1886,6 +1857,79 @@ interface EmojiConversion {
|
|
|
1886
1857
|
text: string;
|
|
1887
1858
|
unresolved: EmojiUnresolved[];
|
|
1888
1859
|
}
|
|
1860
|
+
type CityGrain = 'municipality' | 'subdivision' | 'locality' | 'metropolitan_area';
|
|
1861
|
+
interface CityParent {
|
|
1862
|
+
id: string;
|
|
1863
|
+
name: string | null;
|
|
1864
|
+
name_local: string | null;
|
|
1865
|
+
country: string;
|
|
1866
|
+
state: string | null;
|
|
1867
|
+
type: string | null;
|
|
1868
|
+
grain: CityGrain | null;
|
|
1869
|
+
}
|
|
1870
|
+
interface CityMatch {
|
|
1871
|
+
type: string;
|
|
1872
|
+
source: string;
|
|
1873
|
+
value: string;
|
|
1874
|
+
language: string | null;
|
|
1875
|
+
edit_distance: number | null;
|
|
1876
|
+
}
|
|
1877
|
+
interface CityAmbiguityCandidate {
|
|
1878
|
+
id: string;
|
|
1879
|
+
object: 'city';
|
|
1880
|
+
name?: string | null;
|
|
1881
|
+
name_local?: string | null;
|
|
1882
|
+
country?: string | null;
|
|
1883
|
+
country_name?: string | null;
|
|
1884
|
+
state?: string | null;
|
|
1885
|
+
state_name?: string | null;
|
|
1886
|
+
type?: string | null;
|
|
1887
|
+
}
|
|
1888
|
+
type CityResource = City & {
|
|
1889
|
+
object: 'city';
|
|
1890
|
+
distance?: number;
|
|
1891
|
+
distance_mi?: number;
|
|
1892
|
+
};
|
|
1893
|
+
interface CityCollection {
|
|
1894
|
+
object: 'list';
|
|
1895
|
+
data: CityResource[];
|
|
1896
|
+
has_more?: boolean;
|
|
1897
|
+
url?: string;
|
|
1898
|
+
/** Opaque, query-bound continuation. Keep the same options on the next call. */
|
|
1899
|
+
next_cursor: string | null;
|
|
1900
|
+
q?: string;
|
|
1901
|
+
country?: string;
|
|
1902
|
+
state?: string | null;
|
|
1903
|
+
type?: string;
|
|
1904
|
+
grain?: CityGrain;
|
|
1905
|
+
aliases?: boolean;
|
|
1906
|
+
city?: string;
|
|
1907
|
+
radius?: number;
|
|
1908
|
+
unit?: string;
|
|
1909
|
+
}
|
|
1910
|
+
interface CityList extends CityCollection {
|
|
1911
|
+
}
|
|
1912
|
+
interface CityRelations extends CityCollection {
|
|
1913
|
+
city_id: string;
|
|
1914
|
+
relationship: 'children' | 'ancestors' | 'siblings';
|
|
1915
|
+
coverage: 'partial';
|
|
1916
|
+
parent_id?: string | null;
|
|
1917
|
+
}
|
|
1918
|
+
interface CityDistance {
|
|
1919
|
+
object: 'city_distance';
|
|
1920
|
+
from: string;
|
|
1921
|
+
to: string;
|
|
1922
|
+
/** Great-circle kilometers between stored centers; null when coordinates are unknown. */
|
|
1923
|
+
distance: number | null;
|
|
1924
|
+
distance_mi: number | null;
|
|
1925
|
+
method: 'great_circle';
|
|
1926
|
+
}
|
|
1927
|
+
interface CityNearbyCoordinates extends CityCollection {
|
|
1928
|
+
latitude: number;
|
|
1929
|
+
longitude: number;
|
|
1930
|
+
radius: number;
|
|
1931
|
+
unit: string;
|
|
1932
|
+
}
|
|
1889
1933
|
|
|
1890
1934
|
/** A proposed task contains operation counts, never lookup inputs. */
|
|
1891
1935
|
interface PreflightOperation {
|
|
@@ -2124,6 +2168,7 @@ declare class ParseAPIError extends Error {
|
|
|
2124
2168
|
readonly requestId: string | null;
|
|
2125
2169
|
/** Original Retry-After response header, when supplied. */
|
|
2126
2170
|
readonly retryAfter: string | null;
|
|
2171
|
+
candidates?: CityAmbiguityCandidate[];
|
|
2127
2172
|
constructor(status: number, code: string, message: string, docs: string | null, requestId: string | null, retryAfter?: string | null);
|
|
2128
2173
|
}
|
|
2129
2174
|
/** Optional output language for supported display fields. Input parsing stays unchanged. */
|
|
@@ -2167,23 +2212,34 @@ type DistrictOptions = LanguageOption & {
|
|
|
2167
2212
|
country?: string;
|
|
2168
2213
|
state?: string;
|
|
2169
2214
|
} & DeepOption & RequestOptions;
|
|
2170
|
-
type CityOptions = LanguageOption & {
|
|
2171
|
-
|
|
2172
|
-
|
|
2215
|
+
type CityOptions = LanguageOption & CityScopeOptions & CityResponseOptions & {
|
|
2216
|
+
format?: 'resource';
|
|
2217
|
+
aliases?: boolean;
|
|
2218
|
+
ambiguity?: 'error';
|
|
2173
2219
|
} & DeepOption & RequestOptions;
|
|
2174
|
-
type CityIdOptions = LanguageOption &
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2220
|
+
type CityIdOptions = LanguageOption & CityResponseOptions & {
|
|
2221
|
+
format?: 'resource';
|
|
2222
|
+
hierarchy?: boolean;
|
|
2223
|
+
} & DeepOption & RequestOptions;
|
|
2224
|
+
type CitySearchOptions = LanguageOption & CityScopeOptions & CityCollectionFilters & CityPagingOptions & CityResponseOptions & {
|
|
2225
|
+
format?: 'list';
|
|
2226
|
+
aliases?: boolean;
|
|
2178
2227
|
limit?: number;
|
|
2228
|
+
sort?: CitySort;
|
|
2229
|
+
match?: 'exact' | 'prefix' | 'fuzzy';
|
|
2230
|
+
maxDistance?: 1 | 2;
|
|
2231
|
+
} & DeepOption & RequestOptions;
|
|
2232
|
+
type CityNearestOptions = LanguageOption & CityScopeOptions & CityResponseOptions & {
|
|
2233
|
+
format?: 'resource';
|
|
2179
2234
|
} & DeepOption & RequestOptions;
|
|
2180
|
-
type
|
|
2181
|
-
|
|
2235
|
+
type CityNearbyOptions = LanguageOption & CityScopeOptions & CityCollectionFilters & CityPagingOptions & CityResponseOptions & {
|
|
2236
|
+
format?: 'list';
|
|
2237
|
+
aliases?: boolean;
|
|
2238
|
+
ambiguity?: 'error';
|
|
2182
2239
|
radius?: number;
|
|
2183
2240
|
unit?: 'km' | 'mi';
|
|
2184
|
-
country?: string;
|
|
2185
|
-
state?: string;
|
|
2186
2241
|
limit?: number;
|
|
2242
|
+
sort?: CitySort;
|
|
2187
2243
|
} & DeepOption & RequestOptions;
|
|
2188
2244
|
/** Pass country when known. Codes shared by multiple countries need it. */
|
|
2189
2245
|
type PostalOptions = LanguageOption & {
|
|
@@ -2295,8 +2351,6 @@ type DnsOptions = {
|
|
|
2295
2351
|
} & RequestOptions;
|
|
2296
2352
|
type MxOptions = RequestOptions;
|
|
2297
2353
|
type UseragentOptions = DeepOption & RequestOptions;
|
|
2298
|
-
type VinOptions = DeepOption & RequestOptions;
|
|
2299
|
-
type VehicleOptions = VinOptions;
|
|
2300
2354
|
/** US NAICS 2022 code lookup, using pooled requests. */
|
|
2301
2355
|
type IndustryOptions = DeepOption & RequestOptions;
|
|
2302
2356
|
/** Keyword search. Limit defaults to 10 and accepts 1-50. */
|
|
@@ -2452,11 +2506,21 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
2452
2506
|
districts: (code: string, opts?: StateDistrictsOptions) => Promise<StateDistricts>;
|
|
2453
2507
|
};
|
|
2454
2508
|
district: (code: string, opts?: DistrictOptions) => Promise<District>;
|
|
2455
|
-
city:
|
|
2456
|
-
id:
|
|
2457
|
-
search:
|
|
2458
|
-
|
|
2459
|
-
|
|
2509
|
+
city: CityLookupCall & {
|
|
2510
|
+
id: CityIdCall;
|
|
2511
|
+
search: CitySearchCall;
|
|
2512
|
+
/** Canonical list resource. Reuse next_cursor with exactly the same options. */
|
|
2513
|
+
list: (opts?: CityListOptions) => Promise<CityList>;
|
|
2514
|
+
nearbyCoordinates: (lat: number, lon: number, opts?: CityNearbyCoordinatesOptions) => Promise<CityNearbyCoordinates>;
|
|
2515
|
+
nearest: CityNearestCall;
|
|
2516
|
+
nearby: CityNearbyCall;
|
|
2517
|
+
/** Reviewed immediate children; coverage is partial. */
|
|
2518
|
+
children: (id: string, opts?: CityRelationsOptions) => Promise<CityRelations>;
|
|
2519
|
+
/** Immediate parent first, following only reviewed parent facts. */
|
|
2520
|
+
ancestors: (id: string, opts?: CityAncestorsOptions) => Promise<CityRelations>;
|
|
2521
|
+
siblings: (id: string, opts?: CityRelationsOptions) => Promise<CityRelations>;
|
|
2522
|
+
/** Great-circle distance between stored centers, not travel distance or containment. */
|
|
2523
|
+
distance: (from: string, to: string, opts?: CityDistanceOptions) => Promise<CityDistance>;
|
|
2460
2524
|
};
|
|
2461
2525
|
/** Look up a postal area. Pass country when known. Check nullable latitude/longitude before another location lookup. */
|
|
2462
2526
|
postal: ((code: string, opts?: PostalOptions) => Promise<Postal>) & {
|
|
@@ -2517,10 +2581,6 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
2517
2581
|
dns: (domain: string, opts?: DnsOptions) => Promise<Dns>;
|
|
2518
2582
|
mx: (domain: string, opts?: MxOptions) => Promise<Mx>;
|
|
2519
2583
|
useragent: (ua: string, opts?: UseragentOptions) => Promise<Useragent>;
|
|
2520
|
-
/** Identify a vehicle by VIN. Paid deep adds specifications and model-level recall campaigns. */
|
|
2521
|
-
vehicle: (vin: string, opts?: VehicleOptions) => Promise<Vehicle>;
|
|
2522
|
-
/** Compatibility entry for VIN callers. */
|
|
2523
|
-
vin: (vin: string, opts?: VinOptions) => Promise<Vin>;
|
|
2524
2584
|
/** US NAICS 2022 definitions and hierarchy. */
|
|
2525
2585
|
industry: ((code: string, opts?: IndustryOptions) => Promise<Industry>) & {
|
|
2526
2586
|
search: (query: string, opts?: IndustrySearchOptions) => Promise<IndustrySearch>;
|
|
@@ -2583,5 +2643,92 @@ type IbanOptions = {
|
|
|
2583
2643
|
} & DeepOption & RequestOptions;
|
|
2584
2644
|
type NpiOptions = LanguageOption & DeepOption & RequestOptions;
|
|
2585
2645
|
type BinOptions = DeepOption & RequestOptions;
|
|
2646
|
+
type CityScopeOptions = {
|
|
2647
|
+
country?: string;
|
|
2648
|
+
state?: string;
|
|
2649
|
+
type?: string;
|
|
2650
|
+
grain?: CityGrain;
|
|
2651
|
+
hierarchy?: boolean;
|
|
2652
|
+
};
|
|
2653
|
+
type CityResponseOptions = {
|
|
2654
|
+
romanized?: boolean;
|
|
2655
|
+
};
|
|
2656
|
+
type CityCollectionFilters = {
|
|
2657
|
+
minPopulation?: number;
|
|
2658
|
+
maxPopulation?: number;
|
|
2659
|
+
minElevation?: number;
|
|
2660
|
+
maxElevation?: number;
|
|
2661
|
+
countries?: string | readonly string[];
|
|
2662
|
+
excludeCountries?: string | readonly string[];
|
|
2663
|
+
timezone?: string;
|
|
2664
|
+
timezones?: string | readonly string[];
|
|
2665
|
+
/** Center-coordinate box: west,south,east,north. West > east crosses the date line. */
|
|
2666
|
+
bbox?: string;
|
|
2667
|
+
};
|
|
2668
|
+
type CityPagingOptions = {
|
|
2669
|
+
page?: boolean;
|
|
2670
|
+
cursor?: string;
|
|
2671
|
+
order?: 'asc' | 'desc';
|
|
2672
|
+
};
|
|
2673
|
+
type CitySort = string;
|
|
2674
|
+
type CityListOptions = LanguageOption & CityScopeOptions & CityCollectionFilters & CityResponseOptions & {
|
|
2675
|
+
limit?: number;
|
|
2676
|
+
cursor?: string;
|
|
2677
|
+
sort?: CitySort;
|
|
2678
|
+
order?: 'asc' | 'desc';
|
|
2679
|
+
} & DeepOption & RequestOptions;
|
|
2680
|
+
type CityNearbyCoordinatesOptions = LanguageOption & CityScopeOptions & CityCollectionFilters & CityResponseOptions & {
|
|
2681
|
+
radius?: number;
|
|
2682
|
+
unit?: 'km' | 'mi';
|
|
2683
|
+
limit?: number;
|
|
2684
|
+
cursor?: string;
|
|
2685
|
+
sort?: CitySort;
|
|
2686
|
+
order?: 'asc' | 'desc';
|
|
2687
|
+
} & DeepOption & RequestOptions;
|
|
2688
|
+
type CityRelationsOptions = LanguageOption & CityResponseOptions & {
|
|
2689
|
+
limit?: number;
|
|
2690
|
+
cursor?: string;
|
|
2691
|
+
hierarchy?: boolean;
|
|
2692
|
+
} & DeepOption & RequestOptions;
|
|
2693
|
+
type CityAncestorsOptions = Omit<CityRelationsOptions, 'limit' | 'cursor'>;
|
|
2694
|
+
type CityDistanceOptions = RequestOptions;
|
|
2695
|
+
type ClassicCityOptions<T> = T & {
|
|
2696
|
+
format?: never;
|
|
2697
|
+
};
|
|
2698
|
+
interface CityLookupCall {
|
|
2699
|
+
(name: string, opts?: ClassicCityOptions<CityOptions>): Promise<City>;
|
|
2700
|
+
(name: string, opts: CityOptions & {
|
|
2701
|
+
format: 'resource';
|
|
2702
|
+
}): Promise<CityResource>;
|
|
2703
|
+
(name: string, opts: CityOptions): Promise<City>;
|
|
2704
|
+
}
|
|
2705
|
+
interface CityIdCall {
|
|
2706
|
+
(id: string, opts?: ClassicCityOptions<CityIdOptions>): Promise<City>;
|
|
2707
|
+
(id: string, opts: CityIdOptions & {
|
|
2708
|
+
format: 'resource';
|
|
2709
|
+
}): Promise<CityResource>;
|
|
2710
|
+
(id: string, opts: CityIdOptions): Promise<City>;
|
|
2711
|
+
}
|
|
2712
|
+
interface CityNearestCall {
|
|
2713
|
+
(lat: number, lon: number, opts?: ClassicCityOptions<CityNearestOptions>): Promise<CityNearest>;
|
|
2714
|
+
(lat: number, lon: number, opts: CityNearestOptions & {
|
|
2715
|
+
format: 'resource';
|
|
2716
|
+
}): Promise<CityResource & Pick<CityNearest, 'distance' | 'distance_mi'>>;
|
|
2717
|
+
(lat: number, lon: number, opts: CityNearestOptions): Promise<CityNearest>;
|
|
2718
|
+
}
|
|
2719
|
+
interface CitySearchCall {
|
|
2720
|
+
(query: string, opts?: ClassicCityOptions<CitySearchOptions>): Promise<CitySearch>;
|
|
2721
|
+
(query: string, opts: CitySearchOptions & {
|
|
2722
|
+
format: 'list';
|
|
2723
|
+
}): Promise<CityCollection>;
|
|
2724
|
+
(query: string, opts: CitySearchOptions): Promise<CitySearch | CityCollection>;
|
|
2725
|
+
}
|
|
2726
|
+
interface CityNearbyCall {
|
|
2727
|
+
(name: string, opts?: ClassicCityOptions<CityNearbyOptions>): Promise<CityNearby>;
|
|
2728
|
+
(name: string, opts: CityNearbyOptions & {
|
|
2729
|
+
format: 'list';
|
|
2730
|
+
}): Promise<CityCollection>;
|
|
2731
|
+
(name: string, opts: CityNearbyOptions): Promise<CityNearby | CityCollection>;
|
|
2732
|
+
}
|
|
2586
2733
|
|
|
2587
|
-
export { type Address, type AddressOptions, type AddressSearch, type AddressSearchOptions, type AddressSuggestion, type AgentTask, type AgentTaskInput, type AgentTaskLookupInput, type AgentTaskResult, type Asn, type AsnOptions, type Bank, type BankChecks, type BankDeep, type BankDirectory, type BankIssue, type BankOptions, type BankRequirementField, type BankRequirements, type BankRequirementsOptions, type BankUsAch, type BankUsAchChecks, type BankUsAchInput, type Bin, type BinOptions, type Bloc, type BlocCountries, type BlocCountriesOptions, type BlocCountryItem, type BlocOptions, type Caller, type CallerOptions, type Card, type CardDeep, type CardOptions, type Carrier, type CarrierDeep, type CarrierOptions, type City, type CityDeep, type CityIdOptions, type CityNearby, type CityNearbyOptions, type CityNearest, type CityNearestOptions, type CityOptions, type CitySearch, type CitySearchOptions, type Company, type CompanyCandidate, type CompanyCountry, type CompanyCoverage, type CompanyCoverageOptions, type CompanyDeep, type CompanyEmailAddress, type CompanyIdOptions, type CompanyMatch, type CompanyOptions, type CompanyPhoneNumber, type CompanyProfile, type CompanyProfileAddress, type CompanyProfileDeep, type CompanyProfileDomain, type CompanyProfileEmail, type CompanyProfileEmployees, type CompanyProfileFounding, type CompanyProfileIdentifier, type CompanyProfileIndustry, type CompanyProfileJurisdiction, type CompanyProfileListing, type CompanyProfilePhone, type CompanyProfileRegistration, type CompanyProfileRegistrationAddress, type CompanyProfileRegistrationLegalForm, type CompanyProfileSource, type CompanyProfileWebsite, type CompanySearch, type CompanySearchOptions, type CompanySocialProfile, type Continent, type ContinentCountries, type ContinentCountriesOptions, type ContinentCountryItem, type ContinentOptions, type Country, type CountryDeep, type CountryElevationPoint, type CountryEmergency, type CountryOptions, type CountryStateItem, type CountryStates, type CountryStatesOptions, type Currency, type CurrencyDeep, type CurrencyOptions, type CurrencyRate, type CurrencyRateOptions, type DateInfo, type DateInfoDeep, type DateOptions, type DateTodayOptions, type Deep, type District, type DistrictDeep, type DistrictOptions, type Dns, type DnsOptions, type DnsRecord, type Domain, type DomainDeep, type DomainOptions, type DomainRegistration, type Elevation, type ElevationLocations, type ElevationOptions, type Email, type EmailDeep, type EmailOptions, type Emoji, type EmojiArtwork, type EmojiArtworkSource, type EmojiBrowse, type EmojiBrowseOptions, EmojiCatalog, type EmojiCatalogConvertOptions, type EmojiCatalogData, EmojiCatalogError, type EmojiCatalogLocalization, type EmojiCatalogLookupOptions, type EmojiCatalogOptions, type EmojiCatalogParseOptions, type EmojiCatalogRegexOptions, type EmojiCatalogScope, type EmojiCatalogSearchFacts, type EmojiCatalogSearchOptions, type EmojiCategories, type EmojiCategory, type EmojiConversion, type EmojiConvertOptions, type EmojiDeep, type EmojiMetadata, type EmojiNativeSearchFacts, type EmojiNotice, type EmojiOptions, type EmojiParse, type EmojiParseOptions, type EmojiPosition, type EmojiSearch, type EmojiSearchOptions, type EmojiShortcodeSourceMetadata, type EmojiSkin, type EmojiSource, type EmojiUnresolved, type EmojiVariant, type Hlr, type HlrDeep, type HlrOptions, type Holiday, type HolidayDate, type HolidayDateOptions, type HolidayOptions, type HolidayYear, type Iban, type IbanDeep, type IbanOptions, type Industry, type IndustryChild, type IndustryCorrection, type IndustryDeep, type IndustryExclusion, type IndustryMatch, type IndustryOptions, type IndustrySearch, type IndustrySearchItem, type IndustrySearchOptions, type Ip, type IpDeep, type IpOptions, type IpSelfOptions, type Language, type LanguageDeep, type LanguageOption, type LanguageOptions, type Mac, type MacOptions, type Measure, type MeasureChoice, type MeasureOptions, type MeasureUnit, type MeasureUnits, type MeasureUnitsOptions, type Mx, type MxOptions, type MxRecord, type Naics, type NaicsChild, type NaicsCorrection, type NaicsDeep, type NaicsExclusion, type NaicsMatch, type NaicsOptions, type NaicsSearch, type NaicsSearchItem, type NaicsSearchOptions, type Name, type NameDeep, type NameOptions, type Npi, type NpiDeep, type NpiEnrollment, type NpiOptions, type ParseAPIClient, ParseAPIError, type ParseAPIOptions, type Phone, type PhoneDeep, type PhoneOptions, type Point, type PointCity, type PointDeep, type PointOptions, type Postal, type PostalDeep, type PostalDistance, type PostalDistanceEnd, type PostalDistanceOptions, type PostalLocality, type PostalMetro, type PostalMetrosDeep, type PostalNearby, type PostalNearbyItem, type PostalNearbyOptions, type PostalOptions, type Preflight, type PreflightCost, type PreflightEmailCapacity, type PreflightOperation, type PreflightOperationEstimate, type PreflightPooledCapacity, type PreflightSpendCapacity, type PreflightTask, type PropertyTax, type Provider, type ProviderDeep, type ProviderEnrollment, type ProviderOptions, type ProviderSource, type ProviderSources, type ProviderTaxonomy, type RequestOptions, type Stack, type StackOptions, type StackTechnology, type State, type StateDeep, type StateDistrictDeep, type StateDistrictItem, type StateDistricts, type StateDistrictsOptions, type StateOptions, type Tariff, type TariffDeep, type TariffMeasure, type TariffOptions, type TariffSearch, type TariffSearchHit, type TariffSearchOptions, type Time, type TimeAtOptions, type TimeLocation, type TimeLocationCandidate, type TimeLocationInput, type TimeOptions, type TimeResolution, type TimeResolutionAlternative, type TimeSeason, type TimeTransition, type TimeTransitionState, type TimeZoneEntry, type TimeZones, type TimeZonesOptions, type Timezone, type TimezoneAtOptions, type TimezoneConversionTarget, type TimezoneConversionTargetDeep, type TimezoneDeep, type TimezoneNextDst, type TimezoneOptions, type Useragent, type UseragentBrowserBrand, type UseragentBrowserDeep, type UseragentDeep, type UseragentDeviceDeep, type UseragentEngineDeep, type UseragentOptions, type UseragentOsDeep, type Vat, type VatAddress, type VatDeep, type VatOptions, type
|
|
2734
|
+
export { type Address, type AddressOptions, type AddressSearch, type AddressSearchOptions, type AddressSuggestion, type AgentTask, type AgentTaskInput, type AgentTaskLookupInput, type AgentTaskResult, type Asn, type AsnOptions, type Bank, type BankChecks, type BankDeep, type BankDirectory, type BankIssue, type BankOptions, type BankRequirementField, type BankRequirements, type BankRequirementsOptions, type BankUsAch, type BankUsAchChecks, type BankUsAchInput, type Bin, type BinOptions, type Bloc, type BlocCountries, type BlocCountriesOptions, type BlocCountryItem, type BlocOptions, type Caller, type CallerOptions, type Card, type CardDeep, type CardOptions, type Carrier, type CarrierDeep, type CarrierOptions, type City, type CityAmbiguityCandidate, type CityAncestorsOptions, type CityCollection, type CityCollectionFilters, type CityDeep, type CityDistance, type CityDistanceOptions, type CityGrain, type CityIdCall, type CityIdOptions, type CityList, type CityListOptions, type CityLookupCall, type CityMatch, type CityNearby, type CityNearbyCall, type CityNearbyCoordinates, type CityNearbyCoordinatesOptions, type CityNearbyOptions, type CityNearest, type CityNearestCall, type CityNearestOptions, type CityOptions, type CityPagingOptions, type CityParent, type CityRelations, type CityRelationsOptions, type CityResource, type CityResponseOptions, type CityScopeOptions, type CitySearch, type CitySearchCall, type CitySearchOptions, type CitySort, type Company, type CompanyCandidate, type CompanyCountry, type CompanyCoverage, type CompanyCoverageOptions, type CompanyDeep, type CompanyEmailAddress, type CompanyIdOptions, type CompanyMatch, type CompanyOptions, type CompanyPhoneNumber, type CompanyProfile, type CompanyProfileAddress, type CompanyProfileDeep, type CompanyProfileDomain, type CompanyProfileEmail, type CompanyProfileEmployees, type CompanyProfileFounding, type CompanyProfileIdentifier, type CompanyProfileIndustry, type CompanyProfileJurisdiction, type CompanyProfileListing, type CompanyProfilePhone, type CompanyProfileRegistration, type CompanyProfileRegistrationAddress, type CompanyProfileRegistrationLegalForm, type CompanyProfileSource, type CompanyProfileWebsite, type CompanySearch, type CompanySearchOptions, type CompanySocialProfile, type Continent, type ContinentCountries, type ContinentCountriesOptions, type ContinentCountryItem, type ContinentOptions, type Country, type CountryDeep, type CountryElevationPoint, type CountryEmergency, type CountryOptions, type CountryStateItem, type CountryStates, type CountryStatesOptions, type Currency, type CurrencyDeep, type CurrencyOptions, type CurrencyRate, type CurrencyRateOptions, type DateInfo, type DateInfoDeep, type DateOptions, type DateTodayOptions, type Deep, type District, type DistrictDeep, type DistrictOptions, type Dns, type DnsOptions, type DnsRecord, type Domain, type DomainDeep, type DomainOptions, type DomainRegistration, type Elevation, type ElevationLocations, type ElevationOptions, type Email, type EmailDeep, type EmailOptions, type Emoji, type EmojiArtwork, type EmojiArtworkSource, type EmojiBrowse, type EmojiBrowseOptions, EmojiCatalog, type EmojiCatalogConvertOptions, type EmojiCatalogData, EmojiCatalogError, type EmojiCatalogLocalization, type EmojiCatalogLookupOptions, type EmojiCatalogOptions, type EmojiCatalogParseOptions, type EmojiCatalogRegexOptions, type EmojiCatalogScope, type EmojiCatalogSearchFacts, type EmojiCatalogSearchOptions, type EmojiCategories, type EmojiCategory, type EmojiConversion, type EmojiConvertOptions, type EmojiDeep, type EmojiMetadata, type EmojiNativeSearchFacts, type EmojiNotice, type EmojiOptions, type EmojiParse, type EmojiParseOptions, type EmojiPosition, type EmojiSearch, type EmojiSearchOptions, type EmojiShortcodeSourceMetadata, type EmojiSkin, type EmojiSource, type EmojiUnresolved, type EmojiVariant, type Hlr, type HlrDeep, type HlrOptions, type Holiday, type HolidayDate, type HolidayDateOptions, type HolidayOptions, type HolidayYear, type Iban, type IbanDeep, type IbanOptions, type Industry, type IndustryChild, type IndustryCorrection, type IndustryDeep, type IndustryExclusion, type IndustryMatch, type IndustryOptions, type IndustrySearch, type IndustrySearchItem, type IndustrySearchOptions, type Ip, type IpDeep, type IpOptions, type IpSelfOptions, type Language, type LanguageDeep, type LanguageOption, type LanguageOptions, type Mac, type MacOptions, type Measure, type MeasureChoice, type MeasureOptions, type MeasureUnit, type MeasureUnits, type MeasureUnitsOptions, type Mx, type MxOptions, type MxRecord, type Naics, type NaicsChild, type NaicsCorrection, type NaicsDeep, type NaicsExclusion, type NaicsMatch, type NaicsOptions, type NaicsSearch, type NaicsSearchItem, type NaicsSearchOptions, type Name, type NameDeep, type NameOptions, type Npi, type NpiDeep, type NpiEnrollment, type NpiOptions, type ParseAPIClient, ParseAPIError, type ParseAPIOptions, type Phone, type PhoneDeep, type PhoneOptions, type Point, type PointCity, type PointDeep, type PointOptions, type Postal, type PostalDeep, type PostalDistance, type PostalDistanceEnd, type PostalDistanceOptions, type PostalLocality, type PostalMetro, type PostalMetrosDeep, type PostalNearby, type PostalNearbyItem, type PostalNearbyOptions, type PostalOptions, type Preflight, type PreflightCost, type PreflightEmailCapacity, type PreflightOperation, type PreflightOperationEstimate, type PreflightPooledCapacity, type PreflightSpendCapacity, type PreflightTask, type PropertyTax, type Provider, type ProviderDeep, type ProviderEnrollment, type ProviderOptions, type ProviderSource, type ProviderSources, type ProviderTaxonomy, type RequestOptions, type Stack, type StackOptions, type StackTechnology, type State, type StateDeep, type StateDistrictDeep, type StateDistrictItem, type StateDistricts, type StateDistrictsOptions, type StateOptions, type Tariff, type TariffDeep, type TariffMeasure, type TariffOptions, type TariffSearch, type TariffSearchHit, type TariffSearchOptions, type Time, type TimeAtOptions, type TimeLocation, type TimeLocationCandidate, type TimeLocationInput, type TimeOptions, type TimeResolution, type TimeResolutionAlternative, type TimeSeason, type TimeTransition, type TimeTransitionState, type TimeZoneEntry, type TimeZones, type TimeZonesOptions, type Timezone, type TimezoneAtOptions, type TimezoneConversionTarget, type TimezoneConversionTargetDeep, type TimezoneDeep, type TimezoneNextDst, type TimezoneOptions, type Useragent, type UseragentBrowserBrand, type UseragentBrowserDeep, type UseragentDeep, type UseragentDeviceDeep, type UseragentEngineDeep, type UseragentOptions, type UseragentOsDeep, type Vat, type VatAddress, type VatDeep, type VatOptions, type Weather, type WeatherAir, type WeatherAlert, type WeatherCurrent, type WeatherCurrentDeep, type WeatherDay, type WeatherDeep, type WeatherForecastPeriod, type WeatherHistory, type WeatherHour, type WeatherMinute, type WeatherOptions, type WeatherStation, parseAPI };
|
package/dist/index.js
CHANGED
|
@@ -256,7 +256,7 @@ var EmojiCatalog = class {
|
|
|
256
256
|
};
|
|
257
257
|
|
|
258
258
|
// src/index.ts
|
|
259
|
-
var VERSION = "1.
|
|
259
|
+
var VERSION = "1.11.1";
|
|
260
260
|
var API_VERSION = "2.0.0";
|
|
261
261
|
var DEFAULT_BASE_URL = "https://api.parseapi.com";
|
|
262
262
|
var DEFAULT_TIMEOUT_MS = 1e4;
|
|
@@ -415,7 +415,7 @@ function parseAPI(apiKey, options = {}) {
|
|
|
415
415
|
controller.signal.throwIfAborted();
|
|
416
416
|
}
|
|
417
417
|
signal?.throwIfAborted();
|
|
418
|
-
|
|
418
|
+
const error = new ParseAPIError(
|
|
419
419
|
res.status,
|
|
420
420
|
typeof body2.code === "string" ? body2.code : "unknown_error",
|
|
421
421
|
typeof body2.message === "string" ? body2.message : `Request failed with status ${res.status}`,
|
|
@@ -423,6 +423,11 @@ function parseAPI(apiKey, options = {}) {
|
|
|
423
423
|
typeof body2.request_id === "string" ? body2.request_id : null,
|
|
424
424
|
res.headers.get("Retry-After")
|
|
425
425
|
);
|
|
426
|
+
if (error.status === 409 && error.code === "ambiguous_city") {
|
|
427
|
+
const candidates = cityErrorCandidates(body2.candidates);
|
|
428
|
+
if (candidates) error.candidates = candidates;
|
|
429
|
+
}
|
|
430
|
+
throw error;
|
|
426
431
|
}
|
|
427
432
|
} finally {
|
|
428
433
|
clearTimeout(timer);
|
|
@@ -495,19 +500,52 @@ function parseAPI(apiKey, options = {}) {
|
|
|
495
500
|
),
|
|
496
501
|
district: (code, opts) => request(`/district/${enc(code)}`, { country: opts?.country, state: opts?.state, ...deepQuery(opts) }, void 0, opts),
|
|
497
502
|
city: Object.assign(
|
|
498
|
-
(name, opts) => request(`/city/${enc(name)}`, {
|
|
503
|
+
((name, opts) => request(`/city/${enc(name)}`, { ...cityScopeQuery(opts), ...cityResponseQuery(opts), aliases: opts?.aliases ? "true" : void 0, ambiguity: opts?.ambiguity, ...deepQuery(opts) }, void 0, opts)),
|
|
499
504
|
{
|
|
500
|
-
id: (id, opts) => request(`/city/id/${enc(id)}`, deepQuery(opts), void 0, opts),
|
|
501
|
-
search: (query, opts) =>
|
|
502
|
-
|
|
503
|
-
|
|
505
|
+
id: ((id, opts) => request(`/city/id/${enc(id)}`, { hierarchy: opts?.hierarchy ? "true" : void 0, ...cityResponseQuery(opts), ...deepQuery(opts) }, void 0, opts)),
|
|
506
|
+
search: (async (query, opts) => {
|
|
507
|
+
const spelling = opts?.match !== void 0 || opts?.maxDistance !== void 0;
|
|
508
|
+
const result = await request(spelling ? "/city/search" : "/city", { q: query, match: opts?.match, max_distance: opts?.maxDistance, ...cityScopeQuery(opts), ...cityCollectionQuery(opts), ...cityResponseQuery(opts), aliases: opts?.aliases ? "true" : void 0, limit: opts?.limit, ...deepQuery(opts) }, void 0, opts);
|
|
509
|
+
if (spelling && opts?.format !== "list") {
|
|
510
|
+
const list = result;
|
|
511
|
+
return { q: query, ...opts?.country ? { country: opts.country } : {}, ...opts?.state ? { state: opts.state } : {}, cities: list.data, next_cursor: list.next_cursor };
|
|
512
|
+
}
|
|
513
|
+
return result;
|
|
514
|
+
}),
|
|
515
|
+
/** Canonical list resource. Reuse next_cursor with exactly the same options. */
|
|
516
|
+
list: (opts) => request("/city", { browse: "true", ...cityScopeQuery(opts), ...cityCollectionQuery(opts), ...cityResponseQuery(opts), format: "list", limit: opts?.limit, ...deepQuery(opts) }, void 0, opts),
|
|
517
|
+
nearbyCoordinates: (lat, lon, opts) => request("/city", {
|
|
518
|
+
lat,
|
|
519
|
+
lon,
|
|
520
|
+
nearby: "true",
|
|
504
521
|
radius: opts?.radius,
|
|
505
522
|
unit: opts?.unit,
|
|
506
|
-
|
|
507
|
-
|
|
523
|
+
...cityScopeQuery(opts),
|
|
524
|
+
...cityCollectionQuery(opts),
|
|
525
|
+
...cityResponseQuery(opts),
|
|
526
|
+
format: "list",
|
|
508
527
|
limit: opts?.limit,
|
|
509
528
|
...deepQuery(opts)
|
|
510
|
-
}, void 0, opts)
|
|
529
|
+
}, void 0, opts),
|
|
530
|
+
nearest: ((lat, lon, opts) => request("/city", { lat, lon, ...cityScopeQuery(opts), ...cityResponseQuery(opts), ...deepQuery(opts) }, void 0, opts)),
|
|
531
|
+
nearby: ((name, opts) => request(`/city/${enc(name)}/nearby`, {
|
|
532
|
+
radius: opts?.radius,
|
|
533
|
+
unit: opts?.unit,
|
|
534
|
+
...cityScopeQuery(opts),
|
|
535
|
+
...cityCollectionQuery(opts),
|
|
536
|
+
...cityResponseQuery(opts),
|
|
537
|
+
aliases: opts?.aliases ? "true" : void 0,
|
|
538
|
+
ambiguity: opts?.ambiguity,
|
|
539
|
+
limit: opts?.limit,
|
|
540
|
+
...deepQuery(opts)
|
|
541
|
+
}, void 0, opts)),
|
|
542
|
+
/** Reviewed immediate children; coverage is partial. */
|
|
543
|
+
children: (id, opts) => request(`/city/id/${enc(id)}/children`, { limit: opts?.limit, cursor: opts?.cursor, ...cityResponseQuery(opts), hierarchy: opts?.hierarchy ? "true" : void 0, ...deepQuery(opts) }, void 0, opts),
|
|
544
|
+
/** Immediate parent first, following only reviewed parent facts. */
|
|
545
|
+
ancestors: (id, opts) => request(`/city/id/${enc(id)}/ancestors`, { ...cityResponseQuery(opts), hierarchy: opts?.hierarchy ? "true" : void 0, ...deepQuery(opts) }, void 0, opts),
|
|
546
|
+
siblings: (id, opts) => request(`/city/id/${enc(id)}/siblings`, { limit: opts?.limit, cursor: opts?.cursor, ...cityResponseQuery(opts), hierarchy: opts?.hierarchy ? "true" : void 0, ...deepQuery(opts) }, void 0, opts),
|
|
547
|
+
/** Great-circle distance between stored centers, not travel distance or containment. */
|
|
548
|
+
distance: (from, to, opts) => request(`/city/id/${enc(from)}/distance/${enc(to)}`, void 0, void 0, opts)
|
|
511
549
|
}
|
|
512
550
|
),
|
|
513
551
|
/** Look up a postal area. Pass country when known. Check nullable latitude/longitude before another location lookup. */
|
|
@@ -601,10 +639,6 @@ function parseAPI(apiKey, options = {}) {
|
|
|
601
639
|
dns: (domain, opts) => request(`/dns/${enc(domain)}`, { type: opts?.type }, void 0, opts),
|
|
602
640
|
mx: (domain, opts) => request(`/mx/${enc(domain)}`, void 0, void 0, opts),
|
|
603
641
|
useragent: (ua, opts) => request("/useragent", deepQuery(opts), { "User-Agent": ua }, opts),
|
|
604
|
-
/** Identify a vehicle by VIN. Paid deep adds specifications and model-level recall campaigns. */
|
|
605
|
-
vehicle: (vin, opts) => request(`/vehicle/${enc(vin)}`, deepQuery(opts), void 0, opts),
|
|
606
|
-
/** Compatibility entry for VIN callers. */
|
|
607
|
-
vin: (vin, opts) => request(`/vin/${enc(vin)}`, deepQuery(opts), void 0, opts),
|
|
608
642
|
/** US NAICS 2022 definitions and hierarchy. */
|
|
609
643
|
industry,
|
|
610
644
|
/** Compatibility name for industry. */
|
|
@@ -703,6 +737,42 @@ function timeTargets(targets, to) {
|
|
|
703
737
|
}
|
|
704
738
|
return targets.join(",");
|
|
705
739
|
}
|
|
740
|
+
function cityErrorCandidates(input) {
|
|
741
|
+
if (!Array.isArray(input)) return void 0;
|
|
742
|
+
const fields = ["name", "name_local", "country", "country_name", "state", "state_name", "type"];
|
|
743
|
+
return input.slice(0, 2).flatMap((row) => {
|
|
744
|
+
if (!row || typeof row !== "object" || typeof row.id !== "string" || !/^city_[23456789abcdefghjkmnpqrstuvwxyz]{12}$/.test(row.id)) return [];
|
|
745
|
+
const candidate = { id: row.id, object: "city" };
|
|
746
|
+
for (const field of fields) if (Object.hasOwn(row, field) && (row[field] === null || typeof row[field] === "string" && row[field].length <= 255)) candidate[field] = row[field];
|
|
747
|
+
return [candidate];
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
function cityCsv(value) {
|
|
751
|
+
return typeof value === "string" ? value : value?.join(",");
|
|
752
|
+
}
|
|
753
|
+
function cityResponseQuery(opts) {
|
|
754
|
+
return { format: opts?.format, romanized: opts?.romanized ? "true" : void 0 };
|
|
755
|
+
}
|
|
756
|
+
function cityScopeQuery(opts) {
|
|
757
|
+
return { country: opts?.country, state: opts?.state, type: opts?.type, grain: opts?.grain, hierarchy: opts?.hierarchy ? "true" : void 0 };
|
|
758
|
+
}
|
|
759
|
+
function cityCollectionQuery(opts) {
|
|
760
|
+
return {
|
|
761
|
+
min_population: opts?.minPopulation,
|
|
762
|
+
max_population: opts?.maxPopulation,
|
|
763
|
+
min_elevation: opts?.minElevation,
|
|
764
|
+
max_elevation: opts?.maxElevation,
|
|
765
|
+
countries: cityCsv(opts?.countries),
|
|
766
|
+
exclude_countries: cityCsv(opts?.excludeCountries),
|
|
767
|
+
timezones: cityCsv(opts?.timezones),
|
|
768
|
+
timezone: opts?.timezone,
|
|
769
|
+
bbox: opts?.bbox,
|
|
770
|
+
page: opts?.page ? "true" : void 0,
|
|
771
|
+
cursor: opts?.cursor,
|
|
772
|
+
sort: opts?.sort,
|
|
773
|
+
order: opts?.order
|
|
774
|
+
};
|
|
775
|
+
}
|
|
706
776
|
export {
|
|
707
777
|
EmojiCatalog,
|
|
708
778
|
EmojiCatalogError,
|