- 
                Notifications
    
You must be signed in to change notification settings  - Fork 5.5k
 
18329 components espy #18336
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
18329 components espy #18336
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import app from "../../espy.app.mjs"; | ||
| 
     | 
||
| export default { | ||
| key: "espy-email-lookup", | ||
| name: "Email Lookup", | ||
| description: "Request a lookup for the provided email. [See the documentation](https://api-docs.espysys.com/name-socialscan/headers-and-body-request-by-name-lookup)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| value: { | ||
| propDefinition: [ | ||
| app, | ||
| "value", | ||
| ], | ||
| }, | ||
| }, | ||
| 
     | 
||
| async run({ $ }) { | ||
| const response = await this.app.emailLookup({ | ||
| $, | ||
| data: { | ||
| value: this.value, | ||
| lookupId: 67, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully sent request. Use the ID to get the results: '${response.id}'`); | ||
                
      
                  jcortes marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| return response; | ||
| }, | ||
| }; | ||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,39 @@ | ||||||||
| import app from "../../espy.app.mjs"; | ||||||||
| 
     | 
||||||||
| export default { | ||||||||
| key: "espy-get-lookup-results", | ||||||||
| name: "Get Lookup Results", | ||||||||
| description: "Get the results of the lookup with the provided ID. [See the documentation](https://api-docs.espysys.com/e-mail-lookup/get-get-lookup-data-for-a-request-by-e-mail-lookup)", | ||||||||
| version: "0.0.1", | ||||||||
| type: "action", | ||||||||
| props: { | ||||||||
| app, | ||||||||
| value: { | ||||||||
| propDefinition: [ | ||||||||
| app, | ||||||||
| "value", | ||||||||
| ], | ||||||||
| }, | ||||||||
                
      
                  jcortes marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||||||||
| searchId: { | ||||||||
| propDefinition: [ | ||||||||
| app, | ||||||||
| "searchId", | ||||||||
| ], | ||||||||
| }, | ||||||||
| }, | ||||||||
| 
     | 
||||||||
| async run({ $ }) { | ||||||||
| const response = await this.app.getLookupResults({ | ||||||||
| $, | ||||||||
| searchId: this.searchId, | ||||||||
| data: { | ||||||||
| value: this.value, | ||||||||
| }, | ||||||||
| 
         
      Comment on lines
    
      +29
     to 
      +31
    
   
  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likely incorrect: sending a body on a GET Fetching results should not require  Apply this diff: -      data: {
-        value: this.value,
-      },📝 Committable suggestion
 
        Suggested change
       
    
 🤖 Prompt for AI AgentsThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Quick question here @luancazarine is the get method also accepting  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 
  | 
||||||||
| params: { | ||||||||
| key: `${this.app.$auth.api_key}`, | ||||||||
| }, | ||||||||
| }); | ||||||||
| $.export("$summary", `Successfully retrieved the details of the request with ID: '${this.searchId}'`); | ||||||||
| return response; | ||||||||
| }, | ||||||||
| }; | ||||||||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import app from "../../espy.app.mjs"; | ||
| 
     | 
||
| export default { | ||
| key: "espy-name-lookup", | ||
| name: "Name Lookup", | ||
| description: "Request a lookup for the provided name. [See the documentation](https://api-docs.espysys.com/name-socialscan/headers-and-body-request-by-name-lookup)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| value: { | ||
| propDefinition: [ | ||
| app, | ||
| "value", | ||
| ], | ||
| }, | ||
| }, | ||
| 
     | 
||
| async run({ $ }) { | ||
| const response = await this.app.nameLookup({ | ||
| $, | ||
| data: { | ||
| value: this.value, | ||
| lookupId: 149, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully sent request. Use the ID to get the results: '${response.id}'`); | ||
| return response; | ||
| }, | ||
| }; | 
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,11 +1,82 @@ | ||
| import { axios } from "@pipedream/platform"; | ||
| 
     | 
||
| export default { | ||
| type: "app", | ||
| app: "espy", | ||
| propDefinitions: {}, | ||
| propDefinitions: { | ||
| value: { | ||
| type: "string", | ||
| label: "Value", | ||
| description: "Value to lookup", | ||
| }, | ||
| searchId: { | ||
| type: "string", | ||
| label: "Search ID", | ||
| description: "ID of the search", | ||
| async options() { | ||
| const response = await this.getSearchIds(); | ||
| const searchIds = response.list; | ||
| return searchIds.map(({ id }) => ({ | ||
| value: id, | ||
| })); | ||
| }, | ||
| }, | ||
| }, | ||
| methods: { | ||
| // this.$auth contains connected account data | ||
| authKeys() { | ||
| console.log(Object.keys(this.$auth)); | ||
| _baseUrl() { | ||
| return "https://irbis.espysys.com/api"; | ||
| }, | ||
| async _makeRequest({ | ||
| $ = this, | ||
| path, | ||
| headers, | ||
| data, | ||
| ...otherOpts | ||
| } = {}) { | ||
| return axios($, { | ||
| ...otherOpts, | ||
| url: this._baseUrl() + path, | ||
| headers: { | ||
| ...headers, | ||
| "accept": "application/json", | ||
| "content-type": "application/json", | ||
| }, | ||
| data: { | ||
| ...data, | ||
| key: `${this.$auth.api_key}`, | ||
| }, | ||
| }); | ||
| }, | ||
                
      
                  jcortes marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| async emailLookup(args = {}) { | ||
| return this._makeRequest({ | ||
| path: "/developer/combined_email", | ||
| method: "post", | ||
| ...args, | ||
| }); | ||
| }, | ||
| async nameLookup(args = {}) { | ||
| return this._makeRequest({ | ||
| path: "/developer/combined_name", | ||
| method: "post", | ||
| ...args, | ||
| }); | ||
| }, | ||
| async getLookupResults({ | ||
| searchId, ...args | ||
| }) { | ||
| return this._makeRequest({ | ||
| path: `/request-monitor/api-usage/${searchId}`, | ||
| ...args, | ||
| }); | ||
| }, | ||
| async getSearchIds(args = {}) { | ||
| return this._makeRequest({ | ||
| path: "/request-monitor/api-usage", | ||
| params: { | ||
| key: `${this.$auth.api_key}`, | ||
| }, | ||
| ...args, | ||
| }); | ||
| }, | ||
| }, | ||
| }; | ||
| }; | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "@pipedream/espy", | ||
| "version": "0.0.1", | ||
| "version": "0.1.0", | ||
| "description": "Pipedream ESPY Components", | ||
| "main": "espy.app.mjs", | ||
| "keywords": [ | ||
| 
        
          
        
         | 
    @@ -11,5 +11,8 @@ | |
| "author": "Pipedream <[email protected]> (https://pipedream.com/)", | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "dependencies": { | ||
| "@pipedream/platform": "^3.1.0" | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.