gtm-now 0.8.0 → 0.8.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/index.js +42 -22
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9026,9 +9026,9 @@ var init_disco = __esm({
|
|
|
9026
9026
|
function mapSeniority(values) {
|
|
9027
9027
|
if (!values?.length) return void 0;
|
|
9028
9028
|
const mapped = values.map((v) => SENIORITY_TO_PROSPEO[v] ?? v);
|
|
9029
|
-
return [...new Set(mapped)];
|
|
9029
|
+
return { include: [...new Set(mapped)] };
|
|
9030
9030
|
}
|
|
9031
|
-
function
|
|
9031
|
+
function mapHeadcount(min, max) {
|
|
9032
9032
|
if (min == null && max == null) return void 0;
|
|
9033
9033
|
return { ...min != null && { min }, ...max != null && { max } };
|
|
9034
9034
|
}
|
|
@@ -9054,7 +9054,7 @@ var init_prospeo2 = __esm({
|
|
|
9054
9054
|
ProspeoMcpAdapter = class {
|
|
9055
9055
|
name = "prospeo";
|
|
9056
9056
|
capabilities = ["find_people", "enrich_email"];
|
|
9057
|
-
notes = "Best for: city-level people search with industry/seniority/
|
|
9057
|
+
notes = "Best for: city-level people search with industry/seniority/headcount filters, email enrichment, company technology detection. 200M+ contacts. Note: search emails are masked until revealed with credits.";
|
|
9058
9058
|
client;
|
|
9059
9059
|
constructor(apiKey) {
|
|
9060
9060
|
this.client = new ProspeoClient({ apiKey });
|
|
@@ -9076,25 +9076,38 @@ var init_prospeo2 = __esm({
|
|
|
9076
9076
|
const info = await this.client.getAccountInfo();
|
|
9077
9077
|
return { remaining: info.credits, unit: "credits", provider: this.name };
|
|
9078
9078
|
} catch (error) {
|
|
9079
|
-
logError(
|
|
9079
|
+
logError(
|
|
9080
|
+
"prospeo:checkCredits",
|
|
9081
|
+
error instanceof Error ? error : new Error(String(error))
|
|
9082
|
+
);
|
|
9080
9083
|
return null;
|
|
9081
9084
|
}
|
|
9082
9085
|
}
|
|
9083
9086
|
// ─── PeopleFinder ────────────────────────────────────────
|
|
9084
9087
|
async findPeople(query) {
|
|
9085
9088
|
const filters = {};
|
|
9086
|
-
if (query.job_title)
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
if (query.
|
|
9089
|
+
if (query.job_title) {
|
|
9090
|
+
filters.person_job_title = { include: [query.job_title] };
|
|
9091
|
+
}
|
|
9092
|
+
if (query.seniority) {
|
|
9093
|
+
filters.person_seniority = mapSeniority(query.seniority);
|
|
9094
|
+
}
|
|
9095
|
+
if (query.department?.length) {
|
|
9096
|
+
filters.person_department = query.department[0];
|
|
9097
|
+
}
|
|
9098
|
+
if (query.location) {
|
|
9099
|
+
filters.person_location_search = { include: [query.location] };
|
|
9100
|
+
}
|
|
9090
9101
|
if (query.company_domain) filters.company = query.company_domain;
|
|
9091
9102
|
if (query.company_domains?.length) filters.company = query.company_domains[0];
|
|
9092
|
-
if (query.company_name
|
|
9103
|
+
if (query.company_name && !query.company_domain && !query.company_domains?.length) {
|
|
9104
|
+
filters.company = query.company_name;
|
|
9105
|
+
}
|
|
9093
9106
|
if (query.filter_industry?.length) {
|
|
9094
9107
|
filters.company_industry = { include: query.filter_industry };
|
|
9095
9108
|
}
|
|
9096
9109
|
if (query.min_employees != null || query.max_employees != null) {
|
|
9097
|
-
filters.company_headcount_custom =
|
|
9110
|
+
filters.company_headcount_custom = mapHeadcount(
|
|
9098
9111
|
query.min_employees,
|
|
9099
9112
|
query.max_employees
|
|
9100
9113
|
);
|
|
@@ -9104,19 +9117,23 @@ var init_prospeo2 = __esm({
|
|
|
9104
9117
|
}
|
|
9105
9118
|
const page = query.offset ? Math.floor(query.offset / (query.limit ?? 25)) + 1 : 1;
|
|
9106
9119
|
const response = await this.client.searchPeople({ page, filters });
|
|
9107
|
-
if (response.error || !response.
|
|
9108
|
-
return response.
|
|
9120
|
+
if (response.error || !response.results?.length) return [];
|
|
9121
|
+
return response.results.map((r) => ({
|
|
9109
9122
|
first_name: r.person?.first_name ?? "",
|
|
9110
9123
|
last_name: r.person?.last_name ?? "",
|
|
9111
|
-
job_title: r.person?.
|
|
9112
|
-
company: r.company?.name,
|
|
9113
|
-
company_domain: r.company?.domain,
|
|
9114
|
-
email: r.person?.email,
|
|
9115
|
-
phone: r.person?.
|
|
9116
|
-
linkedin_url: r.person?.linkedin_url,
|
|
9117
|
-
seniority: r.person?.seniority,
|
|
9118
|
-
department: r.person?.
|
|
9119
|
-
location: r.person?.location
|
|
9124
|
+
job_title: r.person?.current_job_title ?? void 0,
|
|
9125
|
+
company: r.company?.name ?? void 0,
|
|
9126
|
+
company_domain: r.company?.domain ?? void 0,
|
|
9127
|
+
email: r.person?.email?.email ?? void 0,
|
|
9128
|
+
phone: r.person?.mobile?.mobile ?? void 0,
|
|
9129
|
+
linkedin_url: r.person?.linkedin_url ?? void 0,
|
|
9130
|
+
seniority: r.person?.job_history?.[0]?.seniority ?? void 0,
|
|
9131
|
+
department: r.person?.job_history?.[0]?.departments?.[0] ?? void 0,
|
|
9132
|
+
location: r.person?.location ? [
|
|
9133
|
+
r.person.location.city,
|
|
9134
|
+
r.person.location.state,
|
|
9135
|
+
r.person.location.country
|
|
9136
|
+
].filter(Boolean).join(", ") : void 0,
|
|
9120
9137
|
sources: [this.name]
|
|
9121
9138
|
}));
|
|
9122
9139
|
}
|
|
@@ -9137,7 +9154,10 @@ var init_prospeo2 = __esm({
|
|
|
9137
9154
|
provider: this.name
|
|
9138
9155
|
};
|
|
9139
9156
|
} catch (error) {
|
|
9140
|
-
logError(
|
|
9157
|
+
logError(
|
|
9158
|
+
"prospeo:enrichEmail",
|
|
9159
|
+
error instanceof Error ? error : new Error(String(error))
|
|
9160
|
+
);
|
|
9141
9161
|
return null;
|
|
9142
9162
|
}
|
|
9143
9163
|
}
|