@parseapi/sdk 1.8.0 → 1.10.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 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.7.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.
20
+ This SDK 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
 
@@ -80,6 +80,36 @@ behavior and does not inherit a previous request's choice.
80
80
 
81
81
  ## Calls
82
82
 
83
+ Search the company directory, then refetch an ID you have chosen:
84
+
85
+ ```ts
86
+ const candidates = await parse.company.search({ query: 'Cloudflare', country: 'US' });
87
+ // After the caller chooses a candidate, retain its id for later lookups.
88
+ const chosenId = 'co_xw3f22es6cjq';
89
+ const company = await parse.company.id(chosenId, { deep: true });
90
+ const coverage = await parse.company.coverage();
91
+ ```
92
+
93
+ Company search accepts at most one of `query`, `domain`, `ticker`, or `identifier`, or discovers candidates using country or exact industry filters.
94
+ Use `exchange` with a ticker, or `authority` with an identifier. `country`, `limit`
95
+ and the returned `next` cursor narrow or page the same search. Pass the cursor as
96
+ `cursor` with the same selector, filters and limit. Each result has its own
97
+ `match` and optional `deep`. The SDK returns all candidates without choosing one.
98
+ Directory methods accept `signal`, `timeoutMs` and `retries`, and omit `lang`.
99
+ Directory deep adds detail in the same pooled request on every plan.
100
+
101
+ Company directory social profiles contain `platform`, `url` and `handle`; unknown metadata stays null. Phone and email records use `type` for the source-reported purpose. Earlier response fields remain readable by the client.
102
+ Coverage describes the current directory edition. Empty listings do not establish
103
+ private ownership. Deep source entries attribute selected enrichment fields, and
104
+ logo URLs are returned without fetching images. The existing `company(number)`
105
+ call still parses national registration numbers and returns `Company`.
106
+
107
+ Discovery example: `await parse.company.search({ country: 'US', industry: '0700', industry_type: 'sic' });`
108
+
109
+ Supply `industry` and `industry_type` together. The supported namespace is `sic`, with an exact four-digit string such as `0700`; leading zeros are meaningful. Country-only discovery is also supported. Filters intersect and may narrow an existing selector. Country matches the profile country, not a headquarters or operating-presence claim. Unknown values do not match a requested filter. Filter-only candidates use `match.field: "filters"` and `match.value: null`; reuse the same filters and limit with a returned cursor. Counts describe this directory edition, not complete country coverage.
110
+
111
+
112
+
83
113
  One method per endpoint, named after the route.
84
114
 
