-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[Components] bigdatacorp #14751 #15028
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
Changes from 11 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
28249a0
Added requested changes
lcaresia eec7a59
Added requested changes
lcaresia c696b5c
Added requested changes
lcaresia fa6156f
Merge branch 'master' into issue-14751
lcaresia 668a2ac
Update components/bigdatacorp/common/constants.mjs
lcaresia 2404e4c
Update components/bigdatacorp/actions/get-address-data/get-address-da…
lcaresia fb66239
Update components/bigdatacorp/actions/get-address-data/get-address-da…
lcaresia 24ea970
Done requests changes
lcaresia 2d29ee4
Done requests changes
lcaresia 6439f63
Done requests changes
lcaresia d3882ab
Merge branch 'master' into issue-14751
lcaresia 77fc0b6
Update components/bigdatacorp/actions/get-address-data/get-address-da…
lcaresia c46bf86
Update components/bigdatacorp/actions/get-address-data/get-address-da…
lcaresia 329a6d6
Update components/bigdatacorp/actions/get-person-data/get-person-data…
lcaresia e591fd3
Update components/bigdatacorp/actions/get-company-data/get-company-da…
lcaresia e79e793
Done requests changes
lcaresia ad07014
Merge branch 'master' into issue-14751
lcaresia 45df4b1
updates
michelle0927 e4aa6ce
pnpm-lock.yaml
michelle0927 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
41 changes: 41 additions & 0 deletions
41
components/bigdatacorp/actions/get-address-data/get-address-data.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,41 @@ | ||
| import app from "../../bigdatacorp.app.mjs"; | ||
| import constants from "../../common/constants.mjs"; | ||
|
|
||
| export default { | ||
| key: "bigdatacorp-get-address-data", | ||
| name: "Get Address Data", | ||
| description: "Returns the available data for a Zipcode number according to the selected dataset. [See the documentation](https://docs.bigdatacorp.com.br/plataforma/reference/enderecos_legal_amazon)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| doc: { | ||
| propDefinition: [ | ||
| app, | ||
| "doc", | ||
| ], | ||
| description: "Zipcode of the address you want to search for, i.e.: `88048-656`", | ||
| }, | ||
| dataset: { | ||
| propDefinition: [ | ||
| app, | ||
| "dataset", | ||
| ], | ||
| options: constants.ADDRESS_DATASETS, | ||
| }, | ||
| }, | ||
|
|
||
| async run({ $ }) { | ||
| const response = await this.app.getAddressData({ | ||
| $, | ||
| data: { | ||
| Datasets: this.dataset, | ||
| q: `zipcode{${this.doc}}`, | ||
lcaresia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }); | ||
|
|
||
| $.export("$summary", `Successfully sent the request for the '${this.dataset}' dataset. Status: ${response.Status[this.dataset][0].Message}`); | ||
lcaresia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| return response; | ||
| }, | ||
| }; | ||
41 changes: 41 additions & 0 deletions
41
components/bigdatacorp/actions/get-company-data/get-company-data.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,41 @@ | ||
| import app from "../../bigdatacorp.app.mjs"; | ||
| import constants from "../../common/constants.mjs"; | ||
|
|
||
| export default { | ||
| key: "bigdatacorp-get-company-data", | ||
| name: "Get Company Data", | ||
| description: "Returns the available data for a CNPJ number according to the selected dataset. [See the documentation](https://docs.bigdatacorp.com.br/plataforma/reference/empresas_emails_extended)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| doc: { | ||
| propDefinition: [ | ||
| app, | ||
| "doc", | ||
| ], | ||
| description: "Document Number of the entity you want to search for, i.e.: `27.823.957/0001-94`", | ||
| }, | ||
| dataset: { | ||
| propDefinition: [ | ||
| app, | ||
| "dataset", | ||
| ], | ||
| options: constants.COMPANY_DATASETS, | ||
| }, | ||
| }, | ||
|
|
||
| async run({ $ }) { | ||
| const response = await this.app.getCompanyData({ | ||
| $, | ||
| data: { | ||
| Datasets: this.dataset, | ||
| q: `doc{${this.doc}}`, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully sent the request for the '${this.dataset}' dataset. Status: ${response.Status[this.dataset][0].Message}`); | ||
lcaresia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| return response; | ||
| }, | ||
| }; | ||
41 changes: 41 additions & 0 deletions
41
components/bigdatacorp/actions/get-person-data/get-person-data.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,41 @@ | ||
| import app from "../../bigdatacorp.app.mjs"; | ||
| import constants from "../../common/constants.mjs"; | ||
|
|
||
| export default { | ||
| key: "bigdatacorp-get-person-data", | ||
| name: "Get Person Data", | ||
| description: "Returns the available data for a CPF number according to the selected dataset. [See the documentation](https://docs.bigdatacorp.com.br/plataforma/reference/pessoas_registration_data)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| doc: { | ||
| propDefinition: [ | ||
| app, | ||
| "doc", | ||
| ], | ||
| description: "Document Number of the entity you want to search for, i.e.: `128.982.560-21`", | ||
| }, | ||
| dataset: { | ||
| propDefinition: [ | ||
| app, | ||
| "dataset", | ||
| ], | ||
| options: constants.PERSON_DATASETS, | ||
| }, | ||
| }, | ||
|
|
||
| async run({ $ }) { | ||
| const response = await this.app.getPersonData({ | ||
| $, | ||
| data: { | ||
| Datasets: this.dataset, | ||
| q: `doc{${this.doc}}`, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully sent the request for the '${this.dataset}' dataset. Status: ${response.Status[this.dataset][0].Message}`); | ||
lcaresia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 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,62 @@ | ||
| import { axios } from "@pipedream/platform"; | ||
|
|
||
| export default { | ||
| type: "app", | ||
| app: "bigdatacorp", | ||
| propDefinitions: {}, | ||
| propDefinitions: { | ||
| doc: { | ||
| type: "string", | ||
| label: "Document Number", | ||
| description: "Document Number of the entity you want to search for", | ||
| }, | ||
| dataset: { | ||
| type: "string", | ||
| label: "Dataset", | ||
| description: "The target dataset to which the query will be sent", | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| methods: { | ||
| // this.$auth contains connected account data | ||
| authKeys() { | ||
| console.log(Object.keys(this.$auth)); | ||
| _baseUrl() { | ||
| return "https://plataforma.bigdatacorp.com.br"; | ||
| }, | ||
| async _makeRequest(opts = {}) { | ||
| const { | ||
| $ = this, | ||
| path, | ||
| headers, | ||
| ...otherOpts | ||
| } = opts; | ||
| return axios($, { | ||
| ...otherOpts, | ||
| url: this._baseUrl() + path, | ||
| headers: { | ||
| ...headers, | ||
| "Accept": "application/json", | ||
| "AccessToken": `${this.$auth.access_token}`, | ||
| "TokenId": `${this.$auth.token_id}`, | ||
| }, | ||
| }); | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| async getPersonData(args = {}) { | ||
| return this._makeRequest({ | ||
| path: "/pessoas", | ||
| method: "post", | ||
| ...args, | ||
| }); | ||
| }, | ||
| async getCompanyData(args = {}) { | ||
| return this._makeRequest({ | ||
| path: "/empresas", | ||
| method: "post", | ||
| ...args, | ||
| }); | ||
| }, | ||
| async getAddressData(args = {}) { | ||
| return this._makeRequest({ | ||
| path: "/enderecos", | ||
| method: "post", | ||
| ...args, | ||
| }); | ||
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 |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| export default { | ||
| PERSON_DATASETS: [ | ||
| { | ||
| "value": "emails_extended", | ||
| "label": "Emails", | ||
| }, | ||
| { | ||
| "value": "phones_extended", | ||
| "label": "Phones", | ||
| }, | ||
| { | ||
| "value": "registration_data", | ||
| "label": "Registration Data", | ||
| }, | ||
| { | ||
| "value": "related_people_emails", | ||
| "label": "Related People Emails", | ||
| }, | ||
| { | ||
| "value": "related_people_phones", | ||
| "label": "Related People Phones", | ||
| }, | ||
| { | ||
| "value": "related_people_addresses", | ||
| "label": "Related People Addresses", | ||
| }, | ||
| { | ||
| "value": "vehicles", | ||
| "label": "Vehicles", | ||
| }, | ||
| ], | ||
| COMPANY_DATASETS: [ | ||
| { | ||
| "value": "emails_extended", | ||
| "label": "Emails", | ||
| }, | ||
| { | ||
| "value": "phones_extended", | ||
| "label": "Phones", | ||
| }, | ||
| { | ||
| "value": "registration_data", | ||
| "label": "Registration Data", | ||
| }, | ||
| { | ||
| "value": "related_people_emails", | ||
| "label": "Related People Emails", | ||
| }, | ||
| { | ||
| "value": "related_people_phones", | ||
| "label": "Related People Phones", | ||
| }, | ||
| { | ||
| "value": "related_people_addresses", | ||
| "label": "Related People Addresses", | ||
| }, | ||
| { | ||
| "value": "political_involvement", | ||
| "label": "Political Involvement", | ||
| }, | ||
| { | ||
| "value": "online_ads", | ||
| "label": "Online Ads", | ||
| }, | ||
| ], | ||
| ADDRESS_DATASETS: [ | ||
| { | ||
| "value": "legal_amazon", | ||
| "label": "Legal Amazon", | ||
| }, | ||
| { | ||
| "value": "environmental_preservation_areas", | ||
| "label": "Enviromental Preservation Areas", | ||
lcaresia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| { | ||
| "value": "biomes_data", | ||
| "label": "Biomes Data", | ||
| }, | ||
| { | ||
| "value": "embargoed_areas", | ||
| "label": "Embargoed Areas", | ||
| }, | ||
| { | ||
| "value": "legal_reserve", | ||
| "label": "Legal Reserve", | ||
| }, | ||
| { | ||
| "value": "basic_data", | ||
| "label": "Basic Data", | ||
| }, | ||
| ], | ||
| }; | ||
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
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.