gtm-now 0.10.7 → 0.10.8
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 +300 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -205,7 +205,8 @@ var init_config = __esm({
|
|
|
205
205
|
GTM_SMARTLEAD_API_KEY: "smartlead",
|
|
206
206
|
GTM_HARVEST_API_KEY: "harvest",
|
|
207
207
|
GTM_STORELEADS_API_KEY: "storeleads",
|
|
208
|
-
GTM_EXA_API_KEY: "exa"
|
|
208
|
+
GTM_EXA_API_KEY: "exa",
|
|
209
|
+
GTM_LEADMAGIC_API_KEY: "leadmagic"
|
|
209
210
|
};
|
|
210
211
|
ENV_WORKSPACE_MAP = {
|
|
211
212
|
GTM_PLUSVIBE_WORKSPACE_ID: "plusvibe"
|
|
@@ -8737,6 +8738,111 @@ var init_client25 = __esm({
|
|
|
8737
8738
|
}
|
|
8738
8739
|
});
|
|
8739
8740
|
|
|
8741
|
+
// ../integrations/dist/leadmagic.js
|
|
8742
|
+
var LeadMagicClient;
|
|
8743
|
+
var init_leadmagic2 = __esm({
|
|
8744
|
+
"../integrations/dist/leadmagic.js"() {
|
|
8745
|
+
"use strict";
|
|
8746
|
+
init_base_client();
|
|
8747
|
+
LeadMagicClient = class extends BaseApiClient {
|
|
8748
|
+
constructor(config) {
|
|
8749
|
+
super({
|
|
8750
|
+
name: "LeadMagic",
|
|
8751
|
+
baseUrl: config.baseUrl ?? "https://api.leadmagic.io",
|
|
8752
|
+
headers: { "X-API-Key": config.apiKey },
|
|
8753
|
+
timeoutMs: config.timeoutMs
|
|
8754
|
+
});
|
|
8755
|
+
}
|
|
8756
|
+
// ─── People ──────────────────────────────────────────────────────────────────
|
|
8757
|
+
async findEmail(params) {
|
|
8758
|
+
return this.request("/v1/people/email-finder", {
|
|
8759
|
+
method: "POST",
|
|
8760
|
+
body: JSON.stringify(params)
|
|
8761
|
+
});
|
|
8762
|
+
}
|
|
8763
|
+
async validateEmail(params) {
|
|
8764
|
+
return this.request("/v1/people/email-validation", {
|
|
8765
|
+
method: "POST",
|
|
8766
|
+
body: JSON.stringify(params)
|
|
8767
|
+
});
|
|
8768
|
+
}
|
|
8769
|
+
async findMobile(params) {
|
|
8770
|
+
return this.request("/v1/people/mobile-finder", {
|
|
8771
|
+
method: "POST",
|
|
8772
|
+
body: JSON.stringify(params)
|
|
8773
|
+
});
|
|
8774
|
+
}
|
|
8775
|
+
async searchProfile(params) {
|
|
8776
|
+
return this.request("/v1/people/profile-search", {
|
|
8777
|
+
method: "POST",
|
|
8778
|
+
body: JSON.stringify(params)
|
|
8779
|
+
});
|
|
8780
|
+
}
|
|
8781
|
+
async findEmployees(params) {
|
|
8782
|
+
return this.request("/v1/people/employee-finder", {
|
|
8783
|
+
method: "POST",
|
|
8784
|
+
body: JSON.stringify(params)
|
|
8785
|
+
});
|
|
8786
|
+
}
|
|
8787
|
+
async findRole(params) {
|
|
8788
|
+
return this.request("/v1/people/role-finder", {
|
|
8789
|
+
method: "POST",
|
|
8790
|
+
body: JSON.stringify(params)
|
|
8791
|
+
});
|
|
8792
|
+
}
|
|
8793
|
+
async emailToProfile(params) {
|
|
8794
|
+
return this.request("/v1/people/b2b-profile", {
|
|
8795
|
+
method: "POST",
|
|
8796
|
+
body: JSON.stringify(params)
|
|
8797
|
+
});
|
|
8798
|
+
}
|
|
8799
|
+
async profileToEmail(params) {
|
|
8800
|
+
return this.request("/v1/people/b2b-profile-email", {
|
|
8801
|
+
method: "POST",
|
|
8802
|
+
body: JSON.stringify(params)
|
|
8803
|
+
});
|
|
8804
|
+
}
|
|
8805
|
+
async findPersonalEmail(params) {
|
|
8806
|
+
return this.request("/v1/people/personal-email-finder", {
|
|
8807
|
+
method: "POST",
|
|
8808
|
+
body: JSON.stringify(params)
|
|
8809
|
+
});
|
|
8810
|
+
}
|
|
8811
|
+
async detectJobChange(params) {
|
|
8812
|
+
return this.request("/v1/people/job-change-detector", {
|
|
8813
|
+
method: "POST",
|
|
8814
|
+
body: JSON.stringify(params)
|
|
8815
|
+
});
|
|
8816
|
+
}
|
|
8817
|
+
// ─── Companies ───────────────────────────────────────────────────────────────
|
|
8818
|
+
async searchCompany(params) {
|
|
8819
|
+
return this.request("/v1/companies/company-search", {
|
|
8820
|
+
method: "POST",
|
|
8821
|
+
body: JSON.stringify(params)
|
|
8822
|
+
});
|
|
8823
|
+
}
|
|
8824
|
+
async searchCompetitors(params) {
|
|
8825
|
+
return this.request("/v1/companies/competitors-search", {
|
|
8826
|
+
method: "POST",
|
|
8827
|
+
body: JSON.stringify(params)
|
|
8828
|
+
});
|
|
8829
|
+
}
|
|
8830
|
+
async getCompanyFunding(params) {
|
|
8831
|
+
return this.request("/v1/companies/company-funding", {
|
|
8832
|
+
method: "POST",
|
|
8833
|
+
body: JSON.stringify(params)
|
|
8834
|
+
});
|
|
8835
|
+
}
|
|
8836
|
+
async getTechnographics(params) {
|
|
8837
|
+
return this.request("/v1/companies/technographics", {
|
|
8838
|
+
method: "POST",
|
|
8839
|
+
body: JSON.stringify(params)
|
|
8840
|
+
});
|
|
8841
|
+
}
|
|
8842
|
+
};
|
|
8843
|
+
}
|
|
8844
|
+
});
|
|
8845
|
+
|
|
8740
8846
|
// ../integrations/dist/index.js
|
|
8741
8847
|
var init_dist2 = __esm({
|
|
8742
8848
|
"../integrations/dist/index.js"() {
|
|
@@ -8778,6 +8884,7 @@ var init_dist2 = __esm({
|
|
|
8778
8884
|
init_factory();
|
|
8779
8885
|
init_client24();
|
|
8780
8886
|
init_client25();
|
|
8887
|
+
init_leadmagic2();
|
|
8781
8888
|
}
|
|
8782
8889
|
});
|
|
8783
8890
|
|
|
@@ -10549,6 +10656,193 @@ var init_exa = __esm({
|
|
|
10549
10656
|
}
|
|
10550
10657
|
});
|
|
10551
10658
|
|
|
10659
|
+
// src/providers/adapters/leadmagic.ts
|
|
10660
|
+
function mapEmailQuality(status) {
|
|
10661
|
+
switch (status) {
|
|
10662
|
+
case "valid":
|
|
10663
|
+
return "95%";
|
|
10664
|
+
case "valid_catch_all":
|
|
10665
|
+
return "80%";
|
|
10666
|
+
case "catch_all":
|
|
10667
|
+
return "60%";
|
|
10668
|
+
default:
|
|
10669
|
+
return "50%";
|
|
10670
|
+
}
|
|
10671
|
+
}
|
|
10672
|
+
function mapVerificationStatus(status) {
|
|
10673
|
+
switch (status) {
|
|
10674
|
+
case "valid":
|
|
10675
|
+
return "deliverable";
|
|
10676
|
+
case "valid_catch_all":
|
|
10677
|
+
return "catch_all_safe";
|
|
10678
|
+
case "catch_all":
|
|
10679
|
+
return "catch_all_not_safe";
|
|
10680
|
+
case "invalid":
|
|
10681
|
+
return "undeliverable";
|
|
10682
|
+
default:
|
|
10683
|
+
return "unknown";
|
|
10684
|
+
}
|
|
10685
|
+
}
|
|
10686
|
+
var LeadMagicAdapter2;
|
|
10687
|
+
var init_leadmagic3 = __esm({
|
|
10688
|
+
"src/providers/adapters/leadmagic.ts"() {
|
|
10689
|
+
"use strict";
|
|
10690
|
+
init_dist();
|
|
10691
|
+
init_dist2();
|
|
10692
|
+
LeadMagicAdapter2 = class {
|
|
10693
|
+
name = "leadmagic";
|
|
10694
|
+
capabilities = [
|
|
10695
|
+
"enrich_email",
|
|
10696
|
+
"enrich_phone",
|
|
10697
|
+
"verify_email",
|
|
10698
|
+
"find_people"
|
|
10699
|
+
];
|
|
10700
|
+
notes = "Best for: email enrichment (name+domain), email validation (0.05 credits), mobile finder (needs LinkedIn URL, 5 credits), employee lists (0.05/employee). Also supports: profile search, company search, technographics, funding, competitors, job change detection. Pay-on-find pricing \u2014 free when no result.";
|
|
10701
|
+
client;
|
|
10702
|
+
constructor(apiKey) {
|
|
10703
|
+
this.client = new LeadMagicClient({ apiKey });
|
|
10704
|
+
}
|
|
10705
|
+
async checkCredentials() {
|
|
10706
|
+
try {
|
|
10707
|
+
await this.client.validateEmail({ email: "test@example.com" });
|
|
10708
|
+
return true;
|
|
10709
|
+
} catch (error) {
|
|
10710
|
+
logError(
|
|
10711
|
+
"leadmagic:checkCredentials",
|
|
10712
|
+
error instanceof Error ? error : new Error(String(error))
|
|
10713
|
+
);
|
|
10714
|
+
return false;
|
|
10715
|
+
}
|
|
10716
|
+
}
|
|
10717
|
+
async checkCredits() {
|
|
10718
|
+
return null;
|
|
10719
|
+
}
|
|
10720
|
+
// ─── EmailEnricher ──────────────────────────────────────
|
|
10721
|
+
async enrichEmail(contact) {
|
|
10722
|
+
try {
|
|
10723
|
+
if (contact.first_name && contact.last_name && (contact.company_domain || contact.company)) {
|
|
10724
|
+
const response = await this.client.findEmail({
|
|
10725
|
+
first_name: contact.first_name,
|
|
10726
|
+
last_name: contact.last_name,
|
|
10727
|
+
domain: contact.company_domain,
|
|
10728
|
+
company_name: !contact.company_domain ? contact.company : void 0
|
|
10729
|
+
});
|
|
10730
|
+
if (response.email && response.status !== "not_found") {
|
|
10731
|
+
return {
|
|
10732
|
+
email: response.email,
|
|
10733
|
+
quality: mapEmailQuality(response.status),
|
|
10734
|
+
provider: this.name
|
|
10735
|
+
};
|
|
10736
|
+
}
|
|
10737
|
+
}
|
|
10738
|
+
if (contact.linkedin_url) {
|
|
10739
|
+
const response = await this.client.profileToEmail({
|
|
10740
|
+
profile_url: contact.linkedin_url
|
|
10741
|
+
});
|
|
10742
|
+
if (response.email) {
|
|
10743
|
+
return {
|
|
10744
|
+
email: response.email,
|
|
10745
|
+
quality: "80%",
|
|
10746
|
+
// Profile-to-email doesn't return validation status
|
|
10747
|
+
provider: this.name
|
|
10748
|
+
};
|
|
10749
|
+
}
|
|
10750
|
+
}
|
|
10751
|
+
return null;
|
|
10752
|
+
} catch (error) {
|
|
10753
|
+
logError("leadmagic:enrichEmail", error instanceof Error ? error : new Error(String(error)));
|
|
10754
|
+
return null;
|
|
10755
|
+
}
|
|
10756
|
+
}
|
|
10757
|
+
// ─── PhoneEnricher ──────────────────────────────────────
|
|
10758
|
+
async enrichPhone(contact) {
|
|
10759
|
+
try {
|
|
10760
|
+
const response = await this.client.findMobile({
|
|
10761
|
+
profile_url: contact.linkedin_url,
|
|
10762
|
+
work_email: void 0,
|
|
10763
|
+
// Could pass email if available
|
|
10764
|
+
personal_email: void 0
|
|
10765
|
+
});
|
|
10766
|
+
if (!response.mobile_number) return null;
|
|
10767
|
+
return {
|
|
10768
|
+
phone: response.mobile_number,
|
|
10769
|
+
provider: this.name
|
|
10770
|
+
};
|
|
10771
|
+
} catch (error) {
|
|
10772
|
+
logError("leadmagic:enrichPhone", error instanceof Error ? error : new Error(String(error)));
|
|
10773
|
+
return null;
|
|
10774
|
+
}
|
|
10775
|
+
}
|
|
10776
|
+
// ─── EmailVerifier ──────────────────────────────────────
|
|
10777
|
+
async verifyEmail(email) {
|
|
10778
|
+
try {
|
|
10779
|
+
const response = await this.client.validateEmail({ email });
|
|
10780
|
+
return {
|
|
10781
|
+
email: response.email ?? email,
|
|
10782
|
+
valid: response.email_status === "valid" || response.email_status === "valid_catch_all",
|
|
10783
|
+
status: mapVerificationStatus(response.email_status),
|
|
10784
|
+
provider: this.name
|
|
10785
|
+
};
|
|
10786
|
+
} catch (error) {
|
|
10787
|
+
logError("leadmagic:verifyEmail", error instanceof Error ? error : new Error(String(error)));
|
|
10788
|
+
return {
|
|
10789
|
+
email,
|
|
10790
|
+
valid: false,
|
|
10791
|
+
status: "unknown",
|
|
10792
|
+
provider: this.name
|
|
10793
|
+
};
|
|
10794
|
+
}
|
|
10795
|
+
}
|
|
10796
|
+
// ─── PeopleFinder ───────────────────────────────────────
|
|
10797
|
+
async findPeople(query) {
|
|
10798
|
+
try {
|
|
10799
|
+
if (query.job_title && (query.company_domain || query.company_name)) {
|
|
10800
|
+
const response = await this.client.findRole({
|
|
10801
|
+
job_title: query.job_title,
|
|
10802
|
+
company_domain: query.company_domain,
|
|
10803
|
+
company_name: !query.company_domain ? query.company_name : void 0
|
|
10804
|
+
});
|
|
10805
|
+
if (response.first_name && response.last_name) {
|
|
10806
|
+
return [
|
|
10807
|
+
{
|
|
10808
|
+
first_name: response.first_name,
|
|
10809
|
+
last_name: response.last_name,
|
|
10810
|
+
job_title: response.job_title ?? void 0,
|
|
10811
|
+
company: response.company_name ?? void 0,
|
|
10812
|
+
company_domain: response.company_website ?? query.company_domain ?? void 0,
|
|
10813
|
+
linkedin_url: response.profile_url ?? void 0,
|
|
10814
|
+
sources: [this.name]
|
|
10815
|
+
}
|
|
10816
|
+
];
|
|
10817
|
+
}
|
|
10818
|
+
return [];
|
|
10819
|
+
}
|
|
10820
|
+
if (query.company_domain || query.company_name) {
|
|
10821
|
+
const response = await this.client.findEmployees({
|
|
10822
|
+
company_domain: query.company_domain,
|
|
10823
|
+
company_name: !query.company_domain ? query.company_name : void 0,
|
|
10824
|
+
limit: query.limit ?? 20
|
|
10825
|
+
});
|
|
10826
|
+
if (!response.data?.length) return [];
|
|
10827
|
+
return response.data.map((emp) => ({
|
|
10828
|
+
first_name: emp.first_name ?? "",
|
|
10829
|
+
last_name: emp.last_name ?? "",
|
|
10830
|
+
job_title: emp.title ?? void 0,
|
|
10831
|
+
company: emp.company_name ?? void 0,
|
|
10832
|
+
company_domain: emp.website ?? query.company_domain ?? void 0,
|
|
10833
|
+
sources: [this.name]
|
|
10834
|
+
}));
|
|
10835
|
+
}
|
|
10836
|
+
return [];
|
|
10837
|
+
} catch (error) {
|
|
10838
|
+
logError("leadmagic:findPeople", error instanceof Error ? error : new Error(String(error)));
|
|
10839
|
+
return [];
|
|
10840
|
+
}
|
|
10841
|
+
}
|
|
10842
|
+
};
|
|
10843
|
+
}
|
|
10844
|
+
});
|
|
10845
|
+
|
|
10552
10846
|
// src/providers/adapters/index.ts
|
|
10553
10847
|
var init_adapters = __esm({
|
|
10554
10848
|
"src/providers/adapters/index.ts"() {
|
|
@@ -10566,6 +10860,7 @@ var init_adapters = __esm({
|
|
|
10566
10860
|
init_storeleads();
|
|
10567
10861
|
init_harvest();
|
|
10568
10862
|
init_exa();
|
|
10863
|
+
init_leadmagic3();
|
|
10569
10864
|
}
|
|
10570
10865
|
});
|
|
10571
10866
|
|
|
@@ -10598,6 +10893,8 @@ function createAdapter(name, config) {
|
|
|
10598
10893
|
return config.api_key ? new HarvestApiAdapter(config.api_key) : null;
|
|
10599
10894
|
case "exa":
|
|
10600
10895
|
return config.api_key ? new ExaAdapter(config.api_key) : null;
|
|
10896
|
+
case "leadmagic":
|
|
10897
|
+
return config.api_key ? new LeadMagicAdapter2(config.api_key) : null;
|
|
10601
10898
|
default:
|
|
10602
10899
|
return null;
|
|
10603
10900
|
}
|
|
@@ -12149,7 +12446,8 @@ var init_waterfall = __esm({
|
|
|
12149
12446
|
bettercontact: { charged_only_on_find: true, estimated_cost_per_hit: "$0.10" },
|
|
12150
12447
|
prospeo: { charged_only_on_find: true, estimated_cost_per_hit: "$0.05" },
|
|
12151
12448
|
apollo: { charged_only_on_find: false, estimated_cost_per_lookup: "$0.03" },
|
|
12152
|
-
hunter: { charged_only_on_find: true, estimated_cost_per_hit: "$0.05" }
|
|
12449
|
+
hunter: { charged_only_on_find: true, estimated_cost_per_hit: "$0.05" },
|
|
12450
|
+
leadmagic: { charged_only_on_find: true, estimated_cost_per_hit: "$0.03" }
|
|
12153
12451
|
};
|
|
12154
12452
|
EXHAUSTION_PATTERNS = [
|
|
12155
12453
|
"insufficient credits",
|