@rapidmx/activesync-plugin 1.0.0-beta.2

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 (225) hide show
  1. package/LICENSE +382 -0
  2. package/README.md +57 -0
  3. package/dist/lib/BaseDeviceSyncStateRoute.js +90 -0
  4. package/dist/lib/BaseDeviceSyncStateRoute.js.map +1 -0
  5. package/dist/lib/BaseEasRoute.js +213 -0
  6. package/dist/lib/BaseEasRoute.js.map +1 -0
  7. package/dist/lib/CompactDateTime.js +43 -0
  8. package/dist/lib/CompactDateTime.js.map +1 -0
  9. package/dist/lib/EasCommandHandler.js +2 -0
  10. package/dist/lib/EasCommandHandler.js.map +1 -0
  11. package/dist/lib/EasSyncKeyUtils.js +119 -0
  12. package/dist/lib/EasSyncKeyUtils.js.map +1 -0
  13. package/dist/lib/adapters/CalendarSyncAdapter.js +255 -0
  14. package/dist/lib/adapters/CalendarSyncAdapter.js.map +1 -0
  15. package/dist/lib/adapters/ContactsSyncAdapter.js +164 -0
  16. package/dist/lib/adapters/ContactsSyncAdapter.js.map +1 -0
  17. package/dist/lib/adapters/EasCollectionSyncAdapter.js +2 -0
  18. package/dist/lib/adapters/EasCollectionSyncAdapter.js.map +1 -0
  19. package/dist/lib/adapters/EmailSyncAdapter.js +269 -0
  20. package/dist/lib/adapters/EmailSyncAdapter.js.map +1 -0
  21. package/dist/lib/adapters/TasksSyncAdapter.js +100 -0
  22. package/dist/lib/adapters/TasksSyncAdapter.js.map +1 -0
  23. package/dist/lib/adapters/mongo/EmailSyncAdapterMongo.js +16 -0
  24. package/dist/lib/adapters/mongo/EmailSyncAdapterMongo.js.map +1 -0
  25. package/dist/lib/adapters/mongo/index.js +6 -0
  26. package/dist/lib/adapters/mongo/index.js.map +1 -0
  27. package/dist/lib/adapters/sql/EmailSyncAdapterSQL.js +16 -0
  28. package/dist/lib/adapters/sql/EmailSyncAdapterSQL.js.map +1 -0
  29. package/dist/lib/adapters/sql/index.js +6 -0
  30. package/dist/lib/adapters/sql/index.js.map +1 -0
  31. package/dist/lib/codec/WbxmlCodePages.js +706 -0
  32. package/dist/lib/codec/WbxmlCodePages.js.map +1 -0
  33. package/dist/lib/codec/WbxmlDecoder.js +154 -0
  34. package/dist/lib/codec/WbxmlDecoder.js.map +1 -0
  35. package/dist/lib/codec/WbxmlElement.js +31 -0
  36. package/dist/lib/codec/WbxmlElement.js.map +1 -0
  37. package/dist/lib/codec/WbxmlEncoder.js +88 -0
  38. package/dist/lib/codec/WbxmlEncoder.js.map +1 -0
  39. package/dist/lib/commands/ComposeMailCommand.js +187 -0
  40. package/dist/lib/commands/ComposeMailCommand.js.map +1 -0
  41. package/dist/lib/commands/FolderSyncCommand.js +155 -0
  42. package/dist/lib/commands/FolderSyncCommand.js.map +1 -0
  43. package/dist/lib/commands/GetItemEstimateCommand.js +149 -0
  44. package/dist/lib/commands/GetItemEstimateCommand.js.map +1 -0
  45. package/dist/lib/commands/ItemOperationsCommand.js +337 -0
  46. package/dist/lib/commands/ItemOperationsCommand.js.map +1 -0
  47. package/dist/lib/commands/MeetingResponseCommand.js +120 -0
  48. package/dist/lib/commands/MeetingResponseCommand.js.map +1 -0
  49. package/dist/lib/commands/MoveItemsCommand.js +103 -0
  50. package/dist/lib/commands/MoveItemsCommand.js.map +1 -0
  51. package/dist/lib/commands/PingCommand.js +145 -0
  52. package/dist/lib/commands/PingCommand.js.map +1 -0
  53. package/dist/lib/commands/ProvisionCommand.js +164 -0
  54. package/dist/lib/commands/ProvisionCommand.js.map +1 -0
  55. package/dist/lib/commands/ResolveRecipientsCommand.js +123 -0
  56. package/dist/lib/commands/ResolveRecipientsCommand.js.map +1 -0
  57. package/dist/lib/commands/SearchCommand.js +234 -0
  58. package/dist/lib/commands/SearchCommand.js.map +1 -0
  59. package/dist/lib/commands/SendMailCommand.js +18 -0
  60. package/dist/lib/commands/SendMailCommand.js.map +1 -0
  61. package/dist/lib/commands/SettingsCommand.js +138 -0
  62. package/dist/lib/commands/SettingsCommand.js.map +1 -0
  63. package/dist/lib/commands/SmartForwardCommand.js +22 -0
  64. package/dist/lib/commands/SmartForwardCommand.js.map +1 -0
  65. package/dist/lib/commands/SmartReplyCommand.js +22 -0
  66. package/dist/lib/commands/SmartReplyCommand.js.map +1 -0
  67. package/dist/lib/commands/SyncCommand.js +406 -0
  68. package/dist/lib/commands/SyncCommand.js.map +1 -0
  69. package/dist/lib/commands/mongo/FolderSyncCommandMongo.js +16 -0
  70. package/dist/lib/commands/mongo/FolderSyncCommandMongo.js.map +1 -0
  71. package/dist/lib/commands/mongo/GetItemEstimateCommandMongo.js +21 -0
  72. package/dist/lib/commands/mongo/GetItemEstimateCommandMongo.js.map +1 -0
  73. package/dist/lib/commands/mongo/ItemOperationsCommandMongo.js +18 -0
  74. package/dist/lib/commands/mongo/ItemOperationsCommandMongo.js.map +1 -0
  75. package/dist/lib/commands/mongo/MeetingResponseCommandMongo.js +17 -0
  76. package/dist/lib/commands/mongo/MeetingResponseCommandMongo.js.map +1 -0
  77. package/dist/lib/commands/mongo/MoveItemsCommandMongo.js +17 -0
  78. package/dist/lib/commands/mongo/MoveItemsCommandMongo.js.map +1 -0
  79. package/dist/lib/commands/mongo/ResolveRecipientsCommandMongo.js +16 -0
  80. package/dist/lib/commands/mongo/ResolveRecipientsCommandMongo.js.map +1 -0
  81. package/dist/lib/commands/mongo/SearchCommandMongo.js +19 -0
  82. package/dist/lib/commands/mongo/SearchCommandMongo.js.map +1 -0
  83. package/dist/lib/commands/mongo/SendMailCommandMongo.js +17 -0
  84. package/dist/lib/commands/mongo/SendMailCommandMongo.js.map +1 -0
  85. package/dist/lib/commands/mongo/SettingsCommandMongo.js +16 -0
  86. package/dist/lib/commands/mongo/SettingsCommandMongo.js.map +1 -0
  87. package/dist/lib/commands/mongo/SmartForwardCommandMongo.js +17 -0
  88. package/dist/lib/commands/mongo/SmartForwardCommandMongo.js.map +1 -0
  89. package/dist/lib/commands/mongo/SmartReplyCommandMongo.js +17 -0
  90. package/dist/lib/commands/mongo/SmartReplyCommandMongo.js.map +1 -0
  91. package/dist/lib/commands/mongo/SyncCommandMongo.js +26 -0
  92. package/dist/lib/commands/mongo/SyncCommandMongo.js.map +1 -0
  93. package/dist/lib/commands/mongo/index.js +14 -0
  94. package/dist/lib/commands/mongo/index.js.map +1 -0
  95. package/dist/lib/commands/sql/FolderSyncCommandSQL.js +16 -0
  96. package/dist/lib/commands/sql/FolderSyncCommandSQL.js.map +1 -0
  97. package/dist/lib/commands/sql/GetItemEstimateCommandSQL.js +21 -0
  98. package/dist/lib/commands/sql/GetItemEstimateCommandSQL.js.map +1 -0
  99. package/dist/lib/commands/sql/ItemOperationsCommandSQL.js +18 -0
  100. package/dist/lib/commands/sql/ItemOperationsCommandSQL.js.map +1 -0
  101. package/dist/lib/commands/sql/MeetingResponseCommandSQL.js +17 -0
  102. package/dist/lib/commands/sql/MeetingResponseCommandSQL.js.map +1 -0
  103. package/dist/lib/commands/sql/MoveItemsCommandSQL.js +17 -0
  104. package/dist/lib/commands/sql/MoveItemsCommandSQL.js.map +1 -0
  105. package/dist/lib/commands/sql/ResolveRecipientsCommandSQL.js +16 -0
  106. package/dist/lib/commands/sql/ResolveRecipientsCommandSQL.js.map +1 -0
  107. package/dist/lib/commands/sql/SearchCommandSQL.js +19 -0
  108. package/dist/lib/commands/sql/SearchCommandSQL.js.map +1 -0
  109. package/dist/lib/commands/sql/SendMailCommandSQL.js +17 -0
  110. package/dist/lib/commands/sql/SendMailCommandSQL.js.map +1 -0
  111. package/dist/lib/commands/sql/SettingsCommandSQL.js +16 -0
  112. package/dist/lib/commands/sql/SettingsCommandSQL.js.map +1 -0
  113. package/dist/lib/commands/sql/SmartForwardCommandSQL.js +17 -0
  114. package/dist/lib/commands/sql/SmartForwardCommandSQL.js.map +1 -0
  115. package/dist/lib/commands/sql/SmartReplyCommandSQL.js +17 -0
  116. package/dist/lib/commands/sql/SmartReplyCommandSQL.js.map +1 -0
  117. package/dist/lib/commands/sql/SyncCommandSQL.js +26 -0
  118. package/dist/lib/commands/sql/SyncCommandSQL.js.map +1 -0
  119. package/dist/lib/commands/sql/index.js +14 -0
  120. package/dist/lib/commands/sql/index.js.map +1 -0
  121. package/dist/lib/index.js +58 -0
  122. package/dist/lib/index.js.map +1 -0
  123. package/dist/lib/jobs/EasDeviceStateCleanupJob.js +101 -0
  124. package/dist/lib/jobs/EasDeviceStateCleanupJob.js.map +1 -0
  125. package/dist/lib/jobs/mongo/EasDeviceStateCleanupJobMongo.js +13 -0
  126. package/dist/lib/jobs/mongo/EasDeviceStateCleanupJobMongo.js.map +1 -0
  127. package/dist/lib/jobs/sql/EasDeviceStateCleanupJobSQL.js +13 -0
  128. package/dist/lib/jobs/sql/EasDeviceStateCleanupJobSQL.js.map +1 -0
  129. package/dist/lib/models/DeviceSyncState.js +2 -0
  130. package/dist/lib/models/DeviceSyncState.js.map +1 -0
  131. package/dist/lib/models/mongo/DeviceSyncStateMongo.js +130 -0
  132. package/dist/lib/models/mongo/DeviceSyncStateMongo.js.map +1 -0
  133. package/dist/lib/models/sql/DeviceSyncStateSQL.js +130 -0
  134. package/dist/lib/models/sql/DeviceSyncStateSQL.js.map +1 -0
  135. package/dist/lib/mongo/DeviceSyncStateRouteMongo.js +28 -0
  136. package/dist/lib/mongo/DeviceSyncStateRouteMongo.js.map +1 -0
  137. package/dist/lib/mongo/EasRouteMongo.js +63 -0
  138. package/dist/lib/mongo/EasRouteMongo.js.map +1 -0
  139. package/dist/lib/mongo/index.js +9 -0
  140. package/dist/lib/mongo/index.js.map +1 -0
  141. package/dist/lib/mongo.js +15 -0
  142. package/dist/lib/mongo.js.map +1 -0
  143. package/dist/lib/sql/DeviceSyncStateRouteSQL.js +28 -0
  144. package/dist/lib/sql/DeviceSyncStateRouteSQL.js.map +1 -0
  145. package/dist/lib/sql/EasRouteSQL.js +63 -0
  146. package/dist/lib/sql/EasRouteSQL.js.map +1 -0
  147. package/dist/lib/sql/index.js +9 -0
  148. package/dist/lib/sql/index.js.map +1 -0
  149. package/dist/lib/sql.js +15 -0
  150. package/dist/lib/sql.js.map +1 -0
  151. package/dist/types/BaseDeviceSyncStateRoute.d.ts +34 -0
  152. package/dist/types/BaseEasRoute.d.ts +65 -0
  153. package/dist/types/CompactDateTime.d.ts +22 -0
  154. package/dist/types/EasCommandHandler.d.ts +59 -0
  155. package/dist/types/EasSyncKeyUtils.d.ts +89 -0
  156. package/dist/types/adapters/CalendarSyncAdapter.d.ts +52 -0
  157. package/dist/types/adapters/ContactsSyncAdapter.d.ts +33 -0
  158. package/dist/types/adapters/EasCollectionSyncAdapter.d.ts +55 -0
  159. package/dist/types/adapters/EmailSyncAdapter.d.ts +71 -0
  160. package/dist/types/adapters/TasksSyncAdapter.d.ts +32 -0
  161. package/dist/types/adapters/mongo/EmailSyncAdapterMongo.d.ts +7 -0
  162. package/dist/types/adapters/mongo/index.d.ts +1 -0
  163. package/dist/types/adapters/sql/EmailSyncAdapterSQL.d.ts +7 -0
  164. package/dist/types/adapters/sql/index.d.ts +1 -0
  165. package/dist/types/codec/WbxmlCodePages.d.ts +45 -0
  166. package/dist/types/codec/WbxmlDecoder.d.ts +33 -0
  167. package/dist/types/codec/WbxmlElement.d.ts +43 -0
  168. package/dist/types/codec/WbxmlEncoder.d.ts +20 -0
  169. package/dist/types/commands/ComposeMailCommand.d.ts +50 -0
  170. package/dist/types/commands/FolderSyncCommand.d.ts +25 -0
  171. package/dist/types/commands/GetItemEstimateCommand.d.ts +43 -0
  172. package/dist/types/commands/ItemOperationsCommand.d.ts +72 -0
  173. package/dist/types/commands/MeetingResponseCommand.d.ts +32 -0
  174. package/dist/types/commands/MoveItemsCommand.d.ts +29 -0
  175. package/dist/types/commands/PingCommand.d.ts +33 -0
  176. package/dist/types/commands/ProvisionCommand.d.ts +54 -0
  177. package/dist/types/commands/ResolveRecipientsCommand.d.ts +36 -0
  178. package/dist/types/commands/SearchCommand.d.ts +60 -0
  179. package/dist/types/commands/SendMailCommand.d.ts +10 -0
  180. package/dist/types/commands/SettingsCommand.d.ts +37 -0
  181. package/dist/types/commands/SmartForwardCommand.d.ts +17 -0
  182. package/dist/types/commands/SmartReplyCommand.d.ts +17 -0
  183. package/dist/types/commands/SyncCommand.d.ts +100 -0
  184. package/dist/types/commands/mongo/FolderSyncCommandMongo.d.ts +8 -0
  185. package/dist/types/commands/mongo/GetItemEstimateCommandMongo.d.ts +7 -0
  186. package/dist/types/commands/mongo/ItemOperationsCommandMongo.d.ts +9 -0
  187. package/dist/types/commands/mongo/MeetingResponseCommandMongo.d.ts +8 -0
  188. package/dist/types/commands/mongo/MoveItemsCommandMongo.d.ts +8 -0
  189. package/dist/types/commands/mongo/ResolveRecipientsCommandMongo.d.ts +7 -0
  190. package/dist/types/commands/mongo/SearchCommandMongo.d.ts +9 -0
  191. package/dist/types/commands/mongo/SendMailCommandMongo.d.ts +8 -0
  192. package/dist/types/commands/mongo/SettingsCommandMongo.d.ts +7 -0
  193. package/dist/types/commands/mongo/SmartForwardCommandMongo.d.ts +8 -0
  194. package/dist/types/commands/mongo/SmartReplyCommandMongo.d.ts +8 -0
  195. package/dist/types/commands/mongo/SyncCommandMongo.d.ts +8 -0
  196. package/dist/types/commands/mongo/index.d.ts +9 -0
  197. package/dist/types/commands/sql/FolderSyncCommandSQL.d.ts +8 -0
  198. package/dist/types/commands/sql/GetItemEstimateCommandSQL.d.ts +7 -0
  199. package/dist/types/commands/sql/ItemOperationsCommandSQL.d.ts +9 -0
  200. package/dist/types/commands/sql/MeetingResponseCommandSQL.d.ts +8 -0
  201. package/dist/types/commands/sql/MoveItemsCommandSQL.d.ts +8 -0
  202. package/dist/types/commands/sql/ResolveRecipientsCommandSQL.d.ts +7 -0
  203. package/dist/types/commands/sql/SearchCommandSQL.d.ts +9 -0
  204. package/dist/types/commands/sql/SendMailCommandSQL.d.ts +8 -0
  205. package/dist/types/commands/sql/SettingsCommandSQL.d.ts +7 -0
  206. package/dist/types/commands/sql/SmartForwardCommandSQL.d.ts +8 -0
  207. package/dist/types/commands/sql/SmartReplyCommandSQL.d.ts +8 -0
  208. package/dist/types/commands/sql/SyncCommandSQL.d.ts +8 -0
  209. package/dist/types/commands/sql/index.d.ts +9 -0
  210. package/dist/types/index.d.ts +53 -0
  211. package/dist/types/jobs/EasDeviceStateCleanupJob.d.ts +26 -0
  212. package/dist/types/jobs/mongo/EasDeviceStateCleanupJobMongo.d.ts +5 -0
  213. package/dist/types/jobs/sql/EasDeviceStateCleanupJobSQL.d.ts +5 -0
  214. package/dist/types/models/DeviceSyncState.d.ts +30 -0
  215. package/dist/types/models/mongo/DeviceSyncStateMongo.d.ts +22 -0
  216. package/dist/types/models/sql/DeviceSyncStateSQL.d.ts +22 -0
  217. package/dist/types/mongo/DeviceSyncStateRouteMongo.d.ts +8 -0
  218. package/dist/types/mongo/EasRouteMongo.d.ts +14 -0
  219. package/dist/types/mongo/index.d.ts +4 -0
  220. package/dist/types/mongo.d.ts +10 -0
  221. package/dist/types/sql/DeviceSyncStateRouteSQL.d.ts +8 -0
  222. package/dist/types/sql/EasRouteSQL.d.ts +14 -0
  223. package/dist/types/sql/index.d.ts +4 -0
  224. package/dist/types/sql.d.ts +10 -0
  225. package/package.json +238 -0
