doomain 0.1.3 → 0.1.4
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/wizard.js +4 -10
- package/oclif.manifest.json +36 -36
- package/package.json +1 -1
package/dist/commands/wizard.js
CHANGED
|
@@ -12,7 +12,6 @@ import { listGlobalVercelTokens } from '../lib/vercel-auth.js';
|
|
|
12
12
|
import { createVercelClient } from '../lib/vercel.js';
|
|
13
13
|
const PERSONAL_ACCOUNT = '__personal__';
|
|
14
14
|
const NEW_TOKEN = '__new_token__';
|
|
15
|
-
const SAVED_TOKEN = '__saved_token__';
|
|
16
15
|
function cancelIfNeeded(value) {
|
|
17
16
|
if (p.isCancel(value)) {
|
|
18
17
|
p.cancel('Cancelled');
|
|
@@ -111,23 +110,18 @@ function teamLabel(team) {
|
|
|
111
110
|
function globalTokenLabel(token) {
|
|
112
111
|
return token.source === 'environment' ? `Use ${token.label}` : `Use ${token.label} token`;
|
|
113
112
|
}
|
|
114
|
-
async function promptVercelToken(globalTokens
|
|
113
|
+
async function promptVercelToken(globalTokens) {
|
|
115
114
|
if (globalTokens.length > 0) {
|
|
116
115
|
const selected = await p.select({
|
|
117
116
|
message: 'Vercel token',
|
|
118
117
|
options: [
|
|
119
118
|
...globalTokens.map((token, index) => ({ label: globalTokenLabel(token), value: String(index), hint: maskSecret(token.token) })),
|
|
120
|
-
...(savedToken && !globalTokens.some((token) => token.token === savedToken)
|
|
121
|
-
? [{ label: 'Use saved Doomain token', value: SAVED_TOKEN, hint: maskSecret(savedToken) }]
|
|
122
|
-
: []),
|
|
123
119
|
{ label: 'Enter a new token', value: NEW_TOKEN },
|
|
124
120
|
],
|
|
125
121
|
});
|
|
126
122
|
const resolved = cancelIfNeeded(selected);
|
|
127
123
|
if (resolved === null)
|
|
128
124
|
return null;
|
|
129
|
-
if (resolved === SAVED_TOKEN)
|
|
130
|
-
return savedToken ?? null;
|
|
131
125
|
if (resolved !== NEW_TOKEN)
|
|
132
126
|
return globalTokens[Number(resolved)]?.token ?? null;
|
|
133
127
|
}
|
|
@@ -156,13 +150,13 @@ export default class Wizard extends Command {
|
|
|
156
150
|
const config = await loadConfig();
|
|
157
151
|
const providerDefinitions = listProviderDefinitions();
|
|
158
152
|
const localProject = detectLocalVercelProject();
|
|
159
|
-
const globalVercelTokens = await listGlobalVercelTokens();
|
|
160
153
|
let vercelToken = config.vercel?.token;
|
|
161
154
|
let vercelTeamId = process.env.VERCEL_TEAM_ID || localProject?.orgId || config.vercel?.teamId;
|
|
162
155
|
const defaultProvider = process.env.DOOMAIN_PROVIDER || config.defaults?.provider;
|
|
163
156
|
const defaultDomain = process.env.DOOMAIN_DOMAIN || config.defaults?.domain;
|
|
164
|
-
if (
|
|
165
|
-
|
|
157
|
+
if (!vercelToken) {
|
|
158
|
+
const globalVercelTokens = await listGlobalVercelTokens();
|
|
159
|
+
vercelToken = (await promptVercelToken(globalVercelTokens)) ?? undefined;
|
|
166
160
|
if (!vercelToken)
|
|
167
161
|
return;
|
|
168
162
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -300,41 +300,6 @@
|
|
|
300
300
|
"list.js"
|
|
301
301
|
]
|
|
302
302
|
},
|
|
303
|
-
"projects:list": {
|
|
304
|
-
"aliases": [],
|
|
305
|
-
"args": {},
|
|
306
|
-
"description": "List Vercel projects.",
|
|
307
|
-
"flags": {
|
|
308
|
-
"json": {
|
|
309
|
-
"description": "Output a single JSON object and never prompt.",
|
|
310
|
-
"name": "json",
|
|
311
|
-
"allowNo": false,
|
|
312
|
-
"type": "boolean"
|
|
313
|
-
},
|
|
314
|
-
"search": {
|
|
315
|
-
"description": "Filter projects by search term.",
|
|
316
|
-
"name": "search",
|
|
317
|
-
"hasDynamicHelp": false,
|
|
318
|
-
"multiple": false,
|
|
319
|
-
"type": "option"
|
|
320
|
-
}
|
|
321
|
-
},
|
|
322
|
-
"hasDynamicHelp": false,
|
|
323
|
-
"hiddenAliases": [],
|
|
324
|
-
"id": "projects:list",
|
|
325
|
-
"pluginAlias": "doomain",
|
|
326
|
-
"pluginName": "doomain",
|
|
327
|
-
"pluginType": "core",
|
|
328
|
-
"strict": true,
|
|
329
|
-
"enableJsonFlag": false,
|
|
330
|
-
"isESM": true,
|
|
331
|
-
"relativePath": [
|
|
332
|
-
"dist",
|
|
333
|
-
"commands",
|
|
334
|
-
"projects",
|
|
335
|
-
"list.js"
|
|
336
|
-
]
|
|
337
|
-
},
|
|
338
303
|
"providers:add": {
|
|
339
304
|
"aliases": [],
|
|
340
305
|
"args": {
|
|
@@ -595,6 +560,41 @@
|
|
|
595
560
|
"verify.js"
|
|
596
561
|
]
|
|
597
562
|
},
|
|
563
|
+
"projects:list": {
|
|
564
|
+
"aliases": [],
|
|
565
|
+
"args": {},
|
|
566
|
+
"description": "List Vercel projects.",
|
|
567
|
+
"flags": {
|
|
568
|
+
"json": {
|
|
569
|
+
"description": "Output a single JSON object and never prompt.",
|
|
570
|
+
"name": "json",
|
|
571
|
+
"allowNo": false,
|
|
572
|
+
"type": "boolean"
|
|
573
|
+
},
|
|
574
|
+
"search": {
|
|
575
|
+
"description": "Filter projects by search term.",
|
|
576
|
+
"name": "search",
|
|
577
|
+
"hasDynamicHelp": false,
|
|
578
|
+
"multiple": false,
|
|
579
|
+
"type": "option"
|
|
580
|
+
}
|
|
581
|
+
},
|
|
582
|
+
"hasDynamicHelp": false,
|
|
583
|
+
"hiddenAliases": [],
|
|
584
|
+
"id": "projects:list",
|
|
585
|
+
"pluginAlias": "doomain",
|
|
586
|
+
"pluginName": "doomain",
|
|
587
|
+
"pluginType": "core",
|
|
588
|
+
"strict": true,
|
|
589
|
+
"enableJsonFlag": false,
|
|
590
|
+
"isESM": true,
|
|
591
|
+
"relativePath": [
|
|
592
|
+
"dist",
|
|
593
|
+
"commands",
|
|
594
|
+
"projects",
|
|
595
|
+
"list.js"
|
|
596
|
+
]
|
|
597
|
+
},
|
|
598
598
|
"auth:logout:vercel": {
|
|
599
599
|
"aliases": [],
|
|
600
600
|
"args": {},
|
|
@@ -629,5 +629,5 @@
|
|
|
629
629
|
]
|
|
630
630
|
}
|
|
631
631
|
},
|
|
632
|
-
"version": "0.1.
|
|
632
|
+
"version": "0.1.4"
|
|
633
633
|
}
|