This commit is contained in:
2026-07-09 16:20:46 +03:00
parent 91d9befa1e
commit 8fce57800f
3 changed files with 46 additions and 67 deletions
+9 -1
View File
@@ -250,6 +250,14 @@ export class EwsClient {
traversal = "Shallow",
} = options;
const isDistinguished =
DISTINGUISHED_FOLDERS[folderId.toLowerCase()] !== undefined
|| ["msgfolderroot"].includes(folderId.toLowerCase());
const folderIdXml = isDistinguished
? `<t:DistinguishedFolderId Id="${folderId}"/>`
: `<t:FolderId Id="${folderId}"/>`;
const soap = buildSoapEnvelope(`\
<m:FindItem Traversal="${traversal}">
<m:ItemShape>
@@ -257,7 +265,7 @@ export class EwsClient {
</m:ItemShape>
<m:IndexedPageItemView MaxEntriesReturned="${limit}" Offset="${offset}" BasePoint="Beginning"/>
<m:ParentFolderIds>
<t:FolderId Id="${folderId}"/>
${folderIdXml}
</m:ParentFolderIds>
<m:SortOrder>
<t:FieldOrder Order="Descending">