@parseapi/sdk 0.1.3 → 0.2.0
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 +2 -0
- package/dist/index.cjs +9 -1
- package/dist/index.d.cts +186 -29
- package/dist/index.d.ts +186 -29
- package/dist/index.js +9 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,6 +25,7 @@ await parse.ip.self();
|
|
|
25
25
|
await parse.email('hello@gmail.com');
|
|
26
26
|
await parse.vat('DE136695976');
|
|
27
27
|
await parse.iban('DE89370400440532013000');
|
|
28
|
+
await parse.npi('1881018208');
|
|
28
29
|
await parse.phone('+14155552671');
|
|
29
30
|
await parse.carrier('+14155552671');
|
|
30
31
|
await parse.caller('+14155552671');
|
|
@@ -61,6 +62,7 @@ await parse.weather(40.7128, -74.006);
|
|
|
61
62
|
await parse.domain('example.com');
|
|
62
63
|
await parse.mx('example.com');
|
|
63
64
|
await parse.useragent(uaString);
|
|
65
|
+
await parse.vin('1HGCM82633A004352');
|
|
64
66
|
await parse.emoji('rocket');
|
|
65
67
|
await parse.emoji.search('fire');
|
|
66
68
|
```
|
package/dist/index.cjs
CHANGED
|
@@ -24,7 +24,7 @@ __export(index_exports, {
|
|
|
24
24
|
parseAPI: () => parseAPI
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(index_exports);
|
|
27
|
-
var VERSION = "0.
|
|
27
|
+
var VERSION = "0.2.0";
|
|
28
28
|
var DEFAULT_BASE_URL = "https://api.parseapi.com";
|
|
29
29
|
var DEFAULT_TIMEOUT_MS = 1e4;
|
|
30
30
|
var DEFAULT_RETRIES = 2;
|
|
@@ -197,6 +197,7 @@ function parseAPI(apiKey, options = {}) {
|
|
|
197
197
|
...deepQuery(opts)
|
|
198
198
|
}),
|
|
199
199
|
iban: (iban, opts) => request(`/iban/${enc(iban)}`, { country: opts?.country }),
|
|
200
|
+
npi: (npi, opts) => request(`/npi/${enc(npi)}`, deepQuery(opts)),
|
|
200
201
|
phone: (number, opts) => request(`/phone/${enc(number)}`, { country: opts?.country, ...deepQuery(opts) }),
|
|
201
202
|
carrier: (number, opts) => request(`/carrier/${enc(number)}`, { country: opts?.country }),
|
|
202
203
|
caller: (number, opts) => request(`/caller/${enc(number)}`, { country: opts?.country }),
|
|
@@ -204,6 +205,13 @@ function parseAPI(apiKey, options = {}) {
|
|
|
204
205
|
domain: (domain, opts) => request(`/domain/${enc(domain)}`, deepQuery(opts)),
|
|
205
206
|
mx: (domain) => request(`/mx/${enc(domain)}`),
|
|
206
207
|
useragent: (ua, opts) => request("/useragent", deepQuery(opts), { "User-Agent": ua }),
|
|
208
|
+
vin: (vin, opts) => request(`/vin/${enc(vin)}`, deepQuery(opts)),
|
|
209
|
+
hts: Object.assign(
|
|
210
|
+
(code, opts) => request(`/hts/${enc(code)}`, { origin: opts?.origin, ...deepQuery(opts) }),
|
|
211
|
+
{
|
|
212
|
+
search: (q) => request("/hts", { q })
|
|
213
|
+
}
|
|
214
|
+
),
|
|
207
215
|
currency: Object.assign(
|
|
208
216
|
(code) => request(`/currency/${enc(code)}`),
|
|
209
217
|
{
|
package/dist/index.d.cts
CHANGED
|
@@ -108,6 +108,7 @@ interface State {
|
|
|
108
108
|
latitude: number | null;
|
|
109
109
|
longitude: number | null;
|
|
110
110
|
population: number | null;
|
|
111
|
+
/** Total area in km2. */
|
|
111
112
|
area: number | null;
|
|
112
113
|
timezone: string | null;
|
|
113
114
|
timezones: string[];
|
|
@@ -141,7 +142,11 @@ interface District {
|
|
|
141
142
|
latitude: number | null;
|
|
142
143
|
longitude: number | null;
|
|
143
144
|
population: number | null;
|
|
145
|
+
/** Total area in km2 (land + water, or the official total). */
|
|
146
|
+
area: number | null;
|
|
147
|
+
/** Land area in km2. Null when the source publishes total only. */
|
|
144
148
|
land_area: number | null;
|
|
149
|
+
/** Water area in km2. Null when the source publishes total only. */
|
|
145
150
|
water_area: number | null;
|
|
146
151
|
seat: string | null;
|
|
147
152
|
timezone: string | null;
|
|
@@ -151,7 +156,8 @@ interface City {
|
|
|
151
156
|
name: string;
|
|
152
157
|
local_name: string | null;
|
|
153
158
|
type: string | null;
|
|
154
|
-
capital:
|
|
159
|
+
/** What this city is the capital of: country, state, or null. */
|
|
160
|
+
capital_of: 'country' | 'state' | null;
|
|
155
161
|
state: string | null;
|
|
156
162
|
state_name: string | null;
|
|
157
163
|
district: string | null;
|
|
@@ -163,7 +169,11 @@ interface City {
|
|
|
163
169
|
elevation: number | null;
|
|
164
170
|
elevation_ft: number | null;
|
|
165
171
|
population: number | null;
|
|
172
|
+
/** Total area in km2 (land + water, or the official total). */
|
|
173
|
+
area: number | null;
|
|
174
|
+
/** Land area in km2. Null when the source publishes total only. */
|
|
166
175
|
land_area: number | null;
|
|
176
|
+
/** Water area in km2. Null when the source publishes total only. */
|
|
167
177
|
water_area: number | null;
|
|
168
178
|
timezone: string | null;
|
|
169
179
|
/** Minted parse id (`city_` + 12 chars). Stable pin via `/city/id/{id}`. */
|
|
@@ -205,7 +215,11 @@ interface Postal {
|
|
|
205
215
|
elevation: number | null;
|
|
206
216
|
elevation_ft: number | null;
|
|
207
217
|
population: number | null;
|
|
218
|
+
/** Total area in km2. Null when the source has no water split. */
|
|
219
|
+
area: number | null;
|
|
220
|
+
/** Land area in km2. Null where the source has none. */
|
|
208
221
|
land_area: number | null;
|
|
222
|
+
/** Water area in km2. Null where the source has none. */
|
|
209
223
|
water_area: number | null;
|
|
210
224
|
timezone: string | null;
|
|
211
225
|
currency: string | null;
|
|
@@ -262,7 +276,8 @@ interface VatDeep {
|
|
|
262
276
|
name: string | null;
|
|
263
277
|
address: VatAddress | null;
|
|
264
278
|
consultation: string | null;
|
|
265
|
-
|
|
279
|
+
/** Registry timestamp of this check, ISO. */
|
|
280
|
+
consulted_at: string | null;
|
|
266
281
|
}
|
|
267
282
|
interface Vat {
|
|
268
283
|
vat: string | null;
|
|
@@ -285,17 +300,152 @@ interface Iban {
|
|
|
285
300
|
branch: string | null;
|
|
286
301
|
account: string | null;
|
|
287
302
|
}
|
|
303
|
+
interface Npi {
|
|
304
|
+
/** Normalized 10-digit NPI. Invalid input still echoes the fold. */
|
|
305
|
+
npi: string | null;
|
|
306
|
+
valid: boolean;
|
|
307
|
+
/** Exists in the CMS NPPES registry. */
|
|
308
|
+
registered: boolean | null;
|
|
309
|
+
active: boolean | null;
|
|
310
|
+
/** On the OIG exclusion list. */
|
|
311
|
+
excluded: boolean | null;
|
|
312
|
+
/** individual or organization. */
|
|
313
|
+
type: string | null;
|
|
314
|
+
name: string | null;
|
|
315
|
+
first: string | null;
|
|
316
|
+
last: string | null;
|
|
317
|
+
credential: string | null;
|
|
318
|
+
specialty: string | null;
|
|
319
|
+
/** NUCC taxonomy code. */
|
|
320
|
+
taxonomy: string | null;
|
|
321
|
+
address: string | null;
|
|
322
|
+
city: string | null;
|
|
323
|
+
state: string | null;
|
|
324
|
+
state_name: string | null;
|
|
325
|
+
postal: string | null;
|
|
326
|
+
country: string | null;
|
|
327
|
+
phone: string | null;
|
|
328
|
+
deep?: Deep<NpiDeep>;
|
|
329
|
+
}
|
|
330
|
+
interface NpiEnrollment {
|
|
331
|
+
/** part_a, part_b, practitioner, dme, order_refer, mdpp. Null when the code is unknown. */
|
|
332
|
+
type: string | null;
|
|
333
|
+
specialty: string | null;
|
|
334
|
+
state: string | null;
|
|
335
|
+
}
|
|
336
|
+
interface NpiDeep {
|
|
337
|
+
/** In the published Medicare FFS enrollment extract. */
|
|
338
|
+
medicare?: boolean | null;
|
|
339
|
+
/** On the CMS opt-out affidavit list. Matched by NPI only. */
|
|
340
|
+
opt_out?: boolean | null;
|
|
341
|
+
/** Enrollment rows. [] when medicare is false. */
|
|
342
|
+
enrollments?: NpiEnrollment[] | null;
|
|
343
|
+
}
|
|
344
|
+
interface HtsMeasure {
|
|
345
|
+
/** Chapter 99 heading, dotted (9903.01.24). */
|
|
346
|
+
heading: string;
|
|
347
|
+
/** The measure text verbatim. */
|
|
348
|
+
description: string;
|
|
349
|
+
/** The rate string verbatim ("The duty provided in the applicable subheading + 10%"). */
|
|
350
|
+
rate: string | null;
|
|
351
|
+
/** Effective from, ISO YYYY-MM-DD. Null when the schedule states none. */
|
|
352
|
+
from: string | null;
|
|
353
|
+
/** Expires, ISO YYYY-MM-DD. Null when open-ended. */
|
|
354
|
+
until: string | null;
|
|
355
|
+
}
|
|
356
|
+
interface HtsDeep {
|
|
357
|
+
/** The origin country the measures were resolved for. */
|
|
358
|
+
origin?: string | null;
|
|
359
|
+
/** Composed ad valorem percent. Null when the components do not compose cleanly. */
|
|
360
|
+
effective_rate?: number | null;
|
|
361
|
+
/** Every Chapter 99 tariff measure that applies to this code from this origin. */
|
|
362
|
+
measures?: HtsMeasure[] | null;
|
|
363
|
+
}
|
|
364
|
+
interface Hts {
|
|
365
|
+
/** Normalized code with dots (8471.30.01.00). */
|
|
366
|
+
hts: string;
|
|
367
|
+
/** The schedule line verbatim. */
|
|
368
|
+
description: string;
|
|
369
|
+
/** Parent descriptions from the schedule outline, outermost first. */
|
|
370
|
+
lineage: string[];
|
|
371
|
+
/** Units of quantity (No., kg). */
|
|
372
|
+
units: string[];
|
|
373
|
+
/** Column 1 general rate, verbatim. */
|
|
374
|
+
general: string | null;
|
|
375
|
+
/** Column 1 special rate, verbatim. */
|
|
376
|
+
special: string | null;
|
|
377
|
+
/** Column 2 rate, verbatim. */
|
|
378
|
+
other: string | null;
|
|
379
|
+
/** The official release that answered (2026HTSRev17). */
|
|
380
|
+
revision: string;
|
|
381
|
+
deep?: Deep<HtsDeep>;
|
|
382
|
+
}
|
|
383
|
+
interface HtsSearchHit {
|
|
384
|
+
hts: string;
|
|
385
|
+
description: string;
|
|
386
|
+
general: string | null;
|
|
387
|
+
}
|
|
388
|
+
interface HtsSearch {
|
|
389
|
+
q: string;
|
|
390
|
+
revision: string;
|
|
391
|
+
/** Up to 20 tariff lines, best match first. */
|
|
392
|
+
lines: HtsSearchHit[];
|
|
393
|
+
}
|
|
394
|
+
interface VinRecall {
|
|
395
|
+
/** Government campaign number. */
|
|
396
|
+
campaign: string;
|
|
397
|
+
/** Report date, ISO YYYY-MM-DD. */
|
|
398
|
+
date: string | null;
|
|
399
|
+
component: string | null;
|
|
400
|
+
/** The filed summary verbatim. */
|
|
401
|
+
summary: string | null;
|
|
402
|
+
}
|
|
403
|
+
interface VinDeep {
|
|
404
|
+
/** Open recall campaigns for the decoded vehicle. [] when none, null when the registry did not answer. */
|
|
405
|
+
recalls?: VinRecall[] | null;
|
|
406
|
+
}
|
|
407
|
+
interface Vin {
|
|
408
|
+
/** Normalized VIN, uppercase, no spaces. Invalid input still echoes the fold. */
|
|
409
|
+
vin: string | null;
|
|
410
|
+
valid: boolean;
|
|
411
|
+
year: number | null;
|
|
412
|
+
make: string | null;
|
|
413
|
+
model: string | null;
|
|
414
|
+
trim: string | null;
|
|
415
|
+
series: string | null;
|
|
416
|
+
/** Body style (sedan, coupe, suv, pickup). */
|
|
417
|
+
body: string | null;
|
|
418
|
+
/** Vehicle type (passenger car, truck, motorcycle, bus, trailer). */
|
|
419
|
+
type: string | null;
|
|
420
|
+
doors: number | null;
|
|
421
|
+
cylinders: number | null;
|
|
422
|
+
/** Engine displacement in liters. */
|
|
423
|
+
displacement: number | null;
|
|
424
|
+
fuel: string | null;
|
|
425
|
+
horsepower: number | null;
|
|
426
|
+
/** fwd, rwd, awd, 4wd. */
|
|
427
|
+
drive: string | null;
|
|
428
|
+
/** automatic, manual, cvt. */
|
|
429
|
+
transmission: string | null;
|
|
430
|
+
manufacturer: string | null;
|
|
431
|
+
plant_city: string | null;
|
|
432
|
+
plant_state: string | null;
|
|
433
|
+
plant_country: string | null;
|
|
434
|
+
/** Gross vehicle weight rating class as filed. */
|
|
435
|
+
gvwr: string | null;
|
|
436
|
+
deep?: Deep<VinDeep>;
|
|
437
|
+
}
|
|
288
438
|
interface Phone {
|
|
289
439
|
phone: string | null;
|
|
290
440
|
valid: boolean;
|
|
291
|
-
/** What the numbering plan can see. Never voip (that is the carrier field's word). Present when valid. */
|
|
292
|
-
type?: 'mobile' | 'landline' | 'toll_free' | 'unknown';
|
|
293
|
-
/** NPA-derived state code (US/CA). Present when valid. */
|
|
294
|
-
state?: string | null;
|
|
295
|
-
state_name?: string | null;
|
|
296
441
|
country: string | null;
|
|
297
|
-
|
|
298
|
-
|
|
442
|
+
/** What the numbering plan can see. Never voip (that is the carrier field's word). Null when invalid. */
|
|
443
|
+
type: 'mobile' | 'landline' | 'toll_free' | 'unknown' | null;
|
|
444
|
+
/** NPA-derived state code (US/CA). */
|
|
445
|
+
state: string | null;
|
|
446
|
+
state_name: string | null;
|
|
447
|
+
national: string | null;
|
|
448
|
+
international: string | null;
|
|
299
449
|
/** Always empty. The metered proves are their own endpoints: carrier, caller, hlr. */
|
|
300
450
|
deep?: Record<string, never>;
|
|
301
451
|
}
|
|
@@ -303,42 +453,42 @@ interface Carrier {
|
|
|
303
453
|
phone: string | null;
|
|
304
454
|
valid: boolean;
|
|
305
455
|
country: string | null;
|
|
306
|
-
/** The network's word, including voip.
|
|
307
|
-
type
|
|
456
|
+
/** The network's word, including voip. Null when invalid. */
|
|
457
|
+
type: 'mobile' | 'landline' | 'voip' | 'toll_free' | 'unknown' | null;
|
|
308
458
|
/** Current carrier display name. Null when the probe had no answer. */
|
|
309
|
-
carrier
|
|
459
|
+
carrier: string | null;
|
|
310
460
|
/** Carrier is a known burner number app. Null when carrier is unknown. */
|
|
311
|
-
burner
|
|
461
|
+
burner: boolean | null;
|
|
312
462
|
/** Issuing rate-center city. */
|
|
313
|
-
city
|
|
314
|
-
state
|
|
315
|
-
state_name
|
|
463
|
+
city: string | null;
|
|
464
|
+
state: string | null;
|
|
465
|
+
state_name: string | null;
|
|
316
466
|
}
|
|
317
467
|
interface Caller {
|
|
318
468
|
phone: string | null;
|
|
319
469
|
valid: boolean;
|
|
320
470
|
country: string | null;
|
|
321
|
-
/** CNAM record verbatim (all-caps telco artifact). Null when no record
|
|
322
|
-
caller
|
|
471
|
+
/** CNAM record verbatim (all-caps telco artifact). Null when no record, outside NANP, or invalid. */
|
|
472
|
+
caller: string | null;
|
|
323
473
|
}
|
|
324
474
|
interface Hlr {
|
|
325
475
|
phone: string | null;
|
|
326
476
|
valid: boolean;
|
|
327
477
|
country: string | null;
|
|
328
|
-
/** Assigned to a subscriber.
|
|
329
|
-
live
|
|
478
|
+
/** Assigned to a subscriber. Null when invalid. */
|
|
479
|
+
live: boolean | null;
|
|
330
480
|
/** Handset reachable right now. Null means unconfirmed, never no. */
|
|
331
|
-
connected
|
|
481
|
+
connected: boolean | null;
|
|
332
482
|
/** The six network extras fill on live HLR dips only. Null elsewhere (NANP, failover). */
|
|
333
|
-
roaming
|
|
334
|
-
roaming_network
|
|
483
|
+
roaming: boolean | null;
|
|
484
|
+
roaming_network: string | null;
|
|
335
485
|
/** ISO2, uppercase. */
|
|
336
|
-
roaming_country
|
|
486
|
+
roaming_country: string | null;
|
|
337
487
|
/** Current serving network name. */
|
|
338
|
-
network
|
|
339
|
-
original_network
|
|
340
|
-
mcc
|
|
341
|
-
mnc
|
|
488
|
+
network: string | null;
|
|
489
|
+
original_network: string | null;
|
|
490
|
+
mcc: string | null;
|
|
491
|
+
mnc: string | null;
|
|
342
492
|
}
|
|
343
493
|
interface MxRecord {
|
|
344
494
|
priority: number;
|
|
@@ -809,6 +959,7 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
809
959
|
iban: (iban: string, opts?: {
|
|
810
960
|
country?: string;
|
|
811
961
|
}) => Promise<Iban>;
|
|
962
|
+
npi: (npi: string, opts?: DeepOption) => Promise<Npi>;
|
|
812
963
|
phone: (number: string, opts?: {
|
|
813
964
|
country?: string;
|
|
814
965
|
} & DeepOption) => Promise<Phone>;
|
|
@@ -824,6 +975,12 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
824
975
|
domain: (domain: string, opts?: DeepOption) => Promise<Domain>;
|
|
825
976
|
mx: (domain: string) => Promise<Mx>;
|
|
826
977
|
useragent: (ua: string, opts?: DeepOption) => Promise<Useragent>;
|
|
978
|
+
vin: (vin: string, opts?: DeepOption) => Promise<Vin>;
|
|
979
|
+
hts: ((code: string, opts?: {
|
|
980
|
+
origin?: string;
|
|
981
|
+
} & DeepOption) => Promise<Hts>) & {
|
|
982
|
+
search: (q: string) => Promise<HtsSearch>;
|
|
983
|
+
};
|
|
827
984
|
currency: ((code: string) => Promise<Currency>) & {
|
|
828
985
|
rate: (base: string, quote: string, opts?: {
|
|
829
986
|
date?: string;
|
|
@@ -867,4 +1024,4 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
867
1024
|
};
|
|
868
1025
|
type ParseAPIClient = ReturnType<typeof parseAPI>;
|
|
869
1026
|
|
|
870
|
-
export { type Bloc, type BlocCountries, type BlocCountryItem, type Caller, type Carrier, type City, type CityNearby, type CityNearest, type CitySearch, type Continent, type ContinentCountries, type ContinentCountryItem, type Country, type CountryStateItem, type CountryStates, type Currency, type CurrencyRate, type DateInfo, type Deep, type District, type Domain, type DomainDeep, type DomainRegistration, type Elevation, type Email, type EmailDeep, type Emoji, type EmojiSearch, type EmojiSkin, type Hlr, type Holiday, type HolidayDate, type HolidayYear, type Iban, type Ip, type IpDeep, type Language, type Mx, type MxRecord, type Name, type ParseAPIClient, ParseAPIError, type ParseAPIOptions, type Phone, type Point, type PointDeep, type Postal, type PostalDistance, type PostalDistanceEnd, type PostalNearby, type PostalNearbyItem, type State, type StateDistrictItem, type StateDistricts, type Timezone, type TimezoneConversionTarget, type TimezoneNextDst, type Useragent, type UseragentBrowserBrand, type UseragentBrowserDeep, type UseragentDeep, type UseragentDeviceDeep, type UseragentEngineDeep, type UseragentOsDeep, type Vat, type VatAddress, type VatDeep, type Weather, type WeatherAir, type WeatherAlert, type WeatherCurrent, type WeatherDay, type WeatherDeep, type WeatherForecastPeriod, type WeatherHistory, type WeatherHour, type WeatherMinute, type WeatherSource, type WeatherStation, parseAPI };
|
|
1027
|
+
export { type Bloc, type BlocCountries, type BlocCountryItem, type Caller, type Carrier, type City, type CityNearby, type CityNearest, type CitySearch, type Continent, type ContinentCountries, type ContinentCountryItem, type Country, type CountryStateItem, type CountryStates, type Currency, type CurrencyRate, type DateInfo, type Deep, type District, type Domain, type DomainDeep, type DomainRegistration, type Elevation, type Email, type EmailDeep, type Emoji, type EmojiSearch, type EmojiSkin, type Hlr, type Holiday, type HolidayDate, type HolidayYear, type Hts, type HtsDeep, type HtsMeasure, type HtsSearch, type HtsSearchHit, type Iban, type Ip, type IpDeep, type Language, type Mx, type MxRecord, type Name, type Npi, type NpiDeep, type NpiEnrollment, type ParseAPIClient, ParseAPIError, type ParseAPIOptions, type Phone, type Point, type PointDeep, type Postal, type PostalDistance, type PostalDistanceEnd, type PostalNearby, type PostalNearbyItem, type State, type StateDistrictItem, type StateDistricts, type Timezone, type TimezoneConversionTarget, type TimezoneNextDst, type Useragent, type UseragentBrowserBrand, type UseragentBrowserDeep, type UseragentDeep, type UseragentDeviceDeep, type UseragentEngineDeep, type UseragentOsDeep, type Vat, type VatAddress, type VatDeep, type Vin, type VinDeep, type VinRecall, type Weather, type WeatherAir, type WeatherAlert, type WeatherCurrent, type WeatherDay, type WeatherDeep, type WeatherForecastPeriod, type WeatherHistory, type WeatherHour, type WeatherMinute, type WeatherSource, type WeatherStation, parseAPI };
|
package/dist/index.d.ts
CHANGED
|
@@ -108,6 +108,7 @@ interface State {
|
|
|
108
108
|
latitude: number | null;
|
|
109
109
|
longitude: number | null;
|
|
110
110
|
population: number | null;
|
|
111
|
+
/** Total area in km2. */
|
|
111
112
|
area: number | null;
|
|
112
113
|
timezone: string | null;
|
|
113
114
|
timezones: string[];
|
|
@@ -141,7 +142,11 @@ interface District {
|
|
|
141
142
|
latitude: number | null;
|
|
142
143
|
longitude: number | null;
|
|
143
144
|
population: number | null;
|
|
145
|
+
/** Total area in km2 (land + water, or the official total). */
|
|
146
|
+
area: number | null;
|
|
147
|
+
/** Land area in km2. Null when the source publishes total only. */
|
|
144
148
|
land_area: number | null;
|
|
149
|
+
/** Water area in km2. Null when the source publishes total only. */
|
|
145
150
|
water_area: number | null;
|
|
146
151
|
seat: string | null;
|
|
147
152
|
timezone: string | null;
|
|
@@ -151,7 +156,8 @@ interface City {
|
|
|
151
156
|
name: string;
|
|
152
157
|
local_name: string | null;
|
|
153
158
|
type: string | null;
|
|
154
|
-
capital:
|
|
159
|
+
/** What this city is the capital of: country, state, or null. */
|
|
160
|
+
capital_of: 'country' | 'state' | null;
|
|
155
161
|
state: string | null;
|
|
156
162
|
state_name: string | null;
|
|
157
163
|
district: string | null;
|
|
@@ -163,7 +169,11 @@ interface City {
|
|
|
163
169
|
elevation: number | null;
|
|
164
170
|
elevation_ft: number | null;
|
|
165
171
|
population: number | null;
|
|
172
|
+
/** Total area in km2 (land + water, or the official total). */
|
|
173
|
+
area: number | null;
|
|
174
|
+
/** Land area in km2. Null when the source publishes total only. */
|
|
166
175
|
land_area: number | null;
|
|
176
|
+
/** Water area in km2. Null when the source publishes total only. */
|
|
167
177
|
water_area: number | null;
|
|
168
178
|
timezone: string | null;
|
|
169
179
|
/** Minted parse id (`city_` + 12 chars). Stable pin via `/city/id/{id}`. */
|
|
@@ -205,7 +215,11 @@ interface Postal {
|
|
|
205
215
|
elevation: number | null;
|
|
206
216
|
elevation_ft: number | null;
|
|
207
217
|
population: number | null;
|
|
218
|
+
/** Total area in km2. Null when the source has no water split. */
|
|
219
|
+
area: number | null;
|
|
220
|
+
/** Land area in km2. Null where the source has none. */
|
|
208
221
|
land_area: number | null;
|
|
222
|
+
/** Water area in km2. Null where the source has none. */
|
|
209
223
|
water_area: number | null;
|
|
210
224
|
timezone: string | null;
|
|
211
225
|
currency: string | null;
|
|
@@ -262,7 +276,8 @@ interface VatDeep {
|
|
|
262
276
|
name: string | null;
|
|
263
277
|
address: VatAddress | null;
|
|
264
278
|
consultation: string | null;
|
|
265
|
-
|
|
279
|
+
/** Registry timestamp of this check, ISO. */
|
|
280
|
+
consulted_at: string | null;
|
|
266
281
|
}
|
|
267
282
|
interface Vat {
|
|
268
283
|
vat: string | null;
|
|
@@ -285,17 +300,152 @@ interface Iban {
|
|
|
285
300
|
branch: string | null;
|
|
286
301
|
account: string | null;
|
|
287
302
|
}
|
|
303
|
+
interface Npi {
|
|
304
|
+
/** Normalized 10-digit NPI. Invalid input still echoes the fold. */
|
|
305
|
+
npi: string | null;
|
|
306
|
+
valid: boolean;
|
|
307
|
+
/** Exists in the CMS NPPES registry. */
|
|
308
|
+
registered: boolean | null;
|
|
309
|
+
active: boolean | null;
|
|
310
|
+
/** On the OIG exclusion list. */
|
|
311
|
+
excluded: boolean | null;
|
|
312
|
+
/** individual or organization. */
|
|
313
|
+
type: string | null;
|
|
314
|
+
name: string | null;
|
|
315
|
+
first: string | null;
|
|
316
|
+
last: string | null;
|
|
317
|
+
credential: string | null;
|
|
318
|
+
specialty: string | null;
|
|
319
|
+
/** NUCC taxonomy code. */
|
|
320
|
+
taxonomy: string | null;
|
|
321
|
+
address: string | null;
|
|
322
|
+
city: string | null;
|
|
323
|
+
state: string | null;
|
|
324
|
+
state_name: string | null;
|
|
325
|
+
postal: string | null;
|
|
326
|
+
country: string | null;
|
|
327
|
+
phone: string | null;
|
|
328
|
+
deep?: Deep<NpiDeep>;
|
|
329
|
+
}
|
|
330
|
+
interface NpiEnrollment {
|
|
331
|
+
/** part_a, part_b, practitioner, dme, order_refer, mdpp. Null when the code is unknown. */
|
|
332
|
+
type: string | null;
|
|
333
|
+
specialty: string | null;
|
|
334
|
+
state: string | null;
|
|
335
|
+
}
|
|
336
|
+
interface NpiDeep {
|
|
337
|
+
/** In the published Medicare FFS enrollment extract. */
|
|
338
|
+
medicare?: boolean | null;
|
|
339
|
+
/** On the CMS opt-out affidavit list. Matched by NPI only. */
|
|
340
|
+
opt_out?: boolean | null;
|
|
341
|
+
/** Enrollment rows. [] when medicare is false. */
|
|
342
|
+
enrollments?: NpiEnrollment[] | null;
|
|
343
|
+
}
|
|
344
|
+
interface HtsMeasure {
|
|
345
|
+
/** Chapter 99 heading, dotted (9903.01.24). */
|
|
346
|
+
heading: string;
|
|
347
|
+
/** The measure text verbatim. */
|
|
348
|
+
description: string;
|
|
349
|
+
/** The rate string verbatim ("The duty provided in the applicable subheading + 10%"). */
|
|
350
|
+
rate: string | null;
|
|
351
|
+
/** Effective from, ISO YYYY-MM-DD. Null when the schedule states none. */
|
|
352
|
+
from: string | null;
|
|
353
|
+
/** Expires, ISO YYYY-MM-DD. Null when open-ended. */
|
|
354
|
+
until: string | null;
|
|
355
|
+
}
|
|
356
|
+
interface HtsDeep {
|
|
357
|
+
/** The origin country the measures were resolved for. */
|
|
358
|
+
origin?: string | null;
|
|
359
|
+
/** Composed ad valorem percent. Null when the components do not compose cleanly. */
|
|
360
|
+
effective_rate?: number | null;
|
|
361
|
+
/** Every Chapter 99 tariff measure that applies to this code from this origin. */
|
|
362
|
+
measures?: HtsMeasure[] | null;
|
|
363
|
+
}
|
|
364
|
+
interface Hts {
|
|
365
|
+
/** Normalized code with dots (8471.30.01.00). */
|
|
366
|
+
hts: string;
|
|
367
|
+
/** The schedule line verbatim. */
|
|
368
|
+
description: string;
|
|
369
|
+
/** Parent descriptions from the schedule outline, outermost first. */
|
|
370
|
+
lineage: string[];
|
|
371
|
+
/** Units of quantity (No., kg). */
|
|
372
|
+
units: string[];
|
|
373
|
+
/** Column 1 general rate, verbatim. */
|
|
374
|
+
general: string | null;
|
|
375
|
+
/** Column 1 special rate, verbatim. */
|
|
376
|
+
special: string | null;
|
|
377
|
+
/** Column 2 rate, verbatim. */
|
|
378
|
+
other: string | null;
|
|
379
|
+
/** The official release that answered (2026HTSRev17). */
|
|
380
|
+
revision: string;
|
|
381
|
+
deep?: Deep<HtsDeep>;
|
|
382
|
+
}
|
|
383
|
+
interface HtsSearchHit {
|
|
384
|
+
hts: string;
|
|
385
|
+
description: string;
|
|
386
|
+
general: string | null;
|
|
387
|
+
}
|
|
388
|
+
interface HtsSearch {
|
|
389
|
+
q: string;
|
|
390
|
+
revision: string;
|
|
391
|
+
/** Up to 20 tariff lines, best match first. */
|
|
392
|
+
lines: HtsSearchHit[];
|
|
393
|
+
}
|
|
394
|
+
interface VinRecall {
|
|
395
|
+
/** Government campaign number. */
|
|
396
|
+
campaign: string;
|
|
397
|
+
/** Report date, ISO YYYY-MM-DD. */
|
|
398
|
+
date: string | null;
|
|
399
|
+
component: string | null;
|
|
400
|
+
/** The filed summary verbatim. */
|
|
401
|
+
summary: string | null;
|
|
402
|
+
}
|
|
403
|
+
interface VinDeep {
|
|
404
|
+
/** Open recall campaigns for the decoded vehicle. [] when none, null when the registry did not answer. */
|
|
405
|
+
recalls?: VinRecall[] | null;
|
|
406
|
+
}
|
|
407
|
+
interface Vin {
|
|
408
|
+
/** Normalized VIN, uppercase, no spaces. Invalid input still echoes the fold. */
|
|
409
|
+
vin: string | null;
|
|
410
|
+
valid: boolean;
|
|
411
|
+
year: number | null;
|
|
412
|
+
make: string | null;
|
|
413
|
+
model: string | null;
|
|
414
|
+
trim: string | null;
|
|
415
|
+
series: string | null;
|
|
416
|
+
/** Body style (sedan, coupe, suv, pickup). */
|
|
417
|
+
body: string | null;
|
|
418
|
+
/** Vehicle type (passenger car, truck, motorcycle, bus, trailer). */
|
|
419
|
+
type: string | null;
|
|
420
|
+
doors: number | null;
|
|
421
|
+
cylinders: number | null;
|
|
422
|
+
/** Engine displacement in liters. */
|
|
423
|
+
displacement: number | null;
|
|
424
|
+
fuel: string | null;
|
|
425
|
+
horsepower: number | null;
|
|
426
|
+
/** fwd, rwd, awd, 4wd. */
|
|
427
|
+
drive: string | null;
|
|
428
|
+
/** automatic, manual, cvt. */
|
|
429
|
+
transmission: string | null;
|
|
430
|
+
manufacturer: string | null;
|
|
431
|
+
plant_city: string | null;
|
|
432
|
+
plant_state: string | null;
|
|
433
|
+
plant_country: string | null;
|
|
434
|
+
/** Gross vehicle weight rating class as filed. */
|
|
435
|
+
gvwr: string | null;
|
|
436
|
+
deep?: Deep<VinDeep>;
|
|
437
|
+
}
|
|
288
438
|
interface Phone {
|
|
289
439
|
phone: string | null;
|
|
290
440
|
valid: boolean;
|
|
291
|
-
/** What the numbering plan can see. Never voip (that is the carrier field's word). Present when valid. */
|
|
292
|
-
type?: 'mobile' | 'landline' | 'toll_free' | 'unknown';
|
|
293
|
-
/** NPA-derived state code (US/CA). Present when valid. */
|
|
294
|
-
state?: string | null;
|
|
295
|
-
state_name?: string | null;
|
|
296
441
|
country: string | null;
|
|
297
|
-
|
|
298
|
-
|
|
442
|
+
/** What the numbering plan can see. Never voip (that is the carrier field's word). Null when invalid. */
|
|
443
|
+
type: 'mobile' | 'landline' | 'toll_free' | 'unknown' | null;
|
|
444
|
+
/** NPA-derived state code (US/CA). */
|
|
445
|
+
state: string | null;
|
|
446
|
+
state_name: string | null;
|
|
447
|
+
national: string | null;
|
|
448
|
+
international: string | null;
|
|
299
449
|
/** Always empty. The metered proves are their own endpoints: carrier, caller, hlr. */
|
|
300
450
|
deep?: Record<string, never>;
|
|
301
451
|
}
|
|
@@ -303,42 +453,42 @@ interface Carrier {
|
|
|
303
453
|
phone: string | null;
|
|
304
454
|
valid: boolean;
|
|
305
455
|
country: string | null;
|
|
306
|
-
/** The network's word, including voip.
|
|
307
|
-
type
|
|
456
|
+
/** The network's word, including voip. Null when invalid. */
|
|
457
|
+
type: 'mobile' | 'landline' | 'voip' | 'toll_free' | 'unknown' | null;
|
|
308
458
|
/** Current carrier display name. Null when the probe had no answer. */
|
|
309
|
-
carrier
|
|
459
|
+
carrier: string | null;
|
|
310
460
|
/** Carrier is a known burner number app. Null when carrier is unknown. */
|
|
311
|
-
burner
|
|
461
|
+
burner: boolean | null;
|
|
312
462
|
/** Issuing rate-center city. */
|
|
313
|
-
city
|
|
314
|
-
state
|
|
315
|
-
state_name
|
|
463
|
+
city: string | null;
|
|
464
|
+
state: string | null;
|
|
465
|
+
state_name: string | null;
|
|
316
466
|
}
|
|
317
467
|
interface Caller {
|
|
318
468
|
phone: string | null;
|
|
319
469
|
valid: boolean;
|
|
320
470
|
country: string | null;
|
|
321
|
-
/** CNAM record verbatim (all-caps telco artifact). Null when no record
|
|
322
|
-
caller
|
|
471
|
+
/** CNAM record verbatim (all-caps telco artifact). Null when no record, outside NANP, or invalid. */
|
|
472
|
+
caller: string | null;
|
|
323
473
|
}
|
|
324
474
|
interface Hlr {
|
|
325
475
|
phone: string | null;
|
|
326
476
|
valid: boolean;
|
|
327
477
|
country: string | null;
|
|
328
|
-
/** Assigned to a subscriber.
|
|
329
|
-
live
|
|
478
|
+
/** Assigned to a subscriber. Null when invalid. */
|
|
479
|
+
live: boolean | null;
|
|
330
480
|
/** Handset reachable right now. Null means unconfirmed, never no. */
|
|
331
|
-
connected
|
|
481
|
+
connected: boolean | null;
|
|
332
482
|
/** The six network extras fill on live HLR dips only. Null elsewhere (NANP, failover). */
|
|
333
|
-
roaming
|
|
334
|
-
roaming_network
|
|
483
|
+
roaming: boolean | null;
|
|
484
|
+
roaming_network: string | null;
|
|
335
485
|
/** ISO2, uppercase. */
|
|
336
|
-
roaming_country
|
|
486
|
+
roaming_country: string | null;
|
|
337
487
|
/** Current serving network name. */
|
|
338
|
-
network
|
|
339
|
-
original_network
|
|
340
|
-
mcc
|
|
341
|
-
mnc
|
|
488
|
+
network: string | null;
|
|
489
|
+
original_network: string | null;
|
|
490
|
+
mcc: string | null;
|
|
491
|
+
mnc: string | null;
|
|
342
492
|
}
|
|
343
493
|
interface MxRecord {
|
|
344
494
|
priority: number;
|
|
@@ -809,6 +959,7 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
809
959
|
iban: (iban: string, opts?: {
|
|
810
960
|
country?: string;
|
|
811
961
|
}) => Promise<Iban>;
|
|
962
|
+
npi: (npi: string, opts?: DeepOption) => Promise<Npi>;
|
|
812
963
|
phone: (number: string, opts?: {
|
|
813
964
|
country?: string;
|
|
814
965
|
} & DeepOption) => Promise<Phone>;
|
|
@@ -824,6 +975,12 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
824
975
|
domain: (domain: string, opts?: DeepOption) => Promise<Domain>;
|
|
825
976
|
mx: (domain: string) => Promise<Mx>;
|
|
826
977
|
useragent: (ua: string, opts?: DeepOption) => Promise<Useragent>;
|
|
978
|
+
vin: (vin: string, opts?: DeepOption) => Promise<Vin>;
|
|
979
|
+
hts: ((code: string, opts?: {
|
|
980
|
+
origin?: string;
|
|
981
|
+
} & DeepOption) => Promise<Hts>) & {
|
|
982
|
+
search: (q: string) => Promise<HtsSearch>;
|
|
983
|
+
};
|
|
827
984
|
currency: ((code: string) => Promise<Currency>) & {
|
|
828
985
|
rate: (base: string, quote: string, opts?: {
|
|
829
986
|
date?: string;
|
|
@@ -867,4 +1024,4 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
867
1024
|
};
|
|
868
1025
|
type ParseAPIClient = ReturnType<typeof parseAPI>;
|
|
869
1026
|
|
|
870
|
-
export { type Bloc, type BlocCountries, type BlocCountryItem, type Caller, type Carrier, type City, type CityNearby, type CityNearest, type CitySearch, type Continent, type ContinentCountries, type ContinentCountryItem, type Country, type CountryStateItem, type CountryStates, type Currency, type CurrencyRate, type DateInfo, type Deep, type District, type Domain, type DomainDeep, type DomainRegistration, type Elevation, type Email, type EmailDeep, type Emoji, type EmojiSearch, type EmojiSkin, type Hlr, type Holiday, type HolidayDate, type HolidayYear, type Iban, type Ip, type IpDeep, type Language, type Mx, type MxRecord, type Name, type ParseAPIClient, ParseAPIError, type ParseAPIOptions, type Phone, type Point, type PointDeep, type Postal, type PostalDistance, type PostalDistanceEnd, type PostalNearby, type PostalNearbyItem, type State, type StateDistrictItem, type StateDistricts, type Timezone, type TimezoneConversionTarget, type TimezoneNextDst, type Useragent, type UseragentBrowserBrand, type UseragentBrowserDeep, type UseragentDeep, type UseragentDeviceDeep, type UseragentEngineDeep, type UseragentOsDeep, type Vat, type VatAddress, type VatDeep, type Weather, type WeatherAir, type WeatherAlert, type WeatherCurrent, type WeatherDay, type WeatherDeep, type WeatherForecastPeriod, type WeatherHistory, type WeatherHour, type WeatherMinute, type WeatherSource, type WeatherStation, parseAPI };
|
|
1027
|
+
export { type Bloc, type BlocCountries, type BlocCountryItem, type Caller, type Carrier, type City, type CityNearby, type CityNearest, type CitySearch, type Continent, type ContinentCountries, type ContinentCountryItem, type Country, type CountryStateItem, type CountryStates, type Currency, type CurrencyRate, type DateInfo, type Deep, type District, type Domain, type DomainDeep, type DomainRegistration, type Elevation, type Email, type EmailDeep, type Emoji, type EmojiSearch, type EmojiSkin, type Hlr, type Holiday, type HolidayDate, type HolidayYear, type Hts, type HtsDeep, type HtsMeasure, type HtsSearch, type HtsSearchHit, type Iban, type Ip, type IpDeep, type Language, type Mx, type MxRecord, type Name, type Npi, type NpiDeep, type NpiEnrollment, type ParseAPIClient, ParseAPIError, type ParseAPIOptions, type Phone, type Point, type PointDeep, type Postal, type PostalDistance, type PostalDistanceEnd, type PostalNearby, type PostalNearbyItem, type State, type StateDistrictItem, type StateDistricts, type Timezone, type TimezoneConversionTarget, type TimezoneNextDst, type Useragent, type UseragentBrowserBrand, type UseragentBrowserDeep, type UseragentDeep, type UseragentDeviceDeep, type UseragentEngineDeep, type UseragentOsDeep, type Vat, type VatAddress, type VatDeep, type Vin, type VinDeep, type VinRecall, type Weather, type WeatherAir, type WeatherAlert, type WeatherCurrent, type WeatherDay, type WeatherDeep, type WeatherForecastPeriod, type WeatherHistory, type WeatherHour, type WeatherMinute, type WeatherSource, type WeatherStation, parseAPI };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
var VERSION = "0.
|
|
2
|
+
var VERSION = "0.2.0";
|
|
3
3
|
var DEFAULT_BASE_URL = "https://api.parseapi.com";
|
|
4
4
|
var DEFAULT_TIMEOUT_MS = 1e4;
|
|
5
5
|
var DEFAULT_RETRIES = 2;
|
|
@@ -172,6 +172,7 @@ function parseAPI(apiKey, options = {}) {
|
|
|
172
172
|
...deepQuery(opts)
|
|
173
173
|
}),
|
|
174
174
|
iban: (iban, opts) => request(`/iban/${enc(iban)}`, { country: opts?.country }),
|
|
175
|
+
npi: (npi, opts) => request(`/npi/${enc(npi)}`, deepQuery(opts)),
|
|
175
176
|
phone: (number, opts) => request(`/phone/${enc(number)}`, { country: opts?.country, ...deepQuery(opts) }),
|
|
176
177
|
carrier: (number, opts) => request(`/carrier/${enc(number)}`, { country: opts?.country }),
|
|
177
178
|
caller: (number, opts) => request(`/caller/${enc(number)}`, { country: opts?.country }),
|
|
@@ -179,6 +180,13 @@ function parseAPI(apiKey, options = {}) {
|
|
|
179
180
|
domain: (domain, opts) => request(`/domain/${enc(domain)}`, deepQuery(opts)),
|
|
180
181
|
mx: (domain) => request(`/mx/${enc(domain)}`),
|
|
181
182
|
useragent: (ua, opts) => request("/useragent", deepQuery(opts), { "User-Agent": ua }),
|
|
183
|
+
vin: (vin, opts) => request(`/vin/${enc(vin)}`, deepQuery(opts)),
|
|
184
|
+
hts: Object.assign(
|
|
185
|
+
(code, opts) => request(`/hts/${enc(code)}`, { origin: opts?.origin, ...deepQuery(opts) }),
|
|
186
|
+
{
|
|
187
|
+
search: (q) => request("/hts", { q })
|
|
188
|
+
}
|
|
189
|
+
),
|
|
182
190
|
currency: Object.assign(
|
|
183
191
|
(code) => request(`/currency/${enc(code)}`),
|
|
184
192
|
{
|