@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,114 @@
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
+ * AppleScript-based content readers.
7
+ *
8
+ * Implements content reader interfaces for fetching detailed content
9
+ * directly from Outlook via AppleScript.
10
+ *
11
+ * Since AppleScript doesn't use file paths like SQLite does, these
12
+ * content readers extract IDs from special path formats and fetch
13
+ * content via AppleScript.
14
+ */
15
+ import type { IContentReader } from '../tools/mail.js';
16
+ import type { IEventContentReader, EventDetails } from '../tools/calendar.js';
17
+ import type { IContactContentReader, ContactDetails } from '../tools/contacts.js';
18
+ import type { ITaskContentReader, TaskDetails } from '../tools/tasks.js';
19
+ import type { INoteContentReader, NoteDetails } from '../tools/notes.js';
20
+ import type { AttachmentInfo } from '../types/mail.js';
21
+ import type { SaveAttachmentResult } from './parser.js';
22
+ /**
23
+ * Prefix for AppleScript email content paths.
24
+ * Format: "applescript-email:123" where 123 is the message ID.
25
+ */
26
+ export declare const EMAIL_PATH_PREFIX = "applescript-email:";
27
+ /**
28
+ * Prefix for AppleScript event content paths.
29
+ * Format: "applescript-event:123" where 123 is the event ID.
30
+ */
31
+ export declare const EVENT_PATH_PREFIX = "applescript-event:";
32
+ /**
33
+ * Prefix for AppleScript contact content paths.
34
+ * Format: "applescript-contact:123" where 123 is the contact ID.
35
+ */
36
+ export declare const CONTACT_PATH_PREFIX = "applescript-contact:";
37
+ /**
38
+ * Prefix for AppleScript task content paths.
39
+ * Format: "applescript-task:123" where 123 is the task ID.
40
+ */
41
+ export declare const TASK_PATH_PREFIX = "applescript-task:";
42
+ /**
43
+ * Prefix for AppleScript note content paths.
44
+ * Format: "applescript-note:123" where 123 is the note ID.
45
+ */
46
+ export declare const NOTE_PATH_PREFIX = "applescript-note:";
47
+ /**
48
+ * Creates an AppleScript path from an entity ID.
49
+ */
50
+ export declare function createEmailPath(id: number): string;
51
+ export declare function createEventPath(id: number): string;
52
+ export declare function createContactPath(id: number): string;
53
+ export declare function createTaskPath(id: number): string;
54
+ export declare function createNotePath(id: number): string;
55
+ /**
56
+ * AppleScript-based email content reader.
57
+ */
58
+ export declare class AppleScriptEmailContentReader implements IContentReader {
59
+ readEmailBody(dataFilePath: string | null): string | null;
60
+ }
61
+ /**
62
+ * AppleScript-based event content reader.
63
+ */
64
+ export declare class AppleScriptEventContentReader implements IEventContentReader {
65
+ readEventDetails(dataFilePath: string | null): EventDetails | null;
66
+ }
67
+ /**
68
+ * AppleScript-based contact content reader.
69
+ */
70
+ export declare class AppleScriptContactContentReader implements IContactContentReader {
71
+ readContactDetails(dataFilePath: string | null): ContactDetails | null;
72
+ }
73
+ /**
74
+ * AppleScript-based task content reader.
75
+ */
76
+ export declare class AppleScriptTaskContentReader implements ITaskContentReader {
77
+ readTaskDetails(dataFilePath: string | null): TaskDetails | null;
78
+ }
79
+ /**
80
+ * AppleScript-based note content reader.
81
+ */
82
+ export declare class AppleScriptNoteContentReader implements INoteContentReader {
83
+ readNoteDetails(dataFilePath: string | null): NoteDetails | null;
84
+ }
85
+ /**
86
+ * Interface for reading attachment metadata and saving attachments.
87
+ */
88
+ export interface IAttachmentReader {
89
+ listAttachments(emailId: number): AttachmentInfo[];
90
+ saveAttachment(emailId: number, attachmentIndex: number, savePath: string): SaveAttachmentResult;
91
+ }
92
+ /**
93
+ * AppleScript-based attachment reader.
94
+ */
95
+ export declare class AppleScriptAttachmentReader implements IAttachmentReader {
96
+ listAttachments(emailId: number): AttachmentInfo[];
97
+ saveAttachment(emailId: number, attachmentIndex: number, savePath: string): SaveAttachmentResult;
98
+ }
99
+ /**
100
+ * All AppleScript content readers bundled together.
101
+ */
102
+ export interface AppleScriptContentReaders {
103
+ readonly email: IContentReader;
104
+ readonly event: IEventContentReader;
105
+ readonly contact: IContactContentReader;
106
+ readonly task: ITaskContentReader;
107
+ readonly note: INoteContentReader;
108
+ readonly attachment: IAttachmentReader;
109
+ }
110
+ /**
111
+ * Creates all AppleScript content readers.
112
+ */
113
+ export declare function createAppleScriptContentReaders(): AppleScriptContentReaders;
114
+ //# sourceMappingURL=content-readers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-readers.d.ts","sourceRoot":"","sources":["../../src/applescript/content-readers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAUxD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,uBAAuB,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,iB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AAM,GAAG,cAAc,EAAE,CAAC;IACnD,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,oBAAoB,CAAC;CAClG;AAED;;GAEG;AACH,qBAAa,2BAA4B,YAAW,iBAAiB;IACnE,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,EAAE;IAoBlD,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,oBAAoB;CAWjG;AAMD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC;IACxC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,UAAU,EAAE,iBAAiB,CAAC;CACxC;AAED;;GAEG;AACH,wBAAgB,+BAA+B,IAAI,yBAAyB,CAS3E"}
@@ -0,0 +1,328 @@
1
+ /**
2
+ * Copyright (c) 2026 JBC Tech Solutions, LLC
3
+ * Licensed under the MIT License. See LICENSE file in the project root.
4
+ */
5
+ import { executeAppleScript, executeAppleScriptOrThrow } from './executor.js';
6
+ import { AppleScriptError } from '../utils/errors.js';
7
+ import * as scripts from './scripts.js';
8
+ import * as parser from './parser.js';
9
+ // =============================================================================
10
+ // Path Format Constants
11
+ // =============================================================================
12
+ /**
13
+ * Prefix for AppleScript email content paths.
14
+ * Format: "applescript-email:123" where 123 is the message ID.
15
+ */
16
+ export const EMAIL_PATH_PREFIX = 'applescript-email:';
17
+ /**
18
+ * Prefix for AppleScript event content paths.
19
+ * Format: "applescript-event:123" where 123 is the event ID.
20
+ */
21
+ export const EVENT_PATH_PREFIX = 'applescript-event:';
22
+ /**
23
+ * Prefix for AppleScript contact content paths.
24
+ * Format: "applescript-contact:123" where 123 is the contact ID.
25
+ */
26
+ export const CONTACT_PATH_PREFIX = 'applescript-contact:';
27
+ /**
28
+ * Prefix for AppleScript task content paths.
29
+ * Format: "applescript-task:123" where 123 is the task ID.
30
+ */
31
+ export const TASK_PATH_PREFIX = 'applescript-task:';
32
+ /**
33
+ * Prefix for AppleScript note content paths.
34
+ * Format: "applescript-note:123" where 123 is the note ID.
35
+ */
36
+ export const NOTE_PATH_PREFIX = 'applescript-note:';
37
+ // =============================================================================
38
+ // Utility Functions
39
+ // =============================================================================
40
+ /**
41
+ * Extracts the ID from an AppleScript path.
42
+ */
43
+ function extractId(path, prefix) {
44
+ if (path == null || !path.startsWith(prefix)) {
45
+ return null;
46
+ }
47
+ const idStr = path.substring(prefix.length);
48
+ const id = parseInt(idStr, 10);
49
+ return isNaN(id) ? null : id;
50
+ }
51
+ /**
52
+ * Creates an AppleScript path from an entity ID.
53
+ */
54
+ export function createEmailPath(id) {
55
+ return `${EMAIL_PATH_PREFIX}${id}`;
56
+ }
57
+ export function createEventPath(id) {
58
+ return `${EVENT_PATH_PREFIX}${id}`;
59
+ }
60
+ export function createContactPath(id) {
61
+ return `${CONTACT_PATH_PREFIX}${id}`;
62
+ }
63
+ export function createTaskPath(id) {
64
+ return `${TASK_PATH_PREFIX}${id}`;
65
+ }
66
+ export function createNotePath(id) {
67
+ return `${NOTE_PATH_PREFIX}${id}`;
68
+ }
69
+ // =============================================================================
70
+ // Email Content Reader
71
+ // =============================================================================
72
+ /**
73
+ * AppleScript-based email content reader.
74
+ */
75
+ export class AppleScriptEmailContentReader {
76
+ readEmailBody(dataFilePath) {
77
+ const id = extractId(dataFilePath, EMAIL_PATH_PREFIX);
78
+ if (id == null) {
79
+ return null;
80
+ }
81
+ try {
82
+ const script = scripts.getMessage(id);
83
+ const result = executeAppleScript(script);
84
+ if (!result.success) {
85
+ return null;
86
+ }
87
+ const email = parser.parseEmail(result.output);
88
+ if (email == null) {
89
+ return null;
90
+ }
91
+ // Return HTML content if available, otherwise plain text
92
+ return email.htmlContent ?? email.plainContent;
93
+ }
94
+ catch {
95
+ return null;
96
+ }
97
+ }
98
+ }
99
+ // =============================================================================
100
+ // Event Content Reader
101
+ // =============================================================================
102
+ /**
103
+ * AppleScript-based event content reader.
104
+ */
105
+ export class AppleScriptEventContentReader {
106
+ readEventDetails(dataFilePath) {
107
+ const id = extractId(dataFilePath, EVENT_PATH_PREFIX);
108
+ if (id == null) {
109
+ return null;
110
+ }
111
+ try {
112
+ const script = scripts.getEvent(id);
113
+ const result = executeAppleScript(script);
114
+ if (!result.success) {
115
+ return null;
116
+ }
117
+ const event = parser.parseEvent(result.output);
118
+ if (event == null) {
119
+ return null;
120
+ }
121
+ return {
122
+ title: event.subject,
123
+ location: event.location,
124
+ description: event.htmlContent ?? event.plainContent,
125
+ organizer: event.organizer,
126
+ attendees: event.attendees.map((a) => ({
127
+ email: a.email,
128
+ name: a.name,
129
+ status: 'unknown',
130
+ })),
131
+ };
132
+ }
133
+ catch {
134
+ return null;
135
+ }
136
+ }
137
+ }
138
+ // =============================================================================
139
+ // Contact Content Reader
140
+ // =============================================================================
141
+ /**
142
+ * AppleScript-based contact content reader.
143
+ */
144
+ export class AppleScriptContactContentReader {
145
+ readContactDetails(dataFilePath) {
146
+ const id = extractId(dataFilePath, CONTACT_PATH_PREFIX);
147
+ if (id == null) {
148
+ return null;
149
+ }
150
+ try {
151
+ const script = scripts.getContact(id);
152
+ const result = executeAppleScript(script);
153
+ if (!result.success) {
154
+ return null;
155
+ }
156
+ const contact = parser.parseContact(result.output);
157
+ if (contact == null) {
158
+ return null;
159
+ }
160
+ // Build emails array
161
+ const emails = contact.emails.map((e) => ({
162
+ type: 'work',
163
+ address: e,
164
+ }));
165
+ // Build phones array
166
+ const phones = [];
167
+ if (contact.homePhone != null) {
168
+ phones.push({ type: 'home', number: contact.homePhone });
169
+ }
170
+ if (contact.workPhone != null) {
171
+ phones.push({ type: 'work', number: contact.workPhone });
172
+ }
173
+ if (contact.mobilePhone != null) {
174
+ phones.push({ type: 'mobile', number: contact.mobilePhone });
175
+ }
176
+ // Build addresses array
177
+ const addresses = [];
178
+ if (contact.homeStreet != null ||
179
+ contact.homeCity != null ||
180
+ contact.homeState != null ||
181
+ contact.homeZip != null ||
182
+ contact.homeCountry != null) {
183
+ addresses.push({
184
+ type: 'home',
185
+ street: contact.homeStreet,
186
+ city: contact.homeCity,
187
+ state: contact.homeState,
188
+ postalCode: contact.homeZip,
189
+ country: contact.homeCountry,
190
+ });
191
+ }
192
+ return {
193
+ firstName: contact.firstName,
194
+ lastName: contact.lastName,
195
+ middleName: contact.middleName,
196
+ nickname: contact.nickname,
197
+ company: contact.company,
198
+ jobTitle: contact.jobTitle,
199
+ department: contact.department,
200
+ emails,
201
+ phones,
202
+ addresses,
203
+ notes: contact.notes,
204
+ };
205
+ }
206
+ catch {
207
+ return null;
208
+ }
209
+ }
210
+ }
211
+ // =============================================================================
212
+ // Task Content Reader
213
+ // =============================================================================
214
+ /**
215
+ * AppleScript-based task content reader.
216
+ */
217
+ export class AppleScriptTaskContentReader {
218
+ readTaskDetails(dataFilePath) {
219
+ const id = extractId(dataFilePath, TASK_PATH_PREFIX);
220
+ if (id == null) {
221
+ return null;
222
+ }
223
+ try {
224
+ const script = scripts.getTask(id);
225
+ const result = executeAppleScript(script);
226
+ if (!result.success) {
227
+ return null;
228
+ }
229
+ const task = parser.parseTask(result.output);
230
+ if (task == null) {
231
+ return null;
232
+ }
233
+ return {
234
+ body: task.htmlContent ?? task.plainContent,
235
+ completedDate: task.completedDate,
236
+ reminderDate: null,
237
+ categories: [],
238
+ };
239
+ }
240
+ catch {
241
+ return null;
242
+ }
243
+ }
244
+ }
245
+ // =============================================================================
246
+ // Note Content Reader
247
+ // =============================================================================
248
+ /**
249
+ * AppleScript-based note content reader.
250
+ */
251
+ export class AppleScriptNoteContentReader {
252
+ readNoteDetails(dataFilePath) {
253
+ const id = extractId(dataFilePath, NOTE_PATH_PREFIX);
254
+ if (id == null) {
255
+ return null;
256
+ }
257
+ try {
258
+ const script = scripts.getNote(id);
259
+ const result = executeAppleScript(script);
260
+ if (!result.success) {
261
+ return null;
262
+ }
263
+ const note = parser.parseNote(result.output);
264
+ if (note == null) {
265
+ return null;
266
+ }
267
+ const body = note.htmlContent ?? note.plainContent ?? '';
268
+ const preview = body.substring(0, 200);
269
+ return {
270
+ title: note.name,
271
+ body,
272
+ preview,
273
+ createdDate: note.createdDate,
274
+ categories: [],
275
+ };
276
+ }
277
+ catch {
278
+ return null;
279
+ }
280
+ }
281
+ }
282
+ /**
283
+ * AppleScript-based attachment reader.
284
+ */
285
+ export class AppleScriptAttachmentReader {
286
+ listAttachments(emailId) {
287
+ try {
288
+ const script = scripts.listAttachments(emailId);
289
+ const result = executeAppleScript(script);
290
+ if (!result.success) {
291
+ return [];
292
+ }
293
+ const rows = parser.parseAttachments(result.output);
294
+ return rows.map((r) => ({
295
+ index: r.index,
296
+ name: r.name,
297
+ size: r.fileSize,
298
+ contentType: r.contentType,
299
+ }));
300
+ }
301
+ catch {
302
+ return [];
303
+ }
304
+ }
305
+ saveAttachment(emailId, attachmentIndex, savePath) {
306
+ const script = scripts.saveAttachment(emailId, attachmentIndex, savePath);
307
+ const output = executeAppleScriptOrThrow(script);
308
+ const result = parser.parseSaveAttachmentResult(output);
309
+ if (result == null) {
310
+ throw new AppleScriptError('Failed to parse save attachment response');
311
+ }
312
+ return result;
313
+ }
314
+ }
315
+ /**
316
+ * Creates all AppleScript content readers.
317
+ */
318
+ export function createAppleScriptContentReaders() {
319
+ return {
320
+ email: new AppleScriptEmailContentReader(),
321
+ event: new AppleScriptEventContentReader(),
322
+ contact: new AppleScriptContactContentReader(),
323
+ task: new AppleScriptTaskContentReader(),
324
+ note: new AppleScriptNoteContentReader(),
325
+ attachment: new AppleScriptAttachmentReader(),
326
+ };
327
+ }
328
+ //# sourceMappingURL=content-readers.js.map
@@ -0,0 +1 @@
1
+ {"version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Ac,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,CAAC,CAAC;QAC1E,MAAM,MAAM,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,MAAM,CAAC,yBAAyB,CAAC,MAAM,CAAC,CAAC;QAExD,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;YACnB,MAAM,IAAI,gBAAgB,CAAC,0CAA0C,CAAC,CAAC;QACzE,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAkBD;;GAEG;AACH,MAAM,UAAU,+BAA+B;IAC7C,OAAO;QACL,KAAK,EAAE,IAAI,6BAA6B,EAAE;QAC1C,KAAK,EAAE,IAAI,6BAA6B,EAAE;QAC1C,OAAO,EAAE,IAAI,+BAA+B,EAAE;QAC9C,IAAI,EAAE,IAAI,4BAA4B,EAAE;QACxC,IAAI,EAAE,IAAI,4BAA4B,EAAE;QACxC,UAAU,EAAE,IAAI,2BAA2B,EAAE;KAC9C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,60 @@
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
+ * Result of an AppleScript execution.
7
+ */
8
+ export interface AppleScriptResult {
9
+ readonly success: boolean;
10
+ readonly output: string;
11
+ readonly error?: string;
12
+ }
13
+ /**
14
+ * Options for AppleScript execution.
15
+ */
16
+ export interface ExecuteOptions {
17
+ readonly timeoutMs?: number;
18
+ }
19
+ /**
20
+ * Escapes a string for safe inclusion in AppleScript.
21
+ * Handles quotes and backslashes.
22
+ */
23
+ export declare function escapeForAppleScript(value: string): string;
24
+ /**
25
+ * Executes an AppleScript and returns the result.
26
+ *
27
+ * @param script - The AppleScript code to execute
28
+ * @param options - Execution options
29
+ * @returns The result of execution
30
+ */
31
+ export declare function executeAppleScript(script: string, options?: ExecuteOptions): AppleScriptResult;
32
+ /**
33
+ * Executes an AppleScript and throws on failure.
34
+ *
35
+ * @param script - The AppleScript code to execute
36
+ * @param options - Execution options
37
+ * @returns The output string
38
+ * @throws Error if execution fails
39
+ */
40
+ export declare function executeAppleScriptOrThrow(script: string, options?: ExecuteOptions): string;
41
+ /**
42
+ * Checks if Microsoft Outlook is currently running.
43
+ */
44
+ export declare function isOutlookRunning(): boolean;
45
+ /**
46
+ * Launches Microsoft Outlook if not already running.
47
+ */
48
+ export declare function launchOutlook(): boolean;
49
+ /**
50
+ * Gets the version of Microsoft Outlook.
51
+ */
52
+ export declare function getOutlookVersion(): string | null;
53
+ /**
54
+ * Error thrown when AppleScript execution fails.
55
+ */
56
+ export declare class AppleScriptExecutionError extends Error {
57
+ readonly errorType: 'not_running' | 'permission_denied' | 'timeout' | 'unknown';
58
+ constructor(message: string, errorType: 'not_running' | 'permission_denied' | 'timeout' | 'unknown');
59
+ }
60
+ //# sourceMappingURL=executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/applescript/executor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkCH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AA0BD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAI1D;AAMD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,iBAAiB,CAmClG;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,MAAM,CAO9F;AAMD;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAU1C;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAUvC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,IAAI,CASjD;AAMD;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,QAAQ,CAAC,SAAS,EAAE,aAAa,GAAG,mBAAmB,GAAG,SAAS,GAAG,SAAS,CAAC;gBAEpE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,GAAG,mBAAmB,GAAG,SAAS,GAAG,SAAS;CAKpG"}