@canner-ca/cli 0.5.3 → 0.5.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/package.json +1 -1
- package/src/cli.mjs +7 -6
package/package.json
CHANGED
package/src/cli.mjs
CHANGED
|
@@ -28,7 +28,7 @@ import { randomUUID } from 'node:crypto';
|
|
|
28
28
|
import { stdin as input, stdout as output } from 'node:process';
|
|
29
29
|
import { create as tarCreate } from 'tar';
|
|
30
30
|
|
|
31
|
-
const VERSION = '0.5.
|
|
31
|
+
const VERSION = '0.5.4';
|
|
32
32
|
const DEFAULT_API_BASE = 'https://api.canner.ca';
|
|
33
33
|
const CONFIG_DIR = join(homedir(), '.canner');
|
|
34
34
|
const CREDENTIALS_PATH = join(CONFIG_DIR, 'credentials');
|
|
@@ -692,7 +692,7 @@ async function resolveTokenId(creds, ref) {
|
|
|
692
692
|
// ---------------------------------------------------------------------------
|
|
693
693
|
// canner env [--reveal] [--slug X] — list env vars
|
|
694
694
|
// (sensitive values redacted by default, in text AND --json; --reveal opts out)
|
|
695
|
-
// canner env set KEY=VALUE [--env production|preview] [--sensitive] [--slug X]
|
|
695
|
+
// canner env set KEY=VALUE [--env production|preview|runtime] [--sensitive] [--slug X]
|
|
696
696
|
// canner env rm <KEY|id> [--env ...] [--slug X] — delete an env var
|
|
697
697
|
// ---------------------------------------------------------------------------
|
|
698
698
|
async function cmdEnv(args) {
|
|
@@ -760,10 +760,11 @@ async function cmdEnv(args) {
|
|
|
760
760
|
die(`unknown env subcommand "${sub}". Use: list | set | rm.`, 2);
|
|
761
761
|
}
|
|
762
762
|
|
|
763
|
-
// Map a --env flag to the API's environment field. Accepts production/preview
|
|
763
|
+
// Map a --env flag to the API's environment field. Accepts production / preview / runtime
|
|
764
|
+
// (runtime = the running app on production deploys only: never builds, the release command or previews);
|
|
764
765
|
// anything else (or absent) means "all environments" (null).
|
|
765
766
|
function normalizeEnvScope(flag) {
|
|
766
|
-
if (flag === 'production' || flag === 'preview') return flag;
|
|
767
|
+
if (flag === 'production' || flag === 'preview' || flag === 'runtime') return flag;
|
|
767
768
|
return null;
|
|
768
769
|
}
|
|
769
770
|
|
|
@@ -2075,9 +2076,9 @@ async function cmdDb(args) {
|
|
|
2075
2076
|
|
|
2076
2077
|
if (sub === 'least-privilege') {
|
|
2077
2078
|
// One step to the usual safe arrangement: the app logs in as a limited role, the owner (which can change the schema) is
|
|
2078
|
-
// given to the
|
|
2079
|
+
// given to the release command only, as DATABASE_URL_MIGRATE, and every migration ledger stays read-only for the app's role.
|
|
2079
2080
|
const label = args._[1] ?? 'primary';
|
|
2080
|
-
requireYes(args, 'The app will run as a limited role (it can read and write data but cannot change the schema) from its next deploy, and the database owner will be given to the
|
|
2081
|
+
requireYes(args, 'The app will run as a limited role (it can read and write data but cannot change the schema) from its next deploy, and the database owner will be given to the release command only, as DATABASE_URL_MIGRATE: run your migrations there.');
|
|
2081
2082
|
const r = await apiJSON(creds, 'POST', `${base}/databases/${encodeURIComponent(label)}/least-privilege`, {
|
|
2082
2083
|
confirm: true,
|
|
2083
2084
|
...(typeof args.label === 'string' ? { label: args.label } : {}),
|