@parseapi/sdk 0.1.3 → 0.2.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 +2 -0
- package/dist/index.cjs +9 -1
- package/dist/index.d.cts +190 -29
- package/dist/index.d.ts +190 -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.1
|
|
27
|
+
var VERSION = "0.2.1";
|
|
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
|
+
tariff: Object.assign(
|
|
210
|
+
(code, opts) => request(`/tariff/${enc(code)}`, { origin: opts?.origin, ...deepQuery(opts) }),
|
|
211
|
+
{
|
|
212
|
+
search: (q) => request("/tariff", { 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,156 @@ 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
|
+
/** Date CMS deactivated the NPI, YYYY-MM-DD. Null when still active. */
|
|
311
|
+
deactivated_at: string | null;
|
|
312
|
+
/** On the OIG exclusion list. */
|
|
313
|
+
excluded: boolean | null;
|
|
314
|
+
/** individual or organization. */
|
|
315
|
+
type: string | null;
|
|
316
|
+
name: string | null;
|
|
317
|
+
first: string | null;
|
|
318
|
+
last: string | null;
|
|
319
|
+
credential: string | null;
|
|
320
|
+
specialty: string | null;
|
|
321
|
+
/** NUCC taxonomy code. */
|
|
322
|
+
taxonomy: string | null;
|
|
323
|
+
address: string | null;
|
|
324
|
+
city: string | null;
|
|
325
|
+
state: string | null;
|
|
326
|
+
state_name: string | null;
|
|
327
|
+
postal: string | null;
|
|
328
|
+
country: string | null;
|
|
329
|
+
phone: string | null;
|
|
330
|
+
deep?: Deep<NpiDeep>;
|
|
331
|
+
}
|
|
332
|
+
interface NpiEnrollment {
|
|
333
|
+
/** part_a, part_b, practitioner, dme, order_refer, mdpp. Null when the code is unknown. */
|
|
334
|
+
type: string | null;
|
|
335
|
+
specialty: string | null;
|
|
336
|
+
state: string | null;
|
|
337
|
+
}
|
|
338
|
+
interface NpiDeep {
|
|
339
|
+
/** In the published Medicare FFS enrollment extract. */
|
|
340
|
+
medicare?: boolean | null;
|
|
341
|
+
/** On the CMS opt-out affidavit list. Matched by NPI only. */
|
|
342
|
+
opt_out?: boolean | null;
|
|
343
|
+
/** Enrollment rows. [] when medicare is false. */
|
|
344
|
+
enrollments?: NpiEnrollment[] | null;
|
|
345
|
+
}
|
|
346
|
+
interface HtsMeasure {
|
|
347
|
+
/** Chapter 99 heading, dotted (9903.01.24). */
|
|
348
|
+
heading: string;
|
|
349
|
+
/** The measure text verbatim. */
|
|
350
|
+
description: string;
|
|
351
|
+
/** The rate string verbatim ("The duty provided in the applicable subheading + 10%"). */
|
|
352
|
+
rate: string | null;
|
|
353
|
+
/** Effective from, ISO YYYY-MM-DD. Null when the schedule states none. */
|
|
354
|
+
from: string | null;
|
|
355
|
+
/** Expires, ISO YYYY-MM-DD. Null when open-ended. */
|
|
356
|
+
until: string | null;
|
|
357
|
+
}
|
|
358
|
+
interface HtsDeep {
|
|
359
|
+
/** The origin country the measures were resolved for. */
|
|
360
|
+
origin?: string | null;
|
|
361
|
+
/** Composed ad valorem percent. Null when the components do not compose cleanly. */
|
|
362
|
+
effective_rate?: number | null;
|
|
363
|
+
/** Every Chapter 99 tariff measure that applies to this code from this origin. */
|
|
364
|
+
measures?: HtsMeasure[] | null;
|
|
365
|
+
}
|
|
366
|
+
interface Hts {
|
|
367
|
+
/** Normalized code with dots (8471.30.01.00). */
|
|
368
|
+
hts: string;
|
|
369
|
+
/** The schedule line verbatim. */
|
|
370
|
+
description: string;
|
|
371
|
+
/** Parent descriptions from the schedule outline, outermost first. */
|
|
372
|
+
lineage: string[];
|
|
373
|
+
/** Units of quantity (No., kg). */
|
|
374
|
+
units: string[];
|
|
375
|
+
/** Column 1 general rate, verbatim. */
|
|
376
|
+
general: string | null;
|
|
377
|
+
/** Column 1 special rate, verbatim. */
|
|
378
|
+
special: string | null;
|
|
379
|
+
/** Column 2 rate, verbatim. */
|
|
380
|
+
other: string | null;
|
|
381
|
+
/** The official release that answered (2026HTSRev17). */
|
|
382
|
+
revision: string;
|
|
383
|
+
deep?: Deep<HtsDeep>;
|
|
384
|
+
}
|
|
385
|
+
interface HtsSearchHit {
|
|
386
|
+
hts: string;
|
|
387
|
+
description: string;
|
|
388
|
+
general: string | null;
|
|
389
|
+
}
|
|
390
|
+
interface HtsSearch {
|
|
391
|
+
q: string;
|
|
392
|
+
revision: string;
|
|
393
|
+
/** Up to 20 tariff lines, best match first. */
|
|
394
|
+
lines: HtsSearchHit[];
|
|
395
|
+
}
|
|
396
|
+
interface VinRecall {
|
|
397
|
+
/** Government campaign number. */
|
|
398
|
+
campaign: string;
|
|
399
|
+
/** Report date, ISO YYYY-MM-DD. */
|
|
400
|
+
date: string | null;
|
|
401
|
+
component: string | null;
|
|
402
|
+
/** The filed summary verbatim. */
|
|
403
|
+
summary: string | null;
|
|
404
|
+
}
|
|
405
|
+
interface VinDeep {
|
|
406
|
+
/** Open recall campaigns for the decoded vehicle. [] when none, null when the registry did not answer. */
|
|
407
|
+
recalls?: VinRecall[] | null;
|
|
408
|
+
}
|
|
409
|
+
interface Vin {
|
|
410
|
+
/** Normalized VIN, uppercase, no spaces. Invalid input still echoes the fold. */
|
|
411
|
+
vin: string | null;
|
|
412
|
+
valid: boolean;
|
|
413
|
+
year: number | null;
|
|
414
|
+
make: string | null;
|
|
415
|
+
model: string | null;
|
|
416
|
+
trim: string | null;
|
|
417
|
+
series: string | null;
|
|
418
|
+
/** Body style (sedan, coupe, suv, pickup). */
|
|
419
|
+
body: string | null;
|
|
420
|
+
/** Vehicle type (passenger car, truck, motorcycle, bus, trailer). */
|
|
421
|
+
type: string | null;
|
|
422
|
+
doors: number | null;
|
|
423
|
+
cylinders: number | null;
|
|
424
|
+
/** Engine displacement in liters. */
|
|
425
|
+
displacement: number | null;
|
|
426
|
+
fuel: string | null;
|
|
427
|
+
horsepower: number | null;
|
|
428
|
+
/** fwd, rwd, awd, 4wd. */
|
|
429
|
+
drive: string | null;
|
|
430
|
+
/** automatic, manual, cvt. */
|
|
431
|
+
transmission: string | null;
|
|
432
|
+
manufacturer: string | null;
|
|
433
|
+
plant_city: string | null;
|
|
434
|
+
plant_state: string | null;
|
|
435
|
+
plant_country: string | null;
|
|
436
|
+
/** Gross vehicle weight rating class as filed. */
|
|
437
|
+
gvwr: string | null;
|
|
438
|
+
deep?: Deep<VinDeep>;
|
|
439
|
+
}
|
|
288
440
|
interface Phone {
|
|
289
441
|
phone: string | null;
|
|
290
442
|
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
443
|
country: string | null;
|
|
297
|
-
|
|
298
|
-
|
|
444
|
+
/** What the numbering plan can see. Never voip (that is the carrier field's word). Null when invalid. */
|
|
445
|
+
type: 'mobile' | 'landline' | 'toll_free' | 'unknown' | null;
|
|
446
|
+
/** NPA-derived state code (US/CA). */
|
|
447
|
+
state: string | null;
|
|
448
|
+
state_name: string | null;
|
|
449
|
+
/** Numbering-plan IANA zone. Null when the prefix covers more than one zone, or invalid. Not the handset. */
|
|
450
|
+
timezone: string | null;
|
|
451
|
+
national: string | null;
|
|
452
|
+
international: string | null;
|
|
299
453
|
/** Always empty. The metered proves are their own endpoints: carrier, caller, hlr. */
|
|
300
454
|
deep?: Record<string, never>;
|
|
301
455
|
}
|
|
@@ -303,42 +457,42 @@ interface Carrier {
|
|
|
303
457
|
phone: string | null;
|
|
304
458
|
valid: boolean;
|
|
305
459
|
country: string | null;
|
|
306
|
-
/** The network's word, including voip.
|
|
307
|
-
type
|
|
460
|
+
/** The network's word, including voip. Null when invalid. */
|
|
461
|
+
type: 'mobile' | 'landline' | 'voip' | 'toll_free' | 'unknown' | null;
|
|
308
462
|
/** Current carrier display name. Null when the probe had no answer. */
|
|
309
|
-
carrier
|
|
463
|
+
carrier: string | null;
|
|
310
464
|
/** Carrier is a known burner number app. Null when carrier is unknown. */
|
|
311
|
-
burner
|
|
465
|
+
burner: boolean | null;
|
|
312
466
|
/** Issuing rate-center city. */
|
|
313
|
-
city
|
|
314
|
-
state
|
|
315
|
-
state_name
|
|
467
|
+
city: string | null;
|
|
468
|
+
state: string | null;
|
|
469
|
+
state_name: string | null;
|
|
316
470
|
}
|
|
317
471
|
interface Caller {
|
|
318
472
|
phone: string | null;
|
|
319
473
|
valid: boolean;
|
|
320
474
|
country: string | null;
|
|
321
|
-
/** CNAM record verbatim (all-caps telco artifact). Null when no record
|
|
322
|
-
caller
|
|
475
|
+
/** CNAM record verbatim (all-caps telco artifact). Null when no record, outside NANP, or invalid. */
|
|
476
|
+
caller: string | null;
|
|
323
477
|
}
|
|
324
478
|
interface Hlr {
|
|
325
479
|
phone: string | null;
|
|
326
480
|
valid: boolean;
|
|
327
481
|
country: string | null;
|
|
328
|
-
/** Assigned to a subscriber.
|
|
329
|
-
live
|
|
482
|
+
/** Assigned to a subscriber. Null when invalid. */
|
|
483
|
+
live: boolean | null;
|
|
330
484
|
/** Handset reachable right now. Null means unconfirmed, never no. */
|
|
331
|
-
connected
|
|
485
|
+
connected: boolean | null;
|
|
332
486
|
/** The six network extras fill on live HLR dips only. Null elsewhere (NANP, failover). */
|
|
333
|
-
roaming
|
|
334
|
-
roaming_network
|
|
487
|
+
roaming: boolean | null;
|
|
488
|
+
roaming_network: string | null;
|
|
335
489
|
/** ISO2, uppercase. */
|
|
336
|
-
roaming_country
|
|
490
|
+
roaming_country: string | null;
|
|
337
491
|
/** Current serving network name. */
|
|
338
|
-
network
|
|
339
|
-
original_network
|
|
340
|
-
mcc
|
|
341
|
-
mnc
|
|
492
|
+
network: string | null;
|
|
493
|
+
original_network: string | null;
|
|
494
|
+
mcc: string | null;
|
|
495
|
+
mnc: string | null;
|
|
342
496
|
}
|
|
343
497
|
interface MxRecord {
|
|
344
498
|
priority: number;
|
|
@@ -809,6 +963,7 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
809
963
|
iban: (iban: string, opts?: {
|
|
810
964
|
country?: string;
|
|
811
965
|
}) => Promise<Iban>;
|
|
966
|
+
npi: (npi: string, opts?: DeepOption) => Promise<Npi>;
|
|
812
967
|
phone: (number: string, opts?: {
|
|
813
968
|
country?: string;
|
|
814
969
|
} & DeepOption) => Promise<Phone>;
|
|
@@ -824,6 +979,12 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
824
979
|
domain: (domain: string, opts?: DeepOption) => Promise<Domain>;
|
|
825
980
|
mx: (domain: string) => Promise<Mx>;
|
|
826
981
|
useragent: (ua: string, opts?: DeepOption) => Promise<Useragent>;
|
|
982
|
+
vin: (vin: string, opts?: DeepOption) => Promise<Vin>;
|
|
983
|
+
tariff: ((code: string, opts?: {
|
|
984
|
+
origin?: string;
|
|
985
|
+
} & DeepOption) => Promise<Hts>) & {
|
|
986
|
+
search: (q: string) => Promise<HtsSearch>;
|
|
987
|
+
};
|
|
827
988
|
currency: ((code: string) => Promise<Currency>) & {
|
|
828
989
|
rate: (base: string, quote: string, opts?: {
|
|
829
990
|
date?: string;
|
|
@@ -867,4 +1028,4 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
867
1028
|
};
|
|
868
1029
|
type ParseAPIClient = ReturnType<typeof parseAPI>;
|
|
869
1030
|
|
|
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 };
|
|
1031
|
+
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,156 @@ 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
|
+
/** Date CMS deactivated the NPI, YYYY-MM-DD. Null when still active. */
|
|
311
|
+
deactivated_at: string | null;
|
|
312
|
+
/** On the OIG exclusion list. */
|
|
313
|
+
excluded: boolean | null;
|
|
314
|
+
/** individual or organization. */
|
|
315
|
+
type: string | null;
|
|
316
|
+
name: string | null;
|
|
317
|
+
first: string | null;
|
|
318
|
+
last: string | null;
|
|
319
|
+
credential: string | null;
|
|
320
|
+
specialty: string | null;
|
|
321
|
+
/** NUCC taxonomy code. */
|
|
322
|
+
taxonomy: string | null;
|
|
323
|
+
address: string | null;
|
|
324
|
+
city: string | null;
|
|
325
|
+
state: string | null;
|
|
326
|
+
state_name: string | null;
|
|
327
|
+
postal: string | null;
|
|
328
|
+
country: string | null;
|
|
329
|
+
phone: string | null;
|
|
330
|
+
deep?: Deep<NpiDeep>;
|
|
331
|
+
}
|
|
332
|
+
interface NpiEnrollment {
|
|
333
|
+
/** part_a, part_b, practitioner, dme, order_refer, mdpp. Null when the code is unknown. */
|
|
334
|
+
type: string | null;
|
|
335
|
+
specialty: string | null;
|
|
336
|
+
state: string | null;
|
|
337
|
+
}
|
|
338
|
+
interface NpiDeep {
|
|
339
|
+
/** In the published Medicare FFS enrollment extract. */
|
|
340
|
+
medicare?: boolean | null;
|
|
341
|
+
/** On the CMS opt-out affidavit list. Matched by NPI only. */
|
|
342
|
+
opt_out?: boolean | null;
|
|
343
|
+
/** Enrollment rows. [] when medicare is false. */
|
|
344
|
+
enrollments?: NpiEnrollment[] | null;
|
|
345
|
+
}
|
|
346
|
+
interface HtsMeasure {
|
|
347
|
+
/** Chapter 99 heading, dotted (9903.01.24). */
|
|
348
|
+
heading: string;
|
|
349
|
+
/** The measure text verbatim. */
|
|
350
|
+
description: string;
|
|
351
|
+
/** The rate string verbatim ("The duty provided in the applicable subheading + 10%"). */
|
|
352
|
+
rate: string | null;
|
|
353
|
+
/** Effective from, ISO YYYY-MM-DD. Null when the schedule states none. */
|
|
354
|
+
from: string | null;
|
|
355
|
+
/** Expires, ISO YYYY-MM-DD. Null when open-ended. */
|
|
356
|
+
until: string | null;
|
|
357
|
+
}
|
|
358
|
+
interface HtsDeep {
|
|
359
|
+
/** The origin country the measures were resolved for. */
|
|
360
|
+
origin?: string | null;
|
|
361
|
+
/** Composed ad valorem percent. Null when the components do not compose cleanly. */
|
|
362
|
+
effective_rate?: number | null;
|
|
363
|
+
/** Every Chapter 99 tariff measure that applies to this code from this origin. */
|
|
364
|
+
measures?: HtsMeasure[] | null;
|
|
365
|
+
}
|
|
366
|
+
interface Hts {
|
|
367
|
+
/** Normalized code with dots (8471.30.01.00). */
|
|
368
|
+
hts: string;
|
|
369
|
+
/** The schedule line verbatim. */
|
|
370
|
+
description: string;
|
|
371
|
+
/** Parent descriptions from the schedule outline, outermost first. */
|
|
372
|
+
lineage: string[];
|
|
373
|
+
/** Units of quantity (No., kg). */
|
|
374
|
+
units: string[];
|
|
375
|
+
/** Column 1 general rate, verbatim. */
|
|
376
|
+
general: string | null;
|
|
377
|
+
/** Column 1 special rate, verbatim. */
|
|
378
|
+
special: string | null;
|
|
379
|
+
/** Column 2 rate, verbatim. */
|
|
380
|
+
other: string | null;
|
|
381
|
+
/** The official release that answered (2026HTSRev17). */
|
|
382
|
+
revision: string;
|
|
383
|
+
deep?: Deep<HtsDeep>;
|
|
384
|
+
}
|
|
385
|
+
interface HtsSearchHit {
|
|
386
|
+
hts: string;
|
|
387
|
+
description: string;
|
|
388
|
+
general: string | null;
|
|
389
|
+
}
|
|
390
|
+
interface HtsSearch {
|
|
391
|
+
q: string;
|
|
392
|
+
revision: string;
|
|
393
|
+
/** Up to 20 tariff lines, best match first. */
|
|
394
|
+
lines: HtsSearchHit[];
|
|
395
|
+
}
|
|
396
|
+
interface VinRecall {
|
|
397
|
+
/** Government campaign number. */
|
|
398
|
+
campaign: string;
|
|
399
|
+
/** Report date, ISO YYYY-MM-DD. */
|
|
400
|
+
date: string | null;
|
|
401
|
+
component: string | null;
|
|
402
|
+
/** The filed summary verbatim. */
|
|
403
|
+
summary: string | null;
|
|
404
|
+
}
|
|
405
|
+
interface VinDeep {
|
|
406
|
+
/** Open recall campaigns for the decoded vehicle. [] when none, null when the registry did not answer. */
|
|
407
|
+
recalls?: VinRecall[] | null;
|
|
408
|
+
}
|
|
409
|
+
interface Vin {
|
|
410
|
+
/** Normalized VIN, uppercase, no spaces. Invalid input still echoes the fold. */
|
|
411
|
+
vin: string | null;
|
|
412
|
+
valid: boolean;
|
|
413
|
+
year: number | null;
|
|
414
|
+
make: string | null;
|
|
415
|
+
model: string | null;
|
|
416
|
+
trim: string | null;
|
|
417
|
+
series: string | null;
|
|
418
|
+
/** Body style (sedan, coupe, suv, pickup). */
|
|
419
|
+
body: string | null;
|
|
420
|
+
/** Vehicle type (passenger car, truck, motorcycle, bus, trailer). */
|
|
421
|
+
type: string | null;
|
|
422
|
+
doors: number | null;
|
|
423
|
+
cylinders: number | null;
|
|
424
|
+
/** Engine displacement in liters. */
|
|
425
|
+
displacement: number | null;
|
|
426
|
+
fuel: string | null;
|
|
427
|
+
horsepower: number | null;
|
|
428
|
+
/** fwd, rwd, awd, 4wd. */
|
|
429
|
+
drive: string | null;
|
|
430
|
+
/** automatic, manual, cvt. */
|
|
431
|
+
transmission: string | null;
|
|
432
|
+
manufacturer: string | null;
|
|
433
|
+
plant_city: string | null;
|
|
434
|
+
plant_state: string | null;
|
|
435
|
+
plant_country: string | null;
|
|
436
|
+
/** Gross vehicle weight rating class as filed. */
|
|
437
|
+
gvwr: string | null;
|
|
438
|
+
deep?: Deep<VinDeep>;
|
|
439
|
+
}
|
|
288
440
|
interface Phone {
|
|
289
441
|
phone: string | null;
|
|
290
442
|
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
443
|
country: string | null;
|
|
297
|
-
|
|
298
|
-
|
|
444
|
+
/** What the numbering plan can see. Never voip (that is the carrier field's word). Null when invalid. */
|
|
445
|
+
type: 'mobile' | 'landline' | 'toll_free' | 'unknown' | null;
|
|
446
|
+
/** NPA-derived state code (US/CA). */
|
|
447
|
+
state: string | null;
|
|
448
|
+
state_name: string | null;
|
|
449
|
+
/** Numbering-plan IANA zone. Null when the prefix covers more than one zone, or invalid. Not the handset. */
|
|
450
|
+
timezone: string | null;
|
|
451
|
+
national: string | null;
|
|
452
|
+
international: string | null;
|
|
299
453
|
/** Always empty. The metered proves are their own endpoints: carrier, caller, hlr. */
|
|
300
454
|
deep?: Record<string, never>;
|
|
301
455
|
}
|
|
@@ -303,42 +457,42 @@ interface Carrier {
|
|
|
303
457
|
phone: string | null;
|
|
304
458
|
valid: boolean;
|
|
305
459
|
country: string | null;
|
|
306
|
-
/** The network's word, including voip.
|
|
307
|
-
type
|
|
460
|
+
/** The network's word, including voip. Null when invalid. */
|
|
461
|
+
type: 'mobile' | 'landline' | 'voip' | 'toll_free' | 'unknown' | null;
|
|
308
462
|
/** Current carrier display name. Null when the probe had no answer. */
|
|
309
|
-
carrier
|
|
463
|
+
carrier: string | null;
|
|
310
464
|
/** Carrier is a known burner number app. Null when carrier is unknown. */
|
|
311
|
-
burner
|
|
465
|
+
burner: boolean | null;
|
|
312
466
|
/** Issuing rate-center city. */
|
|
313
|
-
city
|
|
314
|
-
state
|
|
315
|
-
state_name
|
|
467
|
+
city: string | null;
|
|
468
|
+
state: string | null;
|
|
469
|
+
state_name: string | null;
|
|
316
470
|
}
|
|
317
471
|
interface Caller {
|
|
318
472
|
phone: string | null;
|
|
319
473
|
valid: boolean;
|
|
320
474
|
country: string | null;
|
|
321
|
-
/** CNAM record verbatim (all-caps telco artifact). Null when no record
|
|
322
|
-
caller
|
|
475
|
+
/** CNAM record verbatim (all-caps telco artifact). Null when no record, outside NANP, or invalid. */
|
|
476
|
+
caller: string | null;
|
|
323
477
|
}
|
|
324
478
|
interface Hlr {
|
|
325
479
|
phone: string | null;
|
|
326
480
|
valid: boolean;
|
|
327
481
|
country: string | null;
|
|
328
|
-
/** Assigned to a subscriber.
|
|
329
|
-
live
|
|
482
|
+
/** Assigned to a subscriber. Null when invalid. */
|
|
483
|
+
live: boolean | null;
|
|
330
484
|
/** Handset reachable right now. Null means unconfirmed, never no. */
|
|
331
|
-
connected
|
|
485
|
+
connected: boolean | null;
|
|
332
486
|
/** The six network extras fill on live HLR dips only. Null elsewhere (NANP, failover). */
|
|
333
|
-
roaming
|
|
334
|
-
roaming_network
|
|
487
|
+
roaming: boolean | null;
|
|
488
|
+
roaming_network: string | null;
|
|
335
489
|
/** ISO2, uppercase. */
|
|
336
|
-
roaming_country
|
|
490
|
+
roaming_country: string | null;
|
|
337
491
|
/** Current serving network name. */
|
|
338
|
-
network
|
|
339
|
-
original_network
|
|
340
|
-
mcc
|
|
341
|
-
mnc
|
|
492
|
+
network: string | null;
|
|
493
|
+
original_network: string | null;
|
|
494
|
+
mcc: string | null;
|
|
495
|
+
mnc: string | null;
|
|
342
496
|
}
|
|
343
497
|
interface MxRecord {
|
|
344
498
|
priority: number;
|
|
@@ -809,6 +963,7 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
809
963
|
iban: (iban: string, opts?: {
|
|
810
964
|
country?: string;
|
|
811
965
|
}) => Promise<Iban>;
|
|
966
|
+
npi: (npi: string, opts?: DeepOption) => Promise<Npi>;
|
|
812
967
|
phone: (number: string, opts?: {
|
|
813
968
|
country?: string;
|
|
814
969
|
} & DeepOption) => Promise<Phone>;
|
|
@@ -824,6 +979,12 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
824
979
|
domain: (domain: string, opts?: DeepOption) => Promise<Domain>;
|
|
825
980
|
mx: (domain: string) => Promise<Mx>;
|
|
826
981
|
useragent: (ua: string, opts?: DeepOption) => Promise<Useragent>;
|
|
982
|
+
vin: (vin: string, opts?: DeepOption) => Promise<Vin>;
|
|
983
|
+
tariff: ((code: string, opts?: {
|
|
984
|
+
origin?: string;
|
|
985
|
+
} & DeepOption) => Promise<Hts>) & {
|
|
986
|
+
search: (q: string) => Promise<HtsSearch>;
|
|
987
|
+
};
|
|
827
988
|
currency: ((code: string) => Promise<Currency>) & {
|
|
828
989
|
rate: (base: string, quote: string, opts?: {
|
|
829
990
|
date?: string;
|
|
@@ -867,4 +1028,4 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
867
1028
|
};
|
|
868
1029
|
type ParseAPIClient = ReturnType<typeof parseAPI>;
|
|
869
1030
|
|
|
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 };
|
|
1031
|
+
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.1
|
|
2
|
+
var VERSION = "0.2.1";
|
|
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
|
+
tariff: Object.assign(
|
|
185
|
+
(code, opts) => request(`/tariff/${enc(code)}`, { origin: opts?.origin, ...deepQuery(opts) }),
|
|
186
|
+
{
|
|
187
|
+
search: (q) => request("/tariff", { q })
|
|
188
|
+
}
|
|
189
|
+
),
|
|
182
190
|
currency: Object.assign(
|
|
183
191
|
(code) => request(`/currency/${enc(code)}`),
|
|
184
192
|
{
|