wawesome 0.11.0 → 0.12.0
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/README.md +4 -1
- package/dist/index.mjs +15 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -314,11 +314,14 @@ you say otherwise:
|
|
|
314
314
|
```bash
|
|
315
315
|
# reads logs and cannot deploy, restricted to one App, never expires
|
|
316
316
|
npx wawesome credentials mint agent -c logs:read -a prod --expires never
|
|
317
|
+
|
|
318
|
+
# ships code and attaches the domain the project declares
|
|
319
|
+
npx wawesome credentials mint ci -c deploy,domains:attach -a prod
|
|
317
320
|
```
|
|
318
321
|
|
|
319
322
|
| Flag | Meaning |
|
|
320
323
|
|:---------------------|:------------------------------------------------------------------------------|
|
|
321
|
-
| `-c, --capability` | `deploy`, `logs:read`, or
|
|
324
|
+
| `-c, --capability` | `deploy`, `logs:read`, `domains:attach`, or any mix. Repeatable or comma-separated. Default `deploy` |
|
|
322
325
|
| `-a, --app` | Restrict to these Apps, by slug. Repeatable. Default: every App in the workspace |
|
|
323
326
|
| `--expires` | Days, or `never`. Default: 90 |
|
|
324
327
|
|
package/dist/index.mjs
CHANGED
|
@@ -883,7 +883,7 @@ async function buildJs(entryInput, options) {
|
|
|
883
883
|
* that has to name this version — `--version`, the dependency a scaffolded
|
|
884
884
|
* project pins — reads it here, so a release bumps one file.
|
|
885
885
|
*/
|
|
886
|
-
const CLI_VERSION = "0.
|
|
886
|
+
const CLI_VERSION = "0.12.0";
|
|
887
887
|
//#endregion
|
|
888
888
|
//#region src/prompt.ts
|
|
889
889
|
/**
|
|
@@ -1685,11 +1685,16 @@ function domainsUrl(creds, app) {
|
|
|
1685
1685
|
* added a day apart: the TXT issues the certificate, and the CNAME is pointed
|
|
1686
1686
|
* here afterwards so a site that is already live never answers on a
|
|
1687
1687
|
* certificate that is not there yet.
|
|
1688
|
+
*
|
|
1689
|
+
* Read off the records too, never the states alone: naming a record the payload
|
|
1690
|
+
* does not carry left a reader holding the CNAME alone (#610).
|
|
1688
1691
|
*/
|
|
1689
|
-
function whereItGotTo(
|
|
1692
|
+
function whereItGotTo(domain) {
|
|
1693
|
+
const { state } = domain;
|
|
1690
1694
|
if (state.serving) return "serving";
|
|
1691
1695
|
if (state.certificate_active) return "certificate issued, so point the CNAME here to cut over";
|
|
1692
1696
|
if (state.ownership_verified) return "ownership verified, and the certificate is being issued";
|
|
1697
|
+
if (domain.certificate_record_pending) return "not verified yet, and the TXT record is not ready";
|
|
1693
1698
|
return "not verified yet, so add the TXT record below";
|
|
1694
1699
|
}
|
|
1695
1700
|
function whatItIsFor(record) {
|
|
@@ -1725,7 +1730,7 @@ function domainLines(outcome) {
|
|
|
1725
1730
|
...outcome.held ? [`${VALUE_COLUMN}Nothing was detached. Take '${outcome.held}' off first with`, `${VALUE_COLUMN} \x1b[36mwawesome domains detach ${outcome.held}\x1b[0m`] : [],
|
|
1726
1731
|
`${VALUE_COLUMN}The deploy landed, and this App's other address still answers.`
|
|
1727
1732
|
];
|
|
1728
|
-
const { hostname, records, state, last_checked_at, detaching } = outcome.domain;
|
|
1733
|
+
const { hostname, records, state, last_checked_at, detaching, certificate_record_pending } = outcome.domain;
|
|
1729
1734
|
if (detaching) return [
|
|
1730
1735
|
"",
|
|
1731
1736
|
` Domain: \x1b[33m${hostname}: being detached\x1b[0m`,
|
|
@@ -1733,7 +1738,7 @@ function domainLines(outcome) {
|
|
|
1733
1738
|
`${VALUE_COLUMN}Remove 'domain' from wawesome-function.json, or deploy again`,
|
|
1734
1739
|
`${VALUE_COLUMN}once it is gone to attach it afresh.`
|
|
1735
1740
|
];
|
|
1736
|
-
const lines = ["", ` Domain: \x1b[36m${hostname}\x1b[0m: ${whereItGotTo(
|
|
1741
|
+
const lines = ["", ` Domain: \x1b[36m${hostname}\x1b[0m: ${whereItGotTo(outcome.domain)}`];
|
|
1737
1742
|
if (state.serving) {
|
|
1738
1743
|
lines.push(`${VALUE_COLUMN}The address above answers too, so nothing pointed at it breaks.`);
|
|
1739
1744
|
return lines;
|
|
@@ -1742,7 +1747,9 @@ function domainLines(outcome) {
|
|
|
1742
1747
|
const nameWidth = Math.max(...records.map((record) => record.name.length));
|
|
1743
1748
|
lines.push("", " DNS records to add at your registrar:");
|
|
1744
1749
|
for (const record of records) lines.push("", ` ${whatItIsFor(record)}:`, ` ${record.type.padEnd(5)} ${record.name.padEnd(nameWidth)} ${record.value}`);
|
|
1745
|
-
lines.push(""
|
|
1750
|
+
lines.push("");
|
|
1751
|
+
if (certificate_record_pending) lines.push(`${VALUE_COLUMN}The TXT record that proves you own the name is not ready`, `${VALUE_COLUMN}yet. Deploy again in a minute and it prints here. The`, `${VALUE_COLUMN}deploy is finished either way.`);
|
|
1752
|
+
else lines.push(`${VALUE_COLUMN}The deploy is finished. This domain comes up on its own`, `${VALUE_COLUMN}once the records resolve.`);
|
|
1746
1753
|
return lines;
|
|
1747
1754
|
}
|
|
1748
1755
|
/** The platform's own prose, kept inside the block it is printed in. */
|
|
@@ -5315,10 +5322,11 @@ cli.command("credentials [action] [target]", "Mint, list and revoke deploy crede
|
|
|
5315
5322
|
wawesome credentials mint ci-pipeline
|
|
5316
5323
|
wawesome credentials mint agent -c logs:read --expires never
|
|
5317
5324
|
wawesome credentials mint prod-deploy -c deploy -a prod --expires 30
|
|
5325
|
+
wawesome credentials mint ci -c deploy,domains:attach -a prod
|
|
5318
5326
|
wawesome credentials mint ci-pipeline > /tmp/secret
|
|
5319
5327
|
wawesome credentials revoke ci-pipeline
|
|
5320
|
-
wawesome credentials revoke wawe_ab3k9x --yes`).option("-c, --capability <capability>", "Capability to grant: deploy, logs:read (repeatable or comma-separated, default: deploy)").option("-a, --app <app>", "Restrict the credential to this App (repeatable or comma-separated, default: every App)").option("--expires <days|never>", "Days until the credential expires, or 'never' (default: 90)").option("-y, --yes", "Skip the revoke confirmation").option("-v, --verbose", "Enable verbose debug output").action((action, target, options) => credentialsCommand(action, target, options));
|
|
5321
|
-
cli.command("credentials mint <name>", "Mint a deploy credential, printing its secret exactly once").option("-c, --capability <capability>", "Capability to grant: deploy, logs:read (repeatable or comma-separated)").option("-a, --app <app>", "Restrict the credential to this App (repeatable or comma-separated)").option("--expires <days|never>", "Days until the credential expires, or 'never' (default: 90)").option("-v, --verbose", "Enable verbose debug output").action((name, options) => mintCredentialCommand(name, options));
|
|
5328
|
+
wawesome credentials revoke wawe_ab3k9x --yes`).option("-c, --capability <capability>", "Capability to grant: deploy, logs:read, domains:attach (repeatable or comma-separated, default: deploy)").option("-a, --app <app>", "Restrict the credential to this App (repeatable or comma-separated, default: every App)").option("--expires <days|never>", "Days until the credential expires, or 'never' (default: 90)").option("-y, --yes", "Skip the revoke confirmation").option("-v, --verbose", "Enable verbose debug output").action((action, target, options) => credentialsCommand(action, target, options));
|
|
5329
|
+
cli.command("credentials mint <name>", "Mint a deploy credential, printing its secret exactly once").option("-c, --capability <capability>", "Capability to grant: deploy, logs:read, domains:attach (repeatable or comma-separated)").option("-a, --app <app>", "Restrict the credential to this App (repeatable or comma-separated)").option("--expires <days|never>", "Days until the credential expires, or 'never' (default: 90)").option("-v, --verbose", "Enable verbose debug output").action((name, options) => mintCredentialCommand(name, options));
|
|
5322
5330
|
cli.command("credentials list", "List deploy credentials, never their secrets").alias("credentials ls").option("-v, --verbose", "Enable verbose debug output").action((options) => listCredentialsCommand(options));
|
|
5323
5331
|
cli.command("credentials revoke <name-or-prefix>", "Revoke a deploy credential, immediately and for good").option("-y, --yes", "Revoke without being asked to confirm").option("-v, --verbose", "Enable verbose debug output").action((target, options) => revokeCredentialCommand(target, options));
|
|
5324
5332
|
cli.command("init", "Scaffold a new function project in the current directory").usage("init [options]\n\nWith --template, the project is fetched from the template catalog, wired up\nfrom what the template declares it needs, and deployed. Run 'wawesome templates'\nto see what is available.").example("wawesome init").example("wawesome init --template stripe-webhook").option("-t, --template <name>", "Scaffold from a catalog template and deploy it").option("--api <url>", "API URL (default: https://api.wawesome.io)").option("--dashboard <url>", "Dashboard URL (default: https://dashboard.wawesome.io)").option("--no-install", "Skip installing dependencies after scaffolding").option("--root", "Generate a root function router template").option("-v, --verbose", "Enable verbose debug output").action((options) => init(options));
|