Skip to content

Commit b7d84fa

Browse files
authored
Ahrefs - update to API v3 (#19063)
* update to api v3 * pnpm-lock.yaml * update * updates * fix import statements
1 parent fb8ed75 commit b7d84fa

File tree

10 files changed

+252
-179
lines changed

10 files changed

+252
-179
lines changed

components/ahrefs/actions/get-backlinks-one-per-domain/get-backlinks-one-per-domain.js

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import ahrefs from "../../ahrefs.app.mjs";
2+
3+
export default {
4+
name: "Get Backlinks One Per Domain",
5+
key: "ahrefs-get-backlinks-one-per-domain",
6+
description: "Get one backlink with the highest `ahrefs_rank` per referring domain for a target URL or domain (with details for the referring pages including anchor and page title). [See the documentation](https://docs.ahrefs.com/docs/api/site-explorer/operations/list-all-backlinks)",
7+
version: "0.0.6",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
ahrefs,
16+
target: {
17+
propDefinition: [
18+
ahrefs,
19+
"target",
20+
],
21+
},
22+
select: {
23+
propDefinition: [
24+
ahrefs,
25+
"select",
26+
],
27+
},
28+
mode: {
29+
propDefinition: [
30+
ahrefs,
31+
"mode",
32+
],
33+
},
34+
limit: {
35+
propDefinition: [
36+
ahrefs,
37+
"limit",
38+
],
39+
},
40+
},
41+
async run({ $ }) {
42+
const response = await this.ahrefs.getBacklinks({
43+
$,
44+
params: {
45+
aggregation: "1_per_domain",
46+
target: this.target,
47+
select: this.select.join(","),
48+
mode: this.mode,
49+
limit: this.limit,
50+
},
51+
});
52+
$.export("$summary", "Successfully retrieved backlinks data");
53+
return response;
54+
},
55+
};

components/ahrefs/actions/get-backlinks/get-backlinks.js

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import ahrefs from "../../ahrefs.app.mjs";
2+
3+
export default {
4+
name: "Get Backlinks",
5+
key: "ahrefs-get-backlinks",
6+
description: "Get the backlinks for a domain or URL with details for the referring pages (e.g., anchor and page title). [See the documentation](https://docs.ahrefs.com/docs/api/site-explorer/operations/list-all-backlinks)",
7+
version: "0.0.10",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
ahrefs,
16+
target: {
17+
propDefinition: [
18+
ahrefs,
19+
"target",
20+
],
21+
},
22+
select: {
23+
propDefinition: [
24+
ahrefs,
25+
"select",
26+
],
27+
},
28+
mode: {
29+
propDefinition: [
30+
ahrefs,
31+
"mode",
32+
],
33+
},
34+
limit: {
35+
propDefinition: [
36+
ahrefs,
37+
"limit",
38+
],
39+
},
40+
},
41+
async run({ $ }) {
42+
const response = await this.ahrefs.getBacklinks({
43+
$,
44+
params: {
45+
target: this.target,
46+
select: this.select.join(","),
47+
mode: this.mode,
48+
limit: this.limit,
49+
},
50+
});
51+
$.export("$summary", "Successfully retrieved backlinks data");
52+
return response;
53+
},
54+
};

components/ahrefs/actions/get-referring-domains/get-referring-domains.js

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import ahrefs from "../../ahrefs.app.mjs";
2+
3+
export default {
4+
name: "Get Referring Domains",
5+
description: "Get the referring domains that contain backlinks to the target URL or domain. [See the documentation](https://docs.ahrefs.com/docs/api/site-explorer/operations/list-refdomains)",
6+
key: "ahrefs-get-referring-domains",
7+
version: "0.0.18",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
ahrefs,
16+
target: {
17+
propDefinition: [
18+
ahrefs,
19+
"target",
20+
],
21+
},
22+
select: {
23+
propDefinition: [
24+
ahrefs,
25+
"select",
26+
],
27+
description: "An array of columns to return. [See response schema](https://docs.ahrefs.com/docs/api/site-explorer/operations/list-refdomains) for valid column identifiers.",
28+
},
29+
mode: {
30+
propDefinition: [
31+
ahrefs,
32+
"mode",
33+
],
34+
},
35+
limit: {
36+
propDefinition: [
37+
ahrefs,
38+
"limit",
39+
],
40+
},
41+
},
42+
async run({ $ }) {
43+
const response = await this.ahrefs.getReferringDomains({
44+
$,
45+
params: {
46+
target: this.target,
47+
select: this.select.join(","),
48+
mode: this.mode,
49+
limit: this.limit,
50+
},
51+
});
52+
$.export("$summary", "Successfully retrieved referring domains data");
53+
return response;
54+
},
55+
};

components/ahrefs/ahrefs.app.js

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)