@rapidmx/activesync-plugin 1.0.0-beta.2 → 1.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/README.md +4 -4
  2. package/dist/lib/BaseDeviceSyncStateRoute.js +32 -0
  3. package/dist/lib/BaseDeviceSyncStateRoute.js.map +1 -1
  4. package/dist/lib/BaseEasRoute.js +91 -15
  5. package/dist/lib/BaseEasRoute.js.map +1 -1
  6. package/dist/lib/EasAuditLog.js +56 -0
  7. package/dist/lib/EasAuditLog.js.map +1 -0
  8. package/dist/lib/EasCollectionLease.js +199 -0
  9. package/dist/lib/EasCollectionLease.js.map +1 -0
  10. package/dist/lib/EasCollectionStore.js +102 -0
  11. package/dist/lib/EasCollectionStore.js.map +1 -0
  12. package/dist/lib/EasCollectionSync.js +294 -0
  13. package/dist/lib/EasCollectionSync.js.map +1 -0
  14. package/dist/lib/EasSyncKeyUtils.js +125 -62
  15. package/dist/lib/EasSyncKeyUtils.js.map +1 -1
  16. package/dist/lib/MessageMoveRules.js +100 -0
  17. package/dist/lib/MessageMoveRules.js.map +1 -0
  18. package/dist/lib/MimeHeaderUtils.js +395 -0
  19. package/dist/lib/MimeHeaderUtils.js.map +1 -0
  20. package/dist/lib/RegexPatternUtils.js +30 -0
  21. package/dist/lib/RegexPatternUtils.js.map +1 -0
  22. package/dist/lib/RestapiCompat.js +41 -0
  23. package/dist/lib/RestapiCompat.js.map +1 -0
  24. package/dist/lib/adapters/CalendarSyncAdapter.js +142 -33
  25. package/dist/lib/adapters/CalendarSyncAdapter.js.map +1 -1
  26. package/dist/lib/adapters/EmailSyncAdapter.js +114 -27
  27. package/dist/lib/adapters/EmailSyncAdapter.js.map +1 -1
  28. package/dist/lib/adapters/mongo/EmailSyncAdapterMongo.js +2 -1
  29. package/dist/lib/adapters/mongo/EmailSyncAdapterMongo.js.map +1 -1
  30. package/dist/lib/adapters/sql/EmailSyncAdapterSQL.js +2 -1
  31. package/dist/lib/adapters/sql/EmailSyncAdapterSQL.js.map +1 -1
  32. package/dist/lib/codec/WbxmlDecoder.js +86 -34
  33. package/dist/lib/codec/WbxmlDecoder.js.map +1 -1
  34. package/dist/lib/codec/WbxmlEncoder.js +103 -22
  35. package/dist/lib/codec/WbxmlEncoder.js.map +1 -1
  36. package/dist/lib/commands/ComposeMailCommand.js +105 -31
  37. package/dist/lib/commands/ComposeMailCommand.js.map +1 -1
  38. package/dist/lib/commands/FolderSyncCommand.js +67 -27
  39. package/dist/lib/commands/FolderSyncCommand.js.map +1 -1
  40. package/dist/lib/commands/GetItemEstimateCommand.js +80 -59
  41. package/dist/lib/commands/GetItemEstimateCommand.js.map +1 -1
  42. package/dist/lib/commands/ItemOperationsCommand.js +219 -56
  43. package/dist/lib/commands/ItemOperationsCommand.js.map +1 -1
  44. package/dist/lib/commands/MeetingResponseCommand.js +212 -53
  45. package/dist/lib/commands/MeetingResponseCommand.js.map +1 -1
  46. package/dist/lib/commands/MoveItemsCommand.js +54 -21
  47. package/dist/lib/commands/MoveItemsCommand.js.map +1 -1
  48. package/dist/lib/commands/PingCommand.js +288 -56
  49. package/dist/lib/commands/PingCommand.js.map +1 -1
  50. package/dist/lib/commands/ProvisionCommand.js +34 -17
  51. package/dist/lib/commands/ProvisionCommand.js.map +1 -1
  52. package/dist/lib/commands/ResolveRecipientsCommand.js +43 -5
  53. package/dist/lib/commands/ResolveRecipientsCommand.js.map +1 -1
  54. package/dist/lib/commands/SearchCommand.js +92 -17
  55. package/dist/lib/commands/SearchCommand.js.map +1 -1
  56. package/dist/lib/commands/SettingsCommand.js +2 -1
  57. package/dist/lib/commands/SettingsCommand.js.map +1 -1
  58. package/dist/lib/commands/SmartForwardCommand.js +2 -1
  59. package/dist/lib/commands/SmartForwardCommand.js.map +1 -1
  60. package/dist/lib/commands/SmartReplyCommand.js +2 -1
  61. package/dist/lib/commands/SmartReplyCommand.js.map +1 -1
  62. package/dist/lib/commands/SyncCommand.js +481 -244
  63. package/dist/lib/commands/SyncCommand.js.map +1 -1
  64. package/dist/lib/commands/mongo/GetItemEstimateCommandMongo.js +6 -1
  65. package/dist/lib/commands/mongo/GetItemEstimateCommandMongo.js.map +1 -1
  66. package/dist/lib/commands/mongo/ItemOperationsCommandMongo.js +3 -1
  67. package/dist/lib/commands/mongo/ItemOperationsCommandMongo.js.map +1 -1
  68. package/dist/lib/commands/mongo/MeetingResponseCommandMongo.js +2 -1
  69. package/dist/lib/commands/mongo/MeetingResponseCommandMongo.js.map +1 -1
  70. package/dist/lib/commands/mongo/PingCommandMongo.js +23 -0
  71. package/dist/lib/commands/mongo/PingCommandMongo.js.map +1 -0
  72. package/dist/lib/commands/mongo/SearchCommandMongo.js +3 -1
  73. package/dist/lib/commands/mongo/SearchCommandMongo.js.map +1 -1
  74. package/dist/lib/commands/mongo/SendMailCommandMongo.js +2 -1
  75. package/dist/lib/commands/mongo/SendMailCommandMongo.js.map +1 -1
  76. package/dist/lib/commands/mongo/SmartForwardCommandMongo.js +2 -1
  77. package/dist/lib/commands/mongo/SmartForwardCommandMongo.js.map +1 -1
  78. package/dist/lib/commands/mongo/SmartReplyCommandMongo.js +2 -1
  79. package/dist/lib/commands/mongo/SmartReplyCommandMongo.js.map +1 -1
  80. package/dist/lib/commands/mongo/SyncCommandMongo.js +7 -1
  81. package/dist/lib/commands/mongo/SyncCommandMongo.js.map +1 -1
  82. package/dist/lib/commands/mongo/index.js +1 -0
  83. package/dist/lib/commands/mongo/index.js.map +1 -1
  84. package/dist/lib/commands/sql/GetItemEstimateCommandSQL.js +6 -1
  85. package/dist/lib/commands/sql/GetItemEstimateCommandSQL.js.map +1 -1
  86. package/dist/lib/commands/sql/ItemOperationsCommandSQL.js +3 -1
  87. package/dist/lib/commands/sql/ItemOperationsCommandSQL.js.map +1 -1
  88. package/dist/lib/commands/sql/MeetingResponseCommandSQL.js +2 -1
  89. package/dist/lib/commands/sql/MeetingResponseCommandSQL.js.map +1 -1
  90. package/dist/lib/commands/sql/PingCommandSQL.js +23 -0
  91. package/dist/lib/commands/sql/PingCommandSQL.js.map +1 -0
  92. package/dist/lib/commands/sql/SearchCommandSQL.js +3 -1
  93. package/dist/lib/commands/sql/SearchCommandSQL.js.map +1 -1
  94. package/dist/lib/commands/sql/SendMailCommandSQL.js +2 -1
  95. package/dist/lib/commands/sql/SendMailCommandSQL.js.map +1 -1
  96. package/dist/lib/commands/sql/SmartForwardCommandSQL.js +2 -1
  97. package/dist/lib/commands/sql/SmartForwardCommandSQL.js.map +1 -1
  98. package/dist/lib/commands/sql/SmartReplyCommandSQL.js +2 -1
  99. package/dist/lib/commands/sql/SmartReplyCommandSQL.js.map +1 -1
  100. package/dist/lib/commands/sql/SyncCommandSQL.js +7 -1
  101. package/dist/lib/commands/sql/SyncCommandSQL.js.map +1 -1
  102. package/dist/lib/commands/sql/index.js +1 -0
  103. package/dist/lib/commands/sql/index.js.map +1 -1
  104. package/dist/lib/index.js +5 -0
  105. package/dist/lib/index.js.map +1 -1
  106. package/dist/lib/jobs/EasDeviceStateCleanupJob.js +44 -2
  107. package/dist/lib/jobs/EasDeviceStateCleanupJob.js.map +1 -1
  108. package/dist/lib/jobs/mongo/EasDeviceStateCleanupJobMongo.js +4 -0
  109. package/dist/lib/jobs/mongo/EasDeviceStateCleanupJobMongo.js.map +1 -1
  110. package/dist/lib/jobs/sql/EasDeviceStateCleanupJobSQL.js +9 -0
  111. package/dist/lib/jobs/sql/EasDeviceStateCleanupJobSQL.js.map +1 -1
  112. package/dist/lib/models/EasCollectionChunk.js +2 -0
  113. package/dist/lib/models/EasCollectionChunk.js.map +1 -0
  114. package/dist/lib/models/EasCollectionState.js +2 -0
  115. package/dist/lib/models/EasCollectionState.js.map +1 -0
  116. package/dist/lib/models/mongo/DeviceSyncStateMongo.js +7 -0
  117. package/dist/lib/models/mongo/DeviceSyncStateMongo.js.map +1 -1
  118. package/dist/lib/models/mongo/EasCollectionChunkMongo.js +83 -0
  119. package/dist/lib/models/mongo/EasCollectionChunkMongo.js.map +1 -0
  120. package/dist/lib/models/mongo/EasCollectionStateMongo.js +162 -0
  121. package/dist/lib/models/mongo/EasCollectionStateMongo.js.map +1 -0
  122. package/dist/lib/models/sql/DeviceSyncStateSQL.js +7 -0
  123. package/dist/lib/models/sql/DeviceSyncStateSQL.js.map +1 -1
  124. package/dist/lib/models/sql/EasCollectionChunkSQL.js +83 -0
  125. package/dist/lib/models/sql/EasCollectionChunkSQL.js.map +1 -0
  126. package/dist/lib/models/sql/EasCollectionStateSQL.js +162 -0
  127. package/dist/lib/models/sql/EasCollectionStateSQL.js.map +1 -0
  128. package/dist/lib/mongo/EasRouteMongo.js +2 -2
  129. package/dist/lib/mongo/EasRouteMongo.js.map +1 -1
  130. package/dist/lib/mongo.js +2 -0
  131. package/dist/lib/mongo.js.map +1 -1
  132. package/dist/lib/sql/EasRouteSQL.js +2 -2
  133. package/dist/lib/sql/EasRouteSQL.js.map +1 -1
  134. package/dist/lib/sql.js +2 -0
  135. package/dist/lib/sql.js.map +1 -1
  136. package/dist/types/BaseDeviceSyncStateRoute.d.ts +10 -0
  137. package/dist/types/BaseEasRoute.d.ts +15 -4
  138. package/dist/types/EasAuditLog.d.ts +47 -0
  139. package/dist/types/EasCollectionLease.d.ts +60 -0
  140. package/dist/types/EasCollectionStore.d.ts +51 -0
  141. package/dist/types/EasCollectionSync.d.ts +96 -0
  142. package/dist/types/EasCommandHandler.d.ts +7 -4
  143. package/dist/types/EasSyncKeyUtils.d.ts +73 -42
  144. package/dist/types/MessageMoveRules.d.ts +45 -0
  145. package/dist/types/MimeHeaderUtils.d.ts +73 -0
  146. package/dist/types/RegexPatternUtils.d.ts +14 -0
  147. package/dist/types/RestapiCompat.d.ts +24 -0
  148. package/dist/types/adapters/CalendarSyncAdapter.d.ts +47 -18
  149. package/dist/types/adapters/EasCollectionSyncAdapter.d.ts +18 -2
  150. package/dist/types/adapters/EmailSyncAdapter.d.ts +24 -7
  151. package/dist/types/adapters/mongo/EmailSyncAdapterMongo.d.ts +1 -0
  152. package/dist/types/adapters/sql/EmailSyncAdapterSQL.d.ts +1 -0
  153. package/dist/types/codec/WbxmlDecoder.d.ts +39 -0
  154. package/dist/types/codec/WbxmlEncoder.d.ts +36 -1
  155. package/dist/types/commands/ComposeMailCommand.d.ts +33 -15
  156. package/dist/types/commands/FolderSyncCommand.d.ts +4 -1
  157. package/dist/types/commands/GetItemEstimateCommand.d.ts +20 -15
  158. package/dist/types/commands/ItemOperationsCommand.d.ts +29 -4
  159. package/dist/types/commands/MeetingResponseCommand.d.ts +52 -13
  160. package/dist/types/commands/MoveItemsCommand.d.ts +13 -3
  161. package/dist/types/commands/PingCommand.d.ts +72 -14
  162. package/dist/types/commands/ProvisionCommand.d.ts +16 -11
  163. package/dist/types/commands/ResolveRecipientsCommand.d.ts +4 -0
  164. package/dist/types/commands/SearchCommand.d.ts +13 -1
  165. package/dist/types/commands/SyncCommand.d.ts +102 -62
  166. package/dist/types/commands/mongo/GetItemEstimateCommandMongo.d.ts +3 -0
  167. package/dist/types/commands/mongo/ItemOperationsCommandMongo.d.ts +2 -0
  168. package/dist/types/commands/mongo/MeetingResponseCommandMongo.d.ts +1 -0
  169. package/dist/types/commands/mongo/PingCommandMongo.d.ts +8 -0
  170. package/dist/types/commands/mongo/SearchCommandMongo.d.ts +2 -0
  171. package/dist/types/commands/mongo/SendMailCommandMongo.d.ts +1 -0
  172. package/dist/types/commands/mongo/SmartForwardCommandMongo.d.ts +1 -0
  173. package/dist/types/commands/mongo/SmartReplyCommandMongo.d.ts +1 -0
  174. package/dist/types/commands/mongo/SyncCommandMongo.d.ts +4 -0
  175. package/dist/types/commands/mongo/index.d.ts +1 -0
  176. package/dist/types/commands/sql/GetItemEstimateCommandSQL.d.ts +3 -0
  177. package/dist/types/commands/sql/ItemOperationsCommandSQL.d.ts +2 -0
  178. package/dist/types/commands/sql/MeetingResponseCommandSQL.d.ts +1 -0
  179. package/dist/types/commands/sql/PingCommandSQL.d.ts +8 -0
  180. package/dist/types/commands/sql/SearchCommandSQL.d.ts +2 -0
  181. package/dist/types/commands/sql/SendMailCommandSQL.d.ts +1 -0
  182. package/dist/types/commands/sql/SmartForwardCommandSQL.d.ts +1 -0
  183. package/dist/types/commands/sql/SmartReplyCommandSQL.d.ts +1 -0
  184. package/dist/types/commands/sql/SyncCommandSQL.d.ts +4 -0
  185. package/dist/types/commands/sql/index.d.ts +1 -0
  186. package/dist/types/index.d.ts +5 -0
  187. package/dist/types/jobs/EasDeviceStateCleanupJob.d.ts +15 -0
  188. package/dist/types/jobs/mongo/EasDeviceStateCleanupJobMongo.d.ts +2 -0
  189. package/dist/types/jobs/sql/EasDeviceStateCleanupJobSQL.d.ts +4 -0
  190. package/dist/types/models/DeviceSyncState.d.ts +13 -2
  191. package/dist/types/models/EasCollectionChunk.d.ts +20 -0
  192. package/dist/types/models/EasCollectionState.d.ts +79 -0
  193. package/dist/types/models/mongo/DeviceSyncStateMongo.d.ts +1 -0
  194. package/dist/types/models/mongo/EasCollectionChunkMongo.d.ts +16 -0
  195. package/dist/types/models/mongo/EasCollectionStateMongo.d.ts +27 -0
  196. package/dist/types/models/sql/DeviceSyncStateSQL.d.ts +1 -0
  197. package/dist/types/models/sql/EasCollectionChunkSQL.d.ts +16 -0
  198. package/dist/types/models/sql/EasCollectionStateSQL.d.ts +27 -0
  199. package/dist/types/mongo.d.ts +2 -0
  200. package/dist/types/sql.d.ts +2 -0
  201. package/package.json +267 -238
