@wervt/cli 0.2.13 → 0.2.14
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/index.mjs +14 -3
- package/package.json +1 -1
- package/skill/SKILL.md +1 -0
package/dist/index.mjs
CHANGED
|
@@ -421,7 +421,7 @@ const toList = (value) => (Array.isArray(value) ? value : value === void 0 ? []
|
|
|
421
421
|
const access = defineCommand({
|
|
422
422
|
meta: {
|
|
423
423
|
name: "access",
|
|
424
|
-
description: "Show or change who can open an app (private apps need a login)"
|
|
424
|
+
description: "Show or change who can open an app (private and invite-only apps need a login); --remove takes back invites too"
|
|
425
425
|
},
|
|
426
426
|
args: {
|
|
427
427
|
app: {
|
|
@@ -437,6 +437,10 @@ const access = defineCommand({
|
|
|
437
437
|
type: "boolean",
|
|
438
438
|
description: "Make the app private"
|
|
439
439
|
},
|
|
440
|
+
invite: {
|
|
441
|
+
type: "boolean",
|
|
442
|
+
description: "Make the app private, and let people with access invite others in the app"
|
|
443
|
+
},
|
|
440
444
|
add: {
|
|
441
445
|
type: "string",
|
|
442
446
|
description: "Allow emails or *@domain (comma separated)"
|
|
@@ -451,6 +455,7 @@ const access = defineCommand({
|
|
|
451
455
|
const change = {};
|
|
452
456
|
if (args.public) change.visibility = "public";
|
|
453
457
|
if (args.private) change.visibility = "private";
|
|
458
|
+
if (args.invite) change.visibility = "invite";
|
|
454
459
|
if (args.add) change.add = toList(args.add);
|
|
455
460
|
if (args.remove) change.remove = toList(args.remove);
|
|
456
461
|
const result = await (Object.keys(change).length ? await api(`/v1/apps/${args.app}/access`, args, {
|
|
@@ -459,8 +464,14 @@ const access = defineCommand({
|
|
|
459
464
|
body: JSON.stringify(change)
|
|
460
465
|
}) : await api(`/v1/apps/${args.app}/access`, args)).json();
|
|
461
466
|
if (args.app === "auth") return console.log("auth is the login app and always public");
|
|
462
|
-
console.log(`${args.app} is ${result.visibility}`);
|
|
463
|
-
if (result.visibility === "
|
|
467
|
+
console.log(`${args.app} is ${result.visibility === "invite" ? "invite-only" : result.visibility}`);
|
|
468
|
+
if (result.visibility === "public") return;
|
|
469
|
+
console.log(result.allow.length ? `allowed: ${result.allow.join(", ")}` : "allowed: admins only");
|
|
470
|
+
if (result.visibility === "invite") {
|
|
471
|
+
const invited = result.invited ?? [];
|
|
472
|
+
console.log(invited.length ? "invited:" : "invited: nobody yet");
|
|
473
|
+
for (const invite of invited) console.log(` ${invite.email} (by ${invite.by}, ${invite.at.slice(0, 10)})`);
|
|
474
|
+
}
|
|
464
475
|
}
|
|
465
476
|
});
|
|
466
477
|
const members = defineCommand({
|
package/package.json
CHANGED
package/skill/SKILL.md
CHANGED
|
@@ -65,6 +65,7 @@ existing app, work in its repository instead.
|
|
|
65
65
|
pnpm exec wervt deploy # build, upload, migrate, activate
|
|
66
66
|
pnpm exec wervt access <name> --public # new apps are private (owner, members, admins)
|
|
67
67
|
pnpm exec wervt access <name> --add a@x.com,*@company.com # or let specific people in
|
|
68
|
+
pnpm exec wervt access <name> --invite # private, and people with access invite others (useWervtAccess)
|
|
68
69
|
pnpm exec wervt members <name> --add a@x.com # who may deploy and manage it (the first deploy owns it)
|
|
69
70
|
pnpm exec wervt env <name> --set KEY=value # server env vars, applied from the next request
|
|
70
71
|
```
|