gtm-now 0.7.0 → 0.7.3
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 +140 -79
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8067,19 +8067,8 @@ var init_client12 = __esm({
|
|
|
8067
8067
|
return this.request("/search-person", {
|
|
8068
8068
|
method: "POST",
|
|
8069
8069
|
body: JSON.stringify({
|
|
8070
|
-
|
|
8071
|
-
|
|
8072
|
-
...query.seniority?.length && { seniority: query.seniority },
|
|
8073
|
-
...query.department?.length && { department: query.department },
|
|
8074
|
-
...query.location?.length && { location: query.location },
|
|
8075
|
-
...query.company_name && { company_name: query.company_name },
|
|
8076
|
-
...query.company_domain && { company_domain: query.company_domain },
|
|
8077
|
-
...query.industry?.length && { industry: query.industry },
|
|
8078
|
-
...query.company_size?.length && { company_size: query.company_size },
|
|
8079
|
-
...query.keywords?.length && { keywords: query.keywords }
|
|
8080
|
-
},
|
|
8081
|
-
limit: query.limit ?? 25,
|
|
8082
|
-
offset: query.offset ?? 0
|
|
8070
|
+
page: query.page ?? 1,
|
|
8071
|
+
filters: query.filters
|
|
8083
8072
|
})
|
|
8084
8073
|
});
|
|
8085
8074
|
}
|
|
@@ -8753,10 +8742,30 @@ var init_bettercontact = __esm({
|
|
|
8753
8742
|
|
|
8754
8743
|
// src/providers/adapters/disco.ts
|
|
8755
8744
|
function mapSeniority(values) {
|
|
8756
|
-
if (!values
|
|
8745
|
+
if (!values?.length) return void 0;
|
|
8757
8746
|
const mapped = values.map((v) => SENIORITY_TO_DISCO[v] ?? v);
|
|
8758
8747
|
return [...new Set(mapped)];
|
|
8759
8748
|
}
|
|
8749
|
+
function buildGrowthSignals(data) {
|
|
8750
|
+
if (!data) return void 0;
|
|
8751
|
+
const signals = {
|
|
8752
|
+
quarterly_growth: data.quarterly_growth,
|
|
8753
|
+
growth_trend: data.growth_trend,
|
|
8754
|
+
digital_footprint_score: data.digital_footprint_score,
|
|
8755
|
+
digital_footprint_trend: data.digital_footprint_trend
|
|
8756
|
+
};
|
|
8757
|
+
return Object.values(signals).some((v) => v != null) ? signals : void 0;
|
|
8758
|
+
}
|
|
8759
|
+
function buildEngagementMetrics(data) {
|
|
8760
|
+
if (!data) return void 0;
|
|
8761
|
+
const metrics = {
|
|
8762
|
+
traffic_estimate: data.traffic_estimate,
|
|
8763
|
+
social_presence: data.social_presence,
|
|
8764
|
+
monthly_visitors: data.monthly_visitors,
|
|
8765
|
+
bounce_rate: data.bounce_rate
|
|
8766
|
+
};
|
|
8767
|
+
return Object.values(metrics).some((v) => v != null) ? metrics : void 0;
|
|
8768
|
+
}
|
|
8760
8769
|
function parseName(fullName) {
|
|
8761
8770
|
const parts = fullName.trim().split(/\s+/);
|
|
8762
8771
|
if (parts.length === 0) return { first: "", last: "" };
|
|
@@ -8870,7 +8879,9 @@ var init_disco = __esm({
|
|
|
8870
8879
|
country: c.address?.country,
|
|
8871
8880
|
linkedin_url: c.social_urls?.find((u) => u.includes("linkedin")),
|
|
8872
8881
|
score: c.score,
|
|
8873
|
-
tech_stack:
|
|
8882
|
+
tech_stack: void 0,
|
|
8883
|
+
// Discovery doesn't have vendor data; keywords are not tech_stack
|
|
8884
|
+
keywords: c.keywords ? Object.keys(c.keywords) : void 0,
|
|
8874
8885
|
sources: [this.name]
|
|
8875
8886
|
}));
|
|
8876
8887
|
}
|
|
@@ -8900,9 +8911,8 @@ var init_disco = __esm({
|
|
|
8900
8911
|
const growthData = growth.status === "fulfilled" ? growth.value : void 0;
|
|
8901
8912
|
const vendorsData = vendors.status === "fulfilled" ? vendors.value : void 0;
|
|
8902
8913
|
const metricsData = metrics.status === "fulfilled" ? metrics.value : void 0;
|
|
8903
|
-
const keywordTech = data.keywords ? Object.keys(data.keywords) : [];
|
|
8904
8914
|
const vendorTech = vendorsData?.vendors?.map((v) => v.name) ?? [];
|
|
8905
|
-
const
|
|
8915
|
+
const keywordList = data.keywords ? Object.keys(data.keywords) : [];
|
|
8906
8916
|
return {
|
|
8907
8917
|
domain: data.domain,
|
|
8908
8918
|
name: data.name,
|
|
@@ -8911,15 +8921,10 @@ var init_disco = __esm({
|
|
|
8911
8921
|
employees: data.employees ? parseInt(data.employees, 10) || void 0 : void 0,
|
|
8912
8922
|
country: data.address?.country,
|
|
8913
8923
|
linkedin_url: data.social_urls?.find((u) => u.includes("linkedin")),
|
|
8914
|
-
tech_stack:
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8918
|
-
} : void 0,
|
|
8919
|
-
engagement_metrics: metricsData ? {
|
|
8920
|
-
traffic_estimate: metricsData.traffic_estimate,
|
|
8921
|
-
social_presence: metricsData.social_presence
|
|
8922
|
-
} : void 0,
|
|
8924
|
+
tech_stack: vendorTech.length > 0 ? vendorTech : void 0,
|
|
8925
|
+
keywords: keywordList.length > 0 ? keywordList : void 0,
|
|
8926
|
+
growth_signals: buildGrowthSignals(growthData),
|
|
8927
|
+
engagement_metrics: buildEngagementMetrics(metricsData),
|
|
8923
8928
|
sources: [this.name]
|
|
8924
8929
|
};
|
|
8925
8930
|
} catch (error) {
|
|
@@ -8970,6 +8975,7 @@ var init_disco = __esm({
|
|
|
8970
8975
|
skills: c.skills,
|
|
8971
8976
|
connections: c.connections,
|
|
8972
8977
|
location: c.country,
|
|
8978
|
+
industry: Array.isArray(c.industry) ? c.industry[0] : c.industry,
|
|
8973
8979
|
sources: [this.name]
|
|
8974
8980
|
};
|
|
8975
8981
|
});
|
|
@@ -9032,20 +9038,10 @@ var init_disco = __esm({
|
|
|
9032
9038
|
});
|
|
9033
9039
|
|
|
9034
9040
|
// src/providers/adapters/prospeo.ts
|
|
9035
|
-
function
|
|
9036
|
-
if (!values
|
|
9041
|
+
function mapSeniority2(values) {
|
|
9042
|
+
if (!values?.length) return void 0;
|
|
9037
9043
|
const mapped = values.map((v) => SENIORITY_TO_PROSPEO[v] ?? v);
|
|
9038
|
-
return [...new Set(mapped)];
|
|
9039
|
-
}
|
|
9040
|
-
function mapEmployeeRange(min, max) {
|
|
9041
|
-
if (min == null && max == null) return void 0;
|
|
9042
|
-
const ranges = ["1-10", "11-50", "51-200", "201-500", "501-1000", "1001-5000", "5001+"];
|
|
9043
|
-
return ranges.filter((r) => {
|
|
9044
|
-
const parts = r.replace("+", "").split("-").map(Number);
|
|
9045
|
-
const lo = parts[0] ?? 0;
|
|
9046
|
-
const hi = parts[1] ?? 1e5;
|
|
9047
|
-
return (min == null || hi >= min) && (max == null || lo <= max);
|
|
9048
|
-
});
|
|
9044
|
+
return { include: [...new Set(mapped)] };
|
|
9049
9045
|
}
|
|
9050
9046
|
var SENIORITY_TO_PROSPEO, ProspeoMcpAdapter;
|
|
9051
9047
|
var init_prospeo2 = __esm({
|
|
@@ -9054,19 +9050,22 @@ var init_prospeo2 = __esm({
|
|
|
9054
9050
|
init_dist();
|
|
9055
9051
|
init_dist2();
|
|
9056
9052
|
SENIORITY_TO_PROSPEO = {
|
|
9057
|
-
c_suite: "
|
|
9058
|
-
founder: "
|
|
9059
|
-
owner: "
|
|
9060
|
-
partner: "
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
|
|
9053
|
+
c_suite: "C-Suite",
|
|
9054
|
+
founder: "C-Suite",
|
|
9055
|
+
owner: "C-Suite",
|
|
9056
|
+
partner: "C-Suite",
|
|
9057
|
+
vp: "VP",
|
|
9058
|
+
head: "Director",
|
|
9059
|
+
director: "Director",
|
|
9060
|
+
manager: "Manager",
|
|
9061
|
+
senior: "Senior",
|
|
9062
|
+
entry: "Entry",
|
|
9063
|
+
intern: "Entry"
|
|
9065
9064
|
};
|
|
9066
9065
|
ProspeoMcpAdapter = class {
|
|
9067
9066
|
name = "prospeo";
|
|
9068
9067
|
capabilities = ["find_people", "enrich_email"];
|
|
9069
|
-
notes = "Best for: city-level people search
|
|
9068
|
+
notes = "Best for: city-level people search with industry/seniority/headcount filters, email enrichment, company technology detection, funding data. 200M+ contacts.";
|
|
9070
9069
|
client;
|
|
9071
9070
|
constructor(apiKey) {
|
|
9072
9071
|
this.client = new ProspeoClient({ apiKey });
|
|
@@ -9086,11 +9085,7 @@ var init_prospeo2 = __esm({
|
|
|
9086
9085
|
async checkCredits() {
|
|
9087
9086
|
try {
|
|
9088
9087
|
const info = await this.client.getAccountInfo();
|
|
9089
|
-
return {
|
|
9090
|
-
remaining: info.credits,
|
|
9091
|
-
unit: "credits",
|
|
9092
|
-
provider: this.name
|
|
9093
|
-
};
|
|
9088
|
+
return { remaining: info.credits, unit: "credits", provider: this.name };
|
|
9094
9089
|
} catch (error) {
|
|
9095
9090
|
logError("prospeo:checkCredits", error instanceof Error ? error : new Error(String(error)));
|
|
9096
9091
|
return null;
|
|
@@ -9098,30 +9093,52 @@ var init_prospeo2 = __esm({
|
|
|
9098
9093
|
}
|
|
9099
9094
|
// ─── PeopleFinder ────────────────────────────────────────
|
|
9100
9095
|
async findPeople(query) {
|
|
9101
|
-
const
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
company
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
|
|
9096
|
+
const filters = {};
|
|
9097
|
+
if (query.job_title) {
|
|
9098
|
+
filters.person_job_title = { include: [query.job_title] };
|
|
9099
|
+
}
|
|
9100
|
+
if (query.seniority) {
|
|
9101
|
+
filters.person_seniority = mapSeniority2(query.seniority);
|
|
9102
|
+
}
|
|
9103
|
+
if (query.department?.length) {
|
|
9104
|
+
filters.person_department = query.department[0];
|
|
9105
|
+
}
|
|
9106
|
+
if (query.location) {
|
|
9107
|
+
filters.person_location_search = { include: [query.location] };
|
|
9108
|
+
}
|
|
9109
|
+
if (query.company_domain) filters.company = query.company_domain;
|
|
9110
|
+
if (query.company_domains?.length) filters.company = query.company_domains[0];
|
|
9111
|
+
if (query.company_name && !query.company_domain && !query.company_domains?.length) {
|
|
9112
|
+
filters.company = query.company_name;
|
|
9113
|
+
}
|
|
9114
|
+
if (query.filter_industry?.length) {
|
|
9115
|
+
filters.company_industry = { include: query.filter_industry };
|
|
9116
|
+
}
|
|
9117
|
+
if (query.min_employees != null || query.max_employees != null) {
|
|
9118
|
+
filters.company_headcount_custom = {
|
|
9119
|
+
...query.min_employees != null && { min: query.min_employees },
|
|
9120
|
+
...query.max_employees != null && { max: query.max_employees }
|
|
9121
|
+
};
|
|
9122
|
+
}
|
|
9123
|
+
if (query.skills?.length) {
|
|
9124
|
+
filters.company_keywords = { include: query.skills };
|
|
9125
|
+
}
|
|
9126
|
+
const page = query.offset ? Math.floor(query.offset / (query.limit ?? 25)) + 1 : 1;
|
|
9127
|
+
const response = await this.client.searchPeople({ page, filters });
|
|
9128
|
+
if (response.error || !response.results?.length) return [];
|
|
9129
|
+
return response.results.map((r) => ({
|
|
9130
|
+
first_name: r.person?.first_name ?? "",
|
|
9131
|
+
last_name: r.person?.last_name ?? "",
|
|
9132
|
+
job_title: r.person?.current_job_title ?? void 0,
|
|
9133
|
+
company: r.company?.name ?? void 0,
|
|
9134
|
+
company_domain: r.company?.domain ?? void 0,
|
|
9135
|
+
// Email is masked until revealed — show what we have
|
|
9136
|
+
email: r.person?.email?.email ?? void 0,
|
|
9137
|
+
phone: r.person?.mobile?.mobile ?? void 0,
|
|
9138
|
+
linkedin_url: r.person?.linkedin_url ?? void 0,
|
|
9139
|
+
seniority: r.person?.job_history?.[0]?.seniority ?? void 0,
|
|
9140
|
+
department: r.person?.job_history?.[0]?.departments?.[0] ?? void 0,
|
|
9141
|
+
location: r.person?.location ? [r.person.location.city, r.person.location.state, r.person.location.country].filter(Boolean).join(", ") : void 0,
|
|
9125
9142
|
sources: [this.name]
|
|
9126
9143
|
}));
|
|
9127
9144
|
}
|
|
@@ -9984,11 +10001,21 @@ async function findCompanies(args, ctx) {
|
|
|
9984
10001
|
});
|
|
9985
10002
|
const limit = args.limit ?? 50;
|
|
9986
10003
|
const offset = args.offset ?? 0;
|
|
10004
|
+
const applied_filters = {};
|
|
10005
|
+
if (query.icp_text) applied_filters.icp_text = query.icp_text;
|
|
10006
|
+
if (query.domain) applied_filters.domain = query.domain;
|
|
10007
|
+
if (query.domains?.length) applied_filters.domains = query.domains;
|
|
10008
|
+
if (query.country) applied_filters.country = query.country;
|
|
10009
|
+
if (query.category) applied_filters.category = query.category;
|
|
10010
|
+
if (query.tech_stack?.length) applied_filters.tech_stack = query.tech_stack;
|
|
10011
|
+
if (query.min_employees != null) applied_filters.min_employees = query.min_employees;
|
|
10012
|
+
if (query.max_employees != null) applied_filters.max_employees = query.max_employees;
|
|
9987
10013
|
return {
|
|
9988
10014
|
provider: provider.name,
|
|
9989
10015
|
count: results.length,
|
|
9990
10016
|
has_more: results.length >= limit,
|
|
9991
10017
|
offset,
|
|
10018
|
+
...Object.keys(applied_filters).length > 0 && { applied_filters },
|
|
9992
10019
|
companies: slimmedResults
|
|
9993
10020
|
};
|
|
9994
10021
|
}
|
|
@@ -10036,11 +10063,26 @@ async function findPeople(args, ctx) {
|
|
|
10036
10063
|
});
|
|
10037
10064
|
const limit = args.limit ?? 25;
|
|
10038
10065
|
const offset = args.offset ?? 0;
|
|
10066
|
+
const applied_filters = {};
|
|
10067
|
+
if (query.job_title) applied_filters.job_title = query.job_title;
|
|
10068
|
+
if (query.company_name) applied_filters.company_name = query.company_name;
|
|
10069
|
+
if (query.company_domain) applied_filters.company_domain = query.company_domain;
|
|
10070
|
+
if (query.company_domains?.length) applied_filters.company_domains = query.company_domains;
|
|
10071
|
+
if (query.seniority?.length) applied_filters.seniority = query.seniority;
|
|
10072
|
+
if (query.department?.length) applied_filters.department = query.department;
|
|
10073
|
+
if (query.filter_industry?.length) applied_filters.filter_industry = query.filter_industry;
|
|
10074
|
+
if (query.skills?.length) applied_filters.skills = query.skills;
|
|
10075
|
+
if (query.location) applied_filters.location = query.location;
|
|
10076
|
+
if (query.email_validated) applied_filters.email_validated = query.email_validated;
|
|
10077
|
+
if (query.min_employees != null) applied_filters.min_employees = query.min_employees;
|
|
10078
|
+
if (query.max_employees != null) applied_filters.max_employees = query.max_employees;
|
|
10079
|
+
if (query.revenue_range) applied_filters.revenue_range = query.revenue_range;
|
|
10039
10080
|
return {
|
|
10040
10081
|
provider: provider.name,
|
|
10041
10082
|
count: dedupedResults.length,
|
|
10042
10083
|
has_more: dedupedResults.length >= limit,
|
|
10043
10084
|
offset,
|
|
10085
|
+
...Object.keys(applied_filters).length > 0 && { applied_filters },
|
|
10044
10086
|
people: slimmedResults
|
|
10045
10087
|
};
|
|
10046
10088
|
}
|
|
@@ -12027,7 +12069,21 @@ var init_validation = __esm({
|
|
|
12027
12069
|
company_domain: z2.string().optional(),
|
|
12028
12070
|
location: z2.string().optional(),
|
|
12029
12071
|
limit: z2.number().int().min(1).max(1e3).optional(),
|
|
12030
|
-
seniority: z2.array(
|
|
12072
|
+
seniority: z2.array(
|
|
12073
|
+
z2.enum([
|
|
12074
|
+
"owner",
|
|
12075
|
+
"founder",
|
|
12076
|
+
"c_suite",
|
|
12077
|
+
"partner",
|
|
12078
|
+
"vp",
|
|
12079
|
+
"head",
|
|
12080
|
+
"director",
|
|
12081
|
+
"manager",
|
|
12082
|
+
"senior",
|
|
12083
|
+
"entry",
|
|
12084
|
+
"intern"
|
|
12085
|
+
])
|
|
12086
|
+
).optional(),
|
|
12031
12087
|
department: z2.array(z2.string()).optional(),
|
|
12032
12088
|
has_email: z2.boolean().optional(),
|
|
12033
12089
|
has_phone: z2.boolean().optional(),
|
|
@@ -12044,7 +12100,12 @@ var init_validation = __esm({
|
|
|
12044
12100
|
max_employees: z2.number().int().min(1).optional(),
|
|
12045
12101
|
revenue_range: z2.string().optional(),
|
|
12046
12102
|
fields: z2.union([z2.literal("all"), z2.array(z2.string())]).optional()
|
|
12047
|
-
})
|
|
12103
|
+
}).refine(
|
|
12104
|
+
(data) => !!(data.job_title || data.company_name || data.company_domain || data.company_domains && data.company_domains.length > 0 || data.seniority && data.seniority.length > 0 || data.filter_industry && data.filter_industry.length > 0 || data.skills && data.skills.length > 0 || data.location),
|
|
12105
|
+
{
|
|
12106
|
+
message: "At least one search filter required (job_title, company_name, company_domain, company_domains, seniority, filter_industry, skills, or location)"
|
|
12107
|
+
}
|
|
12108
|
+
),
|
|
12048
12109
|
// StorLeads — DTC/e-commerce company search
|
|
12049
12110
|
gtm_storeleads: z2.object({
|
|
12050
12111
|
search: z2.string().optional(),
|