Skip to content

Commit f924f1a

Browse files
committed
Get Domain Pages Summary + prop reusing
1 parent 295c7ed commit f924f1a

File tree

3 files changed

+168
-43
lines changed

3 files changed

+168
-43
lines changed

components/dataforseo/actions/get-backlink-summary/get-backlink-summary.mjs renamed to components/dataforseo/actions/get-backlinks-summary/get-backlinks-summary.mjs

Lines changed: 23 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import dataforseo from "../../dataforseo.app.mjs";
22
import { parseObjectEntries } from "../../common/utils.mjs";
33

44
export default {
5-
key: "dataforseo-get-backlink-summary",
6-
name: "Get Backlink Summary",
5+
key: "dataforseo-get-backlinks-summary",
6+
name: "Get Backlinks Summary",
77
description:
88
"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/)",
99
version: "0.0.1",
1010
type: "action",
1111
methods: {
12-
getBacklinkSummary(args = {}) {
12+
getBacklinksSummary(args = {}) {
1313
return this._makeRequest({
1414
path: "/backlinks/summary/live",
1515
method: "post",
@@ -20,54 +20,34 @@ export default {
2020
props: {
2121
dataforseo,
2222
target: {
23-
type: "string",
24-
label: "Target",
25-
description:
26-
"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://`",
23+
propDefinition: [
24+
dataforseo,
25+
"backlinksTarget",
26+
],
2727
},
2828
includeSubdomains: {
29-
type: "boolean",
30-
label: "Include Subdomains",
31-
description:
32-
"Whether the subdomains of the `target` will be included in the search. Default is `true`",
33-
optional: true,
29+
propDefinition: [
30+
dataforseo,
31+
"includeSubdomains",
32+
],
3433
},
3534
includeIndirectLinks: {
36-
type: "boolean",
37-
label: "Include Indirect Links",
38-
description:
39-
"Whether indirect links to the target will be included in the results. Default is `true`",
40-
optional: true,
35+
propDefinition: [
36+
dataforseo,
37+
"includeIndirectLinks",
38+
],
4139
},
4240
excludeInternalBacklinks: {
43-
type: "boolean",
44-
label: "Exclude Internal Backlinks",
45-
description:
46-
"Indicates if internal backlinks from subdomains to the target will be excluded from the results. Default is `true`",
47-
optional: true,
41+
propDefinition: [
42+
dataforseo,
43+
"excludeInternalBacklinks",
44+
],
4845
},
4946
backlinksStatusType: {
50-
type: "string",
51-
label: "Include Indirect Links",
52-
description:
53-
"You can use this field to choose what backlinks will be returned and used for aggregated metrics for your target",
54-
optional: true,
55-
options: [
56-
{
57-
value: "all",
58-
label: "All backlinks will be returned and counted",
59-
},
60-
{
61-
value: "live",
62-
label:
63-
"Backlinks found during the last check will be returned and counted",
64-
},
65-
{
66-
value: "lost",
67-
label: "Lost backlinks will be returned and counted",
68-
},
47+
propDefinition: [
48+
dataforseo,
49+
"backlinksStatusType",
6950
],
70-
default: "live",
7151
},
7252
backlinksFilters: {
7353
propDefinition: [
@@ -96,7 +76,7 @@ export default {
9676
},
9777
},
9878
async run({ $ }) {
99-
const response = await this.getBacklinkSummary({
79+
const response = await this.getBacklinksSummary({
10080
$,
10181
data: [
10282
{
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
import dataforseo from "../../dataforseo.app.mjs";
2+
import { parseObjectEntries } from "../../common/utils.mjs";
3+
4+
export default {
5+
key: "dataforseo-get-domain-pages-summary",
6+
name: "Get Domain Pages Summary",
7+
description:
8+
"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/)",
9+
version: "0.0.1",
10+
type: "action",
11+
methods: {
12+
getDomainPagesSummary(args = {}) {
13+
return this._makeRequest({
14+
path: "/backlinks/domain_pages_summary/live",
15+
method: "post",
16+
...args,
17+
});
18+
},
19+
},
20+
props: {
21+
dataforseo,
22+
target: {
23+
propDefinition: [
24+
dataforseo,
25+
"backlinksTarget",
26+
],
27+
},
28+
backlinksStatusType: {
29+
propDefinition: [
30+
dataforseo,
31+
"backlinksStatusType",
32+
],
33+
},
34+
includeSubdomains: {
35+
propDefinition: [
36+
dataforseo,
37+
"includeSubdomains",
38+
],
39+
},
40+
includeIndirectLinks: {
41+
propDefinition: [
42+
dataforseo,
43+
"includeIndirectLinks",
44+
],
45+
},
46+
excludeInternalBacklinks: {
47+
propDefinition: [
48+
dataforseo,
49+
"excludeInternalBacklinks",
50+
],
51+
},
52+
backlinksFilters: {
53+
propDefinition: [
54+
dataforseo,
55+
"backlinksFilters",
56+
],
57+
},
58+
rankScale: {
59+
propDefinition: [
60+
dataforseo,
61+
"rankScale",
62+
],
63+
},
64+
tag: {
65+
propDefinition: [
66+
dataforseo,
67+
"tag",
68+
],
69+
},
70+
additionalOptions: {
71+
propDefinition: [
72+
dataforseo,
73+
"additionalOptions",
74+
],
75+
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.",
76+
},
77+
},
78+
async run({ $ }) {
79+
const response = await this.getDomainPagesSummary({
80+
$,
81+
data: [
82+
{
83+
target: this.target,
84+
include_subdomains: this.includeSubdomains,
85+
include_indirect_links: this.includeIndirectLinks,
86+
exclude_internal_backlinks: this.excludeInternalBacklinks,
87+
backlinks_status_type: this.backlinksStatusType,
88+
backlinks_filters: this.backlinksFilters,
89+
rank_scale: this.rankScale,
90+
tag: this.tag,
91+
...parseObjectEntries(this.additionalOptions),
92+
},
93+
],
94+
});
95+
$.export(
96+
"$summary",
97+
"Successfully retrieved domain pages summary",
98+
);
99+
return response;
100+
},
101+
};

components/dataforseo/dataforseo.app.mjs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,50 @@ export default {
118118
"You can use this parameter to identify the task and match it with the result.",
119119
optional: true,
120120
},
121+
includeSubdomains: {
122+
type: "boolean",
123+
label: "Include Subdomains",
124+
description:
125+
"Whether the subdomains of the `target` will be included in the search. Default is `true`",
126+
optional: true,
127+
},
128+
includeIndirectLinks: {
129+
type: "boolean",
130+
label: "Include Indirect Links",
131+
description:
132+
"Whether indirect links to the target will be included in the results. Default is `true`",
133+
optional: true,
134+
},
135+
excludeInternalBacklinks: {
136+
type: "boolean",
137+
label: "Exclude Internal Backlinks",
138+
description:
139+
"Indicates if internal backlinks from subdomains to the target will be excluded from the results. Default is `true`",
140+
optional: true,
141+
},
142+
backlinksStatusType: {
143+
type: "string",
144+
label: "Backlinks Status Type",
145+
description:
146+
"You can use this field to choose what backlinks will be returned and used for aggregated metrics for your target",
147+
optional: true,
148+
options: [
149+
{
150+
value: "all",
151+
label: "All backlinks will be returned and counted",
152+
},
153+
{
154+
value: "live",
155+
label:
156+
"Backlinks found during the last check will be returned and counted",
157+
},
158+
{
159+
value: "lost",
160+
label: "Lost backlinks will be returned and counted",
161+
},
162+
],
163+
default: "live",
164+
},
121165
additionalOptions: {
122166
type: "object",
123167
label: "Additional Options",

0 commit comments

Comments
 (0)