-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New Components - finalscout #17222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
New Components - finalscout #17222
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
components/finalscout/actions/find-email-linkedin/find-email-linkedin.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| import finalscout from "../../finalscout.app.mjs"; | ||
| import { parseObject } from "../../common/utils.mjs"; | ||
|
|
||
| export default { | ||
| key: "finalscout-find-email-linkedin", | ||
| name: "Find Email from LinkedIn", | ||
| description: "Finds an email address from a LinkedIn profile URL. [See the documentation](https://finalscout.com/public/doc/api.html#tag/Single-Find/paths/~1v1~1find~1linkedin~1single/post)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| finalscout, | ||
| url: { | ||
| type: "string", | ||
| label: "LinkedIn Profile URL", | ||
| description: "The URL of the LinkedIn profile.", | ||
| }, | ||
| tags: { | ||
| propDefinition: [ | ||
| finalscout, | ||
| "tags", | ||
| ], | ||
| }, | ||
| metadata: { | ||
| propDefinition: [ | ||
| finalscout, | ||
| "metadata", | ||
| ], | ||
| }, | ||
| enablePersonalEmail: { | ||
| type: "boolean", | ||
| label: "Enable Personal Email", | ||
| description: "Whether to find personal emails (e.g. [email protected]) when a professional email address is not found", | ||
| optional: true, | ||
| }, | ||
| enableGenericEmail: { | ||
| type: "boolean", | ||
| label: "Enable Generic Email", | ||
| description: "Whether to find generic emails (e.g. [email protected]) when a professional email address is not found", | ||
| optional: true, | ||
| }, | ||
| webhookUrl: { | ||
| propDefinition: [ | ||
| finalscout, | ||
| "webhookUrl", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.finalscout.findEmailViaLinkedIn({ | ||
| $, | ||
| data: { | ||
| person: { | ||
| linkedin_url: this.url, | ||
| }, | ||
| tags: this.tags, | ||
| metadata: parseObject(this.metadata), | ||
| enable_personal_email: this.enablePersonalEmail, | ||
| enable_generic_email: this.enableGenericEmail, | ||
| webhook_url: this.webhookUrl, | ||
| }, | ||
| }); | ||
| $.export("$summary", "Successfully requested email for LinkedIn profile."); | ||
| return response; | ||
| }, | ||
| }; |
51 changes: 51 additions & 0 deletions
51
components/finalscout/actions/find-email-news-article/find-email-news-article.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| import finalscout from "../../finalscout.app.mjs"; | ||
| import { parseObject } from "../../common/utils.mjs"; | ||
|
|
||
| export default { | ||
| key: "finalscout-find-email-news-article", | ||
| name: "Find Email from News Article", | ||
| description: "Finds an email address from a news article URL. [See the documentation](https://finalscout.com/public/doc/api.html#tag/Single-Find/paths/~1v1~1find~1author~1single/post)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| finalscout, | ||
| url: { | ||
| type: "string", | ||
| label: "News Article URL", | ||
| description: "The URL of the news article.", | ||
| }, | ||
| tags: { | ||
| propDefinition: [ | ||
| finalscout, | ||
| "tags", | ||
| ], | ||
| }, | ||
| metadata: { | ||
| propDefinition: [ | ||
| finalscout, | ||
| "metadata", | ||
| ], | ||
| }, | ||
| webhookUrl: { | ||
| propDefinition: [ | ||
| finalscout, | ||
| "webhookUrl", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.finalscout.findEmailViaNewsArticle({ | ||
| $, | ||
| data: { | ||
| person: { | ||
| article_url: this.url, | ||
| }, | ||
| tags: this.tags, | ||
| metadata: parseObject(this.metadata), | ||
| webhook_url: this.webhookUrl, | ||
| }, | ||
| }); | ||
| $.export("$summary", "Successfully requested email for news article."); | ||
| return response; | ||
| }, | ||
| }; |
64 changes: 64 additions & 0 deletions
64
components/finalscout/actions/find-email-professional/find-email-professional.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| import finalscout from "../../finalscout.app.mjs"; | ||
| import { parseObject } from "../../common/utils.mjs"; | ||
|
|
||
| export default { | ||
| key: "finalscout-find-email-professional", | ||
| name: "Find Email from Professional", | ||
| description: "Finds an email address from a person's name and company/domain. [See the documentation](https://finalscout.com/public/doc/api.html#tag/Single-Find/operation/email_finder_v1_person_email_finder_post)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| finalscout, | ||
| fullName: { | ||
| type: "string", | ||
| label: "Full Name", | ||
| description: "The full name of the contact", | ||
| }, | ||
| domain: { | ||
| type: "string", | ||
| label: "Company Domain", | ||
| description: "The company domain for the contact", | ||
| }, | ||
| deepVerify: { | ||
| type: "boolean", | ||
| label: "Deep Verify", | ||
| description: "Whether to perform a deep verification of the email address", | ||
| optional: true, | ||
| }, | ||
| tags: { | ||
| propDefinition: [ | ||
| finalscout, | ||
| "tags", | ||
| ], | ||
| }, | ||
| metadata: { | ||
| propDefinition: [ | ||
| finalscout, | ||
| "metadata", | ||
| ], | ||
| }, | ||
| webhookUrl: { | ||
| propDefinition: [ | ||
| finalscout, | ||
| "webhookUrl", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.finalscout.findEmailProfessional({ | ||
| $, | ||
| data: { | ||
| person: { | ||
| full_name: this.fullName, | ||
| domain: this.domain, | ||
| deep_verify: this.deepVerify, | ||
| }, | ||
| tags: this.tags, | ||
| metadata: parseObject(this.metadata), | ||
| webhook_url: this.webhookUrl, | ||
| }, | ||
| }); | ||
| $.export("$summary", "Successfully requested email for professional."); | ||
| return response; | ||
| }, | ||
| }; |
27 changes: 27 additions & 0 deletions
27
components/finalscout/actions/get-single-task/get-single-task.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import finalscout from "../../finalscout.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "finalscout-get-single-task", | ||
| name: "Get Single Task", | ||
| description: "Get the task status for any Single Find task. [See the documentation](https://finalscout.com/public/doc/api.html#tag/Single-Find/paths/~1v1~1find~1single~1status/get)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| finalscout, | ||
| id: { | ||
| type: "string", | ||
| label: "Task ID", | ||
| description: "The ID of the task to get the status for", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.finalscout.getSingleTask({ | ||
| $, | ||
| params: { | ||
| id: this.id, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully retrieved status for task with ID: ${this.id}`); | ||
| return response; | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| export const parseObject = (obj) => { | ||
| if (!obj) { | ||
| return undefined; | ||
| } | ||
| if (typeof obj === "string") { | ||
| try { | ||
| return JSON.parse(obj); | ||
| } catch (e) { | ||
| return undefined; | ||
| } | ||
| } | ||
| if (Array.isArray(obj)) { | ||
| return obj.map(parseObject); | ||
| } | ||
| if (typeof obj === "object") { | ||
| return Object.fromEntries(Object.entries(obj).map(([ | ||
| key, | ||
| value, | ||
| ]) => [ | ||
| key, | ||
| parseObject(value), | ||
| ])); | ||
| } | ||
| return obj; | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,69 @@ | ||
| import { axios } from "@pipedream/platform"; | ||
|
|
||
| export default { | ||
| type: "app", | ||
| app: "finalscout", | ||
| propDefinitions: {}, | ||
| propDefinitions: { | ||
| tags: { | ||
| type: "string[]", | ||
| label: "Tags", | ||
| description: "Use tags to organize your contacts in FinalScout web app", | ||
| optional: true, | ||
| }, | ||
| webhookUrl: { | ||
| type: "string", | ||
| label: "Webhook URL", | ||
| description: "A URL to receive the webhook event for this task. A webhook event will be sent to the URL when the task is completed, regardless of whether an email is found or not", | ||
| optional: true, | ||
| }, | ||
| metadata: { | ||
| type: "object", | ||
| label: "Metadata", | ||
| description: "Use this param to send custom meta data (like contact id) associated with the contact. The custom data will be returned in the response and webhook event.", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| methods: { | ||
| // this.$auth contains connected account data | ||
| authKeys() { | ||
| console.log(Object.keys(this.$auth)); | ||
| _baseUrl() { | ||
| return "https://api.finalscout.com/v1"; | ||
| }, | ||
| _makeRequest({ | ||
| $ = this, path, ...opts | ||
| }) { | ||
| return axios($, { | ||
| url: `${this._baseUrl()}${path}`, | ||
| headers: { | ||
| Authorization: this.$auth.api_key, | ||
| }, | ||
| ...opts, | ||
| }); | ||
| }, | ||
| findEmailViaLinkedIn(opts = {}) { | ||
| return this._makeRequest({ | ||
| method: "POST", | ||
| path: "/find/linkedin/single", | ||
| ...opts, | ||
| }); | ||
| }, | ||
| findEmailViaNewsArticle(opts = {}) { | ||
| return this._makeRequest({ | ||
| method: "POST", | ||
| path: "/find/author/single", | ||
| ...opts, | ||
| }); | ||
| }, | ||
| findEmailProfessional(opts = {}) { | ||
| return this._makeRequest({ | ||
| method: "POST", | ||
| path: "/find/professional/single", | ||
| ...opts, | ||
| }); | ||
| }, | ||
| getSingleTask(opts = {}) { | ||
| return this._makeRequest({ | ||
| path: "/find/single/status", | ||
| ...opts, | ||
| }); | ||
| }, | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "@pipedream/finalscout", | ||
| "version": "0.0.1", | ||
| "version": "0.1.0", | ||
| "description": "Pipedream FinalScout Components", | ||
| "main": "finalscout.app.mjs", | ||
| "keywords": [ | ||
|
|
@@ -11,5 +11,8 @@ | |
| "author": "Pipedream <[email protected]> (https://pipedream.com/)", | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "dependencies": { | ||
| "@pipedream/platform": "^3.1.0" | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.