@parseapi/sdk 1.1.0 → 1.3.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 +20 -2
- package/dist/index.cjs +6 -3
- package/dist/index.d.cts +46 -2
- package/dist/index.d.ts +46 -2
- package/dist/index.js +6 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ Get a key at [parseapi.com](https://parseapi.com). The client also reads `PARSEA
|
|
|
17
17
|
|
|
18
18
|
## API versions
|
|
19
19
|
|
|
20
|
-
Version 1.
|
|
20
|
+
Version 1.3.0 explicitly selects the API contract supported by this SDK. It sends `Parse-Version: 2.0.0` on every lookup so responses match the API contract supported by the package. Your key and the team's saved default stay the same.
|
|
21
21
|
|
|
22
22
|
Upgrade the dependency in staging, review the [release notes](https://parseapi.com/docs/releases), and test the application before deploying the same code and dependency version to production. Commit your dependency lockfile so the tested package travels with your deployment. Future major SDK upgrades can select a newer API contract.
|
|
23
23
|
|
|
@@ -210,7 +210,7 @@ Choose enrichment for the question you need answered.
|
|
|
210
210
|
|---|---|
|
|
211
211
|
| IP | Richer IP fields included with a paid plan. No separate check meter. |
|
|
212
212
|
| Domain | Registration dates, registrar, status and DNSSEC, included with a paid plan. Use `dns` for DNS records and `mx` for mail routing. |
|
|
213
|
-
| Email | A metered
|
|
213
|
+
| Email | A metered mailbox check with deliverability, catch-all, status, reason and address hints, using included email checks or enabled on-demand usage. |
|
|
214
214
|
| VAT | A metered registry check where supported, using included VAT checks or enabled on-demand usage. |
|
|
215
215
|
| Phone, Time, Date, Currency, Language, Emoji, IBAN, Point | Optional detail in the same pooled request on every plan. |
|
|
216
216
|
| Country, State, District, City, Postal | The place profile on paid plans, including demographic and tax facts where held. |
|
|
@@ -219,6 +219,10 @@ Choose enrichment for the question you need answered.
|
|
|
219
219
|
| Weather | Specialist current measurements and the existing forecast, alert, air and history bag on paid plans. |
|
|
220
220
|
| Carrier, HLR | Optional diagnostic detail within the same metered core unit, including Free allowance units. No second gate or additional check. |
|
|
221
221
|
|
|
222
|
+
Email deep includes mailbox status and the reason for the result, plus a suggested first name, no-reply flag, plus-address tag and mail service. The suggested name is not a verified identity. Unavailable details are null.
|
|
223
|
+
|
|
224
|
+
Reasons include `accepted`, `invalid_format`, `invalid_domain`, `no_mail_server`, `mailbox_not_found`, `mailbox_disabled`, `mailbox_full`, `catchall`, `disposable`, `temporary_failure`, `rejected` and `unconfirmed`.
|
|
225
|
+
|
|
222
226
|
Carrier, caller, and HLR are separate metered operations. Choose them explicitly when you need their answers. Ordinary lookups retry twice by default. Metered checks use one attempt by default. Setting retries explicitly can repeat paid usage.
|
|
223
227
|
|
|
224
228
|
Without `deep`, the response omits that key. When requested, it is an empty object if access is locked or the operation has no deep fields. Otherwise it contains the available fields. A missing or null field means unknown.
|
|
@@ -283,3 +287,17 @@ const basic = await parse.time('America/New_York');
|
|
|
283
287
|
const detail = await parse.time('America/New_York', { deep: true });
|
|
284
288
|
console.log(basic.at, detail.deep?.next_dst);
|
|
285
289
|
```
|
|
290
|
+
|
|
291
|
+
## Stack API
|
|
292
|
+
|
|
293
|
+
```typescript
|
|
294
|
+
const result = await parse.stack("example.com");
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Pass a public hostname without a scheme, path, port or IP address. Stack returns the checked URL and `checked_at` time, followed by `scope`, `pages` and `partial`. `scope` is `homepage` or `site`; `pages` counts successfully checked HTML pages. `partial` is true for homepage-only or incomplete bounded site checks. False means the known in-scope candidates were completed, not that every page on a website was visited. A homepage result has `scope: "homepage"`, `pages: 1` and `partial: true`.
|
|
298
|
+
|
|
299
|
+
`cms`, `servers`, `frameworks`, `ecommerce`, `analytics`, `chat`, `payments` and `hosting` are arrays because a site can use several technologies in each category. Each entry contains `technology`, `name` and nullable `version`. Technology codes are open strings. A successful check uses empty arrays for categories with no matches. When no HTML page could be checked, `checked_at` and all categories are null, `pages` is 0 and `partial` is null. Unknown or conflicting versions are null. Missing detections do not prove absence.
|
|
300
|
+
|
|
301
|
+
Successful checks may be reused for up to 24 hours. `pretty` optionally formats the wire JSON. Stack uses your plan's request allowance and API version 2.0.0 selected by this client.
|
|
302
|
+
|
|
303
|
+
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.
|
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 = "1.
|
|
27
|
+
var VERSION = "1.3.0";
|
|
28
28
|
var API_VERSION = "2.0.0";
|
|
29
29
|
var DEFAULT_BASE_URL = "https://api.parseapi.com";
|
|
30
30
|
var DEFAULT_TIMEOUT_MS = 1e4;
|
|
@@ -102,7 +102,8 @@ function parseAPI(apiKey, options = {}) {
|
|
|
102
102
|
throw new Error("parseAPI: missing API key. Pass one or set PARSEAPI_KEY.");
|
|
103
103
|
}
|
|
104
104
|
const baseUrl = (options.baseUrl ?? env("PARSEAPI_BASE_URL") ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
105
|
-
const
|
|
105
|
+
const configuredTimeoutMs = options.timeoutMs;
|
|
106
|
+
const timeoutMs = configuredTimeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
106
107
|
const configuredRetries = options.retries;
|
|
107
108
|
validateTimeout(timeoutMs);
|
|
108
109
|
validateRetries(configuredRetries);
|
|
@@ -110,7 +111,7 @@ function parseAPI(apiKey, options = {}) {
|
|
|
110
111
|
async function request(path, query, headers, controls = {}, json) {
|
|
111
112
|
const signal = controls.signal;
|
|
112
113
|
signal?.throwIfAborted();
|
|
113
|
-
const attemptTimeout = controls.timeoutMs ?? timeoutMs;
|
|
114
|
+
const attemptTimeout = controls.timeoutMs ?? configuredTimeoutMs ?? (path.startsWith("/stack/") ? 35e3 : timeoutMs);
|
|
114
115
|
const retries = controls.retries ?? configuredRetries ?? (metered(path, query) ? 0 : DEFAULT_RETRIES);
|
|
115
116
|
validateTimeout(attemptTimeout);
|
|
116
117
|
validateRetries(retries);
|
|
@@ -277,6 +278,8 @@ function parseAPI(apiKey, options = {}) {
|
|
|
277
278
|
caller: (number, opts) => request(`/caller/${enc(number)}`, { country: opts?.country }, void 0, opts),
|
|
278
279
|
/** Look up phone status at the last check. Live means assigned and connected means reachable at that check. Cached results may be returned. Null means unconfirmed. Deep adds network diagnostics within the same metered lookup. No automatic retries by default. */
|
|
279
280
|
hlr: (number, opts) => request(`/hlr/${enc(number)}`, { country: opts?.country, ...deepQuery(opts) }, void 0, opts),
|
|
281
|
+
/** Identify website technologies by category, with homepage or bounded site coverage metadata. */
|
|
282
|
+
stack: (domain, opts) => request(`/stack/${enc(domain)}`, { ...deepQuery(opts), pretty: opts?.pretty }, void 0, opts),
|
|
280
283
|
/** Check whether a domain is registered. Deep adds registration dates, registrar, status and DNSSEC on paid plans. */
|
|
281
284
|
domain: (domain, opts) => request(`/domain/${enc(domain)}`, deepQuery(opts), void 0, opts),
|
|
282
285
|
asn: (asn, opts) => request(`/asn/${enc(asn)}`, void 0, void 0, opts),
|
package/dist/index.d.cts
CHANGED
|
@@ -250,8 +250,19 @@ interface PostalDistance {
|
|
|
250
250
|
distance_mi: number;
|
|
251
251
|
}
|
|
252
252
|
interface EmailDeep {
|
|
253
|
+
/** Suggested first name. Not a verified identity. */
|
|
254
|
+
first_name?: string | null;
|
|
255
|
+
no_reply?: boolean | null;
|
|
256
|
+
/** Plus-address tag, without the plus sign. */
|
|
257
|
+
tag?: string | null;
|
|
258
|
+
/** Mail service handling the address, such as Google or Microsoft. */
|
|
259
|
+
mail_provider?: string | null;
|
|
253
260
|
deliverable: boolean | null;
|
|
254
261
|
catchall: boolean | null;
|
|
262
|
+
/** Mailbox status: deliverable, undeliverable or risky. Null when unavailable. */
|
|
263
|
+
status?: string | null;
|
|
264
|
+
/** Why the address received this result, such as mailbox_full or mailbox_not_found. Null when unavailable. */
|
|
265
|
+
reason?: string | null;
|
|
255
266
|
}
|
|
256
267
|
interface Email {
|
|
257
268
|
email: string;
|
|
@@ -482,6 +493,33 @@ interface MxRecord {
|
|
|
482
493
|
priority: number;
|
|
483
494
|
host: string;
|
|
484
495
|
}
|
|
496
|
+
interface StackTechnology {
|
|
497
|
+
technology: string;
|
|
498
|
+
name: string;
|
|
499
|
+
version: string | null;
|
|
500
|
+
}
|
|
501
|
+
interface Stack {
|
|
502
|
+
domain: string;
|
|
503
|
+
url: string;
|
|
504
|
+
/** Time of the check, or null when no HTML page could be checked. */
|
|
505
|
+
checked_at: string | null;
|
|
506
|
+
scope: 'homepage' | 'site';
|
|
507
|
+
/** Number of successfully checked HTML pages. */
|
|
508
|
+
pages: number;
|
|
509
|
+
/** True for homepage-only or incomplete bounded checks; null when no HTML page could be checked. False never guarantees every page was visited. */
|
|
510
|
+
partial: boolean | null;
|
|
511
|
+
/** Collections are null when no HTML page could be checked and empty when no matches were found. */
|
|
512
|
+
cms: StackTechnology[] | null;
|
|
513
|
+
servers: StackTechnology[] | null;
|
|
514
|
+
frameworks: StackTechnology[] | null;
|
|
515
|
+
ecommerce: StackTechnology[] | null;
|
|
516
|
+
analytics: StackTechnology[] | null;
|
|
517
|
+
chat: StackTechnology[] | null;
|
|
518
|
+
payments: StackTechnology[] | null;
|
|
519
|
+
hosting: StackTechnology[] | null;
|
|
520
|
+
/** Empty only when the generic deep compatibility flag was requested. */
|
|
521
|
+
deep?: Record<string, never>;
|
|
522
|
+
}
|
|
485
523
|
interface DomainRegistration {
|
|
486
524
|
registered: boolean;
|
|
487
525
|
created: string | null;
|
|
@@ -1366,7 +1404,7 @@ interface RequestOptions {
|
|
|
1366
1404
|
interface ParseAPIOptions {
|
|
1367
1405
|
/** Override https://api.parseapi.com (tests, canaries). Also read from PARSEAPI_BASE_URL. */
|
|
1368
1406
|
baseUrl?: string;
|
|
1369
|
-
/** Per-attempt timeout in milliseconds.
|
|
1407
|
+
/** Per-attempt timeout in milliseconds. Defaults to 35000 for Stack and 10000 otherwise. An explicit value applies to every operation. */
|
|
1370
1408
|
timeoutMs?: number;
|
|
1371
1409
|
/** Retries after the first attempt on network errors / 429 / 5xx. Default 2 for ordinary calls, 0 for paid checks. An explicit count overrides both. */
|
|
1372
1410
|
retries?: number;
|
|
@@ -1467,6 +1505,10 @@ type CallerOptions = {
|
|
|
1467
1505
|
type HlrOptions = {
|
|
1468
1506
|
country?: string;
|
|
1469
1507
|
} & DeepOption & RequestOptions;
|
|
1508
|
+
/** Public website hostname only. Optional formatting and request controls. */
|
|
1509
|
+
type StackOptions = {
|
|
1510
|
+
pretty?: boolean;
|
|
1511
|
+
} & DeepOption & RequestOptions;
|
|
1470
1512
|
type DomainOptions = DeepOption & RequestOptions;
|
|
1471
1513
|
type AsnOptions = LanguageOption & RequestOptions;
|
|
1472
1514
|
type MacOptions = RequestOptions;
|
|
@@ -1611,6 +1653,8 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
1611
1653
|
caller: (number: string, opts?: CallerOptions) => Promise<Caller>;
|
|
1612
1654
|
/** Look up phone status at the last check. Live means assigned and connected means reachable at that check. Cached results may be returned. Null means unconfirmed. Deep adds network diagnostics within the same metered lookup. No automatic retries by default. */
|
|
1613
1655
|
hlr: (number: string, opts?: HlrOptions) => Promise<Hlr>;
|
|
1656
|
+
/** Identify website technologies by category, with homepage or bounded site coverage metadata. */
|
|
1657
|
+
stack: (domain: string, opts?: StackOptions) => Promise<Stack>;
|
|
1614
1658
|
/** Check whether a domain is registered. Deep adds registration dates, registrar, status and DNSSEC on paid plans. */
|
|
1615
1659
|
domain: (domain: string, opts?: DomainOptions) => Promise<Domain>;
|
|
1616
1660
|
asn: (asn: string, opts?: AsnOptions) => Promise<Asn>;
|
|
@@ -1664,4 +1708,4 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
1664
1708
|
};
|
|
1665
1709
|
type ParseAPIClient = ReturnType<typeof parseAPI>;
|
|
1666
1710
|
|
|
1667
|
-
export { type Address, type AddressOptions, type AddressSearch, type AddressSearchOptions, type AddressSuggestion, type Asn, type AsnOptions, type Bin, type BinOptions, type Bloc, type BlocCountries, type BlocCountriesOptions, type BlocCountryItem, type BlocOptions, type Caller, type CallerOptions, 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 CompanyCountry, type CompanyDeep, type CompanyOptions, 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 ElevationOptions, type Email, type EmailDeep, type EmailOptions, type Emoji, type EmojiDeep, type EmojiOptions, type EmojiSearch, type EmojiSearchOptions, type EmojiSkin, type Hlr, type HlrDeep, type HlrOptions, type Holiday, type HolidayDate, type HolidayDateOptions, type HolidayOptions, type HolidayYear, type Iban, type IbanDeep, type IbanOptions, 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 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 RequestOptions, 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 TimeOptions, 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 Vin, type VinDeep, type VinOptions, type VinRecall, 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 };
|
|
1711
|
+
export { type Address, type AddressOptions, type AddressSearch, type AddressSearchOptions, type AddressSuggestion, type Asn, type AsnOptions, type Bin, type BinOptions, type Bloc, type BlocCountries, type BlocCountriesOptions, type BlocCountryItem, type BlocOptions, type Caller, type CallerOptions, 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 CompanyCountry, type CompanyDeep, type CompanyOptions, 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 ElevationOptions, type Email, type EmailDeep, type EmailOptions, type Emoji, type EmojiDeep, type EmojiOptions, type EmojiSearch, type EmojiSearchOptions, type EmojiSkin, type Hlr, type HlrDeep, type HlrOptions, type Holiday, type HolidayDate, type HolidayDateOptions, type HolidayOptions, type HolidayYear, type Iban, type IbanDeep, type IbanOptions, 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 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 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 TimeOptions, 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 Vin, type VinDeep, type VinOptions, type VinRecall, 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
|
@@ -250,8 +250,19 @@ interface PostalDistance {
|
|
|
250
250
|
distance_mi: number;
|
|
251
251
|
}
|
|
252
252
|
interface EmailDeep {
|
|
253
|
+
/** Suggested first name. Not a verified identity. */
|
|
254
|
+
first_name?: string | null;
|
|
255
|
+
no_reply?: boolean | null;
|
|
256
|
+
/** Plus-address tag, without the plus sign. */
|
|
257
|
+
tag?: string | null;
|
|
258
|
+
/** Mail service handling the address, such as Google or Microsoft. */
|
|
259
|
+
mail_provider?: string | null;
|
|
253
260
|
deliverable: boolean | null;
|
|
254
261
|
catchall: boolean | null;
|
|
262
|
+
/** Mailbox status: deliverable, undeliverable or risky. Null when unavailable. */
|
|
263
|
+
status?: string | null;
|
|
264
|
+
/** Why the address received this result, such as mailbox_full or mailbox_not_found. Null when unavailable. */
|
|
265
|
+
reason?: string | null;
|
|
255
266
|
}
|
|
256
267
|
interface Email {
|
|
257
268
|
email: string;
|
|
@@ -482,6 +493,33 @@ interface MxRecord {
|
|
|
482
493
|
priority: number;
|
|
483
494
|
host: string;
|
|
484
495
|
}
|
|
496
|
+
interface StackTechnology {
|
|
497
|
+
technology: string;
|
|
498
|
+
name: string;
|
|
499
|
+
version: string | null;
|
|
500
|
+
}
|
|
501
|
+
interface Stack {
|
|
502
|
+
domain: string;
|
|
503
|
+
url: string;
|
|
504
|
+
/** Time of the check, or null when no HTML page could be checked. */
|
|
505
|
+
checked_at: string | null;
|
|
506
|
+
scope: 'homepage' | 'site';
|
|
507
|
+
/** Number of successfully checked HTML pages. */
|
|
508
|
+
pages: number;
|
|
509
|
+
/** True for homepage-only or incomplete bounded checks; null when no HTML page could be checked. False never guarantees every page was visited. */
|
|
510
|
+
partial: boolean | null;
|
|
511
|
+
/** Collections are null when no HTML page could be checked and empty when no matches were found. */
|
|
512
|
+
cms: StackTechnology[] | null;
|
|
513
|
+
servers: StackTechnology[] | null;
|
|
514
|
+
frameworks: StackTechnology[] | null;
|
|
515
|
+
ecommerce: StackTechnology[] | null;
|
|
516
|
+
analytics: StackTechnology[] | null;
|
|
517
|
+
chat: StackTechnology[] | null;
|
|
518
|
+
payments: StackTechnology[] | null;
|
|
519
|
+
hosting: StackTechnology[] | null;
|
|
520
|
+
/** Empty only when the generic deep compatibility flag was requested. */
|
|
521
|
+
deep?: Record<string, never>;
|
|
522
|
+
}
|
|
485
523
|
interface DomainRegistration {
|
|
486
524
|
registered: boolean;
|
|
487
525
|
created: string | null;
|
|
@@ -1366,7 +1404,7 @@ interface RequestOptions {
|
|
|
1366
1404
|
interface ParseAPIOptions {
|
|
1367
1405
|
/** Override https://api.parseapi.com (tests, canaries). Also read from PARSEAPI_BASE_URL. */
|
|
1368
1406
|
baseUrl?: string;
|
|
1369
|
-
/** Per-attempt timeout in milliseconds.
|
|
1407
|
+
/** Per-attempt timeout in milliseconds. Defaults to 35000 for Stack and 10000 otherwise. An explicit value applies to every operation. */
|
|
1370
1408
|
timeoutMs?: number;
|
|
1371
1409
|
/** Retries after the first attempt on network errors / 429 / 5xx. Default 2 for ordinary calls, 0 for paid checks. An explicit count overrides both. */
|
|
1372
1410
|
retries?: number;
|
|
@@ -1467,6 +1505,10 @@ type CallerOptions = {
|
|
|
1467
1505
|
type HlrOptions = {
|
|
1468
1506
|
country?: string;
|
|
1469
1507
|
} & DeepOption & RequestOptions;
|
|
1508
|
+
/** Public website hostname only. Optional formatting and request controls. */
|
|
1509
|
+
type StackOptions = {
|
|
1510
|
+
pretty?: boolean;
|
|
1511
|
+
} & DeepOption & RequestOptions;
|
|
1470
1512
|
type DomainOptions = DeepOption & RequestOptions;
|
|
1471
1513
|
type AsnOptions = LanguageOption & RequestOptions;
|
|
1472
1514
|
type MacOptions = RequestOptions;
|
|
@@ -1611,6 +1653,8 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
1611
1653
|
caller: (number: string, opts?: CallerOptions) => Promise<Caller>;
|
|
1612
1654
|
/** Look up phone status at the last check. Live means assigned and connected means reachable at that check. Cached results may be returned. Null means unconfirmed. Deep adds network diagnostics within the same metered lookup. No automatic retries by default. */
|
|
1613
1655
|
hlr: (number: string, opts?: HlrOptions) => Promise<Hlr>;
|
|
1656
|
+
/** Identify website technologies by category, with homepage or bounded site coverage metadata. */
|
|
1657
|
+
stack: (domain: string, opts?: StackOptions) => Promise<Stack>;
|
|
1614
1658
|
/** Check whether a domain is registered. Deep adds registration dates, registrar, status and DNSSEC on paid plans. */
|
|
1615
1659
|
domain: (domain: string, opts?: DomainOptions) => Promise<Domain>;
|
|
1616
1660
|
asn: (asn: string, opts?: AsnOptions) => Promise<Asn>;
|
|
@@ -1664,4 +1708,4 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
|
|
|
1664
1708
|
};
|
|
1665
1709
|
type ParseAPIClient = ReturnType<typeof parseAPI>;
|
|
1666
1710
|
|
|
1667
|
-
export { type Address, type AddressOptions, type AddressSearch, type AddressSearchOptions, type AddressSuggestion, type Asn, type AsnOptions, type Bin, type BinOptions, type Bloc, type BlocCountries, type BlocCountriesOptions, type BlocCountryItem, type BlocOptions, type Caller, type CallerOptions, 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 CompanyCountry, type CompanyDeep, type CompanyOptions, 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 ElevationOptions, type Email, type EmailDeep, type EmailOptions, type Emoji, type EmojiDeep, type EmojiOptions, type EmojiSearch, type EmojiSearchOptions, type EmojiSkin, type Hlr, type HlrDeep, type HlrOptions, type Holiday, type HolidayDate, type HolidayDateOptions, type HolidayOptions, type HolidayYear, type Iban, type IbanDeep, type IbanOptions, 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 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 RequestOptions, 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 TimeOptions, 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 Vin, type VinDeep, type VinOptions, type VinRecall, 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 };
|
|
1711
|
+
export { type Address, type AddressOptions, type AddressSearch, type AddressSearchOptions, type AddressSuggestion, type Asn, type AsnOptions, type Bin, type BinOptions, type Bloc, type BlocCountries, type BlocCountriesOptions, type BlocCountryItem, type BlocOptions, type Caller, type CallerOptions, 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 CompanyCountry, type CompanyDeep, type CompanyOptions, 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 ElevationOptions, type Email, type EmailDeep, type EmailOptions, type Emoji, type EmojiDeep, type EmojiOptions, type EmojiSearch, type EmojiSearchOptions, type EmojiSkin, type Hlr, type HlrDeep, type HlrOptions, type Holiday, type HolidayDate, type HolidayDateOptions, type HolidayOptions, type HolidayYear, type Iban, type IbanDeep, type IbanOptions, 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 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 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 TimeOptions, 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 Vin, type VinDeep, type VinOptions, type VinRecall, 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
var VERSION = "1.
|
|
2
|
+
var VERSION = "1.3.0";
|
|
3
3
|
var API_VERSION = "2.0.0";
|
|
4
4
|
var DEFAULT_BASE_URL = "https://api.parseapi.com";
|
|
5
5
|
var DEFAULT_TIMEOUT_MS = 1e4;
|
|
@@ -77,7 +77,8 @@ function parseAPI(apiKey, options = {}) {
|
|
|
77
77
|
throw new Error("parseAPI: missing API key. Pass one or set PARSEAPI_KEY.");
|
|
78
78
|
}
|
|
79
79
|
const baseUrl = (options.baseUrl ?? env("PARSEAPI_BASE_URL") ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
80
|
-
const
|
|
80
|
+
const configuredTimeoutMs = options.timeoutMs;
|
|
81
|
+
const timeoutMs = configuredTimeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
81
82
|
const configuredRetries = options.retries;
|
|
82
83
|
validateTimeout(timeoutMs);
|
|
83
84
|
validateRetries(configuredRetries);
|
|
@@ -85,7 +86,7 @@ function parseAPI(apiKey, options = {}) {
|
|
|
85
86
|
async function request(path, query, headers, controls = {}, json) {
|
|
86
87
|
const signal = controls.signal;
|
|
87
88
|
signal?.throwIfAborted();
|
|
88
|
-
const attemptTimeout = controls.timeoutMs ?? timeoutMs;
|
|
89
|
+
const attemptTimeout = controls.timeoutMs ?? configuredTimeoutMs ?? (path.startsWith("/stack/") ? 35e3 : timeoutMs);
|
|
89
90
|
const retries = controls.retries ?? configuredRetries ?? (metered(path, query) ? 0 : DEFAULT_RETRIES);
|
|
90
91
|
validateTimeout(attemptTimeout);
|
|
91
92
|
validateRetries(retries);
|
|
@@ -252,6 +253,8 @@ function parseAPI(apiKey, options = {}) {
|
|
|
252
253
|
caller: (number, opts) => request(`/caller/${enc(number)}`, { country: opts?.country }, void 0, opts),
|
|
253
254
|
/** Look up phone status at the last check. Live means assigned and connected means reachable at that check. Cached results may be returned. Null means unconfirmed. Deep adds network diagnostics within the same metered lookup. No automatic retries by default. */
|
|
254
255
|
hlr: (number, opts) => request(`/hlr/${enc(number)}`, { country: opts?.country, ...deepQuery(opts) }, void 0, opts),
|
|
256
|
+
/** Identify website technologies by category, with homepage or bounded site coverage metadata. */
|
|
257
|
+
stack: (domain, opts) => request(`/stack/${enc(domain)}`, { ...deepQuery(opts), pretty: opts?.pretty }, void 0, opts),
|
|
255
258
|
/** Check whether a domain is registered. Deep adds registration dates, registrar, status and DNSSEC on paid plans. */
|
|
256
259
|
domain: (domain, opts) => request(`/domain/${enc(domain)}`, deepQuery(opts), void 0, opts),
|
|
257
260
|
asn: (asn, opts) => request(`/asn/${enc(asn)}`, void 0, void 0, opts),
|