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 registerAuthCommands(program: Command): void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAI3D"}
@@ -0,0 +1,9 @@
1
+ import { loginCommand } from './login.js';
2
+ import { logoutCommand } from './logout.js';
3
+ import { statusCommand } from './status.js';
4
+ export function registerAuthCommands(program) {
5
+ loginCommand(program);
6
+ logoutCommand(program);
7
+ statusCommand(program);
8
+ }
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/auth/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,YAAY,CAAC,OAAO,CAAC,CAAC;IACtB,aAAa,CAAC,OAAO,CAAC,CAAC;IACvB,aAAa,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function loginCommand(parent: Command): void;
3
+ //# sourceMappingURL=login.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAgBlD"}
@@ -0,0 +1,16 @@
1
+ import { login } from '../../utils/auth.js';
2
+ export function loginCommand(parent) {
3
+ parent
4
+ .command('login')
5
+ .description('Authenticate with Microsoft Graph')
6
+ .option('--device-code', 'Use device code flow (for headless/SSH environments)')
7
+ .addHelpText('after', `
8
+ Examples:
9
+ $ msgraph login # Opens browser for login
10
+ $ msgraph login --device-code # Prints URL + code for device login`)
11
+ .action(async (opts) => {
12
+ await login({ deviceCode: opts.deviceCode });
13
+ process.stderr.write(`${JSON.stringify({ status: 'Login successful' })}\n`);
14
+ });
15
+ }
16
+ //# sourceMappingURL=login.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,MAAM,UAAU,YAAY,CAAC,MAAe;IAC1C,MAAM;SACH,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,mCAAmC,CAAC;SAChD,MAAM,CAAC,eAAe,EAAE,sDAAsD,CAAC;SAC/E,WAAW,CACV,OAAO,EACP;;;0EAGoE,CACrE;SACA,MAAM,CAAC,KAAK,EAAE,IAA8B,EAAE,EAAE;QAC/C,MAAM,KAAK,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QAC7C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC,IAAI,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function logoutCommand(parent: Command): void;
3
+ //# sourceMappingURL=logout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAQnD"}
@@ -0,0 +1,11 @@
1
+ import { logout } from '../../utils/auth.js';
2
+ export function logoutCommand(parent) {
3
+ parent
4
+ .command('logout')
5
+ .description('Clear stored credentials')
6
+ .action(() => {
7
+ logout();
8
+ process.stderr.write(`${JSON.stringify({ status: 'Logged out' })}\n`);
9
+ });
10
+ }
11
+ //# sourceMappingURL=logout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logout.js","sourceRoot":"","sources":["../../../src/commands/auth/logout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,MAAM,UAAU,aAAa,CAAC,MAAe;IAC3C,MAAM;SACH,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,0BAA0B,CAAC;SACvC,MAAM,CAAC,GAAG,EAAE;QACX,MAAM,EAAE,CAAC;QACT,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,IAAI,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function statusCommand(parent: Command): void;
3
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAoCnD"}
@@ -0,0 +1,38 @@
1
+ import { GraphClient } from 'microsoft-graph-client';
2
+ import { getAuthStatus, getAccessToken } from '../../utils/auth.js';
3
+ import { output } from '../../utils/output.js';
4
+ export function statusCommand(parent) {
5
+ parent
6
+ .command('status')
7
+ .description('Show current authentication state')
8
+ .action(async () => {
9
+ const status = getAuthStatus();
10
+ if (!status.loggedIn) {
11
+ output({ loggedIn: false, hint: 'Run `msgraph login` to authenticate.' });
12
+ return;
13
+ }
14
+ const clientId = process.env.MSGRAPH_CLIENT_ID;
15
+ const tenantId = process.env.MSGRAPH_TENANT_ID;
16
+ if (!clientId || !tenantId) {
17
+ output({
18
+ loggedIn: true,
19
+ tokenValid: 'unknown',
20
+ hint: 'Set MSGRAPH_CLIENT_ID and MSGRAPH_TENANT_ID to verify token.',
21
+ });
22
+ return;
23
+ }
24
+ const accessToken = await getAccessToken();
25
+ const client = new GraphClient({ clientId, tenantId, accessToken });
26
+ client.initialize();
27
+ const user = await client.users.getCurrentUser();
28
+ output({
29
+ loggedIn: true,
30
+ user: {
31
+ displayName: user.displayName,
32
+ mail: user.mail,
33
+ id: user.id,
34
+ },
35
+ });
36
+ });
37
+ }
38
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/commands/auth/status.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,aAAa,CAAC,MAAe;IAC3C,MAAM;SACH,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,mCAAmC,CAAC;SAChD,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;QAC/B,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;YACrB,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,sCAAsC,EAAE,CAAC,CAAC;YAC1E,OAAO;QACT,CAAC;QAED,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;QAC/C,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;QAC/C,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC3B,MAAM,CAAC;gBACL,QAAQ,EAAE,IAAI;gBACd,UAAU,EAAE,SAAS;gBACrB,IAAI,EAAE,8DAA8D;aACrE,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAED,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;QAC3C,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;QACpE,MAAM,CAAC,UAAU,EAAE,CAAC;QACpB,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;QAEjD,MAAM,CAAC;YACL,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE;gBACJ,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,EAAE,EAAE,IAAI,CAAC,EAAE;aACZ;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function cancel(parent: Command): void;
3
+ //# sourceMappingURL=cancel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cancel.d.ts","sourceRoot":"","sources":["../../../src/commands/calendar/cancel.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 cancel(parent) {
4
+ parent
5
+ .command('cancel <eventId>')
6
+ .description('Cancel a calendar event')
7
+ .option('--comment <text>', 'Cancellation message to attendees')
8
+ .action(async (eventId, opts) => {
9
+ const client = await getClient();
10
+ await client.calendar.cancelEvent({ eventId, comment: opts.comment });
11
+ output({ status: 'ok', eventId });
12
+ });
13
+ }
14
+ //# sourceMappingURL=cancel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cancel.js","sourceRoot":"","sources":["../../../src/commands/calendar/cancel.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,kBAAkB,CAAC;SAC3B,WAAW,CAAC,yBAAyB,CAAC;SACtC,MAAM,CAAC,kBAAkB,EAAE,mCAAmC,CAAC;SAC/D,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,IAA0B,EAAE,EAAE;QAC5D,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QACtE,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function create(parent: Command): void;
3
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/calendar/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAwC5C"}
@@ -0,0 +1,31 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function create(parent) {
4
+ parent
5
+ .command('create')
6
+ .description('Create a calendar event')
7
+ .requiredOption('--subject <text>', 'Event title')
8
+ .requiredOption('--start <datetime>', 'Start time (ISO 8601 UTC)')
9
+ .requiredOption('--end <datetime>', 'End time (ISO 8601 UTC)')
10
+ .requiredOption('--body <text>', 'Event description/agenda')
11
+ .option('--attendees <json>', 'Attendees as JSON array: [{"email":"a@b.com","type":"required"}] or ["a@b.com"]')
12
+ .option('--location <text>', 'Location')
13
+ .option('--online', 'Create as Teams online meeting')
14
+ .action(async (opts) => {
15
+ const client = await getClient();
16
+ const attendees = opts.attendees
17
+ ? JSON.parse(opts.attendees)
18
+ : undefined;
19
+ const result = await client.calendar.createEvent({
20
+ subject: opts.subject,
21
+ startDateTime: opts.start,
22
+ endDateTime: opts.end,
23
+ body: opts.body,
24
+ attendees,
25
+ location: opts.location,
26
+ isOnlineMeeting: opts.online,
27
+ });
28
+ output(result);
29
+ });
30
+ }
31
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/calendar/create.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,QAAQ,CAAC;SACjB,WAAW,CAAC,yBAAyB,CAAC;SACtC,cAAc,CAAC,kBAAkB,EAAE,aAAa,CAAC;SACjD,cAAc,CAAC,oBAAoB,EAAE,2BAA2B,CAAC;SACjE,cAAc,CAAC,kBAAkB,EAAE,yBAAyB,CAAC;SAC7D,cAAc,CAAC,eAAe,EAAE,0BAA0B,CAAC;SAC3D,MAAM,CAAC,oBAAoB,EAAE,iFAAiF,CAAC;SAC/G,MAAM,CAAC,mBAAmB,EAAE,UAAU,CAAC;SACvC,MAAM,CAAC,UAAU,EAAE,gCAAgC,CAAC;SACpD,MAAM,CACL,KAAK,EAAE,IAQN,EAAE,EAAE;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS;YAC9B,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAGtB;YACN,CAAC,CAAC,SAAS,CAAC;QACd,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC;YAC/C,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,aAAa,EAAE,IAAI,CAAC,KAAK;YACzB,WAAW,EAAE,IAAI,CAAC,GAAG;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,SAAS;YACT,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,eAAe,EAAE,IAAI,CAAC,MAAM;SAC7B,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 events(parent: Command): void;
3
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/commands/calendar/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAkB5C"}
@@ -0,0 +1,22 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function events(parent) {
4
+ parent
5
+ .command('events')
6
+ .description('List calendar events (defaults to next 30 days)')
7
+ .option('--from <datetime>', 'Start of time range (ISO datetime UTC)')
8
+ .option('--to <datetime>', 'End of time range (ISO datetime UTC)')
9
+ .option('--subject <text>', 'Filter by subject text')
10
+ .option('--limit <n>', 'Max events (1-100)', '50')
11
+ .action(async (opts) => {
12
+ const client = await getClient();
13
+ const result = await client.calendar.getEvents({
14
+ from: opts.from,
15
+ to: opts.to,
16
+ subject: opts.subject,
17
+ limit: parseInt(opts.limit, 10),
18
+ });
19
+ output(result);
20
+ });
21
+ }
22
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/commands/calendar/events.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,QAAQ,CAAC;SACjB,WAAW,CAAC,iDAAiD,CAAC;SAC9D,MAAM,CAAC,mBAAmB,EAAE,wCAAwC,CAAC;SACrE,MAAM,CAAC,iBAAiB,EAAE,sCAAsC,CAAC;SACjE,MAAM,CAAC,kBAAkB,EAAE,wBAAwB,CAAC;SACpD,MAAM,CAAC,aAAa,EAAE,oBAAoB,EAAE,IAAI,CAAC;SACjD,MAAM,CAAC,KAAK,EAAE,IAAqE,EAAE,EAAE;QACtF,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;YAC7C,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;SAChC,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 findTimes(parent: Command): void;
3
+ //# sourceMappingURL=find-times.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-times.d.ts","sourceRoot":"","sources":["../../../src/commands/calendar/find-times.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAkB/C"}
@@ -0,0 +1,22 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function findTimes(parent) {
4
+ parent
5
+ .command('find-times')
6
+ .description('Find available meeting times')
7
+ .requiredOption('--attendees <json>', 'Attendees JSON: [{"email":"a@b.com","type":"required"}]')
8
+ .requiredOption('--start <datetime>', 'Start of search window (ISO 8601 UTC)')
9
+ .requiredOption('--end <datetime>', 'End of search window (ISO 8601 UTC)')
10
+ .requiredOption('--duration <iso8601>', 'Meeting duration (e.g., PT30M, PT1H)')
11
+ .action(async (opts) => {
12
+ const client = await getClient();
13
+ const result = await client.calendar.findMeetingTimes({
14
+ attendees: JSON.parse(opts.attendees),
15
+ startDateTime: opts.start,
16
+ endDateTime: opts.end,
17
+ meetingDuration: opts.duration,
18
+ });
19
+ output(result);
20
+ });
21
+ }
22
+ //# sourceMappingURL=find-times.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-times.js","sourceRoot":"","sources":["../../../src/commands/calendar/find-times.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,SAAS,CAAC,MAAe;IACvC,MAAM;SACH,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CAAC,8BAA8B,CAAC;SAC3C,cAAc,CAAC,oBAAoB,EAAE,yDAAyD,CAAC;SAC/F,cAAc,CAAC,oBAAoB,EAAE,uCAAuC,CAAC;SAC7E,cAAc,CAAC,kBAAkB,EAAE,qCAAqC,CAAC;SACzE,cAAc,CAAC,sBAAsB,EAAE,sCAAsC,CAAC;SAC9E,MAAM,CAAC,KAAK,EAAE,IAAyE,EAAE,EAAE;QAC1F,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC;YACpD,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAuD;YAC3F,aAAa,EAAE,IAAI,CAAC,KAAK;YACzB,WAAW,EAAE,IAAI,CAAC,GAAG;YACrB,eAAe,EAAE,IAAI,CAAC,QAAQ;SAC/B,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 registerCalendarCommands(program: Command): void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/calendar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAM/D"}
@@ -0,0 +1,12 @@
1
+ import { cancel } from './cancel.js';
2
+ import { create } from './create.js';
3
+ import { events } from './events.js';
4
+ import { findTimes } from './find-times.js';
5
+ export function registerCalendarCommands(program) {
6
+ const calendar = program.command('calendar').description('Calendar operations');
7
+ events(calendar);
8
+ create(calendar);
9
+ cancel(calendar);
10
+ findTimes(calendar);
11
+ }
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/calendar/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,UAAU,wBAAwB,CAAC,OAAgB;IACvD,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAChF,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjB,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjB,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjB,SAAS,CAAC,QAAQ,CAAC,CAAC;AACtB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function create(parent: Command): void;
3
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/chat/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CA6B5C"}
@@ -0,0 +1,26 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function create(parent) {
4
+ parent
5
+ .command('create <emails...>')
6
+ .description('Create a new chat (1:1 or group)')
7
+ .option('--topic <text>', 'Chat topic (for group chats)')
8
+ .addHelpText('after', `
9
+ Examples:
10
+ $ msgraph chat create user@company.com
11
+ $ msgraph chat create user1@company.com user2@company.com --topic "Project X"`)
12
+ .action(async (emails, opts) => {
13
+ const client = await getClient();
14
+ const chatType = emails.length === 1 ? 'oneOnOne' : 'group';
15
+ const me = await client.users.getCurrentUser();
16
+ const makeMember = (userId) => ({
17
+ '@odata.type': '#microsoft.graph.aadUserConversationMember',
18
+ roles: ['owner'],
19
+ 'user@odata.bind': `https://graph.microsoft.com/v1.0/users('${userId}')`,
20
+ });
21
+ const members = [makeMember(me.id), ...emails.map(makeMember)];
22
+ const chat = await client.chats.create({ chatType, members, topic: opts.topic });
23
+ output({ id: chat.id, topic: chat.topic, chatType: chat.chatType });
24
+ });
25
+ }
26
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/chat/create.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,oBAAoB,CAAC;SAC7B,WAAW,CAAC,kCAAkC,CAAC;SAC/C,MAAM,CAAC,gBAAgB,EAAE,8BAA8B,CAAC;SACxD,WAAW,CACV,OAAO,EACP;;;gFAG0E,CAC3E;SACA,MAAM,CAAC,KAAK,EAAE,MAAgB,EAAE,IAAwB,EAAE,EAAE;QAC3D,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC;QAC5D,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;QAE/C,MAAM,UAAU,GAAG,CAAC,MAAc,EAAuD,EAAE,CACzF,CAAC;YACC,aAAa,EAAE,4CAA4C;YAC3D,KAAK,EAAE,CAAC,OAAO,CAAC;YAChB,iBAAiB,EAAE,2CAA2C,MAAM,IAAI;SACzE,CAAmE,CAAC;QAEvE,MAAM,OAAO,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,EAAG,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;QAEhE,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QACjF,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACtE,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/chat/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAiBzC"}
@@ -0,0 +1,21 @@
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>')
6
+ .description('Get chat details by ID')
7
+ .action(async (chatId) => {
8
+ const client = await getClient();
9
+ const chat = await client.chats.get({ chatId });
10
+ output({
11
+ id: chat.id,
12
+ topic: chat.topic,
13
+ chatType: chat.chatType,
14
+ members: chat.members?.map((m) => ({
15
+ displayName: m.displayName,
16
+ id: m.id,
17
+ })),
18
+ });
19
+ });
20
+ }
21
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/chat/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,cAAc,CAAC;SACvB,WAAW,CAAC,wBAAwB,CAAC;SACrC,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,EAAE;QAC/B,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QAChD,MAAM,CAAC;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBACjC,WAAW,EAAE,CAAC,CAAC,WAAW;gBAC1B,EAAE,EAAE,CAAC,CAAC,EAAE;aACT,CAAC,CAAC;SACJ,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerChatCommands(program: Command): void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/chat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAK3D"}
@@ -0,0 +1,10 @@
1
+ import { create } from './create.js';
2
+ import { get } from './get.js';
3
+ import { search } from './search.js';
4
+ export function registerChatCommands(program) {
5
+ const chat = program.command('chat').description('Chat operations');
6
+ get(chat);
7
+ search(chat);
8
+ create(chat);
9
+ }
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/chat/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IACpE,GAAG,CAAC,IAAI,CAAC,CAAC;IACV,MAAM,CAAC,IAAI,CAAC,CAAC;IACb,MAAM,CAAC,IAAI,CAAC,CAAC;AACf,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/chat/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAsB5C"}
@@ -0,0 +1,24 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function search(parent) {
4
+ parent
5
+ .command('search')
6
+ .description('Search chats by topic or type')
7
+ .option('--term <text>', 'Search by topic name (case-insensitive, partial match)')
8
+ .option('--types <types...>', 'Filter by chat types: oneOnOne, group, meeting')
9
+ .option('--limit <n>', 'Maximum results (1-50)', '20')
10
+ .action(async (opts) => {
11
+ const client = await getClient();
12
+ const result = await client.chats.list({
13
+ searchTerm: opts.term,
14
+ chatTypes: opts.types,
15
+ top: parseInt(opts.limit, 10),
16
+ });
17
+ output(result.chats.map((c) => ({
18
+ id: c.id,
19
+ topic: c.topic,
20
+ chatType: c.chatType,
21
+ })));
22
+ });
23
+ }
24
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/commands/chat/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,QAAQ,CAAC;SACjB,WAAW,CAAC,+BAA+B,CAAC;SAC5C,MAAM,CAAC,eAAe,EAAE,wDAAwD,CAAC;SACjF,MAAM,CAAC,oBAAoB,EAAE,gDAAgD,CAAC;SAC9E,MAAM,CAAC,aAAa,EAAE,wBAAwB,EAAE,IAAI,CAAC;SACrD,MAAM,CAAC,KAAK,EAAE,IAAwD,EAAE,EAAE;QACzE,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;YACrC,UAAU,EAAE,IAAI,CAAC,IAAI;YACrB,SAAS,EAAE,IAAI,CAAC,KAAyD;YACzE,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;SAC9B,CAAC,CAAC;QACH,MAAM,CACJ,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACvB,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,QAAQ,EAAE,CAAC,CAAC,QAAQ;SACrB,CAAC,CAAC,CACJ,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function downloadHosted(parent: Command): void;
3
+ //# sourceMappingURL=download-hosted.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download-hosted.d.ts","sourceRoot":"","sources":["../../../src/commands/file/download-hosted.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAyBpD"}
@@ -0,0 +1,30 @@
1
+ import { writeFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { getClient } from '../../utils/client.js';
4
+ import { output } from '../../utils/output.js';
5
+ export function downloadHosted(parent) {
6
+ parent
7
+ .command('download-hosted <chatId> <messageId> <contentIds...>')
8
+ .description('Download inline images from a Teams message')
9
+ .option('--target-dir <path>', 'Directory to save files', '.')
10
+ .action(async (chatId, messageId, contentIds, opts) => {
11
+ const client = await getClient();
12
+ const sdk = client.getSDKClient();
13
+ const results = [];
14
+ for (const contentId of contentIds) {
15
+ try {
16
+ const response = (await sdk
17
+ .api(`/chats/${chatId}/messages/${messageId}/hostedContents/${contentId}/$value`)
18
+ .get());
19
+ const filePath = join(opts.targetDir, `${contentId}.png`);
20
+ writeFileSync(filePath, Buffer.from(response));
21
+ results.push({ contentId, path: filePath });
22
+ }
23
+ catch (err) {
24
+ results.push({ contentId, error: err instanceof Error ? err.message : String(err) });
25
+ }
26
+ }
27
+ output(results);
28
+ });
29
+ }
30
+ //# sourceMappingURL=download-hosted.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download-hosted.js","sourceRoot":"","sources":["../../../src/commands/file/download-hosted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,cAAc,CAAC,MAAe;IAC5C,MAAM;SACH,OAAO,CAAC,sDAAsD,CAAC;SAC/D,WAAW,CAAC,6CAA6C,CAAC;SAC1D,MAAM,CAAC,qBAAqB,EAAE,yBAAyB,EAAE,GAAG,CAAC;SAC7D,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,SAAiB,EAAE,UAAoB,EAAE,IAA2B,EAAE,EAAE;QACrG,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;QAClC,MAAM,OAAO,GAA2D,EAAE,CAAC;QAE3E,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,CAAC,MAAM,GAAG;qBACxB,GAAG,CAAC,UAAU,MAAM,aAAa,SAAS,mBAAmB,SAAS,SAAS,CAAC;qBAChF,GAAG,EAAE,CAAgB,CAAC;gBACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,SAAS,MAAM,CAAC,CAAC;gBAC1D,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAC/C,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;YAC9C,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACvF,CAAC;QACH,CAAC;QAED,MAAM,CAAC,OAAO,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,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/file/download.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CA6B9C"}
@@ -0,0 +1,27 @@
1
+ import { writeFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { getClient } from '../../utils/client.js';
4
+ import { output } from '../../utils/output.js';
5
+ export function download(parent) {
6
+ parent
7
+ .command('download <urls...>')
8
+ .description('Download files from SharePoint/OneDrive URLs')
9
+ .option('--target-dir <path>', 'Directory to save files', '.')
10
+ .action(async (urls, opts) => {
11
+ const client = await getClient();
12
+ const results = [];
13
+ for (const url of urls) {
14
+ try {
15
+ const result = await client.files.download({ contentUrl: url });
16
+ const filePath = join(opts.targetDir, result.filename);
17
+ writeFileSync(filePath, result.data);
18
+ results.push({ url, path: filePath, size: result.size, itemId: result.itemId, driveId: result.driveId });
19
+ }
20
+ catch (err) {
21
+ results.push({ url, error: err instanceof Error ? err.message : String(err) });
22
+ }
23
+ }
24
+ output(results);
25
+ });
26
+ }
27
+ //# sourceMappingURL=download.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download.js","sourceRoot":"","sources":["../../../src/commands/file/download.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,QAAQ,CAAC,MAAe;IACtC,MAAM;SACH,OAAO,CAAC,oBAAoB,CAAC;SAC7B,WAAW,CAAC,8CAA8C,CAAC;SAC3D,MAAM,CAAC,qBAAqB,EAAE,yBAAyB,EAAE,GAAG,CAAC;SAC7D,MAAM,CAAC,KAAK,EAAE,IAAc,EAAE,IAA2B,EAAE,EAAE;QAC5D,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,OAAO,GAOP,EAAE,CAAC;QAET,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;gBAChE,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;gBACvD,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;gBACrC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;YAC3G,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACjF,CAAC;QACH,CAAC;QAED,MAAM,CAAC,OAAO,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function grant(parent: Command): void;
3
+ //# sourceMappingURL=grant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grant.d.ts","sourceRoot":"","sources":["../../../src/commands/file/grant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,KAAK,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAgB3C"}
@@ -0,0 +1,20 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function grant(parent) {
4
+ parent
5
+ .command('grant <itemId> <driveId>')
6
+ .description('Grant file permissions to users')
7
+ .requiredOption('--emails <emails...>', 'User email addresses')
8
+ .requiredOption('--role <role>', 'Permission: read, write')
9
+ .action(async (itemId, driveId, opts) => {
10
+ const client = await getClient();
11
+ await client.files.grantPermission({
12
+ itemId,
13
+ driveId,
14
+ emails: opts.emails,
15
+ role: opts.role,
16
+ });
17
+ output({ status: 'ok', itemId, driveId, emails: opts.emails, role: opts.role });
18
+ });
19
+ }
20
+ //# sourceMappingURL=grant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grant.js","sourceRoot":"","sources":["../../../src/commands/file/grant.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,0BAA0B,CAAC;SACnC,WAAW,CAAC,iCAAiC,CAAC;SAC9C,cAAc,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;SAC9D,cAAc,CAAC,eAAe,EAAE,yBAAyB,CAAC;SAC1D,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,OAAe,EAAE,IAAwC,EAAE,EAAE;QAC1F,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC;YACjC,MAAM;YACN,OAAO;YACP,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,IAAwB;SACpC,CAAC,CAAC;QACH,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAClF,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerFileCommands(program: Command): void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/file/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAO3D"}
@@ -0,0 +1,14 @@
1
+ import { downloadHosted } from './download-hosted.js';
2
+ import { download } from './download.js';
3
+ import { grant } from './grant.js';
4
+ import { update } from './update.js';
5
+ import { upload } from './upload.js';
6
+ export function registerFileCommands(program) {
7
+ const file = program.command('file').description('File operations (SharePoint/OneDrive)');
8
+ download(file);
9
+ downloadHosted(file);
10
+ upload(file);
11
+ update(file);
12
+ grant(file);
13
+ }
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/file/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,uCAAuC,CAAC,CAAC;IAC1F,QAAQ,CAAC,IAAI,CAAC,CAAC;IACf,cAAc,CAAC,IAAI,CAAC,CAAC;IACrB,MAAM,CAAC,IAAI,CAAC,CAAC;IACb,MAAM,CAAC,IAAI,CAAC,CAAC;IACb,KAAK,CAAC,IAAI,CAAC,CAAC;AACd,CAAC"}