@loghead/core 0.1.15 → 0.1.17
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_main.js +12 -2
- package/package.json +1 -1
- package/src/cli_main.ts +12 -2
package/dist/cli_main.js
CHANGED
|
@@ -44,6 +44,10 @@ async function main() {
|
|
|
44
44
|
.command("add <name>", "Add project", {}, (argv) => {
|
|
45
45
|
const p = db.createProject(argv.name);
|
|
46
46
|
console.log(`Project created: ${p.id}`);
|
|
47
|
+
})
|
|
48
|
+
.command("delete <id>", "Delete project", {}, (argv) => {
|
|
49
|
+
db.deleteProject(argv.id);
|
|
50
|
+
console.log(`Project deleted: ${argv.id}`);
|
|
47
51
|
});
|
|
48
52
|
})
|
|
49
53
|
.command("streams <cmd> [type] [name]", "Manage streams", (yargs) => {
|
|
@@ -66,9 +70,15 @@ async function main() {
|
|
|
66
70
|
console.log(`Stream created: ${s.id}`);
|
|
67
71
|
console.log(`Token: ${s.token}`);
|
|
68
72
|
})
|
|
69
|
-
.command("token
|
|
70
|
-
|
|
73
|
+
.command("token", "Get token for stream", {
|
|
74
|
+
stream: { type: "string", demandOption: true }
|
|
75
|
+
}, async (argv) => {
|
|
76
|
+
const token = await auth.createStreamToken(argv.stream);
|
|
71
77
|
console.log(`Token: ${token}`);
|
|
78
|
+
})
|
|
79
|
+
.command("delete <id>", "Delete stream", {}, (argv) => {
|
|
80
|
+
db.deleteStream(argv.id);
|
|
81
|
+
console.log(`Stream deleted: ${argv.id}`);
|
|
72
82
|
});
|
|
73
83
|
})
|
|
74
84
|
.demandCommand(1)
|
package/package.json
CHANGED
package/src/cli_main.ts
CHANGED
|
@@ -45,6 +45,10 @@ async function main() {
|
|
|
45
45
|
.command("add <name>", "Add project", {}, (argv) => {
|
|
46
46
|
const p = db.createProject(argv.name as string);
|
|
47
47
|
console.log(`Project created: ${p.id}`);
|
|
48
|
+
})
|
|
49
|
+
.command("delete <id>", "Delete project", {}, (argv) => {
|
|
50
|
+
db.deleteProject(argv.id as string);
|
|
51
|
+
console.log(`Project deleted: ${argv.id}`);
|
|
48
52
|
});
|
|
49
53
|
})
|
|
50
54
|
.command("streams <cmd> [type] [name]", "Manage streams", (yargs) => {
|
|
@@ -67,9 +71,15 @@ async function main() {
|
|
|
67
71
|
console.log(`Stream created: ${s.id}`);
|
|
68
72
|
console.log(`Token: ${s.token}`);
|
|
69
73
|
})
|
|
70
|
-
.command("token
|
|
71
|
-
|
|
74
|
+
.command("token", "Get token for stream", {
|
|
75
|
+
stream: { type: "string", demandOption: true }
|
|
76
|
+
}, async (argv) => {
|
|
77
|
+
const token = await auth.createStreamToken(argv.stream as string);
|
|
72
78
|
console.log(`Token: ${token}`);
|
|
79
|
+
})
|
|
80
|
+
.command("delete <id>", "Delete stream", {}, (argv) => {
|
|
81
|
+
db.deleteStream(argv.id as string);
|
|
82
|
+
console.log(`Stream deleted: ${argv.id}`);
|
|
73
83
|
});
|
|
74
84
|
})
|
|
75
85
|
.demandCommand(1)
|