@dawnlit/outlook-bridge 1.0.0 → 1.1.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/README.md +2 -1
- package/dist/OutlookService.d.ts +1 -1
- package/dist/OutlookService.js +2 -2
- package/dist/OutlookService.js.map +1 -1
- package/dist/errors.js +19 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/mac/drafts.d.ts +12 -1
- package/dist/mac/drafts.js +71 -0
- package/dist/mac/drafts.js.map +1 -1
- package/dist/mac/index.js +1 -0
- package/dist/mac/index.js.map +1 -1
- package/dist/mac/read.d.ts +4 -2
- package/dist/mac/read.js +4 -2
- package/dist/mac/read.js.map +1 -1
- package/dist/runtime.js +1 -1
- package/dist/runtime.js.map +1 -1
- package/dist/types.d.ts +26 -5
- package/dist/windows/accounts.d.ts +15 -1
- package/dist/windows/accounts.js +32 -5
- package/dist/windows/accounts.js.map +1 -1
- package/dist/windows/bounces.js +2 -1
- package/dist/windows/bounces.js.map +1 -1
- package/dist/windows/cleanup.js +2 -1
- package/dist/windows/cleanup.js.map +1 -1
- package/dist/windows/drafts.d.ts +12 -1
- package/dist/windows/drafts.js +62 -2
- package/dist/windows/drafts.js.map +1 -1
- package/dist/windows/folders.js +2 -1
- package/dist/windows/folders.js.map +1 -1
- package/dist/windows/index.d.ts +1 -1
- package/dist/windows/index.js +3 -1
- package/dist/windows/index.js.map +1 -1
- package/dist/windows/read.d.ts +18 -3
- package/dist/windows/read.js +66 -34
- package/dist/windows/read.js.map +1 -1
- package/dist/windows/scripts.d.ts +29 -6
- package/dist/windows/scripts.js +39 -11
- package/dist/windows/scripts.js.map +1 -1
- package/dist/windows/send.js +12 -1
- package/dist/windows/send.js.map +1 -1
- package/dist/windows/templates.js +4 -2
- package/dist/windows/templates.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -188,7 +188,8 @@ building block for "find the emails matching X" without knowing which subfolder
|
|
|
188
188
|
**Sending & replying** — `sendOutlookEmail`, `replyOutlookEmail` (answers the sender; pass `replyAll: true` to answer
|
|
189
189
|
every recipient), `sendAllDrafts`.
|
|
190
190
|
|
|
191
|
-
**Drafts** — `listOutlookDrafts`, `deleteOutlookDrafts
|
|
191
|
+
**Drafts** — `listOutlookDrafts`, `deleteOutlookDrafts`, `sendDrafts` (sends a chosen subset by
|
|
192
|
+
EntryID — the review-and-select alternative to `sendAllDrafts`'s account-wide sweep).
|
|
192
193
|
|
|
193
194
|
**Attachments** — `saveEmailAttachment`, `saveEmailAttachmentDetailed`, `saveEmailAttachments`
|
|
194
195
|
(the same, batched into one COM round trip for several attachments off one email). All take an optional `destDir`,
|
package/dist/OutlookService.d.ts
CHANGED
|
@@ -40,4 +40,4 @@ export interface OutlookBridgeInstance extends OutlookBridge {
|
|
|
40
40
|
* is called.
|
|
41
41
|
*/
|
|
42
42
|
export declare function createOutlookBridge(options?: BridgeOptions): OutlookBridgeInstance;
|
|
43
|
-
export declare const getOutlookAccounts: () => Promise<string[]>, sendOutlookEmail: (params: import("./types").SendEmailParams) => Promise<void>, replyOutlookEmail: (params: import("./types").ReplyEmailParams) => Promise<import("./types").ReplyEmailResult>, sendAllDrafts: (emailAccount: string) => Promise<import("./types").SendAllDraftsResult>, readInboxEmails: (emailAccount: string, daysBack?: number, limit?: number, folder?: string) => Promise<import("./types").InboxEmail[]>, searchInboxByFilter: (emailAccount: string, filter?: import("./types").InboxSearchFilter, daysBack?: number) => Promise<import("./types").InboxSearchMatch[]>, readSelectedEmail: () => Promise<import("./types").SelectedEmail>, readEmailBody: (entryId: string, storeId?: string, maxChars?: number, includeQuoted?: boolean) => Promise<import("./types").EmailBodyResult>, openOutlookEmail: (entryId: string) => Promise<void>, listInboxFolders: (emailAccount: string, maxDepth?: number) => Promise<import("./types").InboxFolderInfo[]>, moveOutlookEmails: (emailAccount: string, entryIds: string[], folderName: string, createIfMissing?: boolean) => Promise<import("./types").MoveEmailsResult>, listOutlookDrafts: (emailAccount: string, limit?: number, previewChars?: number) => Promise<import("./types").ListDraftsResult>, deleteOutlookDrafts: (emailAccount: string, entryIds: string[]) => Promise<import("./types").DeleteDraftsResult>, deleteOutlookEmails: (emailAccount: string, entryIds: string[], options?: import("./types").DeleteMailOptions) => Promise<import("./types").DeleteMailResult>, purgeDeletedItems: (emailAccount: string, olderThanDays?: number, dryRun?: boolean) => Promise<import("./types").PurgeDeletedItemsResult>, saveEmailAttachment: (entryId: string, fileName: string, storeId?: string, destDir?: string) => Promise<string>, saveEmailAttachmentDetailed: (entryId: string, fileName: string, storeId?: string, destDir?: string) => Promise<import("./types").SavedAttachment>, saveEmailAttachments: (entryId: string, fileNames: string[], storeId?: string, destDir?: string) => Promise<import("./types").SavedAttachment[]>, cleanUndeliverableEmails: (emailAccount: string, daysBack?: number, dryRun?: boolean) => Promise<import("./types").CleanUndeliverableResult>, collectBouncedRecipients: (emailAccount: string, daysBack?: number, scanDeleted?: boolean) => Promise<string[]>, readSentRecipientGroups: (emailAccount: string, daysBack?: number, limit?: number) => Promise<import("./types").SentRecipientGroup[]>, listOutlookSignatures: () => Promise<string[]>, readOutlookSignatureHtml: (name: string) => Promise<string>, readTemplateEmails: (emailAccount: string, folderName?: string, limit?: number, includeBody?: boolean, subject?: string) => Promise<import("./types").TemplateFolderResult>, saveTemplateEmail: (emailAccount: string, subject: string, htmlBody: string, folderName?: string) => Promise<import("./types").SaveTemplateResult>, editEmailTemplate: (label: string, currentHtml: string) => Promise<string>;
|
|
43
|
+
export declare const getOutlookAccounts: () => Promise<string[]>, sendOutlookEmail: (params: import("./types").SendEmailParams) => Promise<void>, replyOutlookEmail: (params: import("./types").ReplyEmailParams) => Promise<import("./types").ReplyEmailResult>, sendAllDrafts: (emailAccount: string) => Promise<import("./types").SendAllDraftsResult>, readInboxEmails: (emailAccount: string, daysBack?: number, limit?: number, folder?: string) => Promise<import("./types").InboxEmail[]>, searchInboxByFilter: (emailAccount: string, filter?: import("./types").InboxSearchFilter, daysBack?: number) => Promise<import("./types").InboxSearchMatch[]>, readSelectedEmail: () => Promise<import("./types").SelectedEmail>, readEmailBody: (entryId: string, storeId?: string, maxChars?: number, includeQuoted?: boolean) => Promise<import("./types").EmailBodyResult>, openOutlookEmail: (entryId: string, storeId?: string) => Promise<void>, listInboxFolders: (emailAccount: string, maxDepth?: number) => Promise<import("./types").InboxFolderInfo[]>, moveOutlookEmails: (emailAccount: string, entryIds: string[], folderName: string, createIfMissing?: boolean) => Promise<import("./types").MoveEmailsResult>, listOutlookDrafts: (emailAccount: string, limit?: number, previewChars?: number) => Promise<import("./types").ListDraftsResult>, deleteOutlookDrafts: (emailAccount: string, entryIds: string[]) => Promise<import("./types").DeleteDraftsResult>, sendDrafts: (emailAccount: string, entryIds: string[]) => Promise<import("./types").SendDraftsResult>, deleteOutlookEmails: (emailAccount: string, entryIds: string[], options?: import("./types").DeleteMailOptions) => Promise<import("./types").DeleteMailResult>, purgeDeletedItems: (emailAccount: string, olderThanDays?: number, dryRun?: boolean) => Promise<import("./types").PurgeDeletedItemsResult>, saveEmailAttachment: (entryId: string, fileName: string, storeId?: string, destDir?: string) => Promise<string>, saveEmailAttachmentDetailed: (entryId: string, fileName: string, storeId?: string, destDir?: string) => Promise<import("./types").SavedAttachment>, saveEmailAttachments: (entryId: string, fileNames: string[], storeId?: string, destDir?: string) => Promise<import("./types").SavedAttachment[]>, cleanUndeliverableEmails: (emailAccount: string, daysBack?: number, dryRun?: boolean) => Promise<import("./types").CleanUndeliverableResult>, collectBouncedRecipients: (emailAccount: string, daysBack?: number, scanDeleted?: boolean) => Promise<string[]>, readSentRecipientGroups: (emailAccount: string, daysBack?: number, limit?: number) => Promise<import("./types").SentRecipientGroup[]>, listOutlookSignatures: () => Promise<string[]>, readOutlookSignatureHtml: (name: string) => Promise<string>, readTemplateEmails: (emailAccount: string, folderName?: string, limit?: number, includeBody?: boolean, subject?: string) => Promise<import("./types").TemplateFolderResult>, saveTemplateEmail: (emailAccount: string, subject: string, htmlBody: string, folderName?: string) => Promise<import("./types").SaveTemplateResult>, editEmailTemplate: (label: string, currentHtml: string) => Promise<string>;
|
package/dist/OutlookService.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.editEmailTemplate = exports.saveTemplateEmail = exports.readTemplateEmails = exports.readOutlookSignatureHtml = exports.listOutlookSignatures = exports.readSentRecipientGroups = exports.collectBouncedRecipients = exports.cleanUndeliverableEmails = exports.saveEmailAttachments = exports.saveEmailAttachmentDetailed = exports.saveEmailAttachment = exports.purgeDeletedItems = exports.deleteOutlookEmails = exports.deleteOutlookDrafts = exports.listOutlookDrafts = exports.moveOutlookEmails = exports.listInboxFolders = exports.openOutlookEmail = exports.readEmailBody = exports.readSelectedEmail = exports.searchInboxByFilter = exports.readInboxEmails = exports.sendAllDrafts = exports.replyOutlookEmail = exports.sendOutlookEmail = exports.getOutlookAccounts = void 0;
|
|
36
|
+
exports.editEmailTemplate = exports.saveTemplateEmail = exports.readTemplateEmails = exports.readOutlookSignatureHtml = exports.listOutlookSignatures = exports.readSentRecipientGroups = exports.collectBouncedRecipients = exports.cleanUndeliverableEmails = exports.saveEmailAttachments = exports.saveEmailAttachmentDetailed = exports.saveEmailAttachment = exports.purgeDeletedItems = exports.deleteOutlookEmails = exports.sendDrafts = exports.deleteOutlookDrafts = exports.listOutlookDrafts = exports.moveOutlookEmails = exports.listInboxFolders = exports.openOutlookEmail = exports.readEmailBody = exports.readSelectedEmail = exports.searchInboxByFilter = exports.readInboxEmails = exports.sendAllDrafts = exports.replyOutlookEmail = exports.sendOutlookEmail = exports.getOutlookAccounts = void 0;
|
|
37
37
|
exports.capabilities = capabilities;
|
|
38
38
|
exports.supports = supports;
|
|
39
39
|
exports.createOutlookBridge = createOutlookBridge;
|
|
@@ -133,5 +133,5 @@ function build(config) {
|
|
|
133
133
|
function createOutlookBridge(options = {}) {
|
|
134
134
|
return build((0, runtime_1.mergeOptions)((0, runtime_1.getGlobalConfig)(), options));
|
|
135
135
|
}
|
|
136
|
-
exports.getOutlookAccounts = impl.getOutlookAccounts, exports.sendOutlookEmail = impl.sendOutlookEmail, exports.replyOutlookEmail = impl.replyOutlookEmail, exports.sendAllDrafts = impl.sendAllDrafts, exports.readInboxEmails = impl.readInboxEmails, exports.searchInboxByFilter = impl.searchInboxByFilter, exports.readSelectedEmail = impl.readSelectedEmail, exports.readEmailBody = impl.readEmailBody, exports.openOutlookEmail = impl.openOutlookEmail, exports.listInboxFolders = impl.listInboxFolders, exports.moveOutlookEmails = impl.moveOutlookEmails, exports.listOutlookDrafts = impl.listOutlookDrafts, exports.deleteOutlookDrafts = impl.deleteOutlookDrafts, exports.deleteOutlookEmails = impl.deleteOutlookEmails, exports.purgeDeletedItems = impl.purgeDeletedItems, exports.saveEmailAttachment = impl.saveEmailAttachment, exports.saveEmailAttachmentDetailed = impl.saveEmailAttachmentDetailed, exports.saveEmailAttachments = impl.saveEmailAttachments, exports.cleanUndeliverableEmails = impl.cleanUndeliverableEmails, exports.collectBouncedRecipients = impl.collectBouncedRecipients, exports.readSentRecipientGroups = impl.readSentRecipientGroups, exports.listOutlookSignatures = impl.listOutlookSignatures, exports.readOutlookSignatureHtml = impl.readOutlookSignatureHtml, exports.readTemplateEmails = impl.readTemplateEmails, exports.saveTemplateEmail = impl.saveTemplateEmail, exports.editEmailTemplate = impl.editEmailTemplate;
|
|
136
|
+
exports.getOutlookAccounts = impl.getOutlookAccounts, exports.sendOutlookEmail = impl.sendOutlookEmail, exports.replyOutlookEmail = impl.replyOutlookEmail, exports.sendAllDrafts = impl.sendAllDrafts, exports.readInboxEmails = impl.readInboxEmails, exports.searchInboxByFilter = impl.searchInboxByFilter, exports.readSelectedEmail = impl.readSelectedEmail, exports.readEmailBody = impl.readEmailBody, exports.openOutlookEmail = impl.openOutlookEmail, exports.listInboxFolders = impl.listInboxFolders, exports.moveOutlookEmails = impl.moveOutlookEmails, exports.listOutlookDrafts = impl.listOutlookDrafts, exports.deleteOutlookDrafts = impl.deleteOutlookDrafts, exports.sendDrafts = impl.sendDrafts, exports.deleteOutlookEmails = impl.deleteOutlookEmails, exports.purgeDeletedItems = impl.purgeDeletedItems, exports.saveEmailAttachment = impl.saveEmailAttachment, exports.saveEmailAttachmentDetailed = impl.saveEmailAttachmentDetailed, exports.saveEmailAttachments = impl.saveEmailAttachments, exports.cleanUndeliverableEmails = impl.cleanUndeliverableEmails, exports.collectBouncedRecipients = impl.collectBouncedRecipients, exports.readSentRecipientGroups = impl.readSentRecipientGroups, exports.listOutlookSignatures = impl.listOutlookSignatures, exports.readOutlookSignatureHtml = impl.readOutlookSignatureHtml, exports.readTemplateEmails = impl.readTemplateEmails, exports.saveTemplateEmail = impl.saveTemplateEmail, exports.editEmailTemplate = impl.editEmailTemplate;
|
|
137
137
|
//# sourceMappingURL=OutlookService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutlookService.js","sourceRoot":"","sources":["../src/OutlookService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,oCAEC;AAGD,4BAEC;AA6ED,kDAEC;AAtID,yEAAyE;AACzE,+EAA+E;AAC/E,8EAA8E;AAC9E,2EAA2E;AAC3E,EAAE;AACF,4EAA4E;AAC5E,0EAA0E;AAC1E,2EAA2E;AAC3E,4EAA4E;AAC5E,6EAA6E;AAC7E,WAAW;AACX,yDAA2C;AAC3C,iDAAmC;AAEnC,uCAAsE;AACtE,qCAAoD;AAGpD,8EAA8E;AAC9E,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAuB,CAAC;AAEjF;;;;;;;;GAQG;AACH,MAAM,iBAAiB,GAAG;IACtB,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,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CAAwB,GAIxB,IAAI,2BAHJ,0BAAkB,GAGlB,IAAI,qBAFJ,yBAAiB,GAEjB,IAAI,oBADJ,yBAAiB,GACjB,IAAI,mBAAC"}
|
package/dist/errors.js
CHANGED
|
@@ -15,6 +15,9 @@ exports.AbortedError = exports.TimeoutError = exports.ScriptError = exports.Inva
|
|
|
15
15
|
exports.classifyRunFailure = classifyRunFailure;
|
|
16
16
|
/** Base class for every error this package raises deliberately. */
|
|
17
17
|
class OutlookError extends Error {
|
|
18
|
+
code;
|
|
19
|
+
/** The underlying failure, when there was one. */
|
|
20
|
+
cause;
|
|
18
21
|
constructor(code, message, options) {
|
|
19
22
|
// Declared as a field rather than passed to `super`: the ES2022 `cause`
|
|
20
23
|
// constructor option isn't in this package's ES2020 target.
|
|
@@ -33,6 +36,8 @@ class OutlookError extends Error {
|
|
|
33
36
|
exports.OutlookError = OutlookError;
|
|
34
37
|
/** This OS has no Outlook automation backend. */
|
|
35
38
|
class UnsupportedPlatformError extends OutlookError {
|
|
39
|
+
/** The platform that was asked, i.e. `process.platform` at the time. */
|
|
40
|
+
platform;
|
|
36
41
|
constructor(platform, detail = 'Outlook automation is only supported on Windows and macOS.') {
|
|
37
42
|
super('UNSUPPORTED_PLATFORM', `${detail} (running on '${platform}')`);
|
|
38
43
|
this.platform = platform;
|
|
@@ -41,6 +46,9 @@ class UnsupportedPlatformError extends OutlookError {
|
|
|
41
46
|
exports.UnsupportedPlatformError = UnsupportedPlatformError;
|
|
42
47
|
/** The platform supports this, but the port isn't written yet. */
|
|
43
48
|
class NotImplementedError extends OutlookError {
|
|
49
|
+
/** The bridge function that isn't ported. */
|
|
50
|
+
operation;
|
|
51
|
+
platform;
|
|
44
52
|
constructor(operation, platform) {
|
|
45
53
|
super('NOT_IMPLEMENTED', `'${operation}' is not implemented for Outlook on ${platform} yet.`);
|
|
46
54
|
this.operation = operation;
|
|
@@ -50,6 +58,7 @@ class NotImplementedError extends OutlookError {
|
|
|
50
58
|
exports.NotImplementedError = NotImplementedError;
|
|
51
59
|
/** No configured Outlook account matches the requested address. */
|
|
52
60
|
class AccountNotFoundError extends OutlookError {
|
|
61
|
+
account;
|
|
53
62
|
constructor(account) {
|
|
54
63
|
super('ACCOUNT_NOT_FOUND', `Outlook account '${account}' not found.`);
|
|
55
64
|
this.account = account;
|
|
@@ -58,6 +67,8 @@ class AccountNotFoundError extends OutlookError {
|
|
|
58
67
|
exports.AccountNotFoundError = AccountNotFoundError;
|
|
59
68
|
/** A named folder, template, signature or item didn't resolve. */
|
|
60
69
|
class NotFoundError extends OutlookError {
|
|
70
|
+
/** What kind of thing was looked up — 'folder', 'template', 'signature', 'email'. */
|
|
71
|
+
kind;
|
|
61
72
|
constructor(kind, message) {
|
|
62
73
|
super('NOT_FOUND', message);
|
|
63
74
|
this.kind = kind;
|
|
@@ -80,6 +91,10 @@ exports.InvalidRequestError = InvalidRequestError;
|
|
|
80
91
|
* attached to the failure itself.
|
|
81
92
|
*/
|
|
82
93
|
class ScriptError extends OutlookError {
|
|
94
|
+
runner;
|
|
95
|
+
script;
|
|
96
|
+
stderr;
|
|
97
|
+
durationMs;
|
|
83
98
|
constructor(init) {
|
|
84
99
|
super('SCRIPT_FAILED', init.stderr || `${init.runner} failed with no output.`, { cause: init.cause });
|
|
85
100
|
this.runner = init.runner;
|
|
@@ -91,6 +106,9 @@ class ScriptError extends OutlookError {
|
|
|
91
106
|
exports.ScriptError = ScriptError;
|
|
92
107
|
/** The run exceeded its budget and was killed. */
|
|
93
108
|
class TimeoutError extends OutlookError {
|
|
109
|
+
runner;
|
|
110
|
+
timeoutMs;
|
|
111
|
+
script;
|
|
94
112
|
constructor(init) {
|
|
95
113
|
super('TIMEOUT', `${init.runner} run exceeded its ${init.timeoutMs}ms budget and was killed.`);
|
|
96
114
|
this.runner = init.runner;
|
|
@@ -101,6 +119,7 @@ class TimeoutError extends OutlookError {
|
|
|
101
119
|
exports.TimeoutError = TimeoutError;
|
|
102
120
|
/** The caller's AbortSignal fired. */
|
|
103
121
|
class AbortedError extends OutlookError {
|
|
122
|
+
runner;
|
|
104
123
|
constructor(runner, reason) {
|
|
105
124
|
super('ABORTED', `${runner} run was aborted by the caller.`, { cause: reason });
|
|
106
125
|
this.runner = runner;
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";AAAA,gCAAgC;AAChC,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,gFAAgF;AAChF,EAAE;AACF,iFAAiF;AACjF,8EAA8E;AAC9E,uCAAuC;;;AA4KvC,gDAsBC;AAvKD,mEAAmE;AACnE,MAAa,YAAa,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";AAAA,gCAAgC;AAChC,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,gFAAgF;AAChF,EAAE;AACF,iFAAiF;AACjF,8EAA8E;AAC9E,uCAAuC;;;AA4KvC,gDAsBC;AAvKD,mEAAmE;AACnE,MAAa,YAAa,SAAQ,KAAK;IAC1B,IAAI,CAAmB;IAEhC,kDAAkD;IACzC,KAAK,CAAW;IAEzB,YAAY,IAAsB,EAAE,OAAe,EAAE,OAA6B;QAC9E,wEAAwE;QACxE,4DAA4D;QAC5D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,OAAO,IAAI,OAAO,IAAI,OAAO;YAAE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC9D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,yEAAyE;QACzE,0CAA0C;QAC1C,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;QAC5B,wEAAwE;QACxE,gEAAgE;QAChE,MAAM,CAAC,cAA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AAC;QAChF,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;CACJ;AAPD,oCAOC;AAED;;;;;;;GAOG;AACH,MAAM,oBAAoB,GAAG,8BAA8B,CAAC;AAE5D;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAAC,IAUlC;IACG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAElF,IAAI,MAAM,EAAE,OAAO,IAAI,SAAS,EAAE,IAAI,KAAK,YAAY,IAAI,SAAS,EAAE,IAAI,KAAK,WAAW,EAAE,CAAC;QACzF,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;IACD,IAAI,SAAS,EAAE,MAAM,IAAI,SAAS,EAAE,CAAC;QACjC,OAAO,IAAI,YAAY,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;IAC3D,CAAC;IACD,MAAM,KAAK,GAAG,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChD,IAAI,KAAK;QAAE,OAAO,IAAI,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,OAAO,IAAI,WAAW,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,IAAI,SAAS,EAAE,CAAC,CAAC;AAClG,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { getOutlookAccounts, sendOutlookEmail, replyOutlookEmail, sendAllDrafts, readInboxEmails, searchInboxByFilter, readSelectedEmail, readEmailBody, openOutlookEmail, listInboxFolders, moveOutlookEmails, listOutlookDrafts, deleteOutlookDrafts, deleteOutlookEmails, purgeDeletedItems, saveEmailAttachment, saveEmailAttachmentDetailed, saveEmailAttachments, cleanUndeliverableEmails, collectBouncedRecipients, readSentRecipientGroups, listOutlookSignatures, readOutlookSignatureHtml, readTemplateEmails, saveTemplateEmail, editEmailTemplate, } from './OutlookService';
|
|
1
|
+
export { getOutlookAccounts, sendOutlookEmail, replyOutlookEmail, sendAllDrafts, readInboxEmails, searchInboxByFilter, readSelectedEmail, readEmailBody, openOutlookEmail, listInboxFolders, moveOutlookEmails, listOutlookDrafts, deleteOutlookDrafts, sendDrafts, deleteOutlookEmails, purgeDeletedItems, saveEmailAttachment, saveEmailAttachmentDetailed, saveEmailAttachments, cleanUndeliverableEmails, collectBouncedRecipients, readSentRecipientGroups, listOutlookSignatures, readOutlookSignatureHtml, readTemplateEmails, saveTemplateEmail, editEmailTemplate, } from './OutlookService';
|
|
2
2
|
export { createOutlookBridge, capabilities, supports } from './OutlookService';
|
|
3
3
|
export type { OutlookBridgeInstance } from './OutlookService';
|
|
4
4
|
export { configure, getConfig } from './runtime';
|
|
@@ -6,6 +6,6 @@ export type { BridgeOptions, BridgeDebugEvent, ResolvedConfig } from './runtime'
|
|
|
6
6
|
export { OutlookError, UnsupportedPlatformError, NotImplementedError, AccountNotFoundError, NotFoundError, InvalidRequestError, ScriptError, TimeoutError, AbortedError, } from './errors';
|
|
7
7
|
export type { OutlookErrorCode } from './errors';
|
|
8
8
|
export { mailFolderRef, splitQuotedOriginal, WELL_KNOWN_FOLDERS } from './mail';
|
|
9
|
-
export type { OutlookBridge, BridgeCapability, CapabilityMap, SendEmailParams, ReplyEmailParams, ReplyEmailResult, DraftSendFailure, SendAllDraftsResult, OutlookDraft, ListDraftsResult, DeleteDraftsResult, DeleteMailOptions, DeleteMailOutcome, DeleteMailResult, PurgeDeletedItemsResult, UndeliverableEmail, CleanUndeliverableResult, SentRecipientGroup, InboxEmail, InboxSearchFilter, InboxSearchMatch, SelectedEmail, EmailBodyResult, MailFolderRef, InboxFolderInfo, MoveEmailsResult, SavedAttachment, TemplateEmail, TemplateFolderResult, SaveTemplateResult, } from './types';
|
|
9
|
+
export type { OutlookBridge, BridgeCapability, CapabilityMap, SendEmailParams, ReplyEmailParams, ReplyEmailResult, DraftSendFailure, SendAllDraftsResult, OutlookDraft, ListDraftsResult, DeleteDraftsResult, SendDraftsFailure, SendDraftsResult, DeleteMailOptions, DeleteMailOutcome, DeleteMailResult, PurgeDeletedItemsResult, UndeliverableEmail, CleanUndeliverableResult, SentRecipientGroup, InboxEmail, InboxSearchFilter, InboxSearchMatch, SelectedEmail, EmailBodyResult, MailFolderRef, InboxFolderInfo, MoveEmailsResult, SavedAttachment, TemplateEmail, TemplateFolderResult, SaveTemplateResult, } from './types';
|
|
10
10
|
export { findTemplateMarkers, replaceToken, removeTokenLine, findTokens, findUnfilledTokens, composeTemplateBody, } from './outlookTemplateSections';
|
|
11
11
|
export type { TemplateMarkers, ComposeOptions } from './outlookTemplateSections';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.composeTemplateBody = exports.findUnfilledTokens = exports.findTokens = exports.removeTokenLine = exports.replaceToken = exports.findTemplateMarkers = exports.WELL_KNOWN_FOLDERS = exports.splitQuotedOriginal = exports.mailFolderRef = exports.AbortedError = exports.TimeoutError = exports.ScriptError = exports.InvalidRequestError = exports.NotFoundError = exports.AccountNotFoundError = exports.NotImplementedError = exports.UnsupportedPlatformError = exports.OutlookError = exports.getConfig = exports.configure = exports.supports = exports.capabilities = exports.createOutlookBridge = exports.editEmailTemplate = exports.saveTemplateEmail = exports.readTemplateEmails = exports.readOutlookSignatureHtml = exports.listOutlookSignatures = exports.readSentRecipientGroups = exports.collectBouncedRecipients = exports.cleanUndeliverableEmails = exports.saveEmailAttachments = exports.saveEmailAttachmentDetailed = exports.saveEmailAttachment = exports.purgeDeletedItems = exports.deleteOutlookEmails = exports.deleteOutlookDrafts = exports.listOutlookDrafts = exports.moveOutlookEmails = exports.listInboxFolders = exports.openOutlookEmail = exports.readEmailBody = exports.readSelectedEmail = exports.searchInboxByFilter = exports.readInboxEmails = exports.sendAllDrafts = exports.replyOutlookEmail = exports.sendOutlookEmail = exports.getOutlookAccounts = void 0;
|
|
3
|
+
exports.composeTemplateBody = exports.findUnfilledTokens = exports.findTokens = exports.removeTokenLine = exports.replaceToken = exports.findTemplateMarkers = exports.WELL_KNOWN_FOLDERS = exports.splitQuotedOriginal = exports.mailFolderRef = exports.AbortedError = exports.TimeoutError = exports.ScriptError = exports.InvalidRequestError = exports.NotFoundError = exports.AccountNotFoundError = exports.NotImplementedError = exports.UnsupportedPlatformError = exports.OutlookError = exports.getConfig = exports.configure = exports.supports = exports.capabilities = exports.createOutlookBridge = exports.editEmailTemplate = exports.saveTemplateEmail = exports.readTemplateEmails = exports.readOutlookSignatureHtml = exports.listOutlookSignatures = exports.readSentRecipientGroups = exports.collectBouncedRecipients = exports.cleanUndeliverableEmails = exports.saveEmailAttachments = exports.saveEmailAttachmentDetailed = exports.saveEmailAttachment = exports.purgeDeletedItems = exports.deleteOutlookEmails = exports.sendDrafts = exports.deleteOutlookDrafts = exports.listOutlookDrafts = exports.moveOutlookEmails = exports.listInboxFolders = exports.openOutlookEmail = exports.readEmailBody = exports.readSelectedEmail = exports.searchInboxByFilter = exports.readInboxEmails = exports.sendAllDrafts = exports.replyOutlookEmail = exports.sendOutlookEmail = exports.getOutlookAccounts = void 0;
|
|
4
4
|
// Public API surface. Deliberately explicit (rather than `export *`) so the
|
|
5
5
|
// package only ever exposes what it means to support; `package.json`'s `exports`
|
|
6
6
|
// map closes the deep-import path that would otherwise reach around this.
|
|
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "listInboxFolders", { enumerable: true, get: func
|
|
|
18
18
|
Object.defineProperty(exports, "moveOutlookEmails", { enumerable: true, get: function () { return OutlookService_1.moveOutlookEmails; } });
|
|
19
19
|
Object.defineProperty(exports, "listOutlookDrafts", { enumerable: true, get: function () { return OutlookService_1.listOutlookDrafts; } });
|
|
20
20
|
Object.defineProperty(exports, "deleteOutlookDrafts", { enumerable: true, get: function () { return OutlookService_1.deleteOutlookDrafts; } });
|
|
21
|
+
Object.defineProperty(exports, "sendDrafts", { enumerable: true, get: function () { return OutlookService_1.sendDrafts; } });
|
|
21
22
|
Object.defineProperty(exports, "deleteOutlookEmails", { enumerable: true, get: function () { return OutlookService_1.deleteOutlookEmails; } });
|
|
22
23
|
Object.defineProperty(exports, "purgeDeletedItems", { enumerable: true, get: function () { return OutlookService_1.purgeDeletedItems; } });
|
|
23
24
|
Object.defineProperty(exports, "saveEmailAttachment", { enumerable: true, get: function () { return OutlookService_1.saveEmailAttachment; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,4EAA4E;AAC5E,iFAAiF;AACjF,0EAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,4EAA4E;AAC5E,iFAAiF;AACjF,0EAA0E;AAC1E,mDA4B0B;AA3BtB,oHAAA,kBAAkB,OAAA;AAClB,kHAAA,gBAAgB,OAAA;AAChB,mHAAA,iBAAiB,OAAA;AACjB,+GAAA,aAAa,OAAA;AACb,iHAAA,eAAe,OAAA;AACf,qHAAA,mBAAmB,OAAA;AACnB,mHAAA,iBAAiB,OAAA;AACjB,+GAAA,aAAa,OAAA;AACb,kHAAA,gBAAgB,OAAA;AAChB,kHAAA,gBAAgB,OAAA;AAChB,mHAAA,iBAAiB,OAAA;AACjB,mHAAA,iBAAiB,OAAA;AACjB,qHAAA,mBAAmB,OAAA;AACnB,4GAAA,UAAU,OAAA;AACV,qHAAA,mBAAmB,OAAA;AACnB,mHAAA,iBAAiB,OAAA;AACjB,qHAAA,mBAAmB,OAAA;AACnB,6HAAA,2BAA2B,OAAA;AAC3B,sHAAA,oBAAoB,OAAA;AACpB,0HAAA,wBAAwB,OAAA;AACxB,0HAAA,wBAAwB,OAAA;AACxB,yHAAA,uBAAuB,OAAA;AACvB,uHAAA,qBAAqB,OAAA;AACrB,0HAAA,wBAAwB,OAAA;AACxB,oHAAA,kBAAkB,OAAA;AAClB,mHAAA,iBAAiB,OAAA;AACjB,mHAAA,iBAAiB,OAAA;AAGrB,0EAA0E;AAC1E,4EAA4E;AAC5E,qCAAqC;AACrC,mDAA+E;AAAtE,qHAAA,mBAAmB,OAAA;AAAE,8GAAA,YAAY,OAAA;AAAE,0GAAA,QAAQ,OAAA;AAGpD,2EAA2E;AAC3E,0EAA0E;AAC1E,oEAAoE;AACpE,qCAAiD;AAAxC,oGAAA,SAAS,OAAA;AAAE,oGAAA,SAAS,OAAA;AAG7B,2EAA2E;AAC3E,mCAUkB;AATd,sGAAA,YAAY,OAAA;AACZ,kHAAA,wBAAwB,OAAA;AACxB,6GAAA,mBAAmB,OAAA;AACnB,8GAAA,oBAAoB,OAAA;AACpB,uGAAA,aAAa,OAAA;AACb,6GAAA,mBAAmB,OAAA;AACnB,qGAAA,WAAW,OAAA;AACX,sGAAA,YAAY,OAAA;AACZ,sGAAA,YAAY,OAAA;AAIhB,4EAA4E;AAC5E,4DAA4D;AAC5D,+BAAgF;AAAvE,qGAAA,aAAa,OAAA;AAAE,2GAAA,mBAAmB,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAqC/D,qEAOmC;AAN/B,8HAAA,mBAAmB,OAAA;AACnB,uHAAA,YAAY,OAAA;AACZ,0HAAA,eAAe,OAAA;AACf,qHAAA,UAAU,OAAA;AACV,6HAAA,kBAAkB,OAAA;AAClB,8HAAA,mBAAmB,OAAA"}
|
package/dist/mac/drafts.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DeleteDraftsResult, ListDraftsResult, SendAllDraftsResult } from '../types';
|
|
1
|
+
import type { DeleteDraftsResult, ListDraftsResult, SendAllDraftsResult, SendDraftsResult } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* List the mail drafts belonging to `emailAccount`, newest first.
|
|
4
4
|
*
|
|
@@ -25,3 +25,14 @@ export declare function sendAllDrafts(emailAccount: string): Promise<SendAllDraf
|
|
|
25
25
|
* general-purpose "delete any email by id" tool, which is not what it is for.
|
|
26
26
|
*/
|
|
27
27
|
export declare function deleteOutlookDrafts(emailAccount: string, entryIds: string[]): Promise<DeleteDraftsResult>;
|
|
28
|
+
/**
|
|
29
|
+
* Send a chosen subset of `emailAccount`'s drafts by message id — e.g. after
|
|
30
|
+
* `listOutlookDrafts` and a user review pass — instead of `sendAllDrafts`'s
|
|
31
|
+
* account-wide sweep.
|
|
32
|
+
*
|
|
33
|
+
* Same ownership gate as `deleteOutlookDrafts`: every id must resolve to a
|
|
34
|
+
* message sitting in THIS account's Drafts folder before anything is sent. An
|
|
35
|
+
* id pointing at ordinary mail, or at another account's draft, is refused and
|
|
36
|
+
* reported rather than sent.
|
|
37
|
+
*/
|
|
38
|
+
export declare function sendDrafts(emailAccount: string, entryIds: string[]): Promise<SendDraftsResult>;
|
package/dist/mac/drafts.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.listOutlookDrafts = listOutlookDrafts;
|
|
4
4
|
exports.sendAllDrafts = sendAllDrafts;
|
|
5
5
|
exports.deleteOutlookDrafts = deleteOutlookDrafts;
|
|
6
|
+
exports.sendDrafts = sendDrafts;
|
|
6
7
|
// Drafts: which ones belong to an account, and sending, listing or deleting them.
|
|
7
8
|
//
|
|
8
9
|
// Where Windows has to scan two Drafts folders and prove each item's
|
|
@@ -211,4 +212,74 @@ end tell`;
|
|
|
211
212
|
],
|
|
212
213
|
};
|
|
213
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* Send a chosen subset of `emailAccount`'s drafts by message id — e.g. after
|
|
217
|
+
* `listOutlookDrafts` and a user review pass — instead of `sendAllDrafts`'s
|
|
218
|
+
* account-wide sweep.
|
|
219
|
+
*
|
|
220
|
+
* Same ownership gate as `deleteOutlookDrafts`: every id must resolve to a
|
|
221
|
+
* message sitting in THIS account's Drafts folder before anything is sent. An
|
|
222
|
+
* id pointing at ordinary mail, or at another account's draft, is refused and
|
|
223
|
+
* reported rather than sent.
|
|
224
|
+
*/
|
|
225
|
+
async function sendDrafts(emailAccount, entryIds) {
|
|
226
|
+
if (entryIds.length === 0)
|
|
227
|
+
return { sent: 0, failed: [] };
|
|
228
|
+
const { valid, invalid } = (0, scripts_1.partitionMessageIds)(entryIds);
|
|
229
|
+
if (valid.length === 0) {
|
|
230
|
+
return { sent: 0, failed: invalid.map(f => ({ entryId: f.entryId, subject: '', error: f.error })) };
|
|
231
|
+
}
|
|
232
|
+
const script = `tell application "Microsoft Outlook"
|
|
233
|
+
${(0, scripts_1.accountLookupSnippet)(emailAccount)}
|
|
234
|
+
set draftsFolder to drafts of targetAcct
|
|
235
|
+
set draftsName to (name of draftsFolder) as string
|
|
236
|
+
set draftIds to id of every message of draftsFolder
|
|
237
|
+
set sentCount to 0
|
|
238
|
+
set out to ""
|
|
239
|
+
repeat with theId in {${valid.join(', ')}}
|
|
240
|
+
set subj to ""
|
|
241
|
+
try
|
|
242
|
+
set theMsg to missing value
|
|
243
|
+
try
|
|
244
|
+
set theMsg to message id theId
|
|
245
|
+
end try
|
|
246
|
+
if theMsg is missing value then error "no such item in this account's Drafts folder"
|
|
247
|
+
try
|
|
248
|
+
set subj to (subject of theMsg) as string
|
|
249
|
+
end try
|
|
250
|
+
-- Prove it is in THIS account's Drafts before sending: the folder it
|
|
251
|
+
-- currently sits in, and the account it is bound to, must both match.
|
|
252
|
+
set inFolder to ""
|
|
253
|
+
try
|
|
254
|
+
set inFolder to (name of (folder of theMsg)) as string
|
|
255
|
+
end try
|
|
256
|
+
if inFolder is not draftsName then error "item is not in this account's Drafts folder - refusing to send"
|
|
257
|
+
if draftIds does not contain (id of theMsg) then error "item is not in this account's Drafts folder - refusing to send"
|
|
258
|
+
set boundTo to ""
|
|
259
|
+
try
|
|
260
|
+
set boundTo to (email address of (account of theMsg)) as string
|
|
261
|
+
end try
|
|
262
|
+
if boundTo is not "" and boundTo is not (email address of targetAcct) then
|
|
263
|
+
error "draft is not bound to this account - refusing to send"
|
|
264
|
+
end if
|
|
265
|
+
send theMsg
|
|
266
|
+
set sentCount to sentCount + 1
|
|
267
|
+
on error errText
|
|
268
|
+
set out to out & ${(0, run_1.asRow)(['(theId as string)', 'subj', 'errText'])}
|
|
269
|
+
end try
|
|
270
|
+
end repeat
|
|
271
|
+
return ${(0, run_1.asRow)(['(sentCount as string)'])} & out
|
|
272
|
+
end tell`;
|
|
273
|
+
const records = (0, run_1.splitRecords)(await (0, run_1.runOsaScript)(script, 300000));
|
|
274
|
+
return {
|
|
275
|
+
sent: (0, run_1.intField)((0, run_1.splitFields)(records[0] || ''), 0),
|
|
276
|
+
failed: [
|
|
277
|
+
...invalid.map(f => ({ entryId: f.entryId, subject: '', error: f.error })),
|
|
278
|
+
...records.slice(1).map(record => {
|
|
279
|
+
const parts = (0, run_1.splitFields)(record);
|
|
280
|
+
return { entryId: (0, run_1.field)(parts, 0), subject: (0, run_1.field)(parts, 1), error: (0, run_1.field)(parts, 2) };
|
|
281
|
+
}),
|
|
282
|
+
],
|
|
283
|
+
};
|
|
284
|
+
}
|
|
214
285
|
//# sourceMappingURL=drafts.js.map
|
package/dist/mac/drafts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drafts.js","sourceRoot":"","sources":["../../src/mac/drafts.ts"],"names":[],"mappings":";;AAsBA,8CAsFC;AASD,sCAmCC;AAYD,kDAwDC;
|
|
1
|
+
{"version":3,"file":"drafts.js","sourceRoot":"","sources":["../../src/mac/drafts.ts"],"names":[],"mappings":";;AAsBA,8CAsFC;AASD,sCAmCC;AAYD,kDAwDC;AAYD,gCA8DC;AAtSD,kFAAkF;AAClF,EAAE;AACF,qEAAqE;AACrE,gFAAgF;AAChF,2EAA2E;AAC3E,6EAA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C,CAAC;;;aAGjE,IAAA,WAAK,EAAC,CAAC,uBAAuB,CAAC,CAAC;SACpC,CAAC;IAEN,MAAM,OAAO,GAAG,IAAA,kBAAY,EAAC,MAAM,IAAA,kBAAY,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACjE,OAAO;QACH,IAAI,EAAE,IAAA,cAAQ,EAAC,IAAA,iBAAW,EAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QAChD,MAAM,EAAE;YACJ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;YAC1E,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;gBAC7B,MAAM,KAAK,GAAG,IAAA,iBAAW,EAAC,MAAM,CAAC,CAAC;gBAClC,OAAO,EAAE,OAAO,EAAE,IAAA,WAAK,EAAC,KAAK,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAA,WAAK,EAAC,KAAK,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAA,WAAK,EAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC;YAC1F,CAAC,CAAC;SACL;KACJ,CAAC;AACN,CAAC"}
|
package/dist/mac/index.js
CHANGED
|
@@ -67,6 +67,7 @@ const bridge = {
|
|
|
67
67
|
moveOutlookEmails: folders_1.moveOutlookEmails,
|
|
68
68
|
listOutlookDrafts: drafts_1.listOutlookDrafts,
|
|
69
69
|
deleteOutlookDrafts: drafts_1.deleteOutlookDrafts,
|
|
70
|
+
sendDrafts: drafts_1.sendDrafts,
|
|
70
71
|
deleteOutlookEmails: cleanup_1.deleteOutlookEmails,
|
|
71
72
|
purgeDeletedItems: cleanup_1.purgeDeletedItems,
|
|
72
73
|
saveEmailAttachment: attachments_1.saveEmailAttachment,
|
package/dist/mac/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mac/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4EAA4E;AAC5E,EAAE;AACF,sEAAsE;AACtE,kFAAkF;AAClF,gFAAgF;AAChF,2EAA2E;AAC3E,gFAAgF;AAChF,+EAA+E;AAC/E,+EAA+E;AAC/E,eAAe;AACf,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,qCAAqC;AACrC,gFAAgF;AAChF,mEAAmE;AACnE,iFAAiF;AACjF,2EAA2E;AAC3E,iEAAiE;AACjE,yCAAgD;AAChD,iCAA6D;AAC7D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mac/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4EAA4E;AAC5E,EAAE;AACF,sEAAsE;AACtE,kFAAkF;AAClF,gFAAgF;AAChF,2EAA2E;AAC3E,gFAAgF;AAChF,+EAA+E;AAC/E,+EAA+E;AAC/E,eAAe;AACf,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,qCAAqC;AACrC,gFAAgF;AAChF,mEAAmE;AACnE,iFAAiF;AACjF,2EAA2E;AAC3E,iEAAiE;AACjE,yCAAgD;AAChD,iCAA6D;AAC7D,qCAA6F;AAC7F,iCAAmH;AACnH,uCAAgE;AAChE,uCAAmE;AACnE,uCAAyG;AACzG,+CAAwG;AACxG,6CAA+E;AAC/E,2CAAuF;AACvF,yDAAuD;AAGvD;;;;;;;GAOG;AACH,MAAM,MAAM,GAAkB;IAC1B,kBAAkB,EAAlB,6BAAkB;IAClB,gBAAgB,EAAhB,uBAAgB;IAChB,iBAAiB,EAAjB,wBAAiB;IACjB,aAAa,EAAb,sBAAa;IACb,eAAe,EAAf,sBAAe;IACf,mBAAmB,EAAnB,0BAAmB;IACnB,iBAAiB,EAAjB,wBAAiB;IACjB,aAAa,EAAb,oBAAa;IACb,gBAAgB,EAAhB,uBAAgB;IAChB,gBAAgB,EAAhB,0BAAgB;IAChB,iBAAiB,EAAjB,2BAAiB;IACjB,iBAAiB,EAAjB,0BAAiB;IACjB,mBAAmB,EAAnB,4BAAmB;IACnB,UAAU,EAAV,mBAAU;IACV,mBAAmB,EAAnB,6BAAmB;IACnB,iBAAiB,EAAjB,2BAAiB;IACjB,mBAAmB,EAAnB,iCAAmB;IACnB,2BAA2B,EAA3B,yCAA2B;IAC3B,oBAAoB,EAApB,kCAAoB;IACpB,wBAAwB,EAAxB,kCAAwB;IACxB,wBAAwB,EAAxB,kCAAwB;IACxB,uBAAuB,EAAvB,iCAAuB;IACvB,qBAAqB,EAArB,kCAAqB;IACrB,wBAAwB,EAAxB,qCAAwB;IACxB,kBAAkB,EAAlB,8BAAkB;IAClB,iBAAiB,EAAjB,6BAAiB;IACjB,iBAAiB,EAAjB,6BAAiB;CACpB,CAAC;AAEO,wBAAM;AAEf,6EAA6E;AAC7E,+EAA+E;AAC/E,8EAA8E;AAC9E,oBAAoB;AACpB,6CAA2B;AAC3B,yCAAuB;AACvB,2CAAyB;AACzB,yCAAuB;AACvB,4CAA0B;AAC1B,4CAA0B;AAC1B,4CAA0B;AAC1B,gDAA8B;AAC9B,+CAA6B;AAC7B,8CAA4B;AAE5B;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,GAAgC,EAAE,CAAC;AAEtC,QAAA,YAAY,GAAkB,IAAA,4BAAa,EAAC,MAAM,EAAE,UAAU,CAAC,CAAC"}
|
package/dist/mac/read.d.ts
CHANGED
|
@@ -42,5 +42,7 @@ export declare function searchInboxByFilter(emailAccount: string, filter?: Inbox
|
|
|
42
42
|
* (an explorer selection and an open item), so there is no second lookup here.
|
|
43
43
|
*/
|
|
44
44
|
export declare function readSelectedEmail(): Promise<SelectedEmail>;
|
|
45
|
-
/** Open an email in Outlook by its message id, and bring Outlook forward.
|
|
46
|
-
|
|
45
|
+
/** Open an email in Outlook by its message id, and bring Outlook forward.
|
|
46
|
+
* `_storeId` is accepted for parity with Windows and ignored — macOS
|
|
47
|
+
* AppleScript has no StoreID (see `readEmailBody`). */
|
|
48
|
+
export declare function openOutlookEmail(entryId: string, _storeId?: string): Promise<void>;
|
package/dist/mac/read.js
CHANGED
|
@@ -392,8 +392,10 @@ end tell`;
|
|
|
392
392
|
attachmentNames: (0, run_1.splitList)((0, run_1.field)(parts, scripts_1.MessageDetail.attachmentNames)),
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
|
-
/** Open an email in Outlook by its message id, and bring Outlook forward.
|
|
396
|
-
|
|
395
|
+
/** Open an email in Outlook by its message id, and bring Outlook forward.
|
|
396
|
+
* `_storeId` is accepted for parity with Windows and ignored — macOS
|
|
397
|
+
* AppleScript has no StoreID (see `readEmailBody`). */
|
|
398
|
+
async function openOutlookEmail(entryId, _storeId) {
|
|
397
399
|
const id = (0, scripts_1.macMessageId)(entryId);
|
|
398
400
|
const script = `
|
|
399
401
|
tell application "Microsoft Outlook"
|
package/dist/mac/read.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../src/mac/read.ts"],"names":[],"mappings":";;AAoCA,0CAoHC;AAaD,sCAmCC;AAkCD,kDAyJC;AASD,8CA0BC;
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../src/mac/read.ts"],"names":[],"mappings":";;AAoCA,0CAoHC;AAaD,sCAmCC;AAkCD,kDAyJC;AASD,8CA0BC;AAKD,4CASC;AApbD,+EAA+E;AAC/E,sCAAsC;AACtC,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,qEAAqE;AACrE,8EAA8E;AAC9E,yDAAyD;AACzD,+BAAsH;AACtH,uCAYmB;AACnB,kCAA6E;AAC7E,sCAA0C;AAG1C,gFAAgF;AAChF,MAAM,aAAa,GAAG,GAAG,CAAC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GE_DEBUG;
|
|
27
27
|
/** The process-wide defaults, as mutated by `configure()`. */
|
|
28
28
|
const globalConfig = {
|
|
29
|
-
timeoutMs:
|
|
29
|
+
timeoutMs: 120_000,
|
|
30
30
|
maxBufferBytes: 8 * 1024 * 1024,
|
|
31
31
|
tempDir: os_1.default.tmpdir(),
|
|
32
32
|
debug: !!envDebug && envDebug !== '0',
|
package/dist/runtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":";;;;;AAkFA,oCAQC;AASD,8BAEC;AAGD,8BAEC;AAGD,0CAEC;AAGD,gCAEC;AAGD,8BAWC;AAOD,4BAGC;AAUD,8CAEC;AAGD,wCAIC;AA/JD,wEAAwE;AACxE,iCAAiC;AACjC,EAAE;AACF,iFAAiF;AACjF,gFAAgF;AAChF,+EAA+E;AAC/E,wEAAwE;AACxE,6CAAgD;AAChD,4CAAoB;AACpB,4CAAoB;AACpB,gDAAwB;AA+CxB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC;AAElD,8DAA8D;AAC9D,MAAM,YAAY,GAAmB;IACjC,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":";;;;;AAkFA,oCAQC;AASD,8BAEC;AAGD,8BAEC;AAGD,0CAEC;AAGD,gCAEC;AAGD,8BAWC;AAOD,4BAGC;AAUD,8CAEC;AAGD,wCAIC;AA/JD,wEAAwE;AACxE,iCAAiC;AACjC,EAAE;AACF,iFAAiF;AACjF,gFAAgF;AAChF,+EAA+E;AAC/E,wEAAwE;AACxE,6CAAgD;AAChD,4CAAoB;AACpB,4CAAoB;AACpB,gDAAwB;AA+CxB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC;AAElD,8DAA8D;AAC9D,MAAM,YAAY,GAAmB;IACjC,SA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6BAA6B,CAAC,CAAC,CAAC;AACzF,CAAC;AAED,sEAAsE;AACtE,SAAgB,cAAc,CAAC,OAAgB;IAC3C,IAAI,CAAC,OAAO;QAAE,OAAO,iBAAiB,EAAE,CAAC;IACzC,YAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3C,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -102,6 +102,17 @@ export interface DeleteDraftsResult {
|
|
|
102
102
|
error: string;
|
|
103
103
|
}[];
|
|
104
104
|
}
|
|
105
|
+
/** One draft that couldn't be sent in a selective send, identified by both id and
|
|
106
|
+
* subject — id for the caller to retry or reconcile, subject for a human report. */
|
|
107
|
+
export interface SendDraftsFailure {
|
|
108
|
+
entryId: string;
|
|
109
|
+
subject: string;
|
|
110
|
+
error: string;
|
|
111
|
+
}
|
|
112
|
+
export interface SendDraftsResult {
|
|
113
|
+
sent: number;
|
|
114
|
+
failed: SendDraftsFailure[];
|
|
115
|
+
}
|
|
105
116
|
/** What happened to one id in a deleteOutlookEmails call. */
|
|
106
117
|
export interface DeleteMailOutcome {
|
|
107
118
|
entryId: string;
|
|
@@ -180,9 +191,11 @@ export interface InboxEmail {
|
|
|
180
191
|
folderPath?: string;
|
|
181
192
|
}
|
|
182
193
|
export interface InboxSearchFilter {
|
|
183
|
-
/**
|
|
184
|
-
* server-side prefilter that keeps a
|
|
185
|
-
*
|
|
194
|
+
/** Glob-style subject pattern — `*` and `?` wildcards, e.g. '*invoice*'.
|
|
195
|
+
* Handed to Items.Restrict as the server-side prefilter that keeps a
|
|
196
|
+
* full-mailbox walk cheap, and re-checked against every subject that
|
|
197
|
+
* comes back, so it filters the result set on stores that won't run the
|
|
198
|
+
* query as well. Omit to restrict on date only. */
|
|
186
199
|
subjectLike?: string;
|
|
187
200
|
/** Regex re-checked client-side against each survivor's trimmed subject,
|
|
188
201
|
* since Restrict's `like` is a blunt substring match. A normal JS
|
|
@@ -323,11 +336,19 @@ export interface OutlookBridge {
|
|
|
323
336
|
searchInboxByFilter(emailAccount: string, filter?: InboxSearchFilter, daysBack?: number): Promise<InboxSearchMatch[]>;
|
|
324
337
|
readSelectedEmail(): Promise<SelectedEmail>;
|
|
325
338
|
readEmailBody(entryId: string, storeId?: string, maxChars?: number, includeQuoted?: boolean): Promise<EmailBodyResult>;
|
|
326
|
-
openOutlookEmail(entryId: string): Promise<void>;
|
|
339
|
+
openOutlookEmail(entryId: string, storeId?: string): Promise<void>;
|
|
327
340
|
listInboxFolders(emailAccount: string, maxDepth?: number): Promise<InboxFolderInfo[]>;
|
|
328
341
|
moveOutlookEmails(emailAccount: string, entryIds: string[], folderName: string, createIfMissing?: boolean): Promise<MoveEmailsResult>;
|
|
329
342
|
listOutlookDrafts(emailAccount: string, limit?: number, previewChars?: number): Promise<ListDraftsResult>;
|
|
330
343
|
deleteOutlookDrafts(emailAccount: string, entryIds: string[]): Promise<DeleteDraftsResult>;
|
|
344
|
+
/**
|
|
345
|
+
* Send a chosen subset of an account's drafts by EntryID — e.g. after
|
|
346
|
+
* `listOutlookDrafts` and a user review pass — rather than the account-wide
|
|
347
|
+
* `sendAllDrafts`. Same "must be THIS account's draft" gate as
|
|
348
|
+
* `deleteOutlookDrafts`: an id pointing at ordinary mail, or at another
|
|
349
|
+
* account's draft, is refused and reported rather than sent.
|
|
350
|
+
*/
|
|
351
|
+
sendDrafts(emailAccount: string, entryIds: string[]): Promise<SendDraftsResult>;
|
|
331
352
|
deleteOutlookEmails(emailAccount: string, entryIds: string[], options?: DeleteMailOptions): Promise<DeleteMailResult>;
|
|
332
353
|
purgeDeletedItems(emailAccount: string, olderThanDays?: number, dryRun?: boolean): Promise<PurgeDeletedItemsResult>;
|
|
333
354
|
saveEmailAttachment(entryId: string, fileName: string, storeId?: string, destDir?: string): Promise<string>;
|
|
@@ -348,7 +369,7 @@ export type BridgeCapability = keyof OutlookBridge;
|
|
|
348
369
|
* Which operations actually work on this machine.
|
|
349
370
|
*
|
|
350
371
|
* The alternative was matching on an error message: a consumer had no way to
|
|
351
|
-
* learn a gap existed except by calling into it. A UI can now
|
|
372
|
+
* learn a gap existed except by calling into it. A UI can now gray out the
|
|
352
373
|
* buttons it can't back rather than discovering the gap when the user clicks one.
|
|
353
374
|
*
|
|
354
375
|
* Windows and macOS both answer the whole contract today, so every flag is
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Retrieve every mailbox this profile can reach, as SMTP addresses.
|
|
3
|
+
*
|
|
4
|
+
* Walks Accounts AND Stores, because they are not the same set. A mailbox
|
|
5
|
+
* opened as a secondary store — a shared mailbox, or a delegated one — has no
|
|
6
|
+
* `Account` object at all, so an Accounts-only walk reports a profile that is
|
|
7
|
+
* missing exactly the mailboxes an operator added on purpose. Worse, it reports
|
|
8
|
+
* them silently: the caller scopes a read to the one address it was given and
|
|
9
|
+
* gets somebody else's inbox back, with no error to notice.
|
|
10
|
+
*
|
|
11
|
+
* A store contributes only when its name looks like an address. Outlook names a
|
|
12
|
+
* store by its display name, which for a mailbox is its address but for a data
|
|
13
|
+
* file is whatever it was called — "Archive", "Personal Folders" — and those
|
|
14
|
+
* name no mailbox a caller could pass back in.
|
|
15
|
+
*/
|
|
2
16
|
export declare function getOutlookAccounts(): Promise<string[]>;
|
package/dist/windows/accounts.js
CHANGED
|
@@ -2,17 +2,44 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getOutlookAccounts = getOutlookAccounts;
|
|
4
4
|
const run_1 = require("./run");
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Retrieve every mailbox this profile can reach, as SMTP addresses.
|
|
7
|
+
*
|
|
8
|
+
* Walks Accounts AND Stores, because they are not the same set. A mailbox
|
|
9
|
+
* opened as a secondary store — a shared mailbox, or a delegated one — has no
|
|
10
|
+
* `Account` object at all, so an Accounts-only walk reports a profile that is
|
|
11
|
+
* missing exactly the mailboxes an operator added on purpose. Worse, it reports
|
|
12
|
+
* them silently: the caller scopes a read to the one address it was given and
|
|
13
|
+
* gets somebody else's inbox back, with no error to notice.
|
|
14
|
+
*
|
|
15
|
+
* A store contributes only when its name looks like an address. Outlook names a
|
|
16
|
+
* store by its display name, which for a mailbox is its address but for a data
|
|
17
|
+
* file is whatever it was called — "Archive", "Personal Folders" — and those
|
|
18
|
+
* name no mailbox a caller could pass back in.
|
|
19
|
+
*/
|
|
6
20
|
async function getOutlookAccounts() {
|
|
7
21
|
if (process.platform !== 'win32')
|
|
8
22
|
return [];
|
|
9
23
|
const script = `
|
|
10
24
|
$outlook = New-Object -ComObject Outlook.Application
|
|
11
|
-
$
|
|
12
|
-
|
|
13
|
-
|
|
25
|
+
$ns = $outlook.GetNamespace('mapi')
|
|
26
|
+
$ns.Logon()
|
|
27
|
+
$seen = @{}
|
|
28
|
+
$out = @()
|
|
29
|
+
foreach ($a in $ns.Accounts) {
|
|
30
|
+
if ($a.SmtpAddress) {
|
|
31
|
+
$k = $a.SmtpAddress.ToLower()
|
|
32
|
+
if (-not $seen.ContainsKey($k)) { $seen[$k] = $true; $out += $a.SmtpAddress }
|
|
33
|
+
}
|
|
14
34
|
}
|
|
15
|
-
$
|
|
35
|
+
foreach ($f in $ns.Folders) {
|
|
36
|
+
$n = $f.Name
|
|
37
|
+
if ($n -and $n -match '@') {
|
|
38
|
+
$k = $n.ToLower()
|
|
39
|
+
if (-not $seen.ContainsKey($k)) { $seen[$k] = $true; $out += $n }
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
$out -join '|'
|
|
16
43
|
`;
|
|
17
44
|
const result = await (0, run_1.runPowerShell)(script);
|
|
18
45
|
if (!result)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/windows/accounts.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/windows/accounts.ts"],"names":[],"mappings":";;AAiBA,gDA0BC;AA3CD,+BAAsC;AAEtC;;;;;;;;;;;;;;GAcG;AACI,KAAK,UAAU,kBAAkB;IACpC,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO;QAAE,OAAO,EAAE,CAAC;IAC5C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;CAoBlB,CAAC;IACE,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAa,EAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IACvB,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC7C,CAAC"}
|