@sapiom/tools 0.6.2 → 0.8.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.
Files changed (78) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +17 -11
  3. package/dist/cjs/_client/index.d.ts +22 -2
  4. package/dist/cjs/_client/index.d.ts.map +1 -1
  5. package/dist/cjs/_client/index.js +16 -6
  6. package/dist/cjs/_client/index.js.map +1 -1
  7. package/dist/cjs/client.d.ts +46 -1
  8. package/dist/cjs/client.d.ts.map +1 -1
  9. package/dist/cjs/client.js +20 -0
  10. package/dist/cjs/client.js.map +1 -1
  11. package/dist/cjs/content-generation/index.d.ts +118 -3
  12. package/dist/cjs/content-generation/index.d.ts.map +1 -1
  13. package/dist/cjs/content-generation/index.js +200 -4
  14. package/dist/cjs/content-generation/index.js.map +1 -1
  15. package/dist/cjs/database/errors.d.ts +16 -0
  16. package/dist/cjs/database/errors.d.ts.map +1 -0
  17. package/dist/cjs/database/errors.js +36 -0
  18. package/dist/cjs/database/errors.js.map +1 -0
  19. package/dist/cjs/database/index.d.ts +101 -0
  20. package/dist/cjs/database/index.d.ts.map +1 -0
  21. package/dist/cjs/database/index.js +118 -0
  22. package/dist/cjs/database/index.js.map +1 -0
  23. package/dist/cjs/index.d.ts +8 -1
  24. package/dist/cjs/index.d.ts.map +1 -1
  25. package/dist/cjs/index.js +13 -1
  26. package/dist/cjs/index.js.map +1 -1
  27. package/dist/cjs/search/errors.d.ts +16 -0
  28. package/dist/cjs/search/errors.d.ts.map +1 -0
  29. package/dist/cjs/search/errors.js +36 -0
  30. package/dist/cjs/search/errors.js.map +1 -0
  31. package/dist/cjs/search/index.d.ts +234 -0
  32. package/dist/cjs/search/index.d.ts.map +1 -0
  33. package/dist/cjs/search/index.js +286 -0
  34. package/dist/cjs/search/index.js.map +1 -0
  35. package/dist/cjs/stub/index.d.ts.map +1 -1
  36. package/dist/cjs/stub/index.js +150 -2
  37. package/dist/cjs/stub/index.js.map +1 -1
  38. package/dist/esm/_client/index.d.ts +22 -2
  39. package/dist/esm/_client/index.d.ts.map +1 -1
  40. package/dist/esm/_client/index.js +16 -6
  41. package/dist/esm/_client/index.js.map +1 -1
  42. package/dist/esm/client.d.ts +46 -1
  43. package/dist/esm/client.d.ts.map +1 -1
  44. package/dist/esm/client.js +20 -0
  45. package/dist/esm/client.js.map +1 -1
  46. package/dist/esm/content-generation/index.d.ts +118 -3
  47. package/dist/esm/content-generation/index.d.ts.map +1 -1
  48. package/dist/esm/content-generation/index.js +196 -3
  49. package/dist/esm/content-generation/index.js.map +1 -1
  50. package/dist/esm/database/errors.d.ts +16 -0
  51. package/dist/esm/database/errors.d.ts.map +1 -0
  52. package/dist/esm/database/errors.js +31 -0
  53. package/dist/esm/database/errors.js.map +1 -0
  54. package/dist/esm/database/index.d.ts +101 -0
  55. package/dist/esm/database/index.d.ts.map +1 -0
  56. package/dist/esm/database/index.js +113 -0
  57. package/dist/esm/database/index.js.map +1 -0
  58. package/dist/esm/index.d.ts +8 -1
  59. package/dist/esm/index.d.ts.map +1 -1
  60. package/dist/esm/index.js +9 -1
  61. package/dist/esm/index.js.map +1 -1
  62. package/dist/esm/search/errors.d.ts +16 -0
  63. package/dist/esm/search/errors.d.ts.map +1 -0
  64. package/dist/esm/search/errors.js +31 -0
  65. package/dist/esm/search/errors.js.map +1 -0
  66. package/dist/esm/search/index.d.ts +234 -0
  67. package/dist/esm/search/index.d.ts.map +1 -0
  68. package/dist/esm/search/index.js +278 -0
  69. package/dist/esm/search/index.js.map +1 -0
  70. package/dist/esm/stub/index.d.ts.map +1 -1
  71. package/dist/esm/stub/index.js +150 -2
  72. package/dist/esm/stub/index.js.map +1 -1
  73. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  74. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  75. package/package.json +11 -1
  76. package/src/content-generation/README.md +90 -2
  77. package/src/database/README.md +62 -0
  78. package/src/search/README.md +255 -0
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SearchHttpError = void 0;
4
+ exports.ensureOk = ensureOk;
5
+ /**
6
+ * Error thrown by the `search` capability when a request fails (non-2xx
7
+ * response). Exposes `status` (HTTP status code) and `body` (parsed JSON body, or
8
+ * raw text when the body isn't JSON) for programmatic inspection.
9
+ */
10
+ class SearchHttpError extends Error {
11
+ constructor(message, status, body) {
12
+ super(message);
13
+ this.name = "SearchHttpError";
14
+ this.status = status;
15
+ this.body = body;
16
+ }
17
+ }
18
+ exports.SearchHttpError = SearchHttpError;
19
+ /**
20
+ * Return the response when 2xx, otherwise throw a {@link SearchHttpError}.
21
+ * Parses the error body as JSON when possible; falls back to raw text.
22
+ */
23
+ async function ensureOk(response, errorPrefix) {
24
+ if (response.ok)
25
+ return response;
26
+ let body;
27
+ const text = await response.text().catch(() => "");
28
+ try {
29
+ body = JSON.parse(text);
30
+ }
31
+ catch {
32
+ body = text;
33
+ }
34
+ throw new SearchHttpError(`${errorPrefix}: ${response.status} ${text}`, response.status, body);
35
+ }
36
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/search/errors.ts"],"names":[],"mappings":";;;AAqBA,4BAiBC;AAtCD;;;;GAIG;AACH,MAAa,eAAgB,SAAQ,KAAK;IAIxC,YAAY,OAAe,EAAE,MAAc,EAAE,IAAa;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAVD,0CAUC;AAED;;;GAGG;AACI,KAAK,UAAU,QAAQ,CAC5B,QAAkB,EAClB,WAAmB;IAEnB,IAAI,QAAQ,CAAC,EAAE;QAAE,OAAO,QAAQ,CAAC;IACjC,IAAI,IAAa,CAAC;IAClB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IACnD,IAAI,CAAC;QACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,GAAG,IAAI,CAAC;IACd,CAAC;IACD,MAAM,IAAI,eAAe,CACvB,GAAG,WAAW,KAAK,QAAQ,CAAC,MAAM,IAAI,IAAI,EAAE,EAC5C,QAAQ,CAAC,MAAM,EACf,IAAI,CACL,CAAC;AACJ,CAAC"}
@@ -0,0 +1,234 @@
1
+ /**
2
+ * `search` capability — find information across the web and beyond.
3
+ *
4
+ * This is the home for Sapiom's search primitives: searching the web, reading the
5
+ * contents of a page, and looking up professional email addresses. It offers
6
+ * `webSearch` (search the web), `scrape` (read a page), and `emailSearch` (find,
7
+ * verify, and discover professional email addresses); more operations follow.
8
+ *
9
+ * import { search } from "@sapiom/tools"; // ambient auth
10
+ * const hits = await search.webSearch({ query: "what is an LLM agent?" });
11
+ * hits.answer; // a synthesized answer
12
+ * const page = await search.scrape({ url: "https://example.com" });
13
+ * page.markdown; // the page content as markdown
14
+ * const found = await search.emailSearch.findEmail({
15
+ * domain: "example.com", fullName: "Ada Lovelace",
16
+ * });
17
+ * found.email; // the discovered email, or null when not found
18
+ *
19
+ * Or via an explicit client: `createClient({ apiKey }).search.webSearch(...)`.
20
+ *
21
+ * Failed requests throw {@link SearchHttpError} (carries `status` + parsed `body`).
22
+ */
23
+ import { Transport } from "../_client/index.js";
24
+ import { SearchHttpError } from "./errors.js";
25
+ export { SearchHttpError };
26
+ /** Output formats `scrape` can return. Defaults to `["markdown"]`. */
27
+ export type ScrapeFormat = "markdown" | "html" | "rawHtml" | "screenshot" | "links";
28
+ export interface ScrapeInput {
29
+ /** URL of the page to read. */
30
+ url: string;
31
+ /** Which content formats to return. Defaults to `["markdown"]`. */
32
+ formats?: ScrapeFormat[];
33
+ /** Return only the main content, dropping nav/header/footer/ads. */
34
+ onlyMainContent?: boolean;
35
+ /** Milliseconds to wait before reading (for content rendered by JavaScript). */
36
+ waitFor?: number;
37
+ }
38
+ export interface ScrapeMetadata {
39
+ /** Page title. */
40
+ title?: string;
41
+ /** Page description. */
42
+ description?: string;
43
+ /** Detected page language. */
44
+ language?: string;
45
+ /** The URL the content was read from. */
46
+ sourceUrl?: string;
47
+ /** HTTP status code returned while reading the page. */
48
+ statusCode?: number;
49
+ }
50
+ export interface ScrapeResult {
51
+ /** The URL that was read (echoes the input). */
52
+ url: string;
53
+ /** Page content as markdown (present when "markdown" was requested). */
54
+ markdown?: string;
55
+ /** Cleaned HTML (present when "html" was requested). */
56
+ html?: string;
57
+ /** Raw HTML (present when "rawHtml" was requested). */
58
+ rawHtml?: string;
59
+ /** Screenshot URL (present when "screenshot" was requested). */
60
+ screenshot?: string;
61
+ /** Links found on the page (present when "links" was requested). */
62
+ links?: string[];
63
+ /** Page metadata (title, description, language, status, …). */
64
+ metadata: ScrapeMetadata;
65
+ }
66
+ /**
67
+ * Read a page and return its content. By default you get markdown; pass `formats`
68
+ * to also (or instead) get HTML, raw HTML, a screenshot, or the page's links.
69
+ *
70
+ * Works on HTML pages and common documents (PDF, DOCX, TXT). Failed requests throw
71
+ * {@link SearchHttpError}.
72
+ */
73
+ export declare function scrape(input: ScrapeInput, transport?: Transport, baseUrl?: string): Promise<ScrapeResult>;
74
+ export interface WebSearchInput {
75
+ /** What to search for. */
76
+ query: string;
77
+ /** How thoroughly to search. Defaults to `"standard"`. */
78
+ depth?: "standard" | "deep";
79
+ /**
80
+ * What you want back. `"answer"` (default) returns a synthesized answer plus
81
+ * supporting results; `"links"` returns a list of relevant results.
82
+ */
83
+ intent?: "answer" | "links";
84
+ }
85
+ export interface WebSearchResult {
86
+ /** Result title. */
87
+ title: string;
88
+ /** Result URL. */
89
+ url: string;
90
+ /** Short excerpt for the result. */
91
+ snippet: string;
92
+ }
93
+ export interface WebSearchResponse {
94
+ /** The query that was searched (echoes the input). */
95
+ query: string;
96
+ /** A synthesized answer, when `intent` is `"answer"`. */
97
+ answer?: string;
98
+ /** The results found for the query. */
99
+ results: WebSearchResult[];
100
+ }
101
+ /**
102
+ * Search the web. By default you get a synthesized answer plus supporting
103
+ * results; pass `intent: "links"` for a list of relevant results, and
104
+ * `depth: "deep"` for a more thorough search.
105
+ *
106
+ * Failed requests throw {@link SearchHttpError}.
107
+ */
108
+ export declare function webSearch(input: WebSearchInput, transport?: Transport, baseUrl?: string): Promise<WebSearchResponse>;
109
+ export interface FindEmailInput {
110
+ /** Company domain to search at, e.g. `"example.com"`. Provide this or `company`. */
111
+ domain?: string;
112
+ /** Company name, as an alternative to `domain`. Provide this or `domain`. */
113
+ company?: string;
114
+ /** Person's first name. Provide with `lastName`, or use `fullName`. */
115
+ firstName?: string;
116
+ /** Person's last name. Provide with `firstName`, or use `fullName`. */
117
+ lastName?: string;
118
+ /** Person's full name, as an alternative to `firstName` + `lastName`. */
119
+ fullName?: string;
120
+ }
121
+ export interface FindEmailResult {
122
+ /** The discovered email address, or `null` when none was found. */
123
+ email: string | null;
124
+ /** Confidence score (0–100) that the email is correct. */
125
+ score?: number;
126
+ /** First name associated with the result. */
127
+ firstName?: string;
128
+ /** Last name associated with the result. */
129
+ lastName?: string;
130
+ /** Job title / position associated with the result. */
131
+ position?: string;
132
+ /** Company associated with the result. */
133
+ company?: string;
134
+ /** LinkedIn profile URL associated with the result. */
135
+ linkedinUrl?: string;
136
+ /** Deliverability verification for the discovered email, when available. */
137
+ verification?: {
138
+ status?: string;
139
+ date?: string;
140
+ };
141
+ }
142
+ /**
143
+ * Find a person's professional email address.
144
+ *
145
+ * You must provide enough to identify both the person and where they work:
146
+ * a `domain` OR `company`, AND either a `fullName` OR both `firstName` and
147
+ * `lastName`. Calling without a valid combination throws {@link SearchHttpError}
148
+ * before any request is made.
149
+ *
150
+ * Returns the best match, with `email` set to `null` when none was found. Failed
151
+ * requests throw {@link SearchHttpError}.
152
+ */
153
+ export declare function findEmail(input: FindEmailInput, transport?: Transport, baseUrl?: string): Promise<FindEmailResult>;
154
+ export interface VerifyEmailInput {
155
+ /** The email address to verify. */
156
+ email: string;
157
+ }
158
+ export interface VerifyEmailResult {
159
+ /** The email address that was verified (echoes the input). */
160
+ email: string;
161
+ /** Overall deliverability status. */
162
+ status?: string;
163
+ /** Verification result classification. */
164
+ result?: string;
165
+ /** Confidence score (0–100) in the verification. */
166
+ score?: number;
167
+ /** Whether the mail server accepted the address at the SMTP level. */
168
+ smtpCheck?: boolean;
169
+ /** Whether the domain accepts mail for any address (so a positive is weak). */
170
+ acceptAll?: boolean;
171
+ /** Whether the address belongs to a disposable email provider. */
172
+ disposable?: boolean;
173
+ /** Whether the address belongs to a public webmail provider. */
174
+ webmail?: boolean;
175
+ }
176
+ /**
177
+ * Verify that an email address is deliverable — returns a status, confidence
178
+ * score, SMTP/accept-all checks, and disposable/webmail flags. Use it before
179
+ * sending to avoid bounces.
180
+ *
181
+ * Failed requests throw {@link SearchHttpError}.
182
+ */
183
+ export declare function verifyEmail(input: VerifyEmailInput, transport?: Transport, baseUrl?: string): Promise<VerifyEmailResult>;
184
+ export interface DomainSearchInput {
185
+ /** Company domain to search, e.g. `"example.com"`. */
186
+ domain: string;
187
+ /** Maximum number of emails to return (max 100, default 10). */
188
+ limit?: number;
189
+ /** Filter by email type. */
190
+ type?: "personal" | "generic";
191
+ /** Filter to one or more seniority levels. */
192
+ seniority?: ("junior" | "senior" | "executive")[];
193
+ /** Filter to one or more departments (e.g. `"engineering"`, `"sales"`). */
194
+ department?: string[];
195
+ }
196
+ export interface DomainEmail {
197
+ /** The email address. */
198
+ email: string;
199
+ /** Email type (e.g. `"personal"` or `"generic"`). */
200
+ type?: string;
201
+ /** Confidence score (0–100) that the address is valid. */
202
+ confidence?: number;
203
+ /** First name associated with the address. */
204
+ firstName?: string;
205
+ /** Last name associated with the address. */
206
+ lastName?: string;
207
+ /** Job title / position associated with the address. */
208
+ position?: string;
209
+ /** Department associated with the address. */
210
+ department?: string;
211
+ /** Seniority level associated with the address. */
212
+ seniority?: string;
213
+ }
214
+ export interface DomainSearchResult {
215
+ /** The domain that was searched (echoes the input). */
216
+ domain: string;
217
+ /** The organization name for the domain, when known. */
218
+ organization?: string;
219
+ /** The detected email pattern for the domain (e.g. `"{first}.{last}"`). */
220
+ pattern?: string;
221
+ /** Whether the domain accepts mail for any address. */
222
+ acceptAll?: boolean;
223
+ /** The emails discovered at the domain. */
224
+ emails: DomainEmail[];
225
+ }
226
+ /**
227
+ * Discover the professional emails published at a company domain. Filter the
228
+ * results by `type`, `seniority`, and `department` to home in on the people you
229
+ * care about.
230
+ *
231
+ * Failed requests throw {@link SearchHttpError}.
232
+ */
233
+ export declare function domainSearch(input: DomainSearchInput, transport?: Transport, baseUrl?: string): Promise<DomainSearchResult>;
234
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/search/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,SAAS,EAAoB,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAY,MAAM,aAAa,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,CAAC;AAa3B,sEAAsE;AACtE,MAAM,MAAM,YAAY,GACpB,UAAU,GACV,MAAM,GACN,SAAS,GACT,YAAY,GACZ,OAAO,CAAC;AAEZ,MAAM,WAAW,WAAW;IAC1B,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,mEAAmE;IACnE,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,oEAAoE;IACpE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,kBAAkB;IAClB,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,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2CAA2C;IAC3C,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AAmDD;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,iBAAiB,EACxB,SAAS,GAAE,SAA8B,EACzC,OAAO,SAAgC,GACtC,OAAO,CAAC,kBAAkB,CAAC,CAyB7B"}
@@ -0,0 +1,286 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SearchHttpError = void 0;
4
+ exports.scrape = scrape;
5
+ exports.webSearch = webSearch;
6
+ exports.findEmail = findEmail;
7
+ exports.verifyEmail = verifyEmail;
8
+ exports.domainSearch = domainSearch;
9
+ /**
10
+ * `search` capability — find information across the web and beyond.
11
+ *
12
+ * This is the home for Sapiom's search primitives: searching the web, reading the
13
+ * contents of a page, and looking up professional email addresses. It offers
14
+ * `webSearch` (search the web), `scrape` (read a page), and `emailSearch` (find,
15
+ * verify, and discover professional email addresses); more operations follow.
16
+ *
17
+ * import { search } from "@sapiom/tools"; // ambient auth
18
+ * const hits = await search.webSearch({ query: "what is an LLM agent?" });
19
+ * hits.answer; // a synthesized answer
20
+ * const page = await search.scrape({ url: "https://example.com" });
21
+ * page.markdown; // the page content as markdown
22
+ * const found = await search.emailSearch.findEmail({
23
+ * domain: "example.com", fullName: "Ada Lovelace",
24
+ * });
25
+ * found.email; // the discovered email, or null when not found
26
+ *
27
+ * Or via an explicit client: `createClient({ apiKey }).search.webSearch(...)`.
28
+ *
29
+ * Failed requests throw {@link SearchHttpError} (carries `status` + parsed `body`).
30
+ */
31
+ const index_js_1 = require("../_client/index.js");
32
+ const errors_js_1 = require("./errors.js");
33
+ Object.defineProperty(exports, "SearchHttpError", { enumerable: true, get: function () { return errors_js_1.SearchHttpError; } });
34
+ const DEFAULT_BASE_URL = process.env.SAPIOM_SCRAPE_URL || "https://firecrawl.services.sapiom.ai";
35
+ const DEFAULT_WEB_SEARCH_BASE_URL = process.env.SAPIOM_SEARCH_URL || "https://api.sapiom.ai";
36
+ const DEFAULT_EMAIL_SEARCH_BASE_URL = process.env.SAPIOM_EMAIL_SEARCH_URL || "https://hunter.services.sapiom.ai";
37
+ /** Collapse a field that may be a single value or an array down to one value. */
38
+ function firstOf(value) {
39
+ return Array.isArray(value) ? value[0] : value;
40
+ }
41
+ function mapMetadata(raw) {
42
+ const meta = raw ?? {};
43
+ const title = firstOf(meta.title);
44
+ const description = firstOf(meta.description);
45
+ // A field a caller didn't ask for comes back null — treat null as absent (`!=`)
46
+ // so the result only carries fields that were actually populated.
47
+ return {
48
+ ...(title != null && { title }),
49
+ ...(description != null && { description }),
50
+ ...(meta.language != null && { language: meta.language }),
51
+ ...(meta.sourceURL != null && { sourceUrl: meta.sourceURL }),
52
+ ...(meta.statusCode != null && { statusCode: meta.statusCode }),
53
+ };
54
+ }
55
+ function mapScrape(url, raw) {
56
+ const data = raw.data ?? {};
57
+ // Unrequested formats come back null; treat null as absent (`!=`) so each
58
+ // format field is present only when it was actually returned.
59
+ return {
60
+ url,
61
+ ...(data.markdown != null && { markdown: data.markdown }),
62
+ ...(data.html != null && { html: data.html }),
63
+ ...(data.rawHtml != null && { rawHtml: data.rawHtml }),
64
+ ...(data.screenshot != null && { screenshot: data.screenshot }),
65
+ ...(data.links != null && { links: data.links }),
66
+ metadata: mapMetadata(data.metadata),
67
+ };
68
+ }
69
+ // ----- Capability operations -----
70
+ /**
71
+ * Read a page and return its content. By default you get markdown; pass `formats`
72
+ * to also (or instead) get HTML, raw HTML, a screenshot, or the page's links.
73
+ *
74
+ * Works on HTML pages and common documents (PDF, DOCX, TXT). Failed requests throw
75
+ * {@link SearchHttpError}.
76
+ */
77
+ async function scrape(input, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_BASE_URL) {
78
+ // `!= null` so an optional explicitly passed as null (a JS caller bypassing the
79
+ // types) is treated as absent rather than forwarded as a null field.
80
+ const body = { url: input.url };
81
+ if (input.formats != null)
82
+ body.formats = input.formats;
83
+ if (input.onlyMainContent != null)
84
+ body.onlyMainContent = input.onlyMainContent;
85
+ if (input.waitFor != null)
86
+ body.waitFor = input.waitFor;
87
+ const res = await (0, errors_js_1.ensureOk)(await transport.fetch(`${baseUrl}/v2/scrape`, {
88
+ method: "POST",
89
+ headers: { "content-type": "application/json" },
90
+ body: JSON.stringify(body),
91
+ }), "Failed to scrape");
92
+ return mapScrape(input.url, (await res.json()));
93
+ }
94
+ function mapWebSearchResult(raw) {
95
+ return {
96
+ title: raw.title ?? "",
97
+ url: raw.url ?? "",
98
+ snippet: raw.snippet ?? "",
99
+ };
100
+ }
101
+ function mapWebSearch(query, raw) {
102
+ // Build the result from only the public fields. A defensive measure: any
103
+ // extra top-level field on the wire (e.g. bookkeeping not meant for callers)
104
+ // is dropped by construction rather than spread through.
105
+ const results = Array.isArray(raw.results)
106
+ ? raw.results.map(mapWebSearchResult)
107
+ : [];
108
+ return {
109
+ query: raw.query ?? query,
110
+ ...(raw.answer != null && { answer: raw.answer }),
111
+ results,
112
+ };
113
+ }
114
+ /**
115
+ * Search the web. By default you get a synthesized answer plus supporting
116
+ * results; pass `intent: "links"` for a list of relevant results, and
117
+ * `depth: "deep"` for a more thorough search.
118
+ *
119
+ * Failed requests throw {@link SearchHttpError}.
120
+ */
121
+ async function webSearch(input, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_WEB_SEARCH_BASE_URL) {
122
+ // `!= null` so an optional explicitly passed as null (a JS caller bypassing the
123
+ // types) is treated as absent rather than forwarded as a null field.
124
+ const body = {
125
+ query: input.query,
126
+ intent: input.intent ?? "answer",
127
+ };
128
+ if (input.depth != null)
129
+ body.depth = input.depth;
130
+ const res = await (0, errors_js_1.ensureOk)(await transport.fetch(`${baseUrl}/v1/capabilities/web.search`, {
131
+ method: "POST",
132
+ headers: { "content-type": "application/json" },
133
+ body: JSON.stringify(body),
134
+ }, { authHeader: "x-api-key" }), "Failed to search the web");
135
+ return mapWebSearch(input.query, (await res.json()));
136
+ }
137
+ // ----- search.emailSearch -----
138
+ //
139
+ // Three operations for working with professional email addresses: find an email
140
+ // for a known person, verify an address is deliverable, and discover the emails
141
+ // published at a company domain.
142
+ // ----- Shared request/response helpers -----
143
+ /**
144
+ * Build a query string from a set of params. Skips any value that is null or
145
+ * undefined (so a JS caller passing an optional as `null` doesn't put `null` on
146
+ * the wire), and stringifies everything else.
147
+ */
148
+ function toQuery(params) {
149
+ const search = new URLSearchParams();
150
+ for (const [key, value] of Object.entries(params)) {
151
+ if (value != null)
152
+ search.set(key, String(value));
153
+ }
154
+ const qs = search.toString();
155
+ return qs ? `?${qs}` : "";
156
+ }
157
+ async function getEnvelope(transport, url, errorPrefix) {
158
+ const res = await (0, errors_js_1.ensureOk)(await transport.fetch(url, { method: "GET" }), errorPrefix);
159
+ const body = (await res.json());
160
+ return body.data;
161
+ }
162
+ function mapFindEmail(raw) {
163
+ const d = raw ?? {};
164
+ // `!= null` so fields that come back null (a miss) are treated as absent rather
165
+ // than surfaced as `field: null`.
166
+ return {
167
+ email: d.email != null ? d.email : null,
168
+ ...(d.score != null && { score: d.score }),
169
+ ...(d.first_name != null && { firstName: d.first_name }),
170
+ ...(d.last_name != null && { lastName: d.last_name }),
171
+ ...(d.position != null && { position: d.position }),
172
+ ...(d.company != null && { company: d.company }),
173
+ ...(d.linkedin_url != null && { linkedinUrl: d.linkedin_url }),
174
+ ...(d.verification != null && { verification: d.verification }),
175
+ };
176
+ }
177
+ /**
178
+ * Find a person's professional email address.
179
+ *
180
+ * You must provide enough to identify both the person and where they work:
181
+ * a `domain` OR `company`, AND either a `fullName` OR both `firstName` and
182
+ * `lastName`. Calling without a valid combination throws {@link SearchHttpError}
183
+ * before any request is made.
184
+ *
185
+ * Returns the best match, with `email` set to `null` when none was found. Failed
186
+ * requests throw {@link SearchHttpError}.
187
+ */
188
+ async function findEmail(input, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_EMAIL_SEARCH_BASE_URL) {
189
+ // Guard the required combination client-side so an under-specified lookup fails
190
+ // fast and clearly, never as a confusing network round-trip. `!= null` plus a
191
+ // truthiness check rejects null/undefined/empty-string for JS callers.
192
+ const hasOrg = Boolean(input.domain) || Boolean(input.company);
193
+ const hasPerson = Boolean(input.fullName) ||
194
+ (Boolean(input.firstName) && Boolean(input.lastName));
195
+ if (!hasOrg || !hasPerson) {
196
+ throw new errors_js_1.SearchHttpError("findEmail requires (domain or company) and (fullName or firstName + lastName)", 400, undefined);
197
+ }
198
+ const query = toQuery({
199
+ domain: input.domain,
200
+ company: input.company,
201
+ first_name: input.firstName,
202
+ last_name: input.lastName,
203
+ full_name: input.fullName,
204
+ });
205
+ const data = await getEnvelope(transport, `${baseUrl}/v2/email-finder${query}`, "Failed to find email");
206
+ return mapFindEmail(data);
207
+ }
208
+ function mapVerifyEmail(email, raw) {
209
+ const d = raw ?? {};
210
+ return {
211
+ email: d.email ?? email,
212
+ ...(d.status != null && { status: d.status }),
213
+ ...(d.result != null && { result: d.result }),
214
+ ...(d.score != null && { score: d.score }),
215
+ ...(d.smtp_check != null && { smtpCheck: d.smtp_check }),
216
+ ...(d.accept_all != null && { acceptAll: d.accept_all }),
217
+ ...(d.disposable != null && { disposable: d.disposable }),
218
+ ...(d.webmail != null && { webmail: d.webmail }),
219
+ };
220
+ }
221
+ /**
222
+ * Verify that an email address is deliverable — returns a status, confidence
223
+ * score, SMTP/accept-all checks, and disposable/webmail flags. Use it before
224
+ * sending to avoid bounces.
225
+ *
226
+ * Failed requests throw {@link SearchHttpError}.
227
+ */
228
+ async function verifyEmail(input, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_EMAIL_SEARCH_BASE_URL) {
229
+ if (!input.email) {
230
+ throw new errors_js_1.SearchHttpError("verifyEmail requires an email", 400, undefined);
231
+ }
232
+ const query = toQuery({ email: input.email });
233
+ const data = await getEnvelope(transport, `${baseUrl}/v2/email-verifier${query}`, "Failed to verify email");
234
+ return mapVerifyEmail(input.email, data);
235
+ }
236
+ function mapDomainEmail(raw) {
237
+ return {
238
+ email: raw.value ?? "",
239
+ ...(raw.type != null && { type: raw.type }),
240
+ ...(raw.confidence != null && { confidence: raw.confidence }),
241
+ ...(raw.first_name != null && { firstName: raw.first_name }),
242
+ ...(raw.last_name != null && { lastName: raw.last_name }),
243
+ ...(raw.position != null && { position: raw.position }),
244
+ ...(raw.department != null && { department: raw.department }),
245
+ ...(raw.seniority != null && { seniority: raw.seniority }),
246
+ };
247
+ }
248
+ function mapDomainSearch(domain, raw) {
249
+ const d = raw ?? {};
250
+ const emails = Array.isArray(d.emails) ? d.emails.map(mapDomainEmail) : [];
251
+ return {
252
+ domain: d.domain ?? domain,
253
+ ...(d.organization != null && { organization: d.organization }),
254
+ ...(d.pattern != null && { pattern: d.pattern }),
255
+ ...(d.accept_all != null && { acceptAll: d.accept_all }),
256
+ emails,
257
+ };
258
+ }
259
+ /**
260
+ * Discover the professional emails published at a company domain. Filter the
261
+ * results by `type`, `seniority`, and `department` to home in on the people you
262
+ * care about.
263
+ *
264
+ * Failed requests throw {@link SearchHttpError}.
265
+ */
266
+ async function domainSearch(input, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_EMAIL_SEARCH_BASE_URL) {
267
+ if (!input.domain) {
268
+ throw new errors_js_1.SearchHttpError("domainSearch requires a domain", 400, undefined);
269
+ }
270
+ // Array filters travel as comma-separated values; an empty array becomes
271
+ // nothing on the wire (filtered by `toQuery`).
272
+ const query = toQuery({
273
+ domain: input.domain,
274
+ limit: input.limit,
275
+ type: input.type,
276
+ seniority: input.seniority != null && input.seniority.length > 0
277
+ ? input.seniority.join(",")
278
+ : undefined,
279
+ department: input.department != null && input.department.length > 0
280
+ ? input.department.join(",")
281
+ : undefined,
282
+ });
283
+ const data = await getEnvelope(transport, `${baseUrl}/v2/domain-search${query}`, "Failed to search domain");
284
+ return mapDomainSearch(input.domain, data);
285
+ }
286
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/search/index.ts"],"names":[],"mappings":";;;AA8JA,wBAsBC;AAgFD,8BA0BC;AAoHD,8BAiCC;AAgED,kCAeC;AAyGD,oCA6BC;AAxoBD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,kDAAkE;AAClE,2CAAwD;AAE/C,gGAFA,2BAAe,OAEA;AAExB,MAAM,gBAAgB,GACpB,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,sCAAsC,CAAC;AAE1E,MAAM,2BAA2B,GAC/B,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,uBAAuB,CAAC;AAE3D,MAAM,6BAA6B,GACjC,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,mCAAmC,CAAC;AAgF7E,iFAAiF;AACjF,SAAS,OAAO,CAAI,KAA0B;IAC5C,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACjD,CAAC;AAED,SAAS,WAAW,CAAC,GAA4B;IAC/C,MAAM,IAAI,GAAG,GAAG,IAAI,EAAE,CAAC;IACvB,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClC,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9C,gFAAgF;IAChF,kEAAkE;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