Skip to content

Commit 41b1d32

Browse files
committed
new components
1 parent 946cafd commit 41b1d32

File tree

9 files changed

+731
-5
lines changed

9 files changed

+731
-5
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import godaddy from "../../godaddy.app.mjs";
2+
3+
export default {
4+
key: "godaddy-check-domain-availability",
5+
name: "Check Domain Availability",
6+
description: "Check the availability of a domain. [See the documentation](https://developer.godaddy.com/doc/endpoint/domains#/v1/available)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
godaddy,
11+
domain: {
12+
type: "string",
13+
label: "Domain",
14+
description: "The domain to check availability for",
15+
},
16+
checkType: {
17+
type: "string",
18+
label: "Check Type",
19+
description: "Optimize for time ('FAST') or accuracy ('FULL')",
20+
options: [
21+
"FAST",
22+
"FULL",
23+
],
24+
optional: true,
25+
},
26+
forTransfer: {
27+
type: "boolean",
28+
label: "For Transfer",
29+
description: "Whether or not to include domains available for transfer. If set to `true`, checkType is ignored",
30+
optional: true,
31+
},
32+
},
33+
async run({ $ }) {
34+
const response = await this.godaddy.checkDomainAvailability({
35+
$,
36+
params: {
37+
domain: this.domain,
38+
checkType: this.checkType,
39+
forTransfer: this.forTransfer,
40+
},
41+
});
42+
$.export("$summary", `Successfully checked domain availability for ${this.domain}`);
43+
return response;
44+
},
45+
};
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import godaddy from "../../godaddy.app.mjs";
2+
3+
export default {
4+
key: "godaddy-list-domains",
5+
name: "List Domains",
6+
description: "List domains in GoDaddy. [See the documentation](https://developer.godaddy.com/doc/endpoint/domains#/v1/list)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
godaddy,
11+
statuses: {
12+
propDefinition: [
13+
godaddy,
14+
"statuses",
15+
],
16+
},
17+
statusGroups: {
18+
propDefinition: [
19+
godaddy,
20+
"statusGroups",
21+
],
22+
},
23+
limit: {
24+
type: "integer",
25+
label: "Limit",
26+
description: "Maximum number of domains to return",
27+
optional: true,
28+
},
29+
marker: {
30+
type: "string",
31+
label: "Marker",
32+
description: "Marker Domain to use as the offset in results",
33+
optional: true,
34+
},
35+
includes: {
36+
propDefinition: [
37+
godaddy,
38+
"includes",
39+
],
40+
},
41+
modifiedDate: {
42+
type: "string",
43+
label: "Modified Date",
44+
description: "Only include results that have been modified since the specified date",
45+
optional: true,
46+
},
47+
},
48+
async run({ $ }) {
49+
const domains = await this.godaddy.listDomains({
50+
$,
51+
data: {
52+
statuses: this.statuses,
53+
statusGroups: this.statusGroups,
54+
limit: this.limit,
55+
marker: this.marker,
56+
includes: this.includes,
57+
modifiedDate: this.modifiedDate,
58+
},
59+
});
60+
61+
$.export("$summary", `Found ${domains.length} domain(s)`);
62+
return domains;
63+
},
64+
};
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import godaddy from "../../godaddy.app.mjs";
2+
3+
export default {
4+
key: "godaddy-renew-domain",
5+
name: "Renew Domain",
6+
description: "Renew a domain in GoDaddy. [See the documentation](https://developer.godaddy.com/doc/endpoint/domains#/v1/renew)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
godaddy,
11+
domain: {
12+
propDefinition: [
13+
godaddy,
14+
"domain",
15+
],
16+
},
17+
period: {
18+
type: "integer",
19+
label: "Period",
20+
description: "Number of years to extend the Domain. Must not exceed maximum for TLD. When omitted, defaults to period specified during original purchase.",
21+
max: 10,
22+
min: 1,
23+
optional: true,
24+
},
25+
},
26+
async run({ $ }) {
27+
const response = await this.godaddy.renewDomain({
28+
$,
29+
domain: this.domain,
30+
data: {
31+
period: this.period,
32+
},
33+
});
34+
$.export("$summary", `Renewed domain ${this.domain}`);
35+
return response;
36+
},
37+
};
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
import godaddy from "../../godaddy.app.mjs";
2+
import constants from "../../common/constants.mjs";
3+
4+
export default {
5+
key: "godaddy-suggest-domains",
6+
name: "Suggest Domains",
7+
description: "Suggest domains based on the given criteria. [See the documentation](https://developer.godaddy.com/doc/endpoint/domains#/v1/suggest)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
godaddy,
12+
query: {
13+
type: "string",
14+
label: "Query",
15+
description: "Domain name or set of keywords for which alternative domain names will be suggested",
16+
optional: true,
17+
},
18+
country: {
19+
type: "string",
20+
label: "Country",
21+
description: "Two-letter ISO country code to be used as a hint for target region",
22+
optional: true,
23+
},
24+
city: {
25+
type: "string",
26+
label: "City",
27+
description: "Name of city to be used as a hint for target region",
28+
optional: true,
29+
},
30+
sources: {
31+
type: "string[]",
32+
label: "Sources",
33+
description: "Sources to be queried",
34+
options: constants.DOMAIN_SUGGESTION_SOURCES,
35+
optional: true,
36+
},
37+
tlds: {
38+
propDefinition: [
39+
godaddy,
40+
"tlds",
41+
],
42+
},
43+
lengthMax: {
44+
type: "integer",
45+
label: "Length Max",
46+
description: "Maximum length of second-level domain",
47+
optional: true,
48+
},
49+
lengthMin: {
50+
type: "integer",
51+
label: "Length Min",
52+
description: "Minimum length of second-level domain",
53+
optional: true,
54+
},
55+
limit: {
56+
type: "integer",
57+
label: "Limit",
58+
description: "Maximum number of suggestions to return",
59+
optional: true,
60+
},
61+
waitMs: {
62+
type: "integer",
63+
label: "Wait Ms",
64+
description: "Maximum amount of time, in milliseconds, to wait for responses. If elapses, return the results compiled up to that point",
65+
optional: true,
66+
},
67+
},
68+
async run({ $ }) {
69+
const domains = await this.godaddy.suggestDomains({
70+
$,
71+
params: {
72+
query: this.query,
73+
country: this.country,
74+
city: this.city,
75+
sources: this.sources,
76+
tlds: this.tlds,
77+
lengthMax: this.lengthMax,
78+
lengthMin: this.lengthMin,
79+
limit: this.limit,
80+
waitMs: this.waitMs,
81+
},
82+
});
83+
84+
$.export("$summary", `Found ${domains.length} domain(s)`);
85+
return domains;
86+
},
87+
};

0 commit comments

Comments
 (0)