gtm-now 0.4.1 → 0.5.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/dist/index.js CHANGED
@@ -9699,6 +9699,39 @@ var init_factory2 = __esm({
9699
9699
  }
9700
9700
  });
9701
9701
 
9702
+ // src/providers/types.ts
9703
+ function applySlimFields(result, fields) {
9704
+ const out = {};
9705
+ for (const field of fields) {
9706
+ if (result[field] !== void 0) {
9707
+ out[field] = result[field];
9708
+ }
9709
+ }
9710
+ return out;
9711
+ }
9712
+ var SLIM_COMPANY_FIELDS, SLIM_PERSON_FIELDS;
9713
+ var init_types3 = __esm({
9714
+ "src/providers/types.ts"() {
9715
+ "use strict";
9716
+ SLIM_COMPANY_FIELDS = [
9717
+ "domain",
9718
+ "name",
9719
+ "industry",
9720
+ "employees",
9721
+ "country"
9722
+ ];
9723
+ SLIM_PERSON_FIELDS = [
9724
+ "first_name",
9725
+ "last_name",
9726
+ "job_title",
9727
+ "email",
9728
+ "company",
9729
+ "company_domain",
9730
+ "linkedin_url"
9731
+ ];
9732
+ }
9733
+ });
9734
+
9702
9735
  // src/handlers/prospect.ts
9703
9736
  var prospect_exports = {};
9704
9737
  __export(prospect_exports, {
@@ -9753,10 +9786,13 @@ async function findCompanies(args, ctx) {
9753
9786
  min_digital_footprint: args.min_digital_footprint,
9754
9787
  max_digital_footprint: args.max_digital_footprint,
9755
9788
  offset: args.offset
9756
- // Note: args.provider is NOT forwarded into the query — it's used by the handler
9757
- // for provider routing (selecting which adapter to call), not as a search parameter.
9758
9789
  };
9759
9790
  const results = await finder.findCompanies(query);
9791
+ const fieldsArg = args.fields;
9792
+ const slimmedResults = fieldsArg === "all" ? results : results.map((r) => {
9793
+ const fieldList = Array.isArray(fieldsArg) ? fieldsArg : SLIM_COMPANY_FIELDS;
9794
+ return applySlimFields(r, fieldList);
9795
+ });
9760
9796
  const limit = args.limit ?? 50;
9761
9797
  const offset = args.offset ?? 0;
9762
9798
  return {
@@ -9764,7 +9800,7 @@ async function findCompanies(args, ctx) {
9764
9800
  count: results.length,
9765
9801
  has_more: results.length >= limit,
9766
9802
  offset,
9767
- companies: results
9803
+ companies: slimmedResults
9768
9804
  };
9769
9805
  }
9770
9806
  async function findPeople(args, ctx) {
@@ -9790,11 +9826,27 @@ async function findPeople(args, ctx) {
9790
9826
  has_phone: args.has_phone,
9791
9827
  has_linkedin: args.has_linkedin,
9792
9828
  min_connections: args.min_connections,
9793
- offset: args.offset
9794
- // Note: args.provider is NOT forwarded into the query — used for provider routing only.
9829
+ offset: args.offset,
9830
+ // ─── DiscoLike filters ───
9831
+ company_domains: args.company_domains,
9832
+ skills: args.skills,
9833
+ filter_industry: args.filter_industry,
9834
+ email_validated: args.email_validated,
9835
+ min_employees: args.min_employees,
9836
+ max_employees: args.max_employees,
9837
+ revenue_range: args.revenue_range
9795
9838
  };
9796
9839
  const results = await finder.findPeople(query);
9797
9840
  const dedupedResults = deduplicatePeople(results);
9841
+ const resultsWithAlias = dedupedResults.map((r) => ({
9842
+ ...r,
9843
+ company_domain: r.company_domain ?? r.company
9844
+ }));
9845
+ const fieldsArg = args.fields;
9846
+ const slimmedResults = fieldsArg === "all" ? resultsWithAlias : resultsWithAlias.map((r) => {
9847
+ const fieldList = Array.isArray(fieldsArg) ? fieldsArg : SLIM_PERSON_FIELDS;
9848
+ return applySlimFields(r, fieldList);
9849
+ });
9798
9850
  const limit = args.limit ?? 25;
9799
9851
  const offset = args.offset ?? 0;
9800
9852
  return {
@@ -9802,12 +9854,13 @@ async function findPeople(args, ctx) {
9802
9854
  count: dedupedResults.length,
9803
9855
  has_more: dedupedResults.length >= limit,
9804
9856
  offset,
9805
- people: dedupedResults
9857
+ people: slimmedResults
9806
9858
  };
9807
9859
  }
9808
9860
  var init_prospect = __esm({
9809
9861
  "src/handlers/prospect.ts"() {
9810
9862
  "use strict";
9863
+ init_types3();
9811
9864
  }
9812
9865
  });
9813
9866