@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.
- package/LICENSE +21 -0
- package/README.md +667 -0
- package/dist/applescript/account-repository.d.ts +30 -0
- package/dist/applescript/account-repository.d.ts.map +1 -0
- package/dist/applescript/account-repository.js +38 -0
- package/dist/applescript/account-repository.js.map +1 -0
- package/dist/applescript/account-scripts.d.ts +21 -0
- package/dist/applescript/account-scripts.d.ts.map +1 -0
- package/dist/applescript/account-scripts.js +180 -0
- package/dist/applescript/account-scripts.js.map +1 -0
- package/dist/applescript/calendar-manager.d.ts +44 -0
- package/dist/applescript/calendar-manager.d.ts.map +1 -0
- package/dist/applescript/calendar-manager.js +92 -0
- package/dist/applescript/calendar-manager.js.map +1 -0
- package/dist/applescript/calendar-writer.d.ts +36 -0
- package/dist/applescript/calendar-writer.d.ts.map +1 -0
- package/dist/applescript/calendar-writer.js +94 -0
- package/dist/applescript/calendar-writer.js.map +1 -0
- package/dist/applescript/content-readers.d.ts +114 -0
- package/dist/applescript/content-readers.d.ts.map +1 -0
- package/dist/applescript/content-readers.js +328 -0
- package/dist/applescript/content-readers.js.map +1 -0
- package/dist/applescript/executor.d.ts +60 -0
- package/dist/applescript/executor.d.ts.map +1 -0
- package/dist/applescript/executor.js +173 -0
- package/dist/applescript/executor.js.map +1 -0
- package/dist/applescript/index.d.ts +20 -0
- package/dist/applescript/index.d.ts.map +1 -0
- package/dist/applescript/index.js +29 -0
- package/dist/applescript/index.js.map +1 -0
- package/dist/applescript/mail-sender.d.ts +38 -0
- package/dist/applescript/mail-sender.d.ts.map +1 -0
- package/dist/applescript/mail-sender.js +67 -0
- package/dist/applescript/mail-sender.js.map +1 -0
- package/dist/applescript/parser.d.ts +235 -0
- package/dist/applescript/parser.d.ts.map +1 -0
- package/dist/applescript/parser.js +496 -0
- package/dist/applescript/parser.js.map +1 -0
- package/dist/applescript/repository.d.ts +64 -0
- package/dist/applescript/repository.d.ts.map +1 -0
- package/dist/applescript/repository.js +444 -0
- package/dist/applescript/repository.js.map +1 -0
- package/dist/applescript/scripts.d.ts +265 -0
- package/dist/applescript/scripts.d.ts.map +1 -0
- package/dist/applescript/scripts.js +1483 -0
- package/dist/applescript/scripts.js.map +1 -0
- package/dist/approval/hash.d.ts +87 -0
- package/dist/approval/hash.d.ts.map +1 -0
- package/dist/approval/hash.js +102 -0
- package/dist/approval/hash.js.map +1 -0
- package/dist/approval/index.d.ts +13 -0
- package/dist/approval/index.d.ts.map +1 -0
- package/dist/approval/index.js +7 -0
- package/dist/approval/index.js.map +1 -0
- package/dist/approval/token-manager.d.ts +51 -0
- package/dist/approval/token-manager.d.ts.map +1 -0
- package/dist/approval/token-manager.js +111 -0
- package/dist/approval/token-manager.js.map +1 -0
- package/dist/approval/types.d.ts +44 -0
- package/dist/approval/types.d.ts.map +1 -0
- package/dist/approval/types.js +6 -0
- package/dist/approval/types.js.map +1 -0
- package/dist/cli.d.ts +30 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +143 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +27 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +42 -0
- package/dist/config.js.map +1 -0
- package/dist/database/connection.d.ts +77 -0
- package/dist/database/connection.d.ts.map +1 -0
- package/dist/database/connection.js +130 -0
- package/dist/database/connection.js.map +1 -0
- package/dist/database/index.d.ts +11 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +11 -0
- package/dist/database/index.js.map +1 -0
- package/dist/database/queries.d.ts +93 -0
- package/dist/database/queries.d.ts.map +1 -0
- package/dist/database/queries.js +430 -0
- package/dist/database/queries.js.map +1 -0
- package/dist/database/repository.d.ts +198 -0
- package/dist/database/repository.d.ts.map +1 -0
- package/dist/database/repository.js +199 -0
- package/dist/database/repository.js.map +1 -0
- package/dist/graph/attachments.d.ts +72 -0
- package/dist/graph/attachments.d.ts.map +1 -0
- package/dist/graph/attachments.js +207 -0
- package/dist/graph/attachments.js.map +1 -0
- package/dist/graph/auth/config.d.ts +34 -0
- package/dist/graph/auth/config.d.ts.map +1 -0
- package/dist/graph/auth/config.js +78 -0
- package/dist/graph/auth/config.js.map +1 -0
- package/dist/graph/auth/device-code-flow.d.ts +55 -0
- package/dist/graph/auth/device-code-flow.d.ts.map +1 -0
- package/dist/graph/auth/device-code-flow.js +180 -0
- package/dist/graph/auth/device-code-flow.js.map +1 -0
- package/dist/graph/auth/index.d.ts +13 -0
- package/dist/graph/auth/index.d.ts.map +1 -0
- package/dist/graph/auth/index.js +13 -0
- package/dist/graph/auth/index.js.map +1 -0
- package/dist/graph/auth/token-cache.d.ts +41 -0
- package/dist/graph/auth/token-cache.d.ts.map +1 -0
- package/dist/graph/auth/token-cache.js +105 -0
- package/dist/graph/auth/token-cache.js.map +1 -0
- package/dist/graph/client/batch.d.ts +38 -0
- package/dist/graph/client/batch.d.ts.map +1 -0
- package/dist/graph/client/batch.js +33 -0
- package/dist/graph/client/batch.js.map +1 -0
- package/dist/graph/client/cache.d.ts +64 -0
- package/dist/graph/client/cache.d.ts.map +1 -0
- package/dist/graph/client/cache.js +108 -0
- package/dist/graph/client/cache.js.map +1 -0
- package/dist/graph/client/graph-client.d.ts +630 -0
- package/dist/graph/client/graph-client.d.ts.map +1 -0
- package/dist/graph/client/graph-client.js +1771 -0
- package/dist/graph/client/graph-client.js.map +1 -0
- package/dist/graph/client/index.d.ts +12 -0
- package/dist/graph/client/index.d.ts.map +1 -0
- package/dist/graph/client/index.js +12 -0
- package/dist/graph/client/index.js.map +1 -0
- package/dist/graph/content-readers.d.ts +106 -0
- package/dist/graph/content-readers.d.ts.map +1 -0
- package/dist/graph/content-readers.js +321 -0
- package/dist/graph/content-readers.js.map +1 -0
- package/dist/graph/index.d.ts +18 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +23 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/mailbox-adapter.d.ts +30 -0
- package/dist/graph/mailbox-adapter.d.ts.map +1 -0
- package/dist/graph/mailbox-adapter.js +59 -0
- package/dist/graph/mailbox-adapter.js.map +1 -0
- package/dist/graph/mappers/contact-mapper.d.ts +14 -0
- package/dist/graph/mappers/contact-mapper.d.ts.map +1 -0
- package/dist/graph/mappers/contact-mapper.js +20 -0
- package/dist/graph/mappers/contact-mapper.js.map +1 -0
- package/dist/graph/mappers/email-mapper.d.ts +14 -0
- package/dist/graph/mappers/email-mapper.d.ts.map +1 -0
- package/dist/graph/mappers/email-mapper.js +44 -0
- package/dist/graph/mappers/email-mapper.js.map +1 -0
- package/dist/graph/mappers/event-mapper.d.ts +14 -0
- package/dist/graph/mappers/event-mapper.d.ts.map +1 -0
- package/dist/graph/mappers/event-mapper.js +31 -0
- package/dist/graph/mappers/event-mapper.js.map +1 -0
- package/dist/graph/mappers/folder-mapper.d.ts +22 -0
- package/dist/graph/mappers/folder-mapper.d.ts.map +1 -0
- package/dist/graph/mappers/folder-mapper.js +51 -0
- package/dist/graph/mappers/folder-mapper.js.map +1 -0
- package/dist/graph/mappers/index.d.ts +16 -0
- package/dist/graph/mappers/index.d.ts.map +1 -0
- package/dist/graph/mappers/index.js +16 -0
- package/dist/graph/mappers/index.js.map +1 -0
- package/dist/graph/mappers/task-mapper.d.ts +20 -0
- package/dist/graph/mappers/task-mapper.d.ts.map +1 -0
- package/dist/graph/mappers/task-mapper.js +27 -0
- package/dist/graph/mappers/task-mapper.js.map +1 -0
- package/dist/graph/mappers/utils.d.ts +97 -0
- package/dist/graph/mappers/utils.d.ts.map +1 -0
- package/dist/graph/mappers/utils.js +186 -0
- package/dist/graph/mappers/utils.js.map +1 -0
- package/dist/graph/repository.d.ts +1104 -0
- package/dist/graph/repository.d.ts.map +1 -0
- package/dist/graph/repository.js +2999 -0
- package/dist/graph/repository.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6052 -0
- package/dist/index.js.map +1 -0
- package/dist/parsers/html-stripper.d.ts +41 -0
- package/dist/parsers/html-stripper.d.ts.map +1 -0
- package/dist/parsers/html-stripper.js +179 -0
- package/dist/parsers/html-stripper.js.map +1 -0
- package/dist/parsers/index.d.ts +12 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/parsers/index.js +12 -0
- package/dist/parsers/index.js.map +1 -0
- package/dist/parsers/olk15.d.ts +87 -0
- package/dist/parsers/olk15.d.ts.map +1 -0
- package/dist/parsers/olk15.js +368 -0
- package/dist/parsers/olk15.js.map +1 -0
- package/dist/signature.d.ts +22 -0
- package/dist/signature.d.ts.map +1 -0
- package/dist/signature.js +89 -0
- package/dist/signature.js.map +1 -0
- package/dist/tools/calendar-permissions.d.ts +79 -0
- package/dist/tools/calendar-permissions.d.ts.map +1 -0
- package/dist/tools/calendar-permissions.js +121 -0
- package/dist/tools/calendar-permissions.js.map +1 -0
- package/dist/tools/calendar.d.ts +208 -0
- package/dist/tools/calendar.d.ts.map +1 -0
- package/dist/tools/calendar.js +247 -0
- package/dist/tools/calendar.js.map +1 -0
- package/dist/tools/categories.d.ts +94 -0
- package/dist/tools/categories.d.ts.map +1 -0
- package/dist/tools/categories.js +117 -0
- package/dist/tools/categories.js.map +1 -0
- package/dist/tools/checklist-items.d.ts +89 -0
- package/dist/tools/checklist-items.d.ts.map +1 -0
- package/dist/tools/checklist-items.js +140 -0
- package/dist/tools/checklist-items.js.map +1 -0
- package/dist/tools/contacts.d.ts +94 -0
- package/dist/tools/contacts.d.ts.map +1 -0
- package/dist/tools/contacts.js +134 -0
- package/dist/tools/contacts.js.map +1 -0
- package/dist/tools/excel.d.ts +96 -0
- package/dist/tools/excel.d.ts.map +1 -0
- package/dist/tools/excel.js +165 -0
- package/dist/tools/excel.js.map +1 -0
- package/dist/tools/focused-overrides.d.ts +70 -0
- package/dist/tools/focused-overrides.d.ts.map +1 -0
- package/dist/tools/focused-overrides.js +117 -0
- package/dist/tools/focused-overrides.js.map +1 -0
- package/dist/tools/index.d.ts +22 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +34 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/linked-resources.d.ts +74 -0
- package/dist/tools/linked-resources.d.ts.map +1 -0
- package/dist/tools/linked-resources.js +122 -0
- package/dist/tools/linked-resources.js.map +1 -0
- package/dist/tools/mail-rules.d.ts +98 -0
- package/dist/tools/mail-rules.d.ts.map +1 -0
- package/dist/tools/mail-rules.js +169 -0
- package/dist/tools/mail-rules.js.map +1 -0
- package/dist/tools/mail-send.d.ts +314 -0
- package/dist/tools/mail-send.d.ts.map +1 -0
- package/dist/tools/mail-send.js +555 -0
- package/dist/tools/mail-send.js.map +1 -0
- package/dist/tools/mail.d.ts +127 -0
- package/dist/tools/mail.d.ts.map +1 -0
- package/dist/tools/mail.js +311 -0
- package/dist/tools/mail.js.map +1 -0
- package/dist/tools/mailbox-organization.d.ts +301 -0
- package/dist/tools/mailbox-organization.d.ts.map +1 -0
- package/dist/tools/mailbox-organization.js +541 -0
- package/dist/tools/mailbox-organization.js.map +1 -0
- package/dist/tools/meetings.d.ts +114 -0
- package/dist/tools/meetings.d.ts.map +1 -0
- package/dist/tools/meetings.js +110 -0
- package/dist/tools/meetings.js.map +1 -0
- package/dist/tools/notes.d.ts +74 -0
- package/dist/tools/notes.d.ts.map +1 -0
- package/dist/tools/notes.js +136 -0
- package/dist/tools/notes.js.map +1 -0
- package/dist/tools/onedrive.d.ts +194 -0
- package/dist/tools/onedrive.d.ts.map +1 -0
- package/dist/tools/onedrive.js +257 -0
- package/dist/tools/onedrive.js.map +1 -0
- package/dist/tools/people.d.ts +129 -0
- package/dist/tools/people.d.ts.map +1 -0
- package/dist/tools/people.js +195 -0
- package/dist/tools/people.js.map +1 -0
- package/dist/tools/planner-visualization.d.ts +91 -0
- package/dist/tools/planner-visualization.d.ts.map +1 -0
- package/dist/tools/planner-visualization.js +192 -0
- package/dist/tools/planner-visualization.js.map +1 -0
- package/dist/tools/planner.d.ts +288 -0
- package/dist/tools/planner.d.ts.map +1 -0
- package/dist/tools/planner.js +368 -0
- package/dist/tools/planner.js.map +1 -0
- package/dist/tools/scheduling.d.ts +49 -0
- package/dist/tools/scheduling.d.ts.map +1 -0
- package/dist/tools/scheduling.js +115 -0
- package/dist/tools/scheduling.js.map +1 -0
- package/dist/tools/sharepoint.d.ts +115 -0
- package/dist/tools/sharepoint.d.ts.map +1 -0
- package/dist/tools/sharepoint.js +99 -0
- package/dist/tools/sharepoint.js.map +1 -0
- package/dist/tools/task-attachments.d.ts +74 -0
- package/dist/tools/task-attachments.d.ts.map +1 -0
- package/dist/tools/task-attachments.js +122 -0
- package/dist/tools/task-attachments.js.map +1 -0
- package/dist/tools/tasks.d.ts +74 -0
- package/dist/tools/tasks.d.ts.map +1 -0
- package/dist/tools/tasks.js +126 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/tools/teams.d.ts +389 -0
- package/dist/tools/teams.d.ts.map +1 -0
- package/dist/tools/teams.js +546 -0
- package/dist/tools/teams.js.map +1 -0
- package/dist/types/calendar.d.ts +60 -0
- package/dist/types/calendar.d.ts.map +1 -0
- package/dist/types/calendar.js +15 -0
- package/dist/types/calendar.js.map +1 -0
- package/dist/types/contacts.d.ts +96 -0
- package/dist/types/contacts.d.ts.map +1 -0
- package/dist/types/contacts.js +41 -0
- package/dist/types/contacts.js.map +1 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +16 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/mail.d.ts +108 -0
- package/dist/types/mail.d.ts.map +1 -0
- package/dist/types/mail.js +40 -0
- package/dist/types/mail.js.map +1 -0
- package/dist/types/notes.d.ts +26 -0
- package/dist/types/notes.d.ts.map +1 -0
- package/dist/types/notes.js +6 -0
- package/dist/types/notes.js.map +1 -0
- package/dist/types/tasks.d.ts +31 -0
- package/dist/types/tasks.d.ts.map +1 -0
- package/dist/types/tasks.js +6 -0
- package/dist/types/tasks.js.map +1 -0
- package/dist/utils/dates.d.ts +66 -0
- package/dist/utils/dates.d.ts.map +1 -0
- package/dist/utils/dates.js +94 -0
- package/dist/utils/dates.js.map +1 -0
- package/dist/utils/errors.d.ts +218 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +306 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/index.d.ts +10 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +10 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/visualization/html.d.ts +26 -0
- package/dist/visualization/html.d.ts.map +1 -0
- package/dist/visualization/html.js +306 -0
- package/dist/visualization/html.js.map +1 -0
- package/dist/visualization/markdown.d.ts +25 -0
- package/dist/visualization/markdown.d.ts.map +1 -0
- package/dist/visualization/markdown.js +186 -0
- package/dist/visualization/markdown.js.map +1 -0
- package/dist/visualization/mermaid.d.ts +25 -0
- package/dist/visualization/mermaid.d.ts.map +1 -0
- package/dist/visualization/mermaid.js +158 -0
- package/dist/visualization/mermaid.js.map +1 -0
- package/dist/visualization/svg.d.ts +25 -0
- package/dist/visualization/svg.d.ts.map +1 -0
- package/dist/visualization/svg.js +282 -0
- package/dist/visualization/svg.js.map +1 -0
- package/dist/visualization/types.d.ts +43 -0
- package/dist/visualization/types.d.ts.map +1 -0
- package/dist/visualization/types.js +34 -0
- package/dist/visualization/types.js.map +1 -0
- package/package.json +88 -0
|
@@ -0,0 +1,173 @@
|
|
|
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 execution utilities.
|
|
7
|
+
*
|
|
8
|
+
* Provides functions to execute AppleScript commands via osascript
|
|
9
|
+
* and handle errors, timeouts, and permission issues.
|
|
10
|
+
*/
|
|
11
|
+
import { execSync } from 'node:child_process';
|
|
12
|
+
// =============================================================================
|
|
13
|
+
// Constants
|
|
14
|
+
// =============================================================================
|
|
15
|
+
/**
|
|
16
|
+
* Default timeout for AppleScript execution in milliseconds.
|
|
17
|
+
*/
|
|
18
|
+
const DEFAULT_TIMEOUT_MS = 30000;
|
|
19
|
+
/**
|
|
20
|
+
* Error messages for common AppleScript failures.
|
|
21
|
+
*/
|
|
22
|
+
const ERROR_PATTERNS = {
|
|
23
|
+
notRunning: /not running|application isn't running/i,
|
|
24
|
+
permissionDenied: /not authorized|permission denied|assistive access/i,
|
|
25
|
+
timeout: /timed out|timeout/i,
|
|
26
|
+
handlerFailed: /AppleEvent handler failed/i,
|
|
27
|
+
};
|
|
28
|
+
// =============================================================================
|
|
29
|
+
// Error Detection
|
|
30
|
+
// =============================================================================
|
|
31
|
+
/**
|
|
32
|
+
* Determines the type of error from an error message.
|
|
33
|
+
*/
|
|
34
|
+
function categorizeError(errorMessage) {
|
|
35
|
+
if (ERROR_PATTERNS.notRunning.test(errorMessage)) {
|
|
36
|
+
return 'not_running';
|
|
37
|
+
}
|
|
38
|
+
if (ERROR_PATTERNS.permissionDenied.test(errorMessage)) {
|
|
39
|
+
return 'permission_denied';
|
|
40
|
+
}
|
|
41
|
+
if (ERROR_PATTERNS.timeout.test(errorMessage)) {
|
|
42
|
+
return 'timeout';
|
|
43
|
+
}
|
|
44
|
+
return 'unknown';
|
|
45
|
+
}
|
|
46
|
+
// =============================================================================
|
|
47
|
+
// Script Escaping
|
|
48
|
+
// =============================================================================
|
|
49
|
+
/**
|
|
50
|
+
* Escapes a string for safe inclusion in AppleScript.
|
|
51
|
+
* Handles quotes and backslashes.
|
|
52
|
+
*/
|
|
53
|
+
export function escapeForAppleScript(value) {
|
|
54
|
+
return value
|
|
55
|
+
.replace(/\\/g, '\\\\')
|
|
56
|
+
.replace(/"/g, '\\"');
|
|
57
|
+
}
|
|
58
|
+
// =============================================================================
|
|
59
|
+
// Execution Functions
|
|
60
|
+
// =============================================================================
|
|
61
|
+
/**
|
|
62
|
+
* Executes an AppleScript and returns the result.
|
|
63
|
+
*
|
|
64
|
+
* @param script - The AppleScript code to execute
|
|
65
|
+
* @param options - Execution options
|
|
66
|
+
* @returns The result of execution
|
|
67
|
+
*/
|
|
68
|
+
export function executeAppleScript(script, options = {}) {
|
|
69
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
70
|
+
const execOptions = {
|
|
71
|
+
encoding: 'utf8',
|
|
72
|
+
timeout: timeoutMs,
|
|
73
|
+
maxBuffer: 50 * 1024 * 1024, // 50MB for large results
|
|
74
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
75
|
+
};
|
|
76
|
+
try {
|
|
77
|
+
// Execute via osascript
|
|
78
|
+
const output = execSync(`osascript -e '${script.replace(/'/g, "'\"'\"'")}'`, execOptions);
|
|
79
|
+
return {
|
|
80
|
+
success: true,
|
|
81
|
+
output: output.trim(),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
86
|
+
const stderr = error?.stderr;
|
|
87
|
+
let stderrText = '';
|
|
88
|
+
if (stderr instanceof Buffer) {
|
|
89
|
+
stderrText = stderr.toString('utf8');
|
|
90
|
+
}
|
|
91
|
+
else if (typeof stderr === 'string') {
|
|
92
|
+
stderrText = stderr;
|
|
93
|
+
}
|
|
94
|
+
const fullError = `${errorMessage}\n${stderrText}`.trim();
|
|
95
|
+
return {
|
|
96
|
+
success: false,
|
|
97
|
+
output: '',
|
|
98
|
+
error: fullError,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Executes an AppleScript and throws on failure.
|
|
104
|
+
*
|
|
105
|
+
* @param script - The AppleScript code to execute
|
|
106
|
+
* @param options - Execution options
|
|
107
|
+
* @returns The output string
|
|
108
|
+
* @throws Error if execution fails
|
|
109
|
+
*/
|
|
110
|
+
export function executeAppleScriptOrThrow(script, options = {}) {
|
|
111
|
+
const result = executeAppleScript(script, options);
|
|
112
|
+
if (!result.success) {
|
|
113
|
+
const errorType = categorizeError(result.error ?? '');
|
|
114
|
+
throw new AppleScriptExecutionError(result.error ?? 'Unknown error', errorType);
|
|
115
|
+
}
|
|
116
|
+
return result.output;
|
|
117
|
+
}
|
|
118
|
+
// =============================================================================
|
|
119
|
+
// Outlook-Specific Functions
|
|
120
|
+
// =============================================================================
|
|
121
|
+
/**
|
|
122
|
+
* Checks if Microsoft Outlook is currently running.
|
|
123
|
+
*/
|
|
124
|
+
export function isOutlookRunning() {
|
|
125
|
+
const script = `
|
|
126
|
+
tell application "System Events"
|
|
127
|
+
set isRunning to (name of processes) contains "Microsoft Outlook"
|
|
128
|
+
return isRunning
|
|
129
|
+
end tell
|
|
130
|
+
`;
|
|
131
|
+
const result = executeAppleScript(script);
|
|
132
|
+
return result.success && result.output.toLowerCase() === 'true';
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Launches Microsoft Outlook if not already running.
|
|
136
|
+
*/
|
|
137
|
+
export function launchOutlook() {
|
|
138
|
+
const script = `
|
|
139
|
+
tell application "Microsoft Outlook"
|
|
140
|
+
launch
|
|
141
|
+
end tell
|
|
142
|
+
return "launched"
|
|
143
|
+
`;
|
|
144
|
+
const result = executeAppleScript(script, { timeoutMs: 10000 });
|
|
145
|
+
return result.success;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Gets the version of Microsoft Outlook.
|
|
149
|
+
*/
|
|
150
|
+
export function getOutlookVersion() {
|
|
151
|
+
const script = `
|
|
152
|
+
tell application "Microsoft Outlook"
|
|
153
|
+
return version
|
|
154
|
+
end tell
|
|
155
|
+
`;
|
|
156
|
+
const result = executeAppleScript(script);
|
|
157
|
+
return result.success ? result.output : null;
|
|
158
|
+
}
|
|
159
|
+
// =============================================================================
|
|
160
|
+
// Error Classes
|
|
161
|
+
// =============================================================================
|
|
162
|
+
/**
|
|
163
|
+
* Error thrown when AppleScript execution fails.
|
|
164
|
+
*/
|
|
165
|
+
export class AppleScriptExecutionError extends Error {
|
|
166
|
+
errorType;
|
|
167
|
+
constructor(message, errorType) {
|
|
168
|
+
super(message);
|
|
169
|
+
this.name = 'AppleScriptExecutionError';
|
|
170
|
+
this.errorType = errorType;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../src/applescript/executor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAA0C,MAAM,oBAAoB,CAAC;AAEtF,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF;;GAEG;AACH,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAEjC;;GAEG;AACH,MAAM,cAAc,GAAG;IACrB,UAAU,EAAE,wCAAwC;IACpD,gBAAgB,EAAE,oDAAoD;IACtE,OAAO,EAAE,oBAAoB;IAC7B,aAAa,EAAE,4BAA4B;CACnC,CAAC;AAsBX,gFAAgF;AAChF,kBAAkB;AAClB,gFAAgF;AAEhF;;GAEG;AACH,SAAS,eAAe,CAAC,YAAoB;IAC3C,IAAI,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QACjD,OAAO,aAAa,CAAC;IACvB,CAAC;IACD,IAAI,cAAc,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QACvD,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IACD,IAAI,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QAC9C,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,gFAAgF;AAChF,kBAAkB;AAClB,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAa;IAChD,OAAO,KAAK;S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MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/C,CAAC;AAED,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IACzC,SAAS,CAA8D;IAEhF,YAAY,OAAe,EAAE,SAAsE;QACjG,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;QACxC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 module for Outlook integration.
|
|
7
|
+
*
|
|
8
|
+
* Provides AppleScript-based access to Microsoft Outlook for Mac,
|
|
9
|
+
* enabling support for both classic and new Outlook versions.
|
|
10
|
+
*/
|
|
11
|
+
export { executeAppleScript, executeAppleScriptOrThrow, escapeForAppleScript, isOutlookRunning, launchOutlook, getOutlookVersion, AppleScriptExecutionError, type AppleScriptResult, type ExecuteOptions, } from './executor.js';
|
|
12
|
+
export { DELIMITERS } from './scripts.js';
|
|
13
|
+
export { parseFolders, parseEmails, parseEmail, parseCalendars, parseEvents, parseEvent, parseContacts, parseContact, parseTasks, parseTask, parseNotes, parseNote, parseCount, parseAccounts, parseDefaultAccountId, parseFoldersWithAccount, parseRespondToEventResult, parseDeleteEventResult, parseUpdateEventResult, parseSendEmailResult, parseAttachments, parseSaveAttachmentResult, type AppleScriptFolderRow, type AppleScriptEmailRow, type AppleScriptCalendarRow, type AppleScriptEventRow, type AppleScriptContactRow, type AppleScriptTaskRow, type AppleScriptNoteRow, type AppleScriptAccountRow, type AppleScriptFolderWithAccountRow, type AppleScriptAttachmentRow, type RespondToEventResult, type DeleteEventResult, type UpdateEventResult, type SendEmailResult, type SaveAttachmentResult, } from './parser.js';
|
|
14
|
+
export { AppleScriptRepository, createAppleScriptRepository, } from './repository.js';
|
|
15
|
+
export { AccountRepository, createAccountRepository, type IAccountRepository, } from './account-repository.js';
|
|
16
|
+
export { AppleScriptCalendarWriter, createCalendarWriter, type ICalendarWriter, type CreateEventParams as CalendarWriterCreateEventParams, type CreatedEvent, type RecurrenceConfig, } from './calendar-writer.js';
|
|
17
|
+
export { AppleScriptCalendarManager, createCalendarManager, type ICalendarManager, type ResponseType, type ApplyToScope, type EventUpdates, type UpdatedEvent, } from './calendar-manager.js';
|
|
18
|
+
export { AppleScriptEmailContentReader, AppleScriptEventContentReader, AppleScriptContactContentReader, AppleScriptTaskContentReader, AppleScriptNoteContentReader, AppleScriptAttachmentReader, createAppleScriptContentReaders, createEmailPath, createEventPath, createContactPath, createTaskPath, createNotePath, EMAIL_PATH_PREFIX, EVENT_PATH_PREFIX, CONTACT_PATH_PREFIX, TASK_PATH_PREFIX, NOTE_PATH_PREFIX, type AppleScriptContentReaders, type IAttachmentReader, } from './content-readers.js';
|
|
19
|
+
export { AppleScriptMailSender, createMailSender, type IMailSender, type SendEmailParams as MailSenderSendEmailParams, type SentEmail, type Attachment, type InlineImage, } from './mail-sender.js';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/applescript/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAGH,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACpB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EACL,YAA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B,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,GACvB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,WAAW,EAChB,KAAK,eAAe,IAAI,yBAAyB,EACjD,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 module for Outlook integration.
|
|
7
|
+
*
|
|
8
|
+
* Provides AppleScript-based access to Microsoft Outlook for Mac,
|
|
9
|
+
* enabling support for both classic and new Outlook versions.
|
|
10
|
+
*/
|
|
11
|
+
// Executor
|
|
12
|
+
export { executeAppleScript, executeAppleScriptOrThrow, escapeForAppleScript, isOutlookRunning, launchOutlook, getOutlookVersion, AppleScriptExecutionError, } from './executor.js';
|
|
13
|
+
// Scripts
|
|
14
|
+
export { DELIMITERS } from './scripts.js';
|
|
15
|
+
// Parser
|
|
16
|
+
export { parseFolders, parseEmails, parseEmail, parseCalendars, parseEvents, parseEvent, parseContacts, parseContact, parseTasks, parseTask, parseNotes, parseNote, parseCount, parseAccounts, parseDefaultAccountId, parseFoldersWithAccount, parseRespondToEventResult, parseDeleteEventResult, parseUpdateEventResult, parseSendEmailResult, parseAttachments, parseSaveAttachmentResult, } from './parser.js';
|
|
17
|
+
// Repository
|
|
18
|
+
export { AppleScriptRepository, createAppleScriptRepository, } from './repository.js';
|
|
19
|
+
// Account Repository
|
|
20
|
+
export { AccountRepository, createAccountRepository, } from './account-repository.js';
|
|
21
|
+
// Calendar Writer
|
|
22
|
+
export { AppleScriptCalendarWriter, createCalendarWriter, } from './calendar-writer.js';
|
|
23
|
+
// Calendar Manager
|
|
24
|
+
export { AppleScriptCalendarManager, createCalendarManager, } from './calendar-manager.js';
|
|
25
|
+
// Content Readers
|
|
26
|
+
export { AppleScriptEmailContentReader, AppleScriptEventContentReader, AppleScriptContactContentReader, AppleScriptTaskContentReader, AppleScriptNoteContentReader, AppleScriptAttachmentReader, createAppleScriptContentReaders, createEmailPath, createEventPath, createContactPath, createTaskPath, createNotePath, EMAIL_PATH_PREFIX, EVENT_PATH_PREFIX, CONTACT_PATH_PREFIX, TASK_PATH_PREFIX, NOTE_PATH_PREFIX, } from './content-readers.js';
|
|
27
|
+
// Mail Sender
|
|
28
|
+
export { AppleScriptMailSender, createMailSender, } from './mail-sender.js';
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/applescript/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,WAAW;AACX,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,yBAAyB,GAG1B,MAAM,eAAe,CAAC;AAEvB,UAAU;AACV,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,SAAS;AACT,OAAO,EACL,YAAY,EACZ,WAAW,EACX,UAAU,EACV,cAAc,EACd,WAAW,EACX,UAAU,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,SAAS,EACT,UAAU,EACV,SAAS,EACT,UAAU,EACV,aAAa,EACb,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EAChB,yBAAyB,GAgB1B,MAAM,aAAa,CAAC;AAErB,aAAa;AACb,OAAO,EACL,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,iBAAiB,CAAC;AAEzB,qBAAqB;AACrB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,GAExB,MAAM,yBAAyB,CAAC;AAEjC,kBAAkB;AAClB,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GAKrB,MAAM,sBAAsB,CAAC;AAE9B,mBAAmB;AACnB,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,GAMtB,MAAM,uBAAuB,CAAC;AAE/B,kBAAkB;AAClB,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,+BAA+B,EAC/B,4BAA4B,EAC5B,4BAA4B,EAC5B,2BAA2B,EAC3B,+BAA+B,EAC/B,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GAGjB,MAAM,sBAAsB,CAAC;AAE9B,cAAc;AACd,OAAO,EACL,qBAAqB,EACrB,gBAAgB,GAMjB,MAAM,kBAAkB,CAAC"}
|
|
@@ -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
|
+
export interface Attachment {
|
|
6
|
+
readonly path: string;
|
|
7
|
+
readonly name?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface InlineImage {
|
|
10
|
+
/** Absolute file path to the image. */
|
|
11
|
+
readonly path: string;
|
|
12
|
+
/** Content ID for referencing in HTML body (without "cid:" prefix). */
|
|
13
|
+
readonly contentId: string;
|
|
14
|
+
}
|
|
15
|
+
export interface SendEmailParams {
|
|
16
|
+
readonly to: readonly string[];
|
|
17
|
+
readonly subject: string;
|
|
18
|
+
readonly body: string;
|
|
19
|
+
readonly bodyType: 'plain' | 'html';
|
|
20
|
+
readonly cc?: readonly string[];
|
|
21
|
+
readonly bcc?: readonly string[];
|
|
22
|
+
readonly replyTo?: string;
|
|
23
|
+
readonly attachments?: readonly Attachment[];
|
|
24
|
+
readonly inlineImages?: readonly InlineImage[];
|
|
25
|
+
readonly accountId?: number;
|
|
26
|
+
}
|
|
27
|
+
export interface SentEmail {
|
|
28
|
+
readonly messageId: string;
|
|
29
|
+
readonly sentAt: string;
|
|
30
|
+
}
|
|
31
|
+
export interface IMailSender {
|
|
32
|
+
sendEmail(params: SendEmailParams): SentEmail;
|
|
33
|
+
}
|
|
34
|
+
export declare class AppleScriptMailSender implements IMailSender {
|
|
35
|
+
sendEmail(params: SendEmailParams): SentEmail;
|
|
36
|
+
}
|
|
37
|
+
export declare function createMailSender(): IMailSender;
|
|
38
|
+
//# sourceMappingURL=mail-sender.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mail-sender.d.ts","sourceRoot":"","sources":["../../src/applescript/mail-sender.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B,uCAAuC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAC7C,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS,CAAC;CAC/C;AAED,qBAAa,qBAAsB,YAAW,WAAW;IACvD,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS;CAmD9C;AAED,wBAAgB,gBAAgB,IAAI,WAAW,CAE9C"}
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
* Mail sender interface for sending emails via AppleScript.
|
|
7
|
+
*/
|
|
8
|
+
import { existsSync } from 'fs';
|
|
9
|
+
import { executeAppleScriptOrThrow } from './executor.js';
|
|
10
|
+
import * as scripts from './scripts.js';
|
|
11
|
+
import { parseSendEmailResult } from './parser.js';
|
|
12
|
+
import { AppleScriptError, AttachmentNotFoundError, MailSendError } from '../utils/errors.js';
|
|
13
|
+
export class AppleScriptMailSender {
|
|
14
|
+
sendEmail(params) {
|
|
15
|
+
// Validate attachments exist
|
|
16
|
+
if (params.attachments != null) {
|
|
17
|
+
for (const attachment of params.attachments) {
|
|
18
|
+
if (!existsSync(attachment.path)) {
|
|
19
|
+
throw new AttachmentNotFoundError(attachment.path);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
// Validate inline images exist
|
|
24
|
+
if (params.inlineImages != null) {
|
|
25
|
+
for (const image of params.inlineImages) {
|
|
26
|
+
if (!existsSync(image.path)) {
|
|
27
|
+
throw new AttachmentNotFoundError(image.path);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
let scriptParams = {
|
|
32
|
+
to: params.to,
|
|
33
|
+
subject: params.subject,
|
|
34
|
+
body: params.body,
|
|
35
|
+
bodyType: params.bodyType,
|
|
36
|
+
};
|
|
37
|
+
if (params.cc != null)
|
|
38
|
+
scriptParams = { ...scriptParams, cc: params.cc };
|
|
39
|
+
if (params.bcc != null)
|
|
40
|
+
scriptParams = { ...scriptParams, bcc: params.bcc };
|
|
41
|
+
if (params.replyTo != null)
|
|
42
|
+
scriptParams = { ...scriptParams, replyTo: params.replyTo };
|
|
43
|
+
if (params.attachments != null)
|
|
44
|
+
scriptParams = { ...scriptParams, attachments: params.attachments };
|
|
45
|
+
if (params.inlineImages != null)
|
|
46
|
+
scriptParams = { ...scriptParams, inlineImages: params.inlineImages };
|
|
47
|
+
if (params.accountId != null)
|
|
48
|
+
scriptParams = { ...scriptParams, accountId: params.accountId };
|
|
49
|
+
const script = scripts.sendEmail(scriptParams);
|
|
50
|
+
const output = executeAppleScriptOrThrow(script);
|
|
51
|
+
const result = parseSendEmailResult(output);
|
|
52
|
+
if (result == null) {
|
|
53
|
+
throw new AppleScriptError('Failed to parse send email response');
|
|
54
|
+
}
|
|
55
|
+
if (!result.success) {
|
|
56
|
+
throw new MailSendError(result.error ?? 'Unknown error');
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
messageId: result.messageId,
|
|
60
|
+
sentAt: result.sentAt,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export function createMailSender() {
|
|
65
|
+
return new AppleScriptMailSender();
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=mail-sender.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mail-sender.js","source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AAC;CACF;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,IAAI,qBAAqB,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,235 @@
|
|
|
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 AppleScriptFolderRow {
|
|
6
|
+
readonly id: number;
|
|
7
|
+
readonly name: string | null;
|
|
8
|
+
readonly unreadCount: number;
|
|
9
|
+
}
|
|
10
|
+
export interface AppleScriptAttachmentRow {
|
|
11
|
+
readonly index: number;
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly fileSize: number;
|
|
14
|
+
readonly contentType: string;
|
|
15
|
+
}
|
|
16
|
+
export interface AppleScriptEmailRow {
|
|
17
|
+
readonly id: number;
|
|
18
|
+
readonly folderId: number | null;
|
|
19
|
+
readonly subject: string | null;
|
|
20
|
+
readonly senderName: string | null;
|
|
21
|
+
readonly senderEmail: string | null;
|
|
22
|
+
readonly toRecipients: string | null;
|
|
23
|
+
readonly ccRecipients: string | null;
|
|
24
|
+
readonly preview: string | null;
|
|
25
|
+
readonly isRead: boolean;
|
|
26
|
+
readonly dateReceived: string | null;
|
|
27
|
+
readonly dateSent: string | null;
|
|
28
|
+
readonly priority: string;
|
|
29
|
+
readonly htmlContent: string | null;
|
|
30
|
+
readonly plainContent: string | null;
|
|
31
|
+
readonly hasHtml: boolean;
|
|
32
|
+
readonly attachments: string[];
|
|
33
|
+
readonly attachmentDetails: AppleScriptAttachmentRow[];
|
|
34
|
+
}
|
|
35
|
+
export interface AppleScriptCalendarRow {
|
|
36
|
+
readonly id: number;
|
|
37
|
+
readonly name: string | null;
|
|
38
|
+
}
|
|
39
|
+
export interface AppleScriptEventRow {
|
|
40
|
+
readonly id: number;
|
|
41
|
+
readonly calendarId: number | null;
|
|
42
|
+
readonly subject: string | null;
|
|
43
|
+
readonly startTime: string | null;
|
|
44
|
+
readonly endTime: string | null;
|
|
45
|
+
readonly location: string | null;
|
|
46
|
+
readonly isAllDay: boolean;
|
|
47
|
+
readonly isRecurring: boolean;
|
|
48
|
+
readonly organizer: string | null;
|
|
49
|
+
readonly htmlContent: string | null;
|
|
50
|
+
readonly plainContent: string | null;
|
|
51
|
+
readonly attendees: Array<{
|
|
52
|
+
email: string;
|
|
53
|
+
name: string;
|
|
54
|
+
}>;
|
|
55
|
+
}
|
|
56
|
+
export interface AppleScriptContactRow {
|
|
57
|
+
readonly id: number;
|
|
58
|
+
readonly displayName: string | null;
|
|
59
|
+
readonly firstName: string | null;
|
|
60
|
+
readonly lastName: string | null;
|
|
61
|
+
readonly middleName: string | null;
|
|
62
|
+
readonly nickname: string | null;
|
|
63
|
+
readonly company: string | null;
|
|
64
|
+
readonly jobTitle: string | null;
|
|
65
|
+
readonly department: string | null;
|
|
66
|
+
readonly notes: string | null;
|
|
67
|
+
readonly emails: string[];
|
|
68
|
+
readonly homePhone: string | null;
|
|
69
|
+
readonly workPhone: string | null;
|
|
70
|
+
readonly mobilePhone: string | null;
|
|
71
|
+
readonly homeStreet: string | null;
|
|
72
|
+
readonly homeCity: string | null;
|
|
73
|
+
readonly homeState: string | null;
|
|
74
|
+
readonly homeZip: string | null;
|
|
75
|
+
readonly homeCountry: string | null;
|
|
76
|
+
}
|
|
77
|
+
export interface AppleScriptTaskRow {
|
|
78
|
+
readonly id: number;
|
|
79
|
+
readonly folderId: number | null;
|
|
80
|
+
readonly name: string | null;
|
|
81
|
+
readonly isCompleted: boolean;
|
|
82
|
+
readonly dueDate: string | null;
|
|
83
|
+
readonly startDate: string | null;
|
|
84
|
+
readonly completedDate: string | null;
|
|
85
|
+
readonly priority: string;
|
|
86
|
+
readonly htmlContent: string | null;
|
|
87
|
+
readonly plainContent: string | null;
|
|
88
|
+
}
|
|
89
|
+
export interface AppleScriptNoteRow {
|
|
90
|
+
readonly id: number;
|
|
91
|
+
readonly folderId: number | null;
|
|
92
|
+
readonly name: string | null;
|
|
93
|
+
readonly createdDate: string | null;
|
|
94
|
+
readonly modifiedDate: string | null;
|
|
95
|
+
readonly preview: string | null;
|
|
96
|
+
readonly htmlContent: string | null;
|
|
97
|
+
readonly plainContent: string | null;
|
|
98
|
+
}
|
|
99
|
+
export interface RespondToEventResult {
|
|
100
|
+
readonly success: boolean;
|
|
101
|
+
readonly eventId?: number;
|
|
102
|
+
readonly error?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface DeleteEventResult {
|
|
105
|
+
readonly success: boolean;
|
|
106
|
+
readonly eventId?: number;
|
|
107
|
+
readonly error?: string;
|
|
108
|
+
}
|
|
109
|
+
export interface SaveAttachmentResult {
|
|
110
|
+
readonly success: boolean;
|
|
111
|
+
readonly name?: string;
|
|
112
|
+
readonly savedTo?: string;
|
|
113
|
+
readonly fileSize?: number;
|
|
114
|
+
readonly error?: string;
|
|
115
|
+
}
|
|
116
|
+
export interface AppleScriptAccountRow {
|
|
117
|
+
readonly id: number;
|
|
118
|
+
readonly name: string | null;
|
|
119
|
+
readonly email: string | null;
|
|
120
|
+
readonly type: string;
|
|
121
|
+
}
|
|
122
|
+
export interface AppleScriptFolderWithAccountRow extends AppleScriptFolderRow {
|
|
123
|
+
readonly accountId: number;
|
|
124
|
+
readonly messageCount: number;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Parses folder output from AppleScript.
|
|
128
|
+
*/
|
|
129
|
+
export declare function parseFolders(output: string): AppleScriptFolderRow[];
|
|
130
|
+
/**
|
|
131
|
+
* Parses email list output from AppleScript.
|
|
132
|
+
*/
|
|
133
|
+
export declare function parseEmails(output: string): AppleScriptEmailRow[];
|
|
134
|
+
/**
|
|
135
|
+
* Parses a single email output from AppleScript.
|
|
136
|
+
*/
|
|
137
|
+
export declare function parseEmail(output: string): AppleScriptEmailRow | null;
|
|
138
|
+
/**
|
|
139
|
+
* Parses calendar list output from AppleScript.
|
|
140
|
+
*/
|
|
141
|
+
export declare function parseCalendars(output: string): AppleScriptCalendarRow[];
|
|
142
|
+
/**
|
|
143
|
+
* Parses event list output from AppleScript.
|
|
144
|
+
*/
|
|
145
|
+
export declare function parseEvents(output: string): AppleScriptEventRow[];
|
|
146
|
+
/**
|
|
147
|
+
* Parses a single event output from AppleScript.
|
|
148
|
+
*/
|
|
149
|
+
export declare function parseEvent(output: string): AppleScriptEventRow | null;
|
|
150
|
+
/**
|
|
151
|
+
* Parses contact list output from AppleScript.
|
|
152
|
+
*/
|
|
153
|
+
export declare function parseContacts(output: string): AppleScriptContactRow[];
|
|
154
|
+
/**
|
|
155
|
+
* Parses a single contact output from AppleScript.
|
|
156
|
+
*/
|
|
157
|
+
export declare function parseContact(output: string): AppleScriptContactRow | null;
|
|
158
|
+
/**
|
|
159
|
+
* Parses task list output from AppleScript.
|
|
160
|
+
*/
|
|
161
|
+
export declare function parseTasks(output: string): AppleScriptTaskRow[];
|
|
162
|
+
/**
|
|
163
|
+
* Parses a single task output from AppleScript.
|
|
164
|
+
*/
|
|
165
|
+
export declare function parseTask(output: string): AppleScriptTaskRow | null;
|
|
166
|
+
/**
|
|
167
|
+
* Parses note list output from AppleScript.
|
|
168
|
+
*/
|
|
169
|
+
export declare function parseNotes(output: string): AppleScriptNoteRow[];
|
|
170
|
+
/**
|
|
171
|
+
* Parses a single note output from AppleScript.
|
|
172
|
+
*/
|
|
173
|
+
export declare function parseNote(output: string): AppleScriptNoteRow | null;
|
|
174
|
+
/**
|
|
175
|
+
* Parses a simple count value from AppleScript output.
|
|
176
|
+
*/
|
|
177
|
+
export declare function parseCount(output: string): number;
|
|
178
|
+
/**
|
|
179
|
+
* Parses account list output from AppleScript.
|
|
180
|
+
*/
|
|
181
|
+
export declare function parseAccounts(output: string): AppleScriptAccountRow[];
|
|
182
|
+
/**
|
|
183
|
+
* Parses default account output from AppleScript.
|
|
184
|
+
* Returns the account ID or null if not found.
|
|
185
|
+
*/
|
|
186
|
+
export declare function parseDefaultAccountId(output: string): number | null;
|
|
187
|
+
/**
|
|
188
|
+
* Parses the result of a create event AppleScript.
|
|
189
|
+
* Returns the created event's ID and calendar ID.
|
|
190
|
+
*/
|
|
191
|
+
export declare function parseCreateEventResult(output: string): {
|
|
192
|
+
id: number;
|
|
193
|
+
calendarId: number | null;
|
|
194
|
+
} | null;
|
|
195
|
+
/**
|
|
196
|
+
* Parses folders with account information from AppleScript.
|
|
197
|
+
*/
|
|
198
|
+
export declare function parseFoldersWithAccount(output: string): AppleScriptFolderWithAccountRow[];
|
|
199
|
+
/**
|
|
200
|
+
* Parses the result of a respond-to-event operation.
|
|
201
|
+
*/
|
|
202
|
+
export declare function parseRespondToEventResult(output: string): RespondToEventResult | null;
|
|
203
|
+
/**
|
|
204
|
+
* Parses the result of a delete-event operation.
|
|
205
|
+
*/
|
|
206
|
+
export declare function parseDeleteEventResult(output: string): DeleteEventResult | null;
|
|
207
|
+
export interface UpdateEventResult {
|
|
208
|
+
readonly success: boolean;
|
|
209
|
+
readonly id?: number;
|
|
210
|
+
readonly updatedFields?: readonly string[];
|
|
211
|
+
readonly error?: string;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Parses the result of an update-event operation.
|
|
215
|
+
*/
|
|
216
|
+
export declare function parseUpdateEventResult(output: string): UpdateEventResult | null;
|
|
217
|
+
export interface SendEmailResult {
|
|
218
|
+
readonly success: boolean;
|
|
219
|
+
readonly messageId?: string;
|
|
220
|
+
readonly sentAt?: string;
|
|
221
|
+
readonly error?: string;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Parses the result of a send-email operation.
|
|
225
|
+
*/
|
|
226
|
+
export declare function parseSendEmailResult(output: string): SendEmailResult | null;
|
|
227
|
+
/**
|
|
228
|
+
* Parses attachment list output from AppleScript.
|
|
229
|
+
*/
|
|
230
|
+
export declare function parseAttachments(output: string): AppleScriptAttachmentRow[];
|
|
231
|
+
/**
|
|
232
|
+
* Parses the result of a save-attachment operation.
|
|
233
|
+
*/
|
|
234
|
+
export declare function parseSaveAttachmentResult(output: string): SaveAttachmentResult | null;
|
|
235
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/applescript/parser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAwBH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAA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