learn-auth-sdk 0.2.7 → 0.3.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/dist/cli/index.d.ts +1 -2
- package/dist/cli/index.js +18 -5
- package/package.json +1 -1
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { }
|
|
1
|
+
#!/usr/bin/env node
|
package/dist/cli/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
1
3
|
// src/cli/index.ts
|
|
2
4
|
import { Command } from "commander";
|
|
3
5
|
|
|
@@ -305,9 +307,20 @@ async function deployCommand() {
|
|
|
305
307
|
|
|
306
308
|
// src/cli/index.ts
|
|
307
309
|
var program = new Command();
|
|
308
|
-
program.name("learn-auth").description("CLI tool for managing Auth settings").version("0.
|
|
309
|
-
program.command("login").description("Authenticate via browser").action(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
program.command("
|
|
310
|
+
program.name("learn-auth").description("CLI tool for managing Auth settings").version("0.3.0");
|
|
311
|
+
program.command("login").description("Authenticate with Learn Auth via browser").option("--base-url <url>", "Custom base URL for API").action(async (options) => {
|
|
312
|
+
await loginCommand(options);
|
|
313
|
+
});
|
|
314
|
+
program.command("init").description("Initialize auth configuration").action(async () => {
|
|
315
|
+
await initCommand();
|
|
316
|
+
});
|
|
317
|
+
program.command("config").description("Configure roles and protected pages").option("--roles <roles>", "Comma separated roles").option("--protect <page>", "Page URL to protect").option("--allowed-roles <roles>", "Roles allowed to view protected page").action(async (options) => {
|
|
318
|
+
await configCommand(options);
|
|
319
|
+
});
|
|
320
|
+
program.command("deploy").description("Deploy auth configuration").action(async () => {
|
|
321
|
+
await deployCommand();
|
|
322
|
+
});
|
|
313
323
|
program.parse(process.argv);
|
|
324
|
+
if (!process.argv.slice(2).length) {
|
|
325
|
+
program.outputHelp();
|
|
326
|
+
}
|