@@ -13,16 +13,29 @@ var __metadata = (this && this.__metadata) || function (k, v) {
13
13
  ///////////////////////////////////////////////////////////////////////////////
14
14
  import { simpleParser } from "mailparser";
15
15
  import { ApiError, ObjectDecorators } from "@rapidrest/core";
16
- import { ACLAction, ACLUtils, ApiErrorMessages, ApiErrors, RepoUtils } from "@rapidrest/service-core";
17
- import { RecoverableRepoUtils } from "@rapidmx/restapi";
16
+ import { ACLAction, ACLUtils, ApiErrorMessages, ApiErrors, ModelUtils, RepoUtils } from "@rapidrest/service-core";
17
+ import { AuditAction, RecoverableRepoUtils } from "@rapidmx/restapi";
18
18
  import { WbxmlCodePage } from "../codec/WbxmlCodePages.js";
19
19
  import { childText, element, findChild, findChildren, opaqueElement, textElement } from "../codec/WbxmlElement.js";
20
20
  import { decodeConversationId } from "../adapters/EmailSyncAdapter.js";
21
- const { Config, Init, Inject } = ObjectDecorators;
21
+ import { hasLiveSendLease, planMessageMove } from "../MessageMoveRules.js";
22
+ import { asEntity, boundIndexedValue } from "../RestapiCompat.js";
23
+ import { EasAuditLog } from "../EasAuditLog.js";
24
+ const { Config, Init, Inject, Logger } = ObjectDecorators;
22
25
  /** Caps how many messages `emptyFolderContents`/`moveConversation` process per backing `find()`/delete-batch
23
26
  * round - keeps memory bounded and, for `emptyFolderContents`, lets an arbitrarily large folder still be fully
24
27
  * emptied via repeated batches rather than one unbounded query. */
25
28
  const DEFAULT_BATCH_SIZE = 500;
29
+ /** Default cap on the combined size of the bodies/attachments one `ItemOperations` response embeds. */
30
+ const DEFAULT_MAX_RESPONSE_BYTES = 64 * 1024 * 1024;
31
+ /** [MS-ASCMD] ItemOperations Status 11: the requested data size is too large. */
32
+ const STATUS_TOO_LARGE = "11";
33
+ /** [MS-ASCMD] ItemOperations Status 3: server error. */
34
+ const STATUS_SERVER_ERROR = "3";
35
+ /** [MS-ASCMD] ItemOperations Status 17: the operation completed partially. */
36
+ const STATUS_PARTIAL = "17";
37
+ /** Most batches (of `mail:eas:itemoperations_batch_size` messages) one `EmptyFolderContents` deletes per request. */
38
+ export const MAX_EMPTY_FOLDER_BATCHES = 20;
26
39
  /** Truncates UTF-8 text to at most `maxBytes` bytes without splitting a multi-byte character in half - backs
27
40
  * off past any trailing UTF-8 continuation byte (`10xxxxxx`) before decoding back to a string. Only ever
28
41
  * called once the caller has already confirmed the text exceeds `maxBytes` - trusts that rather than
@@ -51,7 +64,10 @@ function truncateUtf8(text, maxBytes) {
51
64
  * `MoveItems` command's per-message `SrcFldId`/`SrcMsgId`/`DstFldId` shape. Every `Message` sharing the
52
65
  * decoded `conversationId` across the whole mailbox (not just one folder) that the caller has `UPDATE` on is
53
66
  * relocated to `DstFldId`; one lacking permission is silently skipped rather than failing the whole move (a
54
- * conversation can legitimately span folders the caller doesn't control, e.g. a shared mailbox's Inbox). An
67
+ * conversation can legitimately span folders the caller doesn't control, e.g. a shared mailbox's Inbox). The
68
+ * `ConversationId` is looked up bounded and exact-matched in memory (it derives from sender-controlled headers), and
69
+ * each message's move follows `MessageMoveRules.planMessageMove` (never into Outbox, into Drafts only for drafts, out of
70
+ * Outbox cancels the scheduled send) - a refused message counts as failed. An
55
71
  * optional `MoveAlways` (a hint to keep auto-moving future messages in this conversation) is accepted but not
56
72
  * acted on - this library's `MailFilterRule` has no conversation-scoped condition to key an ongoing rule off
57
73
  * of, a documented simplification, not silent data loss (the move itself still happens).
@@ -63,15 +79,29 @@ function truncateUtf8(text, maxBytes) {
63
79
  * command's original single-`Fetch` design, not a new gap introduced by adding multi-`Fetch` support.
64
80
  * - Only the "inline" delivery method is used (content embedded directly in the WBXML response) - the real
65
81
  * spec's "multipart" alternative (WBXML as one part, binary content as a separate part) is not implemented;
66
- * every attachment this library's own `ScanPipeline` already accepts is assumed to fit comfortably in memory
67
- * for one response, the same assumption `BaseAttachmentRoute.download()` already makes.
82
+ * the combined size of the bodies/attachments embedded in one response is capped at
83
+ * `mail:eas:itemoperations_max_response_bytes` (default 64 MB) - a Fetch that would exceed it gets Status 11
84
+ * ("data too large") instead of content. Attachment access is checked against the owning message's *current*
85
+ * folder (`Attachment.folderUid` is not updated when a message moves).
68
86
  * - `Options/BodyPreference`'s `Type`/`TruncationSize` are honored for a `Message` body fetch (plain text,
69
87
  * HTML, or - `Type 4` - the raw MIME source verbatim); byte-range fetching (`Range`) is not implemented.
70
88
  * - `EmptyFolderContents`'s `DeleteSubFolders` option is rejected outright rather than silently ignored -
71
89
  * recursive subfolder deletion is out of scope for this pragmatic subset; emptying a single folder's own
72
90
  * `Message`s is the common case this implements.
73
91
  *
74
- * `folderClass`/`messageClass`/`attachmentClass` are supplied by the Mongo/SQL concrete subclasses.
92
+ * **Bulk operations are bounded and per item**: `EmptyFolderContents` deletes at most `MAX_EMPTY_FOLDER_BATCHES`
93
+ * batches per request, and `Move` at most one batch; a message that fails to delete or move (e.g. a concurrent
94
+ * edit's version conflict) is skipped rather than failing the request, and the operation then reports Status 17
95
+ * (partial success) - or Status 3 when nothing at all succeeded - so the client can retry for the rest.
96
+ * `EmptyFolderContents` skips (as failed) a message whose send is in flight (`MessageMoveRules.hasLiveSendLease`).
97
+ *
98
+ * **Audit**: in a mailbox the caller doesn't own (restapi's `isNonOwnerAccess()` - an administrator or a delegate), a
99
+ * `Fetch` that returns a body or an attachment records one `MESSAGE_CONTENT_ACCESSED` entry per item, and
100
+ * `EmptyFolderContents` records one `MESSAGE_DELETE` entry per delete batch, listing the deleted message uids
101
+ * (`EasAuditLog`).
102
+ *
103
+ * `folderClass`/`messageClass`/`attachmentClass`/`mailboxClass`/`auditLogClass` are supplied by the Mongo/SQL concrete
104
+ * subclasses.
75
105
  *
76
106
  * @author Jean-Philippe Steinmetz
77
107
  */
@@ -79,6 +109,7 @@ export class ItemOperationsCommand {
79
109
  constructor() {
80
110
  this.command = "ItemOperations";
81
111
  this.maxFetchesPerRequest = 25;
112
+ this.maxResponseBytes = DEFAULT_MAX_RESPONSE_BYTES;
82
113
  this.batchSize = DEFAULT_BATCH_SIZE;
83
114
  }
84
115
  async init() {
@@ -94,9 +125,13 @@ export class ItemOperationsCommand {
94
125
  name: this.attachmentClass.name,
95
126
  args: [this.attachmentClass],
96
127
  });
128
+ this.mailboxRepo = await this._objectFactory.newInstance(RepoUtils, {
129
+ name: this.mailboxClass.name,
130
+ args: [this.mailboxClass],
131
+ });
97
132
  }
98
133
  async handle(ctx) {
99
- if (!this.folderRepo || !this.messageRepo || !this.attachmentRepo || !this.blobStore) {
134
+ if (!this.folderRepo || !this.messageRepo || !this.attachmentRepo || !this.mailboxRepo || !this.blobStore) {
100
135
  throw new ApiError(ApiErrors.INTERNAL_ERROR, 500, ApiErrorMessages.INTERNAL_ERROR);
101
136
  }
102
137
  const fetchEls = ctx.request ? findChildren(ctx.request, "Fetch") : [];
@@ -114,7 +149,11 @@ export class ItemOperationsCommand {
114
149
  if (fetchEls.length > this.maxFetchesPerRequest) {
115
150
  throw new ApiError(ApiErrors.INVALID_REQUEST, 400, `ItemOperations supports at most ${this.maxFetchesPerRequest} Fetch elements per request.`);
116
151
  }
152
+ const audit = new EasAuditLog({ objectFactory: this._objectFactory, auditLogClass: this.auditLogClass, mailboxRepo: this.mailboxRepo, config: this.config, logger: this.logger }, ctx, this.command);
117
153
  const responseChildren = [];
154
+ // Every fetched body/attachment is embedded inline, so their combined size bounds the response. A Fetch
155
+ // that would push it past `maxResponseBytes` is answered with Status 11 ("data too large") instead of content.
156
+ let remainingBytes = this.maxResponseBytes;
118
157
  for (const fetchEl of fetchEls) {
119
158
  const store = childText(fetchEl, "Store");
120
159
  if (store === "DocumentLibrary") {
@@ -123,12 +162,14 @@ export class ItemOperationsCommand {
123
162
  const fileReference = childText(fetchEl, "FileReference");
124
163
  const serverId = childText(fetchEl, "ServerId");
125
164
  const optionsEl = findChild(fetchEl, "Options");
126
- responseChildren.push(fileReference
127
- ? await this.fetchAttachment(ctx, fileReference)
128
- : await this.fetchMessage(ctx, serverId, optionsEl));
165
+ const fetched = fileReference
166
+ ? await this.fetchAttachment(ctx, audit, fileReference, remainingBytes)
167
+ : await this.fetchMessage(ctx, audit, serverId, optionsEl, remainingBytes);
168
+ remainingBytes -= fetched.bytes;
169
+ responseChildren.push(fetched.element);
129
170
  }
130
171
  if (emptyEl) {
131
- responseChildren.push(await this.emptyFolderContents(ctx, emptyEl));
172
+ responseChildren.push(await this.emptyFolderContents(ctx, audit, emptyEl));
132
173
  }
133
174
  if (moveEl) {
134
175
  responseChildren.push(await this.moveConversation(ctx, moveEl));
@@ -138,7 +179,7 @@ export class ItemOperationsCommand {
138
179
  element(WbxmlCodePage.ItemOperations, "Response", responseChildren),
139
180
  ]);
140
181
  }
141
- async fetchMessage(ctx, serverId, optionsEl) {
182
+ async fetchMessage(ctx, audit, serverId, optionsEl, remainingBytes) {
142
183
  if (!serverId) {
143
184
  throw new ApiError(ApiErrors.INVALID_REQUEST, 400, "Fetch requires either a ServerId or a FileReference.");
144
185
  }
@@ -181,27 +222,47 @@ export class ItemOperationsCommand {
181
222
  bodyText = truncateUtf8(bodyText, truncationSize);
182
223
  truncated = true;
183
224
  }
184
- return element(WbxmlCodePage.ItemOperations, "Fetch", [
185
- textElement(WbxmlCodePage.ItemOperations, "Status", "1"),
186
- textElement(WbxmlCodePage.AirSync, "Class", "Email"),
187
- textElement(WbxmlCodePage.AirSync, "CollectionId", message.folderUid),
188
- textElement(WbxmlCodePage.AirSync, "ServerId", serverId),
189
- element(WbxmlCodePage.ItemOperations, "Properties", [
190
- element(WbxmlCodePage.AirSyncBase, "Body", [
191
- textElement(WbxmlCodePage.AirSyncBase, "Type", bodyType),
192
- textElement(WbxmlCodePage.AirSyncBase, "EstimatedDataSize", String(estimatedDataSize)),
193
- textElement(WbxmlCodePage.AirSyncBase, "Truncated", truncated ? "1" : "0"),
194
- textElement(WbxmlCodePage.AirSyncBase, "Data", bodyText),
225
+ const bytes = Buffer.byteLength(bodyText, "utf8");
226
+ if (bytes > remainingBytes) {
227
+ return {
228
+ element: element(WbxmlCodePage.ItemOperations, "Fetch", [
229
+ textElement(WbxmlCodePage.ItemOperations, "Status", STATUS_TOO_LARGE),
230
+ textElement(WbxmlCodePage.AirSync, "ServerId", serverId),
231
+ ]),
232
+ bytes: 0,
233
+ };
234
+ }
235
+ await audit.record({
236
+ action: AuditAction.MESSAGE_CONTENT_ACCESSED,
237
+ mailboxUid: message.mailboxUid,
238
+ targetType: "Message",
239
+ targetUid: message.uid,
240
+ details: { subject: message.subject, folderUid: message.folderUid, bodyType },
241
+ });
242
+ return {
243
+ element: element(WbxmlCodePage.ItemOperations, "Fetch", [
244
+ textElement(WbxmlCodePage.ItemOperations, "Status", "1"),
245
+ textElement(WbxmlCodePage.AirSync, "Class", "Email"),
246
+ textElement(WbxmlCodePage.AirSync, "CollectionId", message.folderUid),
247
+ textElement(WbxmlCodePage.AirSync, "ServerId", serverId),
248
+ element(WbxmlCodePage.ItemOperations, "Properties", [
249
+ element(WbxmlCodePage.AirSyncBase, "Body", [
250
+ textElement(WbxmlCodePage.AirSyncBase, "Type", bodyType),
251
+ textElement(WbxmlCodePage.AirSyncBase, "EstimatedDataSize", String(estimatedDataSize)),
252
+ textElement(WbxmlCodePage.AirSyncBase, "Truncated", truncated ? "1" : "0"),
253
+ textElement(WbxmlCodePage.AirSyncBase, "Data", bodyText),
254
+ ]),
195
255
  ]),
196
256
  ]),
197
- ]);
257
+ bytes,
258
+ };
198
259
  }
199
- async emptyFolderContents(ctx, emptyEl) {
260
+ async emptyFolderContents(ctx, audit, emptyEl) {
200
261
  // Reuses AirSync's own `CollectionId` (the same tag `Sync`/`Fetch` responses already reference a
201
262
  // folder by) rather than a page-specific tag - `WbxmlCodePage.ItemOperations` has no `FolderId` token
202
263
  // of its own at all, confirmed against its own tag table.
203
- const folderUid = childText(emptyEl, "CollectionId");
204
- if (!folderUid) {
264
+ const requestedFolderUid = childText(emptyEl, "CollectionId");
265
+ if (!requestedFolderUid) {
205
266
  throw new ApiError(ApiErrors.INVALID_REQUEST, 400, "EmptyFolderContents requires a CollectionId.");
206
267
  }
207
268
  const optionsEl = findChild(emptyEl, "Options");
@@ -209,9 +270,16 @@ export class ItemOperationsCommand {
209
270
  // Documented gap, not silently ignored - see this class's own doc comment.
210
271
  throw new ApiError(ApiErrors.INVALID_REQUEST, 400, "DeleteSubFolders is not supported.");
211
272
  }
212
- if (!(await this.aclUtils.hasPermission(ctx.user, folderUid, ACLAction.DELETE))) {
273
+ if (!(await this.aclUtils.hasPermission(ctx.user, requestedFolderUid, ACLAction.DELETE))) {
213
274
  throw new ApiError(ApiErrors.AUTH_PERMISSION_FAILURE, 403, ApiErrorMessages.AUTH_PERMISSION_FAILURE);
214
275
  }
276
+ // The batch query below uses the stored folder's own uid, never the client's string, which a query parser
277
+ // could otherwise read as an operator (`ne(x)`) and match every other folder's messages with.
278
+ const folder = await this.folderRepo.findOne(requestedFolderUid, { ignoreACL: true });
279
+ if (!folder) {
280
+ throw new ApiError(ApiErrors.NOT_FOUND, 404, ApiErrorMessages.NOT_FOUND);
281
+ }
282
+ const folderUid = folder.uid;
215
283
  // Processed in bounded batches rather than one unbounded `find()` - a folder with a very large number
216
284
  // of messages would otherwise force the whole set into memory at once. Deletes within a batch still run
217
285
  // sequentially, not via `Promise.all` - the SQL backend (`better-sqlite3`) shares one connection per
@@ -220,21 +288,52 @@ export class ItemOperationsCommand {
220
288
  // theoretical). Looping (rather than a single pass) still empties the folder completely, however large -
221
289
  // a deleted row no longer matches this same `find()` (soft-deleted rows are excluded from an ordinary
222
290
  // query by default), so the loop always terminates once truly empty.
223
- for (;;) {
291
+ //
292
+ // Bounded per request (`MAX_EMPTY_FOLDER_BATCHES`), and a message that fails to delete is remembered and skipped:
293
+ // a batch in which nothing new could be deleted ends the loop instead of spinning on the same failing rows.
294
+ const failed = new Set();
295
+ let deleted = 0;
296
+ let complete = false;
297
+ for (let round = 0; round < MAX_EMPTY_FOLDER_BATCHES; round++) {
224
298
  const batch = await this.messageRepo.find({ folderUid, limit: this.batchSize }, {
225
299
  ignoreACL: true,
226
300
  limit: this.batchSize,
227
301
  });
228
- if (batch.length === 0) {
302
+ const pending = batch.filter((message) => !failed.has(message.uid));
303
+ if (pending.length === 0) {
304
+ complete = batch.length === 0;
229
305
  break;
230
306
  }
231
- for (const message of batch) {
232
- await this.messageRepo.delete(message.uid, { ignoreACL: true, user: ctx.user });
307
+ const deletedUids = [];
308
+ for (const message of pending) {
309
+ // A message whose send is in flight is skipped, as restapi's delete refuses it (409).
310
+ if (hasLiveSendLease(message)) {
311
+ failed.add(message.uid);
312
+ continue;
313
+ }
314
+ try {
315
+ await this.messageRepo.delete(message.uid, { ignoreACL: true, user: ctx.user });
316
+ deletedUids.push(message.uid);
317
+ }
318
+ catch {
319
+ failed.add(message.uid);
320
+ }
321
+ }
322
+ deleted += deletedUids.length;
323
+ if (deletedUids.length > 0) {
324
+ // One entry per batch (at most `batchSize` uids), not one per message: emptying a large folder would
325
+ // otherwise write thousands of rows for one request.
326
+ await audit.record({
327
+ action: AuditAction.MESSAGE_DELETE,
328
+ mailboxUid: folder.mailboxUid,
329
+ targetType: "Folder",
330
+ targetUid: folderUid,
331
+ details: { operation: "EmptyFolderContents", count: deletedUids.length, messageUids: deletedUids },
332
+ });
233
333
  }
234
334
  }
235
- return element(WbxmlCodePage.ItemOperations, "EmptyFolderContents", [
236
- textElement(WbxmlCodePage.ItemOperations, "Status", "1"),
237
- ]);
335
+ const status = complete && failed.size === 0 ? "1" : deleted === 0 ? STATUS_SERVER_ERROR : STATUS_PARTIAL;
336
+ return element(WbxmlCodePage.ItemOperations, "EmptyFolderContents", [textElement(WbxmlCodePage.ItemOperations, "Status", status)]);
238
337
  }
239
338
  /**
240
339
  * Handles `ItemOperations`' `Move`: relocates every `Message` sharing a decoded `ConversationId` to
@@ -257,10 +356,16 @@ export class ItemOperationsCommand {
257
356
  !(await this.aclUtils.hasPermission(ctx.user, dstFldId, ACLAction.CREATE))) {
258
357
  return this.moveResponse("3");
259
358
  }
260
- const conversationId = decodeConversationId(conversationIdEl.opaque);
359
+ // The ConversationId is the device's echo of `Message.conversationId`, which comes from sender-controlled
360
+ // `References`/`In-Reply-To` headers: looked up bounded (as restapi stores it) as a `ModelUtils.literal()`, so a
361
+ // value shaped like a query operator (`ne(x)`) is compared as itself, and still exact-matched in memory.
362
+ const conversationId = boundIndexedValue(decodeConversationId(conversationIdEl.opaque));
261
363
  // Capped rather than an unbounded `find()` - an unusually long-running thread could otherwise return an
262
364
  // unbounded number of rows for one request.
263
- const messages = await this.messageRepo.find({ mailboxUid: ctx.mailboxUid, conversationId, limit: this.batchSize }, { ignoreACL: true, limit: this.batchSize });
365
+ const messages = (await this.messageRepo.find({ mailboxUid: ctx.mailboxUid, conversationId: ModelUtils.literal(conversationId), limit: this.batchSize }, {
366
+ ignoreACL: true,
367
+ limit: this.batchSize,
368
+ })).filter((message) => message.conversationId === conversationId && message.mailboxUid === ctx.mailboxUid);
264
369
  if (messages.length === 0) {
265
370
  return this.moveResponse("3");
266
371
  }
@@ -270,20 +375,36 @@ export class ItemOperationsCommand {
270
375
  // transaction within a transaction" (confirmed against real SQL test failures, not theoretical) -
271
376
  // updates run sequentially in a plain loop instead.
272
377
  const permitted = await Promise.all(messages.map((message) => this.aclUtils.hasPermission(ctx.user, message.folderUid, ACLAction.UPDATE)));
273
- let movedAny = false;
378
+ const folderTypes = new Map();
379
+ let moved = 0;
380
+ let failed = 0;
274
381
  for (let i = 0; i < messages.length; i++) {
382
+ const message = messages[i];
275
383
  if (!permitted[i]) {
276
384
  continue;
277
385
  }
278
- const message = messages[i];
279
- await this.messageRepo.update({ uid: message.uid, version: message.version, folderUid: dstFldId }, message, { ignoreACL: true, user: ctx.user });
280
- movedAny = true;
386
+ if (!folderTypes.has(message.folderUid)) {
387
+ folderTypes.set(message.folderUid, (await this.folderRepo.findOne(message.folderUid, { ignoreACL: true }))?.type);
388
+ }
389
+ // Outbox, or Drafts for a message that isn't a draft, is refused per message - see `planMessageMove()`.
390
+ const plan = planMessageMove(message, folderTypes.get(message.folderUid), destFolder.type);
391
+ if (!plan.allowed) {
392
+ failed++;
393
+ continue;
394
+ }
395
+ try {
396
+ await this.messageRepo.update({ uid: message.uid, version: message.version, folderUid: dstFldId, ...plan.patch }, asEntity(this.messageRepo, message), { ignoreACL: true, user: ctx.user });
397
+ moved++;
398
+ }
399
+ catch {
400
+ failed++;
401
+ }
281
402
  }
282
- if (!movedAny) {
403
+ if (moved === 0) {
283
404
  return this.moveResponse("3");
284
405
  }
285
406
  return element(WbxmlCodePage.ItemOperations, "Move", [
286
- textElement(WbxmlCodePage.ItemOperations, "Status", "1"),
407
+ textElement(WbxmlCodePage.ItemOperations, "Status", failed > 0 ? STATUS_PARTIAL : "1"),
287
408
  textElement(WbxmlCodePage.ItemOperations, "DstFldId", dstFldId),
288
409
  opaqueElement(WbxmlCodePage.ItemOperations, "ConversationId", conversationIdEl.opaque),
289
410
  ]);
@@ -291,27 +412,65 @@ export class ItemOperationsCommand {
291
412
  moveResponse(status) {
292
413
  return element(WbxmlCodePage.ItemOperations, "Move", [textElement(WbxmlCodePage.ItemOperations, "Status", status)]);
293
414
  }
294
- async fetchAttachment(ctx, fileReference) {
415
+ async fetchAttachment(ctx, audit, fileReference, remainingBytes) {
295
416
  const attachment = await this.attachmentRepo.findOne(fileReference, { ignoreACL: true });
296
417
  if (!attachment) {
297
418
  throw new ApiError(ApiErrors.NOT_FOUND, 404, ApiErrorMessages.NOT_FOUND);
298
419
  }
299
- if (!(await this.aclUtils.hasPermission(ctx.user, attachment.folderUid, ACLAction.READ))) {
420
+ // Access follows the message as it is filed *now*: `Attachment.folderUid` is denormalized and is not
421
+ // updated when the message is moved, so it can point at a folder the message has since left.
422
+ const message = await this.messageRepo.findOne(attachment.messageUid, { ignoreACL: true });
423
+ if (!message) {
424
+ throw new ApiError(ApiErrors.NOT_FOUND, 404, ApiErrorMessages.NOT_FOUND);
425
+ }
426
+ if (!(await this.aclUtils.hasPermission(ctx.user, message.folderUid, ACLAction.READ))) {
300
427
  throw new ApiError(ApiErrors.AUTH_PERMISSION_FAILURE, 403, ApiErrorMessages.AUTH_PERMISSION_FAILURE);
301
428
  }
302
- const content = await this.blobStore.get(attachment.blobKey);
303
- return element(WbxmlCodePage.ItemOperations, "Fetch", [
304
- textElement(WbxmlCodePage.ItemOperations, "Status", "1"),
305
- textElement(WbxmlCodePage.AirSyncBase, "FileReference", fileReference),
306
- element(WbxmlCodePage.ItemOperations, "Properties", [
307
- textElement(WbxmlCodePage.AirSyncBase, "ContentType", attachment.mimeType),
308
- // "Inline" delivery per MS-ASCMD: binary content is base64-encoded and embedded directly in the
309
- // WBXML, rather than this library's own opaque/binary element type.
310
- textElement(WbxmlCodePage.ItemOperations, "Data", content.toString("base64")),
429
+ const tooLarge = () => ({
430
+ element: element(WbxmlCodePage.ItemOperations, "Fetch", [
431
+ textElement(WbxmlCodePage.ItemOperations, "Status", STATUS_TOO_LARGE),
432
+ textElement(WbxmlCodePage.AirSyncBase, "FileReference", fileReference),
311
433
  ]),
312
- ]);
434
+ bytes: 0,
435
+ });
436
+ // Checked against the recorded size first, so an oversized attachment is never even loaded.
437
+ if (Math.ceil(attachment.sizeBytes / 3) * 4 > remainingBytes) {
438
+ return tooLarge();
439
+ }
440
+ const data = (await this.blobStore.get(attachment.blobKey)).toString("base64");
441
+ if (data.length > remainingBytes) {
442
+ return tooLarge();
443
+ }
444
+ await audit.record({
445
+ action: AuditAction.MESSAGE_CONTENT_ACCESSED,
446
+ mailboxUid: message.mailboxUid,
447
+ targetType: "Attachment",
448
+ targetUid: attachment.uid,
449
+ details: { messageUid: attachment.messageUid, subject: message.subject, filename: attachment.filename },
450
+ });
451
+ return {
452
+ element: element(WbxmlCodePage.ItemOperations, "Fetch", [
453
+ textElement(WbxmlCodePage.ItemOperations, "Status", "1"),
454
+ textElement(WbxmlCodePage.AirSyncBase, "FileReference", fileReference),
455
+ element(WbxmlCodePage.ItemOperations, "Properties", [
456
+ textElement(WbxmlCodePage.AirSyncBase, "ContentType", attachment.mimeType),
457
+ // "Inline" delivery per MS-ASCMD: binary content is base64-encoded and embedded directly in the
458
+ // WBXML, rather than this library's own opaque/binary element type.
459
+ textElement(WbxmlCodePage.ItemOperations, "Data", data),
460
+ ]),
461
+ ]),
462
+ bytes: data.length,
463
+ };
313
464
  }
314
465
  }
466
+ __decorate([
467
+ Config(),
468
+ __metadata("design:type", Object)
469
+ ], ItemOperationsCommand.prototype, "config", void 0);
470
+ __decorate([
471
+ Logger,
472
+ __metadata("design:type", Object)
473
+ ], ItemOperationsCommand.prototype, "logger", void 0);
315
474
  __decorate([
316
475
  Inject("BlobStore"),
317
476
  __metadata("design:type", Object)
@@ -324,6 +483,10 @@ __decorate([
324
483
  Config("mail:eas:itemoperations_max_fetch", 25),
325
484
  __metadata("design:type", Number)
326
485
  ], ItemOperationsCommand.prototype, "maxFetchesPerRequest", void 0);
486
+ __decorate([
487
+ Config("mail:eas:itemoperations_max_response_bytes", DEFAULT_MAX_RESPONSE_BYTES),
488
+ __metadata("design:type", Number)
489
+ ], ItemOperationsCommand.prototype, "maxResponseBytes", void 0);
327
490
  __decorate([
328
491
  Config("mail:eas:itemoperations_batch_size", DEFAULT_BATCH_SIZE),
329
492
  __metadata("design:type", Number)
@@ -1 +1 @@
1
- {"version":3,"file":"ItemOperationsCommand.js","sourceRoot":"","sources":["../../../src/commands/ItemOperationsCommand.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,mCAAmC;AACnC,+EAA+E;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAiB,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACrH,OAAO,EAAa,oBAAoB,EAA8C,MAAM,kBAAkB,CAAC;AAC/G,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAqB,MAAM,0BAA0B,CAAC;AACtI,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAAC;AAElD;;mEAEmE;AACnE,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAE/B;;;0BAG0B;AAC1B,SAAS,YAAY,CAAC,IAAY,EAAE,QAAgB;IAChD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