@acsetra/runner 0.1.7 → 0.1.10
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 +1 -0
- package/bin/runner.js +4 -2
- package/lib/help.js +2 -0
- package/lib/verbs.js +13 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ npm install -g @acsetra/runner
|
|
|
16
16
|
runner app create crm --label "CRM"
|
|
17
17
|
runner set put crm contacts ada --json '{"role":"eng"}'
|
|
18
18
|
runner doctor <workspace>.crm && runner compile <workspace>.crm
|
|
19
|
+
runner auth crm # gate the app behind pen.acsetra.com sign-in
|
|
19
20
|
runner dev <workspace>.crm
|
|
20
21
|
```
|
|
21
22
|
|
package/bin/runner.js
CHANGED
|
@@ -117,7 +117,9 @@ function safeJoin(dest, rel) {
|
|
|
117
117
|
async function dev(rest) {
|
|
118
118
|
const app = rest.find(a => !a.startsWith("-")) || config.defaultScope();
|
|
119
119
|
if (!app) return fail("runner dev: which app? e.g. `runner dev acme.crm`", 2);
|
|
120
|
-
|
|
120
|
+
// Pretty path: the scope's structural public URL (acme.crm -> /acme/crm). The
|
|
121
|
+
// hosted shell resolves it back to the scope; ?scope= still works as a fallback.
|
|
122
|
+
const url = `${config.apiBase()}/${app.replace(/\./g, "/")}`;
|
|
121
123
|
console.log(url);
|
|
122
124
|
if (!rest.includes("--no-browser")) openUrl(url);
|
|
123
125
|
return 0;
|
|
@@ -132,7 +134,7 @@ async function main() {
|
|
|
132
134
|
const argv = process.argv.slice(2);
|
|
133
135
|
if (!argv.length || ["-h", "--help"].includes(argv[0])) { console.log(renderTop()); return 0; }
|
|
134
136
|
const [cmd, ...rest] = argv;
|
|
135
|
-
if (["version", "--version", "-V"].includes(cmd)) { console.log("runner (@acsetra/runner) 0.1.
|
|
137
|
+
if (["version", "--version", "-V"].includes(cmd)) { console.log("runner (@acsetra/runner) 0.1.10"); return 0; }
|
|
136
138
|
|
|
137
139
|
// help — top-level, `help <topic>`, and per-verb `<cmd> … --help` (lexical, before toOp)
|
|
138
140
|
if (cmd === "help") {
|
package/lib/help.js
CHANGED
|
@@ -120,6 +120,7 @@ export const VERBS_DOC = {
|
|
|
120
120
|
checkout: { usage: "checkout <app> [-o dir] [--force]", desc: "materialize a scope subtree as local files in .tmp/ (read-only; grep/edit, write back with the typed verbs)" },
|
|
121
121
|
app: { usage: "app create <name> [--label L] | app list", desc: "create / list app scopes" },
|
|
122
122
|
apps: { usage: "apps", desc: "list app scopes (alias of `app list`)" },
|
|
123
|
+
auth: { usage: "auth <app> [--off] | auth list [scope]", desc: "gate an app behind pen.acsetra.com sign-in — signed-in visitors are enrolled as members on first visit; --off lifts the gate (no secrets, reuses the main-site realm)" },
|
|
123
124
|
ls: { usage: "ls [-S scope]", desc: "list value sets" },
|
|
124
125
|
inspect: { usage: "inspect [<set>] [-S scope]", desc: "read a set's rows (alias: i); no set => list" },
|
|
125
126
|
read: { usage: "read <code> [-S scope]", desc: "read a value set (me_* = your own per-user zone)" },
|
|
@@ -250,6 +251,7 @@ export function renderTop() {
|
|
|
250
251
|
"");
|
|
251
252
|
out.push("Authoring (planes — run `r <group> --help` for subcommands)",
|
|
252
253
|
" r app create <name> ; r apps",
|
|
254
|
+
" r auth <app> require pen.acsetra.com sign-in to use an app",
|
|
253
255
|
" r set | css | asset | behavior | component | head <subverb> …",
|
|
254
256
|
" r pipe <code> -S <scope> -w c:l ; r w <code> <tier> …",
|
|
255
257
|
" r ls | inspect <set> | read <code> | show <pipe>",
|
package/lib/verbs.js
CHANGED
|
@@ -157,6 +157,19 @@ export function toOp(verb, rest) {
|
|
|
157
157
|
throw new VerbError("usage: runner app create <name> [--label L] | runner app list");
|
|
158
158
|
}
|
|
159
159
|
if (verb === "apps") return ["app.list", {}];
|
|
160
|
+
if (verb === "auth") {
|
|
161
|
+
// Hosted "auth block": gate an app behind pen.acsetra.com sign-in. No secrets —
|
|
162
|
+
// the server reuses its own Keycloak realm; `--off` lifts the gate.
|
|
163
|
+
// runner auth <app> [--off] | runner auth list [scope]
|
|
164
|
+
if (rest[0] === "list" || rest[0] === "ls") {
|
|
165
|
+
const scopes = rest.slice(1).filter(a => !a.startsWith("-"));
|
|
166
|
+
return ["auth.list", scopes.length ? { scope: scopes[0] } : {}];
|
|
167
|
+
}
|
|
168
|
+
const off = rest.includes("--off") || rest.includes("--disable");
|
|
169
|
+
const pos = rest.filter(a => !a.startsWith("-"));
|
|
170
|
+
if (!pos.length) throw new VerbError("usage: runner auth <app> [--off] | runner auth list");
|
|
171
|
+
return ["app.set_auth", { scope: pos[0], enabled: !off }];
|
|
172
|
+
}
|
|
160
173
|
if (PLANES.has(verb)) {
|
|
161
174
|
if (!rest.length) throw new VerbError(`usage: runner ${verb} <subverb> …`);
|
|
162
175
|
let sub = rest[0].replace(/-/g, "_");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acsetra/runner",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Runner CLI — author and run hosted Runner apps from your terminal (the `runner` command).",
|
|
5
5
|
"keywords": ["runner", "acsetra", "cli", "agent", "low-code"],
|
|
6
6
|
"license": "MIT",
|