@jbctechsolutions/mcp-office365 2.5.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 (339) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +667 -0
  3. package/dist/applescript/account-repository.d.ts +30 -0
  4. package/dist/applescript/account-repository.d.ts.map +1 -0
  5. package/dist/applescript/account-repository.js +38 -0
  6. package/dist/applescript/account-repository.js.map +1 -0
  7. package/dist/applescript/account-scripts.d.ts +21 -0
  8. package/dist/applescript/account-scripts.d.ts.map +1 -0
  9. package/dist/applescript/account-scripts.js +180 -0
  10. package/dist/applescript/account-scripts.js.map +1 -0
  11. package/dist/applescript/calendar-manager.d.ts +44 -0
  12. package/dist/applescript/calendar-manager.d.ts.map +1 -0
  13. package/dist/applescript/calendar-manager.js +92 -0
  14. package/dist/applescript/calendar-manager.js.map +1 -0
  15. package/dist/applescript/calendar-writer.d.ts +36 -0
  16. package/dist/applescript/calendar-writer.d.ts.map +1 -0
  17. package/dist/applescript/calendar-writer.js +94 -0
  18. package/dist/applescript/calendar-writer.js.map +1 -0
  19. package/dist/applescript/content-readers.d.ts +114 -0
  20. package/dist/applescript/content-readers.d.ts.map +1 -0
  21. package/dist/applescript/content-readers.js +328 -0
  22. package/dist/applescript/content-readers.js.map +1 -0
  23. package/dist/applescript/executor.d.ts +60 -0
  24. package/dist/applescript/executor.d.ts.map +1 -0
  25. package/dist/applescript/executor.js +173 -0
  26. package/dist/applescript/executor.js.map +1 -0
  27. package/dist/applescript/index.d.ts +20 -0
  28. package/dist/applescript/index.d.ts.map +1 -0
  29. package/dist/applescript/index.js +29 -0
  30. package/dist/applescript/index.js.map +1 -0
  31. package/dist/applescript/mail-sender.d.ts +38 -0
  32. package/dist/applescript/mail-sender.d.ts.map +1 -0
  33. package/dist/applescript/mail-sender.js +67 -0
  34. package/dist/applescript/mail-sender.js.map +1 -0
  35. package/dist/applescript/parser.d.ts +235 -0
  36. package/dist/applescript/parser.d.ts.map +1 -0
  37. package/dist/applescript/parser.js +496 -0
  38. package/dist/applescript/parser.js.map +1 -0
  39. package/dist/applescript/repository.d.ts +64 -0
  40. package/dist/applescript/repository.d.ts.map +1 -0
  41. package/dist/applescript/repository.js +444 -0
  42. package/dist/applescript/repository.js.map +1 -0
  43. package/dist/applescript/scripts.d.ts +265 -0
  44. package/dist/applescript/scripts.d.ts.map +1 -0
  45. package/dist/applescript/scripts.js +1483 -0
  46. package/dist/applescript/scripts.js.map +1 -0
  47. package/dist/approval/hash.d.ts +87 -0
  48. package/dist/approval/hash.d.ts.map +1 -0
  49. package/dist/approval/hash.js +102 -0
  50. package/dist/approval/hash.js.map +1 -0
  51. package/dist/approval/index.d.ts +13 -0
  52. package/dist/approval/index.d.ts.map +1 -0
  53. package/dist/approval/index.js +7 -0
  54. package/dist/approval/index.js.map +1 -0
  55. package/dist/approval/token-manager.d.ts +51 -0
  56. package/dist/approval/token-manager.d.ts.map +1 -0
  57. package/dist/approval/token-manager.js +111 -0
  58. package/dist/approval/token-manager.js.map +1 -0
  59. package/dist/approval/types.d.ts +44 -0
  60. package/dist/approval/types.d.ts.map +1 -0
  61. package/dist/approval/types.js +6 -0
  62. package/dist/approval/types.js.map +1 -0
  63. package/dist/cli.d.ts +30 -0
  64. package/dist/cli.d.ts.map +1 -0
  65. package/dist/cli.js +143 -0
  66. package/dist/cli.js.map +1 -0
  67. package/dist/config.d.ts +27 -0
  68. package/dist/config.d.ts.map +1 -0
  69. package/dist/config.js +42 -0
  70. package/dist/config.js.map +1 -0
  71. package/dist/database/connection.d.ts +77 -0
  72. package/dist/database/connection.d.ts.map +1 -0
  73. package/dist/database/connection.js +130 -0
  74. package/dist/database/connection.js.map +1 -0
  75. package/dist/database/index.d.ts +11 -0
  76. package/dist/database/index.d.ts.map +1 -0
  77. package/dist/database/index.js +11 -0
  78. package/dist/database/index.js.map +1 -0
  79. package/dist/database/queries.d.ts +93 -0
  80. package/dist/database/queries.d.ts.map +1 -0
  81. package/dist/database/queries.js +430 -0
  82. package/dist/database/queries.js.map +1 -0
  83. package/dist/database/repository.d.ts +198 -0
  84. package/dist/database/repository.d.ts.map +1 -0
  85. package/dist/database/repository.js +199 -0
  86. package/dist/database/repository.js.map +1 -0
  87. package/dist/graph/attachments.d.ts +72 -0
  88. package/dist/graph/attachments.d.ts.map +1 -0
  89. package/dist/graph/attachments.js +207 -0
  90. package/dist/graph/attachments.js.map +1 -0
  91. package/dist/graph/auth/config.d.ts +34 -0
  92. package/dist/graph/auth/config.d.ts.map +1 -0
  93. package/dist/graph/auth/config.js +78 -0
  94. package/dist/graph/auth/config.js.map +1 -0
  95. package/dist/graph/auth/device-code-flow.d.ts +55 -0
  96. package/dist/graph/auth/device-code-flow.d.ts.map +1 -0
  97. package/dist/graph/auth/device-code-flow.js +180 -0
  98. package/dist/graph/auth/device-code-flow.js.map +1 -0
  99. package/dist/graph/auth/index.d.ts +13 -0
  100. package/dist/graph/auth/index.d.ts.map +1 -0
  101. package/dist/graph/auth/index.js +13 -0
  102. package/dist/graph/auth/index.js.map +1 -0
  103. package/dist/graph/auth/token-cache.d.ts +41 -0
  104. package/dist/graph/auth/token-cache.d.ts.map +1 -0
  105. package/dist/graph/auth/token-cache.js +105 -0
  106. package/dist/graph/auth/token-cache.js.map +1 -0
  107. package/dist/graph/client/batch.d.ts +38 -0
  108. package/dist/graph/client/batch.d.ts.map +1 -0
  109. package/dist/graph/client/batch.js +33 -0
  110. package/dist/graph/client/batch.js.map +1 -0
  111. package/dist/graph/client/cache.d.ts +64 -0
  112. package/dist/graph/client/cache.d.ts.map +1 -0
  113. package/dist/graph/client/cache.js +108 -0
  114. package/dist/graph/client/cache.js.map +1 -0
  115. package/dist/graph/client/graph-client.d.ts +630 -0
  116. package/dist/graph/client/graph-client.d.ts.map +1 -0
  117. package/dist/graph/client/graph-client.js +1771 -0
  118. package/dist/graph/client/graph-client.js.map +1 -0
  119. package/dist/graph/client/index.d.ts +12 -0
  120. package/dist/graph/client/index.d.ts.map +1 -0
  121. package/dist/graph/client/index.js +12 -0
  122. package/dist/graph/client/index.js.map +1 -0
  123. package/dist/graph/content-readers.d.ts +106 -0
  124. package/dist/graph/content-readers.d.ts.map +1 -0
  125. package/dist/graph/content-readers.js +321 -0
  126. package/dist/graph/content-readers.js.map +1 -0
  127. package/dist/graph/index.d.ts +18 -0
  128. package/dist/graph/index.d.ts.map +1 -0
  129. package/dist/graph/index.js +23 -0
  130. package/dist/graph/index.js.map +1 -0
  131. package/dist/graph/mailbox-adapter.d.ts +30 -0
  132. package/dist/graph/mailbox-adapter.d.ts.map +1 -0
  133. package/dist/graph/mailbox-adapter.js +59 -0
  134. package/dist/graph/mailbox-adapter.js.map +1 -0
  135. package/dist/graph/mappers/contact-mapper.d.ts +14 -0
  136. package/dist/graph/mappers/contact-mapper.d.ts.map +1 -0
  137. package/dist/graph/mappers/contact-mapper.js +20 -0
  138. package/dist/graph/mappers/contact-mapper.js.map +1 -0
  139. package/dist/graph/mappers/email-mapper.d.ts +14 -0
  140. package/dist/graph/mappers/email-mapper.d.ts.map +1 -0
  141. package/dist/graph/mappers/email-mapper.js +44 -0
  142. package/dist/graph/mappers/email-mapper.js.map +1 -0
  143. package/dist/graph/mappers/event-mapper.d.ts +14 -0
  144. package/dist/graph/mappers/event-mapper.d.ts.map +1 -0
  145. package/dist/graph/mappers/event-mapper.js +31 -0
  146. package/dist/graph/mappers/event-mapper.js.map +1 -0
  147. package/dist/graph/mappers/folder-mapper.d.ts +22 -0
  148. package/dist/graph/mappers/folder-mapper.d.ts.map +1 -0
  149. package/dist/graph/mappers/folder-mapper.js +51 -0
  150. package/dist/graph/mappers/folder-mapper.js.map +1 -0
  151. package/dist/graph/mappers/index.d.ts +16 -0
  152. package/dist/graph/mappers/index.d.ts.map +1 -0
  153. package/dist/graph/mappers/index.js +16 -0
  154. package/dist/graph/mappers/index.js.map +1 -0
  155. package/dist/graph/mappers/task-mapper.d.ts +20 -0
  156. package/dist/graph/mappers/task-mapper.d.ts.map +1 -0
  157. package/dist/graph/mappers/task-mapper.js +27 -0
  158. package/dist/graph/mappers/task-mapper.js.map +1 -0
  159. package/dist/graph/mappers/utils.d.ts +97 -0
  160. package/dist/graph/mappers/utils.d.ts.map +1 -0
  161. package/dist/graph/mappers/utils.js +186 -0
  162. package/dist/graph/mappers/utils.js.map +1 -0
  163. package/dist/graph/repository.d.ts +1104 -0
  164. package/dist/graph/repository.d.ts.map +1 -0
  165. package/dist/graph/repository.js +2999 -0
  166. package/dist/graph/repository.js.map +1 -0
  167. package/dist/index.d.ts +21 -0
  168. package/dist/index.d.ts.map +1 -0
  169. package/dist/index.js +6052 -0
  170. package/dist/index.js.map +1 -0
  171. package/dist/parsers/html-stripper.d.ts +41 -0
  172. package/dist/parsers/html-stripper.d.ts.map +1 -0
  173. package/dist/parsers/html-stripper.js +179 -0
  174. package/dist/parsers/html-stripper.js.map +1 -0
  175. package/dist/parsers/index.d.ts +12 -0
  176. package/dist/parsers/index.d.ts.map +1 -0
  177. package/dist/parsers/index.js +12 -0
  178. package/dist/parsers/index.js.map +1 -0
  179. package/dist/parsers/olk15.d.ts +87 -0
  180. package/dist/parsers/olk15.d.ts.map +1 -0
  181. package/dist/parsers/olk15.js +368 -0
  182. package/dist/parsers/olk15.js.map +1 -0
  183. package/dist/signature.d.ts +22 -0
  184. package/dist/signature.d.ts.map +1 -0
  185. package/dist/signature.js +89 -0
  186. package/dist/signature.js.map +1 -0
  187. package/dist/tools/calendar-permissions.d.ts +79 -0
  188. package/dist/tools/calendar-permissions.d.ts.map +1 -0
  189. package/dist/tools/calendar-permissions.js +121 -0
  190. package/dist/tools/calendar-permissions.js.map +1 -0
  191. package/dist/tools/calendar.d.ts +208 -0
  192. package/dist/tools/calendar.d.ts.map +1 -0
  193. package/dist/tools/calendar.js +247 -0
  194. package/dist/tools/calendar.js.map +1 -0
  195. package/dist/tools/categories.d.ts +94 -0
  196. package/dist/tools/categories.d.ts.map +1 -0
  197. package/dist/tools/categories.js +117 -0
  198. package/dist/tools/categories.js.map +1 -0
  199. package/dist/tools/checklist-items.d.ts +89 -0
  200. package/dist/tools/checklist-items.d.ts.map +1 -0
  201. package/dist/tools/checklist-items.js +140 -0
  202. package/dist/tools/checklist-items.js.map +1 -0
  203. package/dist/tools/contacts.d.ts +94 -0
  204. package/dist/tools/contacts.d.ts.map +1 -0
  205. package/dist/tools/contacts.js +134 -0
  206. package/dist/tools/contacts.js.map +1 -0
  207. package/dist/tools/excel.d.ts +96 -0
  208. package/dist/tools/excel.d.ts.map +1 -0
  209. package/dist/tools/excel.js +165 -0
  210. package/dist/tools/excel.js.map +1 -0
  211. package/dist/tools/focused-overrides.d.ts +70 -0
  212. package/dist/tools/focused-overrides.d.ts.map +1 -0
  213. package/dist/tools/focused-overrides.js +117 -0
  214. package/dist/tools/focused-overrides.js.map +1 -0
  215. package/dist/tools/index.d.ts +22 -0
  216. package/dist/tools/index.d.ts.map +1 -0
  217. package/dist/tools/index.js +34 -0
  218. package/dist/tools/index.js.map +1 -0
  219. package/dist/tools/linked-resources.d.ts +74 -0
  220. package/dist/tools/linked-resources.d.ts.map +1 -0
  221. package/dist/tools/linked-resources.js +122 -0
  222. package/dist/tools/linked-resources.js.map +1 -0
  223. package/dist/tools/mail-rules.d.ts +98 -0
  224. package/dist/tools/mail-rules.d.ts.map +1 -0
  225. package/dist/tools/mail-rules.js +169 -0
  226. package/dist/tools/mail-rules.js.map +1 -0
  227. package/dist/tools/mail-send.d.ts +314 -0
  228. package/dist/tools/mail-send.d.ts.map +1 -0
  229. package/dist/tools/mail-send.js +555 -0
  230. package/dist/tools/mail-send.js.map +1 -0
  231. package/dist/tools/mail.d.ts +127 -0
  232. package/dist/tools/mail.d.ts.map +1 -0
  233. package/dist/tools/mail.js +311 -0
  234. package/dist/tools/mail.js.map +1 -0
  235. package/dist/tools/mailbox-organization.d.ts +301 -0
  236. package/dist/tools/mailbox-organization.d.ts.map +1 -0
  237. package/dist/tools/mailbox-organization.js +541 -0
  238. package/dist/tools/mailbox-organization.js.map +1 -0
  239. package/dist/tools/meetings.d.ts +114 -0
  240. package/dist/tools/meetings.d.ts.map +1 -0
  241. package/dist/tools/meetings.js +110 -0
  242. package/dist/tools/meetings.js.map +1 -0
  243. package/dist/tools/notes.d.ts +74 -0
  244. package/dist/tools/notes.d.ts.map +1 -0
  245. package/dist/tools/notes.js +136 -0
  246. package/dist/tools/notes.js.map +1 -0
  247. package/dist/tools/onedrive.d.ts +194 -0
  248. package/dist/tools/onedrive.d.ts.map +1 -0
  249. package/dist/tools/onedrive.js +257 -0
  250. package/dist/tools/onedrive.js.map +1 -0
  251. package/dist/tools/people.d.ts +129 -0
  252. package/dist/tools/people.d.ts.map +1 -0
  253. package/dist/tools/people.js +195 -0
  254. package/dist/tools/people.js.map +1 -0
  255. package/dist/tools/planner-visualization.d.ts +91 -0
  256. package/dist/tools/planner-visualization.d.ts.map +1 -0
  257. package/dist/tools/planner-visualization.js +192 -0
  258. package/dist/tools/planner-visualization.js.map +1 -0
  259. package/dist/tools/planner.d.ts +288 -0
  260. package/dist/tools/planner.d.ts.map +1 -0
  261. package/dist/tools/planner.js +368 -0
  262. package/dist/tools/planner.js.map +1 -0
  263. package/dist/tools/scheduling.d.ts +49 -0
  264. package/dist/tools/scheduling.d.ts.map +1 -0
  265. package/dist/tools/scheduling.js +115 -0
  266. package/dist/tools/scheduling.js.map +1 -0
  267. package/dist/tools/sharepoint.d.ts +115 -0
  268. package/dist/tools/sharepoint.d.ts.map +1 -0
  269. package/dist/tools/sharepoint.js +99 -0
  270. package/dist/tools/sharepoint.js.map +1 -0
  271. package/dist/tools/task-attachments.d.ts +74 -0
  272. package/dist/tools/task-attachments.d.ts.map +1 -0
  273. package/dist/tools/task-attachments.js +122 -0
  274. package/dist/tools/task-attachments.js.map +1 -0
  275. package/dist/tools/tasks.d.ts +74 -0
  276. package/dist/tools/tasks.d.ts.map +1 -0
  277. package/dist/tools/tasks.js +126 -0
  278. package/dist/tools/tasks.js.map +1 -0
  279. package/dist/tools/teams.d.ts +389 -0
  280. package/dist/tools/teams.d.ts.map +1 -0
  281. package/dist/tools/teams.js +546 -0
  282. package/dist/tools/teams.js.map +1 -0
  283. package/dist/types/calendar.d.ts +60 -0
  284. package/dist/types/calendar.d.ts.map +1 -0
  285. package/dist/types/calendar.js +15 -0
  286. package/dist/types/calendar.js.map +1 -0
  287. package/dist/types/contacts.d.ts +96 -0
  288. package/dist/types/contacts.d.ts.map +1 -0
  289. package/dist/types/contacts.js +41 -0
  290. package/dist/types/contacts.js.map +1 -0
  291. package/dist/types/index.d.ts +15 -0
  292. package/dist/types/index.d.ts.map +1 -0
  293. package/dist/types/index.js +16 -0
  294. package/dist/types/index.js.map +1 -0
  295. package/dist/types/mail.d.ts +108 -0
  296. package/dist/types/mail.d.ts.map +1 -0
  297. package/dist/types/mail.js +40 -0
  298. package/dist/types/mail.js.map +1 -0
  299. package/dist/types/notes.d.ts +26 -0
  300. package/dist/types/notes.d.ts.map +1 -0
  301. package/dist/types/notes.js +6 -0
  302. package/dist/types/notes.js.map +1 -0
  303. package/dist/types/tasks.d.ts +31 -0
  304. package/dist/types/tasks.d.ts.map +1 -0
  305. package/dist/types/tasks.js +6 -0
  306. package/dist/types/tasks.js.map +1 -0
  307. package/dist/utils/dates.d.ts +66 -0
  308. package/dist/utils/dates.d.ts.map +1 -0
  309. package/dist/utils/dates.js +94 -0
  310. package/dist/utils/dates.js.map +1 -0
  311. package/dist/utils/errors.d.ts +218 -0
  312. package/dist/utils/errors.d.ts.map +1 -0
  313. package/dist/utils/errors.js +306 -0
  314. package/dist/utils/errors.js.map +1 -0
  315. package/dist/utils/index.d.ts +10 -0
  316. package/dist/utils/index.d.ts.map +1 -0
  317. package/dist/utils/index.js +10 -0
  318. package/dist/utils/index.js.map +1 -0
  319. package/dist/visualization/html.d.ts +26 -0
  320. package/dist/visualization/html.d.ts.map +1 -0
  321. package/dist/visualization/html.js +306 -0
  322. package/dist/visualization/html.js.map +1 -0
  323. package/dist/visualization/markdown.d.ts +25 -0
  324. package/dist/visualization/markdown.d.ts.map +1 -0
  325. package/dist/visualization/markdown.js +186 -0
  326. package/dist/visualization/markdown.js.map +1 -0
  327. package/dist/visualization/mermaid.d.ts +25 -0
  328. package/dist/visualization/mermaid.d.ts.map +1 -0
  329. package/dist/visualization/mermaid.js +158 -0
  330. package/dist/visualization/mermaid.js.map +1 -0
  331. package/dist/visualization/svg.d.ts +25 -0
  332. package/dist/visualization/svg.d.ts.map +1 -0
  333. package/dist/visualization/svg.js +282 -0
  334. package/dist/visualization/svg.js.map +1 -0
  335. package/dist/visualization/types.d.ts +43 -0
  336. package/dist/visualization/types.d.ts.map +1 -0
  337. package/dist/visualization/types.js +34 -0
  338. package/dist/visualization/types.js.map +1 -0
  339. package/package.json +88 -0
