- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.5k
[Components] fullenrich #14282
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
                    [Components] fullenrich #14282
Changes from all commits
      Commits
    
    
  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
        
          
          
            108 changes: 108 additions & 0 deletions
          
          108 
        
  components/fullenrich/actions/enrich-contact/enrich-contact.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,108 @@ | ||
| import { ConfigurationError } from "@pipedream/platform"; | ||
| import app from "../../fullenrich.app.mjs"; | ||
|  | ||
| export default { | ||
| key: "fullenrich-enrich-contact", | ||
| name: "Enrich Contact", | ||
| description: "Starts the enrichment process for a specified contact. [See the documentation](https://docs.fullenrich.com/startbulk)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| name: { | ||
| type: "string", | ||
| label: "Name", | ||
| description: "The name of the action.", | ||
| }, | ||
| webhookUrl: { | ||
| type: "string", | ||
| label: "Webhook URL", | ||
| description: "The Webhook URL that will be triggered when the enrichment is done.", | ||
| optional: true, | ||
| }, | ||
| firstname: { | ||
| type: "string", | ||
| label: "First Name", | ||
| description: "The first name of the contact to enrich.", | ||
| }, | ||
| lastname: { | ||
| type: "string", | ||
| label: "Last Name", | ||
| description: "The last name of the contact to enrich.", | ||
| }, | ||
| domain: { | ||
| type: "string", | ||
| label: "Domain", | ||
| description: "The domain of the contact's company (e.g., example.com). Optional if **Company Name** is provided.", | ||
| optional: true, | ||
| }, | ||
| companyName: { | ||
| type: "string", | ||
| label: "Company Name", | ||
| description: "The name of the contact's company. Optional if a **Domain** is provided.", | ||
| optional: true, | ||
| }, | ||
| linkedinUrl: { | ||
| type: "string", | ||
| label: "LinkedIn URL", | ||
| description: "The LinkedIn URL of the contact to increase the probability of finding emails and phones.", | ||
| optional: true, | ||
| }, | ||
| enrichFields: { | ||
| type: "string[]", | ||
| label: "Enrich Fields", | ||
| description: "The fields to enrich. By default, the action enriches contact emails and phones.", | ||
| optional: true, | ||
| options: [ | ||
| "contact.emails", | ||
| "contact.phones", | ||
| ], | ||
| }, | ||
| }, | ||
| methods: { | ||
| enrichContacts(args = {}) { | ||
| return this.app.post({ | ||
| path: "/contact/enrich/bulk", | ||
| ...args, | ||
| }); | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| enrichContacts, | ||
| name, | ||
| webhookUrl, | ||
| firstname, | ||
| lastname, | ||
| domain, | ||
| companyName, | ||
| linkedinUrl, | ||
| enrichFields, | ||
| } = this; | ||
|  | ||
| if (!domain && !companyName) { | ||
| throw new ConfigurationError("You must provide either a **Domain** or a **Company Name**."); | ||
| } | ||
|         
                  jcortes marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
|  | ||
| const response = await enrichContacts({ | ||
| $, | ||
| data: { | ||
| name, | ||
| webhook_url: webhookUrl, | ||
|         
                  michelle0927 marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
| datas: [ | ||
| { | ||
| firstname, | ||
| lastname, | ||
| domain, | ||
| company_name: companyName, | ||
| linkedin_url: linkedinUrl, | ||
| enrich_fields: enrichFields, | ||
| }, | ||
| ], | ||
| }, | ||
| }); | ||
|         
                  jcortes marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
|  | ||
| $.export("$summary", `Successfully started the enrichment process with ID \`${response.enrichment_id}\`.`); | ||
| return response; | ||
| }, | ||
| }; | ||
        
          
          
            51 changes: 51 additions & 0 deletions
          
          51 
        
  components/fullenrich/actions/get-enrichment-result/get-enrichment-result.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 app from "../../fullenrich.app.mjs"; | ||
|  | ||
| export default { | ||
| key: "fullenrich-get-enrichment-result", | ||
| name: "Get Enrichment Result", | ||
| description: "Get the enrichment result for a specified contact. [See the documentation](https://docs.fullenrich.com/getbulk).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| enrichmentId: { | ||
| type: "string", | ||
| label: "Enrichment ID", | ||
| description: "The ID of the enrichment to get the result for.", | ||
| }, | ||
| forceResults: { | ||
| type: "boolean", | ||
| label: "Force Results", | ||
| description: "This parameter forces the API to return what has been found so far, even if the enrichment is not finished. This may result in missing information and is not recommended for regular use.", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| methods: { | ||
| getEnrichmentResult({ | ||
| enrichmentId, ...args | ||
| } = {}) { | ||
| return this.app._makeRequest({ | ||
| path: `/contact/enrich/bulk/${enrichmentId}`, | ||
| ...args, | ||
| }); | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| getEnrichmentResult, | ||
| enrichmentId, | ||
| forceResults, | ||
| } = this; | ||
|  | ||
| const response = await getEnrichmentResult({ | ||
| $, | ||
| enrichmentId, | ||
| params: { | ||
| forceResults, | ||
| }, | ||
| }); | ||
|  | ||
| $.export("$summary", `Successfully fetched enrichment result with ID \`${response.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 | 
|---|---|---|
| @@ -1,11 +1,33 @@ | ||
| import { axios } from "@pipedream/platform"; | ||
|  | ||
| export default { | ||
| type: "app", | ||
| app: "fullenrich", | ||
| propDefinitions: {}, | ||
| methods: { | ||
| // this.$auth contains connected account data | ||
| authKeys() { | ||
| console.log(Object.keys(this.$auth)); | ||
| getUrl(path) { | ||
| return `https://app.fullenrich.com/api/v1${path}`; | ||
| }, | ||
|         
                  michelle0927 marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
| getHeaders(headers) { | ||
| return { | ||
| "Content-Type": "application/json", | ||
| "Authorization": `Bearer ${this.$auth.api_key}`, | ||
| ...headers, | ||
| }; | ||
| }, | ||
| _makeRequest({ | ||
| $ = this, path, headers, ...args | ||
| } = {}) { | ||
| return axios($, { | ||
| ...args, | ||
| url: this.getUrl(path), | ||
| headers: this.getHeaders(headers), | ||
| }); | ||
| }, | ||
|         
                  jcortes marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
| post(args) { | ||
| return this._makeRequest({ | ||
| method: "POST", | ||
| ...args, | ||
| }); | ||
|         
                  jcortes marked this conversation as resolved.
              Show resolved
            Hide resolved         
                  michelle0927 marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
| }, | ||
| }, | ||
| }; | ||
  
    
      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/fullenrich", | ||
| "version": "0.0.1", | ||
| "version": "0.1.0", | ||
| "description": "Pipedream FullEnrich Components", | ||
| "main": "fullenrich.app.mjs", | ||
| "keywords": [ | ||
|  | @@ -11,5 +11,8 @@ | |
| "author": "Pipedream <[email protected]> (https://pipedream.com/)", | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "dependencies": { | ||
| "@pipedream/platform": "3.0.3" | ||
| } | ||
| } | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
      
      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.