@rapidmx/mapi-plugin 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +382 -0
- package/README.md +60 -0
- package/dist/lib/BaseMapiEmsmdbRoute.js +297 -0
- package/dist/lib/BaseMapiEmsmdbRoute.js.map +1 -0
- package/dist/lib/BaseMapiNspiRoute.js +114 -0
- package/dist/lib/BaseMapiNspiRoute.js.map +1 -0
- package/dist/lib/MapiSessionManager.js +119 -0
- package/dist/lib/MapiSessionManager.js.map +1 -0
- package/dist/lib/RopDispatcher.js +34 -0
- package/dist/lib/RopDispatcher.js.map +1 -0
- package/dist/lib/codec/AppointmentRecurrence.js +314 -0
- package/dist/lib/codec/AppointmentRecurrence.js.map +1 -0
- package/dist/lib/codec/BufferCursor.js +213 -0
- package/dist/lib/codec/BufferCursor.js.map +1 -0
- package/dist/lib/codec/GlobalObjectId.js +92 -0
- package/dist/lib/codec/GlobalObjectId.js.map +1 -0
- package/dist/lib/codec/MapiGuid.js +41 -0
- package/dist/lib/codec/MapiGuid.js.map +1 -0
- package/dist/lib/codec/MapiTimeZone.js +93 -0
- package/dist/lib/codec/MapiTimeZone.js.map +1 -0
- package/dist/lib/codec/PropertyValue.js +214 -0
- package/dist/lib/codec/PropertyValue.js.map +1 -0
- package/dist/lib/codec/RopBuffer.js +26 -0
- package/dist/lib/codec/RopBuffer.js.map +1 -0
- package/dist/lib/codec/TypedString.js +54 -0
- package/dist/lib/codec/TypedString.js.map +1 -0
- package/dist/lib/index.js +99 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/mongo/MapiEmsmdbRouteMongo.js +84 -0
- package/dist/lib/mongo/MapiEmsmdbRouteMongo.js.map +1 -0
- package/dist/lib/mongo/MapiNspiRouteMongo.js +33 -0
- package/dist/lib/mongo/MapiNspiRouteMongo.js.map +1 -0
- package/dist/lib/mongo/index.js +7 -0
- package/dist/lib/mongo/index.js.map +1 -0
- package/dist/lib/mongo.js +6 -0
- package/dist/lib/mongo.js.map +1 -0
- package/dist/lib/nspi/NspiBindHandler.js +54 -0
- package/dist/lib/nspi/NspiBindHandler.js.map +1 -0
- package/dist/lib/nspi/NspiCodec.js +106 -0
- package/dist/lib/nspi/NspiCodec.js.map +1 -0
- package/dist/lib/nspi/NspiGetMatchesHandler.js +142 -0
- package/dist/lib/nspi/NspiGetMatchesHandler.js.map +1 -0
- package/dist/lib/rop/CalendarEventTarget.js +27 -0
- package/dist/lib/rop/CalendarEventTarget.js.map +1 -0
- package/dist/lib/rop/CalendarNamedProperties.js +57 -0
- package/dist/lib/rop/CalendarNamedProperties.js.map +1 -0
- package/dist/lib/rop/ContactTarget.js +23 -0
- package/dist/lib/rop/ContactTarget.js.map +1 -0
- package/dist/lib/rop/FastTransferStream.js +98 -0
- package/dist/lib/rop/FastTransferStream.js.map +1 -0
- package/dist/lib/rop/FolderTarget.js +111 -0
- package/dist/lib/rop/FolderTarget.js.map +1 -0
- package/dist/lib/rop/MeetingMessageClassHandler.js +95 -0
- package/dist/lib/rop/MeetingMessageClassHandler.js.map +1 -0
- package/dist/lib/rop/MessageBodyStream.js +42 -0
- package/dist/lib/rop/MessageBodyStream.js.map +1 -0
- package/dist/lib/rop/MessageTarget.js +44 -0
- package/dist/lib/rop/MessageTarget.js.map +1 -0
- package/dist/lib/rop/NamedPropertyRegistry.js +66 -0
- package/dist/lib/rop/NamedPropertyRegistry.js.map +1 -0
- package/dist/lib/rop/PropertyResolvers.js +313 -0
- package/dist/lib/rop/PropertyResolvers.js.map +1 -0
- package/dist/lib/rop/RopCreateMessageHandler.js +53 -0
- package/dist/lib/rop/RopCreateMessageHandler.js.map +1 -0
- package/dist/lib/rop/RopDeleteFolderHandler.js +133 -0
- package/dist/lib/rop/RopDeleteFolderHandler.js.map +1 -0
- package/dist/lib/rop/RopDeleteMessagesHandler.js +70 -0
- package/dist/lib/rop/RopDeleteMessagesHandler.js.map +1 -0
- package/dist/lib/rop/RopFastTransferSourceCopyPropertiesHandler.js +61 -0
- package/dist/lib/rop/RopFastTransferSourceCopyPropertiesHandler.js.map +1 -0
- package/dist/lib/rop/RopFastTransferSourceCopyToHandler.js +61 -0
- package/dist/lib/rop/RopFastTransferSourceCopyToHandler.js.map +1 -0
- package/dist/lib/rop/RopFastTransferSourceGetBufferHandler.js +75 -0
- package/dist/lib/rop/RopFastTransferSourceGetBufferHandler.js.map +1 -0
- package/dist/lib/rop/RopGetContentsTableHandler.js +76 -0
- package/dist/lib/rop/RopGetContentsTableHandler.js.map +1 -0
- package/dist/lib/rop/RopGetHierarchyTableHandler.js +40 -0
- package/dist/lib/rop/RopGetHierarchyTableHandler.js.map +1 -0
- package/dist/lib/rop/RopGetPropertiesSpecificHandler.js +55 -0
- package/dist/lib/rop/RopGetPropertiesSpecificHandler.js.map +1 -0
- package/dist/lib/rop/RopGetPropertyIdsFromNamesHandler.js +92 -0
- package/dist/lib/rop/RopGetPropertyIdsFromNamesHandler.js.map +1 -0
- package/dist/lib/rop/RopHandler.js +2 -0
- package/dist/lib/rop/RopHandler.js.map +1 -0
- package/dist/lib/rop/RopLogonHandler.js +132 -0
- package/dist/lib/rop/RopLogonHandler.js.map +1 -0
- package/dist/lib/rop/RopOpenFolderHandler.js +46 -0
- package/dist/lib/rop/RopOpenFolderHandler.js.map +1 -0
- package/dist/lib/rop/RopOpenMessageHandler.js +81 -0
- package/dist/lib/rop/RopOpenMessageHandler.js.map +1 -0
- package/dist/lib/rop/RopOpenStreamHandler.js +81 -0
- package/dist/lib/rop/RopOpenStreamHandler.js.map +1 -0
- package/dist/lib/rop/RopQueryRowsHandler.js +91 -0
- package/dist/lib/rop/RopQueryRowsHandler.js.map +1 -0
- package/dist/lib/rop/RopReadStreamHandler.js +55 -0
- package/dist/lib/rop/RopReadStreamHandler.js.map +1 -0
- package/dist/lib/rop/RopReleaseHandler.js +20 -0
- package/dist/lib/rop/RopReleaseHandler.js.map +1 -0
- package/dist/lib/rop/RopSaveChangesMessageHandler.js +210 -0
- package/dist/lib/rop/RopSaveChangesMessageHandler.js.map +1 -0
- package/dist/lib/rop/RopSetColumnsHandler.js +52 -0
- package/dist/lib/rop/RopSetColumnsHandler.js.map +1 -0
- package/dist/lib/rop/RopSetPropertiesHandler.js +162 -0
- package/dist/lib/rop/RopSetPropertiesHandler.js.map +1 -0
- package/dist/lib/rop/RopSubmitMessageHandler.js +314 -0
- package/dist/lib/rop/RopSubmitMessageHandler.js.map +1 -0
- package/dist/lib/rop/RopWriteStreamHandler.js +45 -0
- package/dist/lib/rop/RopWriteStreamHandler.js.map +1 -0
- package/dist/lib/rop/TaskNamedProperties.js +29 -0
- package/dist/lib/rop/TaskNamedProperties.js.map +1 -0
- package/dist/lib/rop/TaskTarget.js +19 -0
- package/dist/lib/rop/TaskTarget.js.map +1 -0
- package/dist/lib/sql/MapiEmsmdbRouteSQL.js +84 -0
- package/dist/lib/sql/MapiEmsmdbRouteSQL.js.map +1 -0
- package/dist/lib/sql/MapiNspiRouteSQL.js +33 -0
- package/dist/lib/sql/MapiNspiRouteSQL.js.map +1 -0
- package/dist/lib/sql/index.js +7 -0
- package/dist/lib/sql/index.js.map +1 -0
- package/dist/lib/sql.js +6 -0
- package/dist/lib/sql.js.map +1 -0
- package/dist/types/BaseMapiEmsmdbRoute.d.ts +82 -0
- package/dist/types/BaseMapiNspiRoute.d.ts +38 -0
- package/dist/types/MapiSessionManager.d.ts +130 -0
- package/dist/types/RopDispatcher.d.ts +17 -0
- package/dist/types/codec/AppointmentRecurrence.d.ts +14 -0
- package/dist/types/codec/BufferCursor.d.ts +78 -0
- package/dist/types/codec/GlobalObjectId.d.ts +11 -0
- package/dist/types/codec/MapiGuid.d.ts +6 -0
- package/dist/types/codec/MapiTimeZone.d.ts +7 -0
- package/dist/types/codec/PropertyValue.d.ts +77 -0
- package/dist/types/codec/RopBuffer.d.ts +25 -0
- package/dist/types/codec/TypedString.d.ts +17 -0
- package/dist/types/index.d.ts +94 -0
- package/dist/types/mongo/MapiEmsmdbRouteMongo.d.ts +19 -0
- package/dist/types/mongo/MapiNspiRouteMongo.d.ts +13 -0
- package/dist/types/mongo/index.d.ts +2 -0
- package/dist/types/mongo.d.ts +1 -0
- package/dist/types/nspi/NspiBindHandler.d.ts +22 -0
- package/dist/types/nspi/NspiCodec.d.ts +59 -0
- package/dist/types/nspi/NspiGetMatchesHandler.d.ts +24 -0
- package/dist/types/rop/CalendarEventTarget.d.ts +29 -0
- package/dist/types/rop/CalendarNamedProperties.d.ts +37 -0
- package/dist/types/rop/ContactTarget.d.ts +29 -0
- package/dist/types/rop/FastTransferStream.d.ts +18 -0
- package/dist/types/rop/FolderTarget.d.ts +63 -0
- package/dist/types/rop/MeetingMessageClassHandler.d.ts +36 -0
- package/dist/types/rop/MessageBodyStream.d.ts +26 -0
- package/dist/types/rop/MessageTarget.d.ts +38 -0
- package/dist/types/rop/NamedPropertyRegistry.d.ts +46 -0
- package/dist/types/rop/PropertyResolvers.d.ts +60 -0
- package/dist/types/rop/RopCreateMessageHandler.d.ts +23 -0
- package/dist/types/rop/RopDeleteFolderHandler.d.ts +38 -0
- package/dist/types/rop/RopDeleteMessagesHandler.d.ts +31 -0
- package/dist/types/rop/RopFastTransferSourceCopyPropertiesHandler.d.ts +24 -0
- package/dist/types/rop/RopFastTransferSourceCopyToHandler.d.ts +24 -0
- package/dist/types/rop/RopFastTransferSourceGetBufferHandler.d.ts +23 -0
- package/dist/types/rop/RopGetContentsTableHandler.d.ts +31 -0
- package/dist/types/rop/RopGetHierarchyTableHandler.d.ts +17 -0
- package/dist/types/rop/RopGetPropertiesSpecificHandler.d.ts +23 -0
- package/dist/types/rop/RopGetPropertyIdsFromNamesHandler.d.ts +23 -0
- package/dist/types/rop/RopHandler.d.ts +67 -0
- package/dist/types/rop/RopLogonHandler.d.ts +31 -0
- package/dist/types/rop/RopOpenFolderHandler.d.ts +19 -0
- package/dist/types/rop/RopOpenMessageHandler.d.ts +27 -0
- package/dist/types/rop/RopOpenStreamHandler.d.ts +27 -0
- package/dist/types/rop/RopQueryRowsHandler.d.ts +36 -0
- package/dist/types/rop/RopReadStreamHandler.d.ts +18 -0
- package/dist/types/rop/RopReleaseHandler.d.ts +14 -0
- package/dist/types/rop/RopSaveChangesMessageHandler.d.ts +44 -0
- package/dist/types/rop/RopSetColumnsHandler.d.ts +21 -0
- package/dist/types/rop/RopSetPropertiesHandler.d.ts +38 -0
- package/dist/types/rop/RopSubmitMessageHandler.d.ts +70 -0
- package/dist/types/rop/RopWriteStreamHandler.d.ts +21 -0
- package/dist/types/rop/TaskNamedProperties.d.ts +24 -0
- package/dist/types/rop/TaskTarget.d.ts +24 -0
- package/dist/types/sql/MapiEmsmdbRouteSQL.d.ts +19 -0
- package/dist/types/sql/MapiNspiRouteSQL.d.ts +13 -0
- package/dist/types/sql/index.d.ts +2 -0
- package/dist/types/sql.d.ts +1 -0
- package/package.json +104 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { BufferReader, BufferWriter } from "../codec/BufferCursor.js";
|
|
2
|
+
import type { RopContext, RopHandler } from "./RopHandler.js";
|
|
3
|
+
/** Splits a `PidTagDisplayTo`/`Cc`/`Bcc`-style string on the semicolons real Outlook separates recipients
|
|
4
|
+
* with (also tolerating commas, in case a client or test harness uses that convention instead), trimming and
|
|
5
|
+
* dropping empty entries. Exported since `RopSaveChangesMessageHandler.ts` reads the same accumulated
|
|
6
|
+
* `PidTagDisplayTo`/`Cc` draft properties to build a Calendar item's attendee list. */
|
|
7
|
+
export declare function parseAddressList(value: string | undefined): string[];
|
|
8
|
+
/**
|
|
9
|
+
* `RopSubmitMessage` (`[MS-OXOMSG]`/`[MS-OXCROPS]`): sends a composed message - the actual trigger point for
|
|
10
|
+
* this pragmatic subset's compose/send pipeline, since `RopSaveChangesMessage` itself does no real persistence
|
|
11
|
+
* (see its own doc comment). Builds a raw MIME buffer from whatever `RopSetProperties`/`RopWriteStream` calls
|
|
12
|
+
* accumulated on the draft handle (`Subject`, the `PidTagBody` stream or an inline `PidTagBody` property, and
|
|
13
|
+
* addressing - see below), via `nodemailer`'s `MailComposer` (already a dependency, used elsewhere in this
|
|
14
|
+
* library only to *send*, not build, MIME - this is its first use purely as a RFC 5322 serializer), then calls
|
|
15
|
+
* the exact same `scanAndRelay()` scan-then-relay pipeline `BaseMessageRoute.send()`/EAS's `ComposeMailCommand`
|
|
16
|
+
* already share, and persists a Sent Items copy (mirroring `ComposeMailCommand`'s own always-committed Sent
|
|
17
|
+
* Items behavior for MAPI submission specifically, since - unlike EAS's optional `SaveInSentItems` - a MAPI
|
|
18
|
+
* `RopSubmitMessage` call has no "don't keep a copy" option to honor).
|
|
19
|
+
*
|
|
20
|
+
* **Known, deliberate limitation - no `RopModifyRecipients` support**: real recipient rows (`[MS-OXCMSG]`
|
|
21
|
+
* §2.2.3.2, each with its own `PidTagEmailAddress`/`PidTagRecipientType`) are a substantial structure this
|
|
22
|
+
* pragmatic subset's ROP coverage doesn't include. Instead, addressing is read from `PidTagDisplayTo`/
|
|
23
|
+
* `DisplayCc`/`DisplayBcc` - the same semicolon-separated "cached recipient display string" properties real
|
|
24
|
+
* Outlook *also* always sets via `RopSetProperties` alongside `RopModifyRecipients` (as a display-only
|
|
25
|
+
* convenience cache). This works correctly for the common case of composing to bare, unresolved email
|
|
26
|
+
* addresses (nothing to resolve to a distinct display name) - the case this library's own integration tests
|
|
27
|
+
* exercise - but is **not** a substitute for real recipient rows: a client that resolves typed names against an
|
|
28
|
+
* address book before submitting would populate these fields with display names, not addresses, and this
|
|
29
|
+
* pragmatic subset has no way to recover a real SMTP address from a bare display name. Documented here rather
|
|
30
|
+
* than silently producing wrong addressing.
|
|
31
|
+
*
|
|
32
|
+
* `SubmitFlags` (`PreprocessOnly`, ...) is decoded to advance past it correctly but not honored - this
|
|
33
|
+
* pragmatic subset has no transport-agent preprocessing distinction to vary by flag.
|
|
34
|
+
*
|
|
35
|
+
* **`PidTagDeferredSendTime`** ("Do not deliver before"), if set to a future time via `RopSetProperties`,
|
|
36
|
+
* parks the message in Outbox with `Message.scheduledSendTime` set instead of relaying immediately - mirroring
|
|
37
|
+
* `BaseMessageRoute.send()`'s own identical branch - for `ScheduledSendJob` to relay later via this same
|
|
38
|
+
* `scanAndRelay()` pipeline. **`PidTagReadReceiptRequested`**, if `true`, attaches a real
|
|
39
|
+
* `Disposition-Notification-To` header (see `util/ReceiptUtils.ts`) and is recorded on the persisted message's
|
|
40
|
+
* own `requestReceipt` field - honored only when the client explicitly sets it, not this mailbox's
|
|
41
|
+
* `alwaysRequestReceiptInternal`/`External` defaults (those apply to the REST/webmail compose path only).
|
|
42
|
+
*
|
|
43
|
+
* **Calendar branches**: a draft whose `PidTagMessageClass` starts with `"IPM.Appointment"` is routed to
|
|
44
|
+
* `submitAppointment()` instead of the mail path below - see that method's own doc comment. One starting with
|
|
45
|
+
* `"IPM.Schedule.Meeting.Resp."` (an attendee's own accept/decline/tentative response to a meeting this server
|
|
46
|
+
* previously invited them to) is routed to `MeetingMessageClassHandler.submitMeetingResponse()` instead - see
|
|
47
|
+
* that function's own doc comment.
|
|
48
|
+
*
|
|
49
|
+
* @author Jean-Philippe Steinmetz
|
|
50
|
+
*/
|
|
51
|
+
export declare class RopSubmitMessageHandler implements RopHandler {
|
|
52
|
+
readonly ropId = 50;
|
|
53
|
+
handle(reader: BufferReader, writer: BufferWriter, context: RopContext): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Submits a Calendar item. The appointment itself is already persisted (`RopSaveChangesMessageHandler`
|
|
56
|
+
* writes the real `CalendarEvent` row at Save time, unlike a mail draft, which stays purely in-session until
|
|
57
|
+
* Submit) - this method's only job is notifying attendees, if any were set (via `PidTagDisplayTo`/`Cc`,
|
|
58
|
+
* decoded into `CalendarEvent.attendees` at Save time). No attendees means no invite to send (e.g. a private,
|
|
59
|
+
* non-meeting appointment) - a well-formed success response either way, since the appointment already exists.
|
|
60
|
+
*
|
|
61
|
+
* Unlike ordinary mail, there is no separate "Sent Items copy" to create - the appointment's durable copy
|
|
62
|
+
* *is* the `CalendarEvent` row already sitting in the organizer's own Calendar folder.
|
|
63
|
+
*
|
|
64
|
+
* The invite itself is a minimal iCalendar (`RFC 5545`) `VEVENT` with `METHOD:REQUEST` (`RFC 5546`),
|
|
65
|
+
* attached via `nodemailer`'s own `MailComposer` `icalEvent` option (which produces both a `text/calendar;
|
|
66
|
+
* method=REQUEST` MIME alternative and an `.ics` attachment - the standard dual form real invite emails use)
|
|
67
|
+
* - reusing the identical `scanAndRelay()` pipeline the mail path above already calls.
|
|
68
|
+
*/
|
|
69
|
+
private submitAppointment;
|
|
70
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BufferReader, BufferWriter } from "../codec/BufferCursor.js";
|
|
2
|
+
import type { RopContext, RopHandler } from "./RopHandler.js";
|
|
3
|
+
/**
|
|
4
|
+
* `RopWriteStream` (`[MS-OXCPRPT]`/`[MS-OXCROPS]`): writes bytes to a stream opened in `ReadWrite`/`Create`
|
|
5
|
+
* mode (`RopOpenStreamHandler`'s write-mode branch - the only kind of writable stream this pragmatic subset
|
|
6
|
+
* ever produces, always a `RopCreateMessage` draft's `PidTagBody`). Accumulates `Data` into the stream handle's
|
|
7
|
+
* `writeBufferBase64` field, decode-concat-reencode each call rather than a naive string concatenation of
|
|
8
|
+
* per-call base64 chunks - base64 is not concatenation-safe (a chunk's padding only belongs at the true end of
|
|
9
|
+
* the data), so reassembling the real bytes requires decoding what's accumulated so far, appending the new raw
|
|
10
|
+
* bytes, and re-encoding the whole thing. `RopSaveChangesMessageHandler`/`RopSubmitMessageHandler` decode this
|
|
11
|
+
* buffer back to the final body text once composing is complete.
|
|
12
|
+
*
|
|
13
|
+
* Like `RopReadStream`, `[MS-OXCROPS]` documents only one combined response-buffer shape for this ROP (no
|
|
14
|
+
* separate Success/Failure pages) - `WrittenSize` is always present, `0` standing in for the failure case.
|
|
15
|
+
*
|
|
16
|
+
* @author Jean-Philippe Steinmetz
|
|
17
|
+
*/
|
|
18
|
+
export declare class RopWriteStreamHandler implements RopHandler {
|
|
19
|
+
readonly ropId = 45;
|
|
20
|
+
handle(reader: BufferReader, writer: BufferWriter, context: RopContext): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Task named-property identity table (`(PropertySet GUID, LID)` pairs) this pragmatic subset supports, per
|
|
3
|
+
* `[MS-OXPROPS]`/`[MS-OXOTASK]` - the exact `CalendarNamedProperties.ts` precedent, adapted for `PSETID_Task`,
|
|
4
|
+
* shared by `PropertyResolvers.ts` (the read side: `taskValueFor`). Read-only in this pass - see
|
|
5
|
+
* `TaskTarget.ts`'s own doc comment for why there's no write-side (`RopSetProperties`/`RopSaveChangesMessage`)
|
|
6
|
+
* counterpart yet.
|
|
7
|
+
*/
|
|
8
|
+
export declare const PSETID_TASK = "00062003-0000-0000-c000-000000000046";
|
|
9
|
+
/** `PidLidTaskStatus` (`PT_LONG`) - `[MS-OXOTASK]` §2.2.2.1.5's own `olTaskNotStarted`(0)/`olTaskInProgress`(1)/
|
|
10
|
+
* `olTaskComplete`(2)/`olTaskWaiting`(3)/`olTaskDeferred`(4) values. This data model's `Task.completed` is a
|
|
11
|
+
* plain boolean with no in-progress/waiting/deferred distinction, so only `olTaskNotStarted`/`olTaskComplete`
|
|
12
|
+
* are ever produced - a documented, harmless approximation, the same category as `CalendarNamedProperties.ts`'s
|
|
13
|
+
* own `olWorkingElsewhere` gap. */
|
|
14
|
+
export declare const LID_TASK_STATUS = 33025;
|
|
15
|
+
export declare const TASK_STATUS_NOT_STARTED = 0;
|
|
16
|
+
export declare const TASK_STATUS_COMPLETE = 2;
|
|
17
|
+
/** `PidLidPercentComplete` (`PT_R8`, `[MS-OXOTASK]` §2.2.2.1.6) - `0.0`-`1.0`. No partial-progress tracking in
|
|
18
|
+
* this data model either, so this is always `1.0` (complete) or `0.0` (not started), mirroring
|
|
19
|
+
* `LID_TASK_STATUS`'s own two-value approximation. */
|
|
20
|
+
export declare const LID_PERCENT_COMPLETE = 33026;
|
|
21
|
+
/** `PidLidTaskDueDate` (`PT_SYSTIME`, `[MS-OXOTASK]` §2.2.2.2.4). */
|
|
22
|
+
export declare const LID_TASK_DUE_DATE = 33029;
|
|
23
|
+
/** `PidLidTaskComplete` (`PT_BOOLEAN`, `[MS-OXOTASK]` §2.2.2.1.9) - maps directly to `Task.completed`. */
|
|
24
|
+
export declare const LID_TASK_COMPLETE = 33052;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { RepoUtils } from "@rapidrest/service-core";
|
|
2
|
+
/**
|
|
3
|
+
* The `RopGetContentsTable`/`RopOpenMessage` analog of `MessageTarget.ts`, for a `Folder` of type `TASKS`:
|
|
4
|
+
* resolves a `"task:<uid>"` row/handle target into the display data a task-item row or an opened task's
|
|
5
|
+
* properties need. A `Task` is addressed by MID exactly the same way a `Message`/`CalendarEvent`/`Contact` is -
|
|
6
|
+
* `MessageTarget.assignOrGetMid`/`session.messageIds` are reused as-is, so this file adds no MID-registry code
|
|
7
|
+
* of its own.
|
|
8
|
+
*
|
|
9
|
+
* Read-only in this pragmatic subset - a client checking off a task (`RopSetProperties`/`RopSaveChangesMessage`
|
|
10
|
+
* against a `"task:"` handle) is a documented gap, same as Contacts (see `ContactTarget.ts`'s own note); the
|
|
11
|
+
* REST API's own `PUT`/`PATCH` `/tasks/:id` remains the way to mutate a `Task` today.
|
|
12
|
+
*/
|
|
13
|
+
export interface TaskTargetInfo {
|
|
14
|
+
title: string;
|
|
15
|
+
completed: boolean;
|
|
16
|
+
dueDate?: Date;
|
|
17
|
+
}
|
|
18
|
+
/** Degrades to empty-looking values for a `"task:<uid>"` target whose real `Task` has since vanished
|
|
19
|
+
* (soft-deleted or otherwise) - the same "don't fail the whole ROP over one stale row" principle
|
|
20
|
+
* `MessageTarget.resolveMessageInfo`/`ContactTarget.resolveContactInfo` already apply. */
|
|
21
|
+
export declare function resolveTaskInfo(target: string, taskRepo: RepoUtils<any>): Promise<TaskTargetInfo>;
|
|
22
|
+
/** Resolves the tasks directly in `folderUid`, as `"task:<uid>"` target strings, for `RopGetContentsTable`
|
|
23
|
+
* against a `TASKS`-type folder. */
|
|
24
|
+
export declare function resolveFolderTasks(folderUid: string, taskRepo: RepoUtils<any>): Promise<string[]>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MailboxSQL } from "@rapidmx/restapi/sql";
|
|
2
|
+
import { BaseMapiEmsmdbRoute } from "../BaseMapiEmsmdbRoute.js";
|
|
3
|
+
/**
|
|
4
|
+
* SQL-backed concrete `BaseMapiEmsmdbRoute`, mounted at `/mapi/emsmdb`. Exported from this plugin's
|
|
5
|
+
* `./sql` entry point, so the server host mounts it without a wrapper class of its
|
|
6
|
+
* own.
|
|
7
|
+
*
|
|
8
|
+
* @author Jean-Philippe Steinmetz
|
|
9
|
+
*/
|
|
10
|
+
export declare class MapiEmsmdbRouteSQL extends BaseMapiEmsmdbRoute<MailboxSQL> {
|
|
11
|
+
protected mailboxClass: any;
|
|
12
|
+
protected folderClass: any;
|
|
13
|
+
protected messageClass: any;
|
|
14
|
+
protected calendarEventClass: any;
|
|
15
|
+
protected contactClass: any;
|
|
16
|
+
protected taskClass: any;
|
|
17
|
+
protected labelClass: any;
|
|
18
|
+
protected ropHandlerClasses: any[];
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MailboxSQL } from "@rapidmx/restapi/sql";
|
|
2
|
+
import { BaseMapiNspiRoute } from "../BaseMapiNspiRoute.js";
|
|
3
|
+
/**
|
|
4
|
+
* SQL-backed concrete `BaseMapiNspiRoute`, mounted at `/mapi/nspi`. Exported from this plugin's
|
|
5
|
+
* `./sql` entry point, so the server host mounts it without a wrapper class of its
|
|
6
|
+
* own.
|
|
7
|
+
*
|
|
8
|
+
* @author Jean-Philippe Steinmetz
|
|
9
|
+
*/
|
|
10
|
+
export declare class MapiNspiRouteSQL extends BaseMapiNspiRoute<MailboxSQL> {
|
|
11
|
+
protected mailboxClass: any;
|
|
12
|
+
protected contactClass: any;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./sql/index.js";
|
package/package.json
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rapidmx/mapi-plugin",
|
|
3
|
+
"version": "1.0.0-beta.3",
|
|
4
|
+
"description": "A RapidMX plugin that provides MAPI over HTTP protocol support.",
|
|
5
|
+
"repository": "https://github.com/RapidMX/mapi.git",
|
|
6
|
+
"author": "RapidREST <rapidrests@gmail.com>",
|
|
7
|
+
"license": "MPL-2.0",
|
|
8
|
+
"contributors": [
|
|
9
|
+
"Jean-Philippe Steinmetz"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "yarn lint && rimraf dist && tsc",
|
|
13
|
+
"lint": "eslint ./src ./test",
|
|
14
|
+
"local-audit": "yarn install && yarn npm audit -A -R \"$@\"",
|
|
15
|
+
"checkup": "yarn dlx @yarnpkg/doctor \"$@\"",
|
|
16
|
+
"dependency-check": "yarn dlx depcheck \"$@\"",
|
|
17
|
+
"report-coverage": "cat ./coverage/lcov.info | coveralls",
|
|
18
|
+
"test": "vitest run",
|
|
19
|
+
"test:prod": "npm run lint && vitest run --coverage",
|
|
20
|
+
"test:watch": "vitest",
|
|
21
|
+
"release": "npx @rapidrest/cli release",
|
|
22
|
+
"prepublish": "yarn build"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@rapidmx/restapi": "0.x",
|
|
26
|
+
"@rapidrest/core": "5.x",
|
|
27
|
+
"@rapidrest/service-core": "2.x"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"mailparser": "^3.9.23",
|
|
31
|
+
"nodemailer": "^10.0.1"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@rapidmx/restapi": "^0.9.0",
|
|
35
|
+
"@rapidrest/core": "^5.2.2",
|
|
36
|
+
"@rapidrest/service-core": "^2.0.0",
|
|
37
|
+
"@swc/core": "^1.16.2",
|
|
38
|
+
"@types/mailparser": "^3.4.6",
|
|
39
|
+
"@types/nconf": "^0.10.7",
|
|
40
|
+
"@types/node": "^26.5.0",
|
|
41
|
+
"@types/nodemailer": "^8.0.1",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^8.70.0",
|
|
43
|
+
"@typescript-eslint/parser": "^8.70.0",
|
|
44
|
+
"@vitest/coverage-v8": "^5.0.0",
|
|
45
|
+
"better-sqlite3": "^13.0.3",
|
|
46
|
+
"eslint": "^10.10.0",
|
|
47
|
+
"eslint-config-prettier": "^10.1.8",
|
|
48
|
+
"eslint-plugin-import": "^2.32.0",
|
|
49
|
+
"eslint-plugin-jsdoc": "^64.3.6",
|
|
50
|
+
"globals": "^17.12.0",
|
|
51
|
+
"lodash-es": "^4.18.1",
|
|
52
|
+
"mongodb": "^7.6.0",
|
|
53
|
+
"mongodb-memory-server": "^11.2.0",
|
|
54
|
+
"nconf": "^0.13.0",
|
|
55
|
+
"openapi3-ts": "^4.6.1",
|
|
56
|
+
"prom-client": "^15.1.3",
|
|
57
|
+
"redis": "^6.2.1",
|
|
58
|
+
"reflect-metadata": "^0.2.2",
|
|
59
|
+
"rimraf": "^6.1.3",
|
|
60
|
+
"ts-node": "^10.9.2",
|
|
61
|
+
"tsx": "^4.23.13",
|
|
62
|
+
"typeorm": "^1.1.1",
|
|
63
|
+
"typescript": "^6.0.3",
|
|
64
|
+
"unplugin-swc": "^1.6.0",
|
|
65
|
+
"vite": "^8.2.2",
|
|
66
|
+
"vitest": "^5.0.0",
|
|
67
|
+
"winston": "^3.19.0"
|
|
68
|
+
},
|
|
69
|
+
"packageManager": "yarn@4.5.3",
|
|
70
|
+
"engines": {
|
|
71
|
+
"node": ">=24.0.0"
|
|
72
|
+
},
|
|
73
|
+
"publishConfig": {
|
|
74
|
+
"registry": "https://registry.npmjs.org/"
|
|
75
|
+
},
|
|
76
|
+
"type": "module",
|
|
77
|
+
"main": "dist/lib/index.js",
|
|
78
|
+
"exports": {
|
|
79
|
+
".": {
|
|
80
|
+
"import": "./dist/lib/index.js",
|
|
81
|
+
"types": "./dist/types/index.d.ts"
|
|
82
|
+
},
|
|
83
|
+
"./mongo": {
|
|
84
|
+
"import": "./dist/lib/mongo.js",
|
|
85
|
+
"types": "./dist/types/mongo.d.ts"
|
|
86
|
+
},
|
|
87
|
+
"./sql": {
|
|
88
|
+
"import": "./dist/lib/sql.js",
|
|
89
|
+
"types": "./dist/types/sql.d.ts"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"typings": "dist/types/index.d.ts",
|
|
93
|
+
"files": [
|
|
94
|
+
"dist"
|
|
95
|
+
],
|
|
96
|
+
"rapidmx": {
|
|
97
|
+
"plugin": {
|
|
98
|
+
"apiVersion": 1,
|
|
99
|
+
"displayName": "MAPI over HTTP",
|
|
100
|
+
"description": "Lets Outlook for Windows connect with the MAPI/HTTP protocol (served at /mapi/emsmdb and /mapi/nspi).",
|
|
101
|
+
"settings": []
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|