@rapidmx/restapi 0.1.0
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/LICENSE +382 -0
- package/README.md +50 -0
- package/dist/lib/blob/BlobStore.js +6 -0
- package/dist/lib/blob/BlobStore.js.map +1 -0
- package/dist/lib/blob/LocalFsBlobStore.js +101 -0
- package/dist/lib/blob/LocalFsBlobStore.js.map +1 -0
- package/dist/lib/blob/index.js +7 -0
- package/dist/lib/blob/index.js.map +1 -0
- package/dist/lib/index.js +12 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/jobs/AttachmentExtractionJob.js +124 -0
- package/dist/lib/jobs/AttachmentExtractionJob.js.map +1 -0
- package/dist/lib/jobs/CalendarReminderJob.js +132 -0
- package/dist/lib/jobs/CalendarReminderJob.js.map +1 -0
- package/dist/lib/jobs/EasDeviceStateCleanupJob.js +101 -0
- package/dist/lib/jobs/EasDeviceStateCleanupJob.js.map +1 -0
- package/dist/lib/jobs/ExternalShareExpirationJob.js +117 -0
- package/dist/lib/jobs/ExternalShareExpirationJob.js.map +1 -0
- package/dist/lib/jobs/MailboxQuotaRecalcJob.js +163 -0
- package/dist/lib/jobs/MailboxQuotaRecalcJob.js.map +1 -0
- package/dist/lib/jobs/MeetingSchedulingJob.js +106 -0
- package/dist/lib/jobs/MeetingSchedulingJob.js.map +1 -0
- package/dist/lib/jobs/QuarantineRetentionJob.js +97 -0
- package/dist/lib/jobs/QuarantineRetentionJob.js.map +1 -0
- package/dist/lib/jobs/ScanQueueJob.js +223 -0
- package/dist/lib/jobs/ScanQueueJob.js.map +1 -0
- package/dist/lib/jobs/SearchIndexJob.js +146 -0
- package/dist/lib/jobs/SearchIndexJob.js.map +1 -0
- package/dist/lib/jobs/index.js +10 -0
- package/dist/lib/jobs/index.js.map +1 -0
- package/dist/lib/jobs/mongo/AttachmentExtractionJobMongo.js +14 -0
- package/dist/lib/jobs/mongo/AttachmentExtractionJobMongo.js.map +1 -0
- package/dist/lib/jobs/mongo/CalendarReminderJobMongo.js +13 -0
- package/dist/lib/jobs/mongo/CalendarReminderJobMongo.js.map +1 -0
- package/dist/lib/jobs/mongo/EasDeviceStateCleanupJobMongo.js +13 -0
- package/dist/lib/jobs/mongo/EasDeviceStateCleanupJobMongo.js.map +1 -0
- package/dist/lib/jobs/mongo/ExternalShareExpirationJobMongo.js +13 -0
- package/dist/lib/jobs/mongo/ExternalShareExpirationJobMongo.js.map +1 -0
- package/dist/lib/jobs/mongo/MailboxQuotaRecalcJobMongo.js +15 -0
- package/dist/lib/jobs/mongo/MailboxQuotaRecalcJobMongo.js.map +1 -0
- package/dist/lib/jobs/mongo/MeetingSchedulingJobMongo.js +13 -0
- package/dist/lib/jobs/mongo/MeetingSchedulingJobMongo.js.map +1 -0
- package/dist/lib/jobs/mongo/QuarantineRetentionJobMongo.js +13 -0
- package/dist/lib/jobs/mongo/QuarantineRetentionJobMongo.js.map +1 -0
- package/dist/lib/jobs/mongo/ScanQueueJobMongo.js +18 -0
- package/dist/lib/jobs/mongo/ScanQueueJobMongo.js.map +1 -0
- package/dist/lib/jobs/mongo/SearchIndexJobMongo.js +14 -0
- package/dist/lib/jobs/mongo/SearchIndexJobMongo.js.map +1 -0
- package/dist/lib/jobs/mongo/index.js +10 -0
- package/dist/lib/jobs/mongo/index.js.map +1 -0
- package/dist/lib/jobs/mongo.js +2 -0
- package/dist/lib/jobs/mongo.js.map +1 -0
- package/dist/lib/jobs/sql/AttachmentExtractionJobSQL.js +14 -0
- package/dist/lib/jobs/sql/AttachmentExtractionJobSQL.js.map +1 -0
- package/dist/lib/jobs/sql/CalendarReminderJobSQL.js +13 -0
- package/dist/lib/jobs/sql/CalendarReminderJobSQL.js.map +1 -0
- package/dist/lib/jobs/sql/EasDeviceStateCleanupJobSQL.js +13 -0
- package/dist/lib/jobs/sql/EasDeviceStateCleanupJobSQL.js.map +1 -0
- package/dist/lib/jobs/sql/ExternalShareExpirationJobSQL.js +13 -0
- package/dist/lib/jobs/sql/ExternalShareExpirationJobSQL.js.map +1 -0
- package/dist/lib/jobs/sql/MailboxQuotaRecalcJobSQL.js +15 -0
- package/dist/lib/jobs/sql/MailboxQuotaRecalcJobSQL.js.map +1 -0
- package/dist/lib/jobs/sql/MeetingSchedulingJobSQL.js +13 -0
- package/dist/lib/jobs/sql/MeetingSchedulingJobSQL.js.map +1 -0
- package/dist/lib/jobs/sql/QuarantineRetentionJobSQL.js +13 -0
- package/dist/lib/jobs/sql/QuarantineRetentionJobSQL.js.map +1 -0
- package/dist/lib/jobs/sql/ScanQueueJobSQL.js +18 -0
- package/dist/lib/jobs/sql/ScanQueueJobSQL.js.map +1 -0
- package/dist/lib/jobs/sql/SearchIndexJobSQL.js +14 -0
- package/dist/lib/jobs/sql/SearchIndexJobSQL.js.map +1 -0
- package/dist/lib/jobs/sql/index.js +10 -0
- package/dist/lib/jobs/sql/index.js.map +1 -0
- package/dist/lib/jobs/sql.js +2 -0
- package/dist/lib/jobs/sql.js.map +1 -0
- package/dist/lib/models/index.js +2 -0
- package/dist/lib/models/index.js.map +1 -0
- package/dist/lib/models/mongo/AttachmentMongo.js +129 -0
- package/dist/lib/models/mongo/AttachmentMongo.js.map +1 -0
- package/dist/lib/models/mongo/CalendarEventMongo.js +172 -0
- package/dist/lib/models/mongo/CalendarEventMongo.js.map +1 -0
- package/dist/lib/models/mongo/CalendarShareLinkMongo.js +85 -0
- package/dist/lib/models/mongo/CalendarShareLinkMongo.js.map +1 -0
- package/dist/lib/models/mongo/ContactListMongo.js +60 -0
- package/dist/lib/models/mongo/ContactListMongo.js.map +1 -0
- package/dist/lib/models/mongo/ContactMongo.js +148 -0
- package/dist/lib/models/mongo/ContactMongo.js.map +1 -0
- package/dist/lib/models/mongo/DeviceSyncStateMongo.js +97 -0
- package/dist/lib/models/mongo/DeviceSyncStateMongo.js.map +1 -0
- package/dist/lib/models/mongo/FolderMongo.js +102 -0
- package/dist/lib/models/mongo/FolderMongo.js.map +1 -0
- package/dist/lib/models/mongo/IngestQueueEntryMongo.js +93 -0
- package/dist/lib/models/mongo/IngestQueueEntryMongo.js.map +1 -0
- package/dist/lib/models/mongo/MailboxMongo.js +105 -0
- package/dist/lib/models/mongo/MailboxMongo.js.map +1 -0
- package/dist/lib/models/mongo/MessageMongo.js +180 -0
- package/dist/lib/models/mongo/MessageMongo.js.map +1 -0
- package/dist/lib/models/mongo/NoteMongo.js +83 -0
- package/dist/lib/models/mongo/NoteMongo.js.map +1 -0
- package/dist/lib/models/mongo/QuarantineEntryMongo.js +99 -0
- package/dist/lib/models/mongo/QuarantineEntryMongo.js.map +1 -0
- package/dist/lib/models/mongo/ScanResultMongo.js +112 -0
- package/dist/lib/models/mongo/ScanResultMongo.js.map +1 -0
- package/dist/lib/models/mongo/SearchIndexStateMongo.js +83 -0
- package/dist/lib/models/mongo/SearchIndexStateMongo.js.map +1 -0
- package/dist/lib/models/mongo/TaskMongo.js +105 -0
- package/dist/lib/models/mongo/TaskMongo.js.map +1 -0
- package/dist/lib/models/mongo/index.js +16 -0
- package/dist/lib/models/mongo/index.js.map +1 -0
- package/dist/lib/models/mongo.js +2 -0
- package/dist/lib/models/mongo.js.map +1 -0
- package/dist/lib/models/sql/AttachmentSQL.js +129 -0
- package/dist/lib/models/sql/AttachmentSQL.js.map +1 -0
- package/dist/lib/models/sql/CalendarEventSQL.js +176 -0
- package/dist/lib/models/sql/CalendarEventSQL.js.map +1 -0
- package/dist/lib/models/sql/CalendarShareLinkSQL.js +85 -0
- package/dist/lib/models/sql/CalendarShareLinkSQL.js.map +1 -0
- package/dist/lib/models/sql/ContactListSQL.js +60 -0
- package/dist/lib/models/sql/ContactListSQL.js.map +1 -0
- package/dist/lib/models/sql/ContactSQL.js +148 -0
- package/dist/lib/models/sql/ContactSQL.js.map +1 -0
- package/dist/lib/models/sql/DeviceSyncStateSQL.js +97 -0
- package/dist/lib/models/sql/DeviceSyncStateSQL.js.map +1 -0
- package/dist/lib/models/sql/FolderSQL.js +106 -0
- package/dist/lib/models/sql/FolderSQL.js.map +1 -0
- package/dist/lib/models/sql/IngestQueueEntrySQL.js +97 -0
- package/dist/lib/models/sql/IngestQueueEntrySQL.js.map +1 -0
- package/dist/lib/models/sql/MailboxSQL.js +105 -0
- package/dist/lib/models/sql/MailboxSQL.js.map +1 -0
- package/dist/lib/models/sql/MessageSQL.js +184 -0
- package/dist/lib/models/sql/MessageSQL.js.map +1 -0
- package/dist/lib/models/sql/NoteSQL.js +83 -0
- package/dist/lib/models/sql/NoteSQL.js.map +1 -0
- package/dist/lib/models/sql/QuarantineEntrySQL.js +103 -0
- package/dist/lib/models/sql/QuarantineEntrySQL.js.map +1 -0
- package/dist/lib/models/sql/ScanResultSQL.js +116 -0
- package/dist/lib/models/sql/ScanResultSQL.js.map +1 -0
- package/dist/lib/models/sql/SearchIndexStateSQL.js +83 -0
- package/dist/lib/models/sql/SearchIndexStateSQL.js.map +1 -0
- package/dist/lib/models/sql/TaskSQL.js +109 -0
- package/dist/lib/models/sql/TaskSQL.js.map +1 -0
- package/dist/lib/models/sql/index.js +16 -0
- package/dist/lib/models/sql/index.js.map +1 -0
- package/dist/lib/models/sql.js +2 -0
- package/dist/lib/models/sql.js.map +1 -0
- package/dist/lib/models/types.js +108 -0
- package/dist/lib/models/types.js.map +1 -0
- package/dist/lib/mongo.js +8 -0
- package/dist/lib/mongo.js.map +1 -0
- package/dist/lib/push/MailPushRoute.js +42 -0
- package/dist/lib/push/MailPushRoute.js.map +1 -0
- package/dist/lib/push/index.js +6 -0
- package/dist/lib/push/index.js.map +1 -0
- package/dist/lib/routes/BaseAttachmentRoute.js +142 -0
- package/dist/lib/routes/BaseAttachmentRoute.js.map +1 -0
- package/dist/lib/routes/BaseCalendarShareLinkRoute.js +123 -0
- package/dist/lib/routes/BaseCalendarShareLinkRoute.js.map +1 -0
- package/dist/lib/routes/BaseFolderRoute.js +192 -0
- package/dist/lib/routes/BaseFolderRoute.js.map +1 -0
- package/dist/lib/routes/BaseMailIngestRoute.js +179 -0
- package/dist/lib/routes/BaseMailIngestRoute.js.map +1 -0
- package/dist/lib/routes/BaseMailboxRoute.js +187 -0
- package/dist/lib/routes/BaseMailboxRoute.js.map +1 -0
- package/dist/lib/routes/BaseMessageRoute.js +142 -0
- package/dist/lib/routes/BaseMessageRoute.js.map +1 -0
- package/dist/lib/routes/BaseScopedChildRoute.js +348 -0
- package/dist/lib/routes/BaseScopedChildRoute.js.map +1 -0
- package/dist/lib/routes/BaseSearchRoute.js +91 -0
- package/dist/lib/routes/BaseSearchRoute.js.map +1 -0
- package/dist/lib/routes/index.js +13 -0
- package/dist/lib/routes/index.js.map +1 -0
- package/dist/lib/routes/mongo/AttachmentRouteMongo.js +26 -0
- package/dist/lib/routes/mongo/AttachmentRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/CalendarEventRouteMongo.js +27 -0
- package/dist/lib/routes/mongo/CalendarEventRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/CalendarShareLinkRouteMongo.js +26 -0
- package/dist/lib/routes/mongo/CalendarShareLinkRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/ContactListRouteMongo.js +26 -0
- package/dist/lib/routes/mongo/ContactListRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/ContactRouteMongo.js +27 -0
- package/dist/lib/routes/mongo/ContactRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/FolderRouteMongo.js +26 -0
- package/dist/lib/routes/mongo/FolderRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/IngestQueueRouteMongo.js +33 -0
- package/dist/lib/routes/mongo/IngestQueueRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/MailIngestRouteMongo.js +14 -0
- package/dist/lib/routes/mongo/MailIngestRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/MailboxRouteMongo.js +39 -0
- package/dist/lib/routes/mongo/MailboxRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/MessageRouteMongo.js +27 -0
- package/dist/lib/routes/mongo/MessageRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/NoteRouteMongo.js +26 -0
- package/dist/lib/routes/mongo/NoteRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/QuarantineRouteMongo.js +35 -0
- package/dist/lib/routes/mongo/QuarantineRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/SearchRouteMongo.js +13 -0
- package/dist/lib/routes/mongo/SearchRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/TaskRouteMongo.js +27 -0
- package/dist/lib/routes/mongo/TaskRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/index.js +15 -0
- package/dist/lib/routes/mongo/index.js.map +1 -0
- package/dist/lib/routes/mongo.js +2 -0
- package/dist/lib/routes/mongo.js.map +1 -0
- package/dist/lib/routes/sql/AttachmentRouteSQL.js +26 -0
- package/dist/lib/routes/sql/AttachmentRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/CalendarEventRouteSQL.js +27 -0
- package/dist/lib/routes/sql/CalendarEventRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/CalendarShareLinkRouteSQL.js +26 -0
- package/dist/lib/routes/sql/CalendarShareLinkRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/ContactListRouteSQL.js +26 -0
- package/dist/lib/routes/sql/ContactListRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/ContactRouteSQL.js +27 -0
- package/dist/lib/routes/sql/ContactRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/FolderRouteSQL.js +26 -0
- package/dist/lib/routes/sql/FolderRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/IngestQueueRouteSQL.js +29 -0
- package/dist/lib/routes/sql/IngestQueueRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/MailIngestRouteSQL.js +35 -0
- package/dist/lib/routes/sql/MailIngestRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/MailboxRouteSQL.js +64 -0
- package/dist/lib/routes/sql/MailboxRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/MessageRouteSQL.js +27 -0
- package/dist/lib/routes/sql/MessageRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/NoteRouteSQL.js +26 -0
- package/dist/lib/routes/sql/NoteRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/QuarantineRouteSQL.js +29 -0
- package/dist/lib/routes/sql/QuarantineRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/SearchRouteSQL.js +13 -0
- package/dist/lib/routes/sql/SearchRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/TaskRouteSQL.js +27 -0
- package/dist/lib/routes/sql/TaskRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/index.js +15 -0
- package/dist/lib/routes/sql/index.js.map +1 -0
- package/dist/lib/routes/sql.js +2 -0
- package/dist/lib/routes/sql.js.map +1 -0
- package/dist/lib/scan/AvScanProvider.js +2 -0
- package/dist/lib/scan/AvScanProvider.js.map +1 -0
- package/dist/lib/scan/ClamAvScanProvider.js +112 -0
- package/dist/lib/scan/ClamAvScanProvider.js.map +1 -0
- package/dist/lib/scan/RspamdSpamScanProvider.js +100 -0
- package/dist/lib/scan/RspamdSpamScanProvider.js.map +1 -0
- package/dist/lib/scan/ScanPipeline.js +118 -0
- package/dist/lib/scan/ScanPipeline.js.map +1 -0
- package/dist/lib/scan/SpamScanProvider.js +2 -0
- package/dist/lib/scan/SpamScanProvider.js.map +1 -0
- package/dist/lib/scan/index.js +10 -0
- package/dist/lib/scan/index.js.map +1 -0
- package/dist/lib/search/MongoTextSearchProvider.js +116 -0
- package/dist/lib/search/MongoTextSearchProvider.js.map +1 -0
- package/dist/lib/search/OpenSearchProvider.js +156 -0
- package/dist/lib/search/OpenSearchProvider.js.map +1 -0
- package/dist/lib/search/PostgresFullTextSearchProvider.js +139 -0
- package/dist/lib/search/PostgresFullTextSearchProvider.js.map +1 -0
- package/dist/lib/search/SearchProvider.js +6 -0
- package/dist/lib/search/SearchProvider.js.map +1 -0
- package/dist/lib/search/extraction/DocxTextExtractor.js +27 -0
- package/dist/lib/search/extraction/DocxTextExtractor.js.map +1 -0
- package/dist/lib/search/extraction/ExtractorRegistry.js +82 -0
- package/dist/lib/search/extraction/ExtractorRegistry.js.map +1 -0
- package/dist/lib/search/extraction/HtmlTextExtractor.js +20 -0
- package/dist/lib/search/extraction/HtmlTextExtractor.js.map +1 -0
- package/dist/lib/search/extraction/PdfTextExtractor.js +22 -0
- package/dist/lib/search/extraction/PdfTextExtractor.js.map +1 -0
- package/dist/lib/search/extraction/PlainTextExtractor.js +14 -0
- package/dist/lib/search/extraction/PlainTextExtractor.js.map +1 -0
- package/dist/lib/search/extraction/TextExtractor.js +6 -0
- package/dist/lib/search/extraction/TextExtractor.js.map +1 -0
- package/dist/lib/search/index.js +15 -0
- package/dist/lib/search/index.js.map +1 -0
- package/dist/lib/sql.js +8 -0
- package/dist/lib/sql.js.map +1 -0
- package/dist/lib/transport/MTAIngestAdapter.js +30 -0
- package/dist/lib/transport/MTAIngestAdapter.js.map +1 -0
- package/dist/lib/transport/MailTransport.js +6 -0
- package/dist/lib/transport/MailTransport.js.map +1 -0
- package/dist/lib/transport/PostfixSendmailTransport.js +61 -0
- package/dist/lib/transport/PostfixSendmailTransport.js.map +1 -0
- package/dist/lib/transport/index.js +8 -0
- package/dist/lib/transport/index.js.map +1 -0
- package/dist/lib/util/FolderUtils.js +50 -0
- package/dist/lib/util/FolderUtils.js.map +1 -0
- package/dist/lib/util/MailSendUtils.js +36 -0
- package/dist/lib/util/MailSendUtils.js.map +1 -0
- package/dist/lib/util/MailboxScopeUtils.js +23 -0
- package/dist/lib/util/MailboxScopeUtils.js.map +1 -0
- package/dist/lib/util/OptionalDeps.js +23 -0
- package/dist/lib/util/OptionalDeps.js.map +1 -0
- package/dist/lib/util/RecoverableRepoUtils.js +42 -0
- package/dist/lib/util/RecoverableRepoUtils.js.map +1 -0
- package/dist/lib/util/index.js +17 -0
- package/dist/lib/util/index.js.map +1 -0
- package/dist/types/blob/BlobStore.d.ts +54 -0
- package/dist/types/blob/LocalFsBlobStore.d.ts +23 -0
- package/dist/types/blob/index.d.ts +2 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/jobs/AttachmentExtractionJob.d.ts +34 -0
- package/dist/types/jobs/CalendarReminderJob.d.ts +37 -0
- package/dist/types/jobs/EasDeviceStateCleanupJob.d.ts +26 -0
- package/dist/types/jobs/ExternalShareExpirationJob.d.ts +34 -0
- package/dist/types/jobs/MailboxQuotaRecalcJob.d.ts +44 -0
- package/dist/types/jobs/MeetingSchedulingJob.d.ts +32 -0
- package/dist/types/jobs/QuarantineRetentionJob.d.ts +27 -0
- package/dist/types/jobs/ScanQueueJob.d.ts +41 -0
- package/dist/types/jobs/SearchIndexJob.d.ts +37 -0
- package/dist/types/jobs/index.d.ts +9 -0
- package/dist/types/jobs/mongo/AttachmentExtractionJobMongo.d.ts +6 -0
- package/dist/types/jobs/mongo/CalendarReminderJobMongo.d.ts +5 -0
- package/dist/types/jobs/mongo/EasDeviceStateCleanupJobMongo.d.ts +5 -0
- package/dist/types/jobs/mongo/ExternalShareExpirationJobMongo.d.ts +5 -0
- package/dist/types/jobs/mongo/MailboxQuotaRecalcJobMongo.d.ts +7 -0
- package/dist/types/jobs/mongo/MeetingSchedulingJobMongo.d.ts +5 -0
- package/dist/types/jobs/mongo/QuarantineRetentionJobMongo.d.ts +5 -0
- package/dist/types/jobs/mongo/ScanQueueJobMongo.d.ts +10 -0
- package/dist/types/jobs/mongo/SearchIndexJobMongo.d.ts +6 -0
- package/dist/types/jobs/mongo/index.d.ts +9 -0
- package/dist/types/jobs/mongo.d.ts +1 -0
- package/dist/types/jobs/sql/AttachmentExtractionJobSQL.d.ts +6 -0
- package/dist/types/jobs/sql/CalendarReminderJobSQL.d.ts +5 -0
- package/dist/types/jobs/sql/EasDeviceStateCleanupJobSQL.d.ts +5 -0
- package/dist/types/jobs/sql/ExternalShareExpirationJobSQL.d.ts +5 -0
- package/dist/types/jobs/sql/MailboxQuotaRecalcJobSQL.d.ts +7 -0
- package/dist/types/jobs/sql/MeetingSchedulingJobSQL.d.ts +5 -0
- package/dist/types/jobs/sql/QuarantineRetentionJobSQL.d.ts +5 -0
- package/dist/types/jobs/sql/ScanQueueJobSQL.d.ts +10 -0
- package/dist/types/jobs/sql/SearchIndexJobSQL.d.ts +6 -0
- package/dist/types/jobs/sql/index.d.ts +9 -0
- package/dist/types/jobs/sql.d.ts +1 -0
- package/dist/types/models/index.d.ts +1 -0
- package/dist/types/models/mongo/AttachmentMongo.d.ts +22 -0
- package/dist/types/models/mongo/CalendarEventMongo.d.ts +28 -0
- package/dist/types/models/mongo/CalendarShareLinkMongo.d.ts +16 -0
- package/dist/types/models/mongo/ContactListMongo.d.ts +13 -0
- package/dist/types/models/mongo/ContactMongo.d.ts +25 -0
- package/dist/types/models/mongo/DeviceSyncStateMongo.d.ts +18 -0
- package/dist/types/models/mongo/FolderMongo.d.ts +18 -0
- package/dist/types/models/mongo/IngestQueueEntryMongo.d.ts +17 -0
- package/dist/types/models/mongo/MailboxMongo.d.ts +18 -0
- package/dist/types/models/mongo/MessageMongo.d.ts +29 -0
- package/dist/types/models/mongo/NoteMongo.d.ts +16 -0
- package/dist/types/models/mongo/QuarantineEntryMongo.d.ts +18 -0
- package/dist/types/models/mongo/ScanResultMongo.d.ts +23 -0
- package/dist/types/models/mongo/SearchIndexStateMongo.d.ts +16 -0
- package/dist/types/models/mongo/TaskMongo.d.ts +19 -0
- package/dist/types/models/mongo/index.d.ts +15 -0
- package/dist/types/models/mongo.d.ts +1 -0
- package/dist/types/models/sql/AttachmentSQL.d.ts +22 -0
- package/dist/types/models/sql/CalendarEventSQL.d.ts +28 -0
- package/dist/types/models/sql/CalendarShareLinkSQL.d.ts +16 -0
- package/dist/types/models/sql/ContactListSQL.d.ts +13 -0
- package/dist/types/models/sql/ContactSQL.d.ts +25 -0
- package/dist/types/models/sql/DeviceSyncStateSQL.d.ts +18 -0
- package/dist/types/models/sql/FolderSQL.d.ts +18 -0
- package/dist/types/models/sql/IngestQueueEntrySQL.d.ts +17 -0
- package/dist/types/models/sql/MailboxSQL.d.ts +18 -0
- package/dist/types/models/sql/MessageSQL.d.ts +29 -0
- package/dist/types/models/sql/NoteSQL.d.ts +16 -0
- package/dist/types/models/sql/QuarantineEntrySQL.d.ts +18 -0
- package/dist/types/models/sql/ScanResultSQL.d.ts +23 -0
- package/dist/types/models/sql/SearchIndexStateSQL.d.ts +16 -0
- package/dist/types/models/sql/TaskSQL.d.ts +19 -0
- package/dist/types/models/sql/index.d.ts +15 -0
- package/dist/types/models/sql.d.ts +1 -0
- package/dist/types/models/types.d.ts +541 -0
- package/dist/types/mongo.d.ts +3 -0
- package/dist/types/push/MailPushRoute.d.ts +37 -0
- package/dist/types/push/index.d.ts +1 -0
- package/dist/types/routes/BaseAttachmentRoute.d.ts +24 -0
- package/dist/types/routes/BaseCalendarShareLinkRoute.d.ts +35 -0
- package/dist/types/routes/BaseFolderRoute.d.ts +58 -0
- package/dist/types/routes/BaseMailIngestRoute.d.ts +47 -0
- package/dist/types/routes/BaseMailboxRoute.d.ts +60 -0
- package/dist/types/routes/BaseMessageRoute.d.ts +27 -0
- package/dist/types/routes/BaseScopedChildRoute.d.ts +61 -0
- package/dist/types/routes/BaseSearchRoute.d.ts +23 -0
- package/dist/types/routes/index.d.ts +8 -0
- package/dist/types/routes/mongo/AttachmentRouteMongo.d.ts +6 -0
- package/dist/types/routes/mongo/CalendarEventRouteMongo.d.ts +6 -0
- package/dist/types/routes/mongo/CalendarShareLinkRouteMongo.d.ts +6 -0
- package/dist/types/routes/mongo/ContactListRouteMongo.d.ts +6 -0
- package/dist/types/routes/mongo/ContactRouteMongo.d.ts +6 -0
- package/dist/types/routes/mongo/FolderRouteMongo.d.ts +5 -0
- package/dist/types/routes/mongo/IngestQueueRouteMongo.d.ts +13 -0
- package/dist/types/routes/mongo/MailIngestRouteMongo.d.ts +6 -0
- package/dist/types/routes/mongo/MailboxRouteMongo.d.ts +8 -0
- package/dist/types/routes/mongo/MessageRouteMongo.d.ts +6 -0
- package/dist/types/routes/mongo/NoteRouteMongo.d.ts +6 -0
- package/dist/types/routes/mongo/QuarantineRouteMongo.d.ts +15 -0
- package/dist/types/routes/mongo/SearchRouteMongo.d.ts +5 -0
- package/dist/types/routes/mongo/TaskRouteMongo.d.ts +6 -0
- package/dist/types/routes/mongo/index.d.ts +14 -0
- package/dist/types/routes/mongo.d.ts +1 -0
- package/dist/types/routes/sql/AttachmentRouteSQL.d.ts +6 -0
- package/dist/types/routes/sql/CalendarEventRouteSQL.d.ts +6 -0
- package/dist/types/routes/sql/CalendarShareLinkRouteSQL.d.ts +6 -0
- package/dist/types/routes/sql/ContactListRouteSQL.d.ts +6 -0
- package/dist/types/routes/sql/ContactRouteSQL.d.ts +6 -0
- package/dist/types/routes/sql/FolderRouteSQL.d.ts +5 -0
- package/dist/types/routes/sql/IngestQueueRouteSQL.d.ts +9 -0
- package/dist/types/routes/sql/MailIngestRouteSQL.d.ts +23 -0
- package/dist/types/routes/sql/MailboxRouteSQL.d.ts +22 -0
- package/dist/types/routes/sql/MessageRouteSQL.d.ts +6 -0
- package/dist/types/routes/sql/NoteRouteSQL.d.ts +6 -0
- package/dist/types/routes/sql/QuarantineRouteSQL.d.ts +9 -0
- package/dist/types/routes/sql/SearchRouteSQL.d.ts +5 -0
- package/dist/types/routes/sql/TaskRouteSQL.d.ts +6 -0
- package/dist/types/routes/sql/index.d.ts +14 -0
- package/dist/types/routes/sql.d.ts +1 -0
- package/dist/types/scan/AvScanProvider.d.ts +22 -0
- package/dist/types/scan/ClamAvScanProvider.d.ts +17 -0
- package/dist/types/scan/RspamdSpamScanProvider.d.ts +16 -0
- package/dist/types/scan/ScanPipeline.d.ts +53 -0
- package/dist/types/scan/SpamScanProvider.d.ts +29 -0
- package/dist/types/scan/index.d.ts +5 -0
- package/dist/types/search/MongoTextSearchProvider.d.ts +22 -0
- package/dist/types/search/OpenSearchProvider.d.ts +24 -0
- package/dist/types/search/PostgresFullTextSearchProvider.d.ts +21 -0
- package/dist/types/search/SearchProvider.d.ts +62 -0
- package/dist/types/search/extraction/DocxTextExtractor.d.ts +14 -0
- package/dist/types/search/extraction/ExtractorRegistry.d.ts +19 -0
- package/dist/types/search/extraction/HtmlTextExtractor.d.ts +11 -0
- package/dist/types/search/extraction/PdfTextExtractor.d.ts +10 -0
- package/dist/types/search/extraction/PlainTextExtractor.d.ts +10 -0
- package/dist/types/search/extraction/TextExtractor.d.ts +17 -0
- package/dist/types/search/index.d.ts +10 -0
- package/dist/types/sql.d.ts +3 -0
- package/dist/types/transport/MTAIngestAdapter.d.ts +25 -0
- package/dist/types/transport/MailTransport.d.ts +29 -0
- package/dist/types/transport/PostfixSendmailTransport.d.ts +15 -0
- package/dist/types/transport/index.d.ts +3 -0
- package/dist/types/util/FolderUtils.d.ts +15 -0
- package/dist/types/util/MailSendUtils.d.ts +19 -0
- package/dist/types/util/MailboxScopeUtils.d.ts +19 -0
- package/dist/types/util/OptionalDeps.d.ts +9 -0
- package/dist/types/util/RecoverableRepoUtils.d.ts +24 -0
- package/dist/types/util/index.d.ts +12 -0
- package/package.json +122 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type JWTUser } from "@rapidrest/core";
|
|
2
|
+
import { CRUDRoute, HttpRequest, HttpResponse } from "@rapidrest/service-core";
|
|
3
|
+
import { Folder } from "../models/types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Extends the standard `CRUDRoute` CRUD scaffolding for `Folder` with a hybrid permission model — `Folder` is
|
|
6
|
+
* one of the two entities in this library with a real per-record `AccessControlList` (the other is `Mailbox`;
|
|
7
|
+
* see the architecture note on `Message.mailboxUid` in `models/types.ts`), so most of `CRUDRoute`'s default
|
|
8
|
+
* behavior already works correctly and is left untouched here:
|
|
9
|
+
*
|
|
10
|
+
* - `findById`/`update`/`delete`/`truncate` rely on `Folder`'s own record-level ACL, which by default inherits
|
|
11
|
+
* (via `AccessControlList.parentUid`) from its owning `Mailbox`'s ACL — so anyone the mailbox is shared with
|
|
12
|
+
* automatically gets the same access to its folders, while a single folder (e.g. one Calendar) can still be
|
|
13
|
+
* shared more narrowly by adding records directly to *that folder's own* ACL instead. `RepoUtils.findOne()`/
|
|
14
|
+
* `update()`/`delete()` check the record's own resolved ACL chain directly (no class-level fast-fail), so
|
|
15
|
+
* this works correctly once the class-level grant is denied; `truncate()` skips its class-level check
|
|
16
|
+
* entirely whenever `recordACL` is `true` (verified by reading its source) and relies on per-record
|
|
17
|
+
* filtering instead, which is equally safe here for the same reason.
|
|
18
|
+
* - `find`/`count`/`exists` are overridden here, for the same reason every other collection-or-fast-fail-gated
|
|
19
|
+
* operation in this library is: `RepoUtils.find()`/`count()`/`exists()` all check the class-level ACL as an
|
|
20
|
+
* unconditional first gate — before any per-record narrowing, and even that later narrowing falls back to
|
|
21
|
+
* the class grant for a record with no caller-specific entry — so a per-record ACL alone can't safely narrow
|
|
22
|
+
* them once class-level access is granted to anyone. `find`/`count` take an explicit `mailboxUid` query
|
|
23
|
+
* parameter and check permission against it directly; `exists` fetches the specific folder first (bypassing
|
|
24
|
+
* ACL) and then checks permission against *that folder's own* uid (i.e. its real resolved ACL chain), same
|
|
25
|
+
* as `findById` does implicitly.
|
|
26
|
+
* - `create` is also overridden, for a different reason: it seeds the new folder's ACL with `parentUid` set to
|
|
27
|
+
* the owning mailbox's ACL uid, which is what wires up the inheritance described above — this can't be done
|
|
28
|
+
* generically by `RepoUtils.create()`'s own default (it would parent to the `Folder` class ACL instead, which
|
|
29
|
+
* is deny-all and grants nothing) — and, since a folder doesn't exist yet at create time, permission is
|
|
30
|
+
* checked against the target `mailboxUid` from the request body instead. It also publishes a live-update
|
|
31
|
+
* notification (see `push/MailPushRoute.ts`) to the owning mailbox's channel, so a webmail client subscribed
|
|
32
|
+
* to a mailbox sees new folders appear without polling.
|
|
33
|
+
*
|
|
34
|
+
* `find`/`count`/`exists` also resolve an unauthenticated caller's `?shareToken=` query param via the local
|
|
35
|
+
* `resolveEffectiveUser()` helper below (see `BaseScopedChildRoute`'s doc comment for the full explanation of
|
|
36
|
+
* the mechanism this is one half of).
|
|
37
|
+
*
|
|
38
|
+
* KNOWN LIMITATIONS:
|
|
39
|
+
* - `update`/`delete` (folder rename/move/removal) do NOT publish a live-update notification, unlike every
|
|
40
|
+
* mutation on the folder-scoped entities in `BaseScopedChildRoute`. Overriding them here purely to add a
|
|
41
|
+
* notify call would mean re-implementing (and re-testing) the exact ACL-delegation behavior this class's own
|
|
42
|
+
* doc comment above is careful to leave untouched by relying on `CRUDRoute`'s defaults — a real gap, but a
|
|
43
|
+
* deliberate one given how comparatively rare and low-urgency folder structural changes are next to new-mail
|
|
44
|
+
* delivery, matching this library's existing "pragmatic subset, not full fidelity" scope elsewhere.
|
|
45
|
+
* - `findById` (also left on `CRUDRoute`'s default) does NOT resolve `?shareToken=` — a share link's token
|
|
46
|
+
* grants read access to the folder's *children* (e.g. its `CalendarEvent`s, via `BaseScopedChildRoute`), not
|
|
47
|
+
* to fetching the `Folder` record itself by id. A client wanting the calendar's display name alongside its
|
|
48
|
+
* events would need that carried elsewhere (e.g. denormalized onto `CalendarShareLink`), not fetched via this
|
|
49
|
+
* route with a token.
|
|
50
|
+
*
|
|
51
|
+
* @author Jean-Philippe Steinmetz
|
|
52
|
+
*/
|
|
53
|
+
export declare abstract class BaseFolderRoute<T extends Folder> extends CRUDRoute<T> {
|
|
54
|
+
count(params: any, query: any, res: HttpResponse, user?: JWTUser): Promise<any>;
|
|
55
|
+
create(obj: Partial<T> | Partial<T>[], req: HttpRequest, user?: JWTUser): Promise<T | T[]>;
|
|
56
|
+
find(params: any, query: any, user?: JWTUser): Promise<T[]>;
|
|
57
|
+
exists(id: string, query: any, res: HttpResponse, user?: JWTUser): Promise<any>;
|
|
58
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { HttpRequest, HttpResponse } from "@rapidrest/service-core";
|
|
2
|
+
import { IngestQueueEntry, Mailbox } from "../models/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Implements the `MTAIngestAdapter` HTTP contract (see `transport/MTAIngestAdapter.ts`) that the deployment's
|
|
5
|
+
* MTA (Postfix, Haraka, ...) integrates against to hand accepted internet mail to this library. Both endpoints
|
|
6
|
+
* are internal-only — never exposed to the public internet — and gated by a shared bearer secret rather than
|
|
7
|
+
* ordinary user JWT auth, since the caller is the MTA process, not an end user.
|
|
8
|
+
*
|
|
9
|
+
* This class is DB-agnostic; `mailboxClass`/`ingestQueueClass` are supplied by the Mongo/SQL concrete
|
|
10
|
+
* subclasses (`MailIngestRouteMongo`/`MailIngestRouteSQL`), following the same pattern
|
|
11
|
+
* `DefaultAccounts`/`DefaultAccountsMongo` use for a background service spanning multiple entity types.
|
|
12
|
+
*
|
|
13
|
+
* !!Note!! that, like `BasePushRoute`/`BaseStatusRoute`, this class is not automatically registered with a
|
|
14
|
+
* server — the consuming application must apply `@Route("/internal/mta")` to its own subclass. The
|
|
15
|
+
* `MTAIngestAdapter` doc comment's `GET /internal/mta/resolve`/`POST /internal/mta/deliver` paths assume that
|
|
16
|
+
* exact base path is used; if a deployment mounts it elsewhere, its MTA content-filter/lookup configuration
|
|
17
|
+
* must be updated to match.
|
|
18
|
+
*
|
|
19
|
+
* @author Jean-Philippe Steinmetz
|
|
20
|
+
*/
|
|
21
|
+
export declare abstract class BaseMailIngestRoute<M extends Mailbox, Q extends IngestQueueEntry> {
|
|
22
|
+
protected abstract mailboxClass: any;
|
|
23
|
+
protected abstract ingestQueueClass: any;
|
|
24
|
+
private _objectFactory?;
|
|
25
|
+
private mailboxRepo?;
|
|
26
|
+
private ingestQueueRepo?;
|
|
27
|
+
private blobStore?;
|
|
28
|
+
private ingestSecret?;
|
|
29
|
+
private logger;
|
|
30
|
+
/**
|
|
31
|
+
* Builds the query value used to match `Mailbox.aliasAddresses` against the given address. MongoDB's
|
|
32
|
+
* implicit array-element equality lets a plain value match "array contains" directly, so the default here
|
|
33
|
+
* is a no-op passthrough. `MailIngestRouteSQL` overrides this: the SQL backend stores `aliasAddresses` as a
|
|
34
|
+
* serialized `simple-json` column, where a plain equality filter compares against the whole serialized
|
|
35
|
+
* string and never matches a single element.
|
|
36
|
+
*/
|
|
37
|
+
protected aliasQueryValue(address: string): any;
|
|
38
|
+
private init;
|
|
39
|
+
/**
|
|
40
|
+
* Verifies the caller presented the configured internal bearer secret. Deliberately not `@Auth(["jwt"])` —
|
|
41
|
+
* the caller is the local MTA process, not an end user with a JWT. Throws `403` if no secret is configured
|
|
42
|
+
* at all (fail closed, never fail open into an unauthenticated internal endpoint).
|
|
43
|
+
*/
|
|
44
|
+
private authorizeInternalCaller;
|
|
45
|
+
resolve(rcpt: string, req: HttpRequest, res: HttpResponse): Promise<HttpResponse>;
|
|
46
|
+
deliver(req: HttpRequest, res: HttpResponse): Promise<HttpResponse>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type JWTUser } from "@rapidrest/core";
|
|
2
|
+
import { CRUDRoute, HttpRequest, HttpResponse } from "@rapidrest/service-core";
|
|
3
|
+
import { Mailbox } from "../models/types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Extends the standard `CRUDRoute` CRUD scaffolding for `Mailbox` with ACL-driven `find`/`count` overrides,
|
|
6
|
+
* plus a `create` override that bypasses the ACL system entirely. `Mailbox` has a real per-record
|
|
7
|
+
* `AccessControlList` (`@Protect(..., true)`; see the architecture note on `Message.mailboxUid`), whose
|
|
8
|
+
* class-level ACL denies EVERY action to non-trusted callers, including `CREATE`.
|
|
9
|
+
*
|
|
10
|
+
* `create` is deliberately NOT gated by the class-level ACL at all (unlike every other action): provisioning a
|
|
11
|
+
* brand-new mailbox is a pure self-service action (any authenticated user may create their own) with no parent
|
|
12
|
+
* resource to check permission against — `RepoUtils.create()`'s own automatic owner-grant logic is what
|
|
13
|
+
* actually scopes the new mailbox to its creator, not a class-level check. A class-level `CREATE` grant to
|
|
14
|
+
* `.*` was tried first and found to leak: every mailbox's own ACL falls back to that SAME class ACL as its
|
|
15
|
+
* parent whenever a caller has no mailbox-specific record, so *any* authenticated user calling
|
|
16
|
+
* `ACLUtils.hasPermission(user, someOtherMailboxUid, CREATE)` (e.g. `BaseFolderRoute.create()` checking
|
|
17
|
+
* permission to create a folder *in* that mailbox) would incorrectly pass too. Denying `CREATE` at the class
|
|
18
|
+
* level entirely, and having this route check only `user` truthiness before bypassing ACL, closes that leak.
|
|
19
|
+
*
|
|
20
|
+
* A non-trusted caller's `ownerUserUid` is always forced to their own uid, discarding whatever the client
|
|
21
|
+
* sent — self-service creation can only ever create a mailbox *for yourself*. Only a trusted caller may create
|
|
22
|
+
* a mailbox with a different (or no) `ownerUserUid` — the latter is a true ownerless "shared mailbox" (the
|
|
23
|
+
* Exchange concept, e.g. `support@example.com`) with no single owner, only delegates added afterward via
|
|
24
|
+
* `BaseACLRoute` (`@rapidrest/service-core`). `RepoUtils.create()`'s automatic owner-grant is already
|
|
25
|
+
* conditioned on the creator lacking a trusted role, so a trusted caller creating an ownerless mailbox does
|
|
26
|
+
* not, on its own, leave behind a stray self-grant for the admin who happened to create it.
|
|
27
|
+
*
|
|
28
|
+
* `find`/`count` still need overriding despite the real per-record ACL: `RepoUtils.find()`/`count()` both
|
|
29
|
+
* check the class-level ACL as an unconditional first gate *before* any per-record narrowing, and even that
|
|
30
|
+
* later per-record narrowing falls back to the class grant for a record with no caller-specific entry —
|
|
31
|
+
* verified by reading their source. Rather than the old ownership-only (`ownerUserUid: user.uid`) scoping,
|
|
32
|
+
* these now query for every mailbox uid the caller has *any* ACL grant on — owned, shared-with-them as a
|
|
33
|
+
* delegate, or (for a trusted caller) every mailbox unfiltered — via `findAccessibleMailboxUids()`, backed by
|
|
34
|
+
* the exact same `AccessControlList` model `BaseACLRoute` exposes as CRUD (no new API surface). `exists`
|
|
35
|
+
* doesn't need this treatment: it fetches the specific record first (bypassing ACL) and then checks
|
|
36
|
+
* permission against *that record's own* uid via `ACLUtils.hasPermission`, which already resolves ownership,
|
|
37
|
+
* delegate shares, and trusted-role access correctly on its own — see `exists()` below, unchanged.
|
|
38
|
+
* `findById`/`update`/`delete` are unaffected for the same reason: `RepoUtils.findOne()`/`update()`/
|
|
39
|
+
* `delete()` check the *record's own* resolved ACL chain directly (no class-level fast-fail), so once the
|
|
40
|
+
* class-level grant is denied, that chain correctly resolves to "deny" for a caller with no grant and "allow"
|
|
41
|
+
* for the owner or any delegate — `CRUDRoute`'s default behavior for those already works correctly and is
|
|
42
|
+
* left untouched.
|
|
43
|
+
*
|
|
44
|
+
* @author Jean-Philippe Steinmetz
|
|
45
|
+
*/
|
|
46
|
+
export declare abstract class BaseMailboxRoute<T extends Mailbox> extends CRUDRoute<T> {
|
|
47
|
+
protected trustedRoles: string[];
|
|
48
|
+
/**
|
|
49
|
+
* Returns the uids of every mailbox this user has any ACL grant on — as owner, as a shared delegate, or
|
|
50
|
+
* (implicitly, via a wildcard/role record) as a trusted caller. Backend-specific because
|
|
51
|
+
* `AccessControlList`'s storage shape differs (a natively queryable embedded array in Mongo vs. a
|
|
52
|
+
* `simple-json` column in SQL) — implemented by the concrete `MailboxRouteMongo`/`MailboxRouteSQL`
|
|
53
|
+
* subclass, each against the exact same `AccessControlList` collection/table `BaseACLRoute` exposes.
|
|
54
|
+
*/
|
|
55
|
+
protected abstract findAccessibleMailboxUids(user: JWTUser): Promise<string[]>;
|
|
56
|
+
create(obj: T | T[], req: HttpRequest, user?: JWTUser): Promise<T | T[]>;
|
|
57
|
+
find(params: any, query: any, user?: JWTUser): Promise<T[]>;
|
|
58
|
+
count(params: any, query: any, res: HttpResponse, user?: JWTUser): Promise<any>;
|
|
59
|
+
exists(id: string, query: any, res: HttpResponse, user?: JWTUser): Promise<any>;
|
|
60
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type JWTUser } from "@rapidrest/core";
|
|
2
|
+
import { HttpRequest, HttpResponse } from "@rapidrest/service-core";
|
|
3
|
+
import { BaseScopedChildRoute } from "./BaseScopedChildRoute.js";
|
|
4
|
+
import { Message } from "../models/types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Extends `BaseScopedChildRoute` (scoped by `folderUid` — see the architecture note on `Message.mailboxUid`)
|
|
7
|
+
* with a `send` endpoint that composes, (re-)scans, and relays a drafted message via `MailTransport`, then
|
|
8
|
+
* moves it into the mailbox's Sent Items folder. Ordinary `create`/`update`/`delete`/`find`/`findById`
|
|
9
|
+
* (save-draft, edit-draft, discard-draft, list, fetch) are handled entirely by the base class — this is the
|
|
10
|
+
* only mail-specific behavior a `Message` needs beyond scoped CRUD.
|
|
11
|
+
*
|
|
12
|
+
* `folderClass` is supplied by the Mongo/SQL concrete subclasses so this class can look up (and, if needed,
|
|
13
|
+
* create) the mailbox's Sent Items folder without depending on either backend directly.
|
|
14
|
+
*
|
|
15
|
+
* @author Jean-Philippe Steinmetz
|
|
16
|
+
*/
|
|
17
|
+
export declare abstract class BaseMessageRoute<T extends Message> extends BaseScopedChildRoute<T> {
|
|
18
|
+
protected readonly scopeProperty: string;
|
|
19
|
+
protected abstract folderClass: any;
|
|
20
|
+
private folderRepo?;
|
|
21
|
+
private blobStore?;
|
|
22
|
+
private mailTransport?;
|
|
23
|
+
private scanPipeline?;
|
|
24
|
+
private getFolderRepo;
|
|
25
|
+
send(id: string, req: HttpRequest, user?: JWTUser): Promise<T>;
|
|
26
|
+
content(id: string, res: HttpResponse, user?: JWTUser): Promise<void>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type JWTUser } from "@rapidrest/core";
|
|
2
|
+
import { BaseEntity, CRUDRoute, HttpRequest, HttpResponse, type UpdateObject } from "@rapidrest/service-core";
|
|
3
|
+
/**
|
|
4
|
+
* Base CRUD route for any entity that has no `AccessControlList` of its own and is instead permission-checked
|
|
5
|
+
* against a named "scope" field it carries — `folderUid` for most entities (`Message`, `CalendarEvent`,
|
|
6
|
+
* `Task`, `Note`, `Contact`, `Attachment`, `CalendarShareLink`), or `mailboxUid` for the one entity with no
|
|
7
|
+
* folder to belong to (`ContactList`). See the architecture note on `Message.mailboxUid` in `models/types.ts`
|
|
8
|
+
* for the full rationale, and `BaseFolderRoute` for `Folder`'s own (different) pattern.
|
|
9
|
+
*
|
|
10
|
+
* Concrete subclasses set `scopeProperty` to the field name to scope by; everything else is generic. A
|
|
11
|
+
* `mailboxUid`-scoped concrete class still works identically here since `ACLUtils.hasPermission` resolves any
|
|
12
|
+
* uid to its `AccessControlList` regardless of which kind of entity that uid actually names.
|
|
13
|
+
*
|
|
14
|
+
* IMPORTANT implementation note: this class deliberately does NOT delegate to `ModelRoute`'s `doFind`/
|
|
15
|
+
* `doCount`/`doFindById`/`doDelete`/`doTruncate`/`doUpdate` helpers, even though `CRUDRoute` (which this
|
|
16
|
+
* extends) normally does. Those helpers' own internal `RepoUtils.find`/`findOne`/`count`/`truncate` calls do
|
|
17
|
+
* NOT forward an `ignoreACL: true` passed into the helper's `options` down to that internal call — verified by
|
|
18
|
+
* reading their source — so calling them after establishing permission below would still hit this library's
|
|
19
|
+
* deny-by-default class-level ACL and fail. `doCreateObject`/`doBulkCreate` are the exception (verified safe:
|
|
20
|
+
* they forward `options`, `ignoreACL` included, straight through to `RepoUtils.create()`), so `create()` still
|
|
21
|
+
* uses them. Every other operation calls `this.repoUtils` directly instead.
|
|
22
|
+
*
|
|
23
|
+
* Read-shaped denials (`find`/`count`/`exists`/`findById`) fail quietly (an empty result / zero count / `404`)
|
|
24
|
+
* rather than `403`, so a caller with no access can't distinguish "records exist but you can't see them" from
|
|
25
|
+
* "nothing matches". Write-shaped denials (`create`/`update`/`delete`/`truncate`/`updateProperty`) return
|
|
26
|
+
* `403`, since the caller already knows the target scope/record they were trying to act on.
|
|
27
|
+
*
|
|
28
|
+
* Read-shaped methods also resolve an unauthenticated caller's `?shareToken=` query param via the local
|
|
29
|
+
* `resolveEffectiveUser()` helper below before checking permission — this, together with
|
|
30
|
+
* `BaseCalendarShareLinkRoute` keeping a real `ACLRecord` for each link's token in sync on the shared folder's
|
|
31
|
+
* `AccessControlList`, is the entire mechanism behind anonymous `CalendarShareLink` consumption. There is no
|
|
32
|
+
* separate route or lookup for it: a share link's token is checked by `ACLUtils.hasPermission()` exactly the
|
|
33
|
+
* same way any other uid is, through these same `find`/`count`/`exists`/`findById` methods every other caller
|
|
34
|
+
* already uses.
|
|
35
|
+
*
|
|
36
|
+
* @author Jean-Philippe Steinmetz
|
|
37
|
+
*/
|
|
38
|
+
export declare abstract class BaseScopedChildRoute<T extends BaseEntity> extends CRUDRoute<T> {
|
|
39
|
+
/** The property name on `T` (and on incoming create bodies / list query params) to check permission by. */
|
|
40
|
+
protected abstract readonly scopeProperty: string;
|
|
41
|
+
private scopeUidOf;
|
|
42
|
+
private requirePermission;
|
|
43
|
+
/**
|
|
44
|
+
* Publishes live-update notifications (see `push/MailPushRoute.ts`) for create/update/delete on this entity
|
|
45
|
+
* type. Channels are bare `folderUid`/`mailboxUid` values, matching every other permission check in this
|
|
46
|
+
* class — a webmail client subscribed to a folder it can read sees every mutation of a record scoped to it.
|
|
47
|
+
* `this.notificationUtils` is inherited from `ModelRoute` (`@Inject(NotificationUtils)` there already) —
|
|
48
|
+
* publishing is fire-and-forget (see `NotificationUtils.sendMessage()`) and never blocks or fails a request.
|
|
49
|
+
*/
|
|
50
|
+
private notify;
|
|
51
|
+
count(params: any, query: any, res: HttpResponse, user?: JWTUser): Promise<any>;
|
|
52
|
+
create(obj: T | T[], req: HttpRequest, user?: JWTUser): Promise<T | T[]>;
|
|
53
|
+
delete(id: string, version: string | undefined, purge: string | undefined, req: HttpRequest, user?: JWTUser): Promise<void>;
|
|
54
|
+
exists(id: string, query: any, res: HttpResponse, user?: JWTUser): Promise<any>;
|
|
55
|
+
find(params: any, query: any, user?: JWTUser): Promise<T[]>;
|
|
56
|
+
findById(id: string, query: any, user?: JWTUser): Promise<T | null>;
|
|
57
|
+
truncate(params: any, query: any, user?: JWTUser): Promise<void>;
|
|
58
|
+
update(id: string, obj: UpdateObject<T>, req?: HttpRequest, user?: JWTUser): Promise<T>;
|
|
59
|
+
updateBulk(obj: UpdateObject<T>[], req: HttpRequest, user?: JWTUser): Promise<T[]>;
|
|
60
|
+
updateProperty(id: string, propertyName: string, obj: any, user?: JWTUser): Promise<T>;
|
|
61
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type JWTUser } from "@rapidrest/core";
|
|
2
|
+
import { SearchResultPage } from "../search/SearchProvider.js";
|
|
3
|
+
import { Mailbox } from "../models/types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Exposes full-text search across a mailbox's messages/contacts/calendar events/notes/tasks. Unlike every
|
|
6
|
+
* other route in this library, this is NOT a `ModelRoute`/`CRUDRoute` subclass — `RepoUtils.find()` has no
|
|
7
|
+
* full-text query capability, so this route calls the injected `SearchProvider` directly instead.
|
|
8
|
+
*
|
|
9
|
+
* `mailboxClass` is supplied by the Mongo/SQL concrete subclasses. Search is always scoped to a mailbox the
|
|
10
|
+
* requesting user owns (`ownerUserUid === user.uid`) — a client-supplied `mailboxUid` is deliberately not
|
|
11
|
+
* accepted, so this endpoint can never be used to search another user's mailbox.
|
|
12
|
+
*
|
|
13
|
+
* @author Jean-Philippe Steinmetz
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class BaseSearchRoute<M extends Mailbox> {
|
|
16
|
+
protected abstract mailboxClass: any;
|
|
17
|
+
private _objectFactory?;
|
|
18
|
+
private mailboxRepo?;
|
|
19
|
+
private searchProvider?;
|
|
20
|
+
private logger;
|
|
21
|
+
private getMailboxRepo;
|
|
22
|
+
search(text: string, typesParam: string | undefined, cursor: string | undefined, limitParam: string | undefined, user?: JWTUser): Promise<SearchResultPage>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./BaseAttachmentRoute.js";
|
|
2
|
+
export * from "./BaseCalendarShareLinkRoute.js";
|
|
3
|
+
export * from "./BaseFolderRoute.js";
|
|
4
|
+
export * from "./BaseMailboxRoute.js";
|
|
5
|
+
export * from "./BaseMailIngestRoute.js";
|
|
6
|
+
export * from "./BaseMessageRoute.js";
|
|
7
|
+
export * from "./BaseScopedChildRoute.js";
|
|
8
|
+
export * from "./BaseSearchRoute.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AttachmentMongo, MessageMongo } from "../../mongo.js";
|
|
2
|
+
import { BaseAttachmentRoute } from "../BaseAttachmentRoute.js";
|
|
3
|
+
export declare class AttachmentRouteMongo extends BaseAttachmentRoute<AttachmentMongo, MessageMongo> {
|
|
4
|
+
protected readonly repoUtilsClass: any;
|
|
5
|
+
protected messageClass: any;
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CalendarEventMongo } from "../../mongo.js";
|
|
2
|
+
import { BaseScopedChildRoute } from "../BaseScopedChildRoute.js";
|
|
3
|
+
export declare class CalendarEventRouteMongo extends BaseScopedChildRoute<CalendarEventMongo> {
|
|
4
|
+
protected readonly repoUtilsClass: any;
|
|
5
|
+
protected readonly scopeProperty: string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CalendarShareLinkMongo } from "../../mongo.js";
|
|
2
|
+
import { BaseCalendarShareLinkRoute } from "../BaseCalendarShareLinkRoute.js";
|
|
3
|
+
export declare class CalendarShareLinkRouteMongo extends BaseCalendarShareLinkRoute<CalendarShareLinkMongo> {
|
|
4
|
+
protected readonly repoUtilsClass: any;
|
|
5
|
+
protected readonly scopeProperty: string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ContactListMongo } from "../../mongo.js";
|
|
2
|
+
import { BaseScopedChildRoute } from "../BaseScopedChildRoute.js";
|
|
3
|
+
export declare class ContactListRouteMongo extends BaseScopedChildRoute<ContactListMongo> {
|
|
4
|
+
protected readonly repoUtilsClass: any;
|
|
5
|
+
protected readonly scopeProperty: string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ContactMongo } from "../../mongo.js";
|
|
2
|
+
import { BaseScopedChildRoute } from "../BaseScopedChildRoute.js";
|
|
3
|
+
export declare class ContactRouteMongo extends BaseScopedChildRoute<ContactMongo> {
|
|
4
|
+
protected readonly repoUtilsClass: any;
|
|
5
|
+
protected readonly scopeProperty: string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IngestQueueEntryMongo } from "../../mongo.js";
|
|
2
|
+
import { BaseScopedChildRoute } from "../BaseScopedChildRoute.js";
|
|
3
|
+
/**
|
|
4
|
+
* `IngestQueueEntry` has no `AccessControlList` of its own — like every other `mailboxUid`-scoped entity (see
|
|
5
|
+
* `ContactListRouteMongo`), `BaseScopedChildRoute` already provides exactly the CRUD/permission behavior
|
|
6
|
+
* needed: a mailbox owner or delegate sees their own mailbox's pending/failed ingest entries, a trusted caller
|
|
7
|
+
* (ops diagnosing stuck delivery) sees everything via the same ACL bypass every other route in this library
|
|
8
|
+
* already gets for free.
|
|
9
|
+
*/
|
|
10
|
+
export declare class IngestQueueRouteMongo extends BaseScopedChildRoute<IngestQueueEntryMongo> {
|
|
11
|
+
protected readonly repoUtilsClass: any;
|
|
12
|
+
protected readonly scopeProperty: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IngestQueueEntryMongo, MailboxMongo } from "../../mongo.js";
|
|
2
|
+
import { BaseMailIngestRoute } from "../BaseMailIngestRoute.js";
|
|
3
|
+
export declare class MailIngestRouteMongo extends BaseMailIngestRoute<MailboxMongo, IngestQueueEntryMongo> {
|
|
4
|
+
protected mailboxClass: any;
|
|
5
|
+
protected ingestQueueClass: any;
|
|
6
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JWTUser } from "@rapidrest/core";
|
|
2
|
+
import { MailboxMongo } from "../../mongo.js";
|
|
3
|
+
import { BaseMailboxRoute } from "../BaseMailboxRoute.js";
|
|
4
|
+
export declare class MailboxRouteMongo extends BaseMailboxRoute<MailboxMongo> {
|
|
5
|
+
protected readonly repoUtilsClass: any;
|
|
6
|
+
private aclRepo?;
|
|
7
|
+
protected findAccessibleMailboxUids(user: JWTUser): Promise<string[]>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NoteMongo } from "../../mongo.js";
|
|
2
|
+
import { BaseScopedChildRoute } from "../BaseScopedChildRoute.js";
|
|
3
|
+
export declare class NoteRouteMongo extends BaseScopedChildRoute<NoteMongo> {
|
|
4
|
+
protected readonly repoUtilsClass: any;
|
|
5
|
+
protected readonly scopeProperty: string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { QuarantineEntryMongo } from "../../mongo.js";
|
|
2
|
+
import { BaseScopedChildRoute } from "../BaseScopedChildRoute.js";
|
|
3
|
+
/**
|
|
4
|
+
* `QuarantineEntry` has no `AccessControlList` of its own — like every other `mailboxUid`-scoped entity (see
|
|
5
|
+
* `ContactListRouteMongo`), `BaseScopedChildRoute` already provides exactly the CRUD/permission behavior
|
|
6
|
+
* needed: a mailbox owner or delegate sees their own mailbox's quarantined mail (a legitimate webmail
|
|
7
|
+
* "Spam/Quarantine" folder), a trusted caller sees everything via the same ACL bypass every other route in
|
|
8
|
+
* this library already gets for free. "Releasing" a quarantined entry is just a normal `PUT /:id` updating
|
|
9
|
+
* `releasedAt`/`releasedByUserUid` — no bespoke endpoint needed. Re-injecting the released message back into
|
|
10
|
+
* normal delivery (if desired) is a separate follow-up, not implemented here.
|
|
11
|
+
*/
|
|
12
|
+
export declare class QuarantineRouteMongo extends BaseScopedChildRoute<QuarantineEntryMongo> {
|
|
13
|
+
protected readonly repoUtilsClass: any;
|
|
14
|
+
protected readonly scopeProperty: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TaskMongo } from "../../mongo.js";
|
|
2
|
+
import { BaseScopedChildRoute } from "../BaseScopedChildRoute.js";
|
|
3
|
+
export declare class TaskRouteMongo extends BaseScopedChildRoute<TaskMongo> {
|
|
4
|
+
protected readonly repoUtilsClass: any;
|
|
5
|
+
protected readonly scopeProperty: string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./AttachmentRouteMongo.js";
|
|
2
|
+
export * from "./CalendarEventRouteMongo.js";
|
|
3
|
+
export * from "./CalendarShareLinkRouteMongo.js";
|
|
4
|
+
export * from "./ContactListRouteMongo.js";
|
|
5
|
+
export * from "./ContactRouteMongo.js";
|
|
6
|
+
export * from "./FolderRouteMongo.js";
|
|
7
|
+
export * from "./IngestQueueRouteMongo.js";
|
|
8
|
+
export * from "./MailboxRouteMongo.js";
|
|
9
|
+
export * from "./MailIngestRouteMongo.js";
|
|
10
|
+
export * from "./MessageRouteMongo.js";
|
|
11
|
+
export * from "./NoteRouteMongo.js";
|
|
12
|
+
export * from "./QuarantineRouteMongo.js";
|
|
13
|
+
export * from "./SearchRouteMongo.js";
|
|
14
|
+
export * from "./TaskRouteMongo.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./mongo/index.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AttachmentSQL, MessageSQL } from "../../sql.js";
|
|
2
|
+
import { BaseAttachmentRoute } from "../BaseAttachmentRoute.js";
|
|
3
|
+
export declare class AttachmentRouteSQL extends BaseAttachmentRoute<AttachmentSQL, MessageSQL> {
|
|
4
|
+
protected readonly repoUtilsClass: any;
|
|
5
|
+
protected messageClass: any;
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CalendarEventSQL } from "../../sql.js";
|
|
2
|
+
import { BaseScopedChildRoute } from "../BaseScopedChildRoute.js";
|
|
3
|
+
export declare class CalendarEventRouteSQL extends BaseScopedChildRoute<CalendarEventSQL> {
|
|
4
|
+
protected readonly repoUtilsClass: any;
|
|
5
|
+
protected readonly scopeProperty: string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CalendarShareLinkSQL } from "../../sql.js";
|
|
2
|
+
import { BaseCalendarShareLinkRoute } from "../BaseCalendarShareLinkRoute.js";
|
|
3
|
+
export declare class CalendarShareLinkRouteSQL extends BaseCalendarShareLinkRoute<CalendarShareLinkSQL> {
|
|
4
|
+
protected readonly repoUtilsClass: any;
|
|
5
|
+
protected readonly scopeProperty: string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ContactListSQL } from "../../sql.js";
|
|
2
|
+
import { BaseScopedChildRoute } from "../BaseScopedChildRoute.js";
|
|
3
|
+
export declare class ContactListRouteSQL extends BaseScopedChildRoute<ContactListSQL> {
|
|
4
|
+
protected readonly repoUtilsClass: any;
|
|
5
|
+
protected readonly scopeProperty: string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ContactSQL } from "../../sql.js";
|
|
2
|
+
import { BaseScopedChildRoute } from "../BaseScopedChildRoute.js";
|
|
3
|
+
export declare class ContactRouteSQL extends BaseScopedChildRoute<ContactSQL> {
|
|
4
|
+
protected readonly repoUtilsClass: any;
|
|
5
|
+
protected readonly scopeProperty: string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IngestQueueEntrySQL } from "../../sql.js";
|
|
2
|
+
import { BaseScopedChildRoute } from "../BaseScopedChildRoute.js";
|
|
3
|
+
/**
|
|
4
|
+
* See `IngestQueueRouteMongo` for the rationale — identical behavior against the SQL backend.
|
|
5
|
+
*/
|
|
6
|
+
export declare class IngestQueueRouteSQL extends BaseScopedChildRoute<IngestQueueEntrySQL> {
|
|
7
|
+
protected readonly repoUtilsClass: any;
|
|
8
|
+
protected readonly scopeProperty: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IngestQueueEntrySQL, MailboxSQL } from "../../sql.js";
|
|
2
|
+
import { BaseMailIngestRoute } from "../BaseMailIngestRoute.js";
|
|
3
|
+
export declare class MailIngestRouteSQL extends BaseMailIngestRoute<MailboxSQL, IngestQueueEntrySQL> {
|
|
4
|
+
protected mailboxClass: any;
|
|
5
|
+
protected ingestQueueClass: any;
|
|
6
|
+
/**
|
|
7
|
+
* `MailboxSQL.aliasAddresses` is a `simple-json` column, stored as a serialized JSON array string (e.g.
|
|
8
|
+
* `["a@example.com","b@example.com"]`). A plain equality filter compares against that whole string, so it
|
|
9
|
+
* never matches a single address. Match the serialized substring instead, anchored on the surrounding
|
|
10
|
+
* quotes the JSON encoding produces, so a partial-address match (e.g. "ob@example.co" against a stored
|
|
11
|
+
* "bob@example.com") can't produce a false positive.
|
|
12
|
+
*
|
|
13
|
+
* Returns a TypeORM `Raw()` `FindOperator` (a live object, not an `op(value)`-encoded string) so this can
|
|
14
|
+
* bind `%`/`_` as literal characters via an explicit `ESCAPE` clause — `RepoUtils`'s shared query-string DSL
|
|
15
|
+
* has no such escaping for its own `like(...)` operator, and `address` here ultimately originates from
|
|
16
|
+
* whatever RCPT TO value an anonymous internet SMTP client sends. Without escaping, an address containing
|
|
17
|
+
* `%`/`_` would turn this intended *exact*-alias-match into a wildcard/substring match, enabling blind
|
|
18
|
+
* alias enumeration via `GET /internal/mta/resolve`'s 200/404 response and mis-delivery to an unintended
|
|
19
|
+
* mailbox whose alias happens to satisfy the resulting pattern - a real, confirmed vulnerability, not a
|
|
20
|
+
* theoretical one.
|
|
21
|
+
*/
|
|
22
|
+
protected aliasQueryValue(address: string): any;
|
|
23
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { JWTUser } from "@rapidrest/core";
|
|
2
|
+
import { MailboxSQL } from "../../sql.js";
|
|
3
|
+
import { BaseMailboxRoute } from "../BaseMailboxRoute.js";
|
|
4
|
+
export declare class MailboxRouteSQL extends BaseMailboxRoute<MailboxSQL> {
|
|
5
|
+
protected readonly repoUtilsClass: any;
|
|
6
|
+
private aclRepo?;
|
|
7
|
+
/**
|
|
8
|
+
* `AccessControlListSQL.records` is a `simple-json` column (serialized as a single JSON string), the same
|
|
9
|
+
* shape as `MailboxSQL.aliasAddresses` — see `MailIngestRouteSQL.aliasQueryValue()` for the identical
|
|
10
|
+
* problem/solution this mirrors: match the serialized substring via `LIKE`, anchored on the `userOrRoleId`
|
|
11
|
+
* key specifically (not just any quoted occurrence, which could otherwise false-positive-match a
|
|
12
|
+
* coincidentally identical string inside a record's `actions` array) and escaped so a candidate id
|
|
13
|
+
* containing `%`/`_` can't turn this intended exact match into an unintended wildcard/substring match.
|
|
14
|
+
*
|
|
15
|
+
* KNOWN LIMITATION: a `LIKE '%...%'` scan of the whole `records` column can't use a standard index the way
|
|
16
|
+
* a normalized join table could, so this degrades on a very large ACL table (every mailbox/folder/message/
|
|
17
|
+
* etc.'s ACL lives in this one table). Acceptable for now given the library's existing precedent of
|
|
18
|
+
* similar tradeoffs elsewhere (e.g. search index eventual consistency); revisit with a dedicated
|
|
19
|
+
* reverse-lookup table if this becomes a real bottleneck.
|
|
20
|
+
*/
|
|
21
|
+
protected findAccessibleMailboxUids(user: JWTUser): Promise<string[]>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NoteSQL } from "../../sql.js";
|
|
2
|
+
import { BaseScopedChildRoute } from "../BaseScopedChildRoute.js";
|
|
3
|
+
export declare class NoteRouteSQL extends BaseScopedChildRoute<NoteSQL> {
|
|
4
|
+
protected readonly repoUtilsClass: any;
|
|
5
|
+
protected readonly scopeProperty: string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { QuarantineEntrySQL } from "../../sql.js";
|
|
2
|
+
import { BaseScopedChildRoute } from "../BaseScopedChildRoute.js";
|
|
3
|
+
/**
|
|
4
|
+
* See `QuarantineRouteMongo` for the rationale — identical behavior against the SQL backend.
|
|
5
|
+
*/
|
|
6
|
+
export declare class QuarantineRouteSQL extends BaseScopedChildRoute<QuarantineEntrySQL> {
|
|
7
|
+
protected readonly repoUtilsClass: any;
|
|
8
|
+
protected readonly scopeProperty: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TaskSQL } from "../../sql.js";
|
|
2
|
+
import { BaseScopedChildRoute } from "../BaseScopedChildRoute.js";
|
|
3
|
+
export declare class TaskRouteSQL extends BaseScopedChildRoute<TaskSQL> {
|
|
4
|
+
protected readonly repoUtilsClass: any;
|
|
5
|
+
protected readonly scopeProperty: string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./AttachmentRouteSQL.js";
|
|
2
|
+
export * from "./CalendarEventRouteSQL.js";
|
|
3
|
+
export * from "./CalendarShareLinkRouteSQL.js";
|
|
4
|
+
export * from "./ContactListRouteSQL.js";
|
|
5
|
+
export * from "./ContactRouteSQL.js";
|
|
6
|
+
export * from "./FolderRouteSQL.js";
|
|
7
|
+
export * from "./IngestQueueRouteSQL.js";
|
|
8
|
+
export * from "./MailboxRouteSQL.js";
|
|
9
|
+
export * from "./MailIngestRouteSQL.js";
|
|
10
|
+
export * from "./MessageRouteSQL.js";
|
|
11
|
+
export * from "./NoteRouteSQL.js";
|
|
12
|
+
export * from "./QuarantineRouteSQL.js";
|
|
13
|
+
export * from "./SearchRouteSQL.js";
|
|
14
|
+
export * from "./TaskRouteSQL.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./sql/index.js";
|