domain-hound 0.1.4 → 0.1.5
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/.claude-plugin/plugin.json +1 -1
- package/README.md +29 -7
- package/assets/readme-search.png +0 -0
- package/clis/domain-check/handles.mjs +337 -0
- package/clis/domain-check/index.mjs +12 -6
- package/clis/domain-check/name-search.mjs +13 -5
- package/clis/domain-check/price-catalog.mjs +20 -12
- package/clis/domain-check/price-snapshot.json +142 -10
- package/clis/domain-check/registry.mjs +110 -17
- package/clis/domain-check/traction.mjs +2 -2
- package/clis/domain-check/triage-sources.mjs +13 -52
- package/clis/domain-check/triage.mjs +120 -42
- package/display.mjs +7 -4
- package/package.json +17 -4
- package/plugin.json +1 -1
- package/results.mjs +85 -21
- package/server.json +3 -3
- package/server.mjs +109 -18
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Find a startup name and a domain you can actually buy
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Domain Hound checks domain availability, first-year and renewal prices, app names, trademarks and social handles from Claude Code, Codex or any MCP client. It runs locally and leaves checkout to you.
|
|
4
|
+
|
|
5
|
+

|
|
4
6
|
|
|
5
7
|
## Install
|
|
6
8
|
|
|
7
9
|
Requires Node.js 20 or later.
|
|
8
10
|
|
|
9
|
-
### Install
|
|
10
|
-
|
|
11
11
|
**Claude Code**
|
|
12
12
|
|
|
13
13
|
```sh
|
|
@@ -35,13 +35,33 @@ Add this to the client’s MCP configuration for a local stdio server.
|
|
|
35
35
|
}
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
+
Then ask, for example: “Is lanternbay.com available?”, “Find a name for my meeting-room booking app” or “Is the app name Quiet Otter taken?”
|
|
39
|
+
|
|
40
|
+
## What it checks
|
|
41
|
+
|
|
42
|
+
- **Domains:** registry RDAP or WHOIS for fourteen endings by default (.com, .ai, .io, .me, .co, .dev, .app, .si, .so, .no, .net, .org, .xyz, .tech) and, on request, .sh, .gg, .inc, .studio, .se, .dk, .de, .uk, .co.uk and .eu. A domain is never called free without a registry or shop answer.
|
|
43
|
+
- **Prices:** first payment, renewal and three-year cost from first-party registrar price lists, each with its date and label; renewal jumps and premium risk are flagged.
|
|
44
|
+
- **Trademarks:** live US marks (USPTO), with search links for the EU, WIPO and Norway.
|
|
45
|
+
- **Apps and rivals:** same-name iOS and Android apps, companies, Wikidata entities and live sites, weighed by their traction.
|
|
46
|
+
- **Handles:** GitHub, npm and Bluesky through their public APIs; YouTube, X, Instagram, TikTok, Facebook, LinkedIn and PyPI as links to check yourself. Each handle reads Taken, No public profile found, or Check yourself.
|
|
47
|
+
|
|
48
|
+
Registry answers and prices cover every name. Trademark, app and rival checks cover the first five names. Public handle checks start after the name screen for the top three. A repeat lookup can collect the completed checks.
|
|
49
|
+
|
|
38
50
|
The default install checks the registry and shows dated list prices. For a confirmed price, set `DOMAIN_HOUND_SPACESHIP_KEY` and `DOMAIN_HOUND_SPACESHIP_SECRET` (Spaceship permission `domains:read`), or `DOMAIN_HOUND_DYNADOT_KEY` (a production API key). Dynadot gives its production key account-wide access. Domain Hound only uses it to search. It shows premium pricing when it has a quote and points you to the shop when it has a premium signal without a price.
|
|
39
51
|
|
|
52
|
+
GitHub allows 60 anonymous API requests an hour. To check GitHub handles more often, set `DOMAIN_HOUND_GITHUB_TOKEN` to a token with no scopes; Domain Hound sends it only to `api.github.com`.
|
|
53
|
+
|
|
40
54
|
For the optional browser fallback, run `npm install domain-hound playwright && npx playwright install chromium` in a project directory and start your MCP client there. Ask for a live shop check to set the `confirm` tool flag, or use `--confirm` with the CLI.
|
|
41
55
|
|
|
56
|
+
## Guides
|
|
57
|
+
|
|
58
|
+
- [Check domain availability](https://domainhound.dev/guides/how-to-check-domain-availability/)
|
|
59
|
+
- [Find an available startup name](https://domainhound.dev/guides/find-an-available-startup-name/)
|
|
60
|
+
- [Check whether an app name is taken](https://domainhound.dev/guides/is-my-app-name-available/)
|
|
61
|
+
|
|
42
62
|
## Tools
|
|
43
63
|
|
|
44
|
-
- `check_domains` checks one name or exact domain, or up to 20 at once. A bare name checks
|
|
64
|
+
- `check_domains` checks one name or exact domain, or up to 20 at once. A bare name checks fourteen endings. The first lookup on a fresh install shows the list prices bundled with the package, labelled with their date, while the local price list refreshes in the background.
|
|
45
65
|
- `triage_names` screens names against public domain, trademark, app, company, and handle data.
|
|
46
66
|
- `naming_method` gives your assistant a recipe for generating and screening new names.
|
|
47
67
|
- `watch_domain` checks the registry, expiry and website. To start a free watch, give your assistant the email it should use. Confirm the watch in your inbox. Optional news requires a separate choice in that confirmation.
|
|
@@ -50,7 +70,7 @@ Completed lookups save an HTML page and a Markdown copy in `~/.domain-hound/resu
|
|
|
50
70
|
|
|
51
71
|
## Privacy
|
|
52
72
|
|
|
53
|
-
Lookups need no Domain Hound account. They send the relevant name or domain to public sources. Domain searches use IANA and registry RDAP/WHOIS, public DNS, and public registrar pricing. When configured, the client sends selected domains to the Spaceship or Dynadot API for a quote. The optional browser check opens a registrar’s public search page. Name screening may also query the USPTO, Apple App Store, Google Play, Google Search and Trends, Wikidata, public company
|
|
73
|
+
Lookups need no Domain Hound account. They send the relevant name or domain to public sources. Domain searches use IANA and registry RDAP/WHOIS, public DNS, and public registrar pricing. When configured, the client sends selected domains to the Spaceship or Dynadot API for a quote. The optional browser check opens a registrar’s public search page. Name screening may also query the USPTO, Apple App Store, Google Play, Google Search and Trends, Wikidata, public company registries, the GitHub, npm and Bluesky public APIs, Tranco, Common Crawl, and candidate websites. Other social platforms are only linked, never queried. If you configure a search provider via environment variables, queries can also go to Brave Search or Serper. Results may be cached locally.
|
|
54
74
|
|
|
55
75
|
Submitting a watch sends the domain, supplied email, optional name and news choice to the Domain Hound watch service. An agent’s yes highlights the news choice. The confirmation click records whether you want it. Result pages omit your supplied email and name.
|
|
56
76
|
|
|
@@ -60,10 +80,12 @@ Run `node scripts/canary.mjs` to check live registries, the Spotify name screen,
|
|
|
60
80
|
|
|
61
81
|
## Releases
|
|
62
82
|
|
|
63
|
-
`.github/workflows/publish.yml` publishes a matching `v*` version tag to npm with Trusted Publishing and provenance. After the first manual publish, open the package settings on npm and add GitHub Actions as a trusted publisher. Use owner `lars-hv`, repository `domain-hound`, workflow `publish.yml`, and allow `npm publish`. Use the workflow for the next unpublished version. [npm Trusted Publishing setup](https://docs.npmjs.com/trusted-publishers/)
|
|
83
|
+
`.github/workflows/publish.yml` publishes a matching `v*` version tag to npm with Trusted Publishing and provenance. It then waits until the npm CDN serves the new tarball, runs `npx -y domain-hound@<version>` as a `tools/list` smoke test, and publishes `server.json` to the MCP Registry. The registry step needs the repository secret `MCP_REGISTRY_PRIVATE_KEY` (the hex Ed25519 private key whose public key is served at `https://domainhound.dev/.well-known/mcp-registry-auth`); without it the run ends with a notice and nothing else changes. Do not open the plain tarball URL before the workflow reports it live: the CDN caches a 404. After the first manual publish, open the package settings on npm and add GitHub Actions as a trusted publisher. Use owner `lars-hv`, repository `domain-hound`, workflow `publish.yml`, and allow `npm publish`. Use the workflow for the next unpublished version. [npm Trusted Publishing setup](https://docs.npmjs.com/trusted-publishers/)
|
|
64
84
|
|
|
65
85
|
To refresh the bundled list prices before a release, run `npm run snapshot-prices`. It copies only the local `prices.json` price list.
|
|
66
86
|
|
|
67
87
|
Run `npm run build-mcpb` on a build machine with Node.js, npm, and `zip`. It writes a standalone bundle to `dist/domain-hound-<version>.mcpb` and prints its SHA-256 for the MCPB entry in `server.json`.
|
|
68
88
|
|
|
89
|
+
Website: [domainhound.dev](https://domainhound.dev) · [Privacy](https://domainhound.dev/privacy/)
|
|
90
|
+
|
|
69
91
|
[MIT license](LICENSE)
|
|
Binary file
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { randomInt } from 'node:crypto';
|
|
2
|
+
import { anySignal, cacheDir, readCache, writeCache } from './cache.mjs';
|
|
3
|
+
|
|
4
|
+
// Social handles. Three states only, never "free": a missing public profile does not mean the handle can be had.
|
|
5
|
+
export const handleStates = {
|
|
6
|
+
taken: 'Taken',
|
|
7
|
+
'not-found': 'No public profile found',
|
|
8
|
+
check: 'Check yourself',
|
|
9
|
+
};
|
|
10
|
+
const hour = 3_600_000;
|
|
11
|
+
// A taken handle is reused for a week, a missing one for an hour. "Check yourself" is never cached.
|
|
12
|
+
export const handleLifetime = { taken: 7 * 24 * hour, 'not-found': hour };
|
|
13
|
+
// One platform's whole run (its two controls, the exact handles and any variants) shares this budget.
|
|
14
|
+
export const platformBudgetMs = 2000;
|
|
15
|
+
export const handleVariants = name => ['get' + name, name + 'app', name + 'hq'];
|
|
16
|
+
const userAgent = 'DomainHound/0.1 (https://domainhound.dev)';
|
|
17
|
+
const githubHoldFile = 'handles-github-hold.json';
|
|
18
|
+
|
|
19
|
+
const label = value => /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(value);
|
|
20
|
+
const syntheticLabel = (length, pick = randomInt) => 'zq' + Array.from({ length }, () => String.fromCharCode(97 + pick(26))).join('');
|
|
21
|
+
|
|
22
|
+
async function readStrictJson(response) {
|
|
23
|
+
if (!/^application\/(?:[\w.+-]+\+)?json\b/i.test(response.headers.get('content-type') ?? '')) {
|
|
24
|
+
await response.body?.cancel().catch(() => {});
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const text = await response.text();
|
|
28
|
+
if (text.length > 512 * 1024) return null;
|
|
29
|
+
try { return JSON.parse(text); } catch { return null; }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Each automatic check uses a documented public API that needs no login. Anything the parser does not recognise is
|
|
33
|
+
// "check yourself".
|
|
34
|
+
const apis = {
|
|
35
|
+
// GitHub REST "Get a user" (users and organizations): https://docs.github.com/en/rest/users/users#get-a-user
|
|
36
|
+
GitHub: {
|
|
37
|
+
valid: handle => /^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){0,38}$/.test(handle),
|
|
38
|
+
url: handle => 'https://api.github.com/users/' + handle,
|
|
39
|
+
headers: { Accept: 'application/vnd.github+json', 'X-GitHub-Api-Version': '2022-11-28' },
|
|
40
|
+
read: async (response, handle) => {
|
|
41
|
+
const data = await readStrictJson(response);
|
|
42
|
+
if (response.status === 200) {
|
|
43
|
+
return typeof data?.login === 'string' && data.login.toLowerCase() === handle
|
|
44
|
+
&& ['User', 'Organization'].includes(data.type) ? 'taken' : 'check';
|
|
45
|
+
}
|
|
46
|
+
if (response.status === 404) return data?.message === 'Not Found' ? 'not-found' : 'check';
|
|
47
|
+
return 'check';
|
|
48
|
+
},
|
|
49
|
+
controls: () => ({ taken: 'github', missing: syntheticLabel(28) }),
|
|
50
|
+
},
|
|
51
|
+
// npm registry package document: https://github.com/npm/registry/blob/main/docs/REGISTRY-API.md#getpackage
|
|
52
|
+
npm: {
|
|
53
|
+
valid: handle => handle.length <= 214,
|
|
54
|
+
url: handle => 'https://registry.npmjs.org/' + handle,
|
|
55
|
+
headers: { Accept: 'application/vnd.npm.install-v1+json' },
|
|
56
|
+
read: async (response, handle) => {
|
|
57
|
+
const data = await readStrictJson(response);
|
|
58
|
+
if (response.status === 200) return data?.name === handle ? 'taken' : 'check';
|
|
59
|
+
if (response.status === 404) return typeof data?.error === 'string' && /^not found$/i.test(data.error) ? 'not-found' : 'check';
|
|
60
|
+
return 'check';
|
|
61
|
+
},
|
|
62
|
+
controls: () => ({ taken: 'lodash', missing: syntheticLabel(24) }),
|
|
63
|
+
},
|
|
64
|
+
// Bluesky public AppView, com.atproto.identity.resolveHandle:
|
|
65
|
+
// https://docs.bsky.app/docs/api/com-atproto-identity-resolve-handle
|
|
66
|
+
Bluesky: {
|
|
67
|
+
valid: handle => handle.length >= 3 && handle.length <= 18,
|
|
68
|
+
identifier: handle => handle + '.bsky.social',
|
|
69
|
+
url: identifier => 'https://public.api.bsky.app/xrpc/com.atproto.identity.resolveHandle?handle=' + encodeURIComponent(identifier),
|
|
70
|
+
headers: { Accept: 'application/json' },
|
|
71
|
+
read: async response => {
|
|
72
|
+
const data = await readStrictJson(response);
|
|
73
|
+
if (response.status === 200) return typeof data?.did === 'string' && /^did:(?:plc|web):[a-z0-9._:%-]+$/i.test(data.did) ? 'taken' : 'check';
|
|
74
|
+
if (response.status === 400) {
|
|
75
|
+
return data?.error === 'InvalidRequest' && /^unable to resolve handle$/i.test(String(data.message ?? '').trim()) ? 'not-found' : 'check';
|
|
76
|
+
}
|
|
77
|
+
return 'check';
|
|
78
|
+
},
|
|
79
|
+
// bsky.app is Bluesky's own account.
|
|
80
|
+
controls: () => ({ taken: 'bsky.app', missing: syntheticLabel(14) + '.bsky.social' }),
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// Display order (Lars, 2026-11-25): YouTube, X, Instagram, TikTok, Facebook, LinkedIn, then GitHub, npm, PyPI, Bluesky.
|
|
85
|
+
// YouTube, X, Instagram, TikTok, Facebook and LinkedIn have no public no-login lookup their terms allow: link only.
|
|
86
|
+
// PyPI is link only by decision.
|
|
87
|
+
export const handlePlatforms = [
|
|
88
|
+
{ id: 'YouTube', link: handle => 'https://www.youtube.com/@' + handle },
|
|
89
|
+
{ id: 'X', link: handle => 'https://x.com/' + handle },
|
|
90
|
+
{ id: 'Instagram', link: handle => 'https://www.instagram.com/' + handle + '/' },
|
|
91
|
+
{ id: 'TikTok', link: handle => 'https://www.tiktok.com/@' + handle },
|
|
92
|
+
{ id: 'Facebook', link: handle => 'https://www.facebook.com/' + handle },
|
|
93
|
+
{ id: 'LinkedIn', link: handle => 'https://www.linkedin.com/company/' + handle + '/' },
|
|
94
|
+
{ id: 'GitHub', link: handle => 'https://github.com/' + handle, auto: true },
|
|
95
|
+
{ id: 'npm', link: handle => 'https://www.npmjs.com/package/' + handle, auto: true },
|
|
96
|
+
{ id: 'PyPI', link: handle => 'https://pypi.org/project/' + handle + '/' },
|
|
97
|
+
{ id: 'Bluesky', link: handle => 'https://bsky.app/profile/' + handle + '.bsky.social', auto: true },
|
|
98
|
+
];
|
|
99
|
+
// Shown only when the person asks for them; always check links.
|
|
100
|
+
export const requestPlatforms = [
|
|
101
|
+
{ id: 'Snapchat', link: handle => 'https://www.snapchat.com/add/' + handle },
|
|
102
|
+
{ id: 'Reddit', link: handle => 'https://www.reddit.com/user/' + handle + '/' },
|
|
103
|
+
{ id: 'Twitch', link: handle => 'https://www.twitch.tv/' + handle },
|
|
104
|
+
{ id: 'Threads', link: handle => 'https://www.threads.com/@' + handle },
|
|
105
|
+
{ id: 'Pinterest', link: handle => 'https://www.pinterest.com/' + handle + '/' },
|
|
106
|
+
{ id: 'Discord', link: () => 'https://support.discord.com/hc/en-us/articles/12620128861463-New-Usernames-Display-Names' },
|
|
107
|
+
];
|
|
108
|
+
export const autoPlatforms = handlePlatforms.filter(platform => platform.auto).map(platform => platform.id);
|
|
109
|
+
|
|
110
|
+
// In-flight lookups and control batches are shared inside one run (one process).
|
|
111
|
+
const inFlight = new Map();
|
|
112
|
+
const controlRuns = new Map();
|
|
113
|
+
// Every answer this run already has, "check yourself" included, so a later step never asks again.
|
|
114
|
+
const runAnswers = new Map();
|
|
115
|
+
export function resetHandleRuns() {
|
|
116
|
+
inFlight.clear();
|
|
117
|
+
controlRuns.clear();
|
|
118
|
+
runAnswers.clear();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
async function githubHeld(directory, now) {
|
|
122
|
+
const hold = await readCache(directory, githubHoldFile);
|
|
123
|
+
return hold?.until > now.getTime();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// One request, and one retry inside the same budget when the platform fails (5xx or no response).
|
|
127
|
+
async function request(platform, identifier, { fetcher, signal, githubToken }, retry = true) {
|
|
128
|
+
const api = apis[platform];
|
|
129
|
+
let failed;
|
|
130
|
+
// An optional token lifts GitHub's 60 requests an hour for anonymous callers. It is sent only to api.github.com.
|
|
131
|
+
const auth = platform === 'GitHub' && githubToken ? { Authorization: 'Bearer ' + githubToken } : {};
|
|
132
|
+
try {
|
|
133
|
+
const response = await fetcher(api.url(identifier), {
|
|
134
|
+
redirect: 'error', signal, headers: { 'User-Agent': userAgent, ...api.headers, ...auth },
|
|
135
|
+
});
|
|
136
|
+
failed = response.status >= 500;
|
|
137
|
+
const state = await api.read(response, identifier);
|
|
138
|
+
const limited = platform === 'GitHub' && [403, 429].includes(response.status);
|
|
139
|
+
if (!failed) return { state, ...(limited && { limited: Number(response.headers.get('x-ratelimit-reset')) * 1000 || null }) };
|
|
140
|
+
} catch {
|
|
141
|
+
failed = true;
|
|
142
|
+
}
|
|
143
|
+
return retry && failed && !signal?.aborted ? request(platform, identifier, { fetcher, signal, githubToken }, false) : { state: 'check' };
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// The run's two controls for one platform: a handle known to exist and a random one that cannot. When either comes
|
|
147
|
+
// back wrong, every answer from that platform in this run becomes "check yourself".
|
|
148
|
+
function controlsFor(platform, options) {
|
|
149
|
+
const key = platform + '|' + (options.directory?.href ?? '');
|
|
150
|
+
const runs = options.controlRuns ?? controlRuns;
|
|
151
|
+
if (!runs.has(key)) {
|
|
152
|
+
const { taken, missing } = options.controls?.[platform] ?? apis[platform].controls();
|
|
153
|
+
runs.set(key, Promise.all([request(platform, taken, options), request(platform, missing, options)])
|
|
154
|
+
.then(([known, absent]) => ({ ok: known.state === 'taken' && absent.state === 'not-found',
|
|
155
|
+
limited: known.limited ?? absent.limited })));
|
|
156
|
+
}
|
|
157
|
+
return runs.get(key);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function lookup(platform, identifier, options) {
|
|
161
|
+
const key = platform + '|' + identifier + '|' + (options.directory?.href ?? '');
|
|
162
|
+
if (!inFlight.has(key)) inFlight.set(key, request(platform, identifier, options).finally(() => inFlight.delete(key)));
|
|
163
|
+
return inFlight.get(key);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const cacheFile = (platform, identifier) => 'handle-' + platform.toLowerCase() + '-' + identifier + '.json';
|
|
167
|
+
|
|
168
|
+
async function cached(directory, platform, identifier, now) {
|
|
169
|
+
const saved = await readCache(directory, cacheFile(platform, identifier));
|
|
170
|
+
const age = now.getTime() - saved?.at;
|
|
171
|
+
return age >= 0 && age < (handleLifetime[saved?.state] ?? 0) ? saved : null;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Answer a list of handles on one platform inside one shared time budget. Cached answers need no request; any live
|
|
175
|
+
// request runs beside the platform's control batch, and only a passing control lets a live answer through.
|
|
176
|
+
async function platformBatch(platform, handles, options, deadline) {
|
|
177
|
+
const { directory, now } = options;
|
|
178
|
+
const api = apis[platform];
|
|
179
|
+
const runCache = options.runAnswers ?? runAnswers;
|
|
180
|
+
const answers = new Map();
|
|
181
|
+
const live = [];
|
|
182
|
+
for (const handle of new Set(handles)) {
|
|
183
|
+
if (!label(handle) || !api.valid(handle)) {
|
|
184
|
+
answers.set(handle, { state: 'check', why: 'cannot check this handle form' });
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
const identifier = api.identifier?.(handle) ?? handle;
|
|
188
|
+
const earlier = runCache.get(platform + '|' + identifier + '|' + (directory?.href ?? ''));
|
|
189
|
+
if (earlier) {
|
|
190
|
+
answers.set(handle, earlier);
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
const saved = await cached(directory, platform, identifier, now);
|
|
194
|
+
if (saved) answers.set(handle, { state: saved.state, checkedAt: new Date(saved.at).toISOString(), via: 'cache' });
|
|
195
|
+
else live.push([handle, identifier]);
|
|
196
|
+
}
|
|
197
|
+
if (!live.length && (!options.controlRuns || !answers.size)) return answers;
|
|
198
|
+
if (platform === 'GitHub' && await githubHeld(directory, now)) {
|
|
199
|
+
for (const handle of [...answers.keys(), ...live.map(([handle]) => handle)]) answers.set(handle, { state: 'check', why: 'rate limited' });
|
|
200
|
+
return answers;
|
|
201
|
+
}
|
|
202
|
+
const signal = options.signal ? anySignal([options.signal, deadline]) : deadline;
|
|
203
|
+
const run = { ...options, signal };
|
|
204
|
+
const [control, results] = await Promise.all([
|
|
205
|
+
controlsFor(platform, run),
|
|
206
|
+
Promise.all(live.map(([, identifier]) => lookup(platform, identifier, run))),
|
|
207
|
+
]);
|
|
208
|
+
const limited = control.limited ?? results.find(result => result.limited !== undefined)?.limited;
|
|
209
|
+
if (limited !== undefined) {
|
|
210
|
+
const until = limited > now.getTime() ? limited : now.getTime() + hour;
|
|
211
|
+
await writeCache(directory, githubHoldFile, { until }).catch(() => {});
|
|
212
|
+
}
|
|
213
|
+
if (!control.ok) {
|
|
214
|
+
for (const handle of [...answers.keys(), ...live.map(([handle]) => handle)]) {
|
|
215
|
+
answers.set(handle, { state: 'check', why: 'control check failed' });
|
|
216
|
+
}
|
|
217
|
+
return answers;
|
|
218
|
+
}
|
|
219
|
+
const checkedAt = now.toISOString();
|
|
220
|
+
for (const [index, [handle, identifier]] of live.entries()) {
|
|
221
|
+
const { state } = results[index];
|
|
222
|
+
const key = platform + '|' + identifier + '|' + (directory?.href ?? '');
|
|
223
|
+
if (state === 'check') {
|
|
224
|
+
const answer = { state: 'check', why: 'no clear answer in time' };
|
|
225
|
+
answers.set(handle, answer);
|
|
226
|
+
runCache.set(key, answer);
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
answers.set(handle, { state, checkedAt, via: 'api' });
|
|
230
|
+
runCache.set(key, { state, checkedAt, via: 'api' });
|
|
231
|
+
await writeCache(directory, cacheFile(platform, identifier), { at: now.getTime(), state }).catch(() => {});
|
|
232
|
+
}
|
|
233
|
+
return answers;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function linkRow(platform, handle, why = 'link only') {
|
|
237
|
+
return { platform: platform.id, handle, state: 'check', link: platform.link(handle), why };
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function selectedPlatforms(extra) {
|
|
241
|
+
return [...handlePlatforms, ...requestPlatforms.filter(platform => extra === true || Array.isArray(extra) && extra.includes(platform.id))];
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export function pendingHandleRows(name, extra) {
|
|
245
|
+
return selectedPlatforms(extra).map(platform => linkRow(platform, name, platform.auto ? 'still checking' : 'link only'));
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export const handlePriorities = {
|
|
249
|
+
developer: ['GitHub', 'npm', 'X'],
|
|
250
|
+
consumer: ['Instagram', 'TikTok'],
|
|
251
|
+
b2b: ['LinkedIn', 'X'],
|
|
252
|
+
media: ['YouTube', 'TikTok'],
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
// rows: [{ name, platforms?: ['GitHub', 'npm', 'Bluesky'], variants?: boolean, links?: boolean }]
|
|
256
|
+
// Returns a Map from name to its handle rows in display order. Exact handle first; getNAME, NAMEapp and NAMEhq only
|
|
257
|
+
// when the exact handle is taken, inside the same per-platform budget.
|
|
258
|
+
export async function checkSocialHandles(rows, {
|
|
259
|
+
directory = cacheDir, now = new Date(), fetcher = globalThis.fetch, signal, budgetMs = platformBudgetMs,
|
|
260
|
+
controls, extraPlatforms = false, env = process.env, freshRun = false,
|
|
261
|
+
} = {}) {
|
|
262
|
+
const githubToken = typeof env?.DOMAIN_HOUND_GITHUB_TOKEN === 'string' && /^[\w-]{20,255}$/.test(env.DOMAIN_HOUND_GITHUB_TOKEN)
|
|
263
|
+
? env.DOMAIN_HOUND_GITHUB_TOKEN : null;
|
|
264
|
+
const options = { directory, now, fetcher, signal, controls, githubToken,
|
|
265
|
+
...(freshRun && { controlRuns: new Map(), runAnswers: new Map() }) };
|
|
266
|
+
const wanted = platform => rows.filter(row => (row.platforms ?? autoPlatforms).includes(platform));
|
|
267
|
+
const perPlatform = new Map(await Promise.all(autoPlatforms.map(async platform => {
|
|
268
|
+
const names = wanted(platform);
|
|
269
|
+
if (!names.length) return [platform, new Map()];
|
|
270
|
+
const started = performance.now();
|
|
271
|
+
const deadline = new AbortController();
|
|
272
|
+
// Keep Node alive until the platform answers or the deadline aborts its requests.
|
|
273
|
+
const timer = setTimeout(() => {
|
|
274
|
+
deadline.abort(new DOMException('The operation was aborted due to timeout', 'TimeoutError'));
|
|
275
|
+
}, budgetMs);
|
|
276
|
+
try {
|
|
277
|
+
const exact = await platformBatch(platform, names.map(row => row.name), options, deadline.signal);
|
|
278
|
+
const taken = names.filter(row => row.variants && exact.get(row.name)?.state === 'taken');
|
|
279
|
+
const left = budgetMs - (performance.now() - started);
|
|
280
|
+
const variants = taken.length && left >= 300
|
|
281
|
+
? await platformBatch(platform, taken.flatMap(row => handleVariants(row.name)), options, deadline.signal)
|
|
282
|
+
: new Map();
|
|
283
|
+
return [platform, { exact, variants, skipped: taken.length > 0 && left < 300 }];
|
|
284
|
+
} finally {
|
|
285
|
+
clearTimeout(timer);
|
|
286
|
+
}
|
|
287
|
+
})));
|
|
288
|
+
const result = new Map();
|
|
289
|
+
for (const row of rows) {
|
|
290
|
+
const platforms = selectedPlatforms(extraPlatforms);
|
|
291
|
+
const entries = [];
|
|
292
|
+
for (const platform of platforms) {
|
|
293
|
+
const checked = (row.platforms ?? autoPlatforms).includes(platform.id) ? perPlatform.get(platform.id) : null;
|
|
294
|
+
if (!platform.auto || !checked?.exact) {
|
|
295
|
+
if (row.links === false) continue;
|
|
296
|
+
entries.push(linkRow(platform, row.name, platform.auto ? 'not checked for this name' : 'link only'));
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
const answer = checked.exact.get(row.name) ?? { state: 'check', why: 'no clear answer in time' };
|
|
300
|
+
const entry = { platform: platform.id, handle: row.name, state: answer.state, link: platform.link(row.name),
|
|
301
|
+
...(answer.checkedAt && { checkedAt: answer.checkedAt }), ...(answer.why && { why: answer.why }) };
|
|
302
|
+
if (row.variants && answer.state === 'taken') {
|
|
303
|
+
entry.variants = handleVariants(row.name).map(handle => {
|
|
304
|
+
const variant = checked.variants.get(handle) ?? { state: 'check', why: 'no clear answer in time' };
|
|
305
|
+
return { handle, state: variant.state, link: platform.link(handle),
|
|
306
|
+
...(variant.checkedAt && { checkedAt: variant.checkedAt }) };
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
entries.push(entry);
|
|
310
|
+
}
|
|
311
|
+
result.set(row.name, entries);
|
|
312
|
+
}
|
|
313
|
+
return result;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// "GitHub taken · npm no public profile found · Bluesky taken; check yourself: YouTube, X, …".
|
|
317
|
+
export function handleSummary(entries, { limit = Infinity, manualLimit = Infinity, ordered = false } = {}) {
|
|
318
|
+
if (!Array.isArray(entries) || !entries.length) return null;
|
|
319
|
+
const checked = entries.filter(entry => entry.state !== 'check');
|
|
320
|
+
const open = entries.filter(entry => entry.state === 'check');
|
|
321
|
+
if (ordered) {
|
|
322
|
+
const shown = new Set([...entries.slice(0, 2), ...checked.slice(0, 2)]);
|
|
323
|
+
for (const entry of entries) {
|
|
324
|
+
if (shown.size === 4) break;
|
|
325
|
+
shown.add(entry);
|
|
326
|
+
}
|
|
327
|
+
const states = entries.filter(entry => shown.has(entry))
|
|
328
|
+
.map(entry => entry.platform + ' ' + handleStates[entry.state].toLowerCase()).join(', ');
|
|
329
|
+
const more = entries.length - shown.size;
|
|
330
|
+
return states + (more ? ' (' + more + ' more on the page)' : '');
|
|
331
|
+
}
|
|
332
|
+
const shown = checked.slice(0, limit).map(entry => entry.platform + ' ' + handleStates[entry.state].toLowerCase());
|
|
333
|
+
const manual = open.slice(0, manualLimit);
|
|
334
|
+
const more = checked.length - shown.length + open.length - manual.length;
|
|
335
|
+
return [shown.join(' · '), manual.length ? 'check yourself: ' + manual.map(entry => entry.platform).join(', ') : '',
|
|
336
|
+
more > 0 ? '(' + more + ' more on the page)' : ''].filter(Boolean).join('; ');
|
|
337
|
+
}
|
|
@@ -5,7 +5,7 @@ import { promisify } from 'node:util';
|
|
|
5
5
|
import { apiShops, cachedSignals, confirmDomain, confirmingShops, lightConfirm } from './confirm.mjs';
|
|
6
6
|
import { checkDomainSite } from './com-site.mjs';
|
|
7
7
|
import { appStoreSearchLink, googleSearchLink, nameCheckLines, playSearchLink } from './google-search.mjs';
|
|
8
|
-
import { applyLiveSite, asciiDomain, canRecommend, defaultEndings, eligibilityNotes, listQuote, mergeQuote, nameCandidates, normalizeName, pickName,
|
|
8
|
+
import { applyLiveSite, asciiDomain, domainEnding, canRecommend, defaultEndings, eligibilityNotes, listQuote, mergeQuote, nameCandidates, normalizeName, pickName,
|
|
9
9
|
premiumRisk, rankName, registrationStatus, searchCandidates, searchName, termCosts, unicodeName, validEligibility, validEndings,
|
|
10
10
|
withPremiumRisk, withoutListPrice } from './name-search.mjs';
|
|
11
11
|
import { bundledCatalog, catalogOffers, datedListPrices, isListPriceUsable, loadCachedCatalog, refreshPrices } from './price-catalog.mjs';
|
|
@@ -76,7 +76,8 @@ export function normalize(input) {
|
|
|
76
76
|
const labels = domain.split('.');
|
|
77
77
|
const label = /^[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?$/;
|
|
78
78
|
const tld = /^(?:[a-z]{2,63}|xn--[a-z\d](?:[a-z\d-]{0,57}[a-z\d])?)$/;
|
|
79
|
-
return labels.length === 2 && labels.
|
|
79
|
+
return (labels.length === 2 || labels.length === 3 && labels.slice(1).join('.') === 'co.uk')
|
|
80
|
+
&& labels.every(part => label.test(part))
|
|
80
81
|
&& tld.test(labels.at(-1)) ? domain : null;
|
|
81
82
|
}
|
|
82
83
|
|
|
@@ -176,7 +177,7 @@ export async function checkDomain(input, {
|
|
|
176
177
|
} = {}) {
|
|
177
178
|
const domain = normalize(input);
|
|
178
179
|
if (!domain) return { error: 'Enter a domain such as example.com.' };
|
|
179
|
-
const tld = domain
|
|
180
|
+
const tld = domainEnding(domain);
|
|
180
181
|
const deadline = performance.now() + totalTimeout;
|
|
181
182
|
const timeout = () => Math.max(0, Math.min(maxTimeout, Math.floor(deadline - performance.now())));
|
|
182
183
|
const [registrations, catalog, pricing, dynadot, confirmed, nok, signals] = await Promise.all([
|
|
@@ -430,6 +431,11 @@ function compactAgentResult(groups, names, complete, checkedAt, batch, rateLimit
|
|
|
430
431
|
s === 'nc' ? { d, s } : { d, s, ...price });
|
|
431
432
|
}
|
|
432
433
|
}
|
|
434
|
+
// Fourteen endings for twenty long names: an unconfirmed list-price row drops its s, as the display layer does.
|
|
435
|
+
if (batch && Buffer.byteLength(JSON.stringify(result)) >= 7900) {
|
|
436
|
+
for (const row of byName.values()) if (row.free) row.free = row.free.map(({ s, ...option }) => s === 'nc' ? option : { ...option, s });
|
|
437
|
+
result.legend = { ...result.legend, d: agentLegend.d + '; a free entry without s is nc' };
|
|
438
|
+
}
|
|
433
439
|
return result;
|
|
434
440
|
}
|
|
435
441
|
|
|
@@ -459,7 +465,7 @@ export async function agentResult(input, options = {}) {
|
|
|
459
465
|
if (names.includes(null)) return { error: 'Enter a valid name or exact domain.' };
|
|
460
466
|
const exact = new Set(domain ? [domain] : names.filter((name, index) => batch && exactDomain(input[index])));
|
|
461
467
|
const groups = [...new Set(names)].map(name => ({ name, candidates: exact.has(name)
|
|
462
|
-
? [{ domain: name, tld: name
|
|
468
|
+
? [{ domain: name, tld: domainEnding(name), exact: true }] : nameCandidates(name, { ...options, variants: !batch }) }));
|
|
463
469
|
const keyed = apiShops(options.env ?? process.env).length > 0;
|
|
464
470
|
const reserve = keyed ? 1800 : 0;
|
|
465
471
|
const searchOptions = { ...options, budgetMs: Math.max(0, Math.min(remaining() - reserve, batch ? 10_700 : 2700)),
|
|
@@ -479,7 +485,7 @@ export async function agentResult(input, options = {}) {
|
|
|
479
485
|
if (targets.length) {
|
|
480
486
|
options.onProgress?.({ stage: 'quotes' });
|
|
481
487
|
const catalog = await loadCachedCatalog(options.directory);
|
|
482
|
-
const listFor = (target, shop) => datedListPrices(catalog, target
|
|
488
|
+
const listFor = (target, shop) => datedListPrices(catalog, domainEnding(target), options.now ?? new Date(),
|
|
483
489
|
options.bundledCatalog === undefined ? bundledCatalog : options.bundledCatalog).find(row => row.id === shop) ?? null;
|
|
484
490
|
const light = options.lightConfirm ?? lightConfirm;
|
|
485
491
|
const found = await light(targets.map(row => row.domain), { env: options.env, fetcher: options.fetcher,
|
|
@@ -691,7 +697,7 @@ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href)
|
|
|
691
697
|
? await refreshTranco({ directory: process.env.DOMAIN_HOUND_TRANCO_CACHE ? pathToFileURL(process.env.DOMAIN_HOUND_TRANCO_CACHE.replace(/\/?$/, '/')) : undefined })
|
|
692
698
|
: args[0] === '--presence' && args.length === 2 ? await namePresence(args[1], { refreshTranco: true })
|
|
693
699
|
: args[0] === '--triage' ? await triageNames(positional.length === 1 ? positional[0].split(',') : null,
|
|
694
|
-
{ ...options, refreshTranco: true })
|
|
700
|
+
{ ...options, refreshTranco: true, deferHandles: process.env.DOMAIN_HOUND_DEFER_HANDLES === '1' })
|
|
695
701
|
: await checkDomain(args.length === 1 ? args[0] : undefined);
|
|
696
702
|
if (result.error) process.exitCode = 1;
|
|
697
703
|
if (args[0] === '--triage' && options.compact) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { domainToASCII, domainToUnicode } from 'node:url';
|
|
2
2
|
import { checkDomainSite } from './com-site.mjs';
|
|
3
3
|
import { cachedSignals, confirmingShops } from './confirm.mjs';
|
|
4
|
-
import { bundledCatalog, datedListPrices, getNameCatalog, loadCachedCatalog, targetEndings } from './price-catalog.mjs';
|
|
4
|
+
import { bundledCatalog, datedListPrices, getNameCatalog, loadCachedCatalog, requestEndings, supportedEndings, targetEndings } from './price-catalog.mjs';
|
|
5
5
|
import { linkable, shopSearchUrl } from './prices.mjs';
|
|
6
6
|
import { lookupRegistrations } from './registry.mjs';
|
|
7
7
|
import { foldLatin } from './triage-sources.mjs';
|
|
@@ -18,6 +18,12 @@ const facts = {
|
|
|
18
18
|
eligibility: 'Norwegian organization or eligible individual, with a Norwegian postal address',
|
|
19
19
|
source: 'https://www.norid.no/en/om-domenenavn/regelverk-for-no/', checked,
|
|
20
20
|
},
|
|
21
|
+
eu: {
|
|
22
|
+
need: 'EU or EEA eligibility',
|
|
23
|
+
eligibility: 'EU, Icelandic, Liechtenstein or Norwegian citizenship, residence or establishment',
|
|
24
|
+
note: 'Registration requires citizenship, residence or establishment in the EU, Iceland, Liechtenstein or Norway',
|
|
25
|
+
source: 'https://eurid.eu/en/knowledge-centre/rules-for-eu-domains/', checked: '2026-11-25',
|
|
26
|
+
},
|
|
21
27
|
io: {
|
|
22
28
|
note: 'Long-term registry uncertainty',
|
|
23
29
|
source: 'https://www.icann.org/en/blogs/details/the-chagos-archipelago-and-the-io-domain-14-11-2024-en', checked,
|
|
@@ -33,7 +39,9 @@ const facts = {
|
|
|
33
39
|
};
|
|
34
40
|
|
|
35
41
|
const label = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
|
|
42
|
+
export const domainEnding = domain => domain.endsWith('.co.uk') ? 'co.uk' : domain.split('.').at(-1);
|
|
36
43
|
export const defaultEndings = targetEndings;
|
|
44
|
+
export { requestEndings, supportedEndings };
|
|
37
45
|
export const restrictedEndings = Object.keys(facts).filter(tld => facts[tld].eligibility);
|
|
38
46
|
const firstCost = row => row.firstPayment ?? Infinity;
|
|
39
47
|
|
|
@@ -58,8 +66,8 @@ export function eligibilityNotes(endings) {
|
|
|
58
66
|
}
|
|
59
67
|
|
|
60
68
|
export function validEndings(endings) {
|
|
61
|
-
return Array.isArray(endings) && endings.length > 0 && endings.length <=
|
|
62
|
-
&& endings.every(ending =>
|
|
69
|
+
return Array.isArray(endings) && endings.length > 0 && endings.length <= supportedEndings.length
|
|
70
|
+
&& new Set(endings).size === endings.length && endings.every(ending => supportedEndings.includes(ending));
|
|
63
71
|
}
|
|
64
72
|
|
|
65
73
|
// One DNS label for a name. Spaces and punctuation go; letters never do. A name with non-ASCII letters (æ, ø, å, é)
|
|
@@ -150,7 +158,7 @@ export function rankName(rows) {
|
|
|
150
158
|
return { ...row, ...termCosts(tld, price, renewal), reason, terms: facts[tld] ?? null,
|
|
151
159
|
renewalJump: price != null && renewal > 2 * price };
|
|
152
160
|
}).sort((a, b) => Number(b.exact) - Number(a.exact) || firstCost(a) - firstCost(b)
|
|
153
|
-
||
|
|
161
|
+
|| supportedEndings.indexOf(a.tld) - supportedEndings.indexOf(b.tld) || a.domain.localeCompare(b.domain));
|
|
154
162
|
}
|
|
155
163
|
|
|
156
164
|
export function pickName(rows, eligible) {
|
|
@@ -247,7 +255,7 @@ export async function searchCandidates(groups, options = {}) {
|
|
|
247
255
|
// A negative registry answer can be wrong. A real response on the domain beats a free claim.
|
|
248
256
|
// Replay and unit callers that inject registry traffic can inject the site check as well.
|
|
249
257
|
const checkNegative = registry.status === 'free' && (options.fetcher === undefined || options.verifyFreeSite);
|
|
250
|
-
const checkTaken = registry.status === 'taken' && exact && siteEndings.includes(tld);
|
|
258
|
+
const checkTaken = registry.status === 'taken' && exact && siteEndings.includes(tld) && (options.siteFilter?.(domain) ?? true);
|
|
251
259
|
if (!checkNegative) publish(registry);
|
|
252
260
|
if (!checkNegative && !checkTaken) return;
|
|
253
261
|
const timeout = Math.min(options.siteTimeout ?? 1200, timeLeft());
|
|
@@ -7,9 +7,15 @@ import { cacheDir, readCache, writeCache } from './cache.mjs';
|
|
|
7
7
|
import { withShopPages } from './confirm.mjs';
|
|
8
8
|
import { catalogPrice, dynadotOffer, offer, shops } from './prices.mjs';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// The endings every bare name is checked on. The first ten are the 0.1.4 set; .net, .org, .xyz and .tech joined in 0.1.5.
|
|
11
|
+
export const targetEndings = ['com', 'ai', 'io', 'me', 'co', 'dev', 'app', 'si', 'so', 'no', 'net', 'org', 'xyz', 'tech'];
|
|
12
|
+
// Checked only when the person asks for them (or names them in endings).
|
|
13
|
+
export const requestEndings = ['sh', 'gg', 'inc', 'studio', 'se', 'dk', 'de', 'uk', 'co.uk', 'eu'];
|
|
14
|
+
export const supportedEndings = [...targetEndings, ...requestEndings];
|
|
15
|
+
// A saved or bundled catalog must cover these; newer endings are priced once a refresh has them.
|
|
16
|
+
const coreEndings = targetEndings.slice(0, 10);
|
|
11
17
|
const otherEndings = ['so', 'no'];
|
|
12
|
-
const spaceshipEndings =
|
|
18
|
+
const spaceshipEndings = coreEndings.filter(tld => !otherEndings.includes(tld));
|
|
13
19
|
const filename = 'prices.json';
|
|
14
20
|
const day = 86_400_000;
|
|
15
21
|
const primaryShops = ['spaceship', 'porkbun', 'dynadot'];
|
|
@@ -26,7 +32,7 @@ function validSource(id, prices) {
|
|
|
26
32
|
const entries = Object.entries(prices ?? {});
|
|
27
33
|
const required = id === 'spaceship' ? spaceshipEndings : id === 'gandi' ? [] : ['com', 'io', 'me'];
|
|
28
34
|
return entries.length > 0 && required.every(tld => Object.hasOwn(prices, tld)) &&
|
|
29
|
-
entries.every(([tld, row]) =>
|
|
35
|
+
entries.every(([tld, row]) => supportedEndings.includes(tld) && validPrice(row, shops[id].name));
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
function validDate(value) {
|
|
@@ -36,7 +42,7 @@ function validDate(value) {
|
|
|
36
42
|
export function validCatalog(value) {
|
|
37
43
|
if (!validDate(value?.checkedAt)) return false;
|
|
38
44
|
if (!value.catalogs) {
|
|
39
|
-
return
|
|
45
|
+
return coreEndings.every(tld => validPrice(value.prices?.[tld], otherEndings.includes(tld) ? 'Gandi' : 'Spaceship'));
|
|
40
46
|
}
|
|
41
47
|
return Object.keys(value.catalogs).length > 0 && Object.entries(value.catalogs).every(([id, source]) =>
|
|
42
48
|
[...primaryShops, 'gandi'].includes(id) && validDate(source.checkedAt) && validSource(id, source.prices));
|
|
@@ -233,17 +239,19 @@ export async function loadPorkbunPrices(fetcher = globalThis.fetch) {
|
|
|
233
239
|
const response = await fetcher(porkbunPricing, { ...options, signal });
|
|
234
240
|
const catalog = response.ok ? await response.json() : null;
|
|
235
241
|
if (catalog?.status !== 'SUCCESS' || !catalog.pricing) throw new Error('Porkbun catalog unavailable');
|
|
236
|
-
return Object.fromEntries(
|
|
242
|
+
return Object.fromEntries(supportedEndings.flatMap(tld => {
|
|
237
243
|
const row = catalog.pricing[tld];
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
244
|
+
const price = { shop: 'Porkbun', firstYear: catalogPrice(row?.registration),
|
|
245
|
+
renewal: catalogPrice(row?.renewal), transfer: catalogPrice(row?.transfer) };
|
|
246
|
+
return validPrice(price, 'Porkbun') ? [[tld, price]] : [];
|
|
241
247
|
}));
|
|
242
248
|
}
|
|
243
249
|
try {
|
|
244
250
|
return await Promise.any([
|
|
245
|
-
load({
|
|
246
|
-
delay(350, undefined, { signal }).then(() => load(
|
|
251
|
+
load({ headers: { Accept: 'application/json' } }),
|
|
252
|
+
delay(350, undefined, { signal }).then(() => load({
|
|
253
|
+
method: 'POST', headers: { Accept: 'application/json', 'Content-Type': 'application/json' }, body: '{}',
|
|
254
|
+
})),
|
|
247
255
|
]);
|
|
248
256
|
} finally {
|
|
249
257
|
controller.abort();
|
|
@@ -263,7 +271,7 @@ export function dynadotPrices(html) {
|
|
|
263
271
|
for (const row of values) {
|
|
264
272
|
if (!row || typeof row !== 'object' || Array.isArray(row)) continue;
|
|
265
273
|
const tld = values[row.name];
|
|
266
|
-
if (!
|
|
274
|
+
if (!supportedEndings.includes(tld)) continue;
|
|
267
275
|
const firstYear = usd(values[row.reg_price]);
|
|
268
276
|
const renewal = usd(values[row.renew_price]);
|
|
269
277
|
if (firstYear && renewal) prices[tld] = {
|
|
@@ -271,7 +279,7 @@ export function dynadotPrices(html) {
|
|
|
271
279
|
};
|
|
272
280
|
}
|
|
273
281
|
}
|
|
274
|
-
for (const tld of
|
|
282
|
+
for (const tld of supportedEndings.filter(tld => !prices[tld])) {
|
|
275
283
|
const row = dynadotOffer(html, tld, 'example.' + tld, new Date());
|
|
276
284
|
if (row) prices[tld] = { shop: 'Dynadot', firstYear: row.regularFirstYear,
|
|
277
285
|
renewal: row.renewal, transfer: row.regularTransferPrice };
|