bdy 1.22.49 → 1.22.50-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/distTs/package.json
CHANGED
|
@@ -76,7 +76,7 @@ const claimNonInteractive = async (client, workspace, domain, onOwnerBehalf) =>
|
|
|
76
76
|
const buyNonInteractive = async (client, workspace, domain, onOwnerBehalf) => {
|
|
77
77
|
output_1.default.arrowSign();
|
|
78
78
|
output_1.default.normal(`Matched: ${output_1.default.formatDomain(domain)}`);
|
|
79
|
-
if (domain.available
|
|
79
|
+
if (domain.available) {
|
|
80
80
|
await client.domainBuy(workspace, domain.name, onOwnerBehalf, true);
|
|
81
81
|
outputBought(domain.name);
|
|
82
82
|
}
|
|
@@ -113,14 +113,12 @@ const interactive = async (client, workspace, prompt, tlds, onOwnerBehalf, onlyA
|
|
|
113
113
|
const search = await client.domainSearch(workspace, [prompt]);
|
|
114
114
|
const buyable = search.domains.find((d) => d.name === prompt);
|
|
115
115
|
if (buyable &&
|
|
116
|
-
(!onlyAvailable ||
|
|
116
|
+
(!onlyAvailable || buyable.available)) {
|
|
117
117
|
toSort.push({
|
|
118
118
|
formatted: output_1.default.formatDomain(buyable),
|
|
119
|
-
value: createValue('domain', prompt, buyable.available
|
|
119
|
+
value: createValue('domain', prompt, buyable.available),
|
|
120
120
|
name: prompt,
|
|
121
|
-
price: buyable.available
|
|
122
|
-
? buyable.prices.create.price
|
|
123
|
-
: Infinity,
|
|
121
|
+
price: buyable.available ? buyable.prices.create.price : Infinity,
|
|
124
122
|
});
|
|
125
123
|
added[prompt] = true;
|
|
126
124
|
}
|
|
@@ -145,8 +143,8 @@ const interactive = async (client, workspace, prompt, tlds, onOwnerBehalf, onlyA
|
|
|
145
143
|
const bIdx = popularTlds.indexOf(bTld);
|
|
146
144
|
return aIdx < bIdx ? -1 : 1;
|
|
147
145
|
});
|
|
148
|
-
const domainsAvailable = search.domains.filter((d) => d.available
|
|
149
|
-
const domainsUnavailable = search.domains.filter((d) => !d.available
|
|
146
|
+
const domainsAvailable = search.domains.filter((d) => d.available);
|
|
147
|
+
const domainsUnavailable = search.domains.filter((d) => !d.available);
|
|
150
148
|
domainsAvailable.forEach((d) => {
|
|
151
149
|
if (!added[d.name]) {
|
|
152
150
|
toSort.push({
|
|
@@ -235,7 +233,7 @@ const interactive = async (client, workspace, prompt, tlds, onOwnerBehalf, onlyA
|
|
|
235
233
|
formatted: output_1.default.formatDomain(d),
|
|
236
234
|
value: createValue('domain', d.name, true),
|
|
237
235
|
name: d.name,
|
|
238
|
-
price: d.available
|
|
236
|
+
price: d.available ? d.prices.create.price : Infinity,
|
|
239
237
|
});
|
|
240
238
|
added[d.name] = true;
|
|
241
239
|
i += 1;
|
|
@@ -56,12 +56,10 @@ commandDomainSearch.action(async (text, options) => {
|
|
|
56
56
|
const search = await client.domainSearch(workspace, [prompt]);
|
|
57
57
|
const buyable = search.domains.find((d) => d.name === prompt);
|
|
58
58
|
if (buyable &&
|
|
59
|
-
(!onlyAvailable ||
|
|
59
|
+
(!onlyAvailable || buyable.available)) {
|
|
60
60
|
matched.push({
|
|
61
61
|
formatted: output_1.default.formatDomain(buyable),
|
|
62
|
-
price: !buyable.available
|
|
63
|
-
? Infinity
|
|
64
|
-
: buyable.prices.create.price,
|
|
62
|
+
price: !buyable.available ? Infinity : buyable.prices.create.price,
|
|
65
63
|
name: buyable.name,
|
|
66
64
|
});
|
|
67
65
|
}
|
|
@@ -94,10 +92,10 @@ commandDomainSearch.action(async (text, options) => {
|
|
|
94
92
|
}
|
|
95
93
|
});
|
|
96
94
|
search.domains.forEach((d) => {
|
|
97
|
-
if (!onlyAvailable ||
|
|
95
|
+
if (!onlyAvailable || d.available) {
|
|
98
96
|
matched.push({
|
|
99
97
|
formatted: output_1.default.formatDomain(d),
|
|
100
|
-
price: !d.available
|
|
98
|
+
price: !d.available ? Infinity : d.prices.create.price,
|
|
101
99
|
name: d.name,
|
|
102
100
|
});
|
|
103
101
|
}
|
|
@@ -125,10 +123,10 @@ commandDomainSearch.action(async (text, options) => {
|
|
|
125
123
|
});
|
|
126
124
|
});
|
|
127
125
|
result.domains.forEach((d) => {
|
|
128
|
-
if (!onlyAvailable || (d.available
|
|
126
|
+
if (!onlyAvailable || (d.available)) {
|
|
129
127
|
suggestions.push({
|
|
130
128
|
formatted: output_1.default.formatDomain(d),
|
|
131
|
-
price: !d.available
|
|
129
|
+
price: !d.available ? Infinity : d.prices.create.price,
|
|
132
130
|
name: d.name,
|
|
133
131
|
});
|
|
134
132
|
}
|
package/distTs/src/output.js
CHANGED
|
@@ -374,10 +374,10 @@ class Output {
|
|
|
374
374
|
return `${sign}${value.toFixed(2)}/${duration}`;
|
|
375
375
|
}
|
|
376
376
|
static formatDomain(domain) {
|
|
377
|
-
if (!domain.available
|
|
377
|
+
if (!domain.available) {
|
|
378
378
|
return this.getDimColor(`${domain.name} (Unavailable)`);
|
|
379
379
|
}
|
|
380
|
-
return `${this.getGreenColor(domain.name)} ${this.formatDomainPrice(domain.prices.create)}
|
|
380
|
+
return `${this.getGreenColor(domain.name)} ${this.formatDomainPrice(domain.prices.create)}`;
|
|
381
381
|
}
|
|
382
382
|
static formatDomainClaim(domain, available) {
|
|
383
383
|
if (available) {
|