Skip to content

Commit c841fb2

Browse files
Add manage conversation after sending message
1 parent 6b5d708 commit c841fb2

3 files changed

Lines changed: 26 additions & 20 deletions

File tree

package-lock.json

Lines changed: 6 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@linkedapi/linkedin-cli",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "AI-agent-friendly CLI for controlling LinkedIn accounts and retrieving real-time data.",
55
"author": "Linked API",
66
"license": "MIT",
@@ -43,7 +43,7 @@
4343
"ai-agent"
4444
],
4545
"dependencies": {
46-
"@linkedapi/node": "^2.2.0",
46+
"@linkedapi/node": "^2.2.1",
4747
"@oclif/core": "^4.2.10"
4848
},
4949
"devDependencies": {

src/commands/message/send.ts

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,16 @@ export default class MessageSend extends BaseCommand {
2424
'thread-id': Flags.string({
2525
description: 'Reply into an existing conversation thread instead of passing person-url',
2626
}),
27+
manage: Flags.string({
28+
description: 'Manage the conversation right after sending (acts on the same thread)',
29+
options: ['archive', 'unarchive', 'star', 'unstar', 'mute', 'unmute'],
30+
}),
2731
};
2832

2933
static override examples = [
3034
'<%= config.bin %> message send https://www.linkedin.com/in/john-doe "Hello John!"',
3135
'<%= config.bin %> message send --thread-id 2-abc123... "Sounds good, talk soon!"',
36+
'<%= config.bin %> message send https://www.linkedin.com/in/john-doe "Hello John!" --manage archive',
3237
];
3338

3439
public async run(): Promise<void> {
@@ -42,18 +47,20 @@ export default class MessageSend extends BaseCommand {
4247

4348
const client = await this.buildAuthenticatedClient();
4449

50+
const params: Record<string, unknown> = {
51+
personUrl: args['person-url'],
52+
threadId: flags['thread-id'],
53+
text: args.text,
54+
};
55+
56+
if (flags.manage) {
57+
params.manageConversation = { operation: flags.manage };
58+
}
59+
4560
try {
46-
const result = await runVoidWorkflow(
47-
client.sendMessage,
48-
{
49-
personUrl: args['person-url'],
50-
threadId: flags['thread-id'],
51-
text: args.text,
52-
},
53-
{
54-
isQuiet: flags.quiet,
55-
},
56-
);
61+
const result = await runVoidWorkflow(client.sendMessage, params, {
62+
isQuiet: flags.quiet,
63+
});
5764

5865
formatVoidOutput({
5966
errors: result.errors,

0 commit comments

Comments
 (0)