orangeslice 1.8.6 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts +5 -4
- package/dist/api.js +44 -27
- package/dist/apify.js +1 -1
- package/dist/b2b.js +1 -2
- package/dist/browser.js +1 -1
- package/dist/cli.js +76 -9
- package/dist/expansion.d.ts +0 -9
- package/dist/expansion.js +10 -22
- package/dist/firecrawl.js +16 -1
- package/dist/generateObject.js +5 -1
- package/dist/googleMaps.js +1 -2
- package/dist/index.d.ts +10 -5
- package/dist/index.js +15 -7
- package/dist/predictLeads.d.ts +36 -0
- package/dist/predictLeads.js +44 -0
- package/dist/serp.js +4 -2
- package/docs/integrations/gmail/index.md +12 -0
- package/docs/integrations/gmail/sendEmail.md +51 -0
- package/docs/integrations/index.md +24 -0
- package/docs/prospecting/index.md +41 -1
- package/docs/providers/predictleads/openapi.json +13209 -0
- package/docs/services/ai/generateObject.ts +2 -2
- package/docs/services/index.md +1 -0
- package/docs/services/person/contact/get.ts +1 -0
- package/docs/services/person/linkedin/enrich.md +1 -0
- package/docs/services/person/linkedin/findUrl.md +2 -0
- package/docs/services/predictLeads/apiSubscription.ts +19 -0
- package/docs/services/predictLeads/companies.ts +84 -0
- package/docs/services/predictLeads/company.ts +78 -0
- package/docs/services/predictLeads/companyConnections.ts +59 -0
- package/docs/services/predictLeads/companyFinancingEvents.ts +60 -0
- package/docs/services/predictLeads/companyGithubRepositories.ts +64 -0
- package/docs/services/predictLeads/companyJobOpenings.ts +102 -0
- package/docs/services/predictLeads/companyNewsEvents.ts +113 -0
- package/docs/services/predictLeads/companyProducts.ts +51 -0
- package/docs/services/predictLeads/companySimilarCompanies.ts +50 -0
- package/docs/services/predictLeads/companyTechnologyDetections.ts +122 -0
- package/docs/services/predictLeads/companyWebsiteEvolution.ts +54 -0
- package/docs/services/predictLeads/discoverConnectionInvestors.ts +59 -0
- package/docs/services/predictLeads/discoverJobOpenings.ts +86 -0
- package/docs/services/predictLeads/discoverProducts.ts +51 -0
- package/docs/services/predictLeads/discoverTechnologyTechnologyDetections.ts +122 -0
- package/docs/services/predictLeads/financingEvents.ts +58 -0
- package/docs/services/predictLeads/followCompany.ts +16 -0
- package/docs/services/predictLeads/followedCompanies.ts +16 -0
- package/docs/services/predictLeads/jobOpening.ts +80 -0
- package/docs/services/predictLeads/newsEvent.ts +103 -0
- package/docs/services/predictLeads/newsEvents.ts +109 -0
- package/docs/services/predictLeads/product.ts +43 -0
- package/docs/services/predictLeads/startupPlatformPosts.ts +35 -0
- package/docs/services/predictLeads/technologies.ts +58 -0
- package/docs/services/predictLeads/technology.ts +52 -0
- package/docs/services/predictLeads/unfollowCompany.ts +14 -0
- package/package.json +1 -1
- package/docs/services/company/careers/findPage.ts +0 -11
package/dist/api.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
interface
|
|
2
|
-
|
|
1
|
+
export interface OrangesliceConfig {
|
|
2
|
+
apiKey?: string;
|
|
3
|
+
baseUrl?: string;
|
|
3
4
|
}
|
|
4
|
-
export declare function
|
|
5
|
-
export
|
|
5
|
+
export declare function configure(opts: OrangesliceConfig): void;
|
|
6
|
+
export declare function post<T>(endpoint: string, payload: Record<string, unknown>): Promise<T>;
|
package/dist/api.js
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configure = configure;
|
|
3
4
|
exports.post = post;
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
-
* -
|
|
7
|
-
*
|
|
6
|
+
* Transport layer for orangeslice SDK.
|
|
7
|
+
* Calls batch-service execute routes directly with API key auth.
|
|
8
|
+
* Polls /function/result/:requestId for async operations.
|
|
8
9
|
*/
|
|
9
|
-
const
|
|
10
|
+
const DEFAULT_BASE_URL = "https://enrichly-production.up.railway.app";
|
|
10
11
|
const POLL_TIMEOUT_MS = 600000;
|
|
11
12
|
const DEFAULT_POLL_INTERVAL_MS = 1000;
|
|
13
|
+
const DEFAULT_INLINE_WAIT_MS = 5000;
|
|
14
|
+
const _config = {};
|
|
15
|
+
function configure(opts) {
|
|
16
|
+
if (opts.apiKey !== undefined)
|
|
17
|
+
_config.apiKey = opts.apiKey;
|
|
18
|
+
if (opts.baseUrl !== undefined)
|
|
19
|
+
_config.baseUrl = opts.baseUrl;
|
|
20
|
+
}
|
|
21
|
+
function resolveBaseUrl() {
|
|
22
|
+
return (_config.baseUrl || process.env.ORANGESLICE_BASE_URL || DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
23
|
+
}
|
|
24
|
+
function resolveApiKey() {
|
|
25
|
+
return _config.apiKey || process.env.ORANGESLICE_API_KEY || "";
|
|
26
|
+
}
|
|
12
27
|
function sleep(ms) {
|
|
13
28
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
14
29
|
}
|
|
@@ -51,18 +66,14 @@ function isPendingResponse(body) {
|
|
|
51
66
|
return false;
|
|
52
67
|
return body.pending === true;
|
|
53
68
|
}
|
|
54
|
-
function
|
|
69
|
+
function resolvePollUrl(baseUrl, pending) {
|
|
55
70
|
if (pending.pollUrl) {
|
|
56
71
|
return new URL(pending.pollUrl, baseUrl).toString();
|
|
57
72
|
}
|
|
58
73
|
if (!pending.requestId) {
|
|
59
74
|
throw new Error("[orangeslice] pending response missing requestId");
|
|
60
75
|
}
|
|
61
|
-
|
|
62
|
-
const basePath = url.pathname.replace(/\/function\/?$/, "");
|
|
63
|
-
url.pathname = `${basePath}/function/result/${pending.requestId}`.replace(/\/{2,}/g, "/");
|
|
64
|
-
url.search = "";
|
|
65
|
-
return url.toString();
|
|
76
|
+
return `${baseUrl}/function/result/${pending.requestId}`;
|
|
66
77
|
}
|
|
67
78
|
async function fetchWithRedirect(url, init) {
|
|
68
79
|
let res = await fetch(url, { ...init, redirect: "manual" });
|
|
@@ -74,8 +85,8 @@ async function fetchWithRedirect(url, init) {
|
|
|
74
85
|
}
|
|
75
86
|
return res;
|
|
76
87
|
}
|
|
77
|
-
async function
|
|
78
|
-
const pollUrl =
|
|
88
|
+
async function pollUntilComplete(baseUrl, endpoint, pending) {
|
|
89
|
+
const pollUrl = resolvePollUrl(baseUrl, pending);
|
|
79
90
|
const timeoutAt = Date.now() + POLL_TIMEOUT_MS;
|
|
80
91
|
let pollAfterMs = typeof pending.pollAfterMs === "number" && pending.pollAfterMs > 0
|
|
81
92
|
? pending.pollAfterMs
|
|
@@ -91,40 +102,46 @@ async function pollBatchUntilComplete(baseUrl, functionId, pending) {
|
|
|
91
102
|
}
|
|
92
103
|
if (!res.ok) {
|
|
93
104
|
const message = asErrorMessage(data) || JSON.stringify(data);
|
|
94
|
-
throw new Error(`[orangeslice] ${
|
|
105
|
+
throw new Error(`[orangeslice] ${endpoint}: ${res.status} ${message}`);
|
|
95
106
|
}
|
|
96
107
|
const message = asErrorMessage(data);
|
|
97
108
|
if (message) {
|
|
98
|
-
throw new Error(`[orangeslice] ${
|
|
109
|
+
throw new Error(`[orangeslice] ${endpoint}: ${message}`);
|
|
99
110
|
}
|
|
100
111
|
return data;
|
|
101
112
|
}
|
|
102
|
-
throw new Error(`[orangeslice] ${
|
|
113
|
+
throw new Error(`[orangeslice] ${endpoint}: polling timed out after ${POLL_TIMEOUT_MS}ms`);
|
|
103
114
|
}
|
|
104
|
-
async function post(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
115
|
+
async function post(endpoint, payload) {
|
|
116
|
+
const baseUrl = resolveBaseUrl();
|
|
117
|
+
const apiKey = resolveApiKey();
|
|
118
|
+
if (!apiKey) {
|
|
119
|
+
throw new Error("[orangeslice] No API key configured. " +
|
|
120
|
+
"Set ORANGESLICE_API_KEY in your environment or call configure({ apiKey: 'osk_...' }).");
|
|
121
|
+
}
|
|
122
|
+
const url = `${baseUrl}${endpoint}`;
|
|
123
|
+
const body = JSON.stringify({ ...payload, inlineWaitMs: DEFAULT_INLINE_WAIT_MS });
|
|
124
|
+
const headers = {
|
|
125
|
+
"Content-Type": "application/json",
|
|
126
|
+
Authorization: `Bearer ${apiKey}`
|
|
127
|
+
};
|
|
110
128
|
const res = await fetchWithRedirect(url, {
|
|
111
129
|
method: "POST",
|
|
112
|
-
headers
|
|
130
|
+
headers,
|
|
113
131
|
body
|
|
114
132
|
});
|
|
115
133
|
if (!res.ok) {
|
|
116
|
-
let message = `${res.status}`;
|
|
117
134
|
const data = await readResponseBody(res);
|
|
118
|
-
message = asErrorMessage(data) || (typeof data === "string" ? data : JSON.stringify(data));
|
|
119
|
-
throw new Error(`[orangeslice] ${
|
|
135
|
+
const message = asErrorMessage(data) || (typeof data === "string" ? data : JSON.stringify(data));
|
|
136
|
+
throw new Error(`[orangeslice] ${endpoint}: ${res.status} ${message}`);
|
|
120
137
|
}
|
|
121
138
|
const data = await readResponseBody(res);
|
|
122
139
|
if (isPendingResponse(data)) {
|
|
123
|
-
return
|
|
140
|
+
return pollUntilComplete(baseUrl, endpoint, data);
|
|
124
141
|
}
|
|
125
142
|
const errorMessage = asErrorMessage(data);
|
|
126
143
|
if (errorMessage) {
|
|
127
|
-
throw new Error(`[orangeslice] ${
|
|
144
|
+
throw new Error(`[orangeslice] ${endpoint}: ${errorMessage}`);
|
|
128
145
|
}
|
|
129
146
|
return data;
|
|
130
147
|
}
|
package/dist/apify.js
CHANGED
package/dist/b2b.js
CHANGED
|
@@ -11,8 +11,7 @@ const api_1 = require("./api");
|
|
|
11
11
|
* });
|
|
12
12
|
*/
|
|
13
13
|
async function linkedinSearch(params) {
|
|
14
|
-
|
|
15
|
-
const data = await (0, api_1.post)("b2b", { ...params }, { direct: true });
|
|
14
|
+
const data = await (0, api_1.post)("/execute/sql", { sql: params.sql });
|
|
16
15
|
return {
|
|
17
16
|
rows: data.rows ?? [],
|
|
18
17
|
rowCount: data.rowCount ?? 0,
|
package/dist/browser.js
CHANGED
package/dist/cli.js
CHANGED
|
@@ -37,6 +37,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
37
37
|
const child_process_1 = require("child_process");
|
|
38
38
|
const fs = __importStar(require("fs"));
|
|
39
39
|
const path = __importStar(require("path"));
|
|
40
|
+
const readline = __importStar(require("readline"));
|
|
40
41
|
const LEGACY_DOCS_DIR = path.join(__dirname, "..", "docs");
|
|
41
42
|
const TARGET_DIR = path.join(process.cwd(), "orangeslice-docs");
|
|
42
43
|
const AGENTS_FILE = path.join(TARGET_DIR, "AGENTS.md");
|
|
@@ -110,6 +111,74 @@ function installOrangeslice(cwd) {
|
|
|
110
111
|
console.log(" Installing orangeslice...");
|
|
111
112
|
(0, child_process_1.execSync)("npm install orangeslice", { stdio: "inherit", cwd });
|
|
112
113
|
}
|
|
114
|
+
function prompt(question) {
|
|
115
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
116
|
+
return new Promise((resolve) => {
|
|
117
|
+
rl.question(question, (answer) => {
|
|
118
|
+
rl.close();
|
|
119
|
+
resolve(answer.trim());
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function readEnvFile(envPath) {
|
|
124
|
+
const entries = new Map();
|
|
125
|
+
if (!fs.existsSync(envPath))
|
|
126
|
+
return entries;
|
|
127
|
+
const lines = fs.readFileSync(envPath, "utf8").split("\n");
|
|
128
|
+
for (const line of lines) {
|
|
129
|
+
const match = line.match(/^([A-Za-z_][A-Za-z0-9_]*)=(.*)/);
|
|
130
|
+
if (match)
|
|
131
|
+
entries.set(match[1], match[2]);
|
|
132
|
+
}
|
|
133
|
+
return entries;
|
|
134
|
+
}
|
|
135
|
+
function writeEnvVar(envPath, key, value) {
|
|
136
|
+
const entries = readEnvFile(envPath);
|
|
137
|
+
entries.set(key, value);
|
|
138
|
+
const lines = [];
|
|
139
|
+
if (fs.existsSync(envPath)) {
|
|
140
|
+
const original = fs.readFileSync(envPath, "utf8").split("\n");
|
|
141
|
+
let replaced = false;
|
|
142
|
+
for (const line of original) {
|
|
143
|
+
const match = line.match(/^([A-Za-z_][A-Za-z0-9_]*)=(.*)/);
|
|
144
|
+
if (match && match[1] === key) {
|
|
145
|
+
lines.push(`${key}=${value}`);
|
|
146
|
+
replaced = true;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
lines.push(line);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (!replaced) {
|
|
153
|
+
if (lines.length > 0 && lines[lines.length - 1] !== "")
|
|
154
|
+
lines.push("");
|
|
155
|
+
lines.push(`${key}=${value}`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
lines.push(`${key}=${value}`, "");
|
|
160
|
+
}
|
|
161
|
+
fs.writeFileSync(envPath, lines.join("\n"), "utf8");
|
|
162
|
+
}
|
|
163
|
+
async function setupApiKey(cwd) {
|
|
164
|
+
const envPath = path.join(cwd, ".env");
|
|
165
|
+
const existing = readEnvFile(envPath).get("ORANGESLICE_API_KEY");
|
|
166
|
+
if (existing) {
|
|
167
|
+
console.log(` ✓ API key already configured in .env (${existing.slice(0, 12)}...)\n`);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
console.log(" API key required. Get one at: https://www.orangeslice.ai/dashboard/api-keys\n");
|
|
171
|
+
const key = await prompt(" Paste your API key (osk_...): ");
|
|
172
|
+
if (!key) {
|
|
173
|
+
console.log("\n ⚠ Skipped. Set ORANGESLICE_API_KEY in .env or call configure({ apiKey }) before using the SDK.\n");
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
if (!key.startsWith("osk_")) {
|
|
177
|
+
console.log("\n ⚠ Key doesn't start with osk_ — saving anyway. Double-check it's correct.\n");
|
|
178
|
+
}
|
|
179
|
+
writeEnvVar(envPath, "ORANGESLICE_API_KEY", key);
|
|
180
|
+
console.log(`\n ✓ API key saved to .env\n`);
|
|
181
|
+
}
|
|
113
182
|
async function main() {
|
|
114
183
|
console.log("\norangeslice\n");
|
|
115
184
|
const docsDir = resolveDocsDir();
|
|
@@ -124,29 +193,27 @@ async function main() {
|
|
|
124
193
|
ensurePackageJson(cwd);
|
|
125
194
|
installOrangeslice(cwd);
|
|
126
195
|
console.log(" ✓ Package installed in current directory\n");
|
|
196
|
+
// API key setup
|
|
197
|
+
await setupApiKey(cwd);
|
|
127
198
|
console.log("\nReady - services-style API\n");
|
|
128
|
-
console.log(" import { services } from 'orangeslice';\n");
|
|
199
|
+
console.log(" import { configure, services } from 'orangeslice';\n");
|
|
200
|
+
console.log(" // Option A: env var (loaded automatically from .env by your framework)");
|
|
201
|
+
console.log(" // ORANGESLICE_API_KEY=osk_... in .env\n");
|
|
202
|
+
console.log(" // Option B: programmatic");
|
|
203
|
+
console.log(" configure({ apiKey: 'osk_...' });\n");
|
|
129
204
|
console.log(" Agent setup (do this first):");
|
|
130
205
|
console.log(" Ask your agent to read:");
|
|
131
206
|
console.log(" 1) ./orangeslice-docs/AGENTS.md");
|
|
132
207
|
console.log(" 2) ./orangeslice-docs/services/index.md");
|
|
133
208
|
console.log(' Then tell it: "Use these docs as source of truth for all orangeslice operations."\n');
|
|
134
|
-
console.log(" Routing note:");
|
|
135
|
-
console.log(" - all services submit to the batch-service /function endpoint");
|
|
136
|
-
console.log(" - pending jobs poll batch-service /function/result endpoints");
|
|
137
|
-
console.log(" - this package currently includes only batch-backed services\n");
|
|
138
209
|
console.log(" // LinkedIn B2B SQL");
|
|
139
210
|
console.log(' const { rows } = await services.company.linkedin.search({ sql: "SELECT * FROM linkedin_company LIMIT 10" });\n');
|
|
140
211
|
console.log(" // Web search");
|
|
141
212
|
console.log(" const page = await services.web.search({ query: 'best CRM software' });\n");
|
|
142
|
-
console.log(" // Batched web search");
|
|
143
|
-
console.log(" const pages = await services.web.batchSearch({ queries: [{ query: 'site:linkedin.com/in stripe' }] });\n");
|
|
144
213
|
console.log(" // AI structured output");
|
|
145
214
|
console.log(" const { object } = await services.ai.generateObject({ prompt: '...', schema: {...} });\n");
|
|
146
215
|
console.log(" // Browser automation (Kernel)");
|
|
147
216
|
console.log(' const browser = await services.browser.execute({ code: "return await page.title();" });\n');
|
|
148
|
-
console.log(" // Apify actor");
|
|
149
|
-
console.log(" const actor = await services.apify.runActor({ actor: 'apify/web-scraper', input: {} });\n");
|
|
150
217
|
console.log(" Always parallelize independent calls with Promise.all.\n");
|
|
151
218
|
}
|
|
152
219
|
main().catch(console.error);
|
package/dist/expansion.d.ts
CHANGED
|
@@ -61,17 +61,8 @@ export interface PersonContactGetResult {
|
|
|
61
61
|
}
|
|
62
62
|
export declare function personLinkedinEnrich(params: Record<string, unknown>): Promise<unknown>;
|
|
63
63
|
export declare function companyLinkedinEnrich(params: Record<string, unknown>): Promise<unknown>;
|
|
64
|
-
/**
|
|
65
|
-
* Find a LinkedIn person profile URL from name/title/company context.
|
|
66
|
-
*/
|
|
67
64
|
export declare function personLinkedinFindUrl(params: PersonLinkedinFindUrlParams): Promise<string | null>;
|
|
68
|
-
/**
|
|
69
|
-
* Find a LinkedIn company URL from website/company context.
|
|
70
|
-
*/
|
|
71
65
|
export declare function companyLinkedinFindUrl(params: CompanyLinkedinFindUrlParams): Promise<string | null>;
|
|
72
|
-
/**
|
|
73
|
-
* Run contact waterfall through Inngest and poll until completion.
|
|
74
|
-
*/
|
|
75
66
|
export declare function personContactGet(params: PersonContactGetParams): Promise<PersonContactGetResult>;
|
|
76
67
|
export declare function companyGetEmployeesFromLinkedin(params: CompanyGetEmployeesFromLinkedinParams): Promise<CompanyGetEmployeesFromLinkedinResult>;
|
|
77
68
|
export declare function geoParseAddress(params: Record<string, unknown>): Promise<unknown>;
|
package/dist/expansion.js
CHANGED
|
@@ -32,9 +32,6 @@ async function personLinkedinEnrich(params) {
|
|
|
32
32
|
if (!url && !username) {
|
|
33
33
|
throw new Error("[orangeslice] person.linkedin.enrich: provide url or username");
|
|
34
34
|
}
|
|
35
|
-
// Root cause fix:
|
|
36
|
-
// Use indexed slug_key64 lookup first, then join into lkd_profile by profile_id.
|
|
37
|
-
// This avoids full scans/timeouts on lkd_profile slug filters.
|
|
38
35
|
const sql = extended
|
|
39
36
|
? `SELECT lkd.*
|
|
40
37
|
FROM linkedin_profile_slug ps
|
|
@@ -63,7 +60,7 @@ async function personLinkedinEnrich(params) {
|
|
|
63
60
|
JOIN lkd_profile lkd ON lkd.profile_id = ps.linkedin_profile_id
|
|
64
61
|
WHERE ps.slug_key64 = key64(${sqlString(username)})
|
|
65
62
|
LIMIT 1`;
|
|
66
|
-
const data = await (0, api_1.post)("
|
|
63
|
+
const data = await (0, api_1.post)("/execute/sql", { sql });
|
|
67
64
|
return data.rows?.[0] ?? null;
|
|
68
65
|
}
|
|
69
66
|
async function companyLinkedinEnrich(params) {
|
|
@@ -85,41 +82,32 @@ async function companyLinkedinEnrich(params) {
|
|
|
85
82
|
? "*"
|
|
86
83
|
: "name, slug, website, description, employee_count, follower_count, founded_year, locality, region, country_iso, country_name, type, size, ticker, specialties, linkedin_url, created_at, updated_at";
|
|
87
84
|
const sql = `SELECT ${fields} FROM lkd_company WHERE ${where.join(" OR ")} LIMIT 1`;
|
|
88
|
-
const data = await (0, api_1.post)("
|
|
85
|
+
const data = await (0, api_1.post)("/execute/sql", { sql });
|
|
89
86
|
return data.rows?.[0] ?? null;
|
|
90
87
|
}
|
|
91
|
-
/**
|
|
92
|
-
* Find a LinkedIn person profile URL from name/title/company context.
|
|
93
|
-
*/
|
|
94
88
|
async function personLinkedinFindUrl(params) {
|
|
95
|
-
const url = await (0, api_1.post)("
|
|
89
|
+
const url = await (0, api_1.post)("/execute/linkedin-find-profile-url", params);
|
|
96
90
|
return typeof url === "string" && url.trim().length > 0 ? url : null;
|
|
97
91
|
}
|
|
98
|
-
/**
|
|
99
|
-
* Find a LinkedIn company URL from website/company context.
|
|
100
|
-
*/
|
|
101
92
|
async function companyLinkedinFindUrl(params) {
|
|
102
|
-
const url = await (0, api_1.post)("
|
|
93
|
+
const url = await (0, api_1.post)("/execute/find-linkedin-company-url", params);
|
|
103
94
|
return typeof url === "string" && url.trim().length > 0 ? url : null;
|
|
104
95
|
}
|
|
105
|
-
/**
|
|
106
|
-
* Run contact waterfall through Inngest and poll until completion.
|
|
107
|
-
*/
|
|
108
96
|
async function personContactGet(params) {
|
|
109
|
-
return (0, api_1.post)("
|
|
97
|
+
return (0, api_1.post)("/execute/contact-waterfall", { ...params });
|
|
110
98
|
}
|
|
111
99
|
async function companyGetEmployeesFromLinkedin(params) {
|
|
112
|
-
return (0, api_1.post)("b2b-
|
|
100
|
+
return (0, api_1.post)("/execute/b2b-company-employees", params);
|
|
113
101
|
}
|
|
114
102
|
async function geoParseAddress(params) {
|
|
115
|
-
return (0, api_1.post)("
|
|
103
|
+
return (0, api_1.post)("/execute/parse-address", params);
|
|
116
104
|
}
|
|
117
105
|
async function builtWithLookupDomain(params) {
|
|
118
|
-
return (0, api_1.post)("
|
|
106
|
+
return (0, api_1.post)("/execute/builtwith/lookup-domain", params);
|
|
119
107
|
}
|
|
120
108
|
async function builtWithRelationships(params) {
|
|
121
|
-
return (0, api_1.post)("
|
|
109
|
+
return (0, api_1.post)("/execute/builtwith/relationships", params);
|
|
122
110
|
}
|
|
123
111
|
async function builtWithSearchByTech(params) {
|
|
124
|
-
return (0, api_1.post)("
|
|
112
|
+
return (0, api_1.post)("/execute/builtwith/search-by-tech", params);
|
|
125
113
|
}
|
package/dist/firecrawl.js
CHANGED
|
@@ -6,5 +6,20 @@ const api_1 = require("./api");
|
|
|
6
6
|
* services.scrape.website
|
|
7
7
|
*/
|
|
8
8
|
async function scrapeWebsite(params) {
|
|
9
|
-
|
|
9
|
+
const p = params.params ?? {};
|
|
10
|
+
return (0, api_1.post)("/execute/firecrawl", {
|
|
11
|
+
url: params.url,
|
|
12
|
+
limit: p.limit ?? 1,
|
|
13
|
+
scrapeOptions: {
|
|
14
|
+
formats: ["markdown", "links"],
|
|
15
|
+
timeout: 30000,
|
|
16
|
+
skipTlsVerification: true,
|
|
17
|
+
onlyMainContent: false,
|
|
18
|
+
removeBase64Images: true,
|
|
19
|
+
blockAds: true,
|
|
20
|
+
storeInCache: true,
|
|
21
|
+
maxAge: 172800000,
|
|
22
|
+
...p
|
|
23
|
+
}
|
|
24
|
+
});
|
|
10
25
|
}
|
package/dist/generateObject.js
CHANGED
|
@@ -21,5 +21,9 @@ const api_1 = require("./api");
|
|
|
21
21
|
* // { object: { company: "Apple Inc", year: 1976, founder: "Steve Jobs" } }
|
|
22
22
|
*/
|
|
23
23
|
async function generateObject(options) {
|
|
24
|
-
return (0, api_1.post)("
|
|
24
|
+
return (0, api_1.post)("/execute/llm", {
|
|
25
|
+
mode: "object",
|
|
26
|
+
prompt: options.prompt,
|
|
27
|
+
schemaJson: options.schema
|
|
28
|
+
});
|
|
25
29
|
}
|
package/dist/googleMaps.js
CHANGED
|
@@ -3,6 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.googleMapsScrape = googleMapsScrape;
|
|
4
4
|
const api_1 = require("./api");
|
|
5
5
|
async function googleMapsScrape(params) {
|
|
6
|
-
|
|
7
|
-
return (0, api_1.post)("googleMaps", { ...params });
|
|
6
|
+
return (0, api_1.post)("/execute/google-maps", { ...params });
|
|
8
7
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { configure } from "./api";
|
|
2
|
+
export type { OrangesliceConfig } from "./api";
|
|
1
3
|
export { linkedinSearch } from "./b2b";
|
|
2
4
|
export type { LinkedInSearchParams, LinkedInSearchResponse } from "./b2b";
|
|
3
5
|
export { webSearch, webBatchSearch } from "./serp";
|
|
@@ -12,16 +14,18 @@ export { runApifyActor } from "./apify";
|
|
|
12
14
|
export type { RunActorParams, RunActorResult, DatasetListParams } from "./apify";
|
|
13
15
|
export { googleMapsScrape } from "./googleMaps";
|
|
14
16
|
export type { GoogleMapsScrapeParams } from "./googleMaps";
|
|
17
|
+
export { executePredictLeads, predictLeads, PREDICT_LEADS_OPERATION_IDS } from "./predictLeads";
|
|
18
|
+
export type { PredictLeadsMethodName, PredictLeadsParams, PredictLeadsServiceMap } from "./predictLeads";
|
|
15
19
|
export { personLinkedinEnrich, personLinkedinFindUrl, personContactGet, companyLinkedinEnrich, companyLinkedinFindUrl, companyGetEmployeesFromLinkedin, geoParseAddress, builtWithLookupDomain, builtWithRelationships, builtWithSearchByTech } from "./expansion";
|
|
16
20
|
export type { PersonLinkedinFindUrlParams, CompanyLinkedinFindUrlParams, PersonContactGetParams, PersonContactGetResult, CompanyGetEmployeesFromLinkedinParams, CompanyGetEmployeesFromLinkedinResult, CompanyEmployeeFromB2B } from "./expansion";
|
|
21
|
+
import { runApifyActor } from "./apify";
|
|
17
22
|
import { linkedinSearch } from "./b2b";
|
|
18
|
-
import { webBatchSearch, webSearch } from "./serp";
|
|
19
|
-
import { generateObject } from "./generateObject";
|
|
20
|
-
import { scrapeWebsite } from "./firecrawl";
|
|
21
23
|
import { browserExecute } from "./browser";
|
|
22
|
-
import { runApifyActor } from "./apify";
|
|
23
|
-
import { googleMapsScrape } from "./googleMaps";
|
|
24
24
|
import { personLinkedinEnrich, personLinkedinFindUrl, personContactGet, companyLinkedinEnrich, companyLinkedinFindUrl, companyGetEmployeesFromLinkedin, geoParseAddress, builtWithLookupDomain, builtWithRelationships, builtWithSearchByTech } from "./expansion";
|
|
25
|
+
import { scrapeWebsite } from "./firecrawl";
|
|
26
|
+
import { generateObject } from "./generateObject";
|
|
27
|
+
import { googleMapsScrape } from "./googleMaps";
|
|
28
|
+
import { webBatchSearch, webSearch } from "./serp";
|
|
25
29
|
export declare const services: {
|
|
26
30
|
company: {
|
|
27
31
|
linkedin: {
|
|
@@ -68,5 +72,6 @@ export declare const services: {
|
|
|
68
72
|
relationships: typeof builtWithRelationships;
|
|
69
73
|
searchByTech: typeof builtWithSearchByTech;
|
|
70
74
|
};
|
|
75
|
+
predictLeads: Readonly<import("./predictLeads").PredictLeadsServiceMap>;
|
|
71
76
|
};
|
|
72
77
|
export default services;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.services = exports.builtWithSearchByTech = exports.builtWithRelationships = exports.builtWithLookupDomain = exports.geoParseAddress = exports.companyGetEmployeesFromLinkedin = exports.companyLinkedinFindUrl = exports.companyLinkedinEnrich = exports.personContactGet = exports.personLinkedinFindUrl = exports.personLinkedinEnrich = exports.googleMapsScrape = exports.runApifyActor = exports.browserExecute = exports.scrapeWebsite = exports.generateObject = exports.webBatchSearch = exports.webSearch = exports.linkedinSearch = void 0;
|
|
3
|
+
exports.services = exports.builtWithSearchByTech = exports.builtWithRelationships = exports.builtWithLookupDomain = exports.geoParseAddress = exports.companyGetEmployeesFromLinkedin = exports.companyLinkedinFindUrl = exports.companyLinkedinEnrich = exports.personContactGet = exports.personLinkedinFindUrl = exports.personLinkedinEnrich = exports.PREDICT_LEADS_OPERATION_IDS = exports.predictLeads = exports.executePredictLeads = exports.googleMapsScrape = exports.runApifyActor = exports.browserExecute = exports.scrapeWebsite = exports.generateObject = exports.webBatchSearch = exports.webSearch = exports.linkedinSearch = exports.configure = void 0;
|
|
4
|
+
var api_1 = require("./api");
|
|
5
|
+
Object.defineProperty(exports, "configure", { enumerable: true, get: function () { return api_1.configure; } });
|
|
4
6
|
var b2b_1 = require("./b2b");
|
|
5
7
|
Object.defineProperty(exports, "linkedinSearch", { enumerable: true, get: function () { return b2b_1.linkedinSearch; } });
|
|
6
8
|
var serp_1 = require("./serp");
|
|
@@ -16,6 +18,10 @@ var apify_1 = require("./apify");
|
|
|
16
18
|
Object.defineProperty(exports, "runApifyActor", { enumerable: true, get: function () { return apify_1.runApifyActor; } });
|
|
17
19
|
var googleMaps_1 = require("./googleMaps");
|
|
18
20
|
Object.defineProperty(exports, "googleMapsScrape", { enumerable: true, get: function () { return googleMaps_1.googleMapsScrape; } });
|
|
21
|
+
var predictLeads_1 = require("./predictLeads");
|
|
22
|
+
Object.defineProperty(exports, "executePredictLeads", { enumerable: true, get: function () { return predictLeads_1.executePredictLeads; } });
|
|
23
|
+
Object.defineProperty(exports, "predictLeads", { enumerable: true, get: function () { return predictLeads_1.predictLeads; } });
|
|
24
|
+
Object.defineProperty(exports, "PREDICT_LEADS_OPERATION_IDS", { enumerable: true, get: function () { return predictLeads_1.PREDICT_LEADS_OPERATION_IDS; } });
|
|
19
25
|
var expansion_1 = require("./expansion");
|
|
20
26
|
Object.defineProperty(exports, "personLinkedinEnrich", { enumerable: true, get: function () { return expansion_1.personLinkedinEnrich; } });
|
|
21
27
|
Object.defineProperty(exports, "personLinkedinFindUrl", { enumerable: true, get: function () { return expansion_1.personLinkedinFindUrl; } });
|
|
@@ -27,14 +33,15 @@ Object.defineProperty(exports, "geoParseAddress", { enumerable: true, get: funct
|
|
|
27
33
|
Object.defineProperty(exports, "builtWithLookupDomain", { enumerable: true, get: function () { return expansion_1.builtWithLookupDomain; } });
|
|
28
34
|
Object.defineProperty(exports, "builtWithRelationships", { enumerable: true, get: function () { return expansion_1.builtWithRelationships; } });
|
|
29
35
|
Object.defineProperty(exports, "builtWithSearchByTech", { enumerable: true, get: function () { return expansion_1.builtWithSearchByTech; } });
|
|
36
|
+
const apify_2 = require("./apify");
|
|
30
37
|
const b2b_2 = require("./b2b");
|
|
31
|
-
const serp_2 = require("./serp");
|
|
32
|
-
const generateObject_2 = require("./generateObject");
|
|
33
|
-
const firecrawl_2 = require("./firecrawl");
|
|
34
38
|
const browser_2 = require("./browser");
|
|
35
|
-
const apify_2 = require("./apify");
|
|
36
|
-
const googleMaps_2 = require("./googleMaps");
|
|
37
39
|
const expansion_2 = require("./expansion");
|
|
40
|
+
const firecrawl_2 = require("./firecrawl");
|
|
41
|
+
const generateObject_2 = require("./generateObject");
|
|
42
|
+
const googleMaps_2 = require("./googleMaps");
|
|
43
|
+
const predictLeads_2 = require("./predictLeads");
|
|
44
|
+
const serp_2 = require("./serp");
|
|
38
45
|
exports.services = {
|
|
39
46
|
company: {
|
|
40
47
|
linkedin: {
|
|
@@ -80,6 +87,7 @@ exports.services = {
|
|
|
80
87
|
lookupDomain: expansion_2.builtWithLookupDomain,
|
|
81
88
|
relationships: expansion_2.builtWithRelationships,
|
|
82
89
|
searchByTech: expansion_2.builtWithSearchByTech
|
|
83
|
-
}
|
|
90
|
+
},
|
|
91
|
+
predictLeads: predictLeads_2.predictLeads
|
|
84
92
|
};
|
|
85
93
|
exports.default = exports.services;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const PREDICT_LEADS_OPERATION_IDS: {
|
|
2
|
+
readonly apiSubscription: "api_subscription";
|
|
3
|
+
readonly companies: "companies";
|
|
4
|
+
readonly company: "company";
|
|
5
|
+
readonly companyConnections: "company_connections";
|
|
6
|
+
readonly companyFinancingEvents: "company_financing_events";
|
|
7
|
+
readonly companyGithubRepositories: "company_github_repositories";
|
|
8
|
+
readonly companyJobOpenings: "company_job_openings";
|
|
9
|
+
readonly companyNewsEvents: "company_news_events";
|
|
10
|
+
readonly companyProducts: "company_products";
|
|
11
|
+
readonly companySimilarCompanies: "company_similar_companies";
|
|
12
|
+
readonly companyTechnologyDetections: "company_technology_detections";
|
|
13
|
+
readonly companyWebsiteEvolution: "company_website_evolution";
|
|
14
|
+
readonly discoverConnectionInvestors: "discover_connection_investors";
|
|
15
|
+
readonly discoverJobOpenings: "discover_job_openings";
|
|
16
|
+
readonly discoverProducts: "discover_products";
|
|
17
|
+
readonly discoverTechnologyTechnologyDetections: "discover_technology_technology_detections";
|
|
18
|
+
readonly financingEvents: "financing_events";
|
|
19
|
+
readonly followCompany: "follow_company";
|
|
20
|
+
readonly followedCompanies: "followed_companies";
|
|
21
|
+
readonly jobOpening: "job_opening";
|
|
22
|
+
readonly newsEvent: "news_event";
|
|
23
|
+
readonly newsEvents: "news_events";
|
|
24
|
+
readonly product: "product";
|
|
25
|
+
readonly startupPlatformPosts: "startup_platform_posts";
|
|
26
|
+
readonly technologies: "technologies";
|
|
27
|
+
readonly technology: "technology";
|
|
28
|
+
readonly unfollowCompany: "unfollow_company";
|
|
29
|
+
};
|
|
30
|
+
export type PredictLeadsMethodName = keyof typeof PREDICT_LEADS_OPERATION_IDS;
|
|
31
|
+
export type PredictLeadsParams = Record<string, unknown>;
|
|
32
|
+
export type PredictLeadsServiceMap = {
|
|
33
|
+
[K in PredictLeadsMethodName]: (params?: PredictLeadsParams) => Promise<unknown>;
|
|
34
|
+
};
|
|
35
|
+
export declare function executePredictLeads(operationId: (typeof PREDICT_LEADS_OPERATION_IDS)[PredictLeadsMethodName], params?: PredictLeadsParams): Promise<unknown>;
|
|
36
|
+
export declare const predictLeads: Readonly<PredictLeadsServiceMap>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.predictLeads = exports.PREDICT_LEADS_OPERATION_IDS = void 0;
|
|
4
|
+
exports.executePredictLeads = executePredictLeads;
|
|
5
|
+
const api_1 = require("./api");
|
|
6
|
+
exports.PREDICT_LEADS_OPERATION_IDS = {
|
|
7
|
+
apiSubscription: "api_subscription",
|
|
8
|
+
companies: "companies",
|
|
9
|
+
company: "company",
|
|
10
|
+
companyConnections: "company_connections",
|
|
11
|
+
companyFinancingEvents: "company_financing_events",
|
|
12
|
+
companyGithubRepositories: "company_github_repositories",
|
|
13
|
+
companyJobOpenings: "company_job_openings",
|
|
14
|
+
companyNewsEvents: "company_news_events",
|
|
15
|
+
companyProducts: "company_products",
|
|
16
|
+
companySimilarCompanies: "company_similar_companies",
|
|
17
|
+
companyTechnologyDetections: "company_technology_detections",
|
|
18
|
+
companyWebsiteEvolution: "company_website_evolution",
|
|
19
|
+
discoverConnectionInvestors: "discover_connection_investors",
|
|
20
|
+
discoverJobOpenings: "discover_job_openings",
|
|
21
|
+
discoverProducts: "discover_products",
|
|
22
|
+
discoverTechnologyTechnologyDetections: "discover_technology_technology_detections",
|
|
23
|
+
financingEvents: "financing_events",
|
|
24
|
+
followCompany: "follow_company",
|
|
25
|
+
followedCompanies: "followed_companies",
|
|
26
|
+
jobOpening: "job_opening",
|
|
27
|
+
newsEvent: "news_event",
|
|
28
|
+
newsEvents: "news_events",
|
|
29
|
+
product: "product",
|
|
30
|
+
startupPlatformPosts: "startup_platform_posts",
|
|
31
|
+
technologies: "technologies",
|
|
32
|
+
technology: "technology",
|
|
33
|
+
unfollowCompany: "unfollow_company"
|
|
34
|
+
};
|
|
35
|
+
async function executePredictLeads(operationId, params) {
|
|
36
|
+
return (0, api_1.post)("/execute/predictleads", {
|
|
37
|
+
operationId,
|
|
38
|
+
params: params ?? {}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
exports.predictLeads = Object.freeze(Object.fromEntries(Object.entries(exports.PREDICT_LEADS_OPERATION_IDS).map(([methodName, operationId]) => [
|
|
42
|
+
methodName,
|
|
43
|
+
async (params) => executePredictLeads(operationId, params)
|
|
44
|
+
])));
|
package/dist/serp.js
CHANGED
|
@@ -10,7 +10,7 @@ const api_1 = require("./api");
|
|
|
10
10
|
* const page = await webSearch({ query: "best CRM software 2025" });
|
|
11
11
|
*/
|
|
12
12
|
async function webSearch(params) {
|
|
13
|
-
return (0, api_1.post)("
|
|
13
|
+
return (0, api_1.post)("/execute/serp", { ...params });
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* services.web.batchSearch
|
|
@@ -19,6 +19,8 @@ async function webSearch(params) {
|
|
|
19
19
|
* const pages = await webBatchSearch({ queries: [{ query: "site:linkedin.com/in stripe" }] });
|
|
20
20
|
*/
|
|
21
21
|
async function webBatchSearch(params) {
|
|
22
|
-
const data = await (0, api_1.post)("
|
|
22
|
+
const data = await (0, api_1.post)("/execute/serp-batch", {
|
|
23
|
+
queries: params.queries
|
|
24
|
+
});
|
|
23
25
|
return Array.isArray(data) ? data : data.results ?? [];
|
|
24
26
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Gmail email sending via Google integration
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Gmail Integration
|
|
6
|
+
|
|
7
|
+
Typed functions for Gmail actions powered by Orange Slice Google integrations.
|
|
8
|
+
|
|
9
|
+
## Email
|
|
10
|
+
|
|
11
|
+
- `integrations.gmail.sendEmail(input)` - Send an email through the connected Gmail account
|
|
12
|
+
- Heavy rate limit: `sendEmail` is capped at **20 calls/day** per connected Gmail account
|