@newly/cli 0.2.205 → 0.2.207
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/dist/commands/domains.js +10 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/commands/domains.js
CHANGED
|
@@ -15,6 +15,15 @@ function makeClient(project) {
|
|
|
15
15
|
appUrl: creds.appUrl,
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
+
const SIGN_IN_SITES = new Set(['https://newly.app', 'https://www.newly.app']);
|
|
19
|
+
export function productWebAppUrl(savedAppUrl, env = process.env) {
|
|
20
|
+
for (const candidate of [env.NEWLY_APP_URL, savedAppUrl]) {
|
|
21
|
+
const url = candidate?.trim().replace(/\/+$/, '');
|
|
22
|
+
if (url && !SIGN_IN_SITES.has(url))
|
|
23
|
+
return url;
|
|
24
|
+
}
|
|
25
|
+
return 'https://app.newly.app';
|
|
26
|
+
}
|
|
18
27
|
export function summarizeDomain(candidate) {
|
|
19
28
|
const name = String(candidate.name ?? candidate.domain ?? candidate.domain_name ?? '(unknown)');
|
|
20
29
|
const state = candidate.registrable === true || candidate.available === true
|
|
@@ -67,7 +76,7 @@ export async function runDomainBuy(client, projectId, domainName, opts, log = co
|
|
|
67
76
|
log('Cancelled.');
|
|
68
77
|
return;
|
|
69
78
|
}
|
|
70
|
-
const appUrl = (opts.appUrl
|
|
79
|
+
const appUrl = productWebAppUrl(opts.appUrl);
|
|
71
80
|
const result = (await client.post(`/projects/${projectId}/domains/registrations/checkout`, {
|
|
72
81
|
domain: domainName,
|
|
73
82
|
years: opts.years,
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = '0.2.
|
|
1
|
+
export const CLI_VERSION = '0.2.207';
|