diff --git a/components/dataforseo/actions/get-backlinks-history/get-backlinks-history.mjs b/components/dataforseo/actions/get-backlinks-history/get-backlinks-history.mjs new file mode 100644 index 0000000000000..1d3799d566e97 --- /dev/null +++ b/components/dataforseo/actions/get-backlinks-history/get-backlinks-history.mjs @@ -0,0 +1,69 @@ +import dataforseo from "../../dataforseo.app.mjs"; + +export default { + key: "dataforseo-get-backlinks-history", + name: "Get Backlinks History", + description: + "Get historical backlinks data back to the beginning of 2019. [See the documentation](https://docs.dataforseo.com/v3/backlinks/history/live/)", + version: "0.0.1", + type: "action", + methods: { + getBacklinksHistory(args = {}) { + return this.dataforseo._makeRequest({ + path: "/backlinks/history/live", + method: "post", + ...args, + }); + }, + }, + props: { + dataforseo, + target: { + type: "string", + label: "Target Domain", + description: "Domain should be specified without `https://` and `www`", + }, + dateFrom: { + type: "string", + label: "Starting Date", + description: + "Starting date of the time range, in `YYYY-MM-DD` format. Default and minimum value is `2019-01-01`", + optional: true, + }, + dateTo: { + type: "string", + label: "End Date", + description: + "End date of the time range, in `YYYY-MM-DD` format. Default is today's date", + optional: true, + }, + rankScale: { + propDefinition: [ + dataforseo, + "rankScale", + ], + }, + tag: { + propDefinition: [ + dataforseo, + "tag", + ], + }, + }, + async run({ $ }) { + const response = await this.getBacklinksHistory({ + $, + data: [ + { + target: this.target, + date_from: this.dateFrom, + date_to: this.dateTo, + rank_scale: this.rankScale, + tag: this.tag, + }, + ], + }); + $.export("$summary", "Successfully retrieved backlinks history"); + return response; + }, +}; diff --git a/components/dataforseo/actions/get-backlinks-summary/get-backlinks-summary.mjs b/components/dataforseo/actions/get-backlinks-summary/get-backlinks-summary.mjs new file mode 100644 index 0000000000000..9648d58170fd6 --- /dev/null +++ b/components/dataforseo/actions/get-backlinks-summary/get-backlinks-summary.mjs @@ -0,0 +1,101 @@ +import dataforseo from "../../dataforseo.app.mjs"; +import { parseObjectEntries } from "../../common/utils.mjs"; + +export default { + key: "dataforseo-get-backlinks-summary", + name: "Get Backlinks Summary", + description: + "Get an overview of backlinks data available for a given domain, subdomain, or webpage. [See the documentation](https://docs.dataforseo.com/v3/backlinks/summary/live/)", + version: "0.0.1", + type: "action", + methods: { + getBacklinksSummary(args = {}) { + return this.dataforseo._makeRequest({ + path: "/backlinks/summary/live", + method: "post", + ...args, + }); + }, + }, + props: { + dataforseo, + target: { + propDefinition: [ + dataforseo, + "backlinksTarget", + ], + }, + includeSubdomains: { + propDefinition: [ + dataforseo, + "includeSubdomains", + ], + }, + includeIndirectLinks: { + propDefinition: [ + dataforseo, + "includeIndirectLinks", + ], + }, + excludeInternalBacklinks: { + propDefinition: [ + dataforseo, + "excludeInternalBacklinks", + ], + }, + backlinksStatusType: { + propDefinition: [ + dataforseo, + "backlinksStatusType", + ], + }, + backlinksFilters: { + propDefinition: [ + dataforseo, + "backlinksFilters", + ], + }, + rankScale: { + propDefinition: [ + dataforseo, + "rankScale", + ], + }, + tag: { + propDefinition: [ + dataforseo, + "tag", + ], + }, + additionalOptions: { + propDefinition: [ + dataforseo, + "additionalOptions", + ], + description: "Additional parameters to send in the request. [See the documentation](https://docs.dataforseo.com/v3/backlinks/summary/live/) for all available parameters. Values will be parsed as JSON where applicable.", + }, + }, + async run({ $ }) { + const response = await this.getBacklinksSummary({ + $, + data: [ + { + target: this.target, + include_subdomains: this.includeSubdomains, + include_indirect_links: this.includeIndirectLinks, + exclude_internal_backlinks: this.excludeInternalBacklinks, + backlinks_status_type: this.backlinksStatusType, + backlinks_filters: this.backlinksFilters, + rank_scale: this.rankScale, + tag: this.tag, + ...parseObjectEntries(this.additionalOptions), + }, + ], + }); + $.export( + "$summary", + "Successfully retrieved backlink summary", + ); + return response; + }, +}; diff --git a/components/dataforseo/actions/get-backlinks/get-backlinks.mjs b/components/dataforseo/actions/get-backlinks/get-backlinks.mjs new file mode 100644 index 0000000000000..d2cc5879f8730 --- /dev/null +++ b/components/dataforseo/actions/get-backlinks/get-backlinks.mjs @@ -0,0 +1,97 @@ +import { parseObjectEntries } from "../../common/utils.mjs"; +import dataforseo from "../../dataforseo.app.mjs"; + +export default { + key: "dataforseo-get-backlinks", + name: "Get Backlinks", + description: + "Get a list of backlinks and relevant data for a given domain, subdomain, or webpage. [See the documentation](https://docs.dataforseo.com/v3/backlinks/backlinks/live/)", + version: "0.0.1", + type: "action", + methods: { + getBacklinks(args = {}) { + return this.dataforseo._makeRequest({ + path: "/backlinks/backlinks/live", + method: "post", + ...args, + }); + }, + }, + props: { + dataforseo, + target: { + propDefinition: [ + dataforseo, + "backlinksTarget", + ], + }, + mode: { + type: "string", + label: "Mode", + description: "Select the mode of grouping the results", + options: [ + { + value: "as_is", + label: "returns all backlinks", + }, + { + value: "one_per_domain", + label: "returns one backlink per domain", + }, + { + value: "one_per_anchor", + label: "returns one backlink per anchor", + }, + ], + default: "as_is", + }, + filters: { + propDefinition: [ + dataforseo, + "backlinksFilters", + ], + }, + order_by: { + type: "string[]", + label: "Order By", + description: "One or more rules to sort results with, with each entry being a field and a direction (`asc` for ascending or `desc` for descending). Example: [\"domain_from_rank,desc\",\"page_from_rank,asc\"]", + }, + rankScale: { + propDefinition: [ + dataforseo, + "rankScale", + ], + }, + tag: { + propDefinition: [ + dataforseo, + "tag", + ], + }, + additionalOptions: { + propDefinition: [ + dataforseo, + "additionalOptions", + ], + description: "Additional parameters to send in the request. [See the documentation](https://docs.dataforseo.com/v3/backlinks/backlinks/live/) for all available parameters. Values will be parsed as JSON where applicable.", + }, + }, + async run({ $ }) { + const response = await this.getBacklinks({ + $, + data: [ + { + target: this.target, + mode: this.mode, + filters: this.filters, + order_by: this.order_by, + rank_scale: this.rankScale, + tag: this.tag, + ...parseObjectEntries(this.additionalOptions), + }, + ], + }); + $.export("$summary", "Successfully retrieved backlinks data"); + return response; + }, +}; diff --git a/components/dataforseo/actions/get-bulk-backlinks/get-bulk-backlinks.mjs b/components/dataforseo/actions/get-bulk-backlinks/get-bulk-backlinks.mjs new file mode 100644 index 0000000000000..c94c1c9d0b7d1 --- /dev/null +++ b/components/dataforseo/actions/get-bulk-backlinks/get-bulk-backlinks.mjs @@ -0,0 +1,47 @@ +import dataforseo from "../../dataforseo.app.mjs"; + +export default { + key: "dataforseo-get-bulk-backlinks", + name: "Get Bulk Backlinks", + description: + "Get the number of backlinks pointing to specified domains, subdomains, and pages. [See the documentation](https://docs.dataforseo.com/v3/backlinks/bulk_backlinks/live/)", + version: "0.0.1", + type: "action", + methods: { + getBulkBacklinks(args = {}) { + return this.dataforseo._makeRequest({ + path: "/backlinks/bulk_backlinks/live", + method: "post", + ...args, + }); + }, + }, + props: { + dataforseo, + targets: { + propDefinition: [ + dataforseo, + "targets", + ], + }, + tag: { + propDefinition: [ + dataforseo, + "tag", + ], + }, + }, + async run({ $ }) { + const response = await this.getBulkBacklinks({ + $, + data: [ + { + targets: this.targets, + tag: this.tag, + }, + ], + }); + $.export("$summary", "Successfully retrieved bulk backlinks"); + return response; + }, +}; diff --git a/components/dataforseo/actions/get-bulk-ranks/get-bulk-ranks.mjs b/components/dataforseo/actions/get-bulk-ranks/get-bulk-ranks.mjs new file mode 100644 index 0000000000000..6b86621c249fc --- /dev/null +++ b/components/dataforseo/actions/get-bulk-ranks/get-bulk-ranks.mjs @@ -0,0 +1,54 @@ +import dataforseo from "../../dataforseo.app.mjs"; + +export default { + key: "dataforseo-get-bulk-ranks", + name: "Get Bulk Ranks", + description: + "Get rank scores of specified domains, subdomains, and pages. [See the documentation](https://docs.dataforseo.com/v3/backlinks/bulk_ranks/live/)", + version: "0.0.1", + type: "action", + methods: { + getBacklinksBulkRanks(args = {}) { + return this.dataforseo._makeRequest({ + path: "/backlinks/bulk_ranks/live", + method: "post", + ...args, + }); + }, + }, + props: { + dataforseo, + targets: { + propDefinition: [ + dataforseo, + "targets", + ], + }, + rankScale: { + propDefinition: [ + dataforseo, + "rankScale", + ], + }, + tag: { + propDefinition: [ + dataforseo, + "tag", + ], + }, + }, + async run({ $ }) { + const response = await this.getBacklinksBulkRanks({ + $, + data: [ + { + targets: this.targets, + rank_scale: this.rankScale, + tag: this.tag, + }, + ], + }); + $.export("$summary", "Successfully retrieved bulk ranks"); + return response; + }, +}; diff --git a/components/dataforseo/actions/get-bulk-referring-domains/get-bulk-referring-domains.mjs b/components/dataforseo/actions/get-bulk-referring-domains/get-bulk-referring-domains.mjs new file mode 100644 index 0000000000000..8ab65b58f051e --- /dev/null +++ b/components/dataforseo/actions/get-bulk-referring-domains/get-bulk-referring-domains.mjs @@ -0,0 +1,47 @@ +import dataforseo from "../../dataforseo.app.mjs"; + +export default { + key: "dataforseo-get-bulk-referring-domains", + name: "Get Bulk Referring Domains", + description: + "Get the number of referring domains pointing to the specified domains, subdomains, and pages. [See the documentation](https://docs.dataforseo.com/v3/backlinks/bulk_referring_domains/live/)", + version: "0.0.1", + type: "action", + methods: { + getBulkReferringDomains(args = {}) { + return this.dataforseo._makeRequest({ + path: "/backlinks/bulk_referring_domains/live", + method: "post", + ...args, + }); + }, + }, + props: { + dataforseo, + targets: { + propDefinition: [ + dataforseo, + "targets", + ], + }, + tag: { + propDefinition: [ + dataforseo, + "tag", + ], + }, + }, + async run({ $ }) { + const response = await this.getBulkReferringDomains({ + $, + data: [ + { + targets: this.targets, + tag: this.tag, + }, + ], + }); + $.export("$summary", "Successfully retrieved bulk referring domains"); + return response; + }, +}; diff --git a/components/dataforseo/actions/get-bulk-spam-score/get-bulk-spam-score.mjs b/components/dataforseo/actions/get-bulk-spam-score/get-bulk-spam-score.mjs new file mode 100644 index 0000000000000..08feabaec805b --- /dev/null +++ b/components/dataforseo/actions/get-bulk-spam-score/get-bulk-spam-score.mjs @@ -0,0 +1,47 @@ +import dataforseo from "../../dataforseo.app.mjs"; + +export default { + key: "dataforseo-get-bulk-spam-score", + name: "Get Bulk Spam Score", + description: + "Get spam scores of the specified domains, subdomains, and pages. [See the documentation](https://docs.dataforseo.com/v3/backlinks/bulk_spam_score/live/)", + version: "0.0.1", + type: "action", + methods: { + getBulkSpamScore(args = {}) { + return this.dataforseo._makeRequest({ + path: "/backlinks/bulk_spam_score/live", + method: "post", + ...args, + }); + }, + }, + props: { + dataforseo, + targets: { + propDefinition: [ + dataforseo, + "targets", + ], + }, + tag: { + propDefinition: [ + dataforseo, + "tag", + ], + }, + }, + async run({ $ }) { + const response = await this.getBulkSpamScore({ + $, + data: [ + { + targets: this.targets, + tag: this.tag, + }, + ], + }); + $.export("$summary", "Successfully retrieved bulk spam score"); + return response; + }, +}; diff --git a/components/dataforseo/actions/get-business-listings/get-business-listings.mjs b/components/dataforseo/actions/get-business-listings/get-business-listings.mjs index e8ea7197156c6..078405645f80a 100644 --- a/components/dataforseo/actions/get-business-listings/get-business-listings.mjs +++ b/components/dataforseo/actions/get-business-listings/get-business-listings.mjs @@ -1,52 +1,52 @@ -import app from "../../dataforseo.app.mjs"; +import dataforseo from "../../dataforseo.app.mjs"; export default { key: "dataforseo-get-business-listings", name: "Get Business Listings", description: "Get Business Listings. [See the documentation](https://docs.dataforseo.com/v3/business_data/business_listings/search/live/?bash)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { - app, + dataforseo, locationCoordinate: { propDefinition: [ - app, + dataforseo, "locationCoordinate", ], }, categories: { propDefinition: [ - app, + dataforseo, "categories", ], }, title: { propDefinition: [ - app, + dataforseo, "title", ], }, description: { propDefinition: [ - app, + dataforseo, "description", ], }, isClaimed: { propDefinition: [ - app, + dataforseo, "isClaimed", ], }, limit: { propDefinition: [ - app, + dataforseo, "limit", ], }, }, async run({ $ }) { - const response = await this.app.getBusinessListings({ + const response = await this.dataforseo.getBusinessListings({ $, data: [ { diff --git a/components/dataforseo/actions/get-categories-aggregation/get-categories-aggregation.mjs b/components/dataforseo/actions/get-categories-aggregation/get-categories-aggregation.mjs new file mode 100644 index 0000000000000..16110b051ad2f --- /dev/null +++ b/components/dataforseo/actions/get-categories-aggregation/get-categories-aggregation.mjs @@ -0,0 +1,79 @@ +import { parseObjectEntries } from "../../common/utils.mjs"; +import dataforseo from "../../dataforseo.app.mjs"; + +export default { + key: "dataforseo-get-categories-aggregation", + name: "Get Categories Aggregation", + description: + "Get information about groups of related categories and the number of entities in each category. [See the documentation](https://docs.dataforseo.com/v3/business_data/business_listings/categories_aggregation/live/)", + version: "0.0.1", + type: "action", + methods: { + getCategoriesAggregation(args = {}) { + return this.dataforseo._makeRequest({ + path: "/business_data/business_listings/categories_aggregation/live", + method: "post", + ...args, + }); + }, + }, + props: { + dataforseo, + categories: { + propDefinition: [ + dataforseo, + "businessCategories", + ], + }, + description: { + propDefinition: [ + dataforseo, + "description", + ], + }, + title: { + propDefinition: [ + dataforseo, + "title", + ], + }, + locationCoordinate: { + propDefinition: [ + dataforseo, + "locationCoordinate", + ], + optional: true, + }, + tag: { + propDefinition: [ + dataforseo, + "tag", + ], + }, + additionalOptions: { + propDefinition: [ + dataforseo, + "additionalOptions", + ], + description: + "Additional parameters to send in the request. [See the documentation](https://docs.dataforseo.com/v3/business_data/business_listings/categories_aggregation/live/) for all available parameters. Values will be parsed as JSON where applicable.", + }, + }, + async run({ $ }) { + const response = await this.getCategoriesAggregation({ + $, + data: [ + { + categories: this.categories, + description: this.description, + title: this.title, + location_coordinate: this.locationCoordinate, + tag: this.tag, + ...parseObjectEntries(this.additionalOptions), + }, + ], + }); + $.export("$summary", "Successfully retrieved categories aggregation"); + return response; + }, +}; diff --git a/components/dataforseo/actions/get-domain-pages-summary/get-domain-pages-summary.mjs b/components/dataforseo/actions/get-domain-pages-summary/get-domain-pages-summary.mjs new file mode 100644 index 0000000000000..6a7ee01178cb0 --- /dev/null +++ b/components/dataforseo/actions/get-domain-pages-summary/get-domain-pages-summary.mjs @@ -0,0 +1,101 @@ +import dataforseo from "../../dataforseo.app.mjs"; +import { parseObjectEntries } from "../../common/utils.mjs"; + +export default { + key: "dataforseo-get-domain-pages-summary", + name: "Get Domain Pages Summary", + description: + "Get detailed summary data on all backlinks and related metrics for each page of the specified domain or subdomain. [See the documentation](https://docs.dataforseo.com/v3/backlinks/domain_pages_summary/live/)", + version: "0.0.1", + type: "action", + methods: { + getDomainPagesSummary(args = {}) { + return this.dataforseo._makeRequest({ + path: "/backlinks/domain_pages_summary/live", + method: "post", + ...args, + }); + }, + }, + props: { + dataforseo, + target: { + propDefinition: [ + dataforseo, + "backlinksTarget", + ], + }, + backlinksStatusType: { + propDefinition: [ + dataforseo, + "backlinksStatusType", + ], + }, + includeSubdomains: { + propDefinition: [ + dataforseo, + "includeSubdomains", + ], + }, + includeIndirectLinks: { + propDefinition: [ + dataforseo, + "includeIndirectLinks", + ], + }, + excludeInternalBacklinks: { + propDefinition: [ + dataforseo, + "excludeInternalBacklinks", + ], + }, + backlinksFilters: { + propDefinition: [ + dataforseo, + "backlinksFilters", + ], + }, + rankScale: { + propDefinition: [ + dataforseo, + "rankScale", + ], + }, + tag: { + propDefinition: [ + dataforseo, + "tag", + ], + }, + additionalOptions: { + propDefinition: [ + dataforseo, + "additionalOptions", + ], + description: "Additional parameters to send in the request. [See the documentation](https://docs.dataforseo.com/v3/backlinks/domain_pages_summary/live/) for all available parameters. Values will be parsed as JSON where applicable.", + }, + }, + async run({ $ }) { + const response = await this.getDomainPagesSummary({ + $, + data: [ + { + target: this.target, + include_subdomains: this.includeSubdomains, + include_indirect_links: this.includeIndirectLinks, + exclude_internal_backlinks: this.excludeInternalBacklinks, + backlinks_status_type: this.backlinksStatusType, + backlinks_filters: this.backlinksFilters, + rank_scale: this.rankScale, + tag: this.tag, + ...parseObjectEntries(this.additionalOptions), + }, + ], + }); + $.export( + "$summary", + "Successfully retrieved domain pages summary", + ); + return response; + }, +}; diff --git a/components/dataforseo/actions/get-keyword-difficulty/get-keyword-difficulty.mjs b/components/dataforseo/actions/get-keyword-difficulty/get-keyword-difficulty.mjs index ec0f079888410..2ee9bc3c7fe64 100644 --- a/components/dataforseo/actions/get-keyword-difficulty/get-keyword-difficulty.mjs +++ b/components/dataforseo/actions/get-keyword-difficulty/get-keyword-difficulty.mjs @@ -1,34 +1,34 @@ -import app from "../../dataforseo.app.mjs"; +import dataforseo from "../../dataforseo.app.mjs"; export default { key: "dataforseo-get-keyword-difficulty", name: "Get Keyword Difficulty", description: "Get Keyword Difficulty. [See the documentation](https://docs.dataforseo.com/v3/dataforseo_labs/google/bulk_keyword_difficulty/live/?bash)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { - app, + dataforseo, languageCode: { propDefinition: [ - app, + dataforseo, "languageCode", ], }, locationCode: { propDefinition: [ - app, + dataforseo, "locationCode", ], }, keywords: { propDefinition: [ - app, + dataforseo, "keywords", ], }, }, async run({ $ }) { - const response = await this.app.getKeywordDifficulty({ + const response = await this.dataforseo.getKeywordDifficulty({ $, data: [ { diff --git a/components/dataforseo/actions/get-ranked-keywords/get-ranked-keywords.mjs b/components/dataforseo/actions/get-ranked-keywords/get-ranked-keywords.mjs index f8d8ef8eb7ffe..a32347ac42732 100644 --- a/components/dataforseo/actions/get-ranked-keywords/get-ranked-keywords.mjs +++ b/components/dataforseo/actions/get-ranked-keywords/get-ranked-keywords.mjs @@ -1,34 +1,34 @@ -import app from "../../dataforseo.app.mjs"; +import dataforseo from "../../dataforseo.app.mjs"; export default { key: "dataforseo-get-ranked-keywords", name: "Get Ranked Keywords", description: "Description for get-ranked-keywords. [See the documentation](https://docs.dataforseo.com/v3/keywords_data/google_ads/keywords_for_site/task_post/?bash)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { - app, + dataforseo, locationCode: { propDefinition: [ - app, + dataforseo, "locationCode", ], }, targetType: { propDefinition: [ - app, + dataforseo, "targetType", ], }, target: { propDefinition: [ - app, + dataforseo, "target", ], }, }, async run({ $ }) { - const response = await this.app.getRankedKeywords({ + const response = await this.dataforseo.getRankedKeywords({ $, data: [ { diff --git a/components/dataforseo/actions/get-referring-domains/get-referring-domains.mjs b/components/dataforseo/actions/get-referring-domains/get-referring-domains.mjs new file mode 100644 index 0000000000000..6cfbcaccdd9f8 --- /dev/null +++ b/components/dataforseo/actions/get-referring-domains/get-referring-domains.mjs @@ -0,0 +1,98 @@ +import { parseObjectEntries } from "../../common/utils.mjs"; +import dataforseo from "../../dataforseo.app.mjs"; + +export default { + key: "dataforseo-get-referring-domains", + name: "Get Referring Domains", + description: + "Get detailed overview of referring domains pointing to the specified target. [See the documentation](https://docs.dataforseo.com/v3/backlinks/referring_domains/live/)", + version: "0.0.1", + type: "action", + methods: { + getReferringDomains(args = {}) { + return this.dataforseo._makeRequest({ + path: "/backlinks/referring_domains/live", + method: "post", + ...args, + }); + }, + }, + props: { + dataforseo, + target: { + propDefinition: [ + dataforseo, + "backlinksTarget", + ], + }, + backlinksStatusType: { + propDefinition: [ + dataforseo, + "backlinksStatusType", + ], + }, + includeSubdomains: { + propDefinition: [ + dataforseo, + "includeSubdomains", + ], + }, + includeIndirectLinks: { + propDefinition: [ + dataforseo, + "includeIndirectLinks", + ], + }, + excludeInternalBacklinks: { + propDefinition: [ + dataforseo, + "excludeInternalBacklinks", + ], + }, + backlinksFilters: { + propDefinition: [ + dataforseo, + "backlinksFilters", + ], + }, + rankScale: { + propDefinition: [ + dataforseo, + "rankScale", + ], + }, + tag: { + propDefinition: [ + dataforseo, + "tag", + ], + }, + additionalOptions: { + propDefinition: [ + dataforseo, + "additionalOptions", + ], + description: "Additional parameters to send in the request. [See the documentation](https://docs.dataforseo.com/v3/backlinks/referring_domains/live/) for all available parameters. Values will be parsed as JSON where applicable.", + }, + }, + async run({ $ }) { + const response = await this.getReferringDomains({ + $, + data: [ + { + target: this.target, + include_subdomains: this.includeSubdomains, + include_indirect_links: this.includeIndirectLinks, + exclude_internal_backlinks: this.excludeInternalBacklinks, + backlinks_status_type: this.backlinksStatusType, + backlinks_filters: this.backlinksFilters, + rank_scale: this.rankScale, + tag: this.tag, + ...parseObjectEntries(this.additionalOptions), + }, + ], + }); + $.export("$summary", "Successfully retrieved referring domains"); + return response; + }, +}; diff --git a/components/dataforseo/actions/parse-page-content/parse-page-content.mjs b/components/dataforseo/actions/parse-page-content/parse-page-content.mjs new file mode 100644 index 0000000000000..2f11cb3565745 --- /dev/null +++ b/components/dataforseo/actions/parse-page-content/parse-page-content.mjs @@ -0,0 +1,71 @@ +import { parseObjectEntries } from "../../common/utils.mjs"; +import dataforseo from "../../dataforseo.app.mjs"; + +export default { + key: "dataforseo-parse-page-content", + name: "Parse Page Content", + description: + "Parse the content on any page and return its structured content. [See the documentation](https://docs.dataforseo.com/v3/on_page/content_parsing/live/)", + version: "0.0.1", + type: "action", + methods: { + parsePageContent(args = {}) { + return this.dataforseo._makeRequest({ + path: "/on_page/content_parsing/live", + method: "post", + ...args, + }); + }, + }, + props: { + dataforseo, + url: { + type: "string", + label: "URL", + description: + "The URL of the page to parse, e.g. `https://pipedream.com/`", + }, + customUserAgent: { + type: "string", + label: "Custom User Agent", + description: "Custom user agent for crawling a website. Default is `Mozilla/5.0 (compatible; RSiteAuditor)`", + optional: true, + }, + storeRawHtml: { + type: "boolean", + label: "Store Raw HTML", + description: "Set to `true` if you want to get the HTML of the page using the [https://docs.dataforseo.com/v3/on_page/raw_html/](OnPage Raw HTML endpoint)", + optional: true, + }, + enableJavascript: { + type: "boolean", + label: "Enable Javascript", + description: "Set to `true` if you want to load the scripts available on a page", + optional: true, + }, + additionalOptions: { + propDefinition: [ + dataforseo, + "additionalOptions", + ], + description: + "Additional parameters to send in the request. [See the documentation](https://docs.dataforseo.com/v3/on_page/content_parsing/live/) for all available parameters. Values will be parsed as JSON where applicable.", + }, + }, + async run({ $ }) { + const response = await this.parsePageContent({ + $, + data: [ + { + url: this.url, + custom_user_agent: this.customUserAgent, + store_raw_html: this.storeRawHtml, + enable_javascript: this.enableJavascript, + ...parseObjectEntries(this.additionalOptions), + }, + ], + }); + $.export("$summary", "Successfully parsed page content"); + return response; + }, +}; diff --git a/components/dataforseo/actions/search-business-listings/search-business-listings.mjs b/components/dataforseo/actions/search-business-listings/search-business-listings.mjs new file mode 100644 index 0000000000000..3ab4327bd45a5 --- /dev/null +++ b/components/dataforseo/actions/search-business-listings/search-business-listings.mjs @@ -0,0 +1,79 @@ +import { parseObjectEntries } from "../../common/utils.mjs"; +import dataforseo from "../../dataforseo.app.mjs"; + +export default { + key: "dataforseo-search-business-listings", + name: "Search Business Listings", + description: + "Get information about business entities listed on Google Maps. [See the documentation](https://docs.dataforseo.com/v3/business_data/business_listings/search/live/)", + version: "0.0.1", + type: "action", + methods: { + searchBusinessListings(args = {}) { + return this.dataforseo._makeRequest({ + path: "/business_data/business_listings/search/live", + method: "post", + ...args, + }); + }, + }, + props: { + dataforseo, + categories: { + propDefinition: [ + dataforseo, + "businessCategories", + ], + }, + description: { + propDefinition: [ + dataforseo, + "description", + ], + }, + title: { + propDefinition: [ + dataforseo, + "title", + ], + }, + locationCoordinate: { + propDefinition: [ + dataforseo, + "locationCoordinate", + ], + optional: true, + }, + tag: { + propDefinition: [ + dataforseo, + "tag", + ], + }, + additionalOptions: { + propDefinition: [ + dataforseo, + "additionalOptions", + ], + description: + "Additional parameters to send in the request. [See the documentation](https://docs.dataforseo.com/v3/business_data/business_listings/search/live/) for all available parameters. Values will be parsed as JSON where applicable.", + }, + }, + async run({ $ }) { + const response = await this.searchBusinessListings({ + $, + data: [ + { + categories: this.categories, + description: this.description, + title: this.title, + location_coordinate: this.locationCoordinate, + tag: this.tag, + ...parseObjectEntries(this.additionalOptions), + }, + ], + }); + $.export("$summary", "Successfully retrieved business listings"); + return response; + }, +}; diff --git a/components/dataforseo/common/utils.mjs b/components/dataforseo/common/utils.mjs new file mode 100644 index 0000000000000..bfc96415c2b39 --- /dev/null +++ b/components/dataforseo/common/utils.mjs @@ -0,0 +1,22 @@ +function optionalParseAsJSON(value) { + try { + return JSON.parse(value); + } catch (e) { + return value; + } +} + +export function parseObjectEntries(value = {}) { + const obj = typeof value === "string" + ? JSON.parse(value) + : value; + return Object.fromEntries( + Object.entries(obj).map(([ + key, + value, + ]) => [ + key, + optionalParseAsJSON(value), + ]), + ); +} diff --git a/components/dataforseo/dataforseo.app.mjs b/components/dataforseo/dataforseo.app.mjs index 97c91b754813c..daf4c86d17a28 100644 --- a/components/dataforseo/dataforseo.app.mjs +++ b/components/dataforseo/dataforseo.app.mjs @@ -23,7 +23,9 @@ export default { locationCoordinate: { type: "string", label: "Location Coordinate", - description: "The coordinate of the target location. It should be specified in the “latitude,longitude,radius” format, i.e.: `53.476225,-2.243572,200`", + description: + "The location to search, in the format `latitude,longitude,radius` where radius is specified in kilometers. Example: `53.476225,-2.243572,200`", + }, targetType: { type: "string", @@ -36,6 +38,12 @@ export default { label: "Target", description: "The domain name or the url of the target website or page", }, + backlinksTarget: { + type: "string", + label: "Target", + description: + "Domain, subdomain or webpage to get data for. A domain or a subdomain should be specified without `https://` and `www`. A page should be specified with absolute URL (including `http://` or `https://`", + }, categories: { type: "string[]", label: "Categories", @@ -86,6 +94,87 @@ export default { label: "Keywords", description: "Target Keywords. The maximum number of keywords is 1000", }, + backlinksFilters: { + type: "string[]", + label: "Backlinks Filters", + description: + "You can use this field to filter the initial backlinks that will be included in the dataset for aggregated metrics for your target. [See the documentation](https://docs.dataforseo.com/v3/backlinks/filters/) for more information. Example: `[\"dofollow\", \"=\", true]`", + optional: true, + }, + rankScale: { + type: "string", + label: "Rank Scale", + description: + "Whether rank values are presented on a 0-100 or 0-1000 scale", + optional: true, + options: [ + "one_hundred", + "one_thousand", + ], + default: "one_thousand", + }, + tag: { + type: "string", + label: "Tag", + description: + "You can use this parameter to identify the task and match it with the result.", + optional: true, + }, + includeSubdomains: { + type: "boolean", + label: "Include Subdomains", + description: + "Whether the subdomains of the `target` will be included in the search. Default is `true`", + optional: true, + }, + includeIndirectLinks: { + type: "boolean", + label: "Include Indirect Links", + description: + "Whether indirect links to the target will be included in the results. Default is `true`", + optional: true, + }, + excludeInternalBacklinks: { + type: "boolean", + label: "Exclude Internal Backlinks", + description: + "Indicates if internal backlinks from subdomains to the target will be excluded from the results. Default is `true`", + optional: true, + }, + backlinksStatusType: { + type: "string", + label: "Backlinks Status Type", + description: + "You can use this field to choose what backlinks will be returned and used for aggregated metrics for your target", + optional: true, + options: [ + { + value: "all", + label: "All backlinks will be returned and counted", + }, + { + value: "live", + label: + "Backlinks found during the last check will be returned and counted", + }, + { + value: "lost", + label: "Lost backlinks will be returned and counted", + }, + ], + default: "live", + }, + additionalOptions: { + type: "object", + label: "Additional Options", + description: "Additional parameters to send in the request. See the documentation for all available parameters. Values will be parsed as JSON where applicable.", + optional: true, + }, + targets: { + type: "string[]", + label: "Targets", + description: "Up to 1000 domains, subdomains or webpages to get data for. A domain or a subdomain should be specified without `https://` and `www`. A page should be specified with absolute URL (including `http://` or `https://`", + }, }, methods: { _baseUrl() { diff --git a/components/dataforseo/package.json b/components/dataforseo/package.json index 31d0b5466fb61..6b25a7c7a2b06 100644 --- a/components/dataforseo/package.json +++ b/components/dataforseo/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/dataforseo", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream DataForSEO Components", "main": "dataforseo.app.mjs", "keywords": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b1e20188ec18c..d9aeddde9b1d9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15400,14 +15400,6 @@ importers: specifier: ^6.0.0 version: 6.2.0 - modelcontextprotocol/node_modules2/@modelcontextprotocol/sdk/dist/cjs: {} - - modelcontextprotocol/node_modules2/@modelcontextprotocol/sdk/dist/esm: {} - - modelcontextprotocol/node_modules2/zod-to-json-schema/dist/cjs: {} - - modelcontextprotocol/node_modules2/zod-to-json-schema/dist/esm: {} - packages/ai: dependencies: '@pipedream/sdk':