chirpie 1.0.7 → 1.0.8
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.js +125 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -286,7 +286,7 @@ postsCommand.command("delete <id>").description("Delete a post").action(async (i
|
|
|
286
286
|
|
|
287
287
|
// src/commands/accounts.ts
|
|
288
288
|
import { Command as Command6 } from "commander";
|
|
289
|
-
var accountsCommand = new Command6("accounts").description("List connected social accounts (X, Bluesky, LinkedIn, Threads, Mastodon, Instagram, and
|
|
289
|
+
var accountsCommand = new Command6("accounts").description("List connected social accounts (X, Bluesky, LinkedIn, Threads, Mastodon, Instagram, Facebook, Telegram, Reddit, Pinterest, TikTok, YouTube, Google Business Profile, and Snapchat)").option("--json", "Output raw JSON").action(async (opts) => {
|
|
290
290
|
const client = getClient();
|
|
291
291
|
try {
|
|
292
292
|
const accounts = await client.listAccounts();
|
|
@@ -419,6 +419,130 @@ accountsCommand.command("connect-facebook").description("Connect a Facebook Page
|
|
|
419
419
|
process.exit(1);
|
|
420
420
|
}
|
|
421
421
|
});
|
|
422
|
+
accountsCommand.command("connect-telegram").description("Connect a Telegram bot to a channel or group").option("--bot-token <token>", "Telegram bot token (omit to enter securely via prompt)").option("--chat-id <id>", "Telegram chat ID (omit to enter via prompt)").action(async (opts) => {
|
|
423
|
+
const client = getClient();
|
|
424
|
+
try {
|
|
425
|
+
let botToken = opts.botToken;
|
|
426
|
+
let chatId = opts.chatId;
|
|
427
|
+
if (!botToken) {
|
|
428
|
+
const readline = await import("readline");
|
|
429
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stderr });
|
|
430
|
+
botToken = await new Promise((resolve) => {
|
|
431
|
+
process.stderr.write("Bot Token: ");
|
|
432
|
+
rl.question("", (answer) => {
|
|
433
|
+
rl.close();
|
|
434
|
+
resolve(answer.trim());
|
|
435
|
+
});
|
|
436
|
+
});
|
|
437
|
+
if (!botToken) {
|
|
438
|
+
error("Bot token is required");
|
|
439
|
+
process.exit(1);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
if (!chatId) {
|
|
443
|
+
const readline = await import("readline");
|
|
444
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stderr });
|
|
445
|
+
chatId = await new Promise((resolve) => {
|
|
446
|
+
process.stderr.write("Chat ID: ");
|
|
447
|
+
rl.question("", (answer) => {
|
|
448
|
+
rl.close();
|
|
449
|
+
resolve(answer.trim());
|
|
450
|
+
});
|
|
451
|
+
});
|
|
452
|
+
if (!chatId) {
|
|
453
|
+
error("Chat ID is required");
|
|
454
|
+
process.exit(1);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
const result = await client.connectTelegramAccount({
|
|
458
|
+
platform: "telegram",
|
|
459
|
+
bot_token: botToken,
|
|
460
|
+
chat_id: chatId
|
|
461
|
+
});
|
|
462
|
+
info(`Connected Telegram bot: ${result.username} (${result.platform_user_id})`);
|
|
463
|
+
} catch (err) {
|
|
464
|
+
error(err instanceof Error ? err.message : "Failed to connect Telegram bot");
|
|
465
|
+
process.exit(1);
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
accountsCommand.command("connect-reddit").description("Connect a Reddit account via OAuth").action(async () => {
|
|
469
|
+
const client = getClient();
|
|
470
|
+
try {
|
|
471
|
+
const result = await client.connectRedditAccount();
|
|
472
|
+
info("Open this URL in your browser to connect your Reddit account:");
|
|
473
|
+
console.log(`
|
|
474
|
+
${result.authorization_url}
|
|
475
|
+
`);
|
|
476
|
+
} catch (err) {
|
|
477
|
+
error(err instanceof Error ? err.message : "Failed to start Reddit connection");
|
|
478
|
+
process.exit(1);
|
|
479
|
+
}
|
|
480
|
+
});
|
|
481
|
+
accountsCommand.command("connect-pinterest").description("Connect a Pinterest account via OAuth").action(async () => {
|
|
482
|
+
const client = getClient();
|
|
483
|
+
try {
|
|
484
|
+
const result = await client.connectPinterestAccount();
|
|
485
|
+
info("Open this URL in your browser to connect your Pinterest account:");
|
|
486
|
+
console.log(`
|
|
487
|
+
${result.authorization_url}
|
|
488
|
+
`);
|
|
489
|
+
} catch (err) {
|
|
490
|
+
error(err instanceof Error ? err.message : "Failed to start Pinterest connection");
|
|
491
|
+
process.exit(1);
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
accountsCommand.command("connect-tiktok").description("Connect a TikTok account via OAuth").action(async () => {
|
|
495
|
+
const client = getClient();
|
|
496
|
+
try {
|
|
497
|
+
const result = await client.connectTikTokAccount();
|
|
498
|
+
info("Open this URL in your browser to connect your TikTok account:");
|
|
499
|
+
console.log(`
|
|
500
|
+
${result.authorization_url}
|
|
501
|
+
`);
|
|
502
|
+
} catch (err) {
|
|
503
|
+
error(err instanceof Error ? err.message : "Failed to start TikTok connection");
|
|
504
|
+
process.exit(1);
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
accountsCommand.command("connect-youtube").description("Connect a YouTube channel via Google OAuth").action(async () => {
|
|
508
|
+
const client = getClient();
|
|
509
|
+
try {
|
|
510
|
+
const result = await client.connectYouTubeAccount();
|
|
511
|
+
info("Open this URL in your browser to connect your YouTube channel:");
|
|
512
|
+
console.log(`
|
|
513
|
+
${result.authorization_url}
|
|
514
|
+
`);
|
|
515
|
+
} catch (err) {
|
|
516
|
+
error(err instanceof Error ? err.message : "Failed to start YouTube connection");
|
|
517
|
+
process.exit(1);
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
accountsCommand.command("connect-google-business").description("Connect a Google Business Profile via Google OAuth").action(async () => {
|
|
521
|
+
const client = getClient();
|
|
522
|
+
try {
|
|
523
|
+
const result = await client.connectGBPAccount();
|
|
524
|
+
info("Open this URL in your browser to connect your Google Business Profile:");
|
|
525
|
+
console.log(`
|
|
526
|
+
${result.authorization_url}
|
|
527
|
+
`);
|
|
528
|
+
} catch (err) {
|
|
529
|
+
error(err instanceof Error ? err.message : "Failed to start Google Business Profile connection");
|
|
530
|
+
process.exit(1);
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
accountsCommand.command("connect-snapchat").description("Connect a Snapchat account via OAuth").action(async () => {
|
|
534
|
+
const client = getClient();
|
|
535
|
+
try {
|
|
536
|
+
const result = await client.connectSnapchatAccount();
|
|
537
|
+
info("Open this URL in your browser to connect your Snapchat account:");
|
|
538
|
+
console.log(`
|
|
539
|
+
${result.authorization_url}
|
|
540
|
+
`);
|
|
541
|
+
} catch (err) {
|
|
542
|
+
error(err instanceof Error ? err.message : "Failed to start Snapchat connection");
|
|
543
|
+
process.exit(1);
|
|
544
|
+
}
|
|
545
|
+
});
|
|
422
546
|
|
|
423
547
|
// src/commands/analytics.ts
|
|
424
548
|
import { Command as Command7 } from "commander";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chirpie",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Chirpie CLI — post to social media from the command line",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
],
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@chirpie/sdk": "^1.0.
|
|
34
|
+
"@chirpie/sdk": "^1.0.7",
|
|
35
35
|
"commander": "^13"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|