msgraph-cli 0.0.1

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.
Files changed (189) hide show
  1. package/dist/commands/auth/index.d.ts +3 -0
  2. package/dist/commands/auth/index.d.ts.map +1 -0
  3. package/dist/commands/auth/index.js +9 -0
  4. package/dist/commands/auth/index.js.map +1 -0
  5. package/dist/commands/auth/login.d.ts +3 -0
  6. package/dist/commands/auth/login.d.ts.map +1 -0
  7. package/dist/commands/auth/login.js +16 -0
  8. package/dist/commands/auth/login.js.map +1 -0
  9. package/dist/commands/auth/logout.d.ts +3 -0
  10. package/dist/commands/auth/logout.d.ts.map +1 -0
  11. package/dist/commands/auth/logout.js +11 -0
  12. package/dist/commands/auth/logout.js.map +1 -0
  13. package/dist/commands/auth/status.d.ts +3 -0
  14. package/dist/commands/auth/status.d.ts.map +1 -0
  15. package/dist/commands/auth/status.js +38 -0
  16. package/dist/commands/auth/status.js.map +1 -0
  17. package/dist/commands/calendar/cancel.d.ts +3 -0
  18. package/dist/commands/calendar/cancel.d.ts.map +1 -0
  19. package/dist/commands/calendar/cancel.js +14 -0
  20. package/dist/commands/calendar/cancel.js.map +1 -0
  21. package/dist/commands/calendar/create.d.ts +3 -0
  22. package/dist/commands/calendar/create.d.ts.map +1 -0
  23. package/dist/commands/calendar/create.js +31 -0
  24. package/dist/commands/calendar/create.js.map +1 -0
  25. package/dist/commands/calendar/events.d.ts +3 -0
  26. package/dist/commands/calendar/events.d.ts.map +1 -0
  27. package/dist/commands/calendar/events.js +22 -0
  28. package/dist/commands/calendar/events.js.map +1 -0
  29. package/dist/commands/calendar/find-times.d.ts +3 -0
  30. package/dist/commands/calendar/find-times.d.ts.map +1 -0
  31. package/dist/commands/calendar/find-times.js +22 -0
  32. package/dist/commands/calendar/find-times.js.map +1 -0
  33. package/dist/commands/calendar/index.d.ts +3 -0
  34. package/dist/commands/calendar/index.d.ts.map +1 -0
  35. package/dist/commands/calendar/index.js +12 -0
  36. package/dist/commands/calendar/index.js.map +1 -0
  37. package/dist/commands/chat/create.d.ts +3 -0
  38. package/dist/commands/chat/create.d.ts.map +1 -0
  39. package/dist/commands/chat/create.js +26 -0
  40. package/dist/commands/chat/create.js.map +1 -0
  41. package/dist/commands/chat/get.d.ts +3 -0
  42. package/dist/commands/chat/get.d.ts.map +1 -0
  43. package/dist/commands/chat/get.js +21 -0
  44. package/dist/commands/chat/get.js.map +1 -0
  45. package/dist/commands/chat/index.d.ts +3 -0
  46. package/dist/commands/chat/index.d.ts.map +1 -0
  47. package/dist/commands/chat/index.js +10 -0
  48. package/dist/commands/chat/index.js.map +1 -0
  49. package/dist/commands/chat/search.d.ts +3 -0
  50. package/dist/commands/chat/search.d.ts.map +1 -0
  51. package/dist/commands/chat/search.js +24 -0
  52. package/dist/commands/chat/search.js.map +1 -0
  53. package/dist/commands/file/download-hosted.d.ts +3 -0
  54. package/dist/commands/file/download-hosted.d.ts.map +1 -0
  55. package/dist/commands/file/download-hosted.js +30 -0
  56. package/dist/commands/file/download-hosted.js.map +1 -0
  57. package/dist/commands/file/download.d.ts +3 -0
  58. package/dist/commands/file/download.d.ts.map +1 -0
  59. package/dist/commands/file/download.js +27 -0
  60. package/dist/commands/file/download.js.map +1 -0
  61. package/dist/commands/file/grant.d.ts +3 -0
  62. package/dist/commands/file/grant.d.ts.map +1 -0
  63. package/dist/commands/file/grant.js +20 -0
  64. package/dist/commands/file/grant.js.map +1 -0
  65. package/dist/commands/file/index.d.ts +3 -0
  66. package/dist/commands/file/index.d.ts.map +1 -0
  67. package/dist/commands/file/index.js +14 -0
  68. package/dist/commands/file/index.js.map +1 -0
  69. package/dist/commands/file/update.d.ts +3 -0
  70. package/dist/commands/file/update.d.ts.map +1 -0
  71. package/dist/commands/file/update.js +13 -0
  72. package/dist/commands/file/update.js.map +1 -0
  73. package/dist/commands/file/upload.d.ts +3 -0
  74. package/dist/commands/file/upload.d.ts.map +1 -0
  75. package/dist/commands/file/upload.js +14 -0
  76. package/dist/commands/file/upload.js.map +1 -0
  77. package/dist/commands/mail/delete.d.ts +3 -0
  78. package/dist/commands/mail/delete.d.ts.map +1 -0
  79. package/dist/commands/mail/delete.js +13 -0
  80. package/dist/commands/mail/delete.js.map +1 -0
  81. package/dist/commands/mail/index.d.ts +3 -0
  82. package/dist/commands/mail/index.d.ts.map +1 -0
  83. package/dist/commands/mail/index.js +12 -0
  84. package/dist/commands/mail/index.js.map +1 -0
  85. package/dist/commands/mail/list.d.ts +3 -0
  86. package/dist/commands/mail/list.d.ts.map +1 -0
  87. package/dist/commands/mail/list.js +32 -0
  88. package/dist/commands/mail/list.js.map +1 -0
  89. package/dist/commands/mail/search.d.ts +3 -0
  90. package/dist/commands/mail/search.d.ts.map +1 -0
  91. package/dist/commands/mail/search.js +23 -0
  92. package/dist/commands/mail/search.js.map +1 -0
  93. package/dist/commands/mail/send.d.ts +3 -0
  94. package/dist/commands/mail/send.d.ts.map +1 -0
  95. package/dist/commands/mail/send.js +45 -0
  96. package/dist/commands/mail/send.js.map +1 -0
  97. package/dist/commands/message/delete.d.ts +3 -0
  98. package/dist/commands/message/delete.d.ts.map +1 -0
  99. package/dist/commands/message/delete.js +13 -0
  100. package/dist/commands/message/delete.js.map +1 -0
  101. package/dist/commands/message/get.d.ts +3 -0
  102. package/dist/commands/message/get.d.ts.map +1 -0
  103. package/dist/commands/message/get.js +13 -0
  104. package/dist/commands/message/get.js.map +1 -0
  105. package/dist/commands/message/index.d.ts +3 -0
  106. package/dist/commands/message/index.d.ts.map +1 -0
  107. package/dist/commands/message/index.js +20 -0
  108. package/dist/commands/message/index.js.map +1 -0
  109. package/dist/commands/message/list.d.ts +3 -0
  110. package/dist/commands/message/list.d.ts.map +1 -0
  111. package/dist/commands/message/list.js +23 -0
  112. package/dist/commands/message/list.js.map +1 -0
  113. package/dist/commands/message/react.d.ts +3 -0
  114. package/dist/commands/message/react.d.ts.map +1 -0
  115. package/dist/commands/message/react.js +13 -0
  116. package/dist/commands/message/react.js.map +1 -0
  117. package/dist/commands/message/search.d.ts +3 -0
  118. package/dist/commands/message/search.d.ts.map +1 -0
  119. package/dist/commands/message/search.js +25 -0
  120. package/dist/commands/message/search.js.map +1 -0
  121. package/dist/commands/message/send.d.ts +3 -0
  122. package/dist/commands/message/send.d.ts.map +1 -0
  123. package/dist/commands/message/send.js +24 -0
  124. package/dist/commands/message/send.js.map +1 -0
  125. package/dist/commands/message/unreact.d.ts +3 -0
  126. package/dist/commands/message/unreact.d.ts.map +1 -0
  127. package/dist/commands/message/unreact.js +13 -0
  128. package/dist/commands/message/unreact.js.map +1 -0
  129. package/dist/commands/message/update.d.ts +3 -0
  130. package/dist/commands/message/update.d.ts.map +1 -0
  131. package/dist/commands/message/update.js +21 -0
  132. package/dist/commands/message/update.js.map +1 -0
  133. package/dist/commands/transcript/download.d.ts +3 -0
  134. package/dist/commands/transcript/download.d.ts.map +1 -0
  135. package/dist/commands/transcript/download.js +37 -0
  136. package/dist/commands/transcript/download.js.map +1 -0
  137. package/dist/commands/transcript/get.d.ts +3 -0
  138. package/dist/commands/transcript/get.d.ts.map +1 -0
  139. package/dist/commands/transcript/get.js +13 -0
  140. package/dist/commands/transcript/get.js.map +1 -0
  141. package/dist/commands/transcript/index.d.ts +3 -0
  142. package/dist/commands/transcript/index.d.ts.map +1 -0
  143. package/dist/commands/transcript/index.js +10 -0
  144. package/dist/commands/transcript/index.js.map +1 -0
  145. package/dist/commands/transcript/list.d.ts +3 -0
  146. package/dist/commands/transcript/list.d.ts.map +1 -0
  147. package/dist/commands/transcript/list.js +22 -0
  148. package/dist/commands/transcript/list.js.map +1 -0
  149. package/dist/commands/user/get.d.ts +3 -0
  150. package/dist/commands/user/get.d.ts.map +1 -0
  151. package/dist/commands/user/get.js +19 -0
  152. package/dist/commands/user/get.js.map +1 -0
  153. package/dist/commands/user/index.d.ts +3 -0
  154. package/dist/commands/user/index.d.ts.map +1 -0
  155. package/dist/commands/user/index.js +12 -0
  156. package/dist/commands/user/index.js.map +1 -0
  157. package/dist/commands/user/me.d.ts +3 -0
  158. package/dist/commands/user/me.d.ts.map +1 -0
  159. package/dist/commands/user/me.js +19 -0
  160. package/dist/commands/user/me.js.map +1 -0
  161. package/dist/commands/user/search.d.ts +3 -0
  162. package/dist/commands/user/search.d.ts.map +1 -0
  163. package/dist/commands/user/search.js +17 -0
  164. package/dist/commands/user/search.js.map +1 -0
  165. package/dist/commands/user/set-status.d.ts +3 -0
  166. package/dist/commands/user/set-status.d.ts.map +1 -0
  167. package/dist/commands/user/set-status.js +25 -0
  168. package/dist/commands/user/set-status.js.map +1 -0
  169. package/dist/index.d.ts +3 -0
  170. package/dist/index.d.ts.map +1 -0
  171. package/dist/index.js +62 -0
  172. package/dist/index.js.map +1 -0
  173. package/dist/utils/auth.d.ts +11 -0
  174. package/dist/utils/auth.d.ts.map +1 -0
  175. package/dist/utils/auth.js +239 -0
  176. package/dist/utils/auth.js.map +1 -0
  177. package/dist/utils/client.d.ts +3 -0
  178. package/dist/utils/client.d.ts.map +1 -0
  179. package/dist/utils/client.js +23 -0
  180. package/dist/utils/client.js.map +1 -0
  181. package/dist/utils/output.d.ts +3 -0
  182. package/dist/utils/output.d.ts.map +1 -0
  183. package/dist/utils/output.js +55 -0
  184. package/dist/utils/output.js.map +1 -0
  185. package/dist/utils/strip-response.d.ts +2 -0
  186. package/dist/utils/strip-response.d.ts.map +1 -0
  187. package/dist/utils/strip-response.js +30 -0
  188. package/dist/utils/strip-response.js.map +1 -0
  189. package/package.json +40 -0
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function update(parent: Command): void;
3
+ //# sourceMappingURL=update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/file/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAS5C"}
@@ -0,0 +1,13 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function update(parent) {
4
+ parent
5
+ .command('update <itemId> <driveId> <filePath>')
6
+ .description('Replace content of an existing file')
7
+ .action(async (itemId, driveId, filePath) => {
8
+ const client = await getClient();
9
+ const result = await client.files.update({ itemId, driveId, filePath });
10
+ output(result);
11
+ });
12
+ }
13
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/file/update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,sCAAsC,CAAC;SAC/C,WAAW,CAAC,qCAAqC,CAAC;SAClD,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,OAAe,EAAE,QAAgB,EAAE,EAAE;QAClE,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;QACxE,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function upload(parent: Command): void;
3
+ //# sourceMappingURL=upload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/commands/file/upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAU5C"}
@@ -0,0 +1,14 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function upload(parent) {
4
+ parent
5
+ .command('upload <filePath>')
6
+ .description('Upload a file to OneDrive and get a sharing link')
7
+ .option('--dest <path>', 'Destination folder in OneDrive', '/')
8
+ .action(async (filePath, opts) => {
9
+ const client = await getClient();
10
+ const result = await client.files.upload({ filePath, destinationPath: opts.dest });
11
+ output(result);
12
+ });
13
+ }
14
+ //# sourceMappingURL=upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../src/commands/file/upload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,mBAAmB,CAAC;SAC5B,WAAW,CAAC,kDAAkD,CAAC;SAC/D,MAAM,CAAC,eAAe,EAAE,gCAAgC,EAAE,GAAG,CAAC;SAC9D,MAAM,CAAC,KAAK,EAAE,QAAgB,EAAE,IAAsB,EAAE,EAAE;QACzD,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACnF,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function del(parent: Command): void;
3
+ //# sourceMappingURL=delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/mail/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CASzC"}
@@ -0,0 +1,13 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function del(parent) {
4
+ parent
5
+ .command('delete <messageId>')
6
+ .description('Delete an email (moves to Deleted Items)')
7
+ .action(async (messageId) => {
8
+ const client = await getClient();
9
+ await client.mail.delete({ messageId });
10
+ output({ status: 'ok', messageId });
11
+ });
12
+ }
13
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/mail/delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,GAAG,CAAC,MAAe;IACjC,MAAM;SACH,OAAO,CAAC,oBAAoB,CAAC;SAC7B,WAAW,CAAC,0CAA0C,CAAC;SACvD,MAAM,CAAC,KAAK,EAAE,SAAiB,EAAE,EAAE;QAClC,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;QACxC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerMailCommands(program: Command): void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/mail/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAM3D"}
@@ -0,0 +1,12 @@
1
+ import { del } from './delete.js';
2
+ import { list } from './list.js';
3
+ import { search } from './search.js';
4
+ import { send } from './send.js';
5
+ export function registerMailCommands(program) {
6
+ const mail = program.command('mail').description('Mail operations');
7
+ list(mail);
8
+ search(mail);
9
+ send(mail);
10
+ del(mail);
11
+ }
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/mail/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IACpE,IAAI,CAAC,IAAI,CAAC,CAAC;IACX,MAAM,CAAC,IAAI,CAAC,CAAC;IACb,IAAI,CAAC,IAAI,CAAC,CAAC;IACX,GAAG,CAAC,IAAI,CAAC,CAAC;AACZ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function list(parent: Command): void;
3
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/mail/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAwC1C"}
@@ -0,0 +1,32 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function list(parent) {
4
+ parent
5
+ .command('list')
6
+ .description('List mail messages from a folder')
7
+ .option('--folder <name>', 'Mail folder: inbox, sentitems, drafts, deleteditems, junkemail, archive')
8
+ .option('--limit <n>', 'Number of messages (1-50)', '20')
9
+ .option('--since <datetime>', 'Messages after this ISO datetime')
10
+ .option('--until <datetime>', 'Messages before this ISO datetime')
11
+ .option('--unread', 'Show only unread messages')
12
+ .option('--has-attachments', 'Show only messages with attachments')
13
+ .option('--from <email>', 'Filter by sender email address')
14
+ .option('--include-body', 'Include full email body in response')
15
+ .option('--body-format <format>', 'Body format: text, html', 'html')
16
+ .action(async (opts) => {
17
+ const client = await getClient();
18
+ const result = await client.mail.list({
19
+ folder: opts.folder,
20
+ limit: parseInt(opts.limit, 10),
21
+ since: opts.since,
22
+ until: opts.until,
23
+ unreadOnly: opts.unread,
24
+ hasAttachments: opts.hasAttachments,
25
+ from: opts.from,
26
+ includeBody: opts.includeBody,
27
+ bodyFormat: opts.bodyFormat,
28
+ });
29
+ output(result);
30
+ });
31
+ }
32
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/mail/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,IAAI,CAAC,MAAe;IAClC,MAAM;SACH,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,kCAAkC,CAAC;SAC/C,MAAM,CAAC,iBAAiB,EAAE,yEAAyE,CAAC;SACpG,MAAM,CAAC,aAAa,EAAE,2BAA2B,EAAE,IAAI,CAAC;SACxD,MAAM,CAAC,oBAAoB,EAAE,kCAAkC,CAAC;SAChE,MAAM,CAAC,oBAAoB,EAAE,mCAAmC,CAAC;SACjE,MAAM,CAAC,UAAU,EAAE,2BAA2B,CAAC;SAC/C,MAAM,CAAC,mBAAmB,EAAE,qCAAqC,CAAC;SAClE,MAAM,CAAC,gBAAgB,EAAE,gCAAgC,CAAC;SAC1D,MAAM,CAAC,gBAAgB,EAAE,qCAAqC,CAAC;SAC/D,MAAM,CAAC,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,CAAC;SACnE,MAAM,CACL,KAAK,EAAE,IAUN,EAAE,EAAE;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;YACpC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;YAC/B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,UAAU,EAAE,IAAI,CAAC,MAAM;YACvB,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,UAAU,EAAE,IAAI,CAAC,UAA6B;SAC/C,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CACF,CAAC;AACN,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function search(parent: Command): void;
3
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/commands/mail/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAqB5C"}
@@ -0,0 +1,23 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function search(parent) {
4
+ parent
5
+ .command('search <query>')
6
+ .description('Search emails by keyword')
7
+ .option('--folder <name>', 'Scope to folder: inbox, sentitems, drafts, etc.')
8
+ .option('--limit <n>', 'Max results (1-100)', '25')
9
+ .option('--include-body', 'Include full email body')
10
+ .option('--body-format <format>', 'Body format: text, html', 'html')
11
+ .action(async (query, opts) => {
12
+ const client = await getClient();
13
+ const result = await client.mail.search({
14
+ query,
15
+ folder: opts.folder,
16
+ limit: parseInt(opts.limit, 10),
17
+ includeBody: opts.includeBody,
18
+ bodyFormat: opts.bodyFormat,
19
+ });
20
+ output(result);
21
+ });
22
+ }
23
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/commands/mail/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,gBAAgB,CAAC;SACzB,WAAW,CAAC,0BAA0B,CAAC;SACvC,MAAM,CAAC,iBAAiB,EAAE,iDAAiD,CAAC;SAC5E,MAAM,CAAC,aAAa,EAAE,qBAAqB,EAAE,IAAI,CAAC;SAClD,MAAM,CAAC,gBAAgB,EAAE,yBAAyB,CAAC;SACnD,MAAM,CAAC,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,CAAC;SACnE,MAAM,CACL,KAAK,EAAE,KAAa,EAAE,IAAmF,EAAE,EAAE;QAC3G,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;YACtC,KAAK;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;YAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,UAAU,EAAE,IAAI,CAAC,UAA6B;SAC/C,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CACF,CAAC;AACN,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function send(parent: Command): void;
3
+ //# sourceMappingURL=send.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../../src/commands/mail/send.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAsD1C"}
@@ -0,0 +1,45 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { basename } from 'node:path';
3
+ import { getClient } from '../../utils/client.js';
4
+ import { output } from '../../utils/output.js';
5
+ export function send(parent) {
6
+ parent
7
+ .command('send')
8
+ .description('Send an email')
9
+ .requiredOption('--to <emails...>', 'Recipient email addresses')
10
+ .requiredOption('--subject <text>', 'Email subject')
11
+ .requiredOption('--body <text>', 'Email body content')
12
+ .option('--body-type <type>', 'Body type: text, html', 'text')
13
+ .option('--cc <emails...>', 'CC recipients')
14
+ .option('--bcc <emails...>', 'BCC recipients')
15
+ .option('--attachments <paths...>', 'File paths to attach (max 3MB each)')
16
+ .addHelpText('after', `
17
+ Examples:
18
+ $ msgraph mail send --to user@example.com --subject "Hello" --body "Hi there"
19
+ $ msgraph mail send --to a@ex.com b@ex.com --subject "Report" --body "<h1>Report</h1>" --body-type html`)
20
+ .action(async (opts) => {
21
+ const client = await getClient();
22
+ let attachments;
23
+ if (opts.attachments?.length) {
24
+ attachments = opts.attachments.map((filePath) => {
25
+ const content = readFileSync(filePath);
26
+ return {
27
+ name: basename(filePath),
28
+ contentType: 'application/octet-stream',
29
+ contentBytes: content.toString('base64'),
30
+ };
31
+ });
32
+ }
33
+ await client.mail.send({
34
+ to: opts.to,
35
+ subject: opts.subject,
36
+ body: opts.body,
37
+ bodyType: opts.bodyType,
38
+ cc: opts.cc,
39
+ bcc: opts.bcc,
40
+ attachments,
41
+ });
42
+ output({ status: 'ok', to: opts.to, subject: opts.subject });
43
+ });
44
+ }
45
+ //# sourceMappingURL=send.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/commands/mail/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAG/C,MAAM,UAAU,IAAI,CAAC,MAAe;IAClC,MAAM;SACH,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,eAAe,CAAC;SAC5B,cAAc,CAAC,kBAAkB,EAAE,2BAA2B,CAAC;SAC/D,cAAc,CAAC,kBAAkB,EAAE,eAAe,CAAC;SACnD,cAAc,CAAC,eAAe,EAAE,oBAAoB,CAAC;SACrD,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,CAAC;SAC7D,MAAM,CAAC,kBAAkB,EAAE,eAAe,CAAC;SAC3C,MAAM,CAAC,mBAAmB,EAAE,gBAAgB,CAAC;SAC7C,MAAM,CAAC,0BAA0B,EAAE,qCAAqC,CAAC;SACzE,WAAW,CACV,OAAO,EACP;;;0GAGoG,CACrG;SACA,MAAM,CACL,KAAK,EAAE,IAQN,EAAE,EAAE;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QAEjC,IAAI,WAAyC,CAAC;QAC9C,IAAI,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;YAC7B,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;gBAC9C,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;gBACvC,OAAO;oBACL,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC;oBACxB,WAAW,EAAE,0BAA0B;oBACvC,YAAY,EAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC;iBACzC,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC;QAED,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;YACrB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,QAAQ,EAAE,IAAI,CAAC,QAA2B;YAC1C,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,WAAW;SACZ,CAAC,CAAC;QACH,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC,CACF,CAAC;AACN,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function del(parent: Command): void;
3
+ //# sourceMappingURL=delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/message/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CASzC"}
@@ -0,0 +1,13 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function del(parent) {
4
+ parent
5
+ .command('delete <chatId> <messageId>')
6
+ .description('Soft-delete a chat message (can be undone)')
7
+ .action(async (chatId, messageId) => {
8
+ const client = await getClient();
9
+ await client.messages.softDelete({ chatId, messageId });
10
+ output({ status: 'ok', chatId, messageId });
11
+ });
12
+ }
13
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/message/delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,GAAG,CAAC,MAAe;IACjC,MAAM;SACH,OAAO,CAAC,6BAA6B,CAAC;SACtC,WAAW,CAAC,4CAA4C,CAAC;SACzD,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,SAAiB,EAAE,EAAE;QAClD,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;QACxD,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function get(parent: Command): void;
3
+ //# sourceMappingURL=get.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/commands/message/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CASzC"}
@@ -0,0 +1,13 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function get(parent) {
4
+ parent
5
+ .command('get <chatId> <messageId>')
6
+ .description('Get a specific message')
7
+ .action(async (chatId, messageId) => {
8
+ const client = await getClient();
9
+ const msg = await client.messages.get({ chatId, messageId });
10
+ output(msg);
11
+ });
12
+ }
13
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/message/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,GAAG,CAAC,MAAe;IACjC,MAAM;SACH,OAAO,CAAC,0BAA0B,CAAC;SACnC,WAAW,CAAC,wBAAwB,CAAC;SACrC,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,SAAiB,EAAE,EAAE;QAClD,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;QAC7D,MAAM,CAAC,GAAG,CAAC,CAAC;IACd,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerMessageCommands(program: Command): void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/message/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAU9D"}
@@ -0,0 +1,20 @@
1
+ import { del } from './delete.js';
2
+ import { get } from './get.js';
3
+ import { list } from './list.js';
4
+ import { react } from './react.js';
5
+ import { search } from './search.js';
6
+ import { send } from './send.js';
7
+ import { unreact } from './unreact.js';
8
+ import { update } from './update.js';
9
+ export function registerMessageCommands(program) {
10
+ const message = program.command('message').description('Message operations');
11
+ list(message);
12
+ get(message);
13
+ send(message);
14
+ update(message);
15
+ del(message);
16
+ search(message);
17
+ react(message);
18
+ unreact(message);
19
+ }
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/message/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IACtD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IAC7E,IAAI,CAAC,OAAO,CAAC,CAAC;IACd,GAAG,CAAC,OAAO,CAAC,CAAC;IACb,IAAI,CAAC,OAAO,CAAC,CAAC;IACd,MAAM,CAAC,OAAO,CAAC,CAAC;IAChB,GAAG,CAAC,OAAO,CAAC,CAAC;IACb,MAAM,CAAC,OAAO,CAAC,CAAC;IAChB,KAAK,CAAC,OAAO,CAAC,CAAC;IACf,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function list(parent: Command): void;
3
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/message/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAmB1C"}
@@ -0,0 +1,23 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function list(parent) {
4
+ parent
5
+ .command('list <chatId>')
6
+ .description('List messages in a chat')
7
+ .option('--limit <n>', 'Number of messages (1-50)', '20')
8
+ .option('--from <datetime>', 'Messages after this ISO datetime')
9
+ .option('--to <datetime>', 'Messages before this ISO datetime')
10
+ .option('--from-user <userId>', 'Filter by sender user ID')
11
+ .action(async (chatId, opts) => {
12
+ const client = await getClient();
13
+ const result = await client.messages.getChatMessages({
14
+ chatId,
15
+ limit: parseInt(opts.limit, 10),
16
+ from: opts.from,
17
+ to: opts.to,
18
+ fromUser: opts.fromUser,
19
+ });
20
+ output(result);
21
+ });
22
+ }
23
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/message/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,IAAI,CAAC,MAAe;IAClC,MAAM;SACH,OAAO,CAAC,eAAe,CAAC;SACxB,WAAW,CAAC,yBAAyB,CAAC;SACtC,MAAM,CAAC,aAAa,EAAE,2BAA2B,EAAE,IAAI,CAAC;SACxD,MAAM,CAAC,mBAAmB,EAAE,kCAAkC,CAAC;SAC/D,MAAM,CAAC,iBAAiB,EAAE,mCAAmC,CAAC;SAC9D,MAAM,CAAC,sBAAsB,EAAE,0BAA0B,CAAC;SAC1D,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,IAAsE,EAAE,EAAE;QACvG,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC;YACnD,MAAM;YACN,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;YAC/B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function react(parent: Command): void;
3
+ //# sourceMappingURL=react.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/commands/message/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,KAAK,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAS3C"}
@@ -0,0 +1,13 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function react(parent) {
4
+ parent
5
+ .command('react <chatId> <messageId> <emoji>')
6
+ .description('Add a reaction to a message')
7
+ .action(async (chatId, messageId, emoji) => {
8
+ const client = await getClient();
9
+ await client.messages.setReaction({ chatId, messageId, reactionType: emoji });
10
+ output({ status: 'ok', chatId, messageId, reaction: emoji });
11
+ });
12
+ }
13
+ //# sourceMappingURL=react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/commands/message/react.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,KAAK,CAAC,MAAe;IACnC,MAAM;SACH,OAAO,CAAC,oCAAoC,CAAC;SAC7C,WAAW,CAAC,6BAA6B,CAAC;SAC1C,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,SAAiB,EAAE,KAAa,EAAE,EAAE;QACjE,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;QAC9E,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function search(parent: Command): void;
3
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/commands/message/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CA0B5C"}
@@ -0,0 +1,25 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function search(parent) {
4
+ parent
5
+ .command('search <query>')
6
+ .description('Search messages across Teams channels and chats')
7
+ .option('--scope <scope>', 'Search scope: all, channels, chats', 'all')
8
+ .option('--limit <n>', 'Max results (1-100)', '25')
9
+ .option('--mentions <userId>', 'Filter by mentions of user ID')
10
+ .option('--from <datetime>', 'Messages after this ISO datetime')
11
+ .option('--from-user <userId>', 'Filter by sender user ID')
12
+ .action(async (query, opts) => {
13
+ const client = await getClient();
14
+ const result = await client.messages.search({
15
+ query,
16
+ scope: opts.scope,
17
+ limit: parseInt(opts.limit, 10),
18
+ mentions: opts.mentions,
19
+ from: opts.from,
20
+ fromUser: opts.fromUser,
21
+ });
22
+ output(result);
23
+ });
24
+ }
25
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/commands/message/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,gBAAgB,CAAC;SACzB,WAAW,CAAC,iDAAiD,CAAC;SAC9D,MAAM,CAAC,iBAAiB,EAAE,oCAAoC,EAAE,KAAK,CAAC;SACtE,MAAM,CAAC,aAAa,EAAE,qBAAqB,EAAE,IAAI,CAAC;SAClD,MAAM,CAAC,qBAAqB,EAAE,+BAA+B,CAAC;SAC9D,MAAM,CAAC,mBAAmB,EAAE,kCAAkC,CAAC;SAC/D,MAAM,CAAC,sBAAsB,EAAE,0BAA0B,CAAC;SAC1D,MAAM,CACL,KAAK,EACH,KAAa,EACb,IAA2F,EAC3F,EAAE;QACF,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;YAC1C,KAAK;YACL,KAAK,EAAE,IAAI,CAAC,KAAqC;YACjD,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;YAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CACF,CAAC;AACN,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function send(parent: Command): void;
3
+ //# sourceMappingURL=send.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../../src/commands/message/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CA0B1C"}
@@ -0,0 +1,24 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function send(parent) {
4
+ parent
5
+ .command('send <chatId> <message>')
6
+ .description('Send a message to a chat')
7
+ .option('--importance <level>', 'Message importance: normal, high, urgent')
8
+ .option('--format <fmt>', 'Message format: text, markdown')
9
+ .option('--reply-to <id>', 'Message ID to reply to')
10
+ .option('--attachments <urls...>', 'SharePoint/OneDrive sharing links to attach')
11
+ .action(async (chatId, message, opts) => {
12
+ const client = await getClient();
13
+ const result = await client.messages.sendChatMessage({
14
+ chatId,
15
+ message,
16
+ importance: opts.importance,
17
+ format: opts.format,
18
+ replyToId: opts.replyTo,
19
+ attachments: opts.attachments,
20
+ });
21
+ output(result);
22
+ });
23
+ }
24
+ //# sourceMappingURL=send.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/commands/message/send.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,IAAI,CAAC,MAAe;IAClC,MAAM;SACH,OAAO,CAAC,yBAAyB,CAAC;SAClC,WAAW,CAAC,0BAA0B,CAAC;SACvC,MAAM,CAAC,sBAAsB,EAAE,0CAA0C,CAAC;SAC1E,MAAM,CAAC,gBAAgB,EAAE,gCAAgC,CAAC;SAC1D,MAAM,CAAC,iBAAiB,EAAE,wBAAwB,CAAC;SACnD,MAAM,CAAC,yBAAyB,EAAE,6CAA6C,CAAC;SAChF,MAAM,CACL,KAAK,EACH,MAAc,EACd,OAAe,EACf,IAAwF,EACxF,EAAE;QACF,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC;YACnD,MAAM;YACN,OAAO;YACP,UAAU,EAAE,IAAI,CAAC,UAAsD;YACvE,MAAM,EAAE,IAAI,CAAC,MAAyC;YACtD,SAAS,EAAE,IAAI,CAAC,OAAO;YACvB,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CACF,CAAC;AACN,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function unreact(parent: Command): void;
3
+ //# sourceMappingURL=unreact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unreact.d.ts","sourceRoot":"","sources":["../../../src/commands/message/unreact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAS7C"}
@@ -0,0 +1,13 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function unreact(parent) {
4
+ parent
5
+ .command('unreact <chatId> <messageId> <emoji>')
6
+ .description('Remove a reaction from a message')
7
+ .action(async (chatId, messageId, emoji) => {
8
+ const client = await getClient();
9
+ await client.messages.unsetReaction({ chatId, messageId, reactionType: emoji });
10
+ output({ status: 'ok', chatId, messageId, reaction: emoji });
11
+ });
12
+ }
13
+ //# sourceMappingURL=unreact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unreact.js","sourceRoot":"","sources":["../../../src/commands/message/unreact.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,OAAO,CAAC,MAAe;IACrC,MAAM;SACH,OAAO,CAAC,sCAAsC,CAAC;SAC/C,WAAW,CAAC,kCAAkC,CAAC;SAC/C,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,SAAiB,EAAE,KAAa,EAAE,EAAE;QACjE,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;QAChF,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function update(parent: Command): void;
3
+ //# sourceMappingURL=update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/message/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAmB5C"}
@@ -0,0 +1,21 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function update(parent) {
4
+ parent
5
+ .command('update <chatId> <messageId> <message>')
6
+ .description('Update an existing chat message')
7
+ .option('--importance <level>', 'Message importance: normal, high, urgent')
8
+ .option('--format <fmt>', 'Message format: text, markdown')
9
+ .action(async (chatId, messageId, message, opts) => {
10
+ const client = await getClient();
11
+ await client.messages.updateChatMessage({
12
+ chatId,
13
+ messageId,
14
+ message,
15
+ importance: opts.importance,
16
+ format: opts.format,
17
+ });
18
+ output({ status: 'ok', chatId, messageId });
19
+ });
20
+ }
21
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/message/update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,uCAAuC,CAAC;SAChD,WAAW,CAAC,iCAAiC,CAAC;SAC9C,MAAM,CAAC,sBAAsB,EAAE,0CAA0C,CAAC;SAC1E,MAAM,CAAC,gBAAgB,EAAE,gCAAgC,CAAC;SAC1D,MAAM,CACL,KAAK,EAAE,MAAc,EAAE,SAAiB,EAAE,OAAe,EAAE,IAA8C,EAAE,EAAE;QAC3G,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC;YACtC,MAAM;YACN,SAAS;YACT,OAAO;YACP,UAAU,EAAE,IAAI,CAAC,UAAsD;YACvE,MAAM,EAAE,IAAI,CAAC,MAAyC;SACvD,CAAC,CAAC;QACH,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IAC9C,CAAC,CACF,CAAC;AACN,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function download(parent: Command): void;
3
+ //# sourceMappingURL=download.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../../src/commands/transcript/download.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAoC9C"}
@@ -0,0 +1,37 @@
1
+ import { writeFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { extractMeetingInfoFromJoinUrl } from 'microsoft-graph-client';
4
+ import { getClient } from '../../utils/client.js';
5
+ import { output } from '../../utils/output.js';
6
+ export function download(parent) {
7
+ parent
8
+ .command('download <chatId>')
9
+ .description('Download all transcripts for a meeting chat')
10
+ .option('--target-dir <path>', 'Directory to save files', '.')
11
+ .action(async (chatId, opts) => {
12
+ const client = await getClient();
13
+ const chat = await client.chats.get({ chatId });
14
+ const onlineMeetingInfo = chat.onlineMeetingInfo;
15
+ const joinUrl = onlineMeetingInfo?.joinWebUrl;
16
+ if (!joinUrl) {
17
+ output({ error: 'No online meeting associated with this chat' });
18
+ return;
19
+ }
20
+ const meetingInfo = extractMeetingInfoFromJoinUrl(joinUrl);
21
+ const transcripts = await client.transcripts.list({ meetingId: meetingInfo.meetingId });
22
+ const files = [];
23
+ for (const t of transcripts) {
24
+ const content = await client.transcripts.getContent({
25
+ meetingId: meetingInfo.meetingId,
26
+ transcriptId: t.id,
27
+ });
28
+ const filename = `transcript-${t.id}.txt`;
29
+ const filePath = join(opts.targetDir, filename);
30
+ const text = typeof content === 'string' ? content : JSON.stringify(content, null, 2);
31
+ writeFileSync(filePath, text, 'utf-8');
32
+ files.push({ transcriptId: t.id, path: filePath, size: Buffer.byteLength(text) });
33
+ }
34
+ output({ meetingId: meetingInfo.meetingId, files });
35
+ });
36
+ }
37
+ //# sourceMappingURL=download.js.map