@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,541 @@
|
|
|
1
|
+
import { BaseEntity, RecoverableBaseEntity } from "@rapidrest/service-core";
|
|
2
|
+
/**
|
|
3
|
+
* The kind of well-known folder a `Folder` represents. `USER` is any folder created by the mailbox owner
|
|
4
|
+
* (or a client) rather than one of the special system folders every mailbox is provisioned with.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum FolderType {
|
|
7
|
+
INBOX = "inbox",
|
|
8
|
+
SENT_ITEMS = "sent_items",
|
|
9
|
+
DRAFTS = "drafts",
|
|
10
|
+
DELETED_ITEMS = "deleted_items",
|
|
11
|
+
OUTBOX = "outbox",
|
|
12
|
+
JUNK = "junk",
|
|
13
|
+
CALENDAR = "calendar",
|
|
14
|
+
CONTACTS = "contacts",
|
|
15
|
+
TASKS = "tasks",
|
|
16
|
+
NOTES = "notes",
|
|
17
|
+
USER = "user"
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Defines a single mailbox belonging to a `User`. A mailbox is the root of a user's Folder hierarchy and the
|
|
21
|
+
* unit that MAPI/EAS clients log on to.
|
|
22
|
+
*
|
|
23
|
+
* @author Jean-Philippe Steinmetz
|
|
24
|
+
*/
|
|
25
|
+
export interface Mailbox extends BaseEntity {
|
|
26
|
+
/**
|
|
27
|
+
* The unique identifier of the `User` (from `@rapidrest/auth`) that owns this mailbox, if any. `undefined`
|
|
28
|
+
* for a true shared mailbox (the Exchange "shared mailbox" concept, e.g. `support@example.com`) that has
|
|
29
|
+
* no single owner — access to one of those is granted entirely via delegate `ACLRecord`s on the mailbox's
|
|
30
|
+
* own `AccessControlList` instead. Creating an ownerless mailbox is a trusted-role-only action; a regular
|
|
31
|
+
* self-service `create()` call always still makes the caller the owner. See `BaseMailboxRoute` for how
|
|
32
|
+
* `find()`/`count()` resolve visibility (owned + shared + trusted-caller-sees-all) entirely from the ACL
|
|
33
|
+
* system rather than from this field.
|
|
34
|
+
*/
|
|
35
|
+
ownerUserUid?: string;
|
|
36
|
+
/** The primary SMTP address that mail addressed to this mailbox is delivered under. */
|
|
37
|
+
primarySmtpAddress: string;
|
|
38
|
+
/** Additional SMTP addresses that also deliver to this mailbox. */
|
|
39
|
+
aliasAddresses: string[];
|
|
40
|
+
/** The display name shown to recipients (e.g. in the `From` header) for mail sent from this mailbox. */
|
|
41
|
+
displayName: string;
|
|
42
|
+
/** The IANA timezone identifier (e.g. `America/Los_Angeles`) used to render dates/times for this mailbox. */
|
|
43
|
+
timezone: string;
|
|
44
|
+
/** The maximum total size, in bytes, of all messages/attachments this mailbox may store. */
|
|
45
|
+
quotaBytes: number;
|
|
46
|
+
/** The current total size, in bytes, of all messages/attachments stored in this mailbox. */
|
|
47
|
+
usedBytes: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Defines a single folder within a `Mailbox`. Folders form a hierarchy via `parentFolderUid` and hold
|
|
51
|
+
* `Message`, `CalendarEvent`, `Contact`, `Task`, or `Note` records depending on `type`.
|
|
52
|
+
*
|
|
53
|
+
* Extends `RecoverableBaseEntity` (soft delete, `deleted: boolean`) rather than plain `BaseEntity` so EAS
|
|
54
|
+
* `FolderSync` can report a removed folder to an already-synced device — see `RecoverableRepoUtils` (in
|
|
55
|
+
* `util/`) and `eas/EasSyncKeyUtils.ts` for the mechanism this backs.
|
|
56
|
+
*
|
|
57
|
+
* @author Jean-Philippe Steinmetz
|
|
58
|
+
*/
|
|
59
|
+
export interface Folder extends RecoverableBaseEntity {
|
|
60
|
+
/** The unique identifier of the `Mailbox` this folder belongs to. */
|
|
61
|
+
mailboxUid: string;
|
|
62
|
+
/** The display name of the folder. */
|
|
63
|
+
name: string;
|
|
64
|
+
/** The kind of well-known folder this is, or `USER` for an ordinary user-created folder. */
|
|
65
|
+
type: FolderType;
|
|
66
|
+
/** The unique identifier of the parent folder, or `undefined` if this is a top-level folder. */
|
|
67
|
+
parentFolderUid?: string;
|
|
68
|
+
/** The number of unread items contained directly in this folder. */
|
|
69
|
+
unreadCount: number;
|
|
70
|
+
/** The total number of items contained directly in this folder. */
|
|
71
|
+
totalCount: number;
|
|
72
|
+
/**
|
|
73
|
+
* A monotonically increasing counter bumped on every change (add/change/delete of a contained item, or of
|
|
74
|
+
* the folder itself) to this folder's contents. EAS `SyncKey` and MAPI ICS-style folder sync state are both
|
|
75
|
+
* derived from this value.
|
|
76
|
+
*/
|
|
77
|
+
syncKeyVersion: number;
|
|
78
|
+
}
|
|
79
|
+
/** The kind of address a `Recipient` represents on a `Message`. */
|
|
80
|
+
export declare enum RecipientType {
|
|
81
|
+
TO = "to",
|
|
82
|
+
CC = "cc",
|
|
83
|
+
BCC = "bcc"
|
|
84
|
+
}
|
|
85
|
+
/** An embedded recipient (or sender) address on a `Message`. */
|
|
86
|
+
export interface Recipient {
|
|
87
|
+
address: string;
|
|
88
|
+
displayName?: string;
|
|
89
|
+
type: RecipientType;
|
|
90
|
+
}
|
|
91
|
+
/** The read/answered/flagged state of a `Message`. */
|
|
92
|
+
export interface MessageFlags {
|
|
93
|
+
read: boolean;
|
|
94
|
+
flagged: boolean;
|
|
95
|
+
answered: boolean;
|
|
96
|
+
forwarded: boolean;
|
|
97
|
+
}
|
|
98
|
+
export declare enum MessageImportance {
|
|
99
|
+
LOW = "low",
|
|
100
|
+
NORMAL = "normal",
|
|
101
|
+
HIGH = "high"
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Defines a single email message stored in a `Folder`. The raw MIME source and sanitized HTML body are not
|
|
105
|
+
* stored inline on this record — they live in the configured `BlobStore`, referenced by
|
|
106
|
+
* `bodyBlobKey`/`sanitizedHtmlBlobKey`.
|
|
107
|
+
*
|
|
108
|
+
* Extends `RecoverableBaseEntity` (soft delete, `deleted: boolean`) rather than plain `BaseEntity` — see the
|
|
109
|
+
* identical note on `Folder`.
|
|
110
|
+
*
|
|
111
|
+
* @author Jean-Philippe Steinmetz
|
|
112
|
+
*/
|
|
113
|
+
export interface Message extends RecoverableBaseEntity {
|
|
114
|
+
/** The unique identifier of the `Folder` this message currently resides in. */
|
|
115
|
+
folderUid: string;
|
|
116
|
+
/**
|
|
117
|
+
* The unique identifier of the `Mailbox` this message belongs to.
|
|
118
|
+
*
|
|
119
|
+
* ARCHITECTURE NOTE (the sharing model for this whole library): only two entities get a real per-record
|
|
120
|
+
* `AccessControlList` (`@Protect(..., true)`) — `Mailbox` (the root) and `Folder` (whose ACL's `parentUid`
|
|
121
|
+
* points at its owning mailbox's ACL, so a mailbox-wide grant flows down to every folder in it by default,
|
|
122
|
+
* while a single folder — e.g. one Calendar — can still be shared independently on its own ACL, which is
|
|
123
|
+
* what makes it possible to share just a calendar with someone without sharing the whole mailbox).
|
|
124
|
+
*
|
|
125
|
+
* Every other entity in this library is a "folder child" with no ACL of its own: `Message`,
|
|
126
|
+
* `CalendarEvent`, `Task`, `Note`, `Contact`, `Attachment`, and `CalendarShareLink` all carry a denormalized
|
|
127
|
+
* `folderUid` and are `@Protect(..., false)` — permissions on an individual message/event/etc. are never
|
|
128
|
+
* granted or revoked independently of the folder it lives in, so giving each of them their own ACL document
|
|
129
|
+
* would be both unnecessary (nothing ever differs per-record) and expensive at scale (one ACL document per
|
|
130
|
+
* message vs. one per folder). `ContactList` has no folder to belong to and instead carries a denormalized
|
|
131
|
+
* `mailboxUid`, checked directly against the mailbox's ACL. Every route for these folder/mailbox-scoped
|
|
132
|
+
* entities checks `ACLUtils.hasPermission(user, record.folderUid | record.mailboxUid, action)` against the
|
|
133
|
+
* owning folder's or mailbox's ACL (which `hasPermission` resolves by uid, following its own `parentUid`
|
|
134
|
+
* chain), then performs the actual `RepoUtils` operation with `ignoreACL: true` since permission was
|
|
135
|
+
* already established. See `BaseScopedChildRoute` for the shared implementation, and `BaseFolderRoute` for
|
|
136
|
+
* `Folder`'s own hybrid pattern (real ACL, but `find`/`count`/`create` still need explicit mailbox-scoped
|
|
137
|
+
* permission checks the same way, since a folder doesn't exist yet at create time and class-level `LIST` is
|
|
138
|
+
* denied for privacy the same reason it is everywhere else in this library).
|
|
139
|
+
*
|
|
140
|
+
* `mailboxUid` itself remains on `Message` (redundant with its `Folder`'s own `mailboxUid`) purely as a
|
|
141
|
+
* denormalized convenience for queries that scan a whole mailbox without caring about folder boundaries
|
|
142
|
+
* (e.g. `MailboxQuotaRecalcJob`) — it plays no role in permission checks.
|
|
143
|
+
*/
|
|
144
|
+
mailboxUid: string;
|
|
145
|
+
/** The RFC 5322 `Message-ID` header value, used to deduplicate and thread messages. */
|
|
146
|
+
messageId: string;
|
|
147
|
+
subject: string;
|
|
148
|
+
from: Recipient;
|
|
149
|
+
recipients: Recipient[];
|
|
150
|
+
sentDate: Date;
|
|
151
|
+
receivedDate: Date;
|
|
152
|
+
/** The key under which the raw MIME source is stored in the `BlobStore`, unmodified from ingestion/send. */
|
|
153
|
+
bodyBlobKey: string;
|
|
154
|
+
/**
|
|
155
|
+
* The key under which the message's HTML body is stored, AFTER `ScanPipeline`'s sanitization pass has run
|
|
156
|
+
* (script/active-content stripped) — set once scanning completes, absent for a not-yet-scanned draft or a
|
|
157
|
+
* message with no HTML body at all. A renderer displaying message content should always prefer this over
|
|
158
|
+
* re-deriving HTML from `bodyBlobKey`'s raw MIME directly, which is never sanitized.
|
|
159
|
+
*/
|
|
160
|
+
sanitizedHtmlBlobKey?: string;
|
|
161
|
+
/** A short plain-text preview of the message body, generated at ingestion time. */
|
|
162
|
+
bodyPreview: string;
|
|
163
|
+
flags: MessageFlags;
|
|
164
|
+
importance: MessageImportance;
|
|
165
|
+
/** The RFC 5322 `In-Reply-To` header value, if this message is a reply. */
|
|
166
|
+
inReplyTo?: string;
|
|
167
|
+
/** The RFC 5322 `References` header value(s), for building conversation threads. */
|
|
168
|
+
references: string[];
|
|
169
|
+
hasAttachments: boolean;
|
|
170
|
+
/** The unique identifier of this message's `ScanResult`, once scanning has completed. */
|
|
171
|
+
scanResultUid?: string;
|
|
172
|
+
/** The timestamp this message was last (re)indexed for full-text search, if ever. */
|
|
173
|
+
searchIndexedAt?: Date;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Defines a single file attached to a `Message`. The binary content is stored in the configured `BlobStore`,
|
|
177
|
+
* referenced by `blobKey`.
|
|
178
|
+
*
|
|
179
|
+
* @author Jean-Philippe Steinmetz
|
|
180
|
+
*/
|
|
181
|
+
export interface Attachment extends BaseEntity {
|
|
182
|
+
/** The unique identifier of the `Message` this attachment belongs to. */
|
|
183
|
+
messageUid: string;
|
|
184
|
+
/**
|
|
185
|
+
* The unique identifier of the `Folder` the owning `Message` resides in. Denormalized from that `Message`
|
|
186
|
+
* so permission checks (see the architecture note on `Message.mailboxUid`) don't require a lookup through
|
|
187
|
+
* it first — an attachment is only ever readable by whoever can read its message, i.e. whoever has
|
|
188
|
+
* permission on that message's folder.
|
|
189
|
+
*/
|
|
190
|
+
folderUid: string;
|
|
191
|
+
/** The unique identifier of the `Mailbox` this attachment belongs to. Denormalized purely for convenience
|
|
192
|
+
* queries that scan a whole mailbox (e.g. `MailboxQuotaRecalcJob`); plays no role in permission checks. */
|
|
193
|
+
mailboxUid: string;
|
|
194
|
+
filename: string;
|
|
195
|
+
mimeType: string;
|
|
196
|
+
sizeBytes: number;
|
|
197
|
+
/** The key under which the attachment's binary content is stored in the `BlobStore`. */
|
|
198
|
+
blobKey: string;
|
|
199
|
+
/** The MIME `Content-ID`, present when this attachment is referenced inline by the message's HTML body. */
|
|
200
|
+
contentId?: string;
|
|
201
|
+
/** `true` if this attachment is displayed inline in the message body rather than listed separately. */
|
|
202
|
+
isInline: boolean;
|
|
203
|
+
/** The key under which this attachment's extracted plain text is stored in the `BlobStore`, once extracted. */
|
|
204
|
+
extractedTextBlobKey?: string;
|
|
205
|
+
/** The unique identifier of this attachment's `ScanResult`, once scanning has completed. */
|
|
206
|
+
scanResultUid?: string;
|
|
207
|
+
}
|
|
208
|
+
export declare enum ContactAddressKind {
|
|
209
|
+
HOME = "home",
|
|
210
|
+
WORK = "work",
|
|
211
|
+
OTHER = "other"
|
|
212
|
+
}
|
|
213
|
+
export interface ContactEmail {
|
|
214
|
+
address: string;
|
|
215
|
+
type: ContactAddressKind;
|
|
216
|
+
}
|
|
217
|
+
export interface ContactPhone {
|
|
218
|
+
phoneNumber: string;
|
|
219
|
+
type: ContactAddressKind;
|
|
220
|
+
}
|
|
221
|
+
export interface ContactPostalAddress {
|
|
222
|
+
street?: string;
|
|
223
|
+
city?: string;
|
|
224
|
+
state?: string;
|
|
225
|
+
postalCode?: string;
|
|
226
|
+
country?: string;
|
|
227
|
+
type: ContactAddressKind;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Defines a single address book entry. Contacts are also the source of truth for MAPI NSPI and EAS GAL
|
|
231
|
+
* (Global Address List) lookups against a mailbox's own address book.
|
|
232
|
+
*
|
|
233
|
+
* Extends `RecoverableBaseEntity` (soft delete, `deleted: boolean`) rather than plain `BaseEntity` — see the
|
|
234
|
+
* identical note on `Folder`.
|
|
235
|
+
*
|
|
236
|
+
* @author Jean-Philippe Steinmetz
|
|
237
|
+
*/
|
|
238
|
+
export interface Contact extends RecoverableBaseEntity {
|
|
239
|
+
/** The unique identifier of the `Mailbox` this contact belongs to. */
|
|
240
|
+
mailboxUid: string;
|
|
241
|
+
/** The unique identifier of the `Folder` (of type `CONTACTS`) this contact resides in. */
|
|
242
|
+
folderUid: string;
|
|
243
|
+
/** The unique identifier of the `ContactList` this contact is a member of, if any. */
|
|
244
|
+
contactListUid?: string;
|
|
245
|
+
displayName: string;
|
|
246
|
+
givenName?: string;
|
|
247
|
+
surname?: string;
|
|
248
|
+
emails: ContactEmail[];
|
|
249
|
+
phones: ContactPhone[];
|
|
250
|
+
addresses: ContactPostalAddress[];
|
|
251
|
+
company?: string;
|
|
252
|
+
jobTitle?: string;
|
|
253
|
+
notes?: string;
|
|
254
|
+
/** The key under which the contact's photo is stored in the `BlobStore`, if one has been set. */
|
|
255
|
+
photoBlobKey?: string;
|
|
256
|
+
/** The unique identifier of an external directory entry (e.g. GAL) this contact was sourced from, if any. */
|
|
257
|
+
sourceUid?: string;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Defines a named grouping (address book / distribution list) of `Contact` records within a `Mailbox`.
|
|
261
|
+
*
|
|
262
|
+
* @author Jean-Philippe Steinmetz
|
|
263
|
+
*/
|
|
264
|
+
export interface ContactList extends BaseEntity {
|
|
265
|
+
mailboxUid: string;
|
|
266
|
+
name: string;
|
|
267
|
+
}
|
|
268
|
+
export declare enum AttendeeRole {
|
|
269
|
+
REQUIRED = "required",
|
|
270
|
+
OPTIONAL = "optional",
|
|
271
|
+
RESOURCE = "resource"
|
|
272
|
+
}
|
|
273
|
+
export declare enum AttendeeResponseStatus {
|
|
274
|
+
NEEDS_ACTION = "needsAction",
|
|
275
|
+
ACCEPTED = "accepted",
|
|
276
|
+
DECLINED = "declined",
|
|
277
|
+
TENTATIVE = "tentative"
|
|
278
|
+
}
|
|
279
|
+
/** An embedded attendee of a `CalendarEvent`. */
|
|
280
|
+
export interface Attendee {
|
|
281
|
+
address: string;
|
|
282
|
+
displayName?: string;
|
|
283
|
+
role: AttendeeRole;
|
|
284
|
+
responseStatus: AttendeeResponseStatus;
|
|
285
|
+
isOrganizer: boolean;
|
|
286
|
+
}
|
|
287
|
+
export declare enum RecurrenceFrequency {
|
|
288
|
+
DAILY = "daily",
|
|
289
|
+
WEEKLY = "weekly",
|
|
290
|
+
MONTHLY = "monthly",
|
|
291
|
+
YEARLY = "yearly"
|
|
292
|
+
}
|
|
293
|
+
/** An embedded RFC 5545 (`RRULE`)-style recurrence definition on a `CalendarEvent`. */
|
|
294
|
+
export interface RecurrenceRule {
|
|
295
|
+
freq: RecurrenceFrequency;
|
|
296
|
+
interval: number;
|
|
297
|
+
byDay?: string[];
|
|
298
|
+
byMonthDay?: number[];
|
|
299
|
+
byMonth?: number[];
|
|
300
|
+
count?: number;
|
|
301
|
+
until?: Date;
|
|
302
|
+
/** Specific occurrence dates removed from the recurrence set. */
|
|
303
|
+
exceptions: Date[];
|
|
304
|
+
}
|
|
305
|
+
export declare enum CalendarEventStatus {
|
|
306
|
+
TENTATIVE = "tentative",
|
|
307
|
+
CONFIRMED = "confirmed",
|
|
308
|
+
CANCELLED = "cancelled"
|
|
309
|
+
}
|
|
310
|
+
export declare enum BusyStatus {
|
|
311
|
+
FREE = "free",
|
|
312
|
+
BUSY = "busy",
|
|
313
|
+
TENTATIVE = "tentative",
|
|
314
|
+
OUT_OF_OFFICE = "oof"
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Defines a single calendar event/meeting stored in a `Folder` of type `CALENDAR`. External sharing and
|
|
318
|
+
* scheduling permissions for the containing folder are governed by the platform's `AccessControlList` (see
|
|
319
|
+
* `ACLAction`), not by any field on this type — see the architecture plan for the `"read"`/`"freebusy"`/
|
|
320
|
+
* `"edit"`/`"delegate"` action convention.
|
|
321
|
+
*
|
|
322
|
+
* Extends `RecoverableBaseEntity` (soft delete, `deleted: boolean`) rather than plain `BaseEntity` — see the
|
|
323
|
+
* identical note on `Folder`.
|
|
324
|
+
*
|
|
325
|
+
* @author Jean-Philippe Steinmetz
|
|
326
|
+
*/
|
|
327
|
+
export interface CalendarEvent extends RecoverableBaseEntity {
|
|
328
|
+
/** The unique identifier of the `Folder` (of type `CALENDAR`) this event resides in. */
|
|
329
|
+
folderUid: string;
|
|
330
|
+
/** The unique identifier of the `Mailbox` this event belongs to. */
|
|
331
|
+
mailboxUid: string;
|
|
332
|
+
title: string;
|
|
333
|
+
location?: string;
|
|
334
|
+
startDate: Date;
|
|
335
|
+
endDate: Date;
|
|
336
|
+
allDay: boolean;
|
|
337
|
+
/** The IANA timezone identifier the event's start/end times were authored in. */
|
|
338
|
+
timezone: string;
|
|
339
|
+
organizer: Recipient;
|
|
340
|
+
attendees: Attendee[];
|
|
341
|
+
recurrenceRule?: RecurrenceRule;
|
|
342
|
+
/** For a single occurrence of a recurring event that has been individually modified, its original start date. */
|
|
343
|
+
recurrenceId?: Date;
|
|
344
|
+
status: CalendarEventStatus;
|
|
345
|
+
busyStatus: BusyStatus;
|
|
346
|
+
/** The number of minutes before `startDate` that a reminder should be dispatched, if any. */
|
|
347
|
+
reminderMinutesBeforeStart?: number;
|
|
348
|
+
/** A stable identifier (RFC 5545 `UID`) for this event, shared across all clients/protocols and iTIP messages. */
|
|
349
|
+
icalUid: string;
|
|
350
|
+
/** The iTIP revision counter (RFC 5546 `SEQUENCE`), incremented on every scheduling-relevant change. */
|
|
351
|
+
sequence: number;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Supports anonymous, unauthenticated external access to a `CalendarEvent` folder's free/busy information (or
|
|
355
|
+
* broader access, per `permittedActions`) via a shareable link. A calendar's sharing is otherwise just ordinary
|
|
356
|
+
* `AccessControlList` management on its `Folder` (see `BaseFolderRoute`/`BaseScopedChildRoute`'s doc comments)
|
|
357
|
+
* — this entity exists solely to add what a bare ACL record can't: a uniquely generated, revocable/expiring
|
|
358
|
+
* credential a link recipient doesn't have to authenticate to use. `token` is granted directly as a real
|
|
359
|
+
* `ACLRecord` (`{userOrRoleId: token, actions: permittedActions}`) on the shared folder's own
|
|
360
|
+
* `AccessControlList` by `BaseCalendarShareLinkRoute` (revoked the same way on delete/expiry) — an anonymous
|
|
361
|
+
* request presenting it via `?shareToken=` is resolved into a synthetic identity checked by the exact same
|
|
362
|
+
* `ACLUtils.hasPermission()` call every other caller goes through (see `BaseScopedChildRoute`'s
|
|
363
|
+
* `resolveEffectiveUser()`). There is no separate lookup route or bespoke permission model for it.
|
|
364
|
+
*
|
|
365
|
+
* @author Jean-Philippe Steinmetz
|
|
366
|
+
*/
|
|
367
|
+
export interface CalendarShareLink extends BaseEntity {
|
|
368
|
+
/**
|
|
369
|
+
* The unique, unguessable token embedded in the shared URL, minted server-side (see
|
|
370
|
+
* `BaseCalendarShareLinkRoute.create()`) and immutable thereafter. Doubles as the `userOrRoleId` of the
|
|
371
|
+
* `ACLRecord` this link grants on its `folderUid`'s `AccessControlList`.
|
|
372
|
+
*/
|
|
373
|
+
token: string;
|
|
374
|
+
/**
|
|
375
|
+
* The unique identifier of the `Folder` (of type `CALENDAR`) being shared. Managing this share link itself
|
|
376
|
+
* (create/list/delete, by someone with access to the calendar) is permission-checked against this folder's
|
|
377
|
+
* `AccessControlList`, the same as every other folder-scoped child entity in this library — see the
|
|
378
|
+
* architecture note on `Message.mailboxUid`.
|
|
379
|
+
*/
|
|
380
|
+
folderUid: string;
|
|
381
|
+
/** The actions (see `ACLAction`) granted to holders of this link, e.g. `["freebusy"]` or `["read"]`. */
|
|
382
|
+
permittedActions: string[];
|
|
383
|
+
/** The date/time after which this link is no longer valid. */
|
|
384
|
+
expiresAt?: Date;
|
|
385
|
+
createdByUserUid: string;
|
|
386
|
+
}
|
|
387
|
+
export declare enum TaskPriority {
|
|
388
|
+
LOW = "low",
|
|
389
|
+
NORMAL = "normal",
|
|
390
|
+
HIGH = "high"
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Defines a single to-do item stored in a `Folder` of type `TASKS`.
|
|
394
|
+
*
|
|
395
|
+
* Extends `RecoverableBaseEntity` (soft delete, `deleted: boolean`) rather than plain `BaseEntity` — see the
|
|
396
|
+
* identical note on `Folder`.
|
|
397
|
+
*
|
|
398
|
+
* @author Jean-Philippe Steinmetz
|
|
399
|
+
*/
|
|
400
|
+
export interface Task extends RecoverableBaseEntity {
|
|
401
|
+
mailboxUid: string;
|
|
402
|
+
folderUid: string;
|
|
403
|
+
title: string;
|
|
404
|
+
body?: string;
|
|
405
|
+
dueDate?: Date;
|
|
406
|
+
completed: boolean;
|
|
407
|
+
priority: TaskPriority;
|
|
408
|
+
reminderDate?: Date;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Defines a single free-form note stored in a `Folder` of type `NOTES`.
|
|
412
|
+
*
|
|
413
|
+
* @author Jean-Philippe Steinmetz
|
|
414
|
+
*/
|
|
415
|
+
export interface Note extends BaseEntity {
|
|
416
|
+
mailboxUid: string;
|
|
417
|
+
folderUid: string;
|
|
418
|
+
title: string;
|
|
419
|
+
body: string;
|
|
420
|
+
/** An optional display color hint (e.g. a hex code) for the note, as commonly supported by note UIs. */
|
|
421
|
+
color?: string;
|
|
422
|
+
}
|
|
423
|
+
/** The kind of record a `ScanResult` was produced for. */
|
|
424
|
+
export declare enum ScanTargetType {
|
|
425
|
+
MESSAGE = "message",
|
|
426
|
+
ATTACHMENT = "attachment"
|
|
427
|
+
}
|
|
428
|
+
export declare enum SpamVerdict {
|
|
429
|
+
CLEAN = "clean",
|
|
430
|
+
SUSPECT = "suspect",
|
|
431
|
+
SPAM = "spam"
|
|
432
|
+
}
|
|
433
|
+
export declare enum AvVerdict {
|
|
434
|
+
CLEAN = "clean",
|
|
435
|
+
INFECTED = "infected",
|
|
436
|
+
ERROR = "error"
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Defines the recorded outcome of running the SPAM/AV `ScanPipeline` against a `Message` or `Attachment`.
|
|
440
|
+
*
|
|
441
|
+
* @author Jean-Philippe Steinmetz
|
|
442
|
+
*/
|
|
443
|
+
export interface ScanResult extends BaseEntity {
|
|
444
|
+
targetType: ScanTargetType;
|
|
445
|
+
/** The unique identifier of the `Message` or `Attachment` (per `targetType`) that was scanned. */
|
|
446
|
+
targetUid: string;
|
|
447
|
+
spamScore: number;
|
|
448
|
+
spamVerdict: SpamVerdict;
|
|
449
|
+
/** The symbolic names (e.g. rspamd symbols) that contributed to the spam verdict. */
|
|
450
|
+
spamSymbols: string[];
|
|
451
|
+
avVerdict: AvVerdict;
|
|
452
|
+
/** The name of the malware signature matched, if `avVerdict` is `INFECTED`. */
|
|
453
|
+
avSignatureName?: string;
|
|
454
|
+
scannedAt: Date;
|
|
455
|
+
/** The version identifiers of the spam/AV engines used, for auditability as signatures update over time. */
|
|
456
|
+
providerVersions: {
|
|
457
|
+
spam?: string;
|
|
458
|
+
av?: string;
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
export declare enum QuarantineReason {
|
|
462
|
+
INFECTED = "infected",
|
|
463
|
+
SPAM_POLICY = "spam_policy",
|
|
464
|
+
OTHER = "other"
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Defines a single message held out of normal delivery pending review, because it was found infected or
|
|
468
|
+
* because organizational policy quarantines spam above a configured threshold rather than delivering to Junk.
|
|
469
|
+
* A quarantined message never appears in any `Folder` or client sync until released.
|
|
470
|
+
*
|
|
471
|
+
* @author Jean-Philippe Steinmetz
|
|
472
|
+
*/
|
|
473
|
+
export interface QuarantineEntry extends BaseEntity {
|
|
474
|
+
/** The unique identifier of the `Mailbox` the message was addressed to. */
|
|
475
|
+
mailboxUid: string;
|
|
476
|
+
/** The unique identifier of the `Message` record, if one was ever created for this delivery attempt. */
|
|
477
|
+
originalMessageUid?: string;
|
|
478
|
+
reason: QuarantineReason;
|
|
479
|
+
scanResultUid: string;
|
|
480
|
+
/** The key under which the original raw MIME source is stored in the `BlobStore`. */
|
|
481
|
+
rawBlobKey: string;
|
|
482
|
+
releasedAt?: Date;
|
|
483
|
+
releasedByUserUid?: string;
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Tracks whether a given entity's content is currently reflected in a specific `SearchProvider`'s index,
|
|
487
|
+
* decoupling "committed to the primary datastore" from "visible in search" (the two are only eventually
|
|
488
|
+
* consistent, reconciled by `SearchIndexJob`).
|
|
489
|
+
*
|
|
490
|
+
* @author Jean-Philippe Steinmetz
|
|
491
|
+
*/
|
|
492
|
+
export interface SearchIndexState extends BaseEntity {
|
|
493
|
+
entityType: string;
|
|
494
|
+
entityUid: string;
|
|
495
|
+
/** The name of the `SearchProvider` implementation this state row applies to. */
|
|
496
|
+
provider: string;
|
|
497
|
+
indexedAt: Date;
|
|
498
|
+
/** A content hash used to detect whether re-indexing is needed after this state was last recorded. */
|
|
499
|
+
contentHash: string;
|
|
500
|
+
}
|
|
501
|
+
export declare enum IngestStatus {
|
|
502
|
+
PENDING = "pending",
|
|
503
|
+
SCANNING = "scanning",
|
|
504
|
+
DELIVERED = "delivered",
|
|
505
|
+
FAILED = "failed"
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* A staging record for one raw message accepted by the MTA (Postfix) and handed to `MailIngestRoute`, before
|
|
509
|
+
* scanning/parsing/delivery has run. Kept separate from `QuarantineEntry` (which holds messages that *failed*
|
|
510
|
+
* scanning) so the two lifecycles — "not yet scanned" vs. "scanned and held" — aren't conflated. Drained by
|
|
511
|
+
* `ScanQueueJob`, which runs the `ScanPipeline` and then either delivers the message to a `Folder`, files it in
|
|
512
|
+
* `QuarantineEntry`, or (on repeated processing failure) marks this entry `FAILED` for operator review.
|
|
513
|
+
*
|
|
514
|
+
* @author Jean-Philippe Steinmetz
|
|
515
|
+
*/
|
|
516
|
+
export interface IngestQueueEntry extends BaseEntity {
|
|
517
|
+
/** The resolved `Mailbox` this message is addressed to. */
|
|
518
|
+
mailboxUid: string;
|
|
519
|
+
envelopeFrom: string;
|
|
520
|
+
envelopeTo: string[];
|
|
521
|
+
/** The key under which the raw MIME source is stored in the `BlobStore`. */
|
|
522
|
+
rawBlobKey: string;
|
|
523
|
+
status: IngestStatus;
|
|
524
|
+
errorMessage?: string;
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Tracks the EAS sync state of a single paired mobile device against a `Mailbox`.
|
|
528
|
+
*
|
|
529
|
+
* @author Jean-Philippe Steinmetz
|
|
530
|
+
*/
|
|
531
|
+
export interface DeviceSyncState extends BaseEntity {
|
|
532
|
+
mailboxUid: string;
|
|
533
|
+
deviceId: string;
|
|
534
|
+
deviceType: string;
|
|
535
|
+
/** The EAS provisioning policy key most recently acknowledged by the device. */
|
|
536
|
+
policyKey?: string;
|
|
537
|
+
/** The per-folder EAS `SyncKey` cursor, keyed by `Folder.uid`. */
|
|
538
|
+
folderSyncKeys: Record<string, string>;
|
|
539
|
+
lastSyncAt?: Date;
|
|
540
|
+
provisioned: boolean;
|
|
541
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BasePushRoute } from "@rapidrest/service-core";
|
|
2
|
+
/**
|
|
3
|
+
* Real-time push notifications for the webmail client, built entirely on `service-core`'s own
|
|
4
|
+
* `BasePushRoute` (WebSocket connect/subscribe/unsubscribe, Redis pub/sub fan-out) — no mail-specific override
|
|
5
|
+
* is needed, since `BasePushRoute`'s channel model already matches this library's own permission model exactly.
|
|
6
|
+
*
|
|
7
|
+
* **Channels are bare entity uids** — a `Mailbox.uid` or a `Folder.uid`, the same uid `ACLUtils.hasPermission()`
|
|
8
|
+
* is checked against everywhere else in this library — NOT a prefixed name like `"mailbox:<uid>"`.
|
|
9
|
+
* `BasePushRoute.connect()`'s SUBSCRIBE handler calls `aclUtils.hasPermission(user, channel, ACLAction.READ)`
|
|
10
|
+
* with the client-supplied channel value verbatim, so a client subscribes directly to the `uid` of whichever
|
|
11
|
+
* `Mailbox`/`Folder` it wants live updates for — that uid resolves to the real `AccessControlList` document the
|
|
12
|
+
* same way every other read in this library does, including the `parentUid` inheritance chain (subscribing to
|
|
13
|
+
* a `Mailbox` uid a caller can read does NOT also deliver that mailbox's folders' events - each `Folder` is a
|
|
14
|
+
* separate channel a client subscribes to independently, matching how `Folder`'s own ACL is a separate document
|
|
15
|
+
* from its owning `Mailbox`'s).
|
|
16
|
+
*
|
|
17
|
+
* Publishing is done via `NotificationUtils.sendMessage(uids, type, action, data)` (`@Inject(NotificationUtils)`
|
|
18
|
+
* in the base route classes) at the mutation call sites — see `BaseScopedChildRoute`/`BaseFolderRoute`/
|
|
19
|
+
* `ScanQueueJob` for where this library calls it. A message arrives at a subscribed client as
|
|
20
|
+
* `{type: "MESSAGE", channel, data: {type, action, data}}` (the outer envelope from `BasePushRoute`'s Redis
|
|
21
|
+
* subscription forwarding, the inner `{type, action, data}` from `NotificationUtils.sendMessage()`).
|
|
22
|
+
*
|
|
23
|
+
* !!Note!! like `BasePushRoute` itself, this class is not automatically registered with a server — the
|
|
24
|
+
* consuming application must apply `@Route("/push")` (or any other chosen base path) to its own subclass:
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { MailPushRoute } from "@rapidrest/mail";
|
|
27
|
+
* import { RouteDecorators } from "@rapidrest/service-core";
|
|
28
|
+
* const { Route } = RouteDecorators;
|
|
29
|
+
*
|
|
30
|
+
* @Route("/push")
|
|
31
|
+
* export class PushRoute extends MailPushRoute {}
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @author Jean-Philippe Steinmetz
|
|
35
|
+
*/
|
|
36
|
+
export declare class MailPushRoute extends BasePushRoute {
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./MailPushRoute.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type JWTUser } from "@rapidrest/core";
|
|
2
|
+
import { HttpRequest, HttpResponse } from "@rapidrest/service-core";
|
|
3
|
+
import { BaseScopedChildRoute } from "./BaseScopedChildRoute.js";
|
|
4
|
+
import { Attachment, Message } from "../models/types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Extends `BaseScopedChildRoute` (scoped by `folderUid` — see the architecture note on `Message.mailboxUid`)
|
|
7
|
+
* for `Attachment` with `upload`/`download` endpoints that move binary content through the configured
|
|
8
|
+
* `BlobStore` — `Attachment` records never carry binary content inline, only metadata plus a `blobKey`.
|
|
9
|
+
* Ordinary `create` is deliberately NOT used for uploading an attachment's content (it would require the
|
|
10
|
+
* client to already have a `blobKey`, which only this route can mint) — `upload` replaces it as the way a new
|
|
11
|
+
* attachment record is created.
|
|
12
|
+
*
|
|
13
|
+
* @author Jean-Philippe Steinmetz
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class BaseAttachmentRoute<T extends Attachment, M extends Message = Message> extends BaseScopedChildRoute<T> {
|
|
16
|
+
protected readonly scopeProperty: string;
|
|
17
|
+
/** The class of the owning `Message` entity, supplied by the Mongo/SQL concrete subclass. */
|
|
18
|
+
protected abstract messageClass: any;
|
|
19
|
+
private messageRepo?;
|
|
20
|
+
private blobStore?;
|
|
21
|
+
private getMessageRepo;
|
|
22
|
+
upload(req: HttpRequest, user?: JWTUser): Promise<T>;
|
|
23
|
+
download(id: string, res: HttpResponse, user?: JWTUser): Promise<void>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type JWTUser } from "@rapidrest/core";
|
|
2
|
+
import { HttpRequest, type UpdateObject } from "@rapidrest/service-core";
|
|
3
|
+
import { BaseScopedChildRoute } from "./BaseScopedChildRoute.js";
|
|
4
|
+
import { CalendarShareLink } from "../models/types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Extends `BaseScopedChildRoute` (scoped by `folderUid`) for `CalendarShareLink` with the two pieces of
|
|
7
|
+
* bookkeeping that make anonymous share-link consumption work with NO separate route or lookup of its own
|
|
8
|
+
* (see `BaseScopedChildRoute`'s doc comment and its local `resolveEffectiveUser()` helper for the read side of
|
|
9
|
+
* this mechanism):
|
|
10
|
+
*
|
|
11
|
+
* 1. `create()`/`update()` always mint (or preserve) `token` server-side, discarding any value the client
|
|
12
|
+
* supplied for it — `token` is the sole credential an anonymous caller presents, so its unguessability can't
|
|
13
|
+
* depend on the client, and it must never change after creation (a client "updating" it would orphan the ACL
|
|
14
|
+
* record already granted under the old value).
|
|
15
|
+
* 2. `create()`/`update()`/`delete()` keep a real `ACLRecord` for the link's token in sync on the shared
|
|
16
|
+
* folder's `AccessControlList` (`{userOrRoleId: token, actions: permittedActions}`) — granted on create,
|
|
17
|
+
* re-granted (upserted, picking up any `permittedActions`/`folderUid` change) on update, and revoked on
|
|
18
|
+
* delete. `ExternalShareExpirationJob` does the same revocation for links it GCs after they expire.
|
|
19
|
+
*
|
|
20
|
+
* @author Jean-Philippe Steinmetz
|
|
21
|
+
*/
|
|
22
|
+
export declare abstract class BaseCalendarShareLinkRoute<T extends CalendarShareLink> extends BaseScopedChildRoute<T> {
|
|
23
|
+
/** Grants (or re-grants, upserting) `link.token` access to `link.folderUid`'s ACL, matching `link`'s
|
|
24
|
+
* current `permittedActions`. A no-op if the folder has no ACL document (should never happen in practice —
|
|
25
|
+
* every `Folder` is seeded with one on creation — but this is a background-adjacent write, not a
|
|
26
|
+
* request the caller is blocked on, so failing open rather than throwing keeps a missing/corrupt folder
|
|
27
|
+
* ACL from turning "create a share link" into a 500. */
|
|
28
|
+
private grantShareTokenAccess;
|
|
29
|
+
/** Removes any ACL record for `token` from `folderUid`'s ACL. A no-op if the folder has no ACL document or
|
|
30
|
+
* no matching record - same fail-open rationale as `grantShareTokenAccess()`. */
|
|
31
|
+
private revokeShareTokenAccess;
|
|
32
|
+
create(obj: T | T[], req: HttpRequest, user?: JWTUser): Promise<T | T[]>;
|
|
33
|
+
update(id: string, obj: UpdateObject<T>, req?: HttpRequest, user?: JWTUser): Promise<T>;
|
|
34
|
+
delete(id: string, version: string | undefined, purge: string | undefined, req: HttpRequest, user?: JWTUser): Promise<void>;
|
|
35
|
+
}
|