@pipedream/tomba 0.0.5 → 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.
package/tomba.app.mjs CHANGED
@@ -1,11 +1,563 @@
1
+ import { axios } from "@pipedream/platform";
2
+
1
3
  export default {
2
4
  type: "app",
3
5
  app: "tomba",
4
- propDefinitions: {},
6
+ propDefinitions: {
7
+ domain: {
8
+ type: "string",
9
+ label: "Domain",
10
+ description: "The domain name to search (e.g., stripe.com)",
11
+ },
12
+ email: {
13
+ type: "string",
14
+ label: "Email Address",
15
+ description: "The email address to verify or search",
16
+ },
17
+ firstName: {
18
+ type: "string",
19
+ label: "First Name",
20
+ description: "The first name of the person",
21
+ },
22
+ lastName: {
23
+ type: "string",
24
+ label: "Last Name",
25
+ description: "The last name of the person",
26
+ },
27
+ linkedinUrl: {
28
+ type: "string",
29
+ label: "LinkedIn URL",
30
+ description: "The LinkedIn profile URL",
31
+ },
32
+ blogUrl: {
33
+ type: "string",
34
+ label: "Blog Post URL",
35
+ description: "The blog post URL to find author email",
36
+ },
37
+ phoneNumber: {
38
+ type: "string",
39
+ label: "Phone Number",
40
+ description: "The phone number to validate",
41
+ },
42
+ country: {
43
+ type: "string",
44
+ label: "Country",
45
+ description: "Two-letter country code (e.g., US, UK, FR)",
46
+ optional: true,
47
+ },
48
+ limit: {
49
+ type: "integer",
50
+ label: "Limit",
51
+ description: "Number of results to return (max 100)",
52
+ optional: true,
53
+ default: 10,
54
+ min: 1,
55
+ max: 100,
56
+ },
57
+ query: {
58
+ type: "string",
59
+ label: "Search Query",
60
+ description: "Natural language query or structured search terms",
61
+ },
62
+ filters: {
63
+ type: "object",
64
+ label: "Search Filters",
65
+ description: "Structured filters for company search",
66
+ optional: true,
67
+ },
68
+ page: {
69
+ type: "integer",
70
+ label: "Page",
71
+ description: "Page number for pagination",
72
+ optional: true,
73
+ default: 1,
74
+ min: 1,
75
+ },
76
+ limitDomainSearch: {
77
+ type: "string",
78
+ label: "Limit",
79
+ description: "Specifies the max number of email addresses to return.",
80
+ optional: true,
81
+ default: "10",
82
+ options: [
83
+ "10",
84
+ "20",
85
+ "50",
86
+ ],
87
+ },
88
+ department: {
89
+ type: "string",
90
+ label: "Department",
91
+ description:
92
+ "Get only email addresses for people working in the selected department(s).",
93
+ optional: true,
94
+ options: [
95
+ "engineering",
96
+ "sales",
97
+ "finance",
98
+ "hr",
99
+ "it",
100
+ "marketing",
101
+ "operations",
102
+ "management",
103
+ "executive",
104
+ "legal",
105
+ "support",
106
+ "communication",
107
+ "software",
108
+ "security",
109
+ "pr",
110
+ "warehouse",
111
+ "diversity",
112
+ "administrative",
113
+ "facilities",
114
+ "accounting",
115
+ ],
116
+ },
117
+ url: {
118
+ type: "string",
119
+ label: "URL",
120
+ description: "The URL to analyze or search",
121
+ },
122
+ searchType: {
123
+ type: "string",
124
+ label: "Search Type",
125
+ description: "Choose the type of search to perform",
126
+ options: [
127
+ {
128
+ label: "Search by Domain",
129
+ value: "domain",
130
+ },
131
+ {
132
+ label: "Search by Email",
133
+ value: "email",
134
+ },
135
+ {
136
+ label: "Search by LinkedIn URL",
137
+ value: "linkedin",
138
+ },
139
+ ],
140
+ reloadProps: true,
141
+ default: "domain",
142
+ },
143
+ companyName: {
144
+ type: "string",
145
+ label: "Company Name",
146
+ description: "The company name to search for",
147
+ },
148
+ },
5
149
  methods: {
6
- // this.$auth contains connected account data
7
- authKeys() {
8
- console.log(Object.keys(this.$auth));
150
+ /**
151
+ * Get the base URL for Tomba API
152
+ * @returns {string} The base URL for API requests
153
+ */
154
+ _baseUrl() {
155
+ return "https://api.tomba.io/v1";
156
+ },
157
+ /**
158
+ * Get headers for API requests including authentication
159
+ * @returns {object} Headers object with API credentials
160
+ */
161
+ _headers() {
162
+ return {
163
+ "X-Tomba-Key": this.$auth.api_key,
164
+ "X-Tomba-Secret": this.$auth.api_secret,
165
+ "User-Agent": "Pipedream/1.0",
166
+ "Accept": "application/json",
167
+ };
168
+ },
169
+ /**
170
+ * Make an HTTP request to the Tomba API
171
+ * @param {object} opts - Configuration options for the request
172
+ * @param {object} opts.$ - Pipedream step context
173
+ * @param {string} opts.path - API endpoint path
174
+ * @param {string} [opts.method=GET] - HTTP method
175
+ * @param {object} [opts.params] - Query parameters
176
+ * @param {object} [opts.data] - Request body data
177
+ * @returns {Promise} API response
178
+ */
179
+ async _makeRequest({
180
+ $ = this, path, ...opts
181
+ }) {
182
+ return axios($, {
183
+ url: `${this._baseUrl()}${path}`,
184
+ headers: this._headers(),
185
+ ...opts,
186
+ });
187
+ },
188
+ /**
189
+ * Find author email from blog post URL
190
+ * @param {object} opts - Configuration options
191
+ * @param {object} opts.$ - Pipedream step context
192
+ * @param {string} opts.blogUrl - The blog post URL to analyze
193
+ * @returns {Promise} Author information and email address
194
+ */
195
+ async findAuthor({
196
+ $, blogUrl, ...opts
197
+ }) {
198
+ return this._makeRequest({
199
+ $,
200
+ path: "/author-finder",
201
+ params: {
202
+ url: blogUrl,
203
+ ...opts,
204
+ },
205
+ });
206
+ },
207
+ /**
208
+ * Get every email address found on the internet for a domain
209
+ * @param {string} opts.domain - The domain to search
210
+ * @param {number} [opts.limit=10] - Number of results to return
211
+ * @returns {Promise} Array of email addresses with sources
212
+ */
213
+ async searchDomain({
214
+ $, domain, ...opts
215
+ }) {
216
+ return this._makeRequest({
217
+ $,
218
+ path: "/domain-search",
219
+ params: {
220
+ domain,
221
+ ...opts,
222
+ },
223
+ });
224
+ },
225
+ /**
226
+ * Get the status of a domain (e.g., if it's disposable or webmail)
227
+ * @param {string} opts.domain - The domain to check
228
+ * @returns {Promise} Domain status information
229
+ * @description This endpoint checks if a domain is disposable or webmail.
230
+ */
231
+ async getDomainStatus({
232
+ $, domain, ...opts
233
+ }) {
234
+ return this._makeRequest({
235
+ $,
236
+ path: "/domain-status",
237
+ params: {
238
+ domain,
239
+ ...opts,
240
+ },
241
+ });
242
+ },
243
+ /**
244
+ * Get the number of email addresses found for a domain
245
+ * @param {string} opts.domain - The domain to check
246
+ * @returns {Promise} Email count information
247
+ * @description This endpoint retrieves the number of email addresses.
248
+ */
249
+ async getEmailCount({
250
+ $, domain, ...opts
251
+ }) {
252
+ return this._makeRequest({
253
+ $,
254
+ path: "/email-count",
255
+ params: {
256
+ domain,
257
+ ...opts,
258
+ },
259
+ });
260
+ },
261
+ /**
262
+ * Enrich email data with additional information
263
+ * @param {string} opts.email - The email address to enrich
264
+ * @returns {Promise} Enriched email information
265
+ * @description This endpoint enriches email data with additional information.
266
+ */
267
+ async enrichEmail({
268
+ $, email, ...opts
269
+ }) {
270
+ return this._makeRequest({
271
+ $,
272
+ path: "/enrich",
273
+ params: {
274
+ email,
275
+ ...opts,
276
+ },
277
+ });
278
+ },
279
+ /**
280
+ * Find the most likely email address from a domain name, first name, and last name
281
+ * @param {string} opts.domain - The domain name to use
282
+ * @param {string} opts.firstName - The first name of the person
283
+ * @param {string} opts.lastName - The last name of the person
284
+ * @returns {Promise} Email address information
285
+ * @description This endpoint generates or retrieves the most likely email address.
286
+ */
287
+ async findEmail({
288
+ $, domain, firstName, lastName, ...opts
289
+ }) {
290
+ return this._makeRequest({
291
+ $,
292
+ path: "/email-finder",
293
+ params: {
294
+ domain,
295
+ first_name: firstName,
296
+ last_name: lastName,
297
+ ...opts,
298
+ },
299
+ });
300
+ },
301
+ /**
302
+ * Get the email format for a domain
303
+ * @param {string} opts.domain - The domain to check
304
+ * @returns {Promise} Email format information
305
+ * @description This endpoint retrieves the email format used by a specific domain.
306
+ */
307
+ async getEmailFormat({
308
+ $, domain, ...opts
309
+ }) {
310
+ return this._makeRequest({
311
+ $,
312
+ path: "/email-format",
313
+ params: {
314
+ domain,
315
+ ...opts,
316
+ },
317
+ });
318
+ },
319
+ /**
320
+ * Get the email sources for a specific email address
321
+ * @param {string} opts.email - The email address to check
322
+ * @returns {Promise} Email sources information
323
+ * @description This endpoint retrieves the sources where a specific email address was found.
324
+ */
325
+ async getEmailSources({
326
+ $, email, ...opts
327
+ }) {
328
+ return this._makeRequest({
329
+ $,
330
+ path: "/email-sources",
331
+ params: {
332
+ email,
333
+ ...opts,
334
+ },
335
+ });
336
+ },
337
+ /**
338
+ * Verify the validity of an email address
339
+ * @param {string} opts.email - The email address to verify
340
+ * @returns {Promise} Email verification information
341
+ * @description This endpoint verifies the validity of an email address.
342
+ */
343
+ async verifyEmail({
344
+ $, email, ...opts
345
+ }) {
346
+ return this._makeRequest({
347
+ $,
348
+ path: "/email-verifier",
349
+ params: {
350
+ email,
351
+ ...opts,
352
+ },
353
+ });
354
+ },
355
+ /**
356
+ * Find a LinkedIn profile based on a LinkedIn URL
357
+ * @param {string} opts.linkedinUrl - The LinkedIn profile URL
358
+ * @returns {Promise} LinkedIn profile information
359
+ * @description This endpoint retrieves information from a LinkedIn profile URL.
360
+ */
361
+ async findLinkedIn({
362
+ $, linkedinUrl, ...opts
363
+ }) {
364
+ return this._makeRequest({
365
+ $,
366
+ path: "/linkedin",
367
+ params: {
368
+ url: linkedinUrl,
369
+ ...opts,
370
+ },
371
+ });
372
+ },
373
+ /**
374
+ * Get the location information for a specific domain
375
+ * @param {string} opts.domain - The domain to check
376
+ * @returns {Promise} Location information
377
+ * @description This endpoint retrieves location information associated with a specific domain.
378
+ */
379
+ async getLocation({
380
+ $, domain, ...opts
381
+ }) {
382
+ return this._makeRequest({
383
+ $,
384
+ path: "/location",
385
+ params: {
386
+ domain,
387
+ ...opts,
388
+ },
389
+ });
390
+ },
391
+ /**
392
+ * Find a phone number based on various parameters
393
+ * @param {string} [opts.domain] - The domain associated with the phone number
394
+ * @param {string} [opts.email] - The email address associated with the phone number
395
+ * @param {string} [opts.linkedinUrl] - The LinkedIn profile URL
396
+ * @returns {Promise} Phone number information
397
+ * @description This endpoint retrieves phone number information based on provided parameters.
398
+ */
399
+ async findPhone({
400
+ $, domain, email, linkedinUrl, ...opts
401
+ }) {
402
+ const params = {};
403
+ if (domain) params.domain = domain;
404
+ if (email) params.email = email;
405
+ if (linkedinUrl) params.linkedin = linkedinUrl;
406
+
407
+ return this._makeRequest({
408
+ $,
409
+ path: "/phone-finder",
410
+ params: {
411
+ ...params,
412
+ ...opts,
413
+ },
414
+ });
415
+ },
416
+ /**
417
+ * Validate a phone number
418
+ * @param {string} [opts.phoneNumber] - The phone number to validate
419
+ * @param {string} [opts.country] - The country code (e.g., US, UK)
420
+ * @returns {Promise} Phone validation information
421
+ * @description This endpoint validates a phone number.
422
+ */
423
+ async validatePhone({
424
+ $, phoneNumber, country, ...opts
425
+ }) {
426
+ return this._makeRequest({
427
+ $,
428
+ path: "/phone-validator",
429
+ params: {
430
+ phone: phoneNumber,
431
+ country,
432
+ ...opts,
433
+ },
434
+ });
435
+ },
436
+ /**
437
+ * Find similar domains based on a specific domain
438
+ * @param {string} opts.domain - The domain to check
439
+ * @returns {Promise} Similar domain information
440
+ * @description This endpoint retrieves domains similar to a specified domain.
441
+ */
442
+ async findSimilarDomains({
443
+ $, domain, ...opts
444
+ }) {
445
+ return this._makeRequest({
446
+ $,
447
+ path: "/similar",
448
+ params: {
449
+ domain,
450
+ ...opts,
451
+ },
452
+ });
453
+ },
454
+ /**
455
+ * Get technology stack information for a specific domain
456
+ * @param {string} opts.domain - The domain to check
457
+ * @returns {Promise} Technology stack information
458
+ * @description This endpoint retrieves technology stack information.
459
+ */
460
+ async getTechnology({
461
+ $, domain, ...opts
462
+ }) {
463
+ return this._makeRequest({
464
+ $,
465
+ path: "/technology",
466
+ params: {
467
+ domain,
468
+ ...opts,
469
+ },
470
+ });
471
+ },
472
+ /**
473
+ * Get the account information for the authenticated user
474
+ * @returns {Promise} Account information
475
+ * @description This endpoint retrieves the account information for the authenticated user.
476
+ */
477
+ async getAccount({
478
+ $, ...opts
479
+ }) {
480
+ return this._makeRequest({
481
+ $,
482
+ path: "/me",
483
+ ...opts,
484
+ });
485
+ },
486
+ /**
487
+ * Search for companies based on various parameters
488
+ * @param {*} param0
489
+ * @returns {Promise} Company search results
490
+ * @description This endpoint searches for companies based on various parameters.
491
+ */
492
+ async searchCompanies({
493
+ $, query, filters, limit, page, ...opts
494
+ }) {
495
+ return this._makeRequest({
496
+ $,
497
+ path: "/reveal/search",
498
+ method: "POST",
499
+ data: {
500
+ query,
501
+ filters,
502
+ limit,
503
+ page,
504
+ ...opts,
505
+ },
506
+ });
507
+ },
508
+ /**
509
+ * Get domain suggestions based on a specific query
510
+ * @param {string} opts.query - The query to search for domain suggestions
511
+ * @returns {Promise} Domain suggestions
512
+ * @description This endpoint retrieves domain suggestions based on a specific query.
513
+ */
514
+ async getDomainSuggestions({
515
+ $, query, ...opts
516
+ }) {
517
+ return this._makeRequest({
518
+ $,
519
+ path: "/domain-suggestions",
520
+ params: {
521
+ query,
522
+ ...opts,
523
+ },
524
+ });
525
+ },
526
+ /**
527
+ * Get usage statistics for the authenticated user
528
+ * @returns {Promise} Usage statistics
529
+ * @description This endpoint retrieves usage statistics for the authenticated user.
530
+ */
531
+ async getUsage({
532
+ $, ...opts
533
+ }) {
534
+ return this._makeRequest({
535
+ $,
536
+ path: "/usage",
537
+ params: {
538
+ ...opts,
539
+ },
540
+ });
541
+ },
542
+ /**
543
+ * Get logs for the authenticated user
544
+ * @param {string} opts.limit - The maximum number of logs to retrieve
545
+ * @param {string} opts.page - The page number for pagination
546
+ * @returns {Promise} Logs information
547
+ * @description This endpoint retrieves logs for the authenticated user.
548
+ */
549
+ async getLogs({
550
+ $, limit, page, ...opts
551
+ }) {
552
+ return this._makeRequest({
553
+ $,
554
+ path: "/logs",
555
+ params: {
556
+ limit,
557
+ page,
558
+ ...opts,
559
+ },
560
+ });
9
561
  },
10
562
  },
11
563
  };