doomain 0.1.14 → 0.1.15
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/link.js +15 -5
- package/dist/lib/command-schema.js +66 -3
- package/dist/lib/link-domain.js +2 -1
- package/oclif.manifest.json +36 -36
- package/package.json +1 -1
package/dist/commands/link.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Args, Command, Flags } from '@oclif/core';
|
|
2
2
|
import * as p from '@clack/prompts';
|
|
3
|
-
import { DoomainError } from '../lib/errors.js';
|
|
4
3
|
import { accountFlag, apexFlag, domainFlag, jsonFlag, projectFlag, providerFlag, subdomainFlag } from '../lib/flags.js';
|
|
5
4
|
import { linkDomain } from '../lib/link-domain.js';
|
|
6
5
|
import { createOutput, outputError } from '../lib/output.js';
|
|
@@ -27,6 +26,18 @@ function dnsOverrideNote(warning) {
|
|
|
27
26
|
...warning.desired.map((record) => `- ${recordLine(record)}`),
|
|
28
27
|
].join('\n');
|
|
29
28
|
}
|
|
29
|
+
function providerAccount(result) {
|
|
30
|
+
return result.isDefaultAccount ? result.provider : `${result.provider}/${result.account}`;
|
|
31
|
+
}
|
|
32
|
+
function dryRunPreview(result) {
|
|
33
|
+
const account = providerAccount(result);
|
|
34
|
+
return [
|
|
35
|
+
`Vercel: add ${result.domain} to ${result.project}`,
|
|
36
|
+
`DNS provider: ${account} (${result.zoneDomain})`,
|
|
37
|
+
...result.records.map((record) => `DNS: ${recordLine(record)} in ${account}`),
|
|
38
|
+
`Actions: ${result.actions.join(', ')}`,
|
|
39
|
+
].join('\n');
|
|
40
|
+
}
|
|
30
41
|
export default class Link extends Command {
|
|
31
42
|
static description = 'Link a Vercel project to a domain and create DNS records.';
|
|
32
43
|
static examples = [
|
|
@@ -59,14 +70,13 @@ export default class Link extends Command {
|
|
|
59
70
|
let spinner;
|
|
60
71
|
const domain = flags.domain ?? args.domain;
|
|
61
72
|
try {
|
|
62
|
-
if (!domain) {
|
|
63
|
-
throw new DoomainError('MISSING_ARGUMENT', 'Domain is required. Use `doomain link <domain>` or pass --domain.');
|
|
64
|
-
}
|
|
65
73
|
if (flags['dry-run']) {
|
|
66
74
|
const result = await linkDomain({ ...flags, domain, dryRun: true, timeoutSeconds: flags.timeout });
|
|
67
75
|
out.result(result);
|
|
68
|
-
if (!out.json)
|
|
76
|
+
if (!out.json) {
|
|
77
|
+
p.note(dryRunPreview(result), 'Dry run');
|
|
69
78
|
out.success(`Dry run ready for ${result.domain}.`);
|
|
79
|
+
}
|
|
70
80
|
return;
|
|
71
81
|
}
|
|
72
82
|
out.intro('Doomain');
|
|
@@ -8,6 +8,7 @@ export const commandSchemas = [
|
|
|
8
8
|
'doomain link app.example.com --project my-app --json',
|
|
9
9
|
'doomain link --domain app.example.com --project my-app --json',
|
|
10
10
|
'doomain link --domain example.com --subdomain app --project my-app --json',
|
|
11
|
+
'doomain link --project my-app --json',
|
|
11
12
|
'doomain link --provider spaceship --domain example.com --apex --project my-app --dry-run --json',
|
|
12
13
|
'doomain link app.example.com --provider spaceship --account work --project my-app --json',
|
|
13
14
|
],
|
|
@@ -27,16 +28,42 @@ export const commandSchemas = [
|
|
|
27
28
|
{ name: 'json', type: 'boolean', description: 'Output a single JSON object and never prompt.' },
|
|
28
29
|
{ name: 'provider', type: 'string', description: 'DNS provider id. Inferred from the target domain when omitted.' },
|
|
29
30
|
{ name: 'account', type: 'string', description: 'DNS provider profile/account alias. Defaults to the provider default account.' },
|
|
30
|
-
{
|
|
31
|
+
{
|
|
32
|
+
name: 'domain',
|
|
33
|
+
type: 'string',
|
|
34
|
+
description: 'Target domain or base zone, for example app.example.com or example.com. Optional when DOOMAIN_DOMAIN or a default domain is configured.',
|
|
35
|
+
},
|
|
31
36
|
{ name: 'subdomain', type: 'string', description: 'Subdomain to add.' },
|
|
32
37
|
{ name: 'apex', type: 'boolean', description: 'Use the root/apex domain.' },
|
|
33
38
|
{ name: 'project', type: 'string', description: 'Vercel project id/name. Optional when project inference succeeds.' },
|
|
34
39
|
{ name: 'dry-run', type: 'boolean', description: 'Preview changes without writing. Intended for human previews; agents should not use this unless explicitly asked.' },
|
|
35
|
-
{
|
|
36
|
-
|
|
40
|
+
{
|
|
41
|
+
name: 'force',
|
|
42
|
+
type: 'boolean',
|
|
43
|
+
description: 'Move existing Vercel project domains and overwrite conflicting DNS records. Interactive DNS override confirmation does not move Vercel aliases; pass --force for that.',
|
|
44
|
+
},
|
|
45
|
+
{ name: 'wait', type: 'boolean', description: 'Wait for DNS and Vercel verification. Use --no-wait to skip waiting.', default: true },
|
|
37
46
|
{ name: 'timeout', type: 'integer', description: 'Wait timeout in seconds.', default: 300 },
|
|
38
47
|
],
|
|
39
48
|
},
|
|
49
|
+
{
|
|
50
|
+
name: 'schema',
|
|
51
|
+
description: 'Print machine-readable command schemas for agents.',
|
|
52
|
+
examples: ['doomain schema --json', 'doomain schema link --json'],
|
|
53
|
+
safeForAgents: true,
|
|
54
|
+
flags: [
|
|
55
|
+
{ name: 'json', type: 'boolean', description: 'Output a single JSON object and never prompt.' },
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'providers list',
|
|
60
|
+
description: 'List supported DNS providers.',
|
|
61
|
+
examples: ['doomain providers list --json'],
|
|
62
|
+
safeForAgents: true,
|
|
63
|
+
flags: [
|
|
64
|
+
{ name: 'json', type: 'boolean', description: 'Output a single JSON object and never prompt.' },
|
|
65
|
+
],
|
|
66
|
+
},
|
|
40
67
|
{
|
|
41
68
|
name: 'providers connect',
|
|
42
69
|
description: 'Save DNS provider credentials locally after verifying them. Prompts for a provider when omitted.',
|
|
@@ -123,6 +150,42 @@ export const commandSchemas = [
|
|
|
123
150
|
{ name: 'json', type: 'boolean', description: 'Output a single JSON object and never prompt.' },
|
|
124
151
|
],
|
|
125
152
|
},
|
|
153
|
+
{
|
|
154
|
+
name: 'domains list',
|
|
155
|
+
description: 'List DNS zones and records for a provider.',
|
|
156
|
+
examples: ['doomain domains list --json', 'doomain domains list --provider cloudflare --domain example.com --json'],
|
|
157
|
+
safeForAgents: true,
|
|
158
|
+
flags: [
|
|
159
|
+
{ name: 'json', type: 'boolean', description: 'Output a single JSON object and never prompt.' },
|
|
160
|
+
{ name: 'provider', type: 'string', description: 'DNS provider id. Defaults to DOOMAIN_PROVIDER, configured default provider, then spaceship.' },
|
|
161
|
+
{ name: 'account', type: 'string', description: 'DNS provider profile/account alias. Omit to list all configured accounts for the provider.' },
|
|
162
|
+
{ name: 'domain', type: 'string', description: 'Limit output to one DNS zone.' },
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: 'projects list',
|
|
167
|
+
description: 'List Vercel projects.',
|
|
168
|
+
examples: ['doomain projects list --json', 'doomain projects list --search my-app --json'],
|
|
169
|
+
safeForAgents: true,
|
|
170
|
+
flags: [
|
|
171
|
+
{ name: 'json', type: 'boolean', description: 'Output a single JSON object and never prompt.' },
|
|
172
|
+
{ name: 'search', type: 'string', description: 'Filter projects by search term.' },
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: 'verify',
|
|
177
|
+
description: 'Ask Vercel to verify a project domain.',
|
|
178
|
+
examples: ['doomain verify --domain app.example.com --project my-app --json', 'doomain verify --domain example.com --apex --project my-app --json'],
|
|
179
|
+
mutates: true,
|
|
180
|
+
safeForAgents: true,
|
|
181
|
+
flags: [
|
|
182
|
+
{ name: 'json', type: 'boolean', description: 'Output a single JSON object and never prompt.' },
|
|
183
|
+
{ name: 'domain', type: 'string', description: 'Target domain or base zone, for example app.example.com or example.com.', required: true },
|
|
184
|
+
{ name: 'subdomain', type: 'string', description: 'Subdomain to verify.' },
|
|
185
|
+
{ name: 'apex', type: 'boolean', description: 'Use the root/apex domain.' },
|
|
186
|
+
{ name: 'project', type: 'string', description: 'Vercel project id/name. Optional when local .vercel/project.json is available.' },
|
|
187
|
+
],
|
|
188
|
+
},
|
|
126
189
|
];
|
|
127
190
|
export function getCommandSchema(name) {
|
|
128
191
|
if (!name)
|
package/dist/lib/link-domain.js
CHANGED
|
@@ -495,8 +495,9 @@ async function resolveDnsForce(input, opts) {
|
|
|
495
495
|
return true;
|
|
496
496
|
}
|
|
497
497
|
export async function createLinkPlan(input) {
|
|
498
|
+
const domain = await resolveConfiguredDomain(input.domain);
|
|
498
499
|
const project = await resolveProject(input.project);
|
|
499
|
-
const resolved = await resolveProviderTarget(input);
|
|
500
|
+
const resolved = await resolveProviderTarget({ ...input, domain });
|
|
500
501
|
const { account, accountInferred, isDefaultAccount, provider, providerInferred, target } = resolved;
|
|
501
502
|
const record = planBaseRecord({ isApex: target.isApex, provider, recordName: target.recordName });
|
|
502
503
|
return {
|
package/oclif.manifest.json
CHANGED
|
@@ -316,6 +316,41 @@
|
|
|
316
316
|
"list.js"
|
|
317
317
|
]
|
|
318
318
|
},
|
|
319
|
+
"projects:list": {
|
|
320
|
+
"aliases": [],
|
|
321
|
+
"args": {},
|
|
322
|
+
"description": "List Vercel projects.",
|
|
323
|
+
"flags": {
|
|
324
|
+
"json": {
|
|
325
|
+
"description": "Output a single JSON object and never prompt.",
|
|
326
|
+
"name": "json",
|
|
327
|
+
"allowNo": false,
|
|
328
|
+
"type": "boolean"
|
|
329
|
+
},
|
|
330
|
+
"search": {
|
|
331
|
+
"description": "Filter projects by search term.",
|
|
332
|
+
"name": "search",
|
|
333
|
+
"hasDynamicHelp": false,
|
|
334
|
+
"multiple": false,
|
|
335
|
+
"type": "option"
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
"hasDynamicHelp": false,
|
|
339
|
+
"hiddenAliases": [],
|
|
340
|
+
"id": "projects:list",
|
|
341
|
+
"pluginAlias": "doomain",
|
|
342
|
+
"pluginName": "doomain",
|
|
343
|
+
"pluginType": "core",
|
|
344
|
+
"strict": true,
|
|
345
|
+
"enableJsonFlag": false,
|
|
346
|
+
"isESM": true,
|
|
347
|
+
"relativePath": [
|
|
348
|
+
"dist",
|
|
349
|
+
"commands",
|
|
350
|
+
"projects",
|
|
351
|
+
"list.js"
|
|
352
|
+
]
|
|
353
|
+
},
|
|
319
354
|
"providers:add": {
|
|
320
355
|
"aliases": [],
|
|
321
356
|
"args": {
|
|
@@ -604,41 +639,6 @@
|
|
|
604
639
|
"verify.js"
|
|
605
640
|
]
|
|
606
641
|
},
|
|
607
|
-
"projects:list": {
|
|
608
|
-
"aliases": [],
|
|
609
|
-
"args": {},
|
|
610
|
-
"description": "List Vercel projects.",
|
|
611
|
-
"flags": {
|
|
612
|
-
"json": {
|
|
613
|
-
"description": "Output a single JSON object and never prompt.",
|
|
614
|
-
"name": "json",
|
|
615
|
-
"allowNo": false,
|
|
616
|
-
"type": "boolean"
|
|
617
|
-
},
|
|
618
|
-
"search": {
|
|
619
|
-
"description": "Filter projects by search term.",
|
|
620
|
-
"name": "search",
|
|
621
|
-
"hasDynamicHelp": false,
|
|
622
|
-
"multiple": false,
|
|
623
|
-
"type": "option"
|
|
624
|
-
}
|
|
625
|
-
},
|
|
626
|
-
"hasDynamicHelp": false,
|
|
627
|
-
"hiddenAliases": [],
|
|
628
|
-
"id": "projects:list",
|
|
629
|
-
"pluginAlias": "doomain",
|
|
630
|
-
"pluginName": "doomain",
|
|
631
|
-
"pluginType": "core",
|
|
632
|
-
"strict": true,
|
|
633
|
-
"enableJsonFlag": false,
|
|
634
|
-
"isESM": true,
|
|
635
|
-
"relativePath": [
|
|
636
|
-
"dist",
|
|
637
|
-
"commands",
|
|
638
|
-
"projects",
|
|
639
|
-
"list.js"
|
|
640
|
-
]
|
|
641
|
-
},
|
|
642
642
|
"auth:logout:vercel": {
|
|
643
643
|
"aliases": [],
|
|
644
644
|
"args": {},
|
|
@@ -673,5 +673,5 @@
|
|
|
673
673
|
]
|
|
674
674
|
}
|
|
675
675
|
},
|
|
676
|
-
"version": "0.1.
|
|
676
|
+
"version": "0.1.15"
|
|
677
677
|
}
|