@dawnlit/outlook-bridge 1.1.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/dist/OutlookService.d.ts +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/types.d.ts +7 -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.js +2 -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 +2 -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/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>, 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>;
|
|
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/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;AAE1B;;;;;;GAMG;AACI,KAAK,UAAU,eAAe,CACjC,YAAoB,EACpB,WAAmB,EAAE,EACrB,QAAgB,EAAE,EAClB,MAAe;IAEf,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3C,IAAI,GAAG,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACzB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,IAAA,oBAAa,EAAC,MAAM,CAAC,C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,KAAK,EAAE,uBAAa,CAAC,UAAU,CAAC;QAClD,WAAW,EAAE,IAAA,WAAK,EAAC,KAAK,EAAE,uBAAa,CAAC,WAAW,CAAC;QACpD,YAAY,EAAE,IAAA,WAAK,EAAC,KAAK,EAAE,uBAAa,CAAC,YAAY,CAAC;QACtD,IAAI,EAAE,IAAA,WAAK,EAAC,KAAK,EAAE,uBAAa,CAAC,IAAI,CAAC;QACtC,eAAe,EAAE,IAAA,eAAS,EAAC,IAAA,WAAK,EAAC,KAAK,EAAE,uBAAa,CAAC,eAAe,CAAC,CAAC;KAC1E,CAAC;AACN,CAAC;AAED;;wDAEwD;AACjD,KAAK,UAAU,gBAAgB,CAAC,OAAe,EAAE,QAAiB;IACrE,MAAM,EAAE,GAAG,IAAA,sBAAY,EAAC,OAAO,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG;;EAEjB,IAAA,8BAAoB,EAAC,EAAE,CAAC;;;SAGjB,CAAC;IACN,MAAM,IAAA,kBAAY,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACtC,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -191,9 +191,11 @@ export interface InboxEmail {
|
|
|
191
191
|
folderPath?: string;
|
|
192
192
|
}
|
|
193
193
|
export interface InboxSearchFilter {
|
|
194
|
-
/**
|
|
195
|
-
* server-side prefilter that keeps a
|
|
196
|
-
*
|
|
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. */
|
|
197
199
|
subjectLike?: string;
|
|
198
200
|
/** Regex re-checked client-side against each survivor's trimmed subject,
|
|
199
201
|
* since Restrict's `like` is a blunt substring match. A normal JS
|
|
@@ -334,7 +336,7 @@ export interface OutlookBridge {
|
|
|
334
336
|
searchInboxByFilter(emailAccount: string, filter?: InboxSearchFilter, daysBack?: number): Promise<InboxSearchMatch[]>;
|
|
335
337
|
readSelectedEmail(): Promise<SelectedEmail>;
|
|
336
338
|
readEmailBody(entryId: string, storeId?: string, maxChars?: number, includeQuoted?: boolean): Promise<EmailBodyResult>;
|
|
337
|
-
openOutlookEmail(entryId: string): Promise<void>;
|
|
339
|
+
openOutlookEmail(entryId: string, storeId?: string): Promise<void>;
|
|
338
340
|
listInboxFolders(emailAccount: string, maxDepth?: number): Promise<InboxFolderInfo[]>;
|
|
339
341
|
moveOutlookEmails(emailAccount: string, entryIds: string[], folderName: string, createIfMissing?: boolean): Promise<MoveEmailsResult>;
|
|
340
342
|
listOutlookDrafts(emailAccount: string, limit?: number, previewChars?: number): Promise<ListDraftsResult>;
|
|
@@ -367,7 +369,7 @@ export type BridgeCapability = keyof OutlookBridge;
|
|
|
367
369
|
* Which operations actually work on this machine.
|
|
368
370
|
*
|
|
369
371
|
* The alternative was matching on an error message: a consumer had no way to
|
|
370
|
-
* 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
|
|
371
373
|
* buttons it can't back rather than discovering the gap when the user clicks one.
|
|
372
374
|
*
|
|
373
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"}
|
package/dist/windows/bounces.js
CHANGED
|
@@ -214,7 +214,8 @@ async function readSentRecipientGroups(emailAccount, daysBack = 30, limit = 3000
|
|
|
214
214
|
const days = (0, mail_1.clamp)(daysBack, 1, 365);
|
|
215
215
|
const cap = (0, mail_1.clamp)(limit, 1, 10000);
|
|
216
216
|
const script = `${(0, scripts_1.accountScript)(emailAccount)}
|
|
217
|
-
$
|
|
217
|
+
${scripts_1.DELIVERY_STORE_PS}
|
|
218
|
+
$sent = $store.GetDefaultFolder(5) # olFolderSentMail
|
|
218
219
|
$cutoff = (Get-Date).AddDays(-${days}).ToString('MM/dd/yyyy HH:mm')
|
|
219
220
|
$items = $sent.Items.Restrict("[SentOn] >= '$cutoff'")
|
|
220
221
|
$items.Sort('[SentOn]', $true)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bounces.js","sourceRoot":"","sources":["../../src/windows/bounces.ts"],"names":[],"mappings":";;AAuFA,4DAoFC;AAWD,4DAiCC;AASD,
|
|
1
|
+
{"version":3,"file":"bounces.js","sourceRoot":"","sources":["../../src/windows/bounces.ts"],"names":[],"mappings":";;AAuFA,4DAoFC;AAWD,4DAiCC;AASD,0DA2DC;AA3RD,wEAAwE;AACxE,yBAAyB;AACzB,+BAAsE;AACtE,uCAA+E;AAC/E,yCAAoF;AACpF,uDAM+B;AAC/B,kCAAgC;AAGhC;;;;GAIG;AACH,MAAM,eAAe,GAAG;eACT,IAAA,YAAM,EAAC,oCAAsB,CAAC;kBAC3B,IAAA,YAAM,EAAC,qCAAuB,CAAC;kBAC/B,IAAA,YAAM,EAAC,iCAAmB,CAAC;CAC5C,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;2BAiBA,sCAAwB;;;;;;;;gDAQH,kCAAoB;;;;;;;;;;;CAWnE,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACI,KAAK,UAAU,wBAAwB,CAC1C,YAAoB,EACpB,QAAQ,GAAG,EAAE,EACb,MAAM,GAAG,IAAI;IAEb,IAAA,oBAAc,GAAE,CAAC;IACjB,MAAM,IAAI,GAAG,IAAA,YAAK,EAAC,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;IACrC,MAAM,MAAM,GAAG,GAAG,IAAA,uBAAa,EAAC,YAAY,CAAC;YACrC,I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AO,EAAE,CAAC;IAC5C,MAAM,IAAI,GAAG,IAAA,YAAK,EAAC,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;IACrC,MAAM,GAAG,GAAG,IAAA,YAAK,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,GAAG,IAAA,uBAAa,EAAC,YAAY,CAAC;EAC/C,2BAAiB;;gCAEa,IAAI;;;;qCAIC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCvC,CAAC;IACE,OAAO,IAAA,iBAAU,EAAC,MAAM,IAAA,mBAAa,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;QAC5D,MAAM,CAAC,GAAG,IAAA,aAAM,EAAC,EAAE,CAAC,CAAC;QACrB,OAAO;YACH,OAAO,EAAE,IAAA,UAAG,EAAC,CAAC,CAAC,OAAO,CAAC;YACvB,OAAO,EAAE,IAAA,UAAG,EAAC,CAAC,CAAC,OAAO,CAAC;YACvB,MAAM,EAAE,IAAA,UAAG,EAAC,CAAC,CAAC,MAAM,CAAC;YACrB,UAAU,EAAE,IAAA,cAAO,EAAC,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,UAAG,CAAC;SAC7C,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/windows/cleanup.js
CHANGED
|
@@ -129,7 +129,8 @@ ConvertTo-Json @{ dryRun = ${(0, run_1.psBool)(dryRun)}; deleted = $deleted; ref
|
|
|
129
129
|
async function purgeDeletedItems(emailAccount, olderThanDays = 0, dryRun = false) {
|
|
130
130
|
(0, run_1.requireWindows)();
|
|
131
131
|
const script = `${(0, scripts_1.accountScript)(emailAccount)}
|
|
132
|
-
$
|
|
132
|
+
${scripts_1.DELIVERY_STORE_PS}
|
|
133
|
+
$folder = $store.GetDefaultFolder(3)
|
|
133
134
|
$cutoff = (Get-Date).AddDays(-${olderThanDays})
|
|
134
135
|
$matched = 0
|
|
135
136
|
$purged = 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleanup.js","sourceRoot":"","sources":["../../src/windows/cleanup.ts"],"names":[],"mappings":";;AAgDA,kDA0EC;AAWD,
|
|
1
|
+
{"version":3,"file":"cleanup.js","sourceRoot":"","sources":["../../src/windows/cleanup.ts"],"names":[],"mappings":";;AAgDA,kDA0EC;AAWD,8CAwCC;AA7KD,wDAAwD;AACxD,+BAAgF;AAChF,uCAA6D;AAC7D,yCAAwE;AACxE,kCAAgD;AAGhD,mFAAmF;AACnF,MAAM,oBAAoB,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEpC,0FAA0F;AAC1F,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;CAkBvB,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACI,KAAK,UAAU,mBAAmB,CACrC,YAAoB,EACpB,QAAkB,EAClB,UAA6B,EAAE;IAE/B,IAAA,oBAAc,GAAE,CAAC;IACjB,MAAM,EAAE,cAAc,GAAG,KAAK,EAAE,MAAM,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;IAC3D,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IACpE,CAAC;IACD,MAAM,MAAM,GAAG,GAAG,IAAA,uBAAa,EAAC,YAAY,CAAC;EAC/C,2BAAiB;EACjB,eAAe;;qBAEI,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC;;;;;;;;oBAQ/B,IAAA,YAAM,EAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;;;qCAkBC,IAAA,YAAM,EAAC,cAAc,CAAC;;sIAE2E,IAAA,cAAQ,EAAC,4BAAqB,CAAC;oBACjJ,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EAAC,MAAM,CAAC;;;;CAIvB,CAAC;IACE,MAAM,MAAM,GAAG,IAAA,kBAAW,EAAC,MAAM,IAAA,mBAAa,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAChE,OAAO;QACH,UAAU,EAAE,IAAA,UAAG,EAAC,MAAM,CAAC,UAAU,CAAC;QAClC,MAAM;QACN,OAAO,EAAE,IAAA,UAAG,EAAC,MAAM,CAAC,OAAO,CAAC;QAC5B,MAAM,EAAE,IAAA,UAAG,EAAC,MAAM,CAAC,MAAM,CAAC;QAC1B,IAAI,EAAE,IAAA,UAAG,EAAC,MAAM,CAAC,IAAI,CAAC;QACtB,MAAM,EAAE,IAAA,UAAG,EAAC,MAAM,CAAC,MAAM,CAAC;KAC7B,CAAC;AACN,CAAC"}
|
package/dist/windows/drafts.js
CHANGED
|
@@ -35,7 +35,7 @@ $scan = @()
|
|
|
35
35
|
$seen = @{}
|
|
36
36
|
|
|
37
37
|
$homeDrafts = $null
|
|
38
|
-
try { $homeDrafts = $
|
|
38
|
+
try { $homeDrafts = $store.GetDefaultFolder(16) } catch {} # olFolderDrafts
|
|
39
39
|
if ($homeDrafts -ne $null) {
|
|
40
40
|
$seen["$($homeDrafts.StoreID)|$($homeDrafts.EntryID)"] = $true
|
|
41
41
|
$scan += [pscustomobject]@{ folder = $homeDrafts; includeNull = $true }
|
|
@@ -62,7 +62,7 @@ function Test-DraftMatches($item, $includeNull) {
|
|
|
62
62
|
`;
|
|
63
63
|
/** Session, account and the drafts scan rule — the prelude all three share. */
|
|
64
64
|
function draftsScript(emailAccount) {
|
|
65
|
-
return (0, scripts_1.accountScript)(emailAccount) + DRAFTS_SCAN_PS;
|
|
65
|
+
return (0, scripts_1.accountScript)(emailAccount) + scripts_1.DELIVERY_STORE_PS + DRAFTS_SCAN_PS;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
68
|
* Send the mail drafts that belong to `emailAccount`, wherever Outlook filed them.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drafts.js","sourceRoot":"","sources":["../../src/windows/drafts.ts"],"names":[],"mappings":";;AAuEA,sCA0CC;AAWD,8CAyEC;AAWD,kDAgDC;AAYD,gCAkDC;AA9TD,kFAAkF;AAClF,+BAA8D;AAC9D,
|
|
1
|
+
{"version":3,"file":"drafts.js","sourceRoot":"","sources":["../../src/windows/drafts.ts"],"names":[],"mappings":";;AAuEA,sCA0CC;AAWD,8CAyEC;AAWD,kDAgDC;AAYD,gCAkDC;AA9TD,kFAAkF;AAClF,+BAA8D;AAC9D,uCAA6D;AAC7D,yCAAiF;AAGjF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BtB,CAAC;AAEF,+EAA+E;AAC/E,SAAS,YAAY,CAAC,YAAoB;IACtC,OAAO,IAAA,uBAAa,EAAC,YAAY,CAAC,GAAG,2BAAiB,GAAG,cAAc,CAAC;AAC5E,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,aAAa,CAAC,YAAoB;IACpD,IAAA,oBAAc,GAAE,CAAC;IACjB,MAAM,MAAM,GAAG,GAAG,YAAY,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;CAwB/C,CAAC;IACE,IAAI,CAAC;QACD,MAAM,MAAM,GAAG,IAAA,kBAAW,EAAC,MAAM,IAAA,mBAAa,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QAChE,OAAO;YACH,IAAI,EAAE,IAAA,UAAG,EAAC,MAAM,CAAC,IAAI,CAAC;YACtB,MAAM,EAAE,IAAA,cAAO,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;gBACnC,MAAM,CAAC,GAAG,IAAA,aAAM,EAAC,CAAC,CAAC,CAAC;gBACpB,OAAO,EAAE,OAAO,EAAE,IAAA,UAAG,EAAC,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,E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15
15
|
const script = `${(0, scripts_1.accountScript)(emailAccount)}
|
|
16
|
-
$
|
|
16
|
+
${scripts_1.DELIVERY_STORE_PS}
|
|
17
|
+
$inbox = $store.GetDefaultFolder(6)
|
|
17
18
|
function Walk-Folders($folder, $level) {
|
|
18
19
|
foreach ($f in $folder.Folders) {
|
|
19
20
|
[PSCustomObject]@{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"folders.js","sourceRoot":"","sources":["../../src/windows/folders.ts"],"names":[],"mappings":";;AAQA,
|
|
1
|
+
{"version":3,"file":"folders.js","sourceRoot":"","sources":["../../src/windows/folders.ts"],"names":[],"mappings":";;AAQA,4CAgCC;AAcD,8CAuCC;AA7FD,gEAAgE;AAChE,+BAA8D;AAC9D,uCAA8E;AAC9E,yCAAoF;AACpF,kCAA+C;AAG/C,6EAA6E;AACtE,KAAK,UAAU,gBAAgB,CAClC,YAAoB,EACpB,QAAQ,GAAG,CAAC;IAEZ,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO;QAAE,OAAO,EAAE,CAAC;IAC5C,MAAM,KAAK,GAAG,IAAA,YAAK,EAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,MAAM,MAAM,GAAG,GAAG,IAAA,uBAAa,EAAC,YAAY,CAAC;EAC/C,2BAAiB;;;;;;;;;;yBAUM,KAAK;;;;;CAK7B,CAAC;IACE,OAAO,IAAA,iBAAU,EAAC,MAAM,IAAA,mBAAa,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QAC7D,MAAM,CAAC,GAAG,IAAA,aAAM,EAAC,IAAI,CAAC,CAAC;QACvB,OAAO;YACH,IAAI,EAAE,IAAA,UAAG,EAAC,CAAC,CAAC,IAAI,CAAC;YACjB,UAAU,EAAE,IAAA,UAAG,EAAC,CAAC,CAAC,UAAU,CAAC;YAC7B,SAAS,EAAE,IAAA,UAAG,EAAC,CAAC,CAAC,SAA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AC,OAAO,CAAC,EAAE,KAAK,EAAE,IAAA,UAAG,EAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5D,CAAC,CAAC;KACL,CAAC;AACN,CAAC"}
|
package/dist/windows/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export * from './bounces';
|
|
|
19
19
|
export * from './attachments';
|
|
20
20
|
export * from './signatures';
|
|
21
21
|
export * from './templates';
|
|
22
|
-
export { mailScopeScript } from './scripts';
|
|
22
|
+
export { accountScript, mailScopeScript } from './scripts';
|
|
23
23
|
/**
|
|
24
24
|
* Windows drives the full COM object model, so every operation is available —
|
|
25
25
|
* this is the reference the macOS map is measured against.
|
package/dist/windows/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.capabilities = exports.mailScopeScript = exports.bridge = void 0;
|
|
17
|
+
exports.capabilities = exports.mailScopeScript = exports.accountScript = exports.bridge = void 0;
|
|
18
18
|
// The Windows implementation: Outlook driven through PowerShell + COM.
|
|
19
19
|
//
|
|
20
20
|
// Split by feature rather than kept as one file — every operation here is
|
|
@@ -92,6 +92,7 @@ __exportStar(require("./templates"), exports);
|
|
|
92
92
|
// without an Outlook session — a syntax error in it would otherwise only ever
|
|
93
93
|
// surface as a failed live run.
|
|
94
94
|
var scripts_1 = require("./scripts");
|
|
95
|
+
Object.defineProperty(exports, "accountScript", { enumerable: true, get: function () { return scripts_1.accountScript; } });
|
|
95
96
|
Object.defineProperty(exports, "mailScopeScript", { enumerable: true, get: function () { return scripts_1.mailScopeScript; } });
|
|
96
97
|
/**
|
|
97
98
|
* Windows drives the full COM object model, so every operation is available —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceR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AoB,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,4EAA4E;AAC5E,8EAA8E;AAC9E,gCAAgC;AAChC,qCAA2D;AAAlD,wGAAA,aAAa,OAAA;AAAE,0GAAA,eAAe,OAAA;AAEvC;;;GAGG;AACU,QAAA,YAAY,GAAkB,IAAA,4BAAa,EAAC,MAAM,CAAC,CAAC"}
|
package/dist/windows/read.d.ts
CHANGED
|
@@ -42,7 +42,10 @@ export declare function readEmailBody(entryId: string, storeId?: string, maxChar
|
|
|
42
42
|
* daily batch run wants, since a subject filter alone walks the whole Inbox
|
|
43
43
|
* tree and returns every match ever received. 0 keeps that unbounded
|
|
44
44
|
* behavior, and is only sane paired with `filter.subjectLike` so Restrict can
|
|
45
|
-
* narrow the set server-side before anything crosses COM.
|
|
45
|
+
* narrow the set server-side before anything crosses COM. Where the store
|
|
46
|
+
* won't run that subject query — an IMAP mailbox accepts it and then matches
|
|
47
|
+
* nothing — an unbounded scan falls back to the last 60 days rather than
|
|
48
|
+
* walking every item the mailbox has ever held.
|
|
46
49
|
*/
|
|
47
50
|
export declare function searchInboxByFilter(emailAccount: string, filter?: InboxSearchFilter, daysBack?: number): Promise<InboxSearchMatch[]>;
|
|
48
51
|
/**
|
|
@@ -50,5 +53,17 @@ export declare function searchInboxByFilter(emailAccount: string, filter?: Inbox
|
|
|
50
53
|
* attachments listed by name but not saved.
|
|
51
54
|
*/
|
|
52
55
|
export declare function readSelectedEmail(): Promise<SelectedEmail>;
|
|
53
|
-
/**
|
|
54
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Open an email in Outlook by its EntryID.
|
|
58
|
+
*
|
|
59
|
+
* `storeId` disambiguates across mailboxes — without one, `GetItemFromID` only
|
|
60
|
+
* looks in the default store, so an id from a shared or secondary mailbox
|
|
61
|
+
* simply isn't found. It's tried first and the bare lookup is the fallback, so
|
|
62
|
+
* a caller holding a stale StoreID (or none) still resolves whatever it can.
|
|
63
|
+
*
|
|
64
|
+
* EntryIDs are rewritten when an item MOVES between folders, so an id recorded
|
|
65
|
+
* before its mail was filed can resolve to nothing — or, worse, to a different
|
|
66
|
+
* message. The caller is the one that knows what the email was supposed to be;
|
|
67
|
+
* this throws a plain not-found rather than guessing.
|
|
68
|
+
*/
|
|
69
|
+
export declare function openOutlookEmail(entryId: string, storeId?: string): Promise<void>;
|
package/dist/windows/read.js
CHANGED
|
@@ -194,26 +194,25 @@ ConvertTo-Json $out -Depth 3 -Compress
|
|
|
194
194
|
* daily batch run wants, since a subject filter alone walks the whole Inbox
|
|
195
195
|
* tree and returns every match ever received. 0 keeps that unbounded
|
|
196
196
|
* behavior, and is only sane paired with `filter.subjectLike` so Restrict can
|
|
197
|
-
* narrow the set server-side before anything crosses COM.
|
|
197
|
+
* narrow the set server-side before anything crosses COM. Where the store
|
|
198
|
+
* won't run that subject query — an IMAP mailbox accepts it and then matches
|
|
199
|
+
* nothing — an unbounded scan falls back to the last 60 days rather than
|
|
200
|
+
* walking every item the mailbox has ever held.
|
|
198
201
|
*/
|
|
199
202
|
async function searchInboxByFilter(emailAccount, filter = {}, daysBack = 0) {
|
|
200
203
|
if (process.platform !== 'win32')
|
|
201
204
|
return [];
|
|
202
205
|
const subjectLike = filter.subjectLike ? (0, run_1.psEscape)(filter.subjectLike) : '';
|
|
206
|
+
// DASL's `like` takes SQL wildcards, so the glob the filter is written in is
|
|
207
|
+
// translated for the server-side prefilter. The client-side re-check keeps
|
|
208
|
+
// the glob form, which is what PowerShell's own -like reads.
|
|
209
|
+
const subjectDasl = filter.subjectLike
|
|
210
|
+
? (0, run_1.psEscape)(filter.subjectLike.replace(/\*/g, '%').replace(/\?/g, '_'))
|
|
211
|
+
: '';
|
|
203
212
|
const subjectPatternSrc = filter.subjectPattern ? (0, run_1.psEscape)(filter.subjectPattern.source) : '';
|
|
204
|
-
// The subject filter reaches PowerShell as a single-quoted literal assigned to
|
|
205
|
-
// $subjLike, and the Restrict query is CONCATENATED from it. Interpolating it
|
|
206
|
-
// into the double-quoted query string directly — which is what the query needs
|
|
207
|
-
// to be, so `$cutoff` expands — would let a caller's `$(...)` execute, and
|
|
208
|
-
// would break the query outright on an apostrophe.
|
|
209
|
-
const boundedRestrict = subjectLike
|
|
210
|
-
? `$folder.Items.Restrict("[ReceivedTime] >= '$cutoff' AND [Subject] like '" + $subjLike + "'")`
|
|
211
|
-
: `$folder.Items.Restrict("[ReceivedTime] >= '$cutoff'")`;
|
|
212
|
-
const unboundedRestrict = subjectLike
|
|
213
|
-
? `$folder.Items.Restrict("[Subject] like '" + $subjLike + "'")`
|
|
214
|
-
: `$folder.Items`;
|
|
215
213
|
const script = `
|
|
216
214
|
$subjLike = '${subjectLike}'
|
|
215
|
+
$subjDasl = '${subjectDasl}'
|
|
217
216
|
${(0, scripts_1.accountScript)(emailAccount)}
|
|
218
217
|
${(0, scripts_1.namedStoreScript)(emailAccount)}
|
|
219
218
|
$inbox = $store.GetDefaultFolder(6)
|
|
@@ -225,31 +224,42 @@ while ($fi -lt $folders.Count) {
|
|
|
225
224
|
try { foreach ($sub in $folders[$fi].Folders) { [void]$folders.Add($sub) } } catch {}
|
|
226
225
|
$fi++
|
|
227
226
|
}
|
|
227
|
+
# The subject prefilter is a DASL property query rather than Outlook's Jet
|
|
228
|
+
# syntax: "[Subject] like '...'" is rejected outright by some stores — an IMAP
|
|
229
|
+
# mailbox answers "Condition is not valid" — while DASL is accepted wherever
|
|
230
|
+
# Restrict is. The two syntaxes cannot be mixed in one filter string, so the
|
|
231
|
+
# date clause stays Jet and the subject one is applied as a second Restrict on
|
|
232
|
+
# top of it. The pattern is CONCATENATED into the query, never interpolated:
|
|
233
|
+
# interpolating would let a caller's $(...) run, and would break the query
|
|
234
|
+
# outright on an apostrophe.
|
|
235
|
+
$subjQuery = '@SQL=' + [char]34 + 'urn:schemas:httpmail:subject' + [char]34 + ' like ' + [char]39 + $subjDasl + [char]39
|
|
228
236
|
$daysBack = ${daysBack}
|
|
229
237
|
foreach ($folder in $folders) {
|
|
230
238
|
if ($daysBack -gt 0) {
|
|
231
|
-
# Bounded scan. Filter on BOTH date and subject in the Restrict so Outlook does the
|
|
232
|
-
# work server-side — a date-only restrict hands back every item in the window for
|
|
233
|
-
# every folder in the tree, which is thousands of COM round-trips on a busy mailbox.
|
|
234
|
-
# Any stricter subject regex still runs on whatever survives.
|
|
235
239
|
$cutoff = (Get-Date).AddDays(-$daysBack).ToString('MM/dd/yyyy HH:mm')
|
|
236
|
-
|
|
237
|
-
$filtered = ${boundedRestrict}
|
|
238
|
-
$fCount = $filtered.Count
|
|
239
|
-
} catch {
|
|
240
|
-
# Some stores reject the compound query; fall back to date-only.
|
|
241
|
-
$filtered = $folder.Items.Restrict("[ReceivedTime] >= '$cutoff'")
|
|
242
|
-
$fCount = $filtered.Count
|
|
243
|
-
}
|
|
240
|
+
$filtered = $folder.Items.Restrict("[ReceivedTime] >= '$cutoff'")
|
|
244
241
|
} else {
|
|
245
|
-
$filtered = $
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
242
|
+
$filtered = $folder.Items
|
|
243
|
+
}
|
|
244
|
+
${subjectLike ? ` # Narrowing on the subject server-side is what keeps this cheap — a date-only
|
|
245
|
+
# restrict hands back every item in the window for every folder in the tree,
|
|
246
|
+
# which is thousands of COM round-trips on a busy mailbox. It is only an
|
|
247
|
+
# optimization though: every subject is re-checked below, so a store that
|
|
248
|
+
# cannot run the query returns the same answer, slower.
|
|
249
|
+
$narrowed = $null
|
|
250
|
+
try {
|
|
251
|
+
$candidate = $filtered.Restrict($subjQuery)
|
|
252
|
+
if ($candidate.Count -gt 0) { $narrowed = $candidate }
|
|
253
|
+
} catch {}
|
|
254
|
+
if ($narrowed -ne $null) {
|
|
255
|
+
$filtered = $narrowed
|
|
256
|
+
} elseif ($daysBack -le 0) {
|
|
257
|
+
# Nothing narrowed it and nothing bounds it, which would walk every item
|
|
258
|
+
# the folder has ever held; cap the sweep at a window instead.
|
|
259
|
+
$cutoff = (Get-Date).AddDays(-60).ToString('MM/dd/yyyy HH:mm')
|
|
260
|
+
$filtered = $folder.Items.Restrict("[ReceivedTime] >= '$cutoff'")
|
|
252
261
|
}
|
|
262
|
+
` : ''} $fCount = $filtered.Count
|
|
253
263
|
for ($i = 1; $i -le $fCount; $i++) {
|
|
254
264
|
$item = $filtered.Item($i)
|
|
255
265
|
if ($seen.ContainsKey($item.EntryID)) { continue }
|
|
@@ -257,6 +267,7 @@ foreach ($folder in $folders) {
|
|
|
257
267
|
$subject = $item.Subject
|
|
258
268
|
if (-not $subject) { continue }
|
|
259
269
|
$subject = $subject.Trim()
|
|
270
|
+
${subjectLike ? `if ($subject -notlike $subjLike) { continue }` : ''}
|
|
260
271
|
${subjectPatternSrc ? `if ($subject -notmatch '${subjectPatternSrc}') { continue }` : ''}
|
|
261
272
|
${filter.excludeReplies ? `if ($subject -imatch '^(re|fw[d]?)\\s*:') { continue }` : ''}
|
|
262
273
|
${filter.requireAttachment ? `if ($item.Attachments.Count -eq 0) { continue }` : ''}
|
|
@@ -363,10 +374,31 @@ ConvertTo-Json $result -Depth 3
|
|
|
363
374
|
attachmentNames: (0, json_1.toArray)(e.attachmentNames).map(json_1.str),
|
|
364
375
|
};
|
|
365
376
|
}
|
|
366
|
-
/**
|
|
367
|
-
|
|
377
|
+
/**
|
|
378
|
+
* Open an email in Outlook by its EntryID.
|
|
379
|
+
*
|
|
380
|
+
* `storeId` disambiguates across mailboxes — without one, `GetItemFromID` only
|
|
381
|
+
* looks in the default store, so an id from a shared or secondary mailbox
|
|
382
|
+
* simply isn't found. It's tried first and the bare lookup is the fallback, so
|
|
383
|
+
* a caller holding a stale StoreID (or none) still resolves whatever it can.
|
|
384
|
+
*
|
|
385
|
+
* EntryIDs are rewritten when an item MOVES between folders, so an id recorded
|
|
386
|
+
* before its mail was filed can resolve to nothing — or, worse, to a different
|
|
387
|
+
* message. The caller is the one that knows what the email was supposed to be;
|
|
388
|
+
* this throws a plain not-found rather than guessing.
|
|
389
|
+
*/
|
|
390
|
+
async function openOutlookEmail(entryId, storeId) {
|
|
368
391
|
(0, run_1.requireWindows)();
|
|
369
|
-
const script = `
|
|
392
|
+
const script = `
|
|
393
|
+
$outlook = New-Object -ComObject Outlook.Application
|
|
394
|
+
$ns = $outlook.GetNamespace('mapi')
|
|
395
|
+
$ns.Logon()
|
|
396
|
+
$item = $null
|
|
397
|
+
${storeId ? `try { ${(0, scripts_1.getItemScript)(entryId, storeId)} } catch { $item = $null }` : ''}
|
|
398
|
+
if ($item -eq $null) { try { ${(0, scripts_1.getItemScript)(entryId)} } catch { $item = $null } }
|
|
399
|
+
if ($item -eq $null) { throw "Email not found for EntryID '${(0, run_1.psEscape)(entryId)}'" }
|
|
400
|
+
$item.Display()
|
|
401
|
+
`;
|
|
370
402
|
await (0, run_1.runPowerShell)(script);
|
|
371
403
|
}
|
|
372
404
|
//# sourceMappingURL=read.js.map
|
package/dist/windows/read.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../src/windows/read.ts"],"names":[],"mappings":";;AAsCA,0CA0EC;AAmBD,sCA0DC;
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../src/windows/read.ts"],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,EAAE,IAAA,UAAG,EAAC,CAAC,CAAC,OAAO,CAAC;QACvB,UAAU,EAAE,IAAA,UAAG,EAAC,CAAC,CAAC,UAAU,CAAC;QAC7B,WAAW,EAAE,IAAA,UAAG,EAAC,CAAC,CAAC,WAAW,CAAC;QAC/B,YAAY,EAAE,IAAA,UAAG,EAAC,CAAC,CAAC,YAAY,CAAC;QACjC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;QACxB,eAAe,EAAE,IAAA,cAAO,EAAC,CAAC,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,UAAG,CAAC;KACvD,CAAC;AACN,CAAC;AAED;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,gBAAgB,CAAC,OAAe,EAAE,OAAgB;IACpE,IAAA,oBAAc,GAAE,CAAC;IACjB,MAAM,MAAM,GAAG;;;;;EAKjB,OAAO,CAAC,CAAC,CAAC,SAAS,IAAA,uBAAa,EAAC,OAAO,EAAE,OAAO,CAAC,4BAA4B,CAAC,CAAC,CAAC,EAAE;+BACtD,IAAA,uBAAa,EAAC,OAAO,CAAC;6DACQ,IAAA,cAAQ,EAAC,OAAO,CAAC;;CAE7E,CAAC;IACE,MAAM,IAAA,mBAAa,EAAC,MAAM,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -1,25 +1,48 @@
|
|
|
1
1
|
import type { MailFolderRef } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
* Session plus the
|
|
4
|
-
* `$
|
|
3
|
+
* Session plus the mailbox the address names; binds `$target`, `$account` and
|
|
4
|
+
* `$storeFolder`.
|
|
5
|
+
*
|
|
6
|
+
* An address can name a mailbox two different ways, and only one of them is an
|
|
7
|
+
* Account. A mailbox opened as a secondary store has no Account object, so
|
|
8
|
+
* resolving through Accounts alone closes every operation to it — including the
|
|
9
|
+
* reads, which never needed an Account in the first place. Both are resolved
|
|
10
|
+
* here and EITHER is enough: `$account` is null for a store-only mailbox, and
|
|
11
|
+
* the operations that genuinely require an identity to act as (sending) check
|
|
12
|
+
* for it themselves rather than being denied the mailbox up front.
|
|
5
13
|
*
|
|
6
14
|
* Fails rather than falling back to the default account. A bad address must
|
|
7
15
|
* never silently send from — or read — the wrong mailbox, and the thrown
|
|
8
16
|
* sentence is the one `classifyRunFailure` recognises to raise
|
|
9
17
|
* `AccountNotFoundError`, so the wording is load-bearing.
|
|
18
|
+
*
|
|
19
|
+
* The store is matched on the target address BEFORE the account's display name,
|
|
20
|
+
* which is what keeps the named-store route (see `namedStoreScript`) selecting
|
|
21
|
+
* the folders it selected before on a profile where the two differ.
|
|
10
22
|
*/
|
|
11
23
|
export declare function accountScript(emailAccount: string): string;
|
|
12
|
-
/** The account's own delivery store, as `$store`. Requires `accountScript`. */
|
|
13
|
-
export declare const DELIVERY_STORE_PS = "\n$store = $account.DeliveryStore\n$storeId = $store.StoreID\n";
|
|
14
24
|
/**
|
|
15
|
-
* The
|
|
16
|
-
*
|
|
25
|
+
* The mailbox's own store, as `$store`. Requires `accountScript`.
|
|
26
|
+
*
|
|
27
|
+
* Falls back to the resolved store folder because a store-only mailbox has no
|
|
28
|
+
* account to read a DeliveryStore off — reaching through `$account` directly is
|
|
29
|
+
* what makes an operation fail on exactly those mailboxes.
|
|
30
|
+
*/
|
|
31
|
+
export declare const DELIVERY_STORE_PS = "\n$store = if ($account -ne $null) { $account.DeliveryStore } else { $storeFolder.Store }\n$storeId = $store.StoreID\n";
|
|
32
|
+
/**
|
|
33
|
+
* The store `accountScript` resolved through the namespace's top-level folders,
|
|
34
|
+
* as `$store`.
|
|
17
35
|
*
|
|
18
36
|
* Kept alongside `DELIVERY_STORE_PS` rather than replaced by it: the reading
|
|
19
37
|
* operations resolve the store this way, and on a profile where a mailbox is
|
|
20
38
|
* open under a display name that differs from the delivery store's, the two do
|
|
21
39
|
* not select the same folders. Changing which one a reader uses changes what it
|
|
22
40
|
* returns, so each keeps the route it was verified against.
|
|
41
|
+
*
|
|
42
|
+
* The folder search itself now lives in `accountScript`, which has to attempt it
|
|
43
|
+
* anyway to resolve a mailbox that has no account. This throws when it found
|
|
44
|
+
* nothing, which is the case where the address named an account whose store is
|
|
45
|
+
* not open in this profile.
|
|
23
46
|
*/
|
|
24
47
|
export declare function namedStoreScript(emailAccount: string): string;
|
|
25
48
|
/**
|
package/dist/windows/scripts.js
CHANGED
|
@@ -25,13 +25,25 @@ $ns = $outlook.GetNamespace('mapi')
|
|
|
25
25
|
$ns.Logon()
|
|
26
26
|
`;
|
|
27
27
|
/**
|
|
28
|
-
* Session plus the
|
|
29
|
-
* `$
|
|
28
|
+
* Session plus the mailbox the address names; binds `$target`, `$account` and
|
|
29
|
+
* `$storeFolder`.
|
|
30
|
+
*
|
|
31
|
+
* An address can name a mailbox two different ways, and only one of them is an
|
|
32
|
+
* Account. A mailbox opened as a secondary store has no Account object, so
|
|
33
|
+
* resolving through Accounts alone closes every operation to it — including the
|
|
34
|
+
* reads, which never needed an Account in the first place. Both are resolved
|
|
35
|
+
* here and EITHER is enough: `$account` is null for a store-only mailbox, and
|
|
36
|
+
* the operations that genuinely require an identity to act as (sending) check
|
|
37
|
+
* for it themselves rather than being denied the mailbox up front.
|
|
30
38
|
*
|
|
31
39
|
* Fails rather than falling back to the default account. A bad address must
|
|
32
40
|
* never silently send from — or read — the wrong mailbox, and the thrown
|
|
33
41
|
* sentence is the one `classifyRunFailure` recognises to raise
|
|
34
42
|
* `AccountNotFoundError`, so the wording is load-bearing.
|
|
43
|
+
*
|
|
44
|
+
* The store is matched on the target address BEFORE the account's display name,
|
|
45
|
+
* which is what keeps the named-store route (see `namedStoreScript`) selecting
|
|
46
|
+
* the folders it selected before on a profile where the two differ.
|
|
35
47
|
*/
|
|
36
48
|
function accountScript(emailAccount) {
|
|
37
49
|
return `${PS_PRELUDE}
|
|
@@ -40,30 +52,46 @@ $account = $null
|
|
|
40
52
|
foreach ($a in $ns.Accounts) {
|
|
41
53
|
if ($a.SmtpAddress -ieq $target) { $account = $a; break }
|
|
42
54
|
}
|
|
43
|
-
|
|
55
|
+
$storeFolder = $null
|
|
56
|
+
foreach ($f in $ns.Folders) {
|
|
57
|
+
if ($f.Name -ieq $target) { $storeFolder = $f; break }
|
|
58
|
+
}
|
|
59
|
+
if ($storeFolder -eq $null -and $account -ne $null) {
|
|
60
|
+
foreach ($f in $ns.Folders) {
|
|
61
|
+
if ($f.Name -ieq $account.DisplayName) { $storeFolder = $f; break }
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if ($account -eq $null -and $storeFolder -eq $null) { throw "Account '$target' not found" }
|
|
44
65
|
`;
|
|
45
66
|
}
|
|
46
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* The mailbox's own store, as `$store`. Requires `accountScript`.
|
|
69
|
+
*
|
|
70
|
+
* Falls back to the resolved store folder because a store-only mailbox has no
|
|
71
|
+
* account to read a DeliveryStore off — reaching through `$account` directly is
|
|
72
|
+
* what makes an operation fail on exactly those mailboxes.
|
|
73
|
+
*/
|
|
47
74
|
exports.DELIVERY_STORE_PS = `
|
|
48
|
-
$store = $account.DeliveryStore
|
|
75
|
+
$store = if ($account -ne $null) { $account.DeliveryStore } else { $storeFolder.Store }
|
|
49
76
|
$storeId = $store.StoreID
|
|
50
77
|
`;
|
|
51
78
|
/**
|
|
52
|
-
* The
|
|
53
|
-
*
|
|
79
|
+
* The store `accountScript` resolved through the namespace's top-level folders,
|
|
80
|
+
* as `$store`.
|
|
54
81
|
*
|
|
55
82
|
* Kept alongside `DELIVERY_STORE_PS` rather than replaced by it: the reading
|
|
56
83
|
* operations resolve the store this way, and on a profile where a mailbox is
|
|
57
84
|
* open under a display name that differs from the delivery store's, the two do
|
|
58
85
|
* not select the same folders. Changing which one a reader uses changes what it
|
|
59
86
|
* returns, so each keeps the route it was verified against.
|
|
87
|
+
*
|
|
88
|
+
* The folder search itself now lives in `accountScript`, which has to attempt it
|
|
89
|
+
* anyway to resolve a mailbox that has no account. This throws when it found
|
|
90
|
+
* nothing, which is the case where the address named an account whose store is
|
|
91
|
+
* not open in this profile.
|
|
60
92
|
*/
|
|
61
93
|
function namedStoreScript(emailAccount) {
|
|
62
94
|
return `
|
|
63
|
-
$storeFolder = $null
|
|
64
|
-
foreach ($f in $ns.Folders) {
|
|
65
|
-
if ($f.Name -ieq $account.DisplayName) { $storeFolder = $f; break }
|
|
66
|
-
}
|
|
67
95
|
if ($storeFolder -eq $null) { throw "Store folder not found for account '${(0, run_1.psEscape)(emailAccount)}'" }
|
|
68
96
|
$store = $storeFolder.Store
|
|
69
97
|
$storeId = $store.StoreID
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scripts.js","sourceRoot":"","sources":["../../src/windows/scripts.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"scripts.js","sourceRoot":"","sources":["../../src/windows/scripts.ts"],"names":[],"mappings":";;;AA2CA,sCAkBC;AA6BD,4CAMC;AAMD,sCAIC;AAgDD,0CAoCC;AA9LD,0EAA0E;AAC1E,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,iCAAiC;AACjC,+BAAiC;AAGjC;;;;;;GAMG;AACH,MAAM,UAAU,GAAG;;;;;CAKlB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,aAAa,CAAC,YAAoB;IAC9C,OAAO,GAAG,UAAU;aACX,IAAA,cAAQ,EAAC,YAAY,CAAC;;;;;;;;;;;;;;;CAelC,CAAC;AACF,CAAC;AAED;;;;;;GAMG;AACU,QAAA,iBAAiB,GAAG;;;CAGhC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,SAAgB,gBAAgB,CAAC,YAAoB;IACjD,OAAO;2EACgE,IAAA,cAAQ,EAAC,YAAY,CAAC;;;CAGhG,CAAC;AACF,CAAC;AAED;;;GAGG;AACH,SAAgB,aAAa,CAAC,OAAe,EAAE,OAAgB;IAC3D,OAAO,OAAO;QACV,CAAC,CAAC,8BAA8B,IAAA,cAAQ,EAAC,OAAO,CAAC,OAAO,IAAA,cAAQ,EAAC,OAAO,CAAC,IAAI;QAC7E,CAAC,CAAC,8BAA8B,IAAA,cAAQ,EAAC,OAAO,CAAC,IAAI,CAAC;AAC9D,CAAC;AAED;;;;;;GAMG;AACU,QAAA,cAAc,GAAG;;;;;;CAM7B,CAAC;AAEF;;;GAGG;AACU,QAAA,cAAc,GAAG;;;;;;;;;;;;CAY7B,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,SAAgB,eAAe,CAAC,GAAkB,EAAE,WAAW,GAAG,EAAE,EAAE,aAAa,GAAG,KAAK;IACvF,MAAM,IAAI,GAAG,2BAA2B,GAAG,CAAC,MAAM,GAAG,CAAC;IACtD,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,YAAY,IAAI,0BAA0B,CAAC;IACjF,OAAO;EACT,sBAAc;gBACA,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,IAAA,cAAQ,EAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;eACpD,IAAI;;;;;;;;;;;;;;;4BAeS,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ;;;;;;;;;;;;;qBAazC,IAAA,cAAQ,EAAC,WAAW,CAAC;EACxC,CAAC;AACH,CAAC"}
|
package/dist/windows/send.js
CHANGED
|
@@ -15,9 +15,20 @@ const templates_1 = require("./templates");
|
|
|
15
15
|
* Direct assignment (`$mail.SendUsingAccount = $account`) is a silent no-op under
|
|
16
16
|
* PowerShell's COM binding — the mail then goes out from whichever account
|
|
17
17
|
* Outlook considers default, which is the failure this package exists to prevent.
|
|
18
|
+
*
|
|
19
|
+
* Refuses a mailbox that resolved to a store with no account. `accountScript`
|
|
20
|
+
* admits those deliberately so the reads can reach them, but SendUsingAccount
|
|
21
|
+
* takes an Account and there is no store to substitute: sending anyway would
|
|
22
|
+
* leave $account null and fall through to the default account — the exact silent
|
|
23
|
+
* wrong-mailbox send this function exists to stop. The guard lives here rather
|
|
24
|
+
* than at the two call sites so neither can be added without it.
|
|
25
|
+
*
|
|
26
|
+
* The wording avoids the phrase `classifyRunFailure` matches for
|
|
27
|
+
* AccountNotFoundError; the mailbox WAS found, it just cannot send.
|
|
18
28
|
*/
|
|
19
29
|
function sendUsingAccount(variable) {
|
|
20
|
-
return `
|
|
30
|
+
return `if ($account -eq $null) { throw "Mailbox '$target' is a secondary store with no sending account attached." }
|
|
31
|
+
[void]$${variable}.GetType().InvokeMember('SendUsingAccount', [Reflection.BindingFlags]::SetProperty, $null, $${variable}, @($account))`;
|
|
21
32
|
}
|
|
22
33
|
/**
|
|
23
34
|
* What to do with a composed item: send it, show it, or file it silently.
|
package/dist/windows/send.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.js","sourceRoot":"","sources":["../../src/windows/send.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"send.js","sourceRoot":"","sources":["../../src/windows/send.ts"],"names":[],"mappings":";;AA+CA,4CAuBC;AASD,8CA8CC;AA7HD,wEAAwE;AACxE,+BAAgG;AAChG,uCAAyD;AACzD,mDAA4E;AAC5E,yCAAkD;AAClD,6CAA+E;AAC/E,2CAAiD;AAGjD;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,gBAAgB,CAAC,QAAgB;IACtC,OAAO;SACF,QAAQ,+FAA+F,QAAQ,gBAAgB,CAAC;AACzI,CAAC;AAED;;;;;GAKG;AACH,SAAS,aAAa,CAClB,QAAgB,EAChB,eAAoC,EACpC,eAAoC;IAEpC,IAAI,eAAe;QAAE,OAAO,IAAI,QAAQ,SAAS,CAAC;IAClD,OAAO,eAAe,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,QAAQ,YAAY,CAAC,CAAC,CAAC,IAAI,QAAQ,SAAS,CAAC;AACxF,CAAC;AAED,iEAAiE;AAC1D,KAAK,UAAU,gBAAgB,CAAC,MAAuB;IAC1D,IAAA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C,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC;IAC3D,6EAA6E;IAC7E,4EAA4E;IAC5E,4EAA4E;IAC5E,uDAAuD;IACvD,MAAM,MAAM,GAAG,GAAG,IAAA,uBAAa,EAAC,MAAM,CAAC,YAAY,CAAC;EACtD,IAAA,uBAAa,EAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC;iBAC9B,WAAW;EAC1B,gBAAgB,CAAC,OAAO,CAAC;;wCAEa,IAAA,cAAQ,EAAC,IAAI,CAAC,IAAI,CAAC;cAC7C,IAAA,cAAQ,EAAC,+BAAmB,CAAC;;;;;;;;;;;;;;EAczC,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,eAAe,CAAC;;CAEvE,CAAC;IACE,IAAI,CAAC;QACD,MAAM,MAAM,GAAG,IAAA,kBAAW,EAAC,MAAM,IAAA,mBAAa,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;QAC/D,OAAO;YACH,EAAE,EAAE,IAAA,UAAG,EAAC,MAAM,CAAC,EAAE,CAAC;YAClB,OAAO,EAAE,IAAA,UAAG,EAAC,MAAM,CAAC,OAAO,CAAC;YAC5B,eAAe,EAAE,IAAA,UAAG,EAAC,MAAM,CAAC,eAAe,CAAC;SAC/C,CAAC;IACN,CAAC;YAAS,CAAC;QACP,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;AACL,CAAC"}
|
|
@@ -23,7 +23,8 @@ async function readTemplateEmails(emailAccount, folderName = 'Templates', limit
|
|
|
23
23
|
const cap = (0, mail_1.clamp)(limit, 1, 50);
|
|
24
24
|
const wanted = (subject || '').trim();
|
|
25
25
|
const script = `${(0, scripts_1.accountScript)(emailAccount)}
|
|
26
|
-
$
|
|
26
|
+
${scripts_1.DELIVERY_STORE_PS}
|
|
27
|
+
$root = $store.GetRootFolder()
|
|
27
28
|
${scripts_1.FIND_FOLDER_PS}
|
|
28
29
|
$folder = Find-FolderByName $root '${(0, run_1.psEscape)(folderName)}' 3
|
|
29
30
|
if ($folder -eq $null) {
|
|
@@ -134,7 +135,8 @@ async function saveTemplateEmail(emailAccount, subject, htmlBody, folderName = '
|
|
|
134
135
|
(0, run_1.requireWindows)();
|
|
135
136
|
const body = (0, run_1.scriptInput)('template-body', htmlBody);
|
|
136
137
|
const script = `${(0, scripts_1.accountScript)(emailAccount)}
|
|
137
|
-
$
|
|
138
|
+
${scripts_1.DELIVERY_STORE_PS}
|
|
139
|
+
$root = $store.GetRootFolder()
|
|
138
140
|
${scripts_1.FIND_FOLDER_PS}
|
|
139
141
|
$folder = Find-FolderByName $root '${(0, run_1.psEscape)(folderName)}' 3
|
|
140
142
|
$folderCreated = $false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/windows/templates.ts"],"names":[],"mappings":";;AAyBA,
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/windows/templates.ts"],"names":[],"mappings":";;AAyBA,gDA+GC;AASD,8CAkCC;AAUD,8CAyEC;AAtQD,8EAA8E;AAC9E,wDAAwD;AACxD,+BAQe;AACf,uCAA6E;AAC7E,yCAAmE;AACnE,wEAAiE;AACjE,kCAAgC;AAChC,sCAA0C;AAC1C,wCAAsC;AAGtC;;;;;GAKG;AACI,KAAK,UAAU,kBAAkB,CACpC,YAAoB,EACpB,UAAU,GAAG,WAAW,EACxB,KAAK,GAAG,EAAE,EACV,WAAW,GAAG,IAAI,EAClB,OAAO,GAAG,EAAE;IAEZ,IAAA,oBAAc,GAAE,CAAC;IACjB,MAAM,GAAG,GAAG,IAAA,YAAK,EAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAChC,MAAM,MAAM,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACtC,MAAM,MAAM,GAAG,GAAG,IAAA,uBAAa,EAA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,MAAM,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,GAAG,KAAK,sCAAsC,CAAC;IAC/D,MAAM,MAAM,GAAG;;gBAEH,IAAA,cAAQ,EAAC,KAAK,CAAC,IAAI,CAAC;iBACnB,IAAA,cAAQ,EAAC,UAAU,CAAC;cACvB,IAAA,cAAQ,EAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoD9B,CAAC;IACE,IAAI,CAAC;QACD,iEAAiE;QACjE,MAAM,IAAA,uBAAiB,EAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACvC,CAAC;YAAS,CAAC;QACP,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;IACD,MAAM,MAAM,GAAG,IAAA,sBAAgB,EAAC,UAAU,CAAC,CAAC;IAC5C,IAAI,CAAC,MAAM,EAAE,CAAC;QACV,MAAM,IAAI,sBAAa,CAAC,UAAU,EAAE,0DAA0D,CAAC,CAAC;IACpG,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dawnlit/outlook-bridge",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Desktop Outlook automation for Node — read, send, reply, file, and template mail by driving the real Outlook client.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Dawnlit",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"prepare": "npm run build"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@types/node": "^24.
|
|
47
|
+
"@types/node": "^24.13.3",
|
|
48
48
|
"typescript": "~6.0.3"
|
|
49
49
|
}
|
|
50
50
|
}
|