@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,30 @@
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 { type AppleScriptAccountRow, type AppleScriptFolderWithAccountRow } from './parser.js';
6
+ export interface IAccountRepository {
7
+ /**
8
+ * Lists all Exchange accounts configured in Outlook.
9
+ */
10
+ listAccounts(): AppleScriptAccountRow[];
11
+ /**
12
+ * Gets the ID of the default account.
13
+ * Returns null if no default is set or no accounts exist.
14
+ */
15
+ getDefaultAccountId(): number | null;
16
+ /**
17
+ * Lists mail folders for specific accounts.
18
+ */
19
+ listMailFoldersByAccounts(accountIds: number[]): AppleScriptFolderWithAccountRow[];
20
+ }
21
+ export declare class AccountRepository implements IAccountRepository {
22
+ listAccounts(): AppleScriptAccountRow[];
23
+ getDefaultAccountId(): number | null;
24
+ listMailFoldersByAccounts(accountIds: number[]): AppleScriptFolderWithAccountRow[];
25
+ }
26
+ /**
27
+ * Creates an account repository instance.
28
+ */
29
+ export declare function createAccountRepository(): IAccountRepository;
30
+ //# sourceMappingURL=account-repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-repository.d.ts","sourceRoot":"","sources":["../../src/applescript/account-repository.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,+BAA+B,EACrC,MAAM,aAAa,CAAC;AAMrB,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,YAAY,IAAI,qBAAqB,EAAE,CAAC;IAExC;;;OAGG;IACH,mBAAmB,IAAI,MAAM,GAAG,IAAI,CAAC;IAErC;;OAEG;IACH,yBAAyB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,+BAA+B,EAAE,CAAC;CACpF;AAMD,qBAAa,iBAAkB,YAAW,kBAAkB;IAC1D,YAAY,IAAI,qBAAqB,EAAE;IAKvC,mBAAmB,IAAI,MAAM,GAAG,IAAI;IAKpC,yBAAyB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,+BAA+B,EAAE;CAQnF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,kBAAkB,CAE5D"}
@@ -0,0 +1,38 @@
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
+ * Repository for Outlook account operations using AppleScript.
7
+ */
8
+ import { executeAppleScriptOrThrow } from './executor.js';
9
+ import { LIST_ACCOUNTS, GET_DEFAULT_ACCOUNT, listMailFoldersByAccounts } from './account-scripts.js';
10
+ import { parseAccounts, parseDefaultAccountId, parseFoldersWithAccount, } from './parser.js';
11
+ // =============================================================================
12
+ // Implementation
13
+ // =============================================================================
14
+ export class AccountRepository {
15
+ listAccounts() {
16
+ const output = executeAppleScriptOrThrow(LIST_ACCOUNTS);
17
+ return parseAccounts(output);
18
+ }
19
+ getDefaultAccountId() {
20
+ const output = executeAppleScriptOrThrow(GET_DEFAULT_ACCOUNT);
21
+ return parseDefaultAccountId(output);
22
+ }
23
+ listMailFoldersByAccounts(accountIds) {
24
+ if (accountIds.length === 0) {
25
+ return [];
26
+ }
27
+ const script = listMailFoldersByAccounts(accountIds);
28
+ const output = executeAppleScriptOrThrow(script);
29
+ return parseFoldersWithAccount(output);
30
+ }
31
+ }
32
+ /**
33
+ * Creates an account repository instance.
34
+ */
35
+ export function createAccountRepository() {
36
+ return new AccountRepository();
37
+ }
38
+ //# sourceMappingURL=account-repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-repository.js","sourceRoot":"","sources":["../../src/applescript/account-repository.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACrG,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,uBAAuB,GAGxB,MAAM,aAAa,CAAC;AAwBrB,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAEhF,MAAM,OAAO,iBAAiB;IAC5B,YAAY;QACV,MAAM,MAAM,GAAG,yBAAyB,CAAC,aAAa,CAAC,CAAC;QACxD,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IAED,mBAAmB;QACjB,MAAM,MAAM,GAAG,yBAAyB,CAAC,mBAAmB,CAAC,CAAC;QAC9D,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IAED,yBAAyB,CAAC,UAAoB;QAC5C,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5B,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,MAAM,MAAM,GAAG,yBAAyB,CAAC,UAAU,CAAC,CAAC;QACrD,MAAM,MAAM,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;QACjD,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,IAAI,iBAAiB,EAAE,CAAC;AACjC,CAAC"}
@@ -0,0 +1,21 @@
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
+ * Lists all accounts in Outlook (Exchange, IMAP, POP).
7
+ * Returns: id, name, email address, type for each account
8
+ */
9
+ export declare const LIST_ACCOUNTS: string;
10
+ /**
11
+ * Gets the default account in Outlook.
12
+ * Returns: id of the default account, or first account if no default is set
13
+ */
14
+ export declare const GET_DEFAULT_ACCOUNT: string;
15
+ /**
16
+ * Lists mail folders for specific accounts (all types: Exchange, IMAP, POP).
17
+ *
18
+ * @param accountIds - Array of account IDs to query
19
+ */
20
+ export declare function listMailFoldersByAccounts(accountIds: number[]): string;
21
+ //# sourceMappingURL=account-scripts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-scripts.d.ts","sourceRoot":"","sources":["../../src/applescript/account-scripts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH;;;GAGG;AACH,eAAO,MAAM,aAAa,QAgDzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QA8B/B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,CAyEtE"}
@@ -0,0 +1,180 @@
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 template strings for Outlook account operations.
7
+ *
8
+ * Outputs data in delimiter-based format for reliable parsing.
9
+ */
10
+ import { DELIMITERS } from './scripts.js';
11
+ // =============================================================================
12
+ // Account Scripts
13
+ // =============================================================================
14
+ /**
15
+ * Lists all accounts in Outlook (Exchange, IMAP, POP).
16
+ * Returns: id, name, email address, type for each account
17
+ */
18
+ export const LIST_ACCOUNTS = `
19
+ tell application "Microsoft Outlook"
20
+ set output to ""
21
+
22
+ -- Get Exchange accounts
23
+ try
24
+ set exchangeAccounts to every exchange account
25
+ repeat with acc in exchangeAccounts
26
+ try
27
+ set accId to id of acc
28
+ set accName to name of acc
29
+ set accEmail to email address of acc
30
+ set accType to "exchange"
31
+ set output to output & "${DELIMITERS.RECORD}id${DELIMITERS.EQUALS}" & accId & "${DELIMITERS.FIELD}name${DELIMITERS.EQUALS}" & accName & "${DELIMITERS.FIELD}email${DELIMITERS.EQUALS}" & accEmail & "${DELIMITERS.FIELD}type${DELIMITERS.EQUALS}" & accType
32
+ end try
33
+ end repeat
34
+ end try
35
+
36
+ -- Get IMAP accounts
37
+ try
38
+ set imapAccounts to every imap account
39
+ repeat with acc in imapAccounts
40
+ try
41
+ set accId to id of acc
42
+ set accName to name of acc
43
+ set accEmail to email address of acc
44
+ set accType to "imap"
45
+ set output to output & "${DELIMITERS.RECORD}id${DELIMITERS.EQUALS}" & accId & "${DELIMITERS.FIELD}name${DELIMITERS.EQUALS}" & accName & "${DELIMITERS.FIELD}email${DELIMITERS.EQUALS}" & accEmail & "${DELIMITERS.FIELD}type${DELIMITERS.EQUALS}" & accType
46
+ end try
47
+ end repeat
48
+ end try
49
+
50
+ -- Get POP accounts
51
+ try
52
+ set popAccounts to every pop account
53
+ repeat with acc in popAccounts
54
+ try
55
+ set accId to id of acc
56
+ set accName to name of acc
57
+ set accEmail to email address of acc
58
+ set accType to "pop"
59
+ set output to output & "${DELIMITERS.RECORD}id${DELIMITERS.EQUALS}" & accId & "${DELIMITERS.FIELD}name${DELIMITERS.EQUALS}" & accName & "${DELIMITERS.FIELD}email${DELIMITERS.EQUALS}" & accEmail & "${DELIMITERS.FIELD}type${DELIMITERS.EQUALS}" & accType
60
+ end try
61
+ end repeat
62
+ end try
63
+
64
+ return output
65
+ end tell
66
+ `;
67
+ /**
68
+ * Gets the default account in Outlook.
69
+ * Returns: id of the default account, or first account if no default is set
70
+ */
71
+ export const GET_DEFAULT_ACCOUNT = `
72
+ tell application "Microsoft Outlook"
73
+ try
74
+ -- Try to get the default account
75
+ set defaultAcc to default account
76
+ set accId to id of defaultAcc
77
+ return "id${DELIMITERS.EQUALS}" & accId
78
+ on error
79
+ -- Fallback: return first available account (try exchange, then imap, then pop)
80
+ try
81
+ set firstAcc to first exchange account
82
+ set accId to id of firstAcc
83
+ return "id${DELIMITERS.EQUALS}" & accId
84
+ on error
85
+ try
86
+ set firstAcc to first imap account
87
+ set accId to id of firstAcc
88
+ return "id${DELIMITERS.EQUALS}" & accId
89
+ on error
90
+ try
91
+ set firstAcc to first pop account
92
+ set accId to id of firstAcc
93
+ return "id${DELIMITERS.EQUALS}" & accId
94
+ on error
95
+ return "error${DELIMITERS.EQUALS}No accounts found"
96
+ end try
97
+ end try
98
+ end try
99
+ end try
100
+ end tell
101
+ `;
102
+ /**
103
+ * Lists mail folders for specific accounts (all types: Exchange, IMAP, POP).
104
+ *
105
+ * @param accountIds - Array of account IDs to query
106
+ */
107
+ export function listMailFoldersByAccounts(accountIds) {
108
+ const accountFilter = accountIds.map(id => `id ${id}`).join(' or id ');
109
+ return `
110
+ tell application "Microsoft Outlook"
111
+ set output to ""
112
+
113
+ -- Get folders from Exchange accounts
114
+ try
115
+ set targetAccounts to (every exchange account whose ${accountFilter})
116
+ repeat with acc in targetAccounts
117
+ set accId to id of acc
118
+ set allFolders to mail folders of acc
119
+ repeat with f in allFolders
120
+ try
121
+ set fId to id of f
122
+ set fName to name of f
123
+ set uCount to unread count of f
124
+ set mCount to 0
125
+ try
126
+ set mCount to count of messages of f
127
+ end try
128
+ set output to output & "${DELIMITERS.RECORD}id${DELIMITERS.EQUALS}" & fId & "${DELIMITERS.FIELD}name${DELIMITERS.EQUALS}" & fName & "${DELIMITERS.FIELD}unreadCount${DELIMITERS.EQUALS}" & uCount & "${DELIMITERS.FIELD}messageCount${DELIMITERS.EQUALS}" & mCount & "${DELIMITERS.FIELD}accountId${DELIMITERS.EQUALS}" & accId
129
+ end try
130
+ end repeat
131
+ end repeat
132
+ end try
133
+
134
+ -- Get folders from IMAP accounts
135
+ try
136
+ set targetAccounts to (every imap account whose ${accountFilter})
137
+ repeat with acc in targetAccounts
138
+ set accId to id of acc
139
+ set allFolders to mail folders of acc
140
+ repeat with f in allFolders
141
+ try
142
+ set fId to id of f
143
+ set fName to name of f
144
+ set uCount to unread count of f
145
+ set mCount to 0
146
+ try
147
+ set mCount to count of messages of f
148
+ end try
149
+ set output to output & "${DELIMITERS.RECORD}id${DELIMITERS.EQUALS}" & fId & "${DELIMITERS.FIELD}name${DELIMITERS.EQUALS}" & fName & "${DELIMITERS.FIELD}unreadCount${DELIMITERS.EQUALS}" & uCount & "${DELIMITERS.FIELD}messageCount${DELIMITERS.EQUALS}" & mCount & "${DELIMITERS.FIELD}accountId${DELIMITERS.EQUALS}" & accId
150
+ end try
151
+ end repeat
152
+ end repeat
153
+ end try
154
+
155
+ -- Get folders from POP accounts
156
+ try
157
+ set targetAccounts to (every pop account whose ${accountFilter})
158
+ repeat with acc in targetAccounts
159
+ set accId to id of acc
160
+ set allFolders to mail folders of acc
161
+ repeat with f in allFolders
162
+ try
163
+ set fId to id of f
164
+ set fName to name of f
165
+ set uCount to unread count of f
166
+ set mCount to 0
167
+ try
168
+ set mCount to count of messages of f
169
+ end try
170
+ set output to output & "${DELIMITERS.RECORD}id${DELIMITERS.EQUALS}" & fId & "${DELIMITERS.FIELD}name${DELIMITERS.EQUALS}" & fName & "${DELIMITERS.FIELD}unreadCount${DELIMITERS.EQUALS}" & uCount & "${DELIMITERS.FIELD}messageCount${DELIMITERS.EQUALS}" & mCount & "${DELIMITERS.FIELD}accountId${DELIMITERS.EQUALS}" & accId
171
+ end try
172
+ end repeat
173
+ end repeat
174
+ end try
175
+
176
+ return output
177
+ end tell
178
+ `;
179
+ }
180
+ //# sourceMappingURL=account-scripts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-scripts.js","sourceRoot":"","sources":["../../src/applescript/account-scripts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CA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CAanC,UAAU,CAAC,MAAM,KAAK,UAAU,CAAC,MAAM,cAAc,UAAU,CAAC,KAAK,OAAO,UAAU,CAAC,MAAM,gBAAgB,UAAU,CAAC,KAAK,cAAc,UAAU,CAAC,MAAM,iBAAiB,UAAU,CAAC,KAAK,eAAe,UAAU,CAAC,MAAM,iBAAiB,UAAU,CAAC,KAAK,YAAY,UAAU,CAAC,MAAM;;;;;;;;sDAQzQ,aAAa;;;;;;;;;;;;;oCAa/B,UAAU,CAAC,MAAM,KAAK,UAAU,CAAC,MAAM,cAAc,UAAU,CAAC,KAAK,OAAO,UAAU,CAAC,MAAM,gBAAgB,UAAU,CAAC,KAAK,cAAc,UAAU,CAAC,MAAM,iBAAiB,UAAU,CAAC,KAAK,eAAe,UAAU,CAAC,MAAM,iBAAiB,UAAU,CAAC,KAAK,YAAY,UAAU,CAAC,MAAM;;;;;;;;qDAQ1Q,aAAa;;;;;;;;;;;;;oCAa9B,UAAU,CAAC,MAAM,KAAK,UAAU,CAAC,MAAM,cAAc,UAAU,CAAC,KAAK,OAAO,UAAU,CAAC,MAAM,gBAAgB,UAAU,CAAC,KAAK,cAAc,UAAU,CAAC,MAAM,iBAAiB,UAAU,CAAC,KAAK,eAAe,UAAU,CAAC,MAAM,iBAAiB,UAAU,CAAC,KAAK,YAAY,UAAU,CAAC,MAAM;;;;;;;;CAQ9T,CAAC;AACF,CAAC"}
@@ -0,0 +1,44 @@
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 { type RespondToEventResult } from './parser.js';
6
+ export type ResponseType = 'accept' | 'decline' | 'tentative';
7
+ export type ApplyToScope = 'this_instance' | 'all_in_series';
8
+ export interface ICalendarManager {
9
+ respondToEvent(eventId: number, response: ResponseType, sendResponse: boolean, comment?: string): RespondToEventResult;
10
+ deleteEvent(eventId: number, applyTo: ApplyToScope): void;
11
+ updateEvent(eventId: number, updates: EventUpdates, applyTo: ApplyToScope): UpdatedEvent;
12
+ }
13
+ export interface EventUpdates {
14
+ readonly title?: string;
15
+ readonly startDate?: string;
16
+ readonly endDate?: string;
17
+ readonly location?: string;
18
+ readonly description?: string;
19
+ readonly isAllDay?: boolean;
20
+ }
21
+ export interface UpdatedEvent {
22
+ readonly id: number;
23
+ readonly updatedFields: readonly string[];
24
+ }
25
+ export declare class AppleScriptCalendarManager implements ICalendarManager {
26
+ /**
27
+ * Responds to an event invitation (accept, decline, or tentative).
28
+ */
29
+ respondToEvent(eventId: number, response: ResponseType, sendResponse: boolean, comment?: string): RespondToEventResult;
30
+ /**
31
+ * Deletes an event (single instance or entire recurring series).
32
+ */
33
+ deleteEvent(eventId: number, applyTo: ApplyToScope): void;
34
+ /**
35
+ * Updates an event (single instance or entire recurring series).
36
+ * All fields in updates are optional - only specified fields will be updated.
37
+ */
38
+ updateEvent(eventId: number, updates: EventUpdates, applyTo: ApplyToScope): UpdatedEvent;
39
+ }
40
+ /**
41
+ * Creates a new calendar manager instance.
42
+ */
43
+ export declare function createCalendarManager(): ICalendarManager;
44
+ //# sourceMappingURL=calendar-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-manager.d.ts","sourceRoot":"","sources":["../../src/applescript/calendar-manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,EAA6E,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAOnI,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AAC9D,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,eAAe,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IAC/B,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,oBAAoB,CAAC;IACvH,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;IAC1D,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY,CAAC;CAC1F;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C;AAMD,qBAAa,0BAA2B,YAAW,gBAAgB;IACjE;;OAEG;IACH,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,oBAAoB;IAmBtH;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI;IAczD;;;OAGG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY;CAiCzF;AAMD;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,gBAAgB,CAExD"}
@@ -0,0 +1,92 @@
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
+ * Calendar management operations using AppleScript.
7
+ *
8
+ * Provides high-level calendar operations including RSVP, deletion, and updates.
9
+ */
10
+ import { executeAppleScriptOrThrow } from './executor.js';
11
+ import * as scripts from './scripts.js';
12
+ import { parseRespondToEventResult, parseDeleteEventResult, parseUpdateEventResult } from './parser.js';
13
+ import { AppleScriptError } from '../utils/errors.js';
14
+ // =============================================================================
15
+ // Implementation
16
+ // =============================================================================
17
+ export class AppleScriptCalendarManager {
18
+ /**
19
+ * Responds to an event invitation (accept, decline, or tentative).
20
+ */
21
+ respondToEvent(eventId, response, sendResponse, comment) {
22
+ const params = comment != null
23
+ ? { eventId, response, sendResponse, comment }
24
+ : { eventId, response, sendResponse };
25
+ const script = scripts.respondToEvent(params);
26
+ const output = executeAppleScriptOrThrow(script);
27
+ const result = parseRespondToEventResult(output);
28
+ if (result == null) {
29
+ throw new AppleScriptError('Failed to parse RSVP response');
30
+ }
31
+ if (!result.success) {
32
+ throw new AppleScriptError(result.error ?? 'RSVP operation failed');
33
+ }
34
+ return result;
35
+ }
36
+ /**
37
+ * Deletes an event (single instance or entire recurring series).
38
+ */
39
+ deleteEvent(eventId, applyTo) {
40
+ const script = scripts.deleteEvent({ eventId, applyTo });
41
+ const output = executeAppleScriptOrThrow(script);
42
+ const result = parseDeleteEventResult(output);
43
+ if (result == null) {
44
+ throw new AppleScriptError('Failed to parse delete response');
45
+ }
46
+ if (!result.success) {
47
+ throw new AppleScriptError(result.error ?? 'Delete operation failed');
48
+ }
49
+ }
50
+ /**
51
+ * Updates an event (single instance or entire recurring series).
52
+ * All fields in updates are optional - only specified fields will be updated.
53
+ */
54
+ updateEvent(eventId, updates, applyTo) {
55
+ const scriptUpdates = {
56
+ ...(updates.title != null && { title: updates.title }),
57
+ ...(updates.location != null && { location: updates.location }),
58
+ ...(updates.description != null && { description: updates.description }),
59
+ ...(updates.startDate != null && { startDate: updates.startDate }),
60
+ ...(updates.endDate != null && { endDate: updates.endDate }),
61
+ ...(updates.isAllDay != null && { isAllDay: updates.isAllDay }),
62
+ };
63
+ const scriptParams = {
64
+ eventId,
65
+ applyTo,
66
+ updates: scriptUpdates,
67
+ };
68
+ const script = scripts.updateEvent(scriptParams);
69
+ const output = executeAppleScriptOrThrow(script);
70
+ const result = parseUpdateEventResult(output);
71
+ if (result == null) {
72
+ throw new AppleScriptError('Failed to parse update response');
73
+ }
74
+ if (!result.success) {
75
+ throw new AppleScriptError(result.error ?? 'Update operation failed');
76
+ }
77
+ return {
78
+ id: result.id,
79
+ updatedFields: result.updatedFields ?? [],
80
+ };
81
+ }
82
+ }
83
+ // =============================================================================
84
+ // Factory
85
+ // =============================================================================
86
+ /**
87
+ * Creates a new calendar manager instance.
88
+ */
89
+ export function createCalendarManager() {
90
+ return new AppleScriptCalendarManager();
91
+ }
92
+ //# sourceMappingURL=calendar-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-manager.js","sourceRoot":"","sources":["../../src/applescript/calendar-manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,sBAAsB,EAA6B,MAAM,aAAa,CAAC;AACnI,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AA6BtD,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAEhF,MAAM,OAAO,0BAA0B;IACrC;;OAEG;IACH,cAAc,CAAC,OAAe,EAAE,QAAsB,EAAE,YAAqB,EAAE,OAAgB;QAC7F,MAAM,MAAM,GAAiC,OAAO,IAAI,IAAI;YAC1D,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE;YAC9C,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;QACxC,MAAM,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAC9C,MAAM,MAAM,GAAG,yBAAyB,CAAC,MAAM,CAAC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,WAAW,EAAE,CAAC;YACxE,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,IAAI,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;YAClE,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC;YAC5D,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;SAChE,CAAC;QAEF,MAAM,YAAY,GAA8B;YAC9C,OAAO;YACP,OAAO;YACP,OAAO,EAAE,aAAa;SACvB,CAAC;QAEF,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;QAE9C,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;YACnB,MAAM,IAAI,gBAAgB,CAAC,iCAAiC,CAAC,CAAC;QAChE,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,IAAI,gBAAgB,CAAC,MAAM,CAAC,KAAK,IAAI,yBAAyB,CAAC,CAAC;QACxE,CAAC;QAED,OAAO;YACL,EAAE,EAAE,MAAM,CAAC,EAAG;YACd,aAAa,EAAE,MAAM,CAAC,aAAa,IAAI,EAAE;SAC1C,CAAC;IACJ,CAAC;CACF;AAED,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,IAAI,0BAA0B,EAAE,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Copyright (c) 2026 JBC Tech Solutions, LLC
3
+ * Licensed under the MIT License. See LICENSE file in the project root.
4
+ */
5
+ export interface RecurrenceConfig {
6
+ readonly frequency: 'daily' | 'weekly' | 'monthly' | 'yearly';
7
+ readonly interval: number;
8
+ readonly daysOfWeek?: readonly string[];
9
+ readonly dayOfMonth?: number;
10
+ readonly weekOfMonth?: string;
11
+ readonly dayOfWeekMonthly?: string;
12
+ readonly endDate?: string;
13
+ readonly endAfterCount?: number;
14
+ }
15
+ export interface CreateEventParams {
16
+ readonly title: string;
17
+ readonly startDate: string;
18
+ readonly endDate: string;
19
+ readonly calendarId?: number;
20
+ readonly location?: string;
21
+ readonly description?: string;
22
+ readonly isAllDay?: boolean;
23
+ readonly recurrence?: RecurrenceConfig;
24
+ }
25
+ export interface CreatedEvent {
26
+ readonly id: number;
27
+ readonly calendarId: number | null;
28
+ }
29
+ export interface ICalendarWriter {
30
+ createEvent(params: CreateEventParams): CreatedEvent;
31
+ }
32
+ export declare class AppleScriptCalendarWriter implements ICalendarWriter {
33
+ createEvent(params: CreateEventParams): CreatedEvent;
34
+ }
35
+ export declare function createCalendarWriter(): ICalendarWriter;
36
+ //# sourceMappingURL=calendar-writer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-writer.d.ts","sourceRoot":"","sources":["../../src/applescript/calendar-writer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkBH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,SAAS,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC9D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,gBAAgB,CAAC;CACxC;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,YAAY,CAAC;CACtD;AAgCD,qBAAa,yBAA0B,YAAW,eAAe;IAC/D,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,YAAY;CAkDrD;AAED,wBAAgB,oBAAoB,IAAI,eAAe,CAEtD"}
@@ -0,0 +1,94 @@
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
+ * Calendar write operations using AppleScript.
7
+ *
8
+ * Follows the IAccountRepository pattern: a separate interface for
9
+ * AppleScript-only capabilities, keeping IRepository read-only.
10
+ */
11
+ import { executeAppleScriptOrThrow } from './executor.js';
12
+ import * as scripts from './scripts.js';
13
+ import { parseCreateEventResult } from './parser.js';
14
+ // =============================================================================
15
+ // Date Conversion
16
+ // =============================================================================
17
+ /**
18
+ * Parses an ISO 8601 date string into individual UTC components.
19
+ * Uses UTC methods so that a Z-suffixed ISO string is interpreted
20
+ * consistently regardless of the host machine's local timezone.
21
+ */
22
+ function isoToDateComponents(isoString) {
23
+ const date = new Date(isoString);
24
+ return {
25
+ year: date.getUTCFullYear(),
26
+ month: date.getUTCMonth() + 1, // JS months are 0-indexed
27
+ day: date.getUTCDate(),
28
+ hours: date.getUTCHours(),
29
+ minutes: date.getUTCMinutes(),
30
+ };
31
+ }
32
+ // =============================================================================
33
+ // Implementation
34
+ // =============================================================================
35
+ export class AppleScriptCalendarWriter {
36
+ createEvent(params) {
37
+ const start = isoToDateComponents(params.startDate);
38
+ const end = isoToDateComponents(params.endDate);
39
+ const scriptParams = {
40
+ title: params.title,
41
+ startYear: start.year,
42
+ startMonth: start.month,
43
+ startDay: start.day,
44
+ startHours: start.hours,
45
+ startMinutes: start.minutes,
46
+ endYear: end.year,
47
+ endMonth: end.month,
48
+ endDay: end.day,
49
+ endHours: end.hours,
50
+ endMinutes: end.minutes,
51
+ };
52
+ if (params.calendarId != null)
53
+ scriptParams.calendarId = params.calendarId;
54
+ if (params.location != null)
55
+ scriptParams.location = params.location;
56
+ if (params.description != null)
57
+ scriptParams.description = params.description;
58
+ if (params.isAllDay != null)
59
+ scriptParams.isAllDay = params.isAllDay;
60
+ if (params.recurrence != null) {
61
+ const rec = params.recurrence;
62
+ const recurrenceScript = {
63
+ frequency: rec.frequency,
64
+ interval: rec.interval,
65
+ };
66
+ // Use mutable alias to conditionally set optional properties
67
+ const mut = recurrenceScript;
68
+ if (rec.daysOfWeek != null)
69
+ mut.daysOfWeek = rec.daysOfWeek;
70
+ if (rec.dayOfMonth != null)
71
+ mut.dayOfMonth = rec.dayOfMonth;
72
+ if (rec.weekOfMonth != null)
73
+ mut.weekOfMonth = rec.weekOfMonth;
74
+ if (rec.dayOfWeekMonthly != null)
75
+ mut.dayOfWeekMonthly = rec.dayOfWeekMonthly;
76
+ if (rec.endAfterCount != null)
77
+ mut.endAfterCount = rec.endAfterCount;
78
+ if (rec.endDate != null)
79
+ mut.endDate = isoToDateComponents(rec.endDate);
80
+ scriptParams.recurrence = recurrenceScript;
81
+ }
82
+ const script = scripts.createEvent(scriptParams);
83
+ const output = executeAppleScriptOrThrow(script);
84
+ const result = parseCreateEventResult(output);
85
+ if (result == null) {
86
+ throw new Error('Failed to parse create event result');
87
+ }
88
+ return result;
89
+ }
90
+ }
91
+ export function createCalendarWriter() {
92
+ return new AppleScriptCalendarWriter();
93
+ }
94
+ //# sourceMappingURL=calendar-writer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-writer.js","sourceRoot":"","sources":["../../src/applescript/calendar-writer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAqCrD,gFAAgF;AAChF,kBAAkB;AAClB,gFAAgF;AAEhF;;;;GAIG;AACH,SAAS,mBAAmB,CAAC,SAAiB;IAO5C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;IACjC,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE;QAC3B,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE,0BAA0B;QACzD,GAAG,EAAE,IAAI,CAAC,UAAU,EAAE;QACtB,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE;QACzB,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE;KAC9B,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAEhF,MAAM,OAAO,yBAAyB;IACpC,WAAW,CAAC,MAAyB;QACnC,MAAM,KAAK,GAAG,mBAAmB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACpD,MAAM,GAAG,GAAG,mBAAmB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAEhD,MAAM,YAAY,GAA8C;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