fastclaw-cli 0.2.1 → 0.2.2
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 +2 -1
- package/dist/index.js +9 -7
- package/dist/sdk.d.ts +1 -1
- package/dist/sdk.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,9 +49,10 @@ fastclaw setup # Interactive one-step bot creation
|
|
|
49
49
|
|
|
50
50
|
fastclaw config set|get|show # Manage local config (~/.fastclaw/config.json)
|
|
51
51
|
|
|
52
|
-
fastclaw admin apps create|list|delete|rotate-token
|
|
52
|
+
fastclaw admin apps create|list [-t]|delete|rotate-token
|
|
53
53
|
|
|
54
54
|
fastclaw bot create|list|get|update|delete
|
|
55
|
+
fastclaw bot list -A [--user-id <uid>] # List bots across all apps (requires admin token)
|
|
55
56
|
fastclaw bot start|stop|restart|status|connect|reset-token <id>
|
|
56
57
|
|
|
57
58
|
fastclaw model add|list|get|delete <bot-id> [provider]
|
package/dist/index.js
CHANGED
|
@@ -379,7 +379,9 @@ var FastClawClient = class {
|
|
|
379
379
|
return this.request("POST", "/bots", { body: req });
|
|
380
380
|
}
|
|
381
381
|
async listBots(userId) {
|
|
382
|
-
|
|
382
|
+
const query = {};
|
|
383
|
+
if (userId) query.user_id = userId;
|
|
384
|
+
return this.request("GET", "/bots", { query });
|
|
383
385
|
}
|
|
384
386
|
async getBot(id) {
|
|
385
387
|
return this.request("GET", `/bots/${id}`);
|
|
@@ -667,7 +669,7 @@ function registerBotCrudCommands(bot) {
|
|
|
667
669
|
withErrorHandler(async (cmdOpts) => {
|
|
668
670
|
if (cmdOpts.all) {
|
|
669
671
|
const { client: adminClient, cfg } = getAdminClient(bot);
|
|
670
|
-
const userId = cmdOpts.userId
|
|
672
|
+
const userId = cmdOpts.userId;
|
|
671
673
|
const apps = await adminClient.listApps();
|
|
672
674
|
const allBots = [];
|
|
673
675
|
for (const app of apps) {
|
|
@@ -694,13 +696,13 @@ function registerBotCrudCommands(bot) {
|
|
|
694
696
|
console.log(chalk5.dim("No bots found."));
|
|
695
697
|
} else {
|
|
696
698
|
printTable(
|
|
697
|
-
["App", "ID", "Name", "Slug", "Status", "Ready", "Created"],
|
|
698
|
-
allBots.map((x) => [x.app_name, x.bot.id, x.bot.name, x.bot.slug, x.bot.status, x.ready, x.bot.created_at])
|
|
699
|
+
["App", "User", "ID", "Name", "Slug", "Status", "Ready", "Created"],
|
|
700
|
+
allBots.map((x) => [x.app_name, x.bot.user_id, x.bot.id, x.bot.name, x.bot.slug, x.bot.status, x.ready, x.bot.created_at])
|
|
699
701
|
);
|
|
700
702
|
}
|
|
701
703
|
} else {
|
|
702
704
|
const { client, cfg } = getClient2(bot);
|
|
703
|
-
const userId = cmdOpts.userId
|
|
705
|
+
const userId = cmdOpts.userId;
|
|
704
706
|
const list = await client.listBots(userId);
|
|
705
707
|
if (cfg.json) {
|
|
706
708
|
printJson(list);
|
|
@@ -717,9 +719,9 @@ function registerBotCrudCommands(bot) {
|
|
|
717
719
|
} catch {
|
|
718
720
|
}
|
|
719
721
|
}
|
|
720
|
-
rows.push([b.id, b.name, b.slug, b.status, ready, b.created_at]);
|
|
722
|
+
rows.push([b.user_id, b.id, b.name, b.slug, b.status, ready, b.created_at]);
|
|
721
723
|
}
|
|
722
|
-
printTable(["ID", "Name", "Slug", "Status", "Ready", "Created"], rows);
|
|
724
|
+
printTable(["User", "ID", "Name", "Slug", "Status", "Ready", "Created"], rows);
|
|
723
725
|
}
|
|
724
726
|
}
|
|
725
727
|
})
|
package/dist/sdk.d.ts
CHANGED
|
@@ -217,7 +217,7 @@ declare class FastClawClient {
|
|
|
217
217
|
upgradeBot(id: string, req?: UpgradeRequest): Promise<UpgradeResponse>;
|
|
218
218
|
upgradeAllBots(req?: UpgradeRequest): Promise<BulkUpgradeResponse>;
|
|
219
219
|
createBot(req: CreateBotRequest): Promise<Bot>;
|
|
220
|
-
listBots(userId
|
|
220
|
+
listBots(userId?: string): Promise<Bot[]>;
|
|
221
221
|
getBot(id: string): Promise<Bot>;
|
|
222
222
|
updateBot(id: string, req: UpdateBotRequest): Promise<Bot>;
|
|
223
223
|
deleteBot(id: string): Promise<{
|
package/dist/sdk.js
CHANGED
|
@@ -206,7 +206,9 @@ var FastClawClient = class {
|
|
|
206
206
|
return this.request("POST", "/bots", { body: req });
|
|
207
207
|
}
|
|
208
208
|
async listBots(userId) {
|
|
209
|
-
|
|
209
|
+
const query = {};
|
|
210
|
+
if (userId) query.user_id = userId;
|
|
211
|
+
return this.request("GET", "/bots", { query });
|
|
210
212
|
}
|
|
211
213
|
async getBot(id) {
|
|
212
214
|
return this.request("GET", `/bots/${id}`);
|