85
115
  ```ts
@@ -101,6 +131,11 @@ await parse.postal.distance('28202', '10001', { country: 'US' });
101
131
  await parse.address('1600 Pennsylvania Ave NW, Washington DC', { country: 'US' });
102
132
  await parse.address.search('1600 Pennsylvania', { country: 'US', postal: '20500' });
103
133
  await parse.company('51 824 753 556', { country: 'AU' });
134
+ await parse.company.id('co_xw3f22es6cjq', { deep: true });
135
+ await parse.company.search({ domain: 'cloudflare.com' });
136
+ await parse.company.search({ ticker: 'NET', exchange: 'NYSE' });
137
+ await parse.company.search({ identifier: '0001477333', authority: 'SEC' });
138
+ await parse.company.coverage();
104
139
  await parse.city('charlotte', { country: 'US' });
105
140
  await parse.city.id('city_mb8mbqrkz8zb');
106
141
  await parse.city.search('char', { country: 'US', limit: 10 });
@@ -303,8 +338,8 @@ Choose enrichment for the question you need answered.
303
338
  | Phone, Time, Date, Currency, Language, Emoji, Bank, Point | Optional detail in the same pooled request on every plan. |
304
339
  | Country, State, District, City, Postal | The place profile on paid plans, including demographic and tax facts where held. |
305
340
  | Name, Industry | Name evidence or the industry definition profile on paid plans. |
306
- | NPI | Deactivation date, Medicare enrollment, opt-out and enrollment rows from stored sources on paid plans. Exclusion evidence stays core. |
307
- | Vehicle, Tariff, Company | The complete product detail bag on paid plans. |
341
+ | Vehicle, Tariff, Company (national number) | The complete product detail bag on paid plans. |
342
+ | Company directory | Profile detail in the same pooled request on every plan. Search detail belongs to each company result. |
308
343
  | Weather | Specialist current measurements and the existing forecast, alert, air and history bag on paid plans. |
309
344
  | Carrier, HLR | Optional diagnostic detail within the same metered core unit, including Free allowance units. No second gate or additional check. |
310
345
 
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.8.0";
27
+ var VERSION = "1.10.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;
@@ -58,6 +58,7 @@ function tariffSelection(result, opts) {
58
58
  }
59
59
  return result;
60
60
  }
61
+ var requestControls = (opts) => ({ signal: opts?.signal, timeoutMs: opts?.timeoutMs, retries: opts?.retries });
61
62
  function env(name) {
62
63
  return typeof process !== "undefined" ? process.env?.[name] : void 0;
63
64
  }
@@ -213,6 +214,16 @@ function parseAPI(apiKey, options = {}) {
213
214
  }
214
215
  );
215
216
  return {
217
+ /** Create a bounded task. Reuse the same request ID and inputs on retries. */
218
+ task: Object.assign(
219
+ (input, requestId, opts) => request("/task", void 0, { "Idempotency-Key": requestId }, opts, input),
220
+ {
221
+ get: (id, opts) => request(`/task/${enc(id)}`, void 0, void 0, opts),
222
+ cancel: (id, opts) => request(`/task/${enc(id)}/cancel`, void 0, void 0, opts, {}),
223
+ /** Reuse requestId with identical inputs to recover the saved result without another lookup or charge. */
224
+ lookup: (id, input, requestId, opts) => request(`/task/${enc(id)}/lookup`, void 0, { "Idempotency-Key": requestId }, opts, input)
225
+ }
226
+ ),
216
227
  /** Estimate task access, capacity and additional charges. Requires a secret key. Reserves no units or money and does not enforce the supplied budget. */
217
228
  preflight: (task, opts) => request("/preflight", void 0, void 0, opts, task),
218
229
  /** Look up an IP. `deep: true` adds enrichment included with a paid plan, without a separate check meter. */
@@ -284,7 +295,17 @@ function parseAPI(apiKey, options = {}) {
284
295
  search: (query, opts) => request("/address", { q: query, country: opts?.country, postal: opts?.postal, city: opts?.city, state: opts?.state, ip: opts?.ip }, void 0, opts)
285
296
  }
286
297
  ),
287
- company: (number, opts) => request(`/company/${enc(number)}`, { country: opts?.country, ...deepQuery(opts) }, void 0, opts),
298
+ company: Object.assign(
299
+ (number, opts) => request(`/company/${enc(number)}`, { country: opts?.country, ...deepQuery(opts) }, void 0, opts),
300
+ {
301
+ /** Look up a stable directory ID. Requested deep belongs to this profile. */
302
+ id: (id, opts) => request(`/company/id/${enc(id)}`, deepQuery(opts), void 0, requestControls(opts)),
303
+ /** Return candidates without selecting a match. Use one selector, country, exact industry, filters. */
304
+ search: (opts) => request("/company", { q: opts.query, domain: opts.domain, ticker: opts.ticker, identifier: opts.identifier, country: opts.country, industry: opts.industry, industry_type: opts.industry_type, exchange: opts.exchange, authority: opts.authority, limit: opts.limit, cursor: opts.cursor, ...deepQuery(opts) }, void 0, requestControls(opts)),
305
+ /** Describe the directory edition and its counts. Counts do not establish complete country coverage. */
306
+ coverage: (opts) => request("/company/directory/coverage", void 0, void 0, requestControls(opts))
307
+ }
308
+ ),
288
309
  /**
289
310
  * Parse an email and check its format and domain.
290
311
  * `deep: true` explicitly requests a metered deliverability check using included checks or enabled on-demand usage.
package/dist/index.d.cts CHANGED
@@ -1132,6 +1132,180 @@ interface Company {
1132
1132
  postal: string | null;
1133
1133
  deep?: Deep<CompanyDeep>;
1134
1134
  }
1135
+ /** Directory listing claims. Exchange and symbol remain separate from legal identifiers. */
1136
+ interface CompanyProfileListing {
1137
+ exchange: string;
1138
+ symbol: string;
1139
+ }
1140
+ interface CompanyProfileAddress {
1141
+ type: string;
1142
+ street: string | null;
1143
+ city: string | null;
1144
+ state: string | null;
1145
+ postal: string | null;
1146
+ country: string | null;
1147
+ }
1148
+ interface CompanyProfileJurisdiction {
1149
+ country: string | null;
1150
+ state: string | null;
1151
+ }
1152
+ interface CompanyProfileWebsite {
1153
+ domain: string;
1154
+ url: string | null;
1155
+ }
1156
+ interface CompanyProfileIdentifier {
1157
+ type: string;
1158
+ authority: string;
1159
+ value: string;
1160
+ }
1161
+ interface CompanyProfileIndustry {
1162
+ type: string;
1163
+ code: string;
1164
+ name: string | null;
1165
+ }
1166
+ /** Source-stated founding value. Precision is year, month, day, or a future open value. */
1167
+ interface CompanyProfileFounding {
1168
+ value: string;
1169
+ precision: string;
1170
+ }
1171
+ /** Reported workforce count for the stated basis, scope and measurement date. */
1172
+ interface CompanyProfileEmployees {
1173
+ count: number;
1174
+ as_of: string;
1175
+ /** Open string: headcount, full_time or full_time_equivalent. Older responses omit it. */
1176
+ basis?: string | null;
1177
+ /** Open string, currently legal_entity or consolidated_group. */
1178
+ scope: string;
1179
+ /** Open string, currently reported. */
1180
+ method: string;
1181
+ approximate: boolean;
1182
+ }
1183
+ /** Legal form recorded by a register; codes remain open strings. */
1184
+ interface CompanyProfileRegistrationLegalForm {
1185
+ code: string;
1186
+ name: string;
1187
+ }
1188
+ /** Source-recorded principal address. State and country_raw are not inferred ISO codes. */
1189
+ interface CompanyProfileRegistrationAddress {
1190
+ kind: string;
1191
+ line1: string | null;
1192
+ line2: string | null;
1193
+ city: string | null;
1194
+ state: string | null;
1195
+ postal: string | null;
1196
+ country_raw: string | null;
1197
+ }
1198
+ /** Registry-scoped legal facts; registration does not establish current operation or tax exemption. */
1199
+ interface CompanyProfileRegistration {
1200
+ authority: string;
1201
+ number: string;
1202
+ jurisdiction: CompanyProfileJurisdiction;
1203
+ role: string;
1204
+ legal_form: CompanyProfileRegistrationLegalForm;
1205
+ status: string;
1206
+ /** This register's reported entity-form date, not universal incorporation or founding. */
1207
+ formation_date: string | null;
1208
+ address: CompanyProfileRegistrationAddress | null;
1209
+ }
1210
+ /** Attribution for selected enrichment fields, not the whole company profile. */
1211
+ interface CompanyProfileSource {
1212
+ type: string;
1213
+ url: string;
1214
+ fields: string[];
1215
+ observed_at: string;
1216
+ /** Explicit source update timestamp or null; employee measurement dates remain in as_of. */
1217
+ updated_at: string | null;
1218
+ }
1219
+ /** Selected public business contacts. Purpose is source-reported or null. */
1220
+ interface CompanyProfilePhone {
1221
+ number: string;
1222
+ kind: string | null;
1223
+ }
1224
+ interface CompanyProfileEmail {
1225
+ address: string;
1226
+ kind: string | null;
1227
+ }
1228
+ /** An associated domain and its recorded URL, when known. */
1229
+ type CompanyProfileDomain = CompanyProfileWebsite;
1230
+ interface CompanySocialProfile {
1231
+ platform: string | null;
1232
+ url: string;
1233
+ handle: string | null;
1234
+ }
1235
+ interface CompanyPhoneNumber {
1236
+ number: string;
1237
+ type: string | null;
1238
+ }
1239
+ interface CompanyEmailAddress {
1240
+ address: string;
1241
+ type: string | null;
1242
+ }
1243
+ /** Directory detail, distinct from national-number CompanyDeep. Missing or null facts remain unknown. */
1244
+ interface CompanyProfileDeep {
1245
+ legal_name?: string | null;
1246
+ aliases?: string[] | null;
1247
+ jurisdiction?: CompanyProfileJurisdiction | null;
1248
+ status?: string | null;
1249
+ domains?: CompanyProfileDomain[] | null;
1250
+ social_profiles?: CompanySocialProfile[] | null;
1251
+ phone_numbers?: CompanyPhoneNumber[] | null;
1252
+ email_addresses?: CompanyEmailAddress[] | null;
1253
+ /** Earlier directory responses. */
1254
+ websites?: CompanyProfileWebsite[] | null;
1255
+ identifiers?: CompanyProfileIdentifier[] | null;
1256
+ incorporated?: string | null;
1257
+ addresses?: CompanyProfileAddress[] | null;
1258
+ industries?: CompanyProfileIndustry[] | null;
1259
+ parent?: string | null;
1260
+ description?: string | null;
1261
+ /** Returned asset URL only. The SDK does not fetch it. */
1262
+ logo?: string | null;
1263
+ socials?: string[] | null;
1264
+ phones?: CompanyProfilePhone[] | null;
1265
+ emails?: CompanyProfileEmail[] | null;
1266
+ /** Founding claim, distinct from legal incorporation. Year-only dates stay year-only. */
1267
+ founded?: CompanyProfileFounding | null;
1268
+ employees?: CompanyProfileEmployees | null;
1269
+ /** Empty means no admitted registration facts; older editions may omit this member. */
1270
+ registrations?: CompanyProfileRegistration[] | null;
1271
+ sources?: CompanyProfileSource[] | null;
1272
+ }
1273
+ interface CompanyProfile {
1274
+ id: string;
1275
+ name: string;
1276
+ country: string | null;
1277
+ website: string | null;
1278
+ listings: CompanyProfileListing[] | null;
1279
+ address: CompanyProfileAddress | null;
1280
+ deep?: Deep<CompanyProfileDeep>;
1281
+ }
1282
+ /** Why a candidate matched. Field/type/authority/exchange values remain extensible strings. */
1283
+ interface CompanyMatch {
1284
+ field?: string | null;
1285
+ value?: string | null;
1286
+ type?: string | null;
1287
+ authority?: string | null;
1288
+ exchange?: string | null;
1289
+ }
1290
+ interface CompanyCandidate extends CompanyProfile {
1291
+ match: CompanyMatch;
1292
+ }
1293
+ interface CompanySearch {
1294
+ companies: CompanyCandidate[];
1295
+ next: string | null;
1296
+ }
1297
+ /** Edition counts describe the records available, not all companies in a country. */
1298
+ interface CompanyCoverage {
1299
+ scope: string;
1300
+ label: string;
1301
+ description: string;
1302
+ snapshot_at: string;
1303
+ companies: number;
1304
+ countries: string[];
1305
+ with_website: number;
1306
+ with_listings: number;
1307
+ with_address: number;
1308
+ }
1135
1309
  /** A direct child industry code. */
1136
1310
  interface NaicsChild {
1137
1311
  naics: string;
@@ -1578,7 +1752,7 @@ interface IbanDeep {
1578
1752
 
1579
1753
  /** A proposed task contains operation counts, never lookup inputs. */
1580
1754
  interface PreflightOperation {
1581
- operation: 'email' | 'domain' | 'dns' | 'mx' | 'country';
1755
+ operation: 'email' | 'domain' | 'dns' | 'mx' | 'country' | 'vat' | 'carrier' | 'caller' | 'hlr' | 'ip' | 'phone' | 'postal';
1582
1756
  /** Positive integer, at most 100000. */
1583
1757
  count: number;
1584
1758
  deep?: boolean;
@@ -1659,6 +1833,16 @@ interface Preflight {
1659
1833
  operations: PreflightOperationEstimate[];
1660
1834
  cost: PreflightCost;
1661
1835
  capacity: {
1836
+ meters?: Record<string, {
1837
+ advisory: true;
1838
+ required_max: number;
1839
+ included_limit: number;
1840
+ reserved_at_snapshot: number | null;
1841
+ unallocated_included_at_snapshot: number | null;
1842
+ on_demand_enabled: boolean | null;
1843
+ on_demand_unit_price_usd: string | null;
1844
+ reset_at: number;
1845
+ }>;
1662
1846
  pooled_requests: PreflightPooledCapacity;
1663
1847
  email_verifications: PreflightEmailCapacity;
1664
1848
  shared_on_demand_spend: PreflightSpendCapacity;
@@ -1672,6 +1856,58 @@ interface Preflight {
1672
1856
  warnings: string[];
1673
1857
  }
1674
1858
 
1859
+ /** Additional-charge budget enforced only for lookups run through this task. */
1860
+ interface AgentTaskInput {
1861
+ operations: PreflightOperation[];
1862
+ budget_usd: string;
1863
+ }
1864
+ interface AgentTaskLookupInput {
1865
+ operation: PreflightOperation['operation'];
1866
+ value: string;
1867
+ deep?: boolean;
1868
+ country?: string;
1869
+ }
1870
+ interface AgentTask {
1871
+ id: string;
1872
+ status: string;
1873
+ api_version: string;
1874
+ created_at: string;
1875
+ expires_at: string;
1876
+ result_expires_at: string;
1877
+ budget: {
1878
+ currency: string;
1879
+ enforced: true;
1880
+ maximum_usd: string;
1881
+ spent_usd: string;
1882
+ reserved_usd: string;
1883
+ remaining_usd: string;
1884
+ };
1885
+ operations: {
1886
+ operation: string;
1887
+ deep: boolean;
1888
+ count: number;
1889
+ allocated: number;
1890
+ completed: number;
1891
+ remaining: number;
1892
+ }[];
1893
+ }
1894
+ /** Inspect status_code and result. Saved errors also replay without new usage. */
1895
+ interface AgentTaskResult<T = unknown> {
1896
+ status_code: number;
1897
+ result: T;
1898
+ receipt: {
1899
+ task_id: string;
1900
+ request_id: string;
1901
+ operation: string;
1902
+ deep: boolean;
1903
+ metered_unit: boolean;
1904
+ additional_cost_usd: string;
1905
+ checked_at: string;
1906
+ api_version: string;
1907
+ retry_after?: string;
1908
+ };
1909
+ }
1910
+
1675
1911
  /** Every non-2xx response from the API. Branch on `code`, never on `message`. */
1676
1912
  declare class ParseAPIError extends Error {
1677
1913
  /** HTTP status */
@@ -1776,6 +2012,30 @@ type AddressSearchOptions = {
1776
2012
  type CompanyOptions = LanguageOption & {
1777
2013
  country?: string;
1778
2014
  } & DeepOption & RequestOptions;
2015
+ /** Refetch a directory company by its stable co_ ID. */
2016
+ type CompanyIdOptions = DeepOption & RequestOptions;
2017
+ /** Choose at most one selector, or discover by country, exact industry. The API validates filters and cursors. */
2018
+ type CompanySearchOptions = {
2019
+ /** Company name search. Sent as q. */
2020
+ query?: string;
2021
+ domain?: string;
2022
+ ticker?: string;
2023
+ identifier?: string;
2024
+ /** ISO2 country filter. */
2025
+ country?: string;
2026
+ /** Exact four-digit SIC code string, preserving leading zeros. Requires industry_type. */
2027
+ industry?: string;
2028
+ /** Industry namespace; currently sic. Requires industry. */
2029
+ industry_type?: string;
2030
+ /** Exchange filter for ticker searches. */
2031
+ exchange?: string;
2032
+ /** Issuing authority filter for identifier searches. */
2033
+ authority?: string;
2034
+ limit?: number;
2035
+ /** Opaque next-page cursor. Keep the same selector and filters. */
2036
+ cursor?: string;
2037
+ } & DeepOption & RequestOptions;
2038
+ type CompanyCoverageOptions = RequestOptions;
1779
2039
  /** `deep: true` requests a metered deliverability check. No automatic retries by default. */
1780
2040
  type EmailOptions = DeepOption & RequestOptions;
1781
2041
  /** `deep: true` requests a metered registry check where supported. `from` is your own VAT number. */
@@ -1943,6 +2203,13 @@ interface DeepOption {
1943
2203
  deep?: boolean;
1944
2204
  }
1945
2205
  declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
2206
+ /** Create a bounded task. Reuse the same request ID and inputs on retries. */
2207
+ task: ((input: AgentTaskInput, requestId: string, opts?: RequestOptions) => Promise<AgentTask>) & {
2208
+ get: (id: string, opts?: RequestOptions) => Promise<AgentTask>;
2209
+ cancel: (id: string, opts?: RequestOptions) => Promise<AgentTask>;
2210
+ /** Reuse requestId with identical inputs to recover the saved result without another lookup or charge. */
2211
+ lookup: <T = unknown>(id: string, input: AgentTaskLookupInput, requestId: string, opts?: RequestOptions) => Promise<AgentTaskResult<T>>;
2212
+ };
1946
2213
  /** Estimate task access, capacity and additional charges. Requires a secret key. Reserves no units or money and does not enforce the supplied budget. */
1947
2214
  preflight: (task: PreflightTask, opts?: RequestOptions) => Promise<Preflight>;
1948
2215
  /** Look up an IP. `deep: true` adds enrichment included with a paid plan, without a separate check meter. */
@@ -1978,7 +2245,14 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
1978
2245
  /** Find address suggestions using the context supplied. Prefer postal, or city and state, from the form. ip is an optional end-user locality hint for server-side calls. An empty result has reason more_input, missing_context or no_matches. Suggestions have reason null. Operational failures are errors. */
1979
2246
  search: (query: string, opts?: AddressSearchOptions) => Promise<AddressSearch>;
1980
2247
  };
1981
- company: (number: string, opts?: CompanyOptions) => Promise<Company>;
2248
+ company: ((number: string, opts?: CompanyOptions) => Promise<Company>) & {
2249
+ /** Look up a stable directory ID. Requested deep belongs to this profile. */
2250
+ id: (id: string, opts?: CompanyIdOptions) => Promise<CompanyProfile>;
2251
+ /** Return candidates without selecting a match. Use one selector, country, exact industry, filters. */
2252
+ search: (opts: CompanySearchOptions) => Promise<CompanySearch>;
2253
+ /** Describe the directory edition and its counts. Counts do not establish complete country coverage. */
2254
+ coverage: (opts?: CompanyCoverageOptions) => Promise<CompanyCoverage>;
2255
+ };
1982
2256
  /**
1983
2257
  * Parse an email and check its format and domain.
1984
2258
  * `deep: true` explicitly requests a metered deliverability check using included checks or enabled on-demand usage.
@@ -2081,4 +2355,4 @@ type IbanOptions = {
2081
2355
  type NpiOptions = LanguageOption & DeepOption & RequestOptions;
2082
2356
  type BinOptions = DeepOption & RequestOptions;
2083
2357
 
2084
- export { type Address, type AddressOptions, type AddressSearch, type AddressSearchOptions, type AddressSuggestion, type Asn, type AsnOptions, type Bank, type BankChecks, type BankDeep, type BankDirectory, type BankIssue, type BankOptions, type BankRequirementField, type BankRequirements, type BankRequirementsOptions, type BankUsAch, type BankUsAchChecks, type BankUsAchInput, type Bin, type BinOptions, type Bloc, type BlocCountries, type BlocCountriesOptions, type BlocCountryItem, type BlocOptions, type Caller, type CallerOptions, type Card, type CardDeep, type CardOptions, type Carrier, type CarrierDeep, type CarrierOptions, type City, type CityDeep, type CityIdOptions, type CityNearby, type CityNearbyOptions, type CityNearest, type CityNearestOptions, type CityOptions, type CitySearch, type CitySearchOptions, type Company, type 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 ElevationLocations, 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 Industry, type IndustryChild, type IndustryCorrection, type IndustryDeep, type IndustryExclusion, type IndustryMatch, type IndustryOptions, type IndustrySearch, type IndustrySearchItem, type IndustrySearchOptions, type Ip, type IpDeep, type IpOptions, type IpSelfOptions, type Language, type LanguageDeep, type LanguageOption, type LanguageOptions, type Mac, type MacOptions, type Measure, type MeasureChoice, type MeasureOptions, type MeasureUnit, type MeasureUnits, type MeasureUnitsOptions, type Mx, type MxOptions, type MxRecord, type Naics, type NaicsChild, type NaicsCorrection, type NaicsDeep, type NaicsExclusion, type NaicsMatch, type NaicsOptions, type NaicsSearch, type NaicsSearchItem, type NaicsSearchOptions, type Name, type NameDeep, type NameOptions, type Npi, type NpiDeep, type NpiEnrollment, type NpiOptions, type ParseAPIClient, ParseAPIError, type ParseAPIOptions, type Phone, type PhoneDeep, type PhoneOptions, type Point, type PointCity, type PointDeep, type PointOptions, type Postal, type PostalDeep, type PostalDistance, type PostalDistanceEnd, type PostalDistanceOptions, type PostalLocality, type PostalMetro, type PostalMetrosDeep, type PostalNearby, type PostalNearbyItem, type PostalNearbyOptions, type PostalOptions, type Preflight, type PreflightCost, type PreflightEmailCapacity, type PreflightOperation, type PreflightOperationEstimate, type PreflightPooledCapacity, type PreflightSpendCapacity, type PreflightTask, type PropertyTax, type Provider, type ProviderDeep, type ProviderEnrollment, type ProviderOptions, type ProviderSource, type ProviderSources, type ProviderTaxonomy, type RequestOptions, type Stack, type StackOptions, type StackTechnology, type State, type StateDeep, type StateDistrictDeep, type StateDistrictItem, type StateDistricts, type StateDistrictsOptions, type StateOptions, type Tariff, type TariffDeep, type TariffMeasure, type TariffOptions, type TariffSearch, type TariffSearchHit, type TariffSearchOptions, type Time, type TimeAtOptions, type TimeLocation, type TimeLocationCandidate, type TimeLocationInput, type TimeOptions, type TimeResolution, type TimeResolutionAlternative, type TimeSeason, type TimeTransition, type TimeTransitionState, type TimeZoneEntry, type TimeZones, type TimeZonesOptions, type Timezone, type TimezoneAtOptions, type TimezoneConversionTarget, type TimezoneConversionTargetDeep, type TimezoneDeep, type TimezoneNextDst, type TimezoneOptions, type Useragent, type UseragentBrowserBrand, type UseragentBrowserDeep, type UseragentDeep, type UseragentDeviceDeep, type UseragentEngineDeep, type UseragentOptions, type UseragentOsDeep, type Vat, type VatAddress, type VatDeep, type VatOptions, type Vehicle, type VehicleDeep, type VehicleOptions, type VehicleRecall, 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 };
2358
+ export { type Address, type AddressOptions, type AddressSearch, type AddressSearchOptions, type AddressSuggestion, type AgentTask, type AgentTaskInput, type AgentTaskLookupInput, type AgentTaskResult, type Asn, type AsnOptions, type Bank, type BankChecks, type BankDeep, type BankDirectory, type BankIssue, type BankOptions, type BankRequirementField, type BankRequirements, type BankRequirementsOptions, type BankUsAch, type BankUsAchChecks, type BankUsAchInput, type Bin, type BinOptions, type Bloc, type BlocCountries, type BlocCountriesOptions, type BlocCountryItem, type BlocOptions, type Caller, type CallerOptions, type Card, type CardDeep, type CardOptions, type Carrier, type CarrierDeep, type CarrierOptions, type City, type CityDeep, type CityIdOptions, type CityNearby, type CityNearbyOptions, type CityNearest, type CityNearestOptions, type CityOptions, type CitySearch, type CitySearchOptions, type Company, type CompanyCandidate, type CompanyCountry, type CompanyCoverage, type CompanyCoverageOptions, type CompanyDeep, type CompanyEmailAddress, type CompanyIdOptions, type CompanyMatch, type CompanyOptions, type CompanyPhoneNumber, type CompanyProfile, type CompanyProfileAddress, type CompanyProfileDeep, type CompanyProfileDomain, type CompanyProfileEmail, type CompanyProfileEmployees, type CompanyProfileFounding, type CompanyProfileIdentifier, type CompanyProfileIndustry, type CompanyProfileJurisdiction, type CompanyProfileListing, type CompanyProfilePhone, type CompanyProfileRegistration, type CompanyProfileRegistrationAddress, type CompanyProfileRegistrationLegalForm, type CompanyProfileSource, type CompanyProfileWebsite, type CompanySearch, type CompanySearchOptions, type CompanySocialProfile, type Continent, type ContinentCountries, type ContinentCountriesOptions, type ContinentCountryItem, type ContinentOptions, type Country, type CountryDeep, type CountryElevationPoint, type CountryEmergency, type CountryOptions, type CountryStateItem, type CountryStates, type CountryStatesOptions, type Currency, type CurrencyDeep, type CurrencyOptions, type CurrencyRate, type CurrencyRateOptions, type DateInfo, type DateInfoDeep, type DateOptions, type DateTodayOptions, type Deep, type District, type DistrictDeep, type DistrictOptions, type Dns, type DnsOptions, type DnsRecord, type Domain, type DomainDeep, type DomainOptions, type DomainRegistration, type Elevation, type ElevationLocations, type ElevationOptions, type Email, type EmailDeep, type EmailOptions, type Emoji, type 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 Industry, type IndustryChild, type IndustryCorrection, type IndustryDeep, type IndustryExclusion, type IndustryMatch, type IndustryOptions, type IndustrySearch, type IndustrySearchItem, type IndustrySearchOptions, type Ip, type IpDeep, type IpOptions, type IpSelfOptions, type Language, type LanguageDeep, type LanguageOption, type LanguageOptions, type Mac, type MacOptions, type Measure, type MeasureChoice, type MeasureOptions, type MeasureUnit, type MeasureUnits, type MeasureUnitsOptions, type Mx, type MxOptions, type MxRecord, type Naics, type NaicsChild, type NaicsCorrection, type NaicsDeep, type NaicsExclusion, type NaicsMatch, type NaicsOptions, type NaicsSearch, type NaicsSearchItem, type NaicsSearchOptions, type Name, type NameDeep, type NameOptions, type Npi, type NpiDeep, type NpiEnrollment, type NpiOptions, type ParseAPIClient, ParseAPIError, type ParseAPIOptions, type Phone, type PhoneDeep, type PhoneOptions, type Point, type PointCity, type PointDeep, type PointOptions, type Postal, type PostalDeep, type PostalDistance, type PostalDistanceEnd, type PostalDistanceOptions, type PostalLocality, type PostalMetro, type PostalMetrosDeep, type PostalNearby, type PostalNearbyItem, type PostalNearbyOptions, type PostalOptions, type Preflight, type PreflightCost, type PreflightEmailCapacity, type PreflightOperation, type PreflightOperationEstimate, type PreflightPooledCapacity, type PreflightSpendCapacity, type PreflightTask, type PropertyTax, type Provider, type ProviderDeep, type ProviderEnrollment, type ProviderOptions, type ProviderSource, type ProviderSources, type ProviderTaxonomy, type RequestOptions, type Stack, type StackOptions, type StackTechnology, type State, type StateDeep, type StateDistrictDeep, type StateDistrictItem, type StateDistricts, type StateDistrictsOptions, type StateOptions, type Tariff, type TariffDeep, type TariffMeasure, type TariffOptions, type TariffSearch, type TariffSearchHit, type TariffSearchOptions, type Time, type TimeAtOptions, type TimeLocation, type TimeLocationCandidate, type TimeLocationInput, type TimeOptions, type TimeResolution, type TimeResolutionAlternative, type TimeSeason, type TimeTransition, type TimeTransitionState, type TimeZoneEntry, type TimeZones, type TimeZonesOptions, type Timezone, type TimezoneAtOptions, type TimezoneConversionTarget, type TimezoneConversionTargetDeep, type TimezoneDeep, type TimezoneNextDst, type TimezoneOptions, type Useragent, type UseragentBrowserBrand, type UseragentBrowserDeep, type UseragentDeep, type UseragentDeviceDeep, type UseragentEngineDeep, type UseragentOptions, type UseragentOsDeep, type Vat, type VatAddress, type VatDeep, type VatOptions, type Vehicle, type VehicleDeep, type VehicleOptions, type VehicleRecall, 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
@@ -1132,6 +1132,180 @@ interface Company {
1132
1132
  postal: string | null;
1133
1133
  deep?: Deep<CompanyDeep>;
1134
1134
  }
1135
+ /** Directory listing claims. Exchange and symbol remain separate from legal identifiers. */
1136
+ interface CompanyProfileListing {
1137
+ exchange: string;
1138
+ symbol: string;
1139
+ }
1140
+ interface CompanyProfileAddress {
1141
+ type: string;
1142
+ street: string | null;
1143
+ city: string | null;
1144
+ state: string | null;
1145
+ postal: string | null;
1146
+ country: string | null;
1147
+ }
1148
+ interface CompanyProfileJurisdiction {
1149
+ country: string | null;
1150
+ state: string | null;
1151
+ }
1152
+ interface CompanyProfileWebsite {
1153
+ domain: string;
1154
+ url: string | null;
1155
+ }
1156
+ interface CompanyProfileIdentifier {
1157
+ type: string;
1158
+ authority: string;
1159
+ value: string;
1160
+ }
1161
+ interface CompanyProfileIndustry {
1162
+ type: string;
1163
+ code: string;
1164
+ name: string | null;
1165
+ }
1166
+ /** Source-stated founding value. Precision is year, month, day, or a future open value. */
1167
+ interface CompanyProfileFounding {
1168
+ value: string;
1169
+ precision: string;
1170
+ }
1171
+ /** Reported workforce count for the stated basis, scope and measurement date. */
1172
+ interface CompanyProfileEmployees {
1173
+ count: number;
1174
+ as_of: string;
1175
+ /** Open string: headcount, full_time or full_time_equivalent. Older responses omit it. */
1176
+ basis?: string | null;
1177
+ /** Open string, currently legal_entity or consolidated_group. */
1178
+ scope: string;
1179
+ /** Open string, currently reported. */
1180
+ method: string;
1181
+ approximate: boolean;
1182
+ }
1183
+ /** Legal form recorded by a register; codes remain open strings. */
1184
+ interface CompanyProfileRegistrationLegalForm {
1185
+ code: string;
1186
+ name: string;
1187
+ }
1188
+ /** Source-recorded principal address. State and country_raw are not inferred ISO codes. */
1189
+ interface CompanyProfileRegistrationAddress {
1190
+ kind: string;
1191
+ line1: string | null;
1192
+ line2: string | null;
1193
+ city: string | null;
1194
+ state: string | null;
1195
+ postal: string | null;
1196
+ country_raw: string | null;
1197
+ }
1198
+ /** Registry-scoped legal facts; registration does not establish current operation or tax exemption. */
1199
+ interface CompanyProfileRegistration {
1200
+ authority: string;
1201
+ number: string;
1202
+ jurisdiction: CompanyProfileJurisdiction;
1203
+ role: string;
1204
+ legal_form: CompanyProfileRegistrationLegalForm;
1205
+ status: string;
1206
+ /** This register's reported entity-form date, not universal incorporation or founding. */
1207
+ formation_date: string | null;
1208
+ address: CompanyProfileRegistrationAddress | null;
1209
+ }
1210
+ /** Attribution for selected enrichment fields, not the whole company profile. */
1211
+ interface CompanyProfileSource {
1212
+ type: string;
1213
+ url: string;
1214
+ fields: string[];
1215
+ observed_at: string;
1216
+ /** Explicit source update timestamp or null; employee measurement dates remain in as_of. */
1217
+ updated_at: string | null;
1218
+ }
1219
+ /** Selected public business contacts. Purpose is source-reported or null. */
1220
+ interface CompanyProfilePhone {
1221
+ number: string;
1222
+ kind: string | null;
1223
+ }
1224
+ interface CompanyProfileEmail {
1225
+ address: string;
1226
+ kind: string | null;
1227
+ }
1228
+ /** An associated domain and its recorded URL, when known. */
1229
+ type CompanyProfileDomain = CompanyProfileWebsite;
1230
+ interface CompanySocialProfile {
1231
+ platform: string | null;
1232
+ url: string;
1233
+ handle: string | null;
1234
+ }
1235
+ interface CompanyPhoneNumber {
1236
+ number: string;
1237
+ type: string | null;
1238
+ }
1239
+ interface CompanyEmailAddress {
1240
+ address: string;
1241
+ type: string | null;
1242
+ }
1243
+ /** Directory detail, distinct from national-number CompanyDeep. Missing or null facts remain unknown. */
1244
+ interface CompanyProfileDeep {
1245
+ legal_name?: string | null;
1246
+ aliases?: string[] | null;
1247
+ jurisdiction?: CompanyProfileJurisdiction | null;
1248
+ status?: string | null;
1249
+ domains?: CompanyProfileDomain[] | null;
1250
+ social_profiles?: CompanySocialProfile[] | null;
1251
+ phone_numbers?: CompanyPhoneNumber[] | null;
1252
+ email_addresses?: CompanyEmailAddress[] | null;
1253
+ /** Earlier directory responses. */
1254
+ websites?: CompanyProfileWebsite[] | null;
1255
+ identifiers?: CompanyProfileIdentifier[] | null;
1256
+ incorporated?: string | null;
1257
+ addresses?: CompanyProfileAddress[] | null;
1258
+ industries?: CompanyProfileIndustry[] | null;
1259
+ parent?: string | null;
1260
+ description?: string | null;
1261
+ /** Returned asset URL only. The SDK does not fetch it. */
1262
+ logo?: string | null;
1263
+ socials?: string[] | null;
1264
+ phones?: CompanyProfilePhone[] | null;
1265
+ emails?: CompanyProfileEmail[] | null;
1266
+ /** Founding claim, distinct from legal incorporation. Year-only dates stay year-only. */
1267
+ founded?: CompanyProfileFounding | null;
1268
+ employees?: CompanyProfileEmployees | null;
1269
+ /** Empty means no admitted registration facts; older editions may omit this member. */
1270
+ registrations?: CompanyProfileRegistration[] | null;
1271
+ sources?: CompanyProfileSource[] | null;
1272
+ }
1273
+ interface CompanyProfile {
1274
+ id: string;
1275
+ name: string;
1276
+ country: string | null;
1277
+ website: string | null;
1278
+ listings: CompanyProfileListing[] | null;
1279
+ address: CompanyProfileAddress | null;
1280
+ deep?: Deep<CompanyProfileDeep>;
1281
+ }
1282
+ /** Why a candidate matched. Field/type/authority/exchange values remain extensible strings. */
1283
+ interface CompanyMatch {
1284
+ field?: string | null;
1285
+ value?: string | null;
1286
+ type?: string | null;
1287
+ authority?: string | null;
1288
+ exchange?: string | null;
1289
+ }
1290
+ interface CompanyCandidate extends CompanyProfile {
1291
+ match: CompanyMatch;
1292
+ }
1293
+ interface CompanySearch {
1294
+ companies: CompanyCandidate[];
1295
+ next: string | null;
1296
+ }
1297
+ /** Edition counts describe the records available, not all companies in a country. */
1298
+ interface CompanyCoverage {
1299
+ scope: string;
1300
+ label: string;
1301
+ description: string;
1302
+ snapshot_at: string;
1303
+ companies: number;
1304
+ countries: string[];
1305
+ with_website: number;
1306
+ with_listings: number;
1307
+ with_address: number;
1308
+ }
1135
1309
  /** A direct child industry code. */
1136
1310
  interface NaicsChild {
1137
1311
  naics: string;
@@ -1578,7 +1752,7 @@ interface IbanDeep {
1578
1752
 
1579
1753
  /** A proposed task contains operation counts, never lookup inputs. */
1580
1754
  interface PreflightOperation {
1581
- operation: 'email' | 'domain' | 'dns' | 'mx' | 'country';
1755
+ operation: 'email' | 'domain' | 'dns' | 'mx' | 'country' | 'vat' | 'carrier' | 'caller' | 'hlr' | 'ip' | 'phone' | 'postal';
1582
1756
  /** Positive integer, at most 100000. */
1583
1757
  count: number;
1584
1758
  deep?: boolean;
@@ -1659,6 +1833,16 @@ interface Preflight {
1659
1833
  operations: PreflightOperationEstimate[];
1660
1834
  cost: PreflightCost;
1661
1835
  capacity: {
1836
+ meters?: Record<string, {
1837
+ advisory: true;
1838
+ required_max: number;
1839
+ included_limit: number;
1840
+ reserved_at_snapshot: number | null;
1841
+ unallocated_included_at_snapshot: number | null;
1842
+ on_demand_enabled: boolean | null;
1843
+ on_demand_unit_price_usd: string | null;
1844
+ reset_at: number;
1845
+ }>;
1662
1846
  pooled_requests: PreflightPooledCapacity;
1663
1847
  email_verifications: PreflightEmailCapacity;
1664
1848
  shared_on_demand_spend: PreflightSpendCapacity;
@@ -1672,6 +1856,58 @@ interface Preflight {
1672
1856
  warnings: string[];
1673
1857
  }
1674
1858
 
1859
+ /** Additional-charge budget enforced only for lookups run through this task. */
1860
+ interface AgentTaskInput {
1861
+ operations: PreflightOperation[];
1862
+ budget_usd: string;
1863
+ }
1864
+ interface AgentTaskLookupInput {
1865
+ operation: PreflightOperation['operation'];
1866
+ value: string;
1867
+ deep?: boolean;
1868
+ country?: string;
1869
+ }
1870
+ interface AgentTask {
1871
+ id: string;
1872
+ status: string;
1873
+ api_version: string;
1874
+ created_at: string;
1875
+ expires_at: string;
1876
+ result_expires_at: string;
1877
+ budget: {
1878
+ currency: string;
1879
+ enforced: true;
1880
+ maximum_usd: string;
1881
+ spent_usd: string;
1882
+ reserved_usd: string;
1883
+ remaining_usd: string;
1884
+ };
1885
+ operations: {
1886
+ operation: string;
1887
+ deep: boolean;
1888
+ count: number;
1889
+ allocated: number;
1890
+ completed: number;
1891
+ remaining: number;
1892
+ }[];
1893
+ }
1894
+ /** Inspect status_code and result. Saved errors also replay without new usage. */
1895
+ interface AgentTaskResult<T = unknown> {
1896
+ status_code: number;
1897
+ result: T;
1898
+ receipt: {
1899
+ task_id: string;
1900
+ request_id: string;
1901
+ operation: string;
1902
+ deep: boolean;
1903
+ metered_unit: boolean;
1904
+ additional_cost_usd: string;
1905
+ checked_at: string;
1906
+ api_version: string;
1907
+ retry_after?: string;
1908
+ };
1909
+ }
1910
+
1675
1911
  /** Every non-2xx response from the API. Branch on `code`, never on `message`. */
1676
1912
  declare class ParseAPIError extends Error {
1677
1913
  /** HTTP status */
@@ -1776,6 +2012,30 @@ type AddressSearchOptions = {
1776
2012
  type CompanyOptions = LanguageOption & {
1777
2013
  country?: string;
1778
2014
  } & DeepOption & RequestOptions;
2015
+ /** Refetch a directory company by its stable co_ ID. */
2016
+ type CompanyIdOptions = DeepOption & RequestOptions;
2017
+ /** Choose at most one selector, or discover by country, exact industry. The API validates filters and cursors. */
2018
+ type CompanySearchOptions = {
2019
+ /** Company name search. Sent as q. */
2020
+ query?: string;
2021
+ domain?: string;
2022
+ ticker?: string;
2023
+ identifier?: string;
2024
+ /** ISO2 country filter. */
2025
+ country?: string;
2026
+ /** Exact four-digit SIC code string, preserving leading zeros. Requires industry_type. */
2027
+ industry?: string;
2028
+ /** Industry namespace; currently sic. Requires industry. */
2029
+ industry_type?: string;
2030
+ /** Exchange filter for ticker searches. */
2031
+ exchange?: string;
2032
+ /** Issuing authority filter for identifier searches. */
2033
+ authority?: string;
2034
+ limit?: number;
2035
+ /** Opaque next-page cursor. Keep the same selector and filters. */
2036
+ cursor?: string;
2037
+ } & DeepOption & RequestOptions;
2038
+ type CompanyCoverageOptions = RequestOptions;
1779
2039
  /** `deep: true` requests a metered deliverability check. No automatic retries by default. */
1780
2040
  type EmailOptions = DeepOption & RequestOptions;
1781
2041
  /** `deep: true` requests a metered registry check where supported. `from` is your own VAT number. */
@@ -1943,6 +2203,13 @@ interface DeepOption {
1943
2203
  deep?: boolean;
1944
2204
  }
1945
2205
  declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
2206
+ /** Create a bounded task. Reuse the same request ID and inputs on retries. */
2207
+ task: ((input: AgentTaskInput, requestId: string, opts?: RequestOptions) => Promise<AgentTask>) & {
2208
+ get: (id: string, opts?: RequestOptions) => Promise<AgentTask>;
2209
+ cancel: (id: string, opts?: RequestOptions) => Promise<AgentTask>;
2210
+ /** Reuse requestId with identical inputs to recover the saved result without another lookup or charge. */
2211
+ lookup: <T = unknown>(id: string, input: AgentTaskLookupInput, requestId: string, opts?: RequestOptions) => Promise<AgentTaskResult<T>>;
2212
+ };
1946
2213
  /** Estimate task access, capacity and additional charges. Requires a secret key. Reserves no units or money and does not enforce the supplied budget. */
1947
2214
  preflight: (task: PreflightTask, opts?: RequestOptions) => Promise<Preflight>;
1948
2215
  /** Look up an IP. `deep: true` adds enrichment included with a paid plan, without a separate check meter. */
@@ -1978,7 +2245,14 @@ declare function parseAPI(apiKey?: string, options?: ParseAPIOptions): {
1978
2245
  /** Find address suggestions using the context supplied. Prefer postal, or city and state, from the form. ip is an optional end-user locality hint for server-side calls. An empty result has reason more_input, missing_context or no_matches. Suggestions have reason null. Operational failures are errors. */
1979
2246
  search: (query: string, opts?: AddressSearchOptions) => Promise<AddressSearch>;
1980
2247
  };
1981
- company: (number: string, opts?: CompanyOptions) => Promise<Company>;
2248
+ company: ((number: string, opts?: CompanyOptions) => Promise<Company>) & {
2249
+ /** Look up a stable directory ID. Requested deep belongs to this profile. */
2250
+ id: (id: string, opts?: CompanyIdOptions) => Promise<CompanyProfile>;
2251
+ /** Return candidates without selecting a match. Use one selector, country, exact industry, filters. */
2252
+ search: (opts: CompanySearchOptions) => Promise<CompanySearch>;
2253
+ /** Describe the directory edition and its counts. Counts do not establish complete country coverage. */
2254
+ coverage: (opts?: CompanyCoverageOptions) => Promise<CompanyCoverage>;
2255
+ };
1982
2256
  /**
1983
2257
  * Parse an email and check its format and domain.
1984
2258
  * `deep: true` explicitly requests a metered deliverability check using included checks or enabled on-demand usage.
@@ -2081,4 +2355,4 @@ type IbanOptions = {
2081
2355
  type NpiOptions = LanguageOption & DeepOption & RequestOptions;
2082
2356
  type BinOptions = DeepOption & RequestOptions;
2083
2357
 
2084
- export { type Address, type AddressOptions, type AddressSearch, type AddressSearchOptions, type AddressSuggestion, type Asn, type AsnOptions, type Bank, type BankChecks, type BankDeep, type BankDirectory, type BankIssue, type BankOptions, type BankRequirementField, type BankRequirements, type BankRequirementsOptions, type BankUsAch, type BankUsAchChecks, type BankUsAchInput, type Bin, type BinOptions, type Bloc, type BlocCountries, type BlocCountriesOptions, type BlocCountryItem, type BlocOptions, type Caller, type CallerOptions, type Card, type CardDeep, type CardOptions, type Carrier, type CarrierDeep, type CarrierOptions, type City, type CityDeep, type CityIdOptions, type CityNearby, type CityNearbyOptions, type CityNearest, type CityNearestOptions, type CityOptions, type CitySearch, type CitySearchOptions, type Company, type 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 ElevationLocations, 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 Industry, type IndustryChild, type IndustryCorrection, type IndustryDeep, type IndustryExclusion, type IndustryMatch, type IndustryOptions, type IndustrySearch, type IndustrySearchItem, type IndustrySearchOptions, type Ip, type IpDeep, type IpOptions, type IpSelfOptions, type Language, type LanguageDeep, type LanguageOption, type LanguageOptions, type Mac, type MacOptions, type Measure, type MeasureChoice, type MeasureOptions, type MeasureUnit, type MeasureUnits, type MeasureUnitsOptions, type Mx, type MxOptions, type MxRecord, type Naics, type NaicsChild, type NaicsCorrection, type NaicsDeep, type NaicsExclusion, type NaicsMatch, type NaicsOptions, type NaicsSearch, type NaicsSearchItem, type NaicsSearchOptions, type Name, type NameDeep, type NameOptions, type Npi, type NpiDeep, type NpiEnrollment, type NpiOptions, type ParseAPIClient, ParseAPIError, type ParseAPIOptions, type Phone, type PhoneDeep, type PhoneOptions, type Point, type PointCity, type PointDeep, type PointOptions, type Postal, type PostalDeep, type PostalDistance, type PostalDistanceEnd, type PostalDistanceOptions, type PostalLocality, type PostalMetro, type PostalMetrosDeep, type PostalNearby, type PostalNearbyItem, type PostalNearbyOptions, type PostalOptions, type Preflight, type PreflightCost, type PreflightEmailCapacity, type PreflightOperation, type PreflightOperationEstimate, type PreflightPooledCapacity, type PreflightSpendCapacity, type PreflightTask, type PropertyTax, type Provider, type ProviderDeep, type ProviderEnrollment, type ProviderOptions, type ProviderSource, type ProviderSources, type ProviderTaxonomy, type RequestOptions, type Stack, type StackOptions, type StackTechnology, type State, type StateDeep, type StateDistrictDeep, type StateDistrictItem, type StateDistricts, type StateDistrictsOptions, type StateOptions, type Tariff, type TariffDeep, type TariffMeasure, type TariffOptions, type TariffSearch, type TariffSearchHit, type TariffSearchOptions, type Time, type TimeAtOptions, type TimeLocation, type TimeLocationCandidate, type TimeLocationInput, type TimeOptions, type TimeResolution, type TimeResolutionAlternative, type TimeSeason, type TimeTransition, type TimeTransitionState, type TimeZoneEntry, type TimeZones, type TimeZonesOptions, type Timezone, type TimezoneAtOptions, type TimezoneConversionTarget, type TimezoneConversionTargetDeep, type TimezoneDeep, type TimezoneNextDst, type TimezoneOptions, type Useragent, type UseragentBrowserBrand, type UseragentBrowserDeep, type UseragentDeep, type UseragentDeviceDeep, type UseragentEngineDeep, type UseragentOptions, type UseragentOsDeep, type Vat, type VatAddress, type VatDeep, type VatOptions, type Vehicle, type VehicleDeep, type VehicleOptions, type VehicleRecall, 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 };
2358
+ export { type Address, type AddressOptions, type AddressSearch, type AddressSearchOptions, type AddressSuggestion, type AgentTask, type AgentTaskInput, type AgentTaskLookupInput, type AgentTaskResult, type Asn, type AsnOptions, type Bank, type BankChecks, type BankDeep, type BankDirectory, type BankIssue, type BankOptions, type BankRequirementField, type BankRequirements, type BankRequirementsOptions, type BankUsAch, type BankUsAchChecks, type BankUsAchInput, type Bin, type BinOptions, type Bloc, type BlocCountries, type BlocCountriesOptions, type BlocCountryItem, type BlocOptions, type Caller, type CallerOptions, type Card, type CardDeep, type CardOptions, type Carrier, type CarrierDeep, type CarrierOptions, type City, type CityDeep, type CityIdOptions, type CityNearby, type CityNearbyOptions, type CityNearest, type CityNearestOptions, type CityOptions, type CitySearch, type CitySearchOptions, type Company, type CompanyCandidate, type CompanyCountry, type CompanyCoverage, type CompanyCoverageOptions, type CompanyDeep, type CompanyEmailAddress, type CompanyIdOptions, type CompanyMatch, type CompanyOptions, type CompanyPhoneNumber, type CompanyProfile, type CompanyProfileAddress, type CompanyProfileDeep, type CompanyProfileDomain, type CompanyProfileEmail, type CompanyProfileEmployees, type CompanyProfileFounding, type CompanyProfileIdentifier, type CompanyProfileIndustry, type CompanyProfileJurisdiction, type CompanyProfileListing, type CompanyProfilePhone, type CompanyProfileRegistration, type CompanyProfileRegistrationAddress, type CompanyProfileRegistrationLegalForm, type CompanyProfileSource, type CompanyProfileWebsite, type CompanySearch, type CompanySearchOptions, type CompanySocialProfile, type Continent, type ContinentCountries, type ContinentCountriesOptions, type ContinentCountryItem, type ContinentOptions, type Country, type CountryDeep, type CountryElevationPoint, type CountryEmergency, type CountryOptions, type CountryStateItem, type CountryStates, type CountryStatesOptions, type Currency, type CurrencyDeep, type CurrencyOptions, type CurrencyRate, type CurrencyRateOptions, type DateInfo, type DateInfoDeep, type DateOptions, type DateTodayOptions, type Deep, type District, type DistrictDeep, type DistrictOptions, type Dns, type DnsOptions, type DnsRecord, type Domain, type DomainDeep, type DomainOptions, type DomainRegistration, type Elevation, type ElevationLocations, type ElevationOptions, type Email, type EmailDeep, type EmailOptions, type Emoji, type 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 Industry, type IndustryChild, type IndustryCorrection, type IndustryDeep, type IndustryExclusion, type IndustryMatch, type IndustryOptions, type IndustrySearch, type IndustrySearchItem, type IndustrySearchOptions, type Ip, type IpDeep, type IpOptions, type IpSelfOptions, type Language, type LanguageDeep, type LanguageOption, type LanguageOptions, type Mac, type MacOptions, type Measure, type MeasureChoice, type MeasureOptions, type MeasureUnit, type MeasureUnits, type MeasureUnitsOptions, type Mx, type MxOptions, type MxRecord, type Naics, type NaicsChild, type NaicsCorrection, type NaicsDeep, type NaicsExclusion, type NaicsMatch, type NaicsOptions, type NaicsSearch, type NaicsSearchItem, type NaicsSearchOptions, type Name, type NameDeep, type NameOptions, type Npi, type NpiDeep, type NpiEnrollment, type NpiOptions, type ParseAPIClient, ParseAPIError, type ParseAPIOptions, type Phone, type PhoneDeep, type PhoneOptions, type Point, type PointCity, type PointDeep, type PointOptions, type Postal, type PostalDeep, type PostalDistance, type PostalDistanceEnd, type PostalDistanceOptions, type PostalLocality, type PostalMetro, type PostalMetrosDeep, type PostalNearby, type PostalNearbyItem, type PostalNearbyOptions, type PostalOptions, type Preflight, type PreflightCost, type PreflightEmailCapacity, type PreflightOperation, type PreflightOperationEstimate, type PreflightPooledCapacity, type PreflightSpendCapacity, type PreflightTask, type PropertyTax, type Provider, type ProviderDeep, type ProviderEnrollment, type ProviderOptions, type ProviderSource, type ProviderSources, type ProviderTaxonomy, type RequestOptions, type Stack, type StackOptions, type StackTechnology, type State, type StateDeep, type StateDistrictDeep, type StateDistrictItem, type StateDistricts, type StateDistrictsOptions, type StateOptions, type Tariff, type TariffDeep, type TariffMeasure, type TariffOptions, type TariffSearch, type TariffSearchHit, type TariffSearchOptions, type Time, type TimeAtOptions, type TimeLocation, type TimeLocationCandidate, type TimeLocationInput, type TimeOptions, type TimeResolution, type TimeResolutionAlternative, type TimeSeason, type TimeTransition, type TimeTransitionState, type TimeZoneEntry, type TimeZones, type TimeZonesOptions, type Timezone, type TimezoneAtOptions, type TimezoneConversionTarget, type TimezoneConversionTargetDeep, type TimezoneDeep, type TimezoneNextDst, type TimezoneOptions, type Useragent, type UseragentBrowserBrand, type UseragentBrowserDeep, type UseragentDeep, type UseragentDeviceDeep, type UseragentEngineDeep, type UseragentOptions, type UseragentOsDeep, type Vat, type VatAddress, type VatDeep, type VatOptions, type Vehicle, type VehicleDeep, type VehicleOptions, type VehicleRecall, 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.8.0";
2
+ var VERSION = "1.10.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;
@@ -33,6 +33,7 @@ function tariffSelection(result, opts) {
33
33
  }
34
34
  return result;
35
35
  }
36
+ var requestControls = (opts) => ({ signal: opts?.signal, timeoutMs: opts?.timeoutMs, retries: opts?.retries });
36
37
  function env(name) {
37
38
  return typeof process !== "undefined" ? process.env?.[name] : void 0;
38
39
  }
@@ -188,6 +189,16 @@ function parseAPI(apiKey, options = {}) {
188
189
  }
189
190
  );
190
191
  return {
192
+ /** Create a bounded task. Reuse the same request ID and inputs on retries. */
193
+ task: Object.assign(
194
+ (input, requestId, opts) => request("/task", void 0, { "Idempotency-Key": requestId }, opts, input),
195
+ {
196
+ get: (id, opts) => request(`/task/${enc(id)}`, void 0, void 0, opts),
197
+ cancel: (id, opts) => request(`/task/${enc(id)}/cancel`, void 0, void 0, opts, {}),
198
+ /** Reuse requestId with identical inputs to recover the saved result without another lookup or charge. */
199
+ lookup: (id, input, requestId, opts) => request(`/task/${enc(id)}/lookup`, void 0, { "Idempotency-Key": requestId }, opts, input)
200
+ }
201
+ ),
191
202
  /** Estimate task access, capacity and additional charges. Requires a secret key. Reserves no units or money and does not enforce the supplied budget. */
192
203
  preflight: (task, opts) => request("/preflight", void 0, void 0, opts, task),
193
204
  /** Look up an IP. `deep: true` adds enrichment included with a paid plan, without a separate check meter. */
@@ -259,7 +270,17 @@ function parseAPI(apiKey, options = {}) {
259
270
  search: (query, opts) => request("/address", { q: query, country: opts?.country, postal: opts?.postal, city: opts?.city, state: opts?.state, ip: opts?.ip }, void 0, opts)
260
271
  }
261
272
  ),
262
- company: (number, opts) => request(`/company/${enc(number)}`, { country: opts?.country, ...deepQuery(opts) }, void 0, opts),
273
+ company: Object.assign(
274
+ (number, opts) => request(`/company/${enc(number)}`, { country: opts?.country, ...deepQuery(opts) }, void 0, opts),
275
+ {
276
+ /** Look up a stable directory ID. Requested deep belongs to this profile. */
277
+ id: (id, opts) => request(`/company/id/${enc(id)}`, deepQuery(opts), void 0, requestControls(opts)),
278
+ /** Return candidates without selecting a match. Use one selector, country, exact industry, filters. */
279
+ search: (opts) => request("/company", { q: opts.query, domain: opts.domain, ticker: opts.ticker, identifier: opts.identifier, country: opts.country, industry: opts.industry, industry_type: opts.industry_type, exchange: opts.exchange, authority: opts.authority, limit: opts.limit, cursor: opts.cursor, ...deepQuery(opts) }, void 0, requestControls(opts)),
280
+ /** Describe the directory edition and its counts. Counts do not establish complete country coverage. */
281
+ coverage: (opts) => request("/company/directory/coverage", void 0, void 0, requestControls(opts))
282
+ }
283
+ ),
263
284
  /**
264
285
  * Parse an email and check its format and domain.
265
286
  * `deep: true` explicitly requests a metered deliverability check using included checks or enabled on-demand usage.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parseapi/sdk",
3
- "version": "1.8.0",
3
+ "version": "1.10.0",
4
4
  "description": "Official ParseAPI client for Node and TypeScript. One key, minimal JSON, fast.",
5
5
  "keywords": [
6
6
  "parseapi",