gtm-now 0.7.0 → 0.7.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 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
- query: {
8071
- ...query.job_title?.length && { job_title: query.job_title },
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
  }
@@ -9032,20 +9021,14 @@ var init_disco = __esm({
9032
9021
  });
9033
9022
 
9034
9023
  // src/providers/adapters/prospeo.ts
9035
- function mapSeniorityToProspeo(values) {
9036
- if (!values || values.length === 0) return void 0;
9024
+ function mapSeniority2(values) {
9025
+ if (!values?.length) return void 0;
9037
9026
  const mapped = values.map((v) => SENIORITY_TO_PROSPEO[v] ?? v);
9038
9027
  return [...new Set(mapped)];
9039
9028
  }
9040
- function mapEmployeeRange(min, max) {
9029
+ function mapHeadcountCustom(min, max) {
9041
9030
  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
- });
9031
+ return { ...min != null && { min }, ...max != null && { max } };
9049
9032
  }
9050
9033
  var SENIORITY_TO_PROSPEO, ProspeoMcpAdapter;
9051
9034
  var init_prospeo2 = __esm({
@@ -9054,19 +9037,22 @@ var init_prospeo2 = __esm({
9054
9037
  init_dist();
9055
9038
  init_dist2();
9056
9039
  SENIORITY_TO_PROSPEO = {
9057
- c_suite: "c_level",
9058
- founder: "c_level",
9059
- owner: "c_level",
9060
- partner: "c_level",
9061
- head: "director",
9062
- senior: "senior",
9063
- entry: "entry",
9064
- intern: "entry"
9040
+ c_suite: "C-Suite",
9041
+ founder: "C-Suite",
9042
+ owner: "C-Suite",
9043
+ partner: "C-Suite",
9044
+ vp: "VP",
9045
+ head: "Director",
9046
+ director: "Director",
9047
+ manager: "Manager",
9048
+ senior: "Senior",
9049
+ entry: "Entry",
9050
+ intern: "Entry"
9065
9051
  };
9066
9052
  ProspeoMcpAdapter = class {
9067
9053
  name = "prospeo";
9068
9054
  capabilities = ["find_people", "enrich_email"];
9069
- notes = "Best for: city-level people search, industry filtering, email finding from LinkedIn URLs. Rich enrichment data (phone, title, company details).";
9055
+ notes = "Best for: city-level people search with industry/seniority/department/headcount filters, email enrichment, company technology detection, funding data. 200M+ contacts.";
9070
9056
  client;
9071
9057
  constructor(apiKey) {
9072
9058
  this.client = new ProspeoClient({ apiKey });
@@ -9086,11 +9072,7 @@ var init_prospeo2 = __esm({
9086
9072
  async checkCredits() {
9087
9073
  try {
9088
9074
  const info = await this.client.getAccountInfo();
9089
- return {
9090
- remaining: info.credits,
9091
- unit: "credits",
9092
- provider: this.name
9093
- };
9075
+ return { remaining: info.credits, unit: "credits", provider: this.name };
9094
9076
  } catch (error) {
9095
9077
  logError("prospeo:checkCredits", error instanceof Error ? error : new Error(String(error)));
9096
9078
  return null;
@@ -9098,30 +9080,41 @@ var init_prospeo2 = __esm({
9098
9080
  }
9099
9081
  // ─── PeopleFinder ────────────────────────────────────────
9100
9082
  async findPeople(query) {
9101
- const response = await this.client.searchPeople({
9102
- job_title: query.job_title ? [query.job_title] : void 0,
9103
- seniority: mapSeniorityToProspeo(query.seniority),
9104
- department: query.department,
9105
- location: query.location ? [query.location] : void 0,
9106
- company_name: query.company_name,
9107
- company_domain: query.company_domain ?? (query.company_domains ? query.company_domains[0] : void 0),
9108
- industry: query.filter_industry,
9109
- company_size: mapEmployeeRange(query.min_employees, query.max_employees),
9110
- limit: query.limit ?? 25,
9111
- offset: query.offset ?? 0
9112
- });
9113
- return response.results.map((p) => ({
9114
- first_name: p.first_name,
9115
- last_name: p.last_name,
9116
- job_title: p.job_title ?? void 0,
9117
- company: p.company_name ?? void 0,
9118
- company_domain: p.company_domain ?? void 0,
9119
- email: p.email ?? void 0,
9120
- phone: p.phone ?? void 0,
9121
- linkedin_url: p.linkedin_url ?? void 0,
9122
- seniority: p.seniority ?? void 0,
9123
- department: p.department ?? void 0,
9124
- location: p.location ?? void 0,
9083
+ const filters = {};
9084
+ if (query.job_title) filters.person_job_title = query.job_title;
9085
+ if (query.seniority) filters.person_seniority = mapSeniority2(query.seniority);
9086
+ if (query.department?.length) filters.person_department = query.department[0];
9087
+ if (query.location) filters.person_location_search = query.location;
9088
+ if (query.company_domain) filters.company = query.company_domain;
9089
+ if (query.company_domains?.length) filters.company = query.company_domains[0];
9090
+ if (query.company_name) filters.company = query.company_name;
9091
+ if (query.filter_industry?.length) {
9092
+ filters.company_industry = { include: query.filter_industry };
9093
+ }
9094
+ if (query.min_employees != null || query.max_employees != null) {
9095
+ filters.company_headcount_custom = mapHeadcountCustom(
9096
+ query.min_employees,
9097
+ query.max_employees
9098
+ );
9099
+ }
9100
+ if (query.skills?.length) {
9101
+ filters.company_keywords = { include: query.skills };
9102
+ }
9103
+ const page = query.offset ? Math.floor(query.offset / (query.limit ?? 25)) + 1 : 1;
9104
+ const response = await this.client.searchPeople({ page, filters });
9105
+ if (response.error || !response.data?.length) return [];
9106
+ return response.data.map((r) => ({
9107
+ first_name: r.person?.first_name ?? "",
9108
+ last_name: r.person?.last_name ?? "",
9109
+ job_title: r.person?.job_title,
9110
+ company: r.company?.name,
9111
+ company_domain: r.company?.domain,
9112
+ email: r.person?.email,
9113
+ phone: r.person?.phone,
9114
+ linkedin_url: r.person?.linkedin_url,
9115
+ seniority: r.person?.seniority,
9116
+ department: r.person?.department,
9117
+ location: r.person?.location ?? r.company?.location,
9125
9118
  sources: [this.name]
9126
9119
  }));
9127
9120
  }