@@ -0,0 +1,1104 @@
1
+ /**
2
+ * Copyright (c) 2026 JBC Tech Solutions, LLC
3
+ * Licensed under the MIT License. See LICENSE file in the project root.
4
+ */
5
+ /**
6
+ * Microsoft Graph API repository implementation.
7
+ *
8
+ * Implements the IRepository interface using Microsoft Graph API
9
+ * for data access instead of AppleScript or SQLite.
10
+ */
11
+ import type { IRepository, FolderRow, EmailRow, EventRow, ContactRow, TaskRow, NoteRow } from '../database/repository.js';
12
+ import { GraphClient } from './client/index.js';
13
+ import type { DeviceCodeCallback } from './auth/index.js';
14
+ import type { PlanVisualizationData } from '../visualization/types.js';
15
+ /**
16
+ * Repository implementation using Microsoft Graph API.
17
+ *
18
+ * Provides read-only access to Outlook data via the Graph API.
19
+ */
20
+ export declare class GraphRepository implements IRepository {
21
+ private readonly client;
22
+ private readonly deltaLinks;
23
+ private readonly idCache;
24
+ constructor(deviceCodeCallback?: DeviceCodeCallback);
25
+ listFolders(): FolderRow[];
26
+ listFoldersAsync(): Promise<FolderRow[]>;
27
+ getFolder(_id: number): FolderRow | undefined;
28
+ getFolderAsync(id: number): Promise<FolderRow | undefined>;
29
+ listEmails(_folderId: number, _limit: number, _offset: number): EmailRow[];
30
+ listEmailsAsync(folderId: number, limit: number, offset: number): Promise<EmailRow[]>;
31
+ private listEmailsWithGraphId;
32
+ listUnreadEmails(_folderId: number, _limit: number, _offset: number): EmailRow[];
33
+ listUnreadEmailsAsync(folderId: number, limit: number, offset: number): Promise<EmailRow[]>;
34
+ private listUnreadEmailsWithGraphId;
35
+ searchEmails(_query: string, _limit: number): EmailRow[];
36
+ searchEmailsAsync(query: string, limit: number): Promise<EmailRow[]>;
37
+ searchEmailsInFolder(_folderId: number, _query: string, _limit: number): EmailRow[];
38
+ searchEmailsInFolderAsync(folderId: number, query: string, limit: number): Promise<EmailRow[]>;
39
+ private searchEmailsInFolderWithGraphId;
40
+ /**
41
+ * Advanced search using raw KQL query syntax.
42
+ */
43
+ searchEmailsAdvancedAsync(query: string, limit: number): Promise<EmailRow[]>;
44
+ /**
45
+ * Advanced search in a specific folder using raw KQL query syntax.
46
+ */
47
+ searchEmailsAdvancedInFolderAsync(folderId: number, query: string, limit: number): Promise<EmailRow[]>;
48
+ checkNewEmailsAsync(folderId: number): Promise<{
49
+ emails: EmailRow[];
50
+ isInitialSync: boolean;
51
+ }>;
52
+ getEmail(_id: number): EmailRow | undefined;
53
+ /**
54
+ * Populates the message ID cache by listing messages from mail folders.
55
+ * Used as a fallback when getEmailAsync is called with an ID not yet in cache
56
+ * (e.g. after server restart or when list_emails/search_emails wasn't called first).
57
+ */
58
+ private refreshMessageCacheForGetEmail;
59
+ getEmailAsync(id: number): Promise<EmailRow | undefined>;
60
+ getUnreadCount(): number;
61
+ getUnreadCountAsync(): Promise<number>;
62
+ getUnreadCountByFolder(_folderId: number): number;
63
+ getUnreadCountByFolderAsync(folderId: number): Promise<number>;
64
+ /**
65
+ * Lists all messages in a conversation thread.
66
+ *
67
+ * Looks up the message to get its conversationId, resolves the Graph string
68
+ * conversationId from cache, then queries for all messages with that ID.
69
+ */
70
+ listConversationAsync(messageId: number, limit: number): Promise<EmailRow[]>;
71
+ listCalendars(): FolderRow[];
72
+ listCalendarsAsync(): Promise<FolderRow[]>;
73
+ listEvents(_limit: number): EventRow[];
74
+ listEventsAsync(limit: number): Promise<EventRow[]>;
75
+ listEventsByFolder(_folderId: number, _limit: number): EventRow[];
76
+ listEventsByFolderAsync(folderId: number, limit: number): Promise<EventRow[]>;
77
+ searchEvents(_query: string | null, _startDate: string | null, _endDate: string | null, _limit: number): EventRow[];
78
+ searchEventsAsync(query: string | null, startDate: string | null, endDate: string | null, limit: number): Promise<EventRow[]>;
79
+ listEventsByDateRange(_startDate: number, _endDate: number, _limit: number): EventRow[];
80
+ listEventsByDateRangeAsync(startDate: number, endDate: number, limit: number): Promise<EventRow[]>;
81
+ getEvent(_id: number): EventRow | undefined;
82
+ getEventAsync(id: number): Promise<EventRow | undefined>;
83
+ listEventInstancesAsync(eventId: number, startDate: string, endDate: string): Promise<EventRow[]>;
84
+ listContacts(_limit: number, _offset: number): ContactRow[];
85
+ listContactsAsync(limit: number, offset: number): Promise<ContactRow[]>;
86
+ searchContacts(_query: string, _limit: number): ContactRow[];
87
+ searchContactsAsync(query: string, limit: number): Promise<ContactRow[]>;
88
+ getContact(_id: number): ContactRow | undefined;
89
+ getContactAsync(id: number): Promise<ContactRow | undefined>;
90
+ listContactFoldersAsync(): Promise<Array<{
91
+ id: number;
92
+ name: string;
93
+ parentFolderId: string | null;
94
+ }>>;
95
+ createContactFolderAsync(name: string): Promise<number>;
96
+ deleteContactFolderAsync(folderId: number): Promise<void>;
97
+ listContactsInFolderAsync(folderId: number, limit?: number): Promise<ContactRow[]>;
98
+ getContactPhotoAsync(contactId: number): Promise<{
99
+ filePath: string;
100
+ contentType: string;
101
+ }>;
102
+ setContactPhotoAsync(contactId: number, filePath: string): Promise<void>;
103
+ listTasks(_limit: number, _offset: number): TaskRow[];
104
+ listTasksAsync(limit: number, offset: number): Promise<TaskRow[]>;
105
+ listIncompleteTasks(_limit: number, _offset: number): TaskRow[];
106
+ listIncompleteTasksAsync(limit: number, offset: number): Promise<TaskRow[]>;
107
+ searchTasks(_query: string, _limit: number): TaskRow[];
108
+ searchTasksAsync(query: string, limit: number): Promise<TaskRow[]>;
109
+ getTask(_id: number): TaskRow | undefined;
110
+ getTaskAsync(id: number): Promise<TaskRow | undefined>;
111
+ listTaskListsAsync(): Promise<Array<{
112
+ id: number;
113
+ name: string;
114
+ isDefault: boolean;
115
+ }>>;
116
+ listNotes(_limit: number, _offset: number): NoteRow[];
117
+ listNotesAsync(_limit: number, _offset: number): Promise<NoteRow[]>;
118
+ getNote(_id: number): NoteRow | undefined;
119
+ getNoteAsync(_id: number): Promise<NoteRow | undefined>;
120
+ /**
121
+ * Gets the Graph client instance for direct access if needed.
122
+ */
123
+ getClient(): GraphClient;
124
+ /**
125
+ * Returns the Graph client (satisfies IMailSendRepository).
126
+ */
127
+ getGraphClient(): GraphClient;
128
+ /**
129
+ * Returns the Graph string ID for a cached draft numeric ID (satisfies IMailSendRepository).
130
+ */
131
+ getGraphIdForDraft(draftId: number): string | undefined;
132
+ /**
133
+ * Gets the Graph string ID from a numeric ID.
134
+ */
135
+ getGraphId(type: 'folder' | 'message' | 'event' | 'contact', numericId: number): string | undefined;
136
+ /**
137
+ * Gets task info from a numeric ID.
138
+ */
139
+ getTaskInfo(numericId: number): {
140
+ taskListId: string;
141
+ taskId: string;
142
+ } | undefined;
143
+ /**
144
+ * Gets the Graph string ID for a task list from a numeric ID.
145
+ */
146
+ getTaskListGraphId(numericId: number): string | undefined;
147
+ moveEmail(_emailId: number, _destinationFolderId: number): void;
148
+ deleteEmail(_emailId: number): void;
149
+ archiveEmail(_emailId: number): void;
150
+ junkEmail(_emailId: number): void;
151
+ markEmailRead(_emailId: number, _isRead: boolean): void;
152
+ setEmailFlag(_emailId: number, _flagStatus: number): void;
153
+ setEmailCategories(_emailId: number, _categories: string[]): void;
154
+ setEmailImportance(_emailId: number, _importance: string): void;
155
+ createFolder(_name: string, _parentFolderId?: number): FolderRow;
156
+ deleteFolder(_folderId: number): void;
157
+ renameFolder(_folderId: number, _newName: string): void;
158
+ moveFolder(_folderId: number, _destinationParentId: number): void;
159
+ emptyFolder(_folderId: number): void;
160
+ moveEmailAsync(emailId: number, destinationFolderId: number): Promise<void>;
161
+ deleteEmailAsync(emailId: number): Promise<void>;
162
+ archiveEmailAsync(emailId: number): Promise<void>;
163
+ junkEmailAsync(emailId: number): Promise<void>;
164
+ markEmailReadAsync(emailId: number, isRead: boolean): Promise<void>;
165
+ setEmailFlagAsync(emailId: number, flagStatus: number): Promise<void>;
166
+ setEmailCategoriesAsync(emailId: number, categories: string[]): Promise<void>;
167
+ setEmailImportanceAsync(emailId: number, importance: string): Promise<void>;
168
+ createFolderAsync(name: string, parentFolderId?: number): Promise<FolderRow>;
169
+ deleteFolderAsync(folderId: number): Promise<void>;
170
+ renameFolderAsync(folderId: number, newName: string): Promise<void>;
171
+ moveFolderAsync(folderId: number, destinationParentId: number): Promise<void>;
172
+ emptyFolderAsync(folderId: number): Promise<void>;
173
+ /**
174
+ * Creates a new draft message.
175
+ *
176
+ * Converts email address strings to Recipient objects, calls the Graph client,
177
+ * adds the returned draft to idCache.messages, and returns its numeric ID.
178
+ */
179
+ createDraftAsync(params: {
180
+ subject: string;
181
+ body: string;
182
+ bodyType: 'text' | 'html';
183
+ to?: string[];
184
+ cc?: string[];
185
+ bcc?: string[];
186
+ }): Promise<{
187
+ numericId: number;
188
+ graphId: string;
189
+ }>;
190
+ /**
191
+ * Updates an existing draft message.
192
+ *
193
+ * Looks up the Graph string ID from idCache.messages, then calls the client.
194
+ */
195
+ updateDraftAsync(draftId: number, updates: Record<string, unknown>): Promise<void>;
196
+ /**
197
+ * Lists draft messages.
198
+ *
199
+ * Uses the well-known 'drafts' folder name directly with the Graph API.
200
+ */
201
+ listDraftsAsync(limit: number, offset: number): Promise<EmailRow[]>;
202
+ /**
203
+ * Sends an existing draft message.
204
+ *
205
+ * Looks up the Graph string ID from idCache.messages, then calls the client.
206
+ */
207
+ sendDraftAsync(draftId: number): Promise<void>;
208
+ /**
209
+ * Sends a new email directly without creating a draft first.
210
+ *
211
+ * Converts email address strings to Recipient objects and calls the client.
212
+ */
213
+ sendMailAsync(params: {
214
+ subject: string;
215
+ body: string;
216
+ bodyType: 'text' | 'html';
217
+ to: string[];
218
+ cc?: string[];
219
+ bcc?: string[];
220
+ }): Promise<void>;
221
+ /**
222
+ * Replies to a message (or replies all).
223
+ *
224
+ * Looks up the Graph string ID from idCache.messages, then calls the client.
225
+ */
226
+ replyMessageAsync(messageId: number, comment: string, replyAll: boolean): Promise<void>;
227
+ /**
228
+ * Forwards a message to specified recipients.
229
+ *
230
+ * Looks up the Graph string ID from idCache.messages, converts recipient
231
+ * email strings to Recipient objects, then calls the client.
232
+ */
233
+ forwardMessageAsync(messageId: number, toRecipients: string[], comment?: string): Promise<void>;
234
+ /**
235
+ * Creates a reply (or reply-all) draft for a message.
236
+ *
237
+ * Looks up the Graph string ID from idCache.messages, creates the draft
238
+ * via the client, caches the new draft ID, and optionally updates the body.
239
+ *
240
+ * @returns The numeric and graph IDs of the new draft.
241
+ */
242
+ replyAsDraftAsync(messageId: number, replyAll?: boolean, comment?: string, bodyType?: string): Promise<{
243
+ numericId: number;
244
+ graphId: string;
245
+ }>;
246
+ /**
247
+ * Creates a forward draft for a message.
248
+ *
249
+ * Looks up the Graph string ID from idCache.messages, creates the draft
250
+ * via the client, caches the new draft ID, and optionally updates the
251
+ * recipients and body.
252
+ *
253
+ * @returns The numeric and graph IDs of the new draft.
254
+ */
255
+ forwardAsDraftAsync(messageId: number, toRecipients?: string[], comment?: string, bodyType?: string): Promise<{
256
+ numericId: number;
257
+ graphId: string;
258
+ }>;
259
+ getScheduleAsync(params: {
260
+ emailAddresses: string[];
261
+ startTime: string;
262
+ endTime: string;
263
+ availabilityViewInterval?: number;
264
+ }): Promise<unknown[]>;
265
+ findMeetingTimesAsync(params: {
266
+ attendees: string[];
267
+ durationMinutes: number;
268
+ startTime?: string;
269
+ endTime?: string;
270
+ maxCandidates?: number;
271
+ }): Promise<unknown>;
272
+ /**
273
+ * Lists attachments for a given email.
274
+ *
275
+ * Looks up the Graph message ID from idCache.messages, calls
276
+ * client.listAttachments, hashes each attachment ID to a numeric key,
277
+ * and caches it in idCache.attachments with { messageId, attachmentId }.
278
+ *
279
+ * @returns Array of attachment metadata objects.
280
+ */
281
+ listAttachmentsAsync(emailId: number): Promise<Array<{
282
+ id: number;
283
+ name: string;
284
+ size: number;
285
+ contentType: string;
286
+ isInline: boolean;
287
+ }>>;
288
+ /**
289
+ * Downloads an attachment for a given email.
290
+ *
291
+ * Looks up { messageId, attachmentId } from idCache.attachments,
292
+ * then delegates to the downloadAttachment helper which fetches
293
+ * the content and writes it to disk.
294
+ *
295
+ * @returns Metadata about the downloaded file including its local path.
296
+ */
297
+ downloadAttachmentAsync(attachmentId: number): Promise<{
298
+ filePath: string;
299
+ name: string;
300
+ size: number;
301
+ contentType: string;
302
+ }>;
303
+ /**
304
+ * Creates a new calendar event.
305
+ *
306
+ * Builds a Graph API event object from the given params, calls
307
+ * client.createEvent(), adds the result to idCache.events, and
308
+ * returns the numeric ID.
309
+ */
310
+ createEventAsync(params: {
311
+ subject: string;
312
+ start: string;
313
+ end: string;
314
+ timezone?: string;
315
+ location?: string;
316
+ body?: string;
317
+ bodyType?: 'text' | 'html';
318
+ attendees?: Array<{
319
+ email: string;
320
+ name?: string;
321
+ type?: 'required' | 'optional';
322
+ }>;
323
+ isAllDay?: boolean;
324
+ recurrence?: {
325
+ pattern: {
326
+ type: 'daily' | 'weekly' | 'monthly' | 'yearly';
327
+ interval: number;
328
+ daysOfWeek?: string[];
329
+ };
330
+ range: {
331
+ type: 'endDate' | 'noEnd' | 'numbered';
332
+ startDate: string;
333
+ endDate?: string;
334
+ numberOfOccurrences?: number;
335
+ };
336
+ };
337
+ calendarId?: number;
338
+ is_online_meeting?: boolean;
339
+ online_meeting_provider?: string;
340
+ }): Promise<number>;
341
+ /**
342
+ * Updates an existing calendar event.
343
+ *
344
+ * Looks up the Graph string ID from idCache.events, then calls
345
+ * client.updateEvent(). Throws if the event is not cached.
346
+ */
347
+ updateEventAsync(eventId: number, updates: Record<string, unknown>): Promise<void>;
348
+ /**
349
+ * Deletes a calendar event.
350
+ *
351
+ * Looks up the Graph string ID from idCache.events, calls
352
+ * client.deleteEvent(), and removes the entry from idCache.
353
+ * Throws if the event is not cached.
354
+ */
355
+ deleteEventAsync(eventId: number): Promise<void>;
356
+ /**
357
+ * Responds to a calendar event invitation.
358
+ *
359
+ * Looks up the Graph string ID from idCache.events, then calls
360
+ * client.respondToEvent(). Throws if the event is not cached.
361
+ */
362
+ respondToEventAsync(eventId: number, response: 'accept' | 'decline' | 'tentative', sendResponse: boolean, comment?: string): Promise<void>;
363
+ /**
364
+ * Creates a new contact.
365
+ *
366
+ * Maps snake_case input fields to Graph API camelCase fields, calls
367
+ * client.createContact(), caches the resulting ID, and returns a numeric ID.
368
+ */
369
+ createContactAsync(params: {
370
+ given_name?: string;
371
+ surname?: string;
372
+ email?: string;
373
+ phone?: string;
374
+ mobile_phone?: string;
375
+ company?: string;
376
+ job_title?: string;
377
+ street_address?: string;
378
+ city?: string;
379
+ state?: string;
380
+ postal_code?: string;
381
+ country?: string;
382
+ }): Promise<number>;
383
+ /**
384
+ * Updates an existing contact.
385
+ *
386
+ * Looks up the Graph string ID from idCache.contacts, then calls
387
+ * client.updateContact(). Throws if the contact is not cached.
388
+ */
389
+ updateContactAsync(contactId: number, updates: Record<string, unknown>): Promise<void>;
390
+ /**
391
+ * Deletes a contact.
392
+ *
393
+ * Looks up the Graph string ID from idCache.contacts, calls
394
+ * client.deleteContact(), and removes the entry from idCache.
395
+ * Throws if the contact is not cached.
396
+ */
397
+ deleteContactAsync(contactId: number): Promise<void>;
398
+ /**
399
+ * Creates a new task in a task list.
400
+ *
401
+ * Looks up the Graph task list ID from idCache.taskLists, builds a
402
+ * Graph API task object from the given params, calls client.createTask(),
403
+ * caches the resulting ID, and returns a numeric ID.
404
+ */
405
+ createTaskAsync(params: {
406
+ title: string;
407
+ task_list_id: number;
408
+ body?: string;
409
+ body_type?: 'text' | 'html';
410
+ due_date?: string;
411
+ importance?: 'low' | 'normal' | 'high';
412
+ reminder_date?: string;
413
+ recurrence?: {
414
+ pattern: 'daily' | 'weekly' | 'monthly' | 'yearly';
415
+ interval?: number | undefined;
416
+ days_of_week?: string[] | undefined;
417
+ day_of_month?: number | undefined;
418
+ range_type: 'endDate' | 'noEnd' | 'numbered';
419
+ start_date: string;
420
+ end_date?: string | undefined;
421
+ occurrences?: number | undefined;
422
+ } | undefined;
423
+ categories?: string[];
424
+ }): Promise<number>;
425
+ /**
426
+ * Updates an existing task.
427
+ *
428
+ * Looks up the Graph task info from idCache.tasks, then calls
429
+ * client.updateTask(). Throws if the task is not cached.
430
+ */
431
+ updateTaskAsync(taskId: number, updates: Record<string, unknown>): Promise<void>;
432
+ /**
433
+ * Marks a task as completed.
434
+ *
435
+ * Convenience method that calls updateTaskAsync with status: 'completed'
436
+ * and the current time as completedDateTime.
437
+ */
438
+ completeTaskAsync(taskId: number): Promise<void>;
439
+ /**
440
+ * Deletes a task.
441
+ *
442
+ * Looks up the Graph task info from idCache.tasks, calls
443
+ * client.deleteTask(), and removes the entry from idCache.
444
+ * Throws if the task is not cached.
445
+ */
446
+ deleteTaskAsync(taskId: number): Promise<void>;
447
+ /**
448
+ * Creates a new task list.
449
+ *
450
+ * Calls client.createTaskList(), caches the resulting ID in
451
+ * idCache.taskLists, and returns a numeric ID.
452
+ */
453
+ createTaskListAsync(displayName: string): Promise<number>;
454
+ /**
455
+ * Renames a task list.
456
+ */
457
+ renameTaskListAsync(listId: number, name: string): Promise<void>;
458
+ /**
459
+ * Deletes a task list.
460
+ */
461
+ deleteTaskListAsync(listId: number): Promise<void>;
462
+ listChecklistItemsAsync(taskId: number): Promise<Array<{
463
+ id: number;
464
+ displayName: string;
465
+ isChecked: boolean;
466
+ createdDateTime: string;
467
+ }>>;
468
+ createChecklistItemAsync(taskId: number, displayName: string, isChecked?: boolean): Promise<number>;
469
+ updateChecklistItemAsync(checklistItemId: number, updates: {
470
+ displayName?: string;
471
+ isChecked?: boolean;
472
+ }): Promise<void>;
473
+ deleteChecklistItemAsync(checklistItemId: number): Promise<void>;
474
+ listLinkedResourcesAsync(taskId: number): Promise<Array<{
475
+ id: number;
476
+ webUrl: string;
477
+ applicationName: string;
478
+ displayName: string;
479
+ }>>;
480
+ createLinkedResourceAsync(taskId: number, webUrl: string, applicationName: string, displayName?: string): Promise<number>;
481
+ deleteLinkedResourceAsync(linkedResourceId: number): Promise<void>;
482
+ listTaskAttachmentsAsync(taskId: number): Promise<Array<{
483
+ id: number;
484
+ name: string;
485
+ size: number;
486
+ contentType: string;
487
+ }>>;
488
+ createTaskAttachmentAsync(taskId: number, name: string, contentBytes: string, contentType?: string): Promise<number>;
489
+ deleteTaskAttachmentAsync(taskAttachmentId: number): Promise<void>;
490
+ /**
491
+ * Lists all inbox mail rules.
492
+ */
493
+ listMailRulesAsync(): Promise<Array<{
494
+ id: number;
495
+ displayName: string;
496
+ sequence: number;
497
+ isEnabled: boolean;
498
+ conditions: unknown;
499
+ actions: unknown;
500
+ }>>;
501
+ /**
502
+ * Creates a new inbox mail rule.
503
+ */
504
+ createMailRuleAsync(rule: Record<string, unknown>): Promise<number>;
505
+ /**
506
+ * Deletes an inbox mail rule.
507
+ */
508
+ deleteMailRuleAsync(ruleId: number): Promise<void>;
509
+ /**
510
+ * Gets the current automatic replies (OOF) settings.
511
+ */
512
+ getAutomaticRepliesAsync(): Promise<{
513
+ status: string;
514
+ externalAudience: string;
515
+ internalReplyMessage: string;
516
+ externalReplyMessage: string;
517
+ scheduledStartDateTime: string | null;
518
+ scheduledEndDateTime: string | null;
519
+ }>;
520
+ /**
521
+ * Sets the automatic replies (OOF) settings.
522
+ */
523
+ setAutomaticRepliesAsync(params: {
524
+ status: 'disabled' | 'alwaysEnabled' | 'scheduled';
525
+ externalAudience?: 'none' | 'contactsOnly' | 'all';
526
+ internalReplyMessage?: string;
527
+ externalReplyMessage?: string;
528
+ scheduledStartDateTime?: string;
529
+ scheduledEndDateTime?: string;
530
+ }): Promise<void>;
531
+ /**
532
+ * Gets the current mailbox settings (language, time zone, formats, working hours).
533
+ */
534
+ getMailboxSettingsAsync(): Promise<{
535
+ language: string | null;
536
+ timeZone: string | null;
537
+ dateFormat: string | null;
538
+ timeFormat: string | null;
539
+ workingHours: unknown;
540
+ }>;
541
+ /**
542
+ * Updates mailbox settings (language, time zone, date/time formats).
543
+ */
544
+ updateMailboxSettingsAsync(params: {
545
+ language?: string;
546
+ timeZone?: string;
547
+ dateFormat?: string;
548
+ timeFormat?: string;
549
+ }): Promise<void>;
550
+ /**
551
+ * Lists all master categories.
552
+ */
553
+ listCategoriesAsync(): Promise<Array<{
554
+ id: number;
555
+ name: string;
556
+ color: string;
557
+ }>>;
558
+ /**
559
+ * Creates a new master category.
560
+ */
561
+ createCategoryAsync(name: string, color: string): Promise<number>;
562
+ /**
563
+ * Deletes a master category.
564
+ */
565
+ deleteCategoryAsync(categoryId: number): Promise<void>;
566
+ /**
567
+ * Lists all focused inbox overrides.
568
+ */
569
+ listFocusedOverridesAsync(): Promise<Array<{
570
+ id: number;
571
+ senderAddress: string;
572
+ classifyAs: string;
573
+ }>>;
574
+ /**
575
+ * Creates a focused inbox override.
576
+ */
577
+ createFocusedOverrideAsync(senderAddress: string, classifyAs: 'focused' | 'other'): Promise<number>;
578
+ /**
579
+ * Deletes a focused inbox override.
580
+ */
581
+ deleteFocusedOverrideAsync(overrideId: number): Promise<void>;
582
+ /**
583
+ * Gets internet message headers for an email.
584
+ */
585
+ getMessageHeadersAsync(emailId: number): Promise<Array<{
586
+ name: string;
587
+ value: string;
588
+ }>>;
589
+ /**
590
+ * Gets the MIME content of a message and saves it as an .eml file.
591
+ */
592
+ getMessageMimeAsync(emailId: number): Promise<{
593
+ filePath: string;
594
+ }>;
595
+ /**
596
+ * Gets mail tips for the specified email addresses.
597
+ */
598
+ getMailTipsAsync(emailAddresses: string[]): Promise<Array<{
599
+ emailAddress: string;
600
+ automaticReplies: {
601
+ message: string;
602
+ } | null;
603
+ mailboxFull: boolean;
604
+ deliveryRestricted: boolean;
605
+ externalMemberCount: number;
606
+ maxMessageSize: number;
607
+ }>>;
608
+ /**
609
+ * Lists all calendar groups.
610
+ */
611
+ listCalendarGroupsAsync(): Promise<Array<{
612
+ id: number;
613
+ name: string;
614
+ classId: string;
615
+ }>>;
616
+ /**
617
+ * Creates a new calendar group.
618
+ */
619
+ createCalendarGroupAsync(name: string): Promise<number>;
620
+ /**
621
+ * Lists all permissions for a calendar.
622
+ */
623
+ listCalendarPermissionsAsync(calendarId: number): Promise<Array<{
624
+ id: number;
625
+ emailAddress: string;
626
+ role: string;
627
+ isRemovable: boolean;
628
+ isInsideOrganization: boolean;
629
+ }>>;
630
+ /**
631
+ * Creates a calendar permission (shares a calendar with someone).
632
+ */
633
+ createCalendarPermissionAsync(calendarId: number, email: string, role: string): Promise<number>;
634
+ /**
635
+ * Deletes a calendar permission.
636
+ */
637
+ deleteCalendarPermissionAsync(permissionId: number): Promise<void>;
638
+ /**
639
+ * Lists all room lists.
640
+ */
641
+ listRoomListsAsync(): Promise<Array<{
642
+ name: string;
643
+ address: string;
644
+ }>>;
645
+ /**
646
+ * Lists rooms, optionally filtered by a room list email.
647
+ */
648
+ listRoomsAsync(roomListEmail?: string): Promise<Array<{
649
+ name: string;
650
+ address: string;
651
+ }>>;
652
+ /**
653
+ * Lists all joined teams with cached numeric IDs.
654
+ */
655
+ listTeamsAsync(): Promise<Array<{
656
+ id: number;
657
+ name: string;
658
+ description: string;
659
+ }>>;
660
+ /**
661
+ * Lists all channels in a team with cached numeric IDs.
662
+ */
663
+ listChannelsAsync(teamId: number): Promise<Array<{
664
+ id: number;
665
+ name: string;
666
+ description: string;
667
+ membershipType: string;
668
+ }>>;
669
+ /**
670
+ * Gets a specific channel by cached numeric ID.
671
+ */
672
+ getChannelAsync(channelId: number): Promise<{
673
+ id: number;
674
+ name: string;
675
+ description: string;
676
+ membershipType: string;
677
+ webUrl: string;
678
+ }>;
679
+ /**
680
+ * Creates a new channel in a team.
681
+ */
682
+ createChannelAsync(teamId: number, name: string, description?: string): Promise<number>;
683
+ /**
684
+ * Updates a channel's properties.
685
+ */
686
+ updateChannelAsync(channelId: number, updates: {
687
+ name?: string;
688
+ description?: string;
689
+ }): Promise<void>;
690
+ /**
691
+ * Deletes a channel.
692
+ */
693
+ deleteChannelAsync(channelId: number): Promise<void>;
694
+ /**
695
+ * Lists members of a team.
696
+ */
697
+ listTeamMembersAsync(teamId: number): Promise<Array<{
698
+ id: string;
699
+ displayName: string;
700
+ email: string;
701
+ roles: string[];
702
+ }>>;
703
+ /**
704
+ * Lists recent messages in a channel.
705
+ */
706
+ listChannelMessagesAsync(channelId: number, limit?: number): Promise<Array<{
707
+ id: number;
708
+ senderName: string;
709
+ senderEmail: string;
710
+ bodyPreview: string;
711
+ bodyContent: string;
712
+ contentType: string;
713
+ createdDateTime: string;
714
+ }>>;
715
+ /**
716
+ * Gets a specific channel message with its replies.
717
+ */
718
+ getChannelMessageAsync(messageId: number): Promise<{
719
+ id: number;
720
+ senderName: string;
721
+ senderEmail: string;
722
+ bodyContent: string;
723
+ contentType: string;
724
+ createdDateTime: string;
725
+ replies: Array<{
726
+ id: number;
727
+ senderName: string;
728
+ senderEmail: string;
729
+ bodyContent: string;
730
+ contentType: string;
731
+ createdDateTime: string;
732
+ }>;
733
+ }>;
734
+ /**
735
+ * Sends a new message to a channel.
736
+ */
737
+ sendChannelMessageAsync(channelId: number, body: string, contentType?: string): Promise<number>;
738
+ /**
739
+ * Replies to a channel message.
740
+ */
741
+ replyToChannelMessageAsync(messageId: number, body: string, contentType?: string): Promise<number>;
742
+ listChatsAsync(limit?: number): Promise<Array<{
743
+ id: number;
744
+ topic: string;
745
+ chatType: string;
746
+ lastMessagePreview: string;
747
+ createdDateTime: string;
748
+ }>>;
749
+ getChatAsync(chatId: number): Promise<{
750
+ id: number;
751
+ topic: string;
752
+ chatType: string;
753
+ createdDateTime: string;
754
+ webUrl: string;
755
+ }>;
756
+ listChatMessagesAsync(chatId: number, limit?: number): Promise<Array<{
757
+ id: number;
758
+ senderName: string;
759
+ senderEmail: string;
760
+ bodyPreview: string;
761
+ bodyContent: string;
762
+ contentType: string;
763
+ createdDateTime: string;
764
+ }>>;
765
+ sendChatMessageAsync(chatId: number, body: string, contentType?: string): Promise<number>;
766
+ listMessageReactionsAsync(messageId: number, messageType: 'channel' | 'chat'): Promise<Array<{
767
+ reactionType: string;
768
+ user: {
769
+ displayName: string;
770
+ };
771
+ createdDateTime: string;
772
+ }>>;
773
+ addMessageReactionAsync(messageId: number, messageType: 'channel' | 'chat', reactionType: string): Promise<void>;
774
+ removeMessageReactionAsync(messageId: number, messageType: 'channel' | 'chat', reactionType: string): Promise<void>;
775
+ listChatMembersAsync(chatId: number): Promise<Array<{
776
+ displayName: string;
777
+ email: string;
778
+ roles: string[];
779
+ }>>;
780
+ /**
781
+ * Lists all plans the current user has.
782
+ */
783
+ listPlansAsync(): Promise<Array<{
784
+ id: number;
785
+ title: string;
786
+ owner: string;
787
+ createdDateTime: string;
788
+ }>>;
789
+ /**
790
+ * Gets a specific plan by cached numeric ID.
791
+ */
792
+ getPlanAsync(planId: number): Promise<{
793
+ id: number;
794
+ title: string;
795
+ owner: string;
796
+ createdDateTime: string;
797
+ etag: string;
798
+ }>;
799
+ /**
800
+ * Creates a new plan.
801
+ */
802
+ createPlanAsync(title: string, groupId: string): Promise<number>;
803
+ /**
804
+ * Updates a plan (requires cached ETag).
805
+ */
806
+ updatePlanAsync(planId: number, updates: {
807
+ title?: string;
808
+ }): Promise<void>;
809
+ /**
810
+ * Lists all buckets in a plan.
811
+ */
812
+ listBucketsAsync(planId: number): Promise<Array<{
813
+ id: number;
814
+ name: string;
815
+ planId: number;
816
+ orderHint: string;
817
+ }>>;
818
+ /**
819
+ * Creates a new bucket in a plan.
820
+ */
821
+ createBucketAsync(planId: number, name: string): Promise<number>;
822
+ /**
823
+ * Updates a bucket (requires cached ETag).
824
+ */
825
+ updateBucketAsync(bucketId: number, updates: {
826
+ name?: string;
827
+ }): Promise<void>;
828
+ /**
829
+ * Deletes a bucket (requires cached ETag).
830
+ */
831
+ deleteBucketAsync(bucketId: number): Promise<void>;
832
+ /**
833
+ * Lists all tasks in a plan.
834
+ */
835
+ listPlannerTasksAsync(planId: number): Promise<Array<{
836
+ id: number;
837
+ title: string;
838
+ bucketId: number | null;
839
+ assignees: string[];
840
+ percentComplete: number;
841
+ priority: number;
842
+ startDateTime: string;
843
+ dueDateTime: string;
844
+ createdDateTime: string;
845
+ }>>;
846
+ /**
847
+ * Gets a specific planner task by cached numeric ID.
848
+ */
849
+ getPlannerTaskAsync(taskId: number): Promise<{
850
+ id: number;
851
+ title: string;
852
+ bucketId: number | null;
853
+ assignees: string[];
854
+ percentComplete: number;
855
+ priority: number;
856
+ startDateTime: string;
857
+ dueDateTime: string;
858
+ createdDateTime: string;
859
+ conversationThreadId: string;
860
+ orderHint: string;
861
+ etag: string;
862
+ }>;
863
+ /**
864
+ * Creates a new planner task.
865
+ */
866
+ createPlannerTaskAsync(planId: number, title: string, bucketId?: number, assignments?: Record<string, object>, priority?: number, startDate?: string, dueDate?: string): Promise<number>;
867
+ /**
868
+ * Updates a planner task (requires cached ETag).
869
+ */
870
+ updatePlannerTaskAsync(taskId: number, updates: {
871
+ title?: string;
872
+ bucketId?: number;
873
+ percentComplete?: number;
874
+ priority?: number;
875
+ startDate?: string;
876
+ dueDate?: string;
877
+ assignments?: Record<string, object>;
878
+ }): Promise<void>;
879
+ /**
880
+ * Deletes a planner task (requires cached ETag).
881
+ */
882
+ deletePlannerTaskAsync(taskId: number): Promise<void>;
883
+ /**
884
+ * Gets details for a planner task (description, checklist, references).
885
+ */
886
+ getPlannerTaskDetailsAsync(taskId: number): Promise<{
887
+ id: number;
888
+ description: string;
889
+ checklist: Record<string, unknown>;
890
+ references: Record<string, unknown>;
891
+ etag: string;
892
+ }>;
893
+ /**
894
+ * Lists all tasks in a plan with their details (description, checklist, references)
895
+ * fetched in batched requests. This avoids N+1 queries when you need both the task
896
+ * list and each task's details.
897
+ *
898
+ * Details are fetched via the Graph $batch API (up to 20 per batch).
899
+ * Partial failures are handled gracefully: tasks whose detail fetch failed will
900
+ * have `details` set to `undefined`.
901
+ */
902
+ listPlannerTasksWithDetailsAsync(planId: number): Promise<Array<{
903
+ id: number;
904
+ title: string;
905
+ bucketId: number | null;
906
+ assignees: string[];
907
+ percentComplete: number;
908
+ priority: number;
909
+ startDateTime: string;
910
+ dueDateTime: string;
911
+ createdDateTime: string;
912
+ details?: {
913
+ description: string;
914
+ checklist: Record<string, unknown>;
915
+ references: Record<string, unknown>;
916
+ etag: string;
917
+ } | undefined;
918
+ }>>;
919
+ /**
920
+ * Updates details for a planner task (requires cached ETag from getPlannerTaskDetailsAsync).
921
+ */
922
+ updatePlannerTaskDetailsAsync(taskId: number, updates: {
923
+ description?: string;
924
+ checklist?: Record<string, object>;
925
+ references?: Record<string, object>;
926
+ }): Promise<void>;
927
+ /**
928
+ * Assembles plan, buckets, and tasks into a unified visualization data object.
929
+ */
930
+ getPlanVisualizationDataAsync(planId: number): Promise<PlanVisualizationData>;
931
+ listOnlineMeetingsAsync(limit?: number): Promise<Array<{
932
+ id: number;
933
+ subject: string;
934
+ startDateTime: string;
935
+ endDateTime: string;
936
+ joinUrl: string;
937
+ }>>;
938
+ getOnlineMeetingAsync(meetingId: number): Promise<{
939
+ id: number;
940
+ subject: string;
941
+ startDateTime: string;
942
+ endDateTime: string;
943
+ joinUrl: string;
944
+ participants: unknown;
945
+ } | undefined>;
946
+ listMeetingRecordingsAsync(meetingId: number): Promise<Array<{
947
+ id: number;
948
+ createdDateTime: string;
949
+ recordingContentUrl: string;
950
+ }>>;
951
+ downloadMeetingRecordingAsync(recordingId: number, outputPath: string): Promise<string>;
952
+ listMeetingTranscriptsAsync(meetingId: number): Promise<Array<{
953
+ id: number;
954
+ createdDateTime: string;
955
+ contentUrl: string;
956
+ }>>;
957
+ getMeetingTranscriptContentAsync(transcriptId: number, format?: string): Promise<string>;
958
+ listWorksheetsAsync(fileId: number): Promise<Record<string, unknown>[]>;
959
+ getWorksheetRangeAsync(fileId: number, worksheetName: string, range: string): Promise<Record<string, unknown>>;
960
+ getUsedRangeAsync(fileId: number, worksheetName: string): Promise<Record<string, unknown>>;
961
+ updateWorksheetRangeAsync(fileId: number, worksheetName: string, range: string, values: unknown[][]): Promise<Record<string, unknown>>;
962
+ getTableDataAsync(fileId: number, tableName: string): Promise<Record<string, unknown>[]>;
963
+ /**
964
+ * Lists files/folders in a drive folder (or root).
965
+ */
966
+ listDriveItemsAsync(folderId?: number): Promise<Array<{
967
+ id: number;
968
+ name: string;
969
+ size: number;
970
+ lastModified: string;
971
+ isFolder: boolean;
972
+ webUrl: string;
973
+ }>>;
974
+ /**
975
+ * Searches drive items by query.
976
+ */
977
+ searchDriveItemsAsync(query: string, limit?: number): Promise<Array<{
978
+ id: number;
979
+ name: string;
980
+ size: number;
981
+ lastModified: string;
982
+ isFolder: boolean;
983
+ webUrl: string;
984
+ }>>;
985
+ /**
986
+ * Gets metadata for a specific drive item.
987
+ */
988
+ getDriveItemAsync(itemId: number): Promise<{
989
+ id: number;
990
+ name: string;
991
+ size: number;
992
+ lastModified: string;
993
+ isFolder: boolean;
994
+ webUrl: string;
995
+ mimeType: string;
996
+ createdBy: string;
997
+ }>;
998
+ /**
999
+ * Downloads a drive item to a local file.
1000
+ */
1001
+ downloadFileAsync(itemId: number, outputPath: string): Promise<{
1002
+ savedPath: string;
1003
+ size: number;
1004
+ }>;
1005
+ /**
1006
+ * Uploads a local file to OneDrive.
1007
+ */
1008
+ uploadFileAsync(parentPath: string, fileName: string, localFilePath: string): Promise<number>;
1009
+ /**
1010
+ * Lists recently accessed drive items.
1011
+ */
1012
+ listRecentFilesAsync(): Promise<Array<{
1013
+ id: number;
1014
+ name: string;
1015
+ size: number;
1016
+ lastModified: string;
1017
+ isFolder: boolean;
1018
+ webUrl: string;
1019
+ }>>;
1020
+ /**
1021
+ * Lists drive items shared with the user.
1022
+ */
1023
+ listSharedWithMeAsync(): Promise<Array<{
1024
+ id: number;
1025
+ name: string;
1026
+ size: number;
1027
+ lastModified: string;
1028
+ isFolder: boolean;
1029
+ webUrl: string;
1030
+ }>>;
1031
+ /**
1032
+ * Creates a sharing link for a drive item.
1033
+ */
1034
+ createSharingLinkAsync(itemId: number, type: string, scope: string): Promise<{
1035
+ webUrl: string;
1036
+ type: string;
1037
+ scope: string;
1038
+ }>;
1039
+ /**
1040
+ * Deletes a drive item.
1041
+ */
1042
+ deleteDriveItemAsync(itemId: number): Promise<void>;
1043
+ /**
1044
+ * Lists followed SharePoint sites, caching IDs.
1045
+ */
1046
+ listSitesAsync(): Promise<Array<{
1047
+ id: number;
1048
+ name: string;
1049
+ webUrl: string;
1050
+ displayName: string;
1051
+ }>>;
1052
+ /**
1053
+ * Searches SharePoint sites by keyword, caching IDs.
1054
+ */
1055
+ searchSitesAsync(query: string): Promise<Array<{
1056
+ id: number;
1057
+ name: string;
1058
+ webUrl: string;
1059
+ displayName: string;
1060
+ }>>;
1061
+ /**
1062
+ * Gets details for a specific SharePoint site.
1063
+ */
1064
+ getSiteAsync(siteId: number): Promise<{
1065
+ id: number;
1066
+ name: string;
1067
+ webUrl: string;
1068
+ displayName: string;
1069
+ description: string;
1070
+ }>;
1071
+ /**
1072
+ * Lists document libraries for a SharePoint site, caching IDs.
1073
+ */
1074
+ listDocumentLibrariesAsync(siteId: number): Promise<Array<{
1075
+ id: number;
1076
+ name: string;
1077
+ webUrl: string;
1078
+ driveType: string;
1079
+ }>>;
1080
+ /**
1081
+ * Lists items in a document library or folder, caching IDs.
1082
+ */
1083
+ listLibraryItemsAsync(libraryId: number, folderId?: number): Promise<Array<{
1084
+ id: number;
1085
+ name: string;
1086
+ size: number;
1087
+ webUrl: string;
1088
+ lastModifiedDateTime: string;
1089
+ isFolder: boolean;
1090
+ }>>;
1091
+ /**
1092
+ * Downloads a file from a document library to the specified path.
1093
+ */
1094
+ downloadLibraryFileAsync(itemId: number, outputPath: string): Promise<string>;
1095
+ /**
1096
+ * Gets the Graph string ID for a folder from the cache.
1097
+ */
1098
+ getFolderGraphId(folderId: number): string | undefined;
1099
+ }
1100
+ /**
1101
+ * Creates a Microsoft Graph API repository.
1102
+ */
1103
+ export declare function createGraphRepository(deviceCodeCallback?: DeviceCodeCallback): GraphRepository;
1104
+ //# sourceMappingURL=repository.d.ts.map