@taskmagic/apps-hunter 0.1.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.
Files changed (47) hide show
  1. package/README.md +3 -0
  2. package/package.json +47 -0
  3. package/src/index.d.ts +3 -0
  4. package/src/index.js +39 -0
  5. package/src/index.js.map +1 -0
  6. package/src/lib/actions/add-recipients.d.ts +5 -0
  7. package/src/lib/actions/add-recipients.js +57 -0
  8. package/src/lib/actions/add-recipients.js.map +1 -0
  9. package/src/lib/actions/count-emails.d.ts +5 -0
  10. package/src/lib/actions/count-emails.js +70 -0
  11. package/src/lib/actions/count-emails.js.map +1 -0
  12. package/src/lib/actions/create-lead.d.ts +20 -0
  13. package/src/lib/actions/create-lead.js +57 -0
  14. package/src/lib/actions/create-lead.js.map +1 -0
  15. package/src/lib/actions/delete-lead.d.ts +3 -0
  16. package/src/lib/actions/delete-lead.js +30 -0
  17. package/src/lib/actions/delete-lead.js.map +1 -0
  18. package/src/lib/actions/find-email.d.ts +8 -0
  19. package/src/lib/actions/find-email.js +106 -0
  20. package/src/lib/actions/find-email.js.map +1 -0
  21. package/src/lib/actions/get-lead.d.ts +3 -0
  22. package/src/lib/actions/get-lead.js +30 -0
  23. package/src/lib/actions/get-lead.js.map +1 -0
  24. package/src/lib/actions/search-leads.d.ts +25 -0
  25. package/src/lib/actions/search-leads.js +101 -0
  26. package/src/lib/actions/search-leads.js.map +1 -0
  27. package/src/lib/actions/update-lead.d.ts +21 -0
  28. package/src/lib/actions/update-lead.js +64 -0
  29. package/src/lib/actions/update-lead.js.map +1 -0
  30. package/src/lib/actions/verify-email.d.ts +3 -0
  31. package/src/lib/actions/verify-email.js +82 -0
  32. package/src/lib/actions/verify-email.js.map +1 -0
  33. package/src/lib/auth.d.ts +1 -0
  34. package/src/lib/auth.js +10 -0
  35. package/src/lib/auth.js.map +1 -0
  36. package/src/lib/common/index.d.ts +8 -0
  37. package/src/lib/common/index.js +19 -0
  38. package/src/lib/common/index.js.map +1 -0
  39. package/src/lib/common/props.d.ts +54 -0
  40. package/src/lib/common/props.js +361 -0
  41. package/src/lib/common/props.js.map +1 -0
  42. package/src/lib/common/types.d.ts +32 -0
  43. package/src/lib/common/types.js +3 -0
  44. package/src/lib/common/types.js.map +1 -0
  45. package/src/lib/triggers/new-lead.d.ts +2 -0
  46. package/src/lib/triggers/new-lead.js +83 -0
  47. package/src/lib/triggers/new-lead.js.map +1 -0
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # hunter
2
+
3
+ This library was generated for the Hunter piece.
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@taskmagic/apps-hunter",
3
+ "version": "0.1.0",
4
+ "dependencies": {
5
+ "@anthropic-ai/sdk": "0.33.1",
6
+ "@sinclair/typebox": "0.34.11",
7
+ "axios": "1.17.0",
8
+ "axios-retry": "4.4.1",
9
+ "deepmerge-ts": "7.1.0",
10
+ "mime-types": "2.1.35",
11
+ "nanoid": "3.3.8",
12
+ "openai": "4.67.1",
13
+ "replicate": "0.34.1",
14
+ "semver": "7.6.0",
15
+ "zod": "3.25.76",
16
+ "@taskmagic/pieces-common": "0.4.4",
17
+ "@taskmagic/pieces-framework": "0.7.46",
18
+ "@taskmagic/shared": "0.10.171",
19
+ "tslib": "1.14.1"
20
+ },
21
+ "overrides": {
22
+ "cross-spawn": "7.0.6",
23
+ "elliptic": "^6.6.1",
24
+ "fast-xml-parser": "^4.4.1",
25
+ "protobufjs": "^7.5.5",
26
+ "tmp": "^0.2.4",
27
+ "koa": "^2.16.4",
28
+ "picomatch": "^4.0.4",
29
+ "langsmith": "^0.6.0",
30
+ "serialize-javascript": "^6.0.2",
31
+ "elevenlabs": {
32
+ "form-data": "^4.0.4"
33
+ },
34
+ "@tryfabric/martian": {
35
+ "@notionhq/client": "$@notionhq/client"
36
+ },
37
+ "vite": {
38
+ "rollup": "npm:@rollup/wasm-node@^4.61.1"
39
+ }
40
+ },
41
+ "resolutions": {
42
+ "rollup": "npm:@rollup/wasm-node@^4.61.1"
43
+ },
44
+ "types": "./src/index.d.ts",
45
+ "main": "./src/index.js",
46
+ "type": "commonjs"
47
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { hunterAuth } from './lib/auth';
2
+ export { hunterAuth };
3
+ export declare const hunter: import("@taskmagic/pieces-framework").Piece<import("@taskmagic/pieces-framework").SecretTextProperty<true>>;
package/src/index.js ADDED
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hunter = exports.hunterAuth = void 0;
4
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
5
+ const shared_1 = require("@taskmagic/shared");
6
+ const add_recipients_1 = require("./lib/actions/add-recipients");
7
+ const count_emails_1 = require("./lib/actions/count-emails");
8
+ const create_lead_1 = require("./lib/actions/create-lead");
9
+ const delete_lead_1 = require("./lib/actions/delete-lead");
10
+ const find_email_1 = require("./lib/actions/find-email");
11
+ const get_lead_1 = require("./lib/actions/get-lead");
12
+ const search_leads_1 = require("./lib/actions/search-leads");
13
+ const update_lead_1 = require("./lib/actions/update-lead");
14
+ const verify_email_1 = require("./lib/actions/verify-email");
15
+ const new_lead_1 = require("./lib/triggers/new-lead");
16
+ const auth_1 = require("./lib/auth");
17
+ Object.defineProperty(exports, "hunterAuth", { enumerable: true, get: function () { return auth_1.hunterAuth; } });
18
+ exports.hunter = (0, pieces_framework_1.createPiece)({
19
+ displayName: 'Hunter',
20
+ description: 'Find, verify and manage professional email addresses at scale. Automate email discovery, validation, lead tracking, and campaign outreach with Hunter.io.',
21
+ auth: auth_1.hunterAuth,
22
+ minimumSupportedRelease: '0.30.0',
23
+ logoUrl: 'https://cdn.activepieces.com/pieces/hunter.png',
24
+ authors: ['varshith257'],
25
+ categories: [shared_1.PieceCategory.SALES_AND_CRM],
26
+ actions: [
27
+ add_recipients_1.addRecipientsAction,
28
+ count_emails_1.countEmailsAction,
29
+ create_lead_1.createLeadAction,
30
+ delete_lead_1.deleteLeadAction,
31
+ find_email_1.findEmailAction,
32
+ get_lead_1.getLeadAction,
33
+ search_leads_1.searchLeadsAction,
34
+ update_lead_1.updateLeadAction,
35
+ verify_email_1.verifyEmailAction,
36
+ ],
37
+ triggers: [new_lead_1.newLeadTrigger],
38
+ });
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/hunter/src/index.ts"],"names":[],"mappings":";;;AAAA,kEAA0D;AAC1D,8CAAkD;AAClD,iEAAmE;AACnE,6DAA+D;AAC/D,2DAA6D;AAC7D,2DAA6D;AAC7D,yDAA2D;AAC3D,qDAAuD;AACvD,6DAA+D;AAC/D,2DAA6D;AAC7D,6DAA+D;AAC/D,sDAAyD;AACzD,qCAAwC;AAE/B,2FAFA,iBAAU,OAEA;AAEN,QAAA,MAAM,GAAG,IAAA,8BAAW,EAAC;IAChC,WAAW,EAAE,QAAQ;IACrB,WAAW,EACT,2JAA2J;IAC7J,IAAI,EAAE,iBAAU;IAChB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,gDAAgD;IACzD,OAAO,EAAE,CAAC,aAAa,CAAC;IACxB,UAAU,EAAE,CAAC,sBAAa,CAAC,aAAa,CAAC;IACzC,OAAO,EAAE;QACP,oCAAmB;QACnB,gCAAiB;QACjB,8BAAgB;QAChB,8BAAgB;QAChB,4BAAe;QACf,wBAAa;QACb,gCAAiB;QACjB,8BAAgB;QAChB,gCAAiB;KAClB;IACD,QAAQ,EAAE,CAAC,yBAAc,CAAC;CAC3B,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const addRecipientsAction: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ campaign_id: import("@taskmagic/pieces-framework").DropdownProperty<number, true>;
3
+ emails: import("@taskmagic/pieces-framework").ArrayProperty<false>;
4
+ lead_ids: import("@taskmagic/pieces-framework").MultiSelectDropdownProperty<unknown, false>;
5
+ }>;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addRecipientsAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const common_1 = require("../common");
8
+ const auth_1 = require("../auth");
9
+ const props_1 = require("../common/props");
10
+ const MAX_EMAILS = 50;
11
+ const MAX_LEAD_IDS = 50;
12
+ exports.addRecipientsAction = (0, pieces_framework_1.createAction)({
13
+ auth: auth_1.hunterAuth,
14
+ name: 'add-recipients',
15
+ displayName: 'Add Recipients',
16
+ description: 'Add one or multiple recipients to a campaign.',
17
+ props: {
18
+ campaign_id: props_1.campaignIdProp,
19
+ emails: props_1.emailsProp,
20
+ lead_ids: props_1.leadIdsDropdownProp,
21
+ },
22
+ run(context) {
23
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
+ const { campaign_id, emails: rawEmails = [], lead_ids: rawLeadIds = [], } = context.propsValue;
25
+ const stringEmails = rawEmails.filter((e) => typeof e === 'string');
26
+ const numberLeadIds = rawLeadIds.filter((id) => typeof id === 'number');
27
+ const filteredEmails = stringEmails
28
+ .map((e) => e.trim())
29
+ .filter((e) => e.length > 0);
30
+ if (filteredEmails.length === 0 && numberLeadIds.length === 0) {
31
+ throw new Error('You must provide at least one valid email or one lead ID.');
32
+ }
33
+ if (filteredEmails.length > MAX_EMAILS) {
34
+ throw new Error(`You can add at most ${MAX_EMAILS} emails at once.`);
35
+ }
36
+ if (numberLeadIds.length > MAX_LEAD_IDS) {
37
+ throw new Error(`You can add at most ${MAX_LEAD_IDS} lead IDs at once.`);
38
+ }
39
+ const body = {};
40
+ if (filteredEmails.length)
41
+ body.emails = filteredEmails;
42
+ if (numberLeadIds.length)
43
+ body.lead_ids = numberLeadIds;
44
+ const resp = (yield (0, common_1.hunterApiCall)({
45
+ apiKey: context.auth,
46
+ endpoint: `/campaigns/${campaign_id}/recipients`,
47
+ method: pieces_common_1.HttpMethod.POST,
48
+ body,
49
+ }));
50
+ return {
51
+ recipients_added: resp.data.recipients_added,
52
+ skipped_recipients: resp.data.skipped_recipients,
53
+ };
54
+ });
55
+ },
56
+ });
57
+ //# sourceMappingURL=add-recipients.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-recipients.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/hunter/src/lib/actions/add-recipients.ts"],"names":[],"mappings":";;;;AAAA,kEAA2D;AAC3D,4DAAsD;AACtD,sCAA0C;AAC1C,kCAAqC;AACrC,2CAIyB;AAEzB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,YAAY,GAAG,EAAE,CAAC;AAEX,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,+CAA+C;IAC5D,KAAK,EAAE;QACL,WAAW,EAAE,sBAAc;QAC3B,MAAM,EAAE,kBAAU;QAClB,QAAQ,EAAE,2BAAmB;KAC9B;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EACJ,WAAW,EACX,MAAM,EAAE,SAAS,GAAG,EAAE,EACtB,QAAQ,EAAE,UAAU,GAAG,EAAE,GAC1B,GAAG,OAAO,CAAC,UAIX,CAAC;YAEF,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,CACnC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAC1C,CAAC;YACF,MAAM,aAAa,GAAG,UAAU,CAAC,MAAM,CACrC,CAAC,EAAE,EAAgB,EAAE,CAAC,OAAO,EAAE,KAAK,QAAQ,CAC7C,CAAC;YAEF,MAAM,cAAc,GAAG,YAAY;iBAChC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;iBACpB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YAE/B,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC9D,MAAM,IAAI,KAAK,CACb,2DAA2D,CAC5D,CAAC;YACJ,CAAC;YAED,IAAI,cAAc,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;gBACvC,MAAM,IAAI,KAAK,CAAC,uBAAuB,UAAU,kBAAkB,CAAC,CAAC;YACvE,CAAC;YACD,IAAI,aAAa,CAAC,MAAM,GAAG,YAAY,EAAE,CAAC;gBACxC,MAAM,IAAI,KAAK,CAAC,uBAAuB,YAAY,oBAAoB,CAAC,CAAC;YAC3E,CAAC;YAED,MAAM,IAAI,GAA+C,EAAE,CAAC;YAC5D,IAAI,cAAc,CAAC,MAAM;gBAAE,IAAI,CAAC,MAAM,GAAG,cAAc,CAAC;YACxD,IAAI,aAAa,CAAC,MAAM;gBAAE,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAC;YAExD,MAAM,IAAI,GAAG,CAAC,MAAM,IAAA,sBAAa,EAAC;gBAChC,MAAM,EAAE,OAAO,CAAC,IAAI;gBACpB,QAAQ,EAAE,cAAc,WAAW,aAAa;gBAChD,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI;aACL,CAAC,CAcD,CAAC;YAEF,OAAO;gBACL,gBAAgB,EAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB;gBAC5C,kBAAkB,EAAE,IAAI,CAAC,IAAI,CAAC,kBAAkB;aACjD,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const countEmailsAction: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ domain: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
3
+ company: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
4
+ type: import("@taskmagic/pieces-framework").DropdownProperty<string, false>;
5
+ }>;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.countEmailsAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const common_1 = require("../common");
8
+ const auth_1 = require("../auth");
9
+ const props_1 = require("../common/props");
10
+ exports.countEmailsAction = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.hunterAuth,
12
+ name: 'count-emails',
13
+ displayName: 'Count Emails',
14
+ description: 'Returns the number of email addresses found for a domain or company.',
15
+ props: {
16
+ domain: props_1.domainProp,
17
+ company: props_1.companyProp,
18
+ type: props_1.emailTypeProp,
19
+ },
20
+ run(context) {
21
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
22
+ var _a, _b, _c, _d, _e;
23
+ const { domain, company, type } = context.propsValue;
24
+ if (!domain && !company) {
25
+ throw new Error('You must provide at least a domain or a company name to count emails.');
26
+ }
27
+ const qparams = {};
28
+ if (domain)
29
+ qparams['domain'] = domain;
30
+ if (!domain && company)
31
+ qparams['company'] = company;
32
+ if (type)
33
+ qparams['type'] = type;
34
+ let respBody;
35
+ try {
36
+ respBody = yield (0, common_1.hunterApiCall)({
37
+ apiKey: context.auth,
38
+ endpoint: '/email-count',
39
+ method: pieces_common_1.HttpMethod.GET,
40
+ qparams,
41
+ });
42
+ }
43
+ catch (err) {
44
+ const httpErr = err;
45
+ const status = (_a = httpErr.response) === null || _a === void 0 ? void 0 : _a.status;
46
+ const details = ((_e = (_d = (_c = (_b = httpErr.response) === null || _b === void 0 ? void 0 : _b.body) === null || _c === void 0 ? void 0 : _c.errors) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.details) ||
47
+ 'Unknown error';
48
+ if (status === 400 && details.includes('wrong_params')) {
49
+ throw new Error('Missing domain or company parameter.');
50
+ }
51
+ if (status === 400 && details.includes('invalid_type')) {
52
+ throw new Error('Invalid type. Must be "personal" or "generic", exactly as shown.');
53
+ }
54
+ if (status === 429) {
55
+ throw new Error('Rate limit exceeded (15 req/s). Please wait a moment and try again.');
56
+ }
57
+ throw new Error(`Hunter Email Count API error: ${details}`);
58
+ }
59
+ const data = respBody.data;
60
+ return {
61
+ total: data.total,
62
+ personal_emails: data.personal_emails,
63
+ generic_emails: data.generic_emails,
64
+ department: data.department,
65
+ seniority: data.seniority,
66
+ };
67
+ });
68
+ },
69
+ });
70
+ //# sourceMappingURL=count-emails.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"count-emails.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/hunter/src/lib/actions/count-emails.ts"],"names":[],"mappings":";;;;AAAA,kEAA2D;AAC3D,4DAA8E;AAC9E,sCAA0C;AAC1C,kCAAqC;AACrC,2CAAyE;AAE5D,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EACT,sEAAsE;IACxE,KAAK,EAAE;QACL,MAAM,EAAE,kBAAU;QAClB,OAAO,EAAE,mBAAW;QACpB,IAAI,EAAE,qBAAa;KACpB;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,UAIzC,CAAC;YACF,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;gBACxB,MAAM,IAAI,KAAK,CACb,uEAAuE,CACxE,CAAC;YACJ,CAAC;YAED,MAAM,OAAO,GAAgB,EAAE,CAAC;YAChC,IAAI,MAAM;gBAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;YACvC,IAAI,CAAC,MAAM,IAAI,OAAO;gBAAE,OA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AI,CAAC,eAAyB;gBAC/C,cAAc,EAAE,IAAI,CAAC,cAAwB;gBAC7C,UAAU,EAAE,IAAI,CAAC,UAAoC;gBACrD,SAAS,EAAE,IAAI,CAAC,SAAmC;aACpD,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ export declare const createLeadAction: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ email: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
3
+ first_name: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
4
+ last_name: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
5
+ position: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
6
+ company: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
7
+ company_industry: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
8
+ company_size: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
9
+ confidence_score: import("@taskmagic/pieces-framework").NumberProperty<false>;
10
+ website: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
11
+ country_code: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
12
+ linkedin_url: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
13
+ phone_number: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
14
+ twitter: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
15
+ notes: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
16
+ source: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
17
+ leads_list_id: import("@taskmagic/pieces-framework").DropdownProperty<any, false>;
18
+ leads_list_ids: import("@taskmagic/pieces-framework").ArrayProperty<false>;
19
+ custom_attributes: import("@taskmagic/pieces-framework").JsonProperty<false>;
20
+ }>;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createLeadAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const common_1 = require("../common");
8
+ const auth_1 = require("../auth");
9
+ const props_1 = require("../common/props");
10
+ exports.createLeadAction = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.hunterAuth,
12
+ name: 'create-lead',
13
+ displayName: 'Create Lead',
14
+ description: 'Create and store a lead record.',
15
+ props: {
16
+ email: props_1.emailProp,
17
+ first_name: props_1.firstNameProp,
18
+ last_name: props_1.lastNameProp,
19
+ position: props_1.positionProp,
20
+ company: props_1.companyLeadProp,
21
+ company_industry: props_1.companyIndustryProp,
22
+ company_size: props_1.companySizeProp,
23
+ confidence_score: props_1.confidenceScoreProp,
24
+ website: props_1.websiteProp,
25
+ country_code: props_1.countryCodeProp,
26
+ linkedin_url: props_1.linkedinUrlProp,
27
+ phone_number: props_1.phoneNumberProp,
28
+ twitter: props_1.twitterProp,
29
+ notes: props_1.notesProp,
30
+ source: props_1.sourceProp,
31
+ leads_list_id: props_1.leadsListDropdownProp,
32
+ leads_list_ids: props_1.leadsListIdsProp,
33
+ custom_attributes: props_1.customAttributesProp,
34
+ },
35
+ run(context) {
36
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
37
+ const props = context.propsValue;
38
+ const body = {};
39
+ for (const [key, val] of Object.entries(props)) {
40
+ if (val !== undefined &&
41
+ val !== null &&
42
+ !((Array.isArray(val) && val.length === 0) ||
43
+ (typeof val === 'string' && val === ''))) {
44
+ body[key] = val;
45
+ }
46
+ }
47
+ const resp = (yield (0, common_1.hunterApiCall)({
48
+ apiKey: context.auth,
49
+ endpoint: '/leads',
50
+ method: pieces_common_1.HttpMethod.POST,
51
+ body,
52
+ }));
53
+ return { lead: resp.data };
54
+ });
55
+ },
56
+ });
57
+ //# sourceMappingURL=create-lead.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-lead.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/hunter/src/lib/actions/create-lead.ts"],"names":[],"mappings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gBAClB,CAAC;YACH,CAAC;YAED,MAAM,IAAI,GAAG,CAAC,MAAM,IAAA,sBAAa,EAAC;gBAChC,MAAM,EAAE,OAAO,CAAC,IAAI;gBACpB,QAAQ,EAAE,QAAQ;gBAClB,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI;aACL,CAAC,CAAkB,CAAC;YAErB,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;QAC7B,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const deleteLeadAction: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ lead_id: import("@taskmagic/pieces-framework").DropdownProperty<unknown, true>;
3
+ }>;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteLeadAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const common_1 = require("../common");
8
+ const auth_1 = require("../auth");
9
+ const props_1 = require("../common/props");
10
+ exports.deleteLeadAction = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.hunterAuth,
12
+ name: 'delete-lead',
13
+ displayName: 'Delete Lead',
14
+ description: 'Delete a specific lead record by ID.',
15
+ props: {
16
+ lead_id: props_1.leadDeleteDropdownProp,
17
+ },
18
+ run(context) {
19
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
20
+ const { lead_id } = context.propsValue;
21
+ yield (0, common_1.hunterApiCall)({
22
+ apiKey: context.auth,
23
+ endpoint: `/leads/${lead_id}`,
24
+ method: pieces_common_1.HttpMethod.DELETE,
25
+ });
26
+ return { success: true };
27
+ });
28
+ },
29
+ });
30
+ //# sourceMappingURL=delete-lead.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-lead.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/hunter/src/lib/actions/delete-lead.ts"],"names":[],"mappings":";;;;AAAA,kEAA2D;AAC3D,4DAAsD;AACtD,sCAA0C;AAC1C,kCAAqC;AACrC,2CAAyD;AAE5C,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,sCAAsC;IACnD,KAAK,EAAE;QACL,OAAO,EAAE,8BAAsB;KAChC;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEvC,MAAM,IAAA,sBAAa,EAAC;gBAClB,MAAM,EAAE,OAAO,CAAC,IAAI;gBACpB,QAAQ,EAAE,UAAU,OAAO,EAAE;gBAC7B,MAAM,EAAE,0BAAU,CAAC,MAAM;aAC1B,CAAC,CAAC;YAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC3B,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const findEmailAction: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ domain: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
3
+ company: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
4
+ first_name: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
5
+ last_name: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
6
+ full_name: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
7
+ max_duration: import("@taskmagic/pieces-framework").NumberProperty<false>;
8
+ }>;
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findEmailAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const common_1 = require("../common");
8
+ const auth_1 = require("../auth");
9
+ const props_1 = require("../common/props");
10
+ exports.findEmailAction = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.hunterAuth,
12
+ name: 'find-email',
13
+ displayName: 'Find Email',
14
+ description: 'Retrieve/propose the most likely email for a person at a domain.',
15
+ props: {
16
+ domain: props_1.domainProp,
17
+ company: props_1.companyProp,
18
+ first_name: props_1.firstNameProp,
19
+ last_name: props_1.lastNameProp,
20
+ full_name: props_1.fullNameProp,
21
+ max_duration: props_1.maxDurationProp,
22
+ },
23
+ run(context) {
24
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
25
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
26
+ const { domain, company, first_name, last_name, full_name, max_duration } = context.propsValue;
27
+ if (!domain && !company) {
28
+ throw new Error('You must provide at least a domain or a company name.');
29
+ }
30
+ if (!((first_name && last_name) || full_name)) {
31
+ throw new Error('You must provide both first_name and last_name, or a full_name.');
32
+ }
33
+ if (max_duration !== undefined && (max_duration < 3 || max_duration > 20)) {
34
+ throw new Error('max_duration must be between 3 and 20 seconds.');
35
+ }
36
+ const qparams = {};
37
+ if (domain)
38
+ qparams['domain'] = domain;
39
+ else if (company)
40
+ qparams['company'] = company;
41
+ if (first_name)
42
+ qparams['first_name'] = first_name;
43
+ if (last_name)
44
+ qparams['last_name'] = last_name;
45
+ if (full_name)
46
+ qparams['full_name'] = full_name;
47
+ if (max_duration !== undefined)
48
+ qparams['max_duration'] = String(max_duration);
49
+ let responseBody;
50
+ try {
51
+ responseBody = yield (0, common_1.hunterApiCall)({
52
+ apiKey: context.auth,
53
+ endpoint: '/email-finder',
54
+ method: pieces_common_1.HttpMethod.GET,
55
+ qparams,
56
+ });
57
+ }
58
+ catch (err) {
59
+ const httpErr = err;
60
+ const status = (_a = httpErr.response) === null || _a === void 0 ? void 0 : _a.status;
61
+ const errId = (_e = (_d = (_c = (_b = httpErr.response) === null || _b === void 0 ? void 0 : _b.body) === null || _c === void 0 ? void 0 : _c.errors) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.id;
62
+ const details = (_k = (_j = (_h = (_g = (_f = httpErr.response) === null || _f === void 0 ? void 0 : _f.body) === null || _g === void 0 ? void 0 : _g.errors) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.details) !== null && _k !== void 0 ? _k : '';
63
+ if (status === 400) {
64
+ switch (errId) {
65
+ case 'wrong_params':
66
+ throw new Error('Missing required parameter—please supply domain or company, and first_name+last_name or full_name.');
67
+ case 'invalid_first_name':
68
+ throw new Error('The supplied first_name is invalid.');
69
+ case 'invalid_last_name':
70
+ throw new Error('The supplied last_name is invalid.');
71
+ case 'invalid_full_name':
72
+ throw new Error('The supplied full_name is invalid.');
73
+ case 'invalid_domain':
74
+ throw new Error('The supplied domain is invalid or lacks MX records.');
75
+ case 'invalid_max_duration':
76
+ throw new Error('The supplied max_duration is invalid (must be 3–20 seconds).');
77
+ }
78
+ }
79
+ if (status === 429) {
80
+ throw new Error('Rate limit exceeded (15 requests/sec, 500 req/min). Please retry shortly.');
81
+ }
82
+ if (status === 451 && errId === 'claimed_email') {
83
+ throw new Error('This email address cannot be processed because its owner requested to stop processing.');
84
+ }
85
+ throw new Error(`Hunter Email Finder error: ${details} (status ${status}).`);
86
+ }
87
+ const d = responseBody.data;
88
+ return {
89
+ first_name: d.first_name,
90
+ last_name: d.last_name,
91
+ email: d.email,
92
+ score: d.score,
93
+ domain: d.domain,
94
+ accept_all: d.accept_all,
95
+ position: d.position,
96
+ twitter: d.twitter,
97
+ linkedin_url: d.linkedin_url,
98
+ phone_number: d.phone_number,
99
+ company: d.company,
100
+ sources: d.sources,
101
+ verification: d.verification,
102
+ };
103
+ });
104
+ },
105
+ });
106
+ //# sourceMappingURL=find-email.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-email.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/hunter/src/lib/actions/find-email.ts"],"names":[],"m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oC,CAAC,CAAC;wBACxD,KAAK,gBAAgB;4BACnB,MAAM,IAAI,KAAK,CACb,qDAAqD,CACtD,CAAC;wBACJ,KAAK,sBAAsB;4BACzB,MAAM,IAAI,KAAK,CACb,8DAA8D,CAC/D,CAAC;oBACN,CAAC;gBACH,CAAC;gBACD,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;oBACnB,MAAM,IAAI,KAAK,CACb,2EAA2E,CAC5E,CAAC;gBACJ,CAAC;gBACD,IAAI,MAAM,KAAK,GAAG,IAAI,KAAK,KAAK,eAAe,EAAE,CAAC;oBAChD,MAAM,IAAI,KAAK,CACb,wFAAwF,CACzF,CAAC;gBACJ,CAAC;gBACD,MAAM,IAAI,KAAK,CACb,8BAA8B,OAAO,YAAY,MAAM,IAAI,CAC5D,CAAC;YACJ,CAAC;YAED,MAAM,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC;YAC5B,OAAO;gBACL,UAAU,EAAE,CAAC,CAAC,UAAU;gBACxB,SAAS,EAAE,CAAC,CAAC,SAAS;gBACtB,KAAK,EAAE,CAAC,CAAC,KAAK;gBACd,KAAK,EAAE,CAAC,CAAC,KAAK;gBACd,MAAM,EAAE,CAAC,CAAC,MAAM;gBAChB,UAAU,EAAE,CAAC,CAAC,UAAU;gBACxB,QAAQ,EAAE,CAAC,CAAC,QAAQ;gBACpB,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,YAAY,EAAE,CAAC,CAAC,YAAY;gBAC5B,YAAY,EAAE,CAAC,CAAC,YAAY;gBAC5B,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,YAAY,EAAE,CAAC,CAAC,YAAY;aAC7B,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const getLeadAction: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ lead_id: import("@taskmagic/pieces-framework").DropdownProperty<unknown, true>;
3
+ }>;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getLeadAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const common_1 = require("../common");
8
+ const auth_1 = require("../auth");
9
+ const props_1 = require("../common/props");
10
+ exports.getLeadAction = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.hunterAuth,
12
+ name: 'get-lead',
13
+ displayName: 'Get Lead',
14
+ description: 'Retrieve details of a specific lead.',
15
+ props: {
16
+ lead_id: props_1.leadSelectDropdownProp,
17
+ },
18
+ run(context) {
19
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
20
+ const { lead_id } = context.propsValue;
21
+ const resp = (yield (0, common_1.hunterApiCall)({
22
+ apiKey: context.auth,
23
+ endpoint: `/leads/${lead_id}`,
24
+ method: pieces_common_1.HttpMethod.GET,
25
+ }));
26
+ return { lead: resp.data };
27
+ });
28
+ },
29
+ });
30
+ //# sourceMappingURL=get-lead.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-lead.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/hunter/src/lib/actions/get-lead.ts"],"names":[],"mappings":";;;;AAAA,kEAA2D;AAC3D,4DAAsD;AACtD,sCAA0C;AAC1C,kCAAqC;AACrC,2CAAyD;AAE5C,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,sCAAsC;IACnD,KAAK,EAAE;QACL,OAAO,EAAE,8BAAsB;KAChC;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEvC,MAAM,IAAI,GAAG,CAAC,MAAM,IAAA,sBAAa,EAAC;gBAChC,MAAM,EAAE,OAAO,CAAC,IAAI;gBACpB,QAAQ,EAAE,UAAU,OAAO,EAAE;gBAC7B,MAAM,EAAE,0BAAU,CAAC,GAAG;aACvB,CAAC,CAkCD,CAAC;YAEF,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;QAC7B,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ export declare const searchLeadsAction: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ leads_list_id: import("@taskmagic/pieces-framework").DropdownProperty<any, false>;
3
+ email: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
4
+ first_name: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
5
+ last_name: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
6
+ position: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
7
+ company: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
8
+ industry: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
9
+ website: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
10
+ country_code: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
11
+ company_size: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
12
+ source: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
13
+ twitter: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
14
+ linkedin_url: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
15
+ phone_number: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
16
+ sync_status: import("@taskmagic/pieces-framework").DropdownProperty<string, false>;
17
+ sending_status: import("@taskmagic/pieces-framework").ArrayProperty<false>;
18
+ verification_status: import("@taskmagic/pieces-framework").ArrayProperty<false>;
19
+ last_activity_at: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
20
+ last_contacted_at: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
21
+ custom_attributes: import("@taskmagic/pieces-framework").JsonProperty<false>;
22
+ query: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
23
+ limit: import("@taskmagic/pieces-framework").NumberProperty<false>;
24
+ offset: import("@taskmagic/pieces-framework").NumberProperty<false>;
25
+ }>;