orangeslice 2.1.5 → 2.3.0-beta.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 +3 -1
- package/dist/careers.d.ts +47 -0
- package/dist/careers.js +11 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +29 -3
- package/dist/integrations.d.ts +60 -0
- package/dist/integrations.js +106 -0
- package/dist/ocean.d.ts +160 -0
- package/dist/ocean.js +23 -0
- package/dist/skills.d.ts +57 -0
- package/dist/skills.js +33 -0
- package/docs/data-enrichement/index.md +10 -2
- package/docs/integrations/gmail/createDraft.md +54 -0
- package/docs/integrations/gmail/fetchEmails.md +50 -0
- package/docs/integrations/gmail/fetchMessageByMessageId.md +36 -0
- package/docs/integrations/gmail/fetchMessageByThreadId.md +37 -0
- package/docs/integrations/gmail/getProfile.md +37 -0
- package/docs/integrations/gmail/index.md +19 -2
- package/docs/integrations/gmail/listLabels.md +34 -0
- package/docs/integrations/gmail/replyToThread.md +51 -0
- package/docs/integrations/index.md +14 -1
- package/docs/lookalike-search/index.md +24 -12
- package/docs/prospecting/index.md +2 -2
- package/docs/services/builtWith/index.md +2 -2
- package/docs/services/company/findCareersPage.md +137 -0
- package/docs/services/company/findCareersPage.ts +37 -0
- package/docs/services/company/linkedin/enrich.md +47 -1
- package/docs/services/company/scrapeCareersPage.md +150 -0
- package/docs/services/index.md +2 -2
- package/docs/services/ocean/search/companies.ts +122 -119
- package/docs/services/person/linkedin/findUrl.md +2 -2
- package/docs/services/predictLeads/companyJobOpenings.ts +168 -94
- package/docs/services/web/search.md +29 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,8 +90,10 @@ const startups = await services.crunchbase.search({
|
|
|
90
90
|
## Service map
|
|
91
91
|
|
|
92
92
|
- `services.company.linkedin.search/enrich`
|
|
93
|
+
- `services.company.findCareersPage/scrapeCareersPage`
|
|
93
94
|
- `services.crunchbase.search` (returns rows array directly)
|
|
94
95
|
- `services.company.getEmployeesFromLinkedin` (database-only B2B path)
|
|
96
|
+
- `services.ocean.search.companies/people`
|
|
95
97
|
- `services.person.linkedin.search/enrich`
|
|
96
98
|
- `services.web.search/batchSearch`
|
|
97
99
|
- `services.ai.generateObject`
|
|
@@ -106,7 +108,7 @@ const startups = await services.crunchbase.search({
|
|
|
106
108
|
|
|
107
109
|
All service calls go through `post()` in `src/api.ts`.
|
|
108
110
|
|
|
109
|
-
-
|
|
111
|
+
- Execute paths: `https://enrichly-production.up.railway.app/execute/*` and `https://enrichly-production.up.railway.app/ctx/*`
|
|
110
112
|
- Pending responses (`pending: true` / `202`) poll batch-service result endpoints.
|
|
111
113
|
- Polling timeout supports long-running workflows (up to 10 minutes).
|
|
112
114
|
- This package now exposes only batch-backed services.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface FindCareersPageParams {
|
|
2
|
+
website?: string;
|
|
3
|
+
url?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface FindCareersPageResult {
|
|
6
|
+
inputUrl: string;
|
|
7
|
+
normalizedWebsiteUrl: string;
|
|
8
|
+
careerPageUrl: string | null;
|
|
9
|
+
pageType: "ats" | "official" | "not_found";
|
|
10
|
+
atsProvider: string | null;
|
|
11
|
+
detectionMethod: "input-ats" | "homepage-ats-link" | "homepage-careers-link" | "deterministic-candidate" | "candidate-ats-link" | "embedded-ats" | "candidate-redirect" | "ats-unverified" | "not-found";
|
|
12
|
+
checkedUrls: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface ScrapeCareersPageParams {
|
|
15
|
+
careersPageUrl?: string;
|
|
16
|
+
url?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ScrapeCareersPageJob {
|
|
19
|
+
id: string;
|
|
20
|
+
title: string;
|
|
21
|
+
url: string;
|
|
22
|
+
applyUrl: string | null;
|
|
23
|
+
location: string | null;
|
|
24
|
+
locations: string[];
|
|
25
|
+
department: string | null;
|
|
26
|
+
team: string | null;
|
|
27
|
+
employmentType: string | null;
|
|
28
|
+
workplaceType: string | null;
|
|
29
|
+
postedAt: string | null;
|
|
30
|
+
postedText: string | null;
|
|
31
|
+
requisitionId: string | null;
|
|
32
|
+
}
|
|
33
|
+
export interface ScrapeCareersPageResult {
|
|
34
|
+
status: "success" | "unsupported_url" | "unsupported_provider";
|
|
35
|
+
inputUrl: string;
|
|
36
|
+
normalizedBoardUrl: string | null;
|
|
37
|
+
atsProvider: string | null;
|
|
38
|
+
companyName: string | null;
|
|
39
|
+
source: "api" | "html" | null;
|
|
40
|
+
totalJobs: number;
|
|
41
|
+
jobs: ScrapeCareersPageJob[];
|
|
42
|
+
checkedUrls: string[];
|
|
43
|
+
supportedProviders: string[];
|
|
44
|
+
message: string | null;
|
|
45
|
+
}
|
|
46
|
+
export declare function findCareersPage(params: FindCareersPageParams): Promise<FindCareersPageResult>;
|
|
47
|
+
export declare function scrapeCareersPage(params: ScrapeCareersPageParams): Promise<ScrapeCareersPageResult>;
|
package/dist/careers.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findCareersPage = findCareersPage;
|
|
4
|
+
exports.scrapeCareersPage = scrapeCareersPage;
|
|
5
|
+
const api_1 = require("./api");
|
|
6
|
+
async function findCareersPage(params) {
|
|
7
|
+
return (0, api_1.post)("/execute/find-careers-page", { ...params });
|
|
8
|
+
}
|
|
9
|
+
async function scrapeCareersPage(params) {
|
|
10
|
+
return (0, api_1.post)("/execute/scrape-careers-page", { ...params });
|
|
11
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
export { configure } from "./api";
|
|
2
2
|
export type { OrangesliceConfig } from "./api";
|
|
3
|
+
export { integrations } from "./integrations";
|
|
4
|
+
export type { Integration, IntegrationProvider, IntegrationListParams, IntegrationCreateParams, IntegrationUpdateParams, IntegrationConnectOptions } from "./integrations";
|
|
5
|
+
export { skills } from "./skills";
|
|
6
|
+
export type { Skill, SkillListParams, SkillCreateParams, SkillUpdateParams } from "./skills";
|
|
7
|
+
export { findCareersPage, scrapeCareersPage } from "./careers";
|
|
8
|
+
export type { FindCareersPageParams, FindCareersPageResult, ScrapeCareersPageParams, ScrapeCareersPageResult, ScrapeCareersPageJob } from "./careers";
|
|
3
9
|
export { ctx } from "./ctx";
|
|
4
10
|
export type { Spreadsheet, SpreadsheetListItem, SqlResult, SqlQueryResult, SqlActionResult, RowsAddResult } from "./ctx";
|
|
5
11
|
export { linkedinSearch } from "./b2b";
|
|
6
12
|
export type { LinkedInSearchParams, LinkedInSearchResponse } from "./b2b";
|
|
7
13
|
export { crunchbaseSearch } from "./crunchbase";
|
|
8
14
|
export type { CrunchbaseSearchParams } from "./crunchbase";
|
|
15
|
+
export { executeOcean, oceanSearchCompanies, oceanSearchPeople, OCEAN_OPERATION_IDS } from "./ocean";
|
|
16
|
+
export type { OceanOperationId, OceanCompaniesFilters, OceanPeopleFilters, OceanCompaniesSearchParams, OceanCompaniesSearchResponse, OceanCompanyResult, OceanCompanyMatch, OceanPeopleSearchParams, OceanPeopleSearchResponse, OceanPersonResult } from "./ocean";
|
|
9
17
|
export { webSearch, webBatchSearch } from "./serp";
|
|
10
18
|
export type { WebSearchQuery, WebSearchResult, WebSearchResponse, BatchWebSearchParams } from "./serp";
|
|
11
19
|
export { generateObject } from "./generateObject";
|
|
@@ -25,11 +33,13 @@ export type { PersonLinkedinFindUrlParams, CompanyLinkedinFindUrlParams, PersonC
|
|
|
25
33
|
import { runApifyActor } from "./apify";
|
|
26
34
|
import { linkedinSearch } from "./b2b";
|
|
27
35
|
import { browserExecute } from "./browser";
|
|
36
|
+
import { findCareersPage, scrapeCareersPage } from "./careers";
|
|
28
37
|
import { crunchbaseSearch } from "./crunchbase";
|
|
29
38
|
import { personLinkedinEnrich, personLinkedinFindUrl, personContactGet, companyLinkedinEnrich, companyLinkedinFindUrl, companyGetEmployeesFromLinkedin, geoParseAddress, builtWithLookupDomain, builtWithRelationships, builtWithSearchByTech } from "./expansion";
|
|
30
39
|
import { scrapeWebsite } from "./firecrawl";
|
|
31
40
|
import { generateObject } from "./generateObject";
|
|
32
41
|
import { googleMapsScrape } from "./googleMaps";
|
|
42
|
+
import { oceanSearchCompanies, oceanSearchPeople } from "./ocean";
|
|
33
43
|
import { webBatchSearch, webSearch } from "./serp";
|
|
34
44
|
export declare const services: {
|
|
35
45
|
crunchbase: {
|
|
@@ -42,6 +52,8 @@ export declare const services: {
|
|
|
42
52
|
search: typeof linkedinSearch;
|
|
43
53
|
};
|
|
44
54
|
getEmployeesFromLinkedin: typeof companyGetEmployeesFromLinkedin;
|
|
55
|
+
findCareersPage: typeof findCareersPage;
|
|
56
|
+
scrapeCareersPage: typeof scrapeCareersPage;
|
|
45
57
|
};
|
|
46
58
|
person: {
|
|
47
59
|
linkedin: {
|
|
@@ -75,11 +87,40 @@ export declare const services: {
|
|
|
75
87
|
googleMaps: {
|
|
76
88
|
scrape: typeof googleMapsScrape;
|
|
77
89
|
};
|
|
90
|
+
ocean: {
|
|
91
|
+
search: {
|
|
92
|
+
companies: typeof oceanSearchCompanies;
|
|
93
|
+
people: typeof oceanSearchPeople;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
78
96
|
builtWith: {
|
|
79
97
|
lookupDomain: typeof builtWithLookupDomain;
|
|
80
98
|
relationships: typeof builtWithRelationships;
|
|
81
99
|
searchByTech: typeof builtWithSearchByTech;
|
|
82
100
|
};
|
|
83
101
|
predictLeads: Readonly<import("./predictLeads").PredictLeadsServiceMap>;
|
|
102
|
+
integrations: {
|
|
103
|
+
connect: (provider: import("./integrations").IntegrationProvider, opts?: import("./integrations").IntegrationConnectOptions) => Promise<import("./integrations").Integration>;
|
|
104
|
+
list: (opts?: import("./integrations").IntegrationListParams) => Promise<{
|
|
105
|
+
integrations: import("./integrations").Integration[];
|
|
106
|
+
}>;
|
|
107
|
+
get: (id: string) => Promise<import("./integrations").Integration>;
|
|
108
|
+
create: (opts: import("./integrations").IntegrationCreateParams) => Promise<import("./integrations").Integration>;
|
|
109
|
+
update: (id: string, fields: import("./integrations").IntegrationUpdateParams) => Promise<import("./integrations").Integration>;
|
|
110
|
+
delete: (id: string) => Promise<{
|
|
111
|
+
success: boolean;
|
|
112
|
+
}>;
|
|
113
|
+
};
|
|
114
|
+
skills: {
|
|
115
|
+
list: (opts?: import("./skills").SkillListParams) => Promise<{
|
|
116
|
+
skills: import("./skills").Skill[];
|
|
117
|
+
}>;
|
|
118
|
+
get: (id: string) => Promise<import("./skills").Skill>;
|
|
119
|
+
create: (opts: import("./skills").SkillCreateParams) => Promise<import("./skills").Skill>;
|
|
120
|
+
update: (id: string, fields: import("./skills").SkillUpdateParams) => Promise<import("./skills").Skill>;
|
|
121
|
+
delete: (id: string) => Promise<{
|
|
122
|
+
success: boolean;
|
|
123
|
+
}>;
|
|
124
|
+
};
|
|
84
125
|
};
|
|
85
126
|
export default services;
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
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.PREDICT_LEADS_OPERATION_IDS = exports.predictLeads = exports.executePredictLeads = exports.googleMapsScrape = exports.runApifyActor = exports.browserExecute = exports.scrapeWebsite = exports.generateObject = exports.webBatchSearch = exports.webSearch = exports.crunchbaseSearch = exports.linkedinSearch = exports.ctx = exports.configure = 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.OCEAN_OPERATION_IDS = exports.oceanSearchPeople = exports.oceanSearchCompanies = exports.executeOcean = exports.crunchbaseSearch = exports.linkedinSearch = exports.ctx = exports.scrapeCareersPage = exports.findCareersPage = exports.skills = exports.integrations = exports.configure = void 0;
|
|
4
4
|
var api_1 = require("./api");
|
|
5
5
|
Object.defineProperty(exports, "configure", { enumerable: true, get: function () { return api_1.configure; } });
|
|
6
|
+
var integrations_1 = require("./integrations");
|
|
7
|
+
Object.defineProperty(exports, "integrations", { enumerable: true, get: function () { return integrations_1.integrations; } });
|
|
8
|
+
var skills_1 = require("./skills");
|
|
9
|
+
Object.defineProperty(exports, "skills", { enumerable: true, get: function () { return skills_1.skills; } });
|
|
10
|
+
var careers_1 = require("./careers");
|
|
11
|
+
Object.defineProperty(exports, "findCareersPage", { enumerable: true, get: function () { return careers_1.findCareersPage; } });
|
|
12
|
+
Object.defineProperty(exports, "scrapeCareersPage", { enumerable: true, get: function () { return careers_1.scrapeCareersPage; } });
|
|
6
13
|
var ctx_1 = require("./ctx");
|
|
7
14
|
Object.defineProperty(exports, "ctx", { enumerable: true, get: function () { return ctx_1.ctx; } });
|
|
8
15
|
var b2b_1 = require("./b2b");
|
|
9
16
|
Object.defineProperty(exports, "linkedinSearch", { enumerable: true, get: function () { return b2b_1.linkedinSearch; } });
|
|
10
17
|
var crunchbase_1 = require("./crunchbase");
|
|
11
18
|
Object.defineProperty(exports, "crunchbaseSearch", { enumerable: true, get: function () { return crunchbase_1.crunchbaseSearch; } });
|
|
19
|
+
var ocean_1 = require("./ocean");
|
|
20
|
+
Object.defineProperty(exports, "executeOcean", { enumerable: true, get: function () { return ocean_1.executeOcean; } });
|
|
21
|
+
Object.defineProperty(exports, "oceanSearchCompanies", { enumerable: true, get: function () { return ocean_1.oceanSearchCompanies; } });
|
|
22
|
+
Object.defineProperty(exports, "oceanSearchPeople", { enumerable: true, get: function () { return ocean_1.oceanSearchPeople; } });
|
|
23
|
+
Object.defineProperty(exports, "OCEAN_OPERATION_IDS", { enumerable: true, get: function () { return ocean_1.OCEAN_OPERATION_IDS; } });
|
|
12
24
|
var serp_1 = require("./serp");
|
|
13
25
|
Object.defineProperty(exports, "webSearch", { enumerable: true, get: function () { return serp_1.webSearch; } });
|
|
14
26
|
Object.defineProperty(exports, "webBatchSearch", { enumerable: true, get: function () { return serp_1.webBatchSearch; } });
|
|
@@ -40,11 +52,15 @@ Object.defineProperty(exports, "builtWithSearchByTech", { enumerable: true, get:
|
|
|
40
52
|
const apify_2 = require("./apify");
|
|
41
53
|
const b2b_2 = require("./b2b");
|
|
42
54
|
const browser_2 = require("./browser");
|
|
55
|
+
const careers_2 = require("./careers");
|
|
43
56
|
const crunchbase_2 = require("./crunchbase");
|
|
57
|
+
const integrations_2 = require("./integrations");
|
|
58
|
+
const skills_2 = require("./skills");
|
|
44
59
|
const expansion_2 = require("./expansion");
|
|
45
60
|
const firecrawl_2 = require("./firecrawl");
|
|
46
61
|
const generateObject_2 = require("./generateObject");
|
|
47
62
|
const googleMaps_2 = require("./googleMaps");
|
|
63
|
+
const ocean_2 = require("./ocean");
|
|
48
64
|
const predictLeads_2 = require("./predictLeads");
|
|
49
65
|
const serp_2 = require("./serp");
|
|
50
66
|
exports.services = {
|
|
@@ -57,7 +73,9 @@ exports.services = {
|
|
|
57
73
|
enrich: expansion_2.companyLinkedinEnrich,
|
|
58
74
|
search: b2b_2.linkedinSearch
|
|
59
75
|
},
|
|
60
|
-
getEmployeesFromLinkedin: expansion_2.companyGetEmployeesFromLinkedin
|
|
76
|
+
getEmployeesFromLinkedin: expansion_2.companyGetEmployeesFromLinkedin,
|
|
77
|
+
findCareersPage: careers_2.findCareersPage,
|
|
78
|
+
scrapeCareersPage: careers_2.scrapeCareersPage
|
|
61
79
|
},
|
|
62
80
|
person: {
|
|
63
81
|
linkedin: {
|
|
@@ -91,11 +109,19 @@ exports.services = {
|
|
|
91
109
|
googleMaps: {
|
|
92
110
|
scrape: googleMaps_2.googleMapsScrape
|
|
93
111
|
},
|
|
112
|
+
ocean: {
|
|
113
|
+
search: {
|
|
114
|
+
companies: ocean_2.oceanSearchCompanies,
|
|
115
|
+
people: ocean_2.oceanSearchPeople
|
|
116
|
+
}
|
|
117
|
+
},
|
|
94
118
|
builtWith: {
|
|
95
119
|
lookupDomain: expansion_2.builtWithLookupDomain,
|
|
96
120
|
relationships: expansion_2.builtWithRelationships,
|
|
97
121
|
searchByTech: expansion_2.builtWithSearchByTech
|
|
98
122
|
},
|
|
99
|
-
predictLeads: predictLeads_2.predictLeads
|
|
123
|
+
predictLeads: predictLeads_2.predictLeads,
|
|
124
|
+
integrations: integrations_2.integrations,
|
|
125
|
+
skills: skills_2.skills
|
|
100
126
|
};
|
|
101
127
|
exports.default = exports.services;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integrations API for the orangeslice SDK.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* import { integrations } from "orangeslice";
|
|
6
|
+
*
|
|
7
|
+
* // Connect an OAuth provider (opens browser)
|
|
8
|
+
* const hubspot = await integrations.connect("hubspot");
|
|
9
|
+
*
|
|
10
|
+
* // List connected integrations
|
|
11
|
+
* const { integrations: list } = await integrations.list();
|
|
12
|
+
*
|
|
13
|
+
* // Programmatic API-key create (no browser)
|
|
14
|
+
* await integrations.create({ provider: "instantly", apiKey: "inst_..." });
|
|
15
|
+
*/
|
|
16
|
+
export type IntegrationProvider = "hubspot" | "salesforce" | "attio" | "gmail" | "slack" | "instantly" | "heyreach";
|
|
17
|
+
export interface Integration {
|
|
18
|
+
id: string;
|
|
19
|
+
provider: string;
|
|
20
|
+
displayName: string;
|
|
21
|
+
isActive: boolean;
|
|
22
|
+
hasApiKey: boolean;
|
|
23
|
+
hasOauthToken: boolean;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
scope: "account" | "spreadsheet";
|
|
27
|
+
spreadsheetId?: string | null;
|
|
28
|
+
}
|
|
29
|
+
export interface IntegrationListParams {
|
|
30
|
+
spreadsheetId?: string;
|
|
31
|
+
provider?: IntegrationProvider;
|
|
32
|
+
}
|
|
33
|
+
export interface IntegrationCreateParams {
|
|
34
|
+
provider: IntegrationProvider;
|
|
35
|
+
apiKey: string;
|
|
36
|
+
displayName?: string;
|
|
37
|
+
config?: Record<string, string>;
|
|
38
|
+
spreadsheetId?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface IntegrationUpdateParams {
|
|
41
|
+
apiKey?: string;
|
|
42
|
+
displayName?: string;
|
|
43
|
+
isActive?: boolean;
|
|
44
|
+
config?: Record<string, string>;
|
|
45
|
+
}
|
|
46
|
+
export interface IntegrationConnectOptions {
|
|
47
|
+
noBrowser?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export declare const integrations: {
|
|
50
|
+
connect: (provider: IntegrationProvider, opts?: IntegrationConnectOptions) => Promise<Integration>;
|
|
51
|
+
list: (opts?: IntegrationListParams) => Promise<{
|
|
52
|
+
integrations: Integration[];
|
|
53
|
+
}>;
|
|
54
|
+
get: (id: string) => Promise<Integration>;
|
|
55
|
+
create: (opts: IntegrationCreateParams) => Promise<Integration>;
|
|
56
|
+
update: (id: string, fields: IntegrationUpdateParams) => Promise<Integration>;
|
|
57
|
+
delete: (id: string) => Promise<{
|
|
58
|
+
success: boolean;
|
|
59
|
+
}>;
|
|
60
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Integrations API for the orangeslice SDK.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* import { integrations } from "orangeslice";
|
|
7
|
+
*
|
|
8
|
+
* // Connect an OAuth provider (opens browser)
|
|
9
|
+
* const hubspot = await integrations.connect("hubspot");
|
|
10
|
+
*
|
|
11
|
+
* // List connected integrations
|
|
12
|
+
* const { integrations: list } = await integrations.list();
|
|
13
|
+
*
|
|
14
|
+
* // Programmatic API-key create (no browser)
|
|
15
|
+
* await integrations.create({ provider: "instantly", apiKey: "inst_..." });
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.integrations = void 0;
|
|
19
|
+
const api_1 = require("./api");
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
// Constants
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
const AUTH_BASE_URL = "https://www.orangeslice.ai";
|
|
24
|
+
const CONNECT_POLL_TIMEOUT_MS = 600000;
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
// Browser helper (same as cli.ts)
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
function openBrowser(url) {
|
|
29
|
+
if (!process?.versions?.node) {
|
|
30
|
+
console.log(` Open this URL in your browser:\n ${url}\n`);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
const { execFileSync } = require("child_process");
|
|
35
|
+
if (process.platform === "darwin") {
|
|
36
|
+
execFileSync("open", [url], { stdio: "ignore" });
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (process.platform === "win32") {
|
|
40
|
+
execFileSync("cmd.exe", ["/c", "start", "", url], { stdio: "ignore" });
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
execFileSync("xdg-open", [url], { stdio: "ignore" });
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
console.log(` Open this URL in your browser:\n ${url}\n`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function sleep(ms) {
|
|
50
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
51
|
+
}
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
// Connect (device flow via Next.js)
|
|
54
|
+
// ---------------------------------------------------------------------------
|
|
55
|
+
async function connectIntegration(provider, opts) {
|
|
56
|
+
const startRes = await fetch(`${AUTH_BASE_URL}/api/orangeslice/integrations/connect/start`, {
|
|
57
|
+
method: "POST",
|
|
58
|
+
headers: { "Content-Type": "application/json" },
|
|
59
|
+
body: JSON.stringify({ provider })
|
|
60
|
+
});
|
|
61
|
+
if (!startRes.ok) {
|
|
62
|
+
const data = (await startRes.json().catch(() => ({})));
|
|
63
|
+
throw new Error(`[orangeslice] integrations.connect: ${data.error || "Failed to start connect flow"}`);
|
|
64
|
+
}
|
|
65
|
+
const start = (await startRes.json());
|
|
66
|
+
if (opts?.noBrowser) {
|
|
67
|
+
console.log(` Open this URL to connect ${provider}:\n ${start.verificationUrl}\n`);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
openBrowser(start.verificationUrl);
|
|
71
|
+
console.log(` Browser opened. Complete ${provider} authorization there, then return here.\n`);
|
|
72
|
+
}
|
|
73
|
+
const timeoutAt = Date.now() + CONNECT_POLL_TIMEOUT_MS;
|
|
74
|
+
let pollInterval = start.pollIntervalMs > 0 ? start.pollIntervalMs : 1000;
|
|
75
|
+
while (Date.now() < timeoutAt) {
|
|
76
|
+
await sleep(pollInterval);
|
|
77
|
+
const pollRes = await fetch(`${AUTH_BASE_URL}/api/orangeslice/integrations/connect/poll?deviceCode=${encodeURIComponent(start.deviceCode)}`, { method: "GET", headers: { "Content-Type": "application/json" } });
|
|
78
|
+
const data = (await pollRes.json());
|
|
79
|
+
if (data.status === "pending")
|
|
80
|
+
continue;
|
|
81
|
+
if (data.status === "approved" && data.integration) {
|
|
82
|
+
return data.integration;
|
|
83
|
+
}
|
|
84
|
+
if (data.status === "expired") {
|
|
85
|
+
throw new Error(`[orangeslice] integrations.connect: Device code expired. Please try again.`);
|
|
86
|
+
}
|
|
87
|
+
if (data.status === "consumed") {
|
|
88
|
+
throw new Error(`[orangeslice] integrations.connect: Device code already used.`);
|
|
89
|
+
}
|
|
90
|
+
if (!pollRes.ok) {
|
|
91
|
+
throw new Error(`[orangeslice] integrations.connect: ${data.error || "Polling failed"}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
throw new Error(`[orangeslice] integrations.connect: Timed out waiting for authorization.`);
|
|
95
|
+
}
|
|
96
|
+
// ---------------------------------------------------------------------------
|
|
97
|
+
// CRUD (via batch-service)
|
|
98
|
+
// ---------------------------------------------------------------------------
|
|
99
|
+
exports.integrations = {
|
|
100
|
+
connect: (provider, opts) => connectIntegration(provider, opts),
|
|
101
|
+
list: (opts) => (0, api_1.post)("/ctx/integrations/list", (opts ?? {})),
|
|
102
|
+
get: (id) => (0, api_1.post)("/ctx/integrations/get", { id }),
|
|
103
|
+
create: (opts) => (0, api_1.post)("/ctx/integrations/create", opts),
|
|
104
|
+
update: (id, fields) => (0, api_1.post)("/ctx/integrations/update", { id, ...fields }),
|
|
105
|
+
delete: (id) => (0, api_1.post)("/ctx/integrations/delete", { id })
|
|
106
|
+
};
|
package/dist/ocean.d.ts
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
export declare const OCEAN_OPERATION_IDS: {
|
|
2
|
+
readonly searchCompanies: "search-companies";
|
|
3
|
+
readonly searchPeople: "search-people";
|
|
4
|
+
};
|
|
5
|
+
export type OceanOperationId = (typeof OCEAN_OPERATION_IDS)[keyof typeof OCEAN_OPERATION_IDS];
|
|
6
|
+
export interface OceanCompaniesFilters {
|
|
7
|
+
lookalikeDomains?: string[];
|
|
8
|
+
companySizes?: Array<"0-1" | "2-10" | "11-50" | "51-200" | "201-500" | "501-1000" | "1001-5000" | "5001-10000" | "10001+">;
|
|
9
|
+
countries?: string[];
|
|
10
|
+
industries?: string[];
|
|
11
|
+
ecommerce?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface OceanPeopleFilters {
|
|
14
|
+
seniorities?: string[];
|
|
15
|
+
departments?: string[];
|
|
16
|
+
jobTitleKeywords?: string[];
|
|
17
|
+
countries?: string[];
|
|
18
|
+
lookalikePeopleIds?: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface OceanCompaniesSearchParams {
|
|
21
|
+
companiesFilters?: OceanCompaniesFilters;
|
|
22
|
+
peopleFilters?: OceanPeopleFilters;
|
|
23
|
+
size?: number;
|
|
24
|
+
searchAfter?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface OceanPhone {
|
|
27
|
+
country?: string;
|
|
28
|
+
number: string;
|
|
29
|
+
primary?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface OceanMediaProfile {
|
|
32
|
+
url?: string;
|
|
33
|
+
handle?: string;
|
|
34
|
+
name?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface OceanLocation {
|
|
37
|
+
primary?: boolean;
|
|
38
|
+
latitude?: number;
|
|
39
|
+
longitude?: number;
|
|
40
|
+
country?: string;
|
|
41
|
+
locality?: string;
|
|
42
|
+
region?: string;
|
|
43
|
+
postalCode?: string;
|
|
44
|
+
streetAddress?: string;
|
|
45
|
+
state?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface OceanDepartmentSize {
|
|
48
|
+
department: string;
|
|
49
|
+
size: number;
|
|
50
|
+
}
|
|
51
|
+
export interface OceanHeadcountGrowth {
|
|
52
|
+
threeMonths?: number;
|
|
53
|
+
threeMonthsPercentage?: number;
|
|
54
|
+
sixMonths?: number;
|
|
55
|
+
sixMonthsPercentage?: number;
|
|
56
|
+
twelveMonths?: number;
|
|
57
|
+
twelveMonthsPercentage?: number;
|
|
58
|
+
}
|
|
59
|
+
export interface OceanCompanyResult {
|
|
60
|
+
domain: string;
|
|
61
|
+
name?: string;
|
|
62
|
+
legalName?: string;
|
|
63
|
+
description?: string;
|
|
64
|
+
countries?: string[];
|
|
65
|
+
primaryCountry?: string;
|
|
66
|
+
companySize?: string;
|
|
67
|
+
industryCategories?: string[];
|
|
68
|
+
industries?: string[];
|
|
69
|
+
linkedinIndustry?: string;
|
|
70
|
+
ecommerce?: boolean;
|
|
71
|
+
keywords?: string[];
|
|
72
|
+
employeeCountOcean?: number;
|
|
73
|
+
employeeCountLinkedin?: number;
|
|
74
|
+
revenue?: string;
|
|
75
|
+
yearFounded?: number;
|
|
76
|
+
emails?: string[];
|
|
77
|
+
phones?: OceanPhone[];
|
|
78
|
+
logo?: string;
|
|
79
|
+
technologies?: string[];
|
|
80
|
+
technologyCategories?: string[];
|
|
81
|
+
rootUrl?: string;
|
|
82
|
+
medias?: Record<string, OceanMediaProfile>;
|
|
83
|
+
locations?: OceanLocation[];
|
|
84
|
+
departmentSizes?: OceanDepartmentSize[];
|
|
85
|
+
headcountGrowth?: OceanHeadcountGrowth;
|
|
86
|
+
updatedAt?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface OceanCompanyMatch {
|
|
89
|
+
company: OceanCompanyResult;
|
|
90
|
+
relevance?: string;
|
|
91
|
+
}
|
|
92
|
+
export interface OceanCompaniesSearchResponse {
|
|
93
|
+
detail?: string;
|
|
94
|
+
total: number;
|
|
95
|
+
searchAfter?: string;
|
|
96
|
+
companies: OceanCompanyMatch[];
|
|
97
|
+
redirectMap?: Record<string, string>;
|
|
98
|
+
}
|
|
99
|
+
export interface OceanPersonExperience {
|
|
100
|
+
dateFrom?: string;
|
|
101
|
+
dateTo?: string;
|
|
102
|
+
description?: string;
|
|
103
|
+
domain?: string;
|
|
104
|
+
jobTitle?: string;
|
|
105
|
+
}
|
|
106
|
+
export interface OceanContactField {
|
|
107
|
+
address?: string;
|
|
108
|
+
status?: string;
|
|
109
|
+
}
|
|
110
|
+
export interface OceanPhoneField {
|
|
111
|
+
numbers?: string[];
|
|
112
|
+
status?: string;
|
|
113
|
+
}
|
|
114
|
+
export interface OceanPersonCompanySnapshot {
|
|
115
|
+
companySize?: string;
|
|
116
|
+
logo?: string;
|
|
117
|
+
name?: string;
|
|
118
|
+
}
|
|
119
|
+
export interface OceanPersonResult {
|
|
120
|
+
id: string;
|
|
121
|
+
domain?: string;
|
|
122
|
+
name?: string;
|
|
123
|
+
firstName?: string;
|
|
124
|
+
lastName?: string;
|
|
125
|
+
country?: string;
|
|
126
|
+
state?: string;
|
|
127
|
+
location?: string;
|
|
128
|
+
linkedinUrl?: string;
|
|
129
|
+
seniorities?: string[];
|
|
130
|
+
departments?: string[];
|
|
131
|
+
photo?: string;
|
|
132
|
+
jobTitle?: string;
|
|
133
|
+
jobTitleEnglish?: string;
|
|
134
|
+
currentJobDescription?: string;
|
|
135
|
+
experiences?: OceanPersonExperience[];
|
|
136
|
+
summary?: string;
|
|
137
|
+
skills?: string[];
|
|
138
|
+
phone?: OceanPhoneField;
|
|
139
|
+
email?: OceanContactField;
|
|
140
|
+
updatedAt?: string;
|
|
141
|
+
company?: OceanPersonCompanySnapshot;
|
|
142
|
+
}
|
|
143
|
+
export interface OceanPeopleSearchParams {
|
|
144
|
+
companiesFilters?: OceanCompaniesFilters;
|
|
145
|
+
peopleFilters?: OceanPeopleFilters;
|
|
146
|
+
size?: number;
|
|
147
|
+
from?: number;
|
|
148
|
+
searchAfter?: string;
|
|
149
|
+
enableEmailSearch?: boolean;
|
|
150
|
+
enablePhoneSearch?: boolean;
|
|
151
|
+
}
|
|
152
|
+
export interface OceanPeopleSearchResponse {
|
|
153
|
+
total: number;
|
|
154
|
+
searchAfter?: string;
|
|
155
|
+
people: OceanPersonResult[];
|
|
156
|
+
redirectMap?: Record<string, string>;
|
|
157
|
+
}
|
|
158
|
+
export declare function executeOcean<T = unknown>(operationId: OceanOperationId, params?: Record<string, unknown>): Promise<T>;
|
|
159
|
+
export declare function oceanSearchCompanies(params: OceanCompaniesSearchParams): Promise<OceanCompaniesSearchResponse>;
|
|
160
|
+
export declare function oceanSearchPeople(params: OceanPeopleSearchParams): Promise<OceanPeopleSearchResponse>;
|
package/dist/ocean.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OCEAN_OPERATION_IDS = void 0;
|
|
4
|
+
exports.executeOcean = executeOcean;
|
|
5
|
+
exports.oceanSearchCompanies = oceanSearchCompanies;
|
|
6
|
+
exports.oceanSearchPeople = oceanSearchPeople;
|
|
7
|
+
const api_1 = require("./api");
|
|
8
|
+
exports.OCEAN_OPERATION_IDS = {
|
|
9
|
+
searchCompanies: "search-companies",
|
|
10
|
+
searchPeople: "search-people"
|
|
11
|
+
};
|
|
12
|
+
async function executeOcean(operationId, params) {
|
|
13
|
+
return (0, api_1.post)("/execute/oceanio", {
|
|
14
|
+
operationId,
|
|
15
|
+
params: params ?? {}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
async function oceanSearchCompanies(params) {
|
|
19
|
+
return executeOcean(exports.OCEAN_OPERATION_IDS.searchCompanies, params);
|
|
20
|
+
}
|
|
21
|
+
async function oceanSearchPeople(params) {
|
|
22
|
+
return executeOcean(exports.OCEAN_OPERATION_IDS.searchPeople, params);
|
|
23
|
+
}
|
package/dist/skills.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge Skills API for the orangeslice SDK.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* import { skills } from "orangeslice";
|
|
6
|
+
*
|
|
7
|
+
* // Create a skill
|
|
8
|
+
* const skill = await skills.create({
|
|
9
|
+
* title: "CRM Mapping",
|
|
10
|
+
* description: "Maps company fields to HubSpot properties",
|
|
11
|
+
* content: "When pushing to HubSpot, map ...",
|
|
12
|
+
* });
|
|
13
|
+
*
|
|
14
|
+
* // List all skills
|
|
15
|
+
* const { skills: list } = await skills.list();
|
|
16
|
+
*
|
|
17
|
+
* // Update a skill
|
|
18
|
+
* await skills.update(skill.id, { autoInject: true });
|
|
19
|
+
*/
|
|
20
|
+
export interface Skill {
|
|
21
|
+
id: string;
|
|
22
|
+
title: string;
|
|
23
|
+
description: string;
|
|
24
|
+
content: string;
|
|
25
|
+
autoInject: boolean;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
updatedAt: string;
|
|
28
|
+
scope: "account" | "spreadsheet";
|
|
29
|
+
spreadsheetId?: string | null;
|
|
30
|
+
}
|
|
31
|
+
export interface SkillListParams {
|
|
32
|
+
spreadsheetId?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface SkillCreateParams {
|
|
35
|
+
title: string;
|
|
36
|
+
description: string;
|
|
37
|
+
content: string;
|
|
38
|
+
autoInject?: boolean;
|
|
39
|
+
spreadsheetId?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface SkillUpdateParams {
|
|
42
|
+
title?: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
content?: string;
|
|
45
|
+
autoInject?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export declare const skills: {
|
|
48
|
+
list: (opts?: SkillListParams) => Promise<{
|
|
49
|
+
skills: Skill[];
|
|
50
|
+
}>;
|
|
51
|
+
get: (id: string) => Promise<Skill>;
|
|
52
|
+
create: (opts: SkillCreateParams) => Promise<Skill>;
|
|
53
|
+
update: (id: string, fields: SkillUpdateParams) => Promise<Skill>;
|
|
54
|
+
delete: (id: string) => Promise<{
|
|
55
|
+
success: boolean;
|
|
56
|
+
}>;
|
|
57
|
+
};
|