@@ -0,0 +1,101 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ ///////////////////////////////////////////////////////////////////////////////
11
+ // Copyright (C) 2026 Jean-Philippe Steinmetz. All rights reserved.
12
+ // SPDX-License-Identifier: MPL-2.0
13
+ ///////////////////////////////////////////////////////////////////////////////
14
+ import { ObjectDecorators } from "@rapidrest/core";
15
+ import { BackgroundService, RepoUtils } from "@rapidrest/service-core";
16
+ const { Config, Init, Logger } = ObjectDecorators;
17
+ /**
18
+ * Prunes `DeviceSyncState` rows for EAS devices that haven't synced in more than `device_ttl_days` days (or
19
+ * that have never successfully synced at all), keeping the collection from growing unbounded with abandoned
20
+ * device pairings.
21
+ *
22
+ * Concrete entity classes are supplied by the Mongo/SQL subclasses (`EasDeviceStateCleanupJobMongo`/
23
+ * `EasDeviceStateCleanupJobSQL`), following the same generic pattern `ScanQueueJob` uses.
24
+ *
25
+ * @author Jean-Philippe Steinmetz
26
+ */
27
+ export class EasDeviceStateCleanupJob extends BackgroundService {
28
+ constructor() {
29
+ super(...arguments);
30
+ this.scheduleExpr = "0 0 4 * * *";
31
+ this.batchSize = 500;
32
+ this.deviceTtlDays = 90;
33
+ }
34
+ get schedule() {
35
+ return this.scheduleExpr;
36
+ }
37
+ async init() {
38
+ this.deviceSyncStateRepo = await this._objectFactory.newInstance(RepoUtils, {
39
+ name: this.deviceSyncStateClass.name,
40
+ args: [this.deviceSyncStateClass],
41
+ });
42
+ }
43
+ async start() {
44
+ // Nothing to do at startup beyond `init()` above; processing happens entirely in `run()`.
45
+ }
46
+ stop() {
47
+ // Do nothing
48
+ }
49
+ async run() {
50
+ if (!this.deviceSyncStateRepo) {
51
+ return;
52
+ }
53
+ const cutoff = new Date(Date.now() - this.deviceTtlDays * 24 * 60 * 60 * 1000);
54
+ // `ModelUtils.buildSearchQuery` supports single-sided `lt(...)` comparisons with correct Date
55
+ // coercion on both backends, so the "stale" half of this job's criteria is pushed into the query. The
56
+ // "never synced at all" half (`lastSyncAt` unset) is a separate, plain-equality query rather than an
57
+ // `$or` of the two — `$or` support isn't confirmed identical across both backends' query builders, and
58
+ // a second bounded query is just as cheap for a low-frequency daily cleanup job.
59
+ //
60
+ // `limit` is passed both via `options` (all the Mongo backend of `RepoUtils.find()` actually reads)
61
+ // *and* baked into each query object (all `ModelUtils.buildSearchQuerySQL` reads - it ignores
62
+ // `options.limit` entirely and falls back to its own default of 100 otherwise). Confirmed by
63
+ // real-database testing: on the SQL backend, `options.limit` alone silently caps at 100 regardless of
64
+ // the configured batch size.
65
+ const [stale, neverSynced] = await Promise.all([
66
+ this.deviceSyncStateRepo.find({ lastSyncAt: `lt(${cutoff.toISOString()})`, limit: this.batchSize }, { ignoreACL: true, limit: this.batchSize }),
67
+ this.deviceSyncStateRepo.find({ lastSyncAt: null, limit: this.batchSize }, { ignoreACL: true, limit: this.batchSize }),
68
+ ]);
69
+ for (const row of [...stale, ...neverSynced]) {
70
+ try {
71
+ await this.deviceSyncStateRepo.delete(row.uid, { ignoreACL: true, purge: true });
72
+ }
73
+ catch (err) {
74
+ this.logger?.warn(`EasDeviceStateCleanupJob: failed to delete stale device sync state ${row.uid}: ${err.message}`);
75
+ }
76
+ }
77
+ }
78
+ }
79
+ __decorate([
80
+ Config("mail:jobs:eas_device_cleanup:schedule", "0 0 4 * * *"),
81
+ __metadata("design:type", String)
82
+ ], EasDeviceStateCleanupJob.prototype, "scheduleExpr", void 0);
83
+ __decorate([
84
+ Config("mail:jobs:eas_device_cleanup:batch_size", 500),
85
+ __metadata("design:type", Number)
86
+ ], EasDeviceStateCleanupJob.prototype, "batchSize", void 0);
87
+ __decorate([
88
+ Config("mail:jobs:eas_device_cleanup:device_ttl_days", 90),
89
+ __metadata("design:type", Number)
90
+ ], EasDeviceStateCleanupJob.prototype, "deviceTtlDays", void 0);
91
+ __decorate([
92
+ Logger,
93
+ __metadata("design:type", Object)
94
+ ], EasDeviceStateCleanupJob.prototype, "logger", void 0);
95
+ __decorate([
96
+ Init,
97
+ __metadata("design:type", Function),
98
+ __metadata("design:paramtypes", []),
99
+ __metadata("design:returntype", Promise)
100
+ ], EasDeviceStateCleanupJob.prototype, "init", null);
101
+ //# sourceMappingURL=EasDeviceStateCleanupJob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EasDeviceStateCleanupJob.js","sourceRoot":"","sources":["../../../src/jobs/EasDeviceStateCleanupJob.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,mCAAmC;AACnC,+EAA+E;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAiB,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEtF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAAC;AAElD;;;;;;;;;GASG;AACH,MAAM,OAAgB,wBAAoD,SAAQ,iBAAiB;IAAnG;;QASY,iBAAY,GAAW,aAAa,CAAC;QAGrC,cAAS,GAAW,GAAG,CAAC;QAGxB,kBAAa,GAAW,EAAE,CAAC;IA8DvC,CAAC;IAzDG,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAGY,AAAN,KAAK,CAAC,IAAI;QACb,IAAI,CAAC,mBAAmB,GAAG,MAAM,IAAI,CAAC,cAAe,CAAC,WAAW,CAAC,SAAS,EAAE;YACzE,IAAI,EAAE,IAAI,CAAC,oBAAoB,CAAC,IAAI;YACpC,IAAI,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC;SACpC,CAAC,CAAC;IACP,CAAC;IAEM,KAAK,CAAC,KAAK;QACd,0FAA0F;IAC9F,CAAC;IAEM,IAAI;QACP,aAAa;IACjB,CAAC;IAEM,KAAK,CAAC,GAAG;QACZ,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC5B,OAAO;QACX,CAAC;QAED,MAAM,MAAM,GAAS,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI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vB;AAGxB;IADP,MAAM,CAAC,8CAA8C,EAAE,EAAE,CAAC;;+DACxB;AAG3B;IADP,MAAM;;wDACa;AAOP;IADZ,IAAI;;;;oDAMJ"}
@@ -0,0 +1,13 @@
1
+ ///////////////////////////////////////////////////////////////////////////////
2
+ // Copyright (C) 2026 Jean-Philippe Steinmetz. All rights reserved.
3
+ // SPDX-License-Identifier: MPL-2.0
4
+ ///////////////////////////////////////////////////////////////////////////////
5
+ import { EasDeviceStateCleanupJob } from "../EasDeviceStateCleanupJob.js";
6
+ import { DeviceSyncStateMongo } from "../../models/mongo/DeviceSyncStateMongo.js";
7
+ export class EasDeviceStateCleanupJobMongo extends EasDeviceStateCleanupJob {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.deviceSyncStateClass = DeviceSyncStateMongo;
11
+ }
12
+ }
13
+ //# sourceMappingURL=EasDeviceStateCleanupJobMongo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EasDeviceStateCleanupJobMongo.js","sourceRoot":"","sources":["../../../../src/jobs/mongo/EasDeviceStateCleanupJobMongo.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,mCAAmC;AACnC,+EAA+E;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAElF,MAAM,OAAO,6BAA8B,SAAQ,wBAA8C;IAAjG;;QACc,yBAAoB,GAAQ,oBAAoB,CAAC;IAC/D,CAAC;CAAA"}
@@ -0,0 +1,13 @@
1
+ ///////////////////////////////////////////////////////////////////////////////
2
+ // Copyright (C) 2026 Jean-Philippe Steinmetz. All rights reserved.
3
+ // SPDX-License-Identifier: MPL-2.0
4
+ ///////////////////////////////////////////////////////////////////////////////
5
+ import { EasDeviceStateCleanupJob } from "../EasDeviceStateCleanupJob.js";
6
+ import { DeviceSyncStateSQL } from "../../models/sql/DeviceSyncStateSQL.js";
7
+ export class EasDeviceStateCleanupJobSQL extends EasDeviceStateCleanupJob {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.deviceSyncStateClass = DeviceSyncStateSQL;
11
+ }
12
+ }
13
+ //# sourceMappingURL=EasDeviceStateCleanupJobSQL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EasDeviceStateCleanupJobSQL.js","sourceRoot":"","sources":["../../../../src/jobs/sql/EasDeviceStateCleanupJobSQL.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,mCAAmC;AACnC,+EAA+E;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE5E,MAAM,OAAO,2BAA4B,SAAQ,wBAA4C;IAA7F;;QACc,yBAAoB,GAAQ,kBAAkB,CAAC;IAC7D,CAAC;CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DeviceSyncState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeviceSyncState.js","sourceRoot":"","sources":["../../../src/models/DeviceSyncState.ts"],"names":[],"mappings":""}
@@ -0,0 +1,130 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ ///////////////////////////////////////////////////////////////////////////////
11
+ // Copyright (C) 2026 Jean-Philippe Steinmetz. All rights reserved.
12
+ // SPDX-License-Identifier: MPL-2.0
13
+ ///////////////////////////////////////////////////////////////////////////////
14
+ import { BaseMongoEntity, DocDecorators, ModelDecorators, PersistenceDecorators, } from "@rapidrest/service-core";
15
+ import { ObjectDecorators } from "@rapidrest/core";
16
+ import { MailboxScopedData } from "@rapidmx/restapi";
17
+ const { Description } = DocDecorators;
18
+ const { DataStore, Protect } = ModelDecorators;
19
+ const { Nullable } = ObjectDecorators;
20
+ const { Column, Entity, Index } = PersistenceDecorators;
21
+ /**
22
+ * Implementation of the `DeviceSyncState` interface for storage in a MongoDB database. If SQL is desired,
23
+ * please use `models.sql.DeviceSyncStateSQL` instead.
24
+ *
25
+ * @author Jean-Philippe Steinmetz
26
+ */
27
+ let DeviceSyncStateMongo = class DeviceSyncStateMongo extends BaseMongoEntity {
28
+ constructor(other) {
29
+ super(other);
30
+ this.mailboxUid = "";
31
+ this.deviceId = "";
32
+ this.deviceType = "";
33
+ this.folderSyncKeys = {};
34
+ this.folderCollectionClasses = {};
35
+ this.provisioned = false;
36
+ if (other) {
37
+ this.mailboxUid = other.mailboxUid !== undefined ? other.mailboxUid : this.mailboxUid;
38
+ this.deviceId = other.deviceId !== undefined ? other.deviceId : this.deviceId;
39
+ this.deviceType = other.deviceType !== undefined ? other.deviceType : this.deviceType;
40
+ this.policyKey = "policyKey" in other ? other.policyKey : this.policyKey;
41
+ this.folderSyncKeys = other.folderSyncKeys !== undefined ? other.folderSyncKeys : this.folderSyncKeys;
42
+ this.folderCollectionClasses =
43
+ other.folderCollectionClasses !== undefined ? other.folderCollectionClasses : this.folderCollectionClasses;
44
+ this.lastSyncAt = "lastSyncAt" in other ? other.lastSyncAt : this.lastSyncAt;
45
+ this.provisioned = other.provisioned !== undefined ? other.provisioned : this.provisioned;
46
+ this.remoteWipeRequested = "remoteWipeRequested" in other ? other.remoteWipeRequested : this.remoteWipeRequested;
47
+ this.remoteWipeAccountOnly =
48
+ "remoteWipeAccountOnly" in other ? other.remoteWipeAccountOnly : this.remoteWipeAccountOnly;
49
+ this.remoteWipeAcknowledgedAt =
50
+ "remoteWipeAcknowledgedAt" in other ? other.remoteWipeAcknowledgedAt : this.remoteWipeAcknowledgedAt;
51
+ }
52
+ }
53
+ };
54
+ __decorate([
55
+ Column(),
56
+ Description("The unique identifier of the `Mailbox` this device is synced against."),
57
+ __metadata("design:type", String)
58
+ ], DeviceSyncStateMongo.prototype, "mailboxUid", void 0);
59
+ __decorate([
60
+ Column(),
61
+ Description("The unique identifier of the paired device."),
62
+ __metadata("design:type", String)
63
+ ], DeviceSyncStateMongo.prototype, "deviceId", void 0);
64
+ __decorate([
65
+ Column(),
66
+ Description("The device type/model string reported by the device."),
67
+ __metadata("design:type", String)
68
+ ], DeviceSyncStateMongo.prototype, "deviceType", void 0);
69
+ __decorate([
70
+ Column(),
71
+ Description("The EAS provisioning policy key most recently acknowledged by the device."),
72
+ Nullable,
73
+ __metadata("design:type", String)
74
+ ], DeviceSyncStateMongo.prototype, "policyKey", void 0);
75
+ __decorate([
76
+ Column(),
77
+ Description("The per-folder EAS `SyncKey` cursor, keyed by `Folder.uid`."),
78
+ __metadata("design:type", Object)
79
+ ], DeviceSyncStateMongo.prototype, "folderSyncKeys", void 0);
80
+ __decorate([
81
+ Column(),
82
+ Description("The EAS `Class` most recently synced for a folder, keyed by `Folder.uid`."),
83
+ __metadata("design:type", Object)
84
+ ], DeviceSyncStateMongo.prototype, "folderCollectionClasses", void 0);
85
+ __decorate([
86
+ Column(),
87
+ Description("The date and time of the device's last successful sync."),
88
+ Nullable,
89
+ __metadata("design:type", Date)
90
+ ], DeviceSyncStateMongo.prototype, "lastSyncAt", void 0);
91
+ __decorate([
92
+ Column(),
93
+ Description("`true` if the device has completed EAS provisioning."),
94
+ __metadata("design:type", Boolean)
95
+ ], DeviceSyncStateMongo.prototype, "provisioned", void 0);
96
+ __decorate([
97
+ Column(),
98
+ Description("`true` once an administrator has requested this device be remotely wiped."),
99
+ Nullable,
100
+ __metadata("design:type", Boolean)
101
+ ], DeviceSyncStateMongo.prototype, "remoteWipeRequested", void 0);
102
+ __decorate([
103
+ Column(),
104
+ Description("`true` if the pending/most recent remote wipe request was scoped to this account only."),
105
+ Nullable,
106
+ __metadata("design:type", Boolean)
107
+ ], DeviceSyncStateMongo.prototype, "remoteWipeAccountOnly", void 0);
108
+ __decorate([
109
+ Column(),
110
+ Description("When the device most recently acknowledged a remote wipe request."),
111
+ Nullable,
112
+ __metadata("design:type", Date)
113
+ ], DeviceSyncStateMongo.prototype, "remoteWipeAcknowledgedAt", void 0);
114
+ DeviceSyncStateMongo = __decorate([
115
+ DataStore("mongo"),
116
+ Entity(),
117
+ MailboxScopedData(),
118
+ Description("Tracks the EAS sync state of a single paired mobile device against a `Mailbox`."),
119
+ Index("devicesyncstate_mailbox_device", ["mailboxUid", "deviceId"], { unique: true }),
120
+ Protect({
121
+ uid: "DeviceSyncState",
122
+ records: [
123
+ { userOrRoleId: "anonymous", actions: [] },
124
+ { userOrRoleId: ".*", actions: [] },
125
+ ],
126
+ }, false),
127
+ __metadata("design:paramtypes", [Object])
128
+ ], DeviceSyncStateMongo);
129
+ export { DeviceSyncStateMongo };
130
+ //# sourceMappingURL=DeviceSyncStateMongo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeviceSyncStateMongo.js","sourceRoot":"","sources":["../../../../src/models/mongo/DeviceSyncStateMongo.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,mCAAmC;AACnC,+EAA+E;AAC/E,OAAO,EACH,eAAe,EACf,aAAa,EACb,eAAe,EACf,qBAAqB,GACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,EAAE,WAAW,EAAE,GAAG,aAAa,CAAC;AACtC,MAAM,EAAE,SAAS,EAAE,OAAO,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rD;IAHN,MAAM,EAAE;IACR,WAAW,CAAC,yDAAyD,CAAC;IACtE,QAAQ;8BACW,IAAI;wDAAC;AAIlB;IAFN,MAAM,EAAE;IACR,WAAW,CAAC,sDAAsD,CAAC;;yDAChC;AAK7B;IAHN,MAAM,EAAE;IACR,WAAW,CAAC,2EAA2E,CAAC;IACxF,QAAQ;;iEAC4B;AAK9B;IAHN,MAAM,EAAE;IACR,WAAW,CAAC,wFAAwF,CAAC;IACrG,QAAQ;;mEAC8B;AAKhC;IAHN,MAAM,EAAE;IACR,WAAW,CAAC,mEAAmE,CAAC;IAChF,QAAQ;8BACyB,IAAI;sEAAC;AAhD9B,oBAAoB;IAfhC,SAAS,CAAC,OAAO,CAAC;IAClB,MAAM,EAAE;IACR,iBAAiB,EAAE;IACnB,WAAW,CAAC,iFAAiF,CAAC;IAC9F,KAAK,CAAC,gCAAgC,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACrF,OAAO,CACJ;QACI,GAAG,EAAE,iBAAiB;QACtB,OAAO,EAAE;YACL,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE;YAC1C,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;SACtC;KACJ,EACD,KAAK,CACR;;GACY,oBAAoB,CAsEhC"}
@@ -0,0 +1,130 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ ///////////////////////////////////////////////////////////////////////////////
11
+ // Copyright (C) 2026 Jean-Philippe Steinmetz. All rights reserved.
12
+ // SPDX-License-Identifier: MPL-2.0
13
+ ///////////////////////////////////////////////////////////////////////////////
14
+ import { BaseEntity, DocDecorators, ModelDecorators, PersistenceDecorators } from "@rapidrest/service-core";
15
+ import { ObjectDecorators } from "@rapidrest/core";
16
+ import { MailboxScopedData } from "@rapidmx/restapi";
17
+ const { Description } = DocDecorators;
18
+ const { DataStore, Protect } = ModelDecorators;
19
+ const { Nullable } = ObjectDecorators;
20
+ const { Column, Entity, Index } = PersistenceDecorators;
21
+ /**
22
+ * Implementation of the `DeviceSyncState` interface for storage in a SQL database. If MongoDB is desired,
23
+ * please use `models.mongo.DeviceSyncStateMongo` instead.
24
+ *
25
+ * @author Jean-Philippe Steinmetz
26
+ */
27
+ let DeviceSyncStateSQL = class DeviceSyncStateSQL extends BaseEntity {
28
+ constructor(other) {
29
+ super(other);
30
+ this.mailboxUid = "";
31
+ this.deviceId = "";
32
+ this.deviceType = "";
33
+ this.folderSyncKeys = {};
34
+ this.folderCollectionClasses = {};
35
+ this.provisioned = false;
36
+ if (other) {
37
+ this.mailboxUid = other.mailboxUid !== undefined ? other.mailboxUid : this.mailboxUid;
38
+ this.deviceId = other.deviceId !== undefined ? other.deviceId : this.deviceId;
39
+ this.deviceType = other.deviceType !== undefined ? other.deviceType : this.deviceType;
40
+ this.policyKey = "policyKey" in other ? other.policyKey : this.policyKey;
41
+ this.folderSyncKeys = other.folderSyncKeys !== undefined ? other.folderSyncKeys : this.folderSyncKeys;
42
+ this.folderCollectionClasses =
43
+ other.folderCollectionClasses !== undefined ? other.folderCollectionClasses : this.folderCollectionClasses;
44
+ this.lastSyncAt = "lastSyncAt" in other ? other.lastSyncAt : this.lastSyncAt;
45
+ this.provisioned = other.provisioned !== undefined ? other.provisioned : this.provisioned;
46
+ this.remoteWipeRequested = "remoteWipeRequested" in other ? other.remoteWipeRequested : this.remoteWipeRequested;
47
+ this.remoteWipeAccountOnly =
48
+ "remoteWipeAccountOnly" in other ? other.remoteWipeAccountOnly : this.remoteWipeAccountOnly;
49
+ this.remoteWipeAcknowledgedAt =
50
+ "remoteWipeAcknowledgedAt" in other ? other.remoteWipeAcknowledgedAt : this.remoteWipeAcknowledgedAt;
51
+ }
52
+ }
53
+ };
54
+ __decorate([
55
+ Column(),
56
+ Description("The unique identifier of the `Mailbox` this device is synced against."),
57
+ __metadata("design:type", String)
58
+ ], DeviceSyncStateSQL.prototype, "mailboxUid", void 0);
59
+ __decorate([
60
+ Column(),
61
+ Description("The unique identifier of the paired device."),
62
+ __metadata("design:type", String)
63
+ ], DeviceSyncStateSQL.prototype, "deviceId", void 0);
64
+ __decorate([
65
+ Column(),
66
+ Description("The device type/model string reported by the device."),
67
+ __metadata("design:type", String)
68
+ ], DeviceSyncStateSQL.prototype, "deviceType", void 0);
69
+ __decorate([
70
+ Column({ nullable: true }),
71
+ Description("The EAS provisioning policy key most recently acknowledged by the device."),
72
+ Nullable,
73
+ __metadata("design:type", String)
74
+ ], DeviceSyncStateSQL.prototype, "policyKey", void 0);
75
+ __decorate([
76
+ Column({ type: "simple-json" }),
77
+ Description("The per-folder EAS `SyncKey` cursor, keyed by `Folder.uid`."),
78
+ __metadata("design:type", Object)
79
+ ], DeviceSyncStateSQL.prototype, "folderSyncKeys", void 0);
80
+ __decorate([
81
+ Column({ type: "simple-json" }),
82
+ Description("The EAS `Class` most recently synced for a folder, keyed by `Folder.uid`."),
83
+ __metadata("design:type", Object)
84
+ ], DeviceSyncStateSQL.prototype, "folderCollectionClasses", void 0);
85
+ __decorate([
86
+ Column({ nullable: true }),
87
+ Description("The date and time of the device's last successful sync."),
88
+ Nullable,
89
+ __metadata("design:type", Date)
90
+ ], DeviceSyncStateSQL.prototype, "lastSyncAt", void 0);
91
+ __decorate([
92
+ Column(),
93
+ Description("`true` if the device has completed EAS provisioning."),
94
+ __metadata("design:type", Boolean)
95
+ ], DeviceSyncStateSQL.prototype, "provisioned", void 0);
96
+ __decorate([
97
+ Column({ nullable: true }),
98
+ Description("`true` once an administrator has requested this device be remotely wiped."),
99
+ Nullable,
100
+ __metadata("design:type", Boolean)
101
+ ], DeviceSyncStateSQL.prototype, "remoteWipeRequested", void 0);
102
+ __decorate([
103
+ Column({ nullable: true }),
104
+ Description("`true` if the pending/most recent remote wipe request was scoped to this account only."),
105
+ Nullable,
106
+ __metadata("design:type", Boolean)
107
+ ], DeviceSyncStateSQL.prototype, "remoteWipeAccountOnly", void 0);
108
+ __decorate([
109
+ Column({ nullable: true }),
110
+ Description("When the device most recently acknowledged a remote wipe request."),
111
+ Nullable,
112
+ __metadata("design:type", Date)
113
+ ], DeviceSyncStateSQL.prototype, "remoteWipeAcknowledgedAt", void 0);
114
+ DeviceSyncStateSQL = __decorate([
115
+ DataStore("sql"),
116
+ Entity(),
117
+ MailboxScopedData(),
118
+ Description("Tracks the EAS sync state of a single paired mobile device against a `Mailbox`."),
119
+ Index("devicesyncstate_mailbox_device", ["mailboxUid", "deviceId"], { unique: true }),
120
+ Protect({
121
+ uid: "DeviceSyncState",
122
+ records: [
123
+ { userOrRoleId: "anonymous", actions: [] },
124
+ { userOrRoleId: ".*", actions: [] },
125
+ ],
126
+ }, false),
127
+ __metadata("design:paramtypes", [Object])
128
+ ], DeviceSyncStateSQL);
129
+ export { DeviceSyncStateSQL };
130
+ //# sourceMappingURL=DeviceSyncStateSQL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeviceSyncStateSQL.js","sourceRoot":"","sources":["../../../../src/models/sql/DeviceSyncStateSQL.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,mCAAmC;AACnC,+EAA+E;AAC/E,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AA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,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;SACtC;KACJ,EACD,KAAK,CACR;;GACY,kBAAkB,CAsE9B"}
@@ -0,0 +1,28 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ ///////////////////////////////////////////////////////////////////////////////
8
+ // Copyright (C) 2026 Jean-Philippe Steinmetz. All rights reserved.
9
+ // SPDX-License-Identifier: MPL-2.0
10
+ ///////////////////////////////////////////////////////////////////////////////
11
+ import { RouteDecorators } from "@rapidrest/service-core";
12
+ import { DeviceSyncStateMongo } from "../models/mongo/DeviceSyncStateMongo.js";
13
+ import { BaseDeviceSyncStateRoute } from "../BaseDeviceSyncStateRoute.js";
14
+ const { ApiRoute } = RouteDecorators;
15
+ /**
16
+ * @author Jean-Philippe Steinmetz
17
+ */
18
+ let DeviceSyncStateRouteMongo = class DeviceSyncStateRouteMongo extends BaseDeviceSyncStateRoute {
19
+ constructor() {
20
+ super(...arguments);
21
+ this.deviceSyncStateClass = DeviceSyncStateMongo;
22
+ }
23
+ };
24
+ DeviceSyncStateRouteMongo = __decorate([
25
+ ApiRoute("mail/devices")
26
+ ], DeviceSyncStateRouteMongo);
27
+ export { DeviceSyncStateRouteMongo };
28
+ //# sourceMappingURL=DeviceSyncStateRouteMongo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeviceSyncStateRouteMongo.js","sourceRoot":"","sources":["../../../src/mongo/DeviceSyncStateRouteMongo.ts"],"names":[],"mappings":";;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,mCAAmC;AACnC,+EAA+E;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,MAAM,EAAE,QAAQ,EAAE,GAAG,eAAe,CAAC;AAErC;;GAEG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,wBAA8C;IAAtF;;QACO,yBAAoB,GAAQ,oBAAoB,CAAC;IAC/D,CAAC;CAAA,CAAA;AAFY,yBAAyB;IADrC,QAAQ,CAAC,cAAc,CAAC;GACZ,yBAAyB,CAErC"}
@@ -0,0 +1,63 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ ///////////////////////////////////////////////////////////////////////////////
8
+ // Copyright (C) 2026 Jean-Philippe Steinmetz. All rights reserved.
9
+ // SPDX-License-Identifier: MPL-2.0
10
+ ///////////////////////////////////////////////////////////////////////////////
11
+ import { MailboxMongo } from "@rapidmx/restapi/mongo";
12
+ import { RouteDecorators } from "@rapidrest/service-core";
13
+ import { DeviceSyncStateMongo } from "../models/mongo/DeviceSyncStateMongo.js";
14
+ import { BaseEasRoute } from "../BaseEasRoute.js";
15
+ import { ProvisionCommand } from "../commands/ProvisionCommand.js";
16
+ import { PingCommand } from "../commands/PingCommand.js";
17
+ import { FolderSyncCommandMongo } from "../commands/mongo/FolderSyncCommandMongo.js";
18
+ import { SyncCommandMongo } from "../commands/mongo/SyncCommandMongo.js";
19
+ import { SendMailCommandMongo } from "../commands/mongo/SendMailCommandMongo.js";
20
+ import { SmartForwardCommandMongo } from "../commands/mongo/SmartForwardCommandMongo.js";
21
+ import { SmartReplyCommandMongo } from "../commands/mongo/SmartReplyCommandMongo.js";
22
+ import { ItemOperationsCommandMongo } from "../commands/mongo/ItemOperationsCommandMongo.js";
23
+ import { SearchCommandMongo } from "../commands/mongo/SearchCommandMongo.js";
24
+ import { MeetingResponseCommandMongo } from "../commands/mongo/MeetingResponseCommandMongo.js";
25
+ import { SettingsCommandMongo } from "../commands/mongo/SettingsCommandMongo.js";
26
+ import { GetItemEstimateCommandMongo } from "../commands/mongo/GetItemEstimateCommandMongo.js";
27
+ import { MoveItemsCommandMongo } from "../commands/mongo/MoveItemsCommandMongo.js";
28
+ import { ResolveRecipientsCommandMongo } from "../commands/mongo/ResolveRecipientsCommandMongo.js";
29
+ const { Route } = RouteDecorators;
30
+ /**
31
+ * Mongo-backed concrete `BaseEasRoute`, mounted at the protocol's well-known path. Exported from this plugin's
32
+ * `./mongo` entry point, so the server host mounts it without a wrapper class of its own.
33
+ *
34
+ * @author Jean-Philippe Steinmetz
35
+ */
36
+ let EasRouteMongo = class EasRouteMongo extends BaseEasRoute {
37
+ constructor() {
38
+ super(...arguments);
39
+ this.deviceSyncStateClass = DeviceSyncStateMongo;
40
+ this.mailboxClass = MailboxMongo;
41
+ this.commandHandlerClasses = [
42
+ ProvisionCommand,
43
+ FolderSyncCommandMongo,
44
+ SyncCommandMongo,
45
+ SendMailCommandMongo,
46
+ SmartForwardCommandMongo,
47
+ SmartReplyCommandMongo,
48
+ ItemOperationsCommandMongo,
49
+ SearchCommandMongo,
50
+ MeetingResponseCommandMongo,
51
+ SettingsCommandMongo,
52
+ PingCommand,
53
+ GetItemEstimateCommandMongo,
54
+ MoveItemsCommandMongo,
55
+ ResolveRecipientsCommandMongo,
56
+ ];
57
+ }
58
+ };
59
+ EasRouteMongo = __decorate([
60
+ Route("/Microsoft-Server-ActiveSync")
61
+ ], EasRouteMongo);
62
+ export { EasRouteMongo };
63
+ //# sourceMappingURL=EasRouteMongo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EasRouteMongo.js","sourceRoot":"","sources":["../../../src/mongo/EasRouteMongo.ts"],"names":[],"mappings":";;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,mCAAmC;AACnC,+EAA+E;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AACzF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAC/F,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAC/F,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,MAAM,EAAE,KAAK,EAAE,GAAG,eAAe,CAAC;AAElC;;;;;GAKG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,YAAgD;IAA5E;;QACO,yBAAoB,GAAQ,oBAAoB,CAAC;QACjD,iBAAY,GAAQ,YAAY,CAAC;QACjC,0BAAqB,GAAU;YACrC,gBAAgB;YAChB,sBAAsB;YACtB,gBAAgB;YAChB,oBAAoB;YACpB,wBAAwB;YACxB,sBAAsB;YACtB,0BAA0B;YAC1B,kBAAkB;YAClB,2BAA2B;YAC3B,oBAAoB;YACpB,WAAW;YACX,2BAA2B;YAC3B,qBAAqB;YACrB,6BAA6B;SAChC,CAAC;IACN,CAAC;CAAA,CAAA;AAnBY,aAAa;IADzB,KAAK,CAAC,8BAA8B,CAAC;GACzB,aAAa,CAmBzB"}
@@ -0,0 +1,9 @@
1
+ ///////////////////////////////////////////////////////////////////////////////
2
+ // Copyright (C) 2026 Jean-Philippe Steinmetz. All rights reserved.
3
+ // SPDX-License-Identifier: MPL-2.0
4
+ ///////////////////////////////////////////////////////////////////////////////
5
+ export * from "./EasRouteMongo.js";
6
+ export * from "./DeviceSyncStateRouteMongo.js";
7
+ export * from "../commands/mongo/index.js";
8
+ export * from "../adapters/mongo/index.js";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mongo/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,mCAAmC;AACnC,+EAA+E;AAC/E,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC"}
@@ -0,0 +1,15 @@
1
+ ///////////////////////////////////////////////////////////////////////////////
2
+ // Copyright (C) 2026 Jean-Philippe Steinmetz. All rights reserved.
3
+ // SPDX-License-Identifier: MPL-2.0
4
+ ///////////////////////////////////////////////////////////////////////////////
5
+ /**
6
+ * This plugin's `./mongo` entry point: exactly the classes a server host loads for a Mongo deployment - the
7
+ * mounted routes, the device-state model and its cleanup job. Anything else exported here would be registered
8
+ * by the host too (and an abstract `BackgroundService` would even be started), so the command and adapter
9
+ * classes these routes use stay internal.
10
+ */
11
+ export { EasRouteMongo } from "./mongo/EasRouteMongo.js";
12
+ export { DeviceSyncStateRouteMongo } from "./mongo/DeviceSyncStateRouteMongo.js";
13
+ export { DeviceSyncStateMongo } from "./models/mongo/DeviceSyncStateMongo.js";
14
+ export { EasDeviceStateCleanupJobMongo } from "./jobs/mongo/EasDeviceStateCleanupJobMongo.js";
15
+ //# sourceMappingURL=mongo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongo.js","sourceRoot":"","sources":["../../src/mongo.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,mCAAmC;AACnC,+EAA+E;AAC/E;;;;;GAKG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC"}
@@ -0,0 +1,28 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ ///////////////////////////////////////////////////////////////////////////////
8
+ // Copyright (C) 2026 Jean-Philippe Steinmetz. All rights reserved.
9
+ // SPDX-License-Identifier: MPL-2.0
10
+ ///////////////////////////////////////////////////////////////////////////////
11
+ import { RouteDecorators } from "@rapidrest/service-core";
12
+ import { DeviceSyncStateSQL } from "../models/sql/DeviceSyncStateSQL.js";
13
+ import { BaseDeviceSyncStateRoute } from "../BaseDeviceSyncStateRoute.js";
14
+ const { ApiRoute } = RouteDecorators;
15
+ /**
16
+ * @author Jean-Philippe Steinmetz
17
+ */
18
+ let DeviceSyncStateRouteSQL = class DeviceSyncStateRouteSQL extends BaseDeviceSyncStateRoute {
19
+ constructor() {
20
+ super(...arguments);
21
+ this.deviceSyncStateClass = DeviceSyncStateSQL;
22
+ }
23
+ };
24
+ DeviceSyncStateRouteSQL = __decorate([
25
+ ApiRoute("mail/devices")
26
+ ], DeviceSyncStateRouteSQL);
27
+ export { DeviceSyncStateRouteSQL };
28
+ //# sourceMappingURL=DeviceSyncStateRouteSQL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeviceSyncStateRouteSQL.js","sourceRoot":"","sources":["../../../src/sql/DeviceSyncStateRouteSQL.ts"],"names":[],"mappings":";;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,mCAAmC;AACnC,+EAA+E;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,MAAM,EAAE,QAAQ,EAAE,GAAG,eAAe,CAAC;AAErC;;GAEG;AAEI,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,wBAA4C;IAAlF;;QACO,yBAAoB,GAAQ,kBAAkB,CAAC;IAC7D,CAAC;CAAA,CAAA;AAFY,uBAAuB;IADnC,QAAQ,CAAC,cAAc,CAAC;GACZ,uBAAuB,CAEnC"}