MCPcopy Index your code
hub / github.com/DeepNotesApp/DeepNotes / handleCommand

Function handleCommand

apps/manager/src/index.ts:46–115  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

44}
45
46async function handleCommand(command: string) {
47 const [commandName, ...args] = command.split(' ');
48
49 try {
50 switch (commandName) {
51 case 'help':
52 showHelp();
53 break;
54 case 'hget':
55 mainLogger.info(
56 `Result: ${await dataAbstraction().hget(
57 args[0] as any,
58 args[1],
59 args[2],
60 )}`,
61 );
62 break;
63 case 'hset':
64 await dataAbstraction().hmset(args[0] as any, args[1], {
65 [args[2]]: eval(args[3]),
66 });
67 break;
68
69 case 'delete-user':
70 await deleteUser(args[0]);
71 break;
72
73 case 'hash-email':
74 mainLogger.info(
75 `Result: '\\x${Buffer.from(hashUserEmail(args[0])).toString('hex')}'`,
76 );
77 break;
78
79 case 'send-sendgrid-test-mail':
80 await sendSendGridMail({
81 from: { name: 'DeepNotes', email: args[0] },
82 to: [args[1]],
83
84 subject: 'SendGrid test mail',
85 html: 'SendGrid test mail',
86 });
87 break;
88 case 'send-brevo-test-mail':
89 await sendBrevoMail({
90 from: { name: 'DeepNotes', email: args[0] },
91 to: [args[1]],
92
93 subject: 'Brevo test mail',
94 html: 'Brevo test mail',
95 });
96 break;
97 case 'send-mailjet-test-mail':
98 await sendMailjetMail({
99 from: { name: 'DeepNotes', email: args[0] },
100 to: [args[1]],
101
102 subject: 'Mailjet test mail',
103 html: 'Mailjet test mail',

Callers 1

requestCommandFunction · 0.85

Calls 8

hashUserEmailFunction · 0.90
sendSendGridMailFunction · 0.90
sendBrevoMailFunction · 0.90
sendMailjetMailFunction · 0.90
showHelpFunction · 0.85
deleteUserFunction · 0.85
hgetMethod · 0.45
hmsetMethod · 0.45

Tested by

no test coverage detected