@jbctechsolutions/mcp-office365 2.5.1
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 +21 -0
- package/README.md +667 -0
- package/dist/applescript/account-repository.d.ts +30 -0
- package/dist/applescript/account-repository.d.ts.map +1 -0
- package/dist/applescript/account-repository.js +38 -0
- package/dist/applescript/account-repository.js.map +1 -0
- package/dist/applescript/account-scripts.d.ts +21 -0
- package/dist/applescript/account-scripts.d.ts.map +1 -0
- package/dist/applescript/account-scripts.js +180 -0
- package/dist/applescript/account-scripts.js.map +1 -0
- package/dist/applescript/calendar-manager.d.ts +44 -0
- package/dist/applescript/calendar-manager.d.ts.map +1 -0
- package/dist/applescript/calendar-manager.js +92 -0
- package/dist/applescript/calendar-manager.js.map +1 -0
- package/dist/applescript/calendar-writer.d.ts +36 -0
- package/dist/applescript/calendar-writer.d.ts.map +1 -0
- package/dist/applescript/calendar-writer.js +94 -0
- package/dist/applescript/calendar-writer.js.map +1 -0
- package/dist/applescript/content-readers.d.ts +114 -0
- package/dist/applescript/content-readers.d.ts.map +1 -0
- package/dist/applescript/content-readers.js +328 -0
- package/dist/applescript/content-readers.js.map +1 -0
- package/dist/applescript/executor.d.ts +60 -0
- package/dist/applescript/executor.d.ts.map +1 -0
- package/dist/applescript/executor.js +173 -0
- package/dist/applescript/executor.js.map +1 -0
- package/dist/applescript/index.d.ts +20 -0
- package/dist/applescript/index.d.ts.map +1 -0
- package/dist/applescript/index.js +29 -0
- package/dist/applescript/index.js.map +1 -0
- package/dist/applescript/mail-sender.d.ts +38 -0
- package/dist/applescript/mail-sender.d.ts.map +1 -0
- package/dist/applescript/mail-sender.js +67 -0
- package/dist/applescript/mail-sender.js.map +1 -0
- package/dist/applescript/parser.d.ts +235 -0
- package/dist/applescript/parser.d.ts.map +1 -0
- package/dist/applescript/parser.js +496 -0
- package/dist/applescript/parser.js.map +1 -0
- package/dist/applescript/repository.d.ts +64 -0
- package/dist/applescript/repository.d.ts.map +1 -0
- package/dist/applescript/repository.js +444 -0
- package/dist/applescript/repository.js.map +1 -0
- package/dist/applescript/scripts.d.ts +265 -0
- package/dist/applescript/scripts.d.ts.map +1 -0
- package/dist/applescript/scripts.js +1483 -0
- package/dist/applescript/scripts.js.map +1 -0
- package/dist/approval/hash.d.ts +87 -0
- package/dist/approval/hash.d.ts.map +1 -0
- package/dist/approval/hash.js +102 -0
- package/dist/approval/hash.js.map +1 -0
- package/dist/approval/index.d.ts +13 -0
- package/dist/approval/index.d.ts.map +1 -0
- package/dist/approval/index.js +7 -0
- package/dist/approval/index.js.map +1 -0
- package/dist/approval/token-manager.d.ts +51 -0
- package/dist/approval/token-manager.d.ts.map +1 -0
- package/dist/approval/token-manager.js +111 -0
- package/dist/approval/token-manager.js.map +1 -0
- package/dist/approval/types.d.ts +44 -0
- package/dist/approval/types.d.ts.map +1 -0
- package/dist/approval/types.js +6 -0
- package/dist/approval/types.js.map +1 -0
- package/dist/cli.d.ts +30 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +143 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +27 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +42 -0
- package/dist/config.js.map +1 -0
- package/dist/database/connection.d.ts +77 -0
- package/dist/database/connection.d.ts.map +1 -0
- package/dist/database/connection.js +130 -0
- package/dist/database/connection.js.map +1 -0
- package/dist/database/index.d.ts +11 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +11 -0
- package/dist/database/index.js.map +1 -0
- package/dist/database/queries.d.ts +93 -0
- package/dist/database/queries.d.ts.map +1 -0
- package/dist/database/queries.js +430 -0
- package/dist/database/queries.js.map +1 -0
- package/dist/database/repository.d.ts +198 -0
- package/dist/database/repository.d.ts.map +1 -0
- package/dist/database/repository.js +199 -0
- package/dist/database/repository.js.map +1 -0
- package/dist/graph/attachments.d.ts +72 -0
- package/dist/graph/attachments.d.ts.map +1 -0
- package/dist/graph/attachments.js +207 -0
- package/dist/graph/attachments.js.map +1 -0
- package/dist/graph/auth/config.d.ts +34 -0
- package/dist/graph/auth/config.d.ts.map +1 -0
- package/dist/graph/auth/config.js +78 -0
- package/dist/graph/auth/config.js.map +1 -0
- package/dist/graph/auth/device-code-flow.d.ts +55 -0
- package/dist/graph/auth/device-code-flow.d.ts.map +1 -0
- package/dist/graph/auth/device-code-flow.js +180 -0
- package/dist/graph/auth/device-code-flow.js.map +1 -0
- package/dist/graph/auth/index.d.ts +13 -0
- package/dist/graph/auth/index.d.ts.map +1 -0
- package/dist/graph/auth/index.js +13 -0
- package/dist/graph/auth/index.js.map +1 -0
- package/dist/graph/auth/token-cache.d.ts +41 -0
- package/dist/graph/auth/token-cache.d.ts.map +1 -0
- package/dist/graph/auth/token-cache.js +105 -0
- package/dist/graph/auth/token-cache.js.map +1 -0
- package/dist/graph/client/batch.d.ts +38 -0
- package/dist/graph/client/batch.d.ts.map +1 -0
- package/dist/graph/client/batch.js +33 -0
- package/dist/graph/client/batch.js.map +1 -0
- package/dist/graph/client/cache.d.ts +64 -0
- package/dist/graph/client/cache.d.ts.map +1 -0
- package/dist/graph/client/cache.js +108 -0
- package/dist/graph/client/cache.js.map +1 -0
- package/dist/graph/client/graph-client.d.ts +630 -0
- package/dist/graph/client/graph-client.d.ts.map +1 -0
- package/dist/graph/client/graph-client.js +1771 -0
- package/dist/graph/client/graph-client.js.map +1 -0
- package/dist/graph/client/index.d.ts +12 -0
- package/dist/graph/client/index.d.ts.map +1 -0
- package/dist/graph/client/index.js +12 -0
- package/dist/graph/client/index.js.map +1 -0
- package/dist/graph/content-readers.d.ts +106 -0
- package/dist/graph/content-readers.d.ts.map +1 -0
- package/dist/graph/content-readers.js +321 -0
- package/dist/graph/content-readers.js.map +1 -0
- package/dist/graph/index.d.ts +18 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +23 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/mailbox-adapter.d.ts +30 -0
- package/dist/graph/mailbox-adapter.d.ts.map +1 -0
- package/dist/graph/mailbox-adapter.js +59 -0
- package/dist/graph/mailbox-adapter.js.map +1 -0
- package/dist/graph/mappers/contact-mapper.d.ts +14 -0
- package/dist/graph/mappers/contact-mapper.d.ts.map +1 -0
- package/dist/graph/mappers/contact-mapper.js +20 -0
- package/dist/graph/mappers/contact-mapper.js.map +1 -0
- package/dist/graph/mappers/email-mapper.d.ts +14 -0
- package/dist/graph/mappers/email-mapper.d.ts.map +1 -0
- package/dist/graph/mappers/email-mapper.js +44 -0
- package/dist/graph/mappers/email-mapper.js.map +1 -0
- package/dist/graph/mappers/event-mapper.d.ts +14 -0
- package/dist/graph/mappers/event-mapper.d.ts.map +1 -0
- package/dist/graph/mappers/event-mapper.js +31 -0
- package/dist/graph/mappers/event-mapper.js.map +1 -0
- package/dist/graph/mappers/folder-mapper.d.ts +22 -0
- package/dist/graph/mappers/folder-mapper.d.ts.map +1 -0
- package/dist/graph/mappers/folder-mapper.js +51 -0
- package/dist/graph/mappers/folder-mapper.js.map +1 -0
- package/dist/graph/mappers/index.d.ts +16 -0
- package/dist/graph/mappers/index.d.ts.map +1 -0
- package/dist/graph/mappers/index.js +16 -0
- package/dist/graph/mappers/index.js.map +1 -0
- package/dist/graph/mappers/task-mapper.d.ts +20 -0
- package/dist/graph/mappers/task-mapper.d.ts.map +1 -0
- package/dist/graph/mappers/task-mapper.js +27 -0
- package/dist/graph/mappers/task-mapper.js.map +1 -0
- package/dist/graph/mappers/utils.d.ts +97 -0
- package/dist/graph/mappers/utils.d.ts.map +1 -0
- package/dist/graph/mappers/utils.js +186 -0
- package/dist/graph/mappers/utils.js.map +1 -0
- package/dist/graph/repository.d.ts +1104 -0
- package/dist/graph/repository.d.ts.map +1 -0
- package/dist/graph/repository.js +2999 -0
- package/dist/graph/repository.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6052 -0
- package/dist/index.js.map +1 -0
- package/dist/parsers/html-stripper.d.ts +41 -0
- package/dist/parsers/html-stripper.d.ts.map +1 -0
- package/dist/parsers/html-stripper.js +179 -0
- package/dist/parsers/html-stripper.js.map +1 -0
- package/dist/parsers/index.d.ts +12 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/parsers/index.js +12 -0
- package/dist/parsers/index.js.map +1 -0
- package/dist/parsers/olk15.d.ts +87 -0
- package/dist/parsers/olk15.d.ts.map +1 -0
- package/dist/parsers/olk15.js +368 -0
- package/dist/parsers/olk15.js.map +1 -0
- package/dist/signature.d.ts +22 -0
- package/dist/signature.d.ts.map +1 -0
- package/dist/signature.js +89 -0
- package/dist/signature.js.map +1 -0
- package/dist/tools/calendar-permissions.d.ts +79 -0
- package/dist/tools/calendar-permissions.d.ts.map +1 -0
- package/dist/tools/calendar-permissions.js +121 -0
- package/dist/tools/calendar-permissions.js.map +1 -0
- package/dist/tools/calendar.d.ts +208 -0
- package/dist/tools/calendar.d.ts.map +1 -0
- package/dist/tools/calendar.js +247 -0
- package/dist/tools/calendar.js.map +1 -0
- package/dist/tools/categories.d.ts +94 -0
- package/dist/tools/categories.d.ts.map +1 -0
- package/dist/tools/categories.js +117 -0
- package/dist/tools/categories.js.map +1 -0
- package/dist/tools/checklist-items.d.ts +89 -0
- package/dist/tools/checklist-items.d.ts.map +1 -0
- package/dist/tools/checklist-items.js +140 -0
- package/dist/tools/checklist-items.js.map +1 -0
- package/dist/tools/contacts.d.ts +94 -0
- package/dist/tools/contacts.d.ts.map +1 -0
- package/dist/tools/contacts.js +134 -0
- package/dist/tools/contacts.js.map +1 -0
- package/dist/tools/excel.d.ts +96 -0
- package/dist/tools/excel.d.ts.map +1 -0
- package/dist/tools/excel.js +165 -0
- package/dist/tools/excel.js.map +1 -0
- package/dist/tools/focused-overrides.d.ts +70 -0
- package/dist/tools/focused-overrides.d.ts.map +1 -0
- package/dist/tools/focused-overrides.js +117 -0
- package/dist/tools/focused-overrides.js.map +1 -0
- package/dist/tools/index.d.ts +22 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +34 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/linked-resources.d.ts +74 -0
- package/dist/tools/linked-resources.d.ts.map +1 -0
- package/dist/tools/linked-resources.js +122 -0
- package/dist/tools/linked-resources.js.map +1 -0
- package/dist/tools/mail-rules.d.ts +98 -0
- package/dist/tools/mail-rules.d.ts.map +1 -0
- package/dist/tools/mail-rules.js +169 -0
- package/dist/tools/mail-rules.js.map +1 -0
- package/dist/tools/mail-send.d.ts +314 -0
- package/dist/tools/mail-send.d.ts.map +1 -0
- package/dist/tools/mail-send.js +555 -0
- package/dist/tools/mail-send.js.map +1 -0
- package/dist/tools/mail.d.ts +127 -0
- package/dist/tools/mail.d.ts.map +1 -0
- package/dist/tools/mail.js +311 -0
- package/dist/tools/mail.js.map +1 -0
- package/dist/tools/mailbox-organization.d.ts +301 -0
- package/dist/tools/mailbox-organization.d.ts.map +1 -0
- package/dist/tools/mailbox-organization.js +541 -0
- package/dist/tools/mailbox-organization.js.map +1 -0
- package/dist/tools/meetings.d.ts +114 -0
- package/dist/tools/meetings.d.ts.map +1 -0
- package/dist/tools/meetings.js +110 -0
- package/dist/tools/meetings.js.map +1 -0
- package/dist/tools/notes.d.ts +74 -0
- package/dist/tools/notes.d.ts.map +1 -0
- package/dist/tools/notes.js +136 -0
- package/dist/tools/notes.js.map +1 -0
- package/dist/tools/onedrive.d.ts +194 -0
- package/dist/tools/onedrive.d.ts.map +1 -0
- package/dist/tools/onedrive.js +257 -0
- package/dist/tools/onedrive.js.map +1 -0
- package/dist/tools/people.d.ts +129 -0
- package/dist/tools/people.d.ts.map +1 -0
- package/dist/tools/people.js +195 -0
- package/dist/tools/people.js.map +1 -0
- package/dist/tools/planner-visualization.d.ts +91 -0
- package/dist/tools/planner-visualization.d.ts.map +1 -0
- package/dist/tools/planner-visualization.js +192 -0
- package/dist/tools/planner-visualization.js.map +1 -0
- package/dist/tools/planner.d.ts +288 -0
- package/dist/tools/planner.d.ts.map +1 -0
- package/dist/tools/planner.js +368 -0
- package/dist/tools/planner.js.map +1 -0
- package/dist/tools/scheduling.d.ts +49 -0
- package/dist/tools/scheduling.d.ts.map +1 -0
- package/dist/tools/scheduling.js +115 -0
- package/dist/tools/scheduling.js.map +1 -0
- package/dist/tools/sharepoint.d.ts +115 -0
- package/dist/tools/sharepoint.d.ts.map +1 -0
- package/dist/tools/sharepoint.js +99 -0
- package/dist/tools/sharepoint.js.map +1 -0
- package/dist/tools/task-attachments.d.ts +74 -0
- package/dist/tools/task-attachments.d.ts.map +1 -0
- package/dist/tools/task-attachments.js +122 -0
- package/dist/tools/task-attachments.js.map +1 -0
- package/dist/tools/tasks.d.ts +74 -0
- package/dist/tools/tasks.d.ts.map +1 -0
- package/dist/tools/tasks.js +126 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/tools/teams.d.ts +389 -0
- package/dist/tools/teams.d.ts.map +1 -0
- package/dist/tools/teams.js +546 -0
- package/dist/tools/teams.js.map +1 -0
- package/dist/types/calendar.d.ts +60 -0
- package/dist/types/calendar.d.ts.map +1 -0
- package/dist/types/calendar.js +15 -0
- package/dist/types/calendar.js.map +1 -0
- package/dist/types/contacts.d.ts +96 -0
- package/dist/types/contacts.d.ts.map +1 -0
- package/dist/types/contacts.js +41 -0
- package/dist/types/contacts.js.map +1 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +16 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/mail.d.ts +108 -0
- package/dist/types/mail.d.ts.map +1 -0
- package/dist/types/mail.js +40 -0
- package/dist/types/mail.js.map +1 -0
- package/dist/types/notes.d.ts +26 -0
- package/dist/types/notes.d.ts.map +1 -0
- package/dist/types/notes.js +6 -0
- package/dist/types/notes.js.map +1 -0
- package/dist/types/tasks.d.ts +31 -0
- package/dist/types/tasks.d.ts.map +1 -0
- package/dist/types/tasks.js +6 -0
- package/dist/types/tasks.js.map +1 -0
- package/dist/utils/dates.d.ts +66 -0
- package/dist/utils/dates.d.ts.map +1 -0
- package/dist/utils/dates.js +94 -0
- package/dist/utils/dates.js.map +1 -0
- package/dist/utils/errors.d.ts +218 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +306 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/index.d.ts +10 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +10 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/visualization/html.d.ts +26 -0
- package/dist/visualization/html.d.ts.map +1 -0
- package/dist/visualization/html.js +306 -0
- package/dist/visualization/html.js.map +1 -0
- package/dist/visualization/markdown.d.ts +25 -0
- package/dist/visualization/markdown.d.ts.map +1 -0
- package/dist/visualization/markdown.js +186 -0
- package/dist/visualization/markdown.js.map +1 -0
- package/dist/visualization/mermaid.d.ts +25 -0
- package/dist/visualization/mermaid.d.ts.map +1 -0
- package/dist/visualization/mermaid.js +158 -0
- package/dist/visualization/mermaid.js.map +1 -0
- package/dist/visualization/svg.d.ts +25 -0
- package/dist/visualization/svg.d.ts.map +1 -0
- package/dist/visualization/svg.js +282 -0
- package/dist/visualization/svg.js.map +1 -0
- package/dist/visualization/types.d.ts +43 -0
- package/dist/visualization/types.d.ts.map +1 -0
- package/dist/visualization/types.js +34 -0
- package/dist/visualization/types.js.map +1 -0
- package/package.json +88 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/graph/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,eAAe;AACf,OAAO,EACL,eAAe,EACf,eAAe,EACf,YAAY,EAEZ,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,UAAU,EACV,OAAO,EACP,iBAAiB,GAElB,MAAM,iBAAiB,CAAC;AAEzB,iBAAiB;AACjB,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,QAAQ,EACR,cAAc,EACd,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAE3B,iBAAiB;AACjB,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,2BAA2B,GAE5B,MAAM,oBAAoB,CAAC;AAE5B,qBAAqB;AACrB,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,yBAAyB;AACzB,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EACzB,mCAAmC,EAEnC,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Adapter that bridges GraphRepository's xxxAsync() methods
|
|
7
|
+
* to the IMailboxRepository interface.
|
|
8
|
+
*/
|
|
9
|
+
import type { IMailboxRepository, FolderRow, EmailRow } from '../database/repository.js';
|
|
10
|
+
import type { GraphRepository } from './repository.js';
|
|
11
|
+
export declare class GraphMailboxAdapter implements IMailboxRepository {
|
|
12
|
+
private readonly graph;
|
|
13
|
+
constructor(graph: GraphRepository);
|
|
14
|
+
getEmail(id: number): Promise<EmailRow | undefined>;
|
|
15
|
+
getFolder(id: number): Promise<FolderRow | undefined>;
|
|
16
|
+
moveEmail(emailId: number, destinationFolderId: number): Promise<void>;
|
|
17
|
+
deleteEmail(emailId: number): Promise<void>;
|
|
18
|
+
archiveEmail(emailId: number): Promise<void>;
|
|
19
|
+
junkEmail(emailId: number): Promise<void>;
|
|
20
|
+
markEmailRead(emailId: number, isRead: boolean): Promise<void>;
|
|
21
|
+
setEmailFlag(emailId: number, flagStatus: number): Promise<void>;
|
|
22
|
+
setEmailCategories(emailId: number, categories: string[]): Promise<void>;
|
|
23
|
+
setEmailImportance(emailId: number, importance: string): Promise<void>;
|
|
24
|
+
createFolder(name: string, parentFolderId?: number): Promise<FolderRow>;
|
|
25
|
+
deleteFolder(folderId: number): Promise<void>;
|
|
26
|
+
renameFolder(folderId: number, newName: string): Promise<void>;
|
|
27
|
+
moveFolder(folderId: number, destinationParentId: number): Promise<void>;
|
|
28
|
+
emptyFolder(folderId: number): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=mailbox-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mailbox-adapter.d.ts","sourceRoot":"","sources":["../../src/graph/mailbox-adapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,qBAAa,mBAAoB,YAAW,kBAAkB;IAChD,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,eAAe;IAGnD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC;IAInD,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAKrD,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAItE,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3C,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5C,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzC,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9D,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhE,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxE,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKtE,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAIvE,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9D,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxE,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG7C"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
export class GraphMailboxAdapter {
|
|
6
|
+
graph;
|
|
7
|
+
constructor(graph) {
|
|
8
|
+
this.graph = graph;
|
|
9
|
+
}
|
|
10
|
+
// Read
|
|
11
|
+
getEmail(id) {
|
|
12
|
+
return this.graph.getEmailAsync(id);
|
|
13
|
+
}
|
|
14
|
+
getFolder(id) {
|
|
15
|
+
return this.graph.getFolderAsync(id);
|
|
16
|
+
}
|
|
17
|
+
// Email organization
|
|
18
|
+
moveEmail(emailId, destinationFolderId) {
|
|
19
|
+
return this.graph.moveEmailAsync(emailId, destinationFolderId);
|
|
20
|
+
}
|
|
21
|
+
deleteEmail(emailId) {
|
|
22
|
+
return this.graph.deleteEmailAsync(emailId);
|
|
23
|
+
}
|
|
24
|
+
archiveEmail(emailId) {
|
|
25
|
+
return this.graph.archiveEmailAsync(emailId);
|
|
26
|
+
}
|
|
27
|
+
junkEmail(emailId) {
|
|
28
|
+
return this.graph.junkEmailAsync(emailId);
|
|
29
|
+
}
|
|
30
|
+
markEmailRead(emailId, isRead) {
|
|
31
|
+
return this.graph.markEmailReadAsync(emailId, isRead);
|
|
32
|
+
}
|
|
33
|
+
setEmailFlag(emailId, flagStatus) {
|
|
34
|
+
return this.graph.setEmailFlagAsync(emailId, flagStatus);
|
|
35
|
+
}
|
|
36
|
+
setEmailCategories(emailId, categories) {
|
|
37
|
+
return this.graph.setEmailCategoriesAsync(emailId, categories);
|
|
38
|
+
}
|
|
39
|
+
setEmailImportance(emailId, importance) {
|
|
40
|
+
return this.graph.setEmailImportanceAsync(emailId, importance);
|
|
41
|
+
}
|
|
42
|
+
// Folder management
|
|
43
|
+
createFolder(name, parentFolderId) {
|
|
44
|
+
return this.graph.createFolderAsync(name, parentFolderId);
|
|
45
|
+
}
|
|
46
|
+
deleteFolder(folderId) {
|
|
47
|
+
return this.graph.deleteFolderAsync(folderId);
|
|
48
|
+
}
|
|
49
|
+
renameFolder(folderId, newName) {
|
|
50
|
+
return this.graph.renameFolderAsync(folderId, newName);
|
|
51
|
+
}
|
|
52
|
+
moveFolder(folderId, destinationParentId) {
|
|
53
|
+
return this.graph.moveFolderAsync(folderId, destinationParentId);
|
|
54
|
+
}
|
|
55
|
+
emptyFolder(folderId) {
|
|
56
|
+
return this.graph.emptyFolderAsync(folderId);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=mailbox-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mailbox-adapter.js","sourceRoot":"","sources":["../../src/graph/mailbox-adapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,MAAM,OAAO,mBAAmB;IACD;IAA7B,YAA6B,KAAsB;QAAtB,UAAK,GAAL,KAAK,CAAiB;IAAG,CAAC;IAEvD,OAAO;IACP,QAAQ,CAAC,EAAU;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC;IAED,SAAS,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;IACvC,CAAC;IAED,qBAAqB;IACrB,SAAS,CAAC,OAAe,EAAE,mBAA2B;QACpD,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;IACjE,CAAC;IAED,WAAW,CAAC,OAAe;QACzB,OAAO,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,YAAY,CAAC,OAAe;QAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;IAED,SAAS,CAAC,OAAe;QACvB,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED,aAAa,CAAC,OAAe,EAAE,MAAe;QAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACxD,CAAC;IAED,YAAY,CAAC,OAAe,EAAE,UAAkB;QAC9C,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAC3D,CAAC;IAED,kBAAkB,CAAC,OAAe,EAAE,UAAoB;QACtD,OAAO,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACjE,CAAC;IAED,kBAAkB,CAAC,OAAe,EAAE,UAAkB;QACpD,OAAO,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACjE,CAAC;IAED,oBAAoB;IACpB,YAAY,CAAC,IAAY,EAAE,cAAuB;QAChD,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAC5D,CAAC;IAED,YAAY,CAAC,QAAgB;QAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC;IAED,YAAY,CAAC,QAAgB,EAAE,OAAe;QAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,UAAU,CAAC,QAAgB,EAAE,mBAA2B;QACtD,OAAO,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;IACnE,CAAC;IAED,WAAW,CAAC,QAAgB;QAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;CACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Maps Microsoft Graph Contact type to ContactRow.
|
|
7
|
+
*/
|
|
8
|
+
import type * as MicrosoftGraph from '@microsoft/microsoft-graph-types';
|
|
9
|
+
import type { ContactRow } from '../../database/repository.js';
|
|
10
|
+
/**
|
|
11
|
+
* Maps a Graph Contact to a ContactRow.
|
|
12
|
+
*/
|
|
13
|
+
export declare function mapContactToContactRow(contact: MicrosoftGraph.Contact): ContactRow;
|
|
14
|
+
//# sourceMappingURL=contact-mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact-mapper.d.ts","sourceRoot":"","sources":["../../../src/graph/mappers/contact-mapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,KAAK,KAAK,cAAc,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAG/D;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,cAAc,CAAC,OAAO,GAAG,UAAU,CAWlF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
import { hashStringToNumber, createGraphContentPath } from './utils.js';
|
|
6
|
+
/**
|
|
7
|
+
* Maps a Graph Contact to a ContactRow.
|
|
8
|
+
*/
|
|
9
|
+
export function mapContactToContactRow(contact) {
|
|
10
|
+
const contactId = contact.id ?? '';
|
|
11
|
+
return {
|
|
12
|
+
id: hashStringToNumber(contactId),
|
|
13
|
+
folderId: 0, // Graph contacts don't have folders in the same way
|
|
14
|
+
displayName: contact.displayName ?? null,
|
|
15
|
+
sortName: contact.surname ?? contact.displayName ?? null,
|
|
16
|
+
contactType: null, // Not available in Graph
|
|
17
|
+
dataFilePath: createGraphContentPath('contact', contactId),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=contact-mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact-mapper.js","sourceRoot":"","sources":["../../../src/graph/mappers/contact-mapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAExE;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAA+B;IACpE,MAAM,SAAS,GAAG,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC;IAEnC,OAAO;QACL,EAAE,EAAE,kBAAkB,CAAC,SAAS,CAAC;QACjC,QAAQ,EAAE,CAAC,EAAE,oDAAoD;QACjE,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,IAAI;QACxC,QAAQ,EAAE,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,WAAW,IAAI,IAAI;QACxD,WAAW,EAAE,IAAI,EAAE,yBAAyB;QAC5C,YAAY,EAAE,sBAAsB,CAAC,SAAS,EAAE,SAAS,CAAC;KAC3D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Maps Microsoft Graph Message type to EmailRow.
|
|
7
|
+
*/
|
|
8
|
+
import type * as MicrosoftGraph from '@microsoft/microsoft-graph-types';
|
|
9
|
+
import type { EmailRow } from '../../database/repository.js';
|
|
10
|
+
/**
|
|
11
|
+
* Maps a Graph Message to an EmailRow.
|
|
12
|
+
*/
|
|
13
|
+
export declare function mapMessageToEmailRow(message: MicrosoftGraph.Message, folderId?: string): EmailRow;
|
|
14
|
+
//# sourceMappingURL=email-mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-mapper.d.ts","sourceRoot":"","sources":["../../../src/graph/mappers/email-mapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,KAAK,KAAK,cAAc,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAa7D;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,cAAc,CAAC,OAAO,EAC/B,QAAQ,CAAC,EAAE,MAAM,GAChB,QAAQ,CAoCV"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
import { hashStringToNumber, isoToTimestamp, importanceToPriority, flagStatusToNumber, extractDisplayName, extractEmailAddress, formatRecipients, formatRecipientAddresses, createGraphContentPath, } from './utils.js';
|
|
6
|
+
/**
|
|
7
|
+
* Maps a Graph Message to an EmailRow.
|
|
8
|
+
*/
|
|
9
|
+
export function mapMessageToEmailRow(message, folderId) {
|
|
10
|
+
const messageId = message.id ?? '';
|
|
11
|
+
const parentFolderId = folderId ?? message.parentFolderId;
|
|
12
|
+
// Type assertions needed due to Graph API's NullableOption types
|
|
13
|
+
// which are incompatible with exactOptionalPropertyTypes
|
|
14
|
+
const from = message.from;
|
|
15
|
+
const toRecipients = message.toRecipients;
|
|
16
|
+
const ccRecipients = message.ccRecipients;
|
|
17
|
+
const flag = message.flag;
|
|
18
|
+
return {
|
|
19
|
+
id: hashStringToNumber(messageId),
|
|
20
|
+
folderId: parentFolderId != null ? hashStringToNumber(parentFolderId) : 0,
|
|
21
|
+
subject: message.subject ?? null,
|
|
22
|
+
sender: extractDisplayName(from),
|
|
23
|
+
senderAddress: extractEmailAddress(from),
|
|
24
|
+
recipients: formatRecipients(toRecipients),
|
|
25
|
+
displayTo: formatRecipients(toRecipients),
|
|
26
|
+
toAddresses: formatRecipientAddresses(toRecipients),
|
|
27
|
+
ccAddresses: formatRecipientAddresses(ccRecipients),
|
|
28
|
+
preview: message.bodyPreview ?? null,
|
|
29
|
+
isRead: message.isRead === true ? 1 : 0,
|
|
30
|
+
timeReceived: isoToTimestamp(message.receivedDateTime),
|
|
31
|
+
timeSent: isoToTimestamp(message.sentDateTime),
|
|
32
|
+
hasAttachment: message.hasAttachments === true ? 1 : 0,
|
|
33
|
+
size: 0, // Not available in Graph API message response
|
|
34
|
+
priority: importanceToPriority(message.importance),
|
|
35
|
+
flagStatus: flagStatusToNumber(flag),
|
|
36
|
+
categories: message.categories != null && message.categories.length > 0
|
|
37
|
+
? Buffer.from(message.categories.join(','), 'utf-8')
|
|
38
|
+
: null,
|
|
39
|
+
messageId: message.internetMessageId ?? null,
|
|
40
|
+
conversationId: message.conversationId != null ? hashStringToNumber(message.conversationId) : null,
|
|
41
|
+
dataFilePath: createGraphContentPath('email', messageId),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=email-mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-mapper.js","sourceRoot":"","sources":["../../../src/graph/mappers/email-mapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAA+B,EAC/B,QAAiB;IAEjB,MAAM,SAAS,GAAG,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC;IACnC,MAAM,cAAc,GAAG,QAAQ,IAAI,OAAO,CAAC,cAAc,CAAC;IAE1D,iEAAiE;IACjE,yDAAyD;IACzD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAiF,CAAC;IACvG,MAAM,YAAY,GAAG,OAAO,CAAC,YAAgG,CAAC;IAC9H,MAAM,YAAY,GAAG,OAAO,CAAC,YAAgG,CAAC;IAC9H,MAAM,IAAI,GAAG,OAAO,CAAC,IAAkD,CAAC;IAExE,OAAO;QACL,EAAE,EAAE,kBAAkB,CAAC,SAAS,CAAC;QACjC,QAAQ,EAAE,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;QACzE,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,IAAI;QAChC,MAAM,EAAE,kBAAkB,CAAC,IAAI,CAAC;QAChC,aAAa,EAAE,mBAAmB,CAAC,IAAI,CAAC;QACxC,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAAC;QAC1C,SAAS,EAAE,gBAAgB,CAAC,YAAY,CAAC;QACzC,WAAW,EAAE,wBAAwB,CAAC,YAAY,CAAC;QACnD,WAAW,EAAE,wBAAwB,CAAC,YAAY,CAAC;QACnD,OAAO,EAAE,OAAO,CAAC,WAAW,IAAI,IAAI;QACpC,MAAM,EAAE,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,YAAY,EAAE,cAAc,CAAC,OAAO,CAAC,gBAAgB,CAAC;QACtD,QAAQ,EAAE,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC;QAC9C,aAAa,EAAE,OAAO,CAAC,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACtD,IAAI,EAAE,CAAC,EAAE,8CAA8C;QACvD,QAAQ,EAAE,oBAAoB,CAAC,OAAO,CAAC,UAAU,CAAC;QAClD,UAAU,EAAE,kBAAkB,CAAC,IAAI,CAAC;QACpC,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;YACrE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;YACpD,CAAC,CAAC,IAAI;QACR,SAAS,EAAE,OAAO,CAAC,iBAAiB,IAAI,IAAI;QAC5C,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI;QAClG,YAAY,EAAE,sBAAsB,CAAC,OAAO,EAAE,SAAS,CAAC;KACzD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Maps Microsoft Graph Event type to EventRow.
|
|
7
|
+
*/
|
|
8
|
+
import type * as MicrosoftGraph from '@microsoft/microsoft-graph-types';
|
|
9
|
+
import type { EventRow } from '../../database/repository.js';
|
|
10
|
+
/**
|
|
11
|
+
* Maps a Graph Event to an EventRow.
|
|
12
|
+
*/
|
|
13
|
+
export declare function mapEventToEventRow(event: MicrosoftGraph.Event, calendarId?: string): EventRow;
|
|
14
|
+
//# sourceMappingURL=event-mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-mapper.d.ts","sourceRoot":"","sources":["../../../src/graph/mappers/event-mapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,KAAK,KAAK,cAAc,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAO7D;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,cAAc,CAAC,KAAK,EAC3B,UAAU,CAAC,EAAE,MAAM,GAClB,QAAQ,CAuBV"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
import { hashStringToNumber, dateTimeTimeZoneToTimestamp, createGraphContentPath, } from './utils.js';
|
|
6
|
+
/**
|
|
7
|
+
* Maps a Graph Event to an EventRow.
|
|
8
|
+
*/
|
|
9
|
+
export function mapEventToEventRow(event, calendarId) {
|
|
10
|
+
const eventId = event.id ?? '';
|
|
11
|
+
// Type assertions needed due to Graph API's NullableOption types
|
|
12
|
+
// which are incompatible with exactOptionalPropertyTypes
|
|
13
|
+
const start = event.start;
|
|
14
|
+
const end = event.end;
|
|
15
|
+
return {
|
|
16
|
+
id: hashStringToNumber(eventId),
|
|
17
|
+
folderId: calendarId != null ? hashStringToNumber(calendarId) : 0,
|
|
18
|
+
subject: event.subject ?? null,
|
|
19
|
+
startDate: dateTimeTimeZoneToTimestamp(start),
|
|
20
|
+
endDate: dateTimeTimeZoneToTimestamp(end),
|
|
21
|
+
isRecurring: event.recurrence != null ? 1 : 0,
|
|
22
|
+
hasReminder: event.isReminderOn === true ? 1 : 0,
|
|
23
|
+
attendeeCount: event.attendees?.length ?? 0,
|
|
24
|
+
uid: event.iCalUId ?? null,
|
|
25
|
+
masterRecordId: null, // Not directly available
|
|
26
|
+
recurrenceId: null, // Not directly available
|
|
27
|
+
dataFilePath: createGraphContentPath('event', eventId),
|
|
28
|
+
onlineMeetingUrl: event.onlineMeeting?.joinUrl ?? null,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=event-mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-mapper.js","sourceRoot":"","sources":["../../../src/graph/mappers/event-mapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EACL,kBAAkB,EAClB,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAA2B,EAC3B,UAAmB;IAEnB,MAAM,OAAO,GAAG,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IAE/B,iEAAiE;IACjE,yDAAyD;IACzD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAoE,CAAC;IACzF,MAAM,GAAG,GAAG,KAAK,CAAC,GAAkE,CAAC;IAErF,OAAO;QACL,EAAE,EAAE,kBAAkB,CAAC,OAAO,CAAC;QAC/B,QAAQ,EAAE,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACjE,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,IAAI;QAC9B,SAAS,EAAE,2BAA2B,CAAC,KAAK,CAAC;QAC7C,OAAO,EAAE,2BAA2B,CAAC,GAAG,CAAC;QACzC,WAAW,EAAE,KAAK,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7C,WAAW,EAAE,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChD,aAAa,EAAE,KAAK,CAAC,SAAS,EAAE,MAAM,IAAI,CAAC;QAC3C,GAAG,EAAE,KAAK,CAAC,OAAO,IAAI,IAAI;QAC1B,cAAc,EAAE,IAAI,EAAE,yBAAyB;QAC/C,YAAY,EAAE,IAAI,EAAE,yBAAyB;QAC7C,YAAY,EAAE,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC;QACtD,gBAAgB,EAAE,KAAK,CAAC,aAAa,EAAE,OAAO,IAAI,IAAI;KACvD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Maps Microsoft Graph MailFolder and Calendar types to FolderRow.
|
|
7
|
+
*/
|
|
8
|
+
import type * as MicrosoftGraph from '@microsoft/microsoft-graph-types';
|
|
9
|
+
import type { FolderRow } from '../../database/repository.js';
|
|
10
|
+
/**
|
|
11
|
+
* Maps a Graph MailFolder to a FolderRow.
|
|
12
|
+
*/
|
|
13
|
+
export declare function mapMailFolderToRow(folder: MicrosoftGraph.MailFolder): FolderRow;
|
|
14
|
+
/**
|
|
15
|
+
* Maps a Graph Calendar to a FolderRow (calendars use FolderRow structure).
|
|
16
|
+
*/
|
|
17
|
+
export declare function mapCalendarToFolderRow(calendar: MicrosoftGraph.Calendar): FolderRow;
|
|
18
|
+
/**
|
|
19
|
+
* Maps a Graph TodoTaskList to a FolderRow.
|
|
20
|
+
*/
|
|
21
|
+
export declare function mapTaskListToFolderRow(taskList: MicrosoftGraph.TodoTaskList): FolderRow;
|
|
22
|
+
//# sourceMappingURL=folder-mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"folder-mapper.d.ts","sourceRoot":"","sources":["../../../src/graph/mappers/folder-mapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,KAAK,KAAK,cAAc,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAG9D;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,CAAC,UAAU,GAAG,SAAS,CAW/E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,cAAc,CAAC,QAAQ,GAAG,SAAS,CAWnF;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,cAAc,CAAC,YAAY,GAAG,SAAS,CAWvF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
import { hashStringToNumber } from './utils.js';
|
|
6
|
+
/**
|
|
7
|
+
* Maps a Graph MailFolder to a FolderRow.
|
|
8
|
+
*/
|
|
9
|
+
export function mapMailFolderToRow(folder) {
|
|
10
|
+
return {
|
|
11
|
+
id: hashStringToNumber(folder.id ?? ''),
|
|
12
|
+
name: folder.displayName ?? null,
|
|
13
|
+
parentId: folder.parentFolderId != null ? hashStringToNumber(folder.parentFolderId) : null,
|
|
14
|
+
specialType: 0, // Graph doesn't expose special type directly
|
|
15
|
+
folderType: 1, // Mail folder
|
|
16
|
+
accountId: 1, // Default account
|
|
17
|
+
messageCount: folder.totalItemCount ?? 0,
|
|
18
|
+
unreadCount: folder.unreadItemCount ?? 0,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Maps a Graph Calendar to a FolderRow (calendars use FolderRow structure).
|
|
23
|
+
*/
|
|
24
|
+
export function mapCalendarToFolderRow(calendar) {
|
|
25
|
+
return {
|
|
26
|
+
id: hashStringToNumber(calendar.id ?? ''),
|
|
27
|
+
name: calendar.name ?? null,
|
|
28
|
+
parentId: null,
|
|
29
|
+
specialType: 0,
|
|
30
|
+
folderType: 2, // Calendar folder
|
|
31
|
+
accountId: 1,
|
|
32
|
+
messageCount: 0,
|
|
33
|
+
unreadCount: 0,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Maps a Graph TodoTaskList to a FolderRow.
|
|
38
|
+
*/
|
|
39
|
+
export function mapTaskListToFolderRow(taskList) {
|
|
40
|
+
return {
|
|
41
|
+
id: hashStringToNumber(taskList.id ?? ''),
|
|
42
|
+
name: taskList.displayName ?? null,
|
|
43
|
+
parentId: null,
|
|
44
|
+
specialType: 0,
|
|
45
|
+
folderType: 3, // Task folder
|
|
46
|
+
accountId: 1,
|
|
47
|
+
messageCount: 0,
|
|
48
|
+
unreadCount: 0,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=folder-mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"folder-mapper.js","sourceRoot":"","sources":["../../../src/graph/mappers/folder-mapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAiC;IAClE,OAAO;QACL,EAAE,EAAE,kBAAkB,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC;QACvC,IAAI,EAAE,MAAM,CAAC,WAAW,IAAI,IAAI;QAChC,QAAQ,EAAE,MAAM,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI;QAC1F,WAAW,EAAE,CAAC,EAAE,6CAA6C;QAC7D,UAAU,EAAE,CAAC,EAAE,cAAc;QAC7B,SAAS,EAAE,CAAC,EAAE,kBAAkB;QAChC,YAAY,EAAE,MAAM,CAAC,cAAc,IAAI,CAAC;QACxC,WAAW,EAAE,MAAM,CAAC,eAAe,IAAI,CAAC;KACzC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAiC;IACtE,OAAO;QACL,EAAE,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC;QACzC,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,IAAI;QAC3B,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,CAAC,EAAE,kBAAkB;QACjC,SAAS,EAAE,CAAC;QACZ,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,CAAC;KACf,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAqC;IAC1E,OAAO;QACL,EAAE,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC;QACzC,IAAI,EAAE,QAAQ,CAAC,WAAW,IAAI,IAAI;QAClC,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,CAAC,EAAE,cAAc;QAC7B,SAAS,EAAE,CAAC;QACZ,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,CAAC;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Microsoft Graph type mappers.
|
|
7
|
+
*
|
|
8
|
+
* Exports functions to convert Graph API types to internal row types.
|
|
9
|
+
*/
|
|
10
|
+
export { mapMailFolderToRow, mapCalendarToFolderRow, mapTaskListToFolderRow, } from './folder-mapper.js';
|
|
11
|
+
export { mapMessageToEmailRow } from './email-mapper.js';
|
|
12
|
+
export { mapEventToEventRow } from './event-mapper.js';
|
|
13
|
+
export { mapContactToContactRow } from './contact-mapper.js';
|
|
14
|
+
export { mapTaskToTaskRow, type TodoTaskWithList } from './task-mapper.js';
|
|
15
|
+
export { hashStringToNumber, isoToTimestamp, dateTimeTimeZoneToTimestamp, unixTimestampToIso, unixTimestampToLocalIso, importanceToPriority, flagStatusToNumber, extractEmailAddress, extractDisplayName, formatRecipients, formatRecipientAddresses, createGraphContentPath, } from './utils.js';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/graph/mappers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,2BAA2B,EAC3B,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Microsoft Graph type mappers.
|
|
7
|
+
*
|
|
8
|
+
* Exports functions to convert Graph API types to internal row types.
|
|
9
|
+
*/
|
|
10
|
+
export { mapMailFolderToRow, mapCalendarToFolderRow, mapTaskListToFolderRow, } from './folder-mapper.js';
|
|
11
|
+
export { mapMessageToEmailRow } from './email-mapper.js';
|
|
12
|
+
export { mapEventToEventRow } from './event-mapper.js';
|
|
13
|
+
export { mapContactToContactRow } from './contact-mapper.js';
|
|
14
|
+
export { mapTaskToTaskRow } from './task-mapper.js';
|
|
15
|
+
export { hashStringToNumber, isoToTimestamp, dateTimeTimeZoneToTimestamp, unixTimestampToIso, unixTimestampToLocalIso, importanceToPriority, flagStatusToNumber, extractEmailAddress, extractDisplayName, formatRecipients, formatRecipientAddresses, createGraphContentPath, } from './utils.js';
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/graph/mappers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAyB,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,2BAA2B,EAC3B,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Maps Microsoft Graph TodoTask type to TaskRow.
|
|
7
|
+
*/
|
|
8
|
+
import type * as MicrosoftGraph from '@microsoft/microsoft-graph-types';
|
|
9
|
+
import type { TaskRow } from '../../database/repository.js';
|
|
10
|
+
/**
|
|
11
|
+
* Extended TodoTask with taskListId for reference.
|
|
12
|
+
*/
|
|
13
|
+
export interface TodoTaskWithList extends MicrosoftGraph.TodoTask {
|
|
14
|
+
taskListId?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Maps a Graph TodoTask to a TaskRow.
|
|
18
|
+
*/
|
|
19
|
+
export declare function mapTaskToTaskRow(task: TodoTaskWithList): TaskRow;
|
|
20
|
+
//# sourceMappingURL=task-mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-mapper.d.ts","sourceRoot":"","sources":["../../../src/graph/mappers/task-mapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,KAAK,KAAK,cAAc,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAQ5D;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,QAAQ;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAmBhE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
import { hashStringToNumber, dateTimeTimeZoneToTimestamp, importanceToPriority, createGraphContentPath, } from './utils.js';
|
|
6
|
+
/**
|
|
7
|
+
* Maps a Graph TodoTask to a TaskRow.
|
|
8
|
+
*/
|
|
9
|
+
export function mapTaskToTaskRow(task) {
|
|
10
|
+
const taskId = task.id ?? '';
|
|
11
|
+
// Type assertions needed due to Graph API's NullableOption types
|
|
12
|
+
// which are incompatible with exactOptionalPropertyTypes
|
|
13
|
+
const dueDateTime = task.dueDateTime;
|
|
14
|
+
const startDateTime = task.startDateTime;
|
|
15
|
+
return {
|
|
16
|
+
id: hashStringToNumber(taskId),
|
|
17
|
+
folderId: task.taskListId != null ? hashStringToNumber(task.taskListId) : 0,
|
|
18
|
+
name: task.title ?? null,
|
|
19
|
+
isCompleted: task.status === 'completed' ? 1 : 0,
|
|
20
|
+
dueDate: dateTimeTimeZoneToTimestamp(dueDateTime),
|
|
21
|
+
startDate: dateTimeTimeZoneToTimestamp(startDateTime),
|
|
22
|
+
priority: importanceToPriority(task.importance),
|
|
23
|
+
hasReminder: task.isReminderOn === true ? 1 : 0,
|
|
24
|
+
dataFilePath: createGraphContentPath('task', `${task.taskListId ?? 'default'}:${taskId}`),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=task-mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-mapper.js","sourceRoot":"","sources":["../../../src/graph/mappers/task-mapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EACL,kBAAkB,EAClB,2BAA2B,EAC3B,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AASpB;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAsB;IACrD,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;IAE7B,iEAAiE;IACjE,yDAAyD;IACzD,MAAM,WAAW,GAAG,IAAI,CAAC,WAA0E,CAAC;IACpG,MAAM,aAAa,GAAG,IAAI,CAAC,aAA4E,CAAC;IAExG,OAAO;QACL,EAAE,EAAE,kBAAkB,CAAC,MAAM,CAAC;QAC9B,QAAQ,EAAE,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3E,IAAI,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI;QACxB,WAAW,EAAE,IAAI,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChD,OAAO,EAAE,2BAA2B,CAAC,WAAW,CAAC;QACjD,SAAS,EAAE,2BAA2B,CAAC,aAAa,CAAC;QACrD,QAAQ,EAAE,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC;QAC/C,WAAW,EAAE,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,YAAY,EAAE,sBAAsB,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,IAAI,SAAS,IAAI,MAAM,EAAE,CAAC;KAC1F,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Utility functions for mappers.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Hashes a string ID to a numeric ID.
|
|
10
|
+
*
|
|
11
|
+
* Graph API uses string UUIDs while our row types use numeric IDs.
|
|
12
|
+
* This creates a deterministic numeric ID from a string.
|
|
13
|
+
*
|
|
14
|
+
* Note: There's a small chance of collision, but it's acceptable
|
|
15
|
+
* for our use case (display purposes only, not database operations).
|
|
16
|
+
*/
|
|
17
|
+
export declare function hashStringToNumber(str: string): number;
|
|
18
|
+
/**
|
|
19
|
+
* Parses an ISO date string to a Unix timestamp (seconds).
|
|
20
|
+
*/
|
|
21
|
+
export declare function isoToTimestamp(isoDate: string | null | undefined): number | null;
|
|
22
|
+
/**
|
|
23
|
+
* Parses a Graph DateTimeTimeZone object to a Unix timestamp.
|
|
24
|
+
*
|
|
25
|
+
* Graph API returns datetime strings WITHOUT a Z suffix (e.g. "2026-02-23T16:00:00.0000000")
|
|
26
|
+
* alongside a separate timeZone field (e.g. "UTC"). JavaScript's Date constructor treats
|
|
27
|
+
* strings without Z or offset as local time, so we must append Z when the timezone is UTC.
|
|
28
|
+
*/
|
|
29
|
+
export declare function dateTimeTimeZoneToTimestamp(dt: {
|
|
30
|
+
dateTime?: string;
|
|
31
|
+
timeZone?: string;
|
|
32
|
+
} | null | undefined): number | null;
|
|
33
|
+
/**
|
|
34
|
+
* Maps Graph importance to a priority number.
|
|
35
|
+
*/
|
|
36
|
+
export declare function importanceToPriority(importance: string | null | undefined): number;
|
|
37
|
+
/**
|
|
38
|
+
* Maps Graph flag status to a number.
|
|
39
|
+
*/
|
|
40
|
+
export declare function flagStatusToNumber(flag: {
|
|
41
|
+
flagStatus?: string;
|
|
42
|
+
} | null | undefined): number;
|
|
43
|
+
/**
|
|
44
|
+
* Extracts email address from a Graph EmailAddress object.
|
|
45
|
+
*/
|
|
46
|
+
export declare function extractEmailAddress(recipient: {
|
|
47
|
+
emailAddress?: {
|
|
48
|
+
address?: string;
|
|
49
|
+
name?: string;
|
|
50
|
+
};
|
|
51
|
+
} | null | undefined): string | null;
|
|
52
|
+
/**
|
|
53
|
+
* Extracts display name from a Graph EmailAddress object.
|
|
54
|
+
*/
|
|
55
|
+
export declare function extractDisplayName(recipient: {
|
|
56
|
+
emailAddress?: {
|
|
57
|
+
address?: string;
|
|
58
|
+
name?: string;
|
|
59
|
+
};
|
|
60
|
+
} | null | undefined): string | null;
|
|
61
|
+
/**
|
|
62
|
+
* Formats recipients array to a comma-separated string.
|
|
63
|
+
*/
|
|
64
|
+
export declare function formatRecipients(recipients: Array<{
|
|
65
|
+
emailAddress?: {
|
|
66
|
+
address?: string;
|
|
67
|
+
name?: string;
|
|
68
|
+
};
|
|
69
|
+
}> | null | undefined): string | null;
|
|
70
|
+
/**
|
|
71
|
+
* Formats recipients array to email addresses string.
|
|
72
|
+
*/
|
|
73
|
+
export declare function formatRecipientAddresses(recipients: Array<{
|
|
74
|
+
emailAddress?: {
|
|
75
|
+
address?: string;
|
|
76
|
+
name?: string;
|
|
77
|
+
};
|
|
78
|
+
}> | null | undefined): string | null;
|
|
79
|
+
/**
|
|
80
|
+
* Converts a Unix timestamp (seconds since 1970) to an ISO 8601 string in UTC.
|
|
81
|
+
*
|
|
82
|
+
* Unlike appleTimestampToIso (which adds the Apple epoch offset),
|
|
83
|
+
* this treats the input as a standard Unix timestamp.
|
|
84
|
+
*/
|
|
85
|
+
export declare function unixTimestampToIso(timestamp: number | null | undefined): string | null;
|
|
86
|
+
/**
|
|
87
|
+
* Converts a Unix timestamp (seconds since 1970) to an ISO 8601 string
|
|
88
|
+
* in the system's local timezone with offset (e.g. "2026-02-23T10:00:00.000-05:00").
|
|
89
|
+
*
|
|
90
|
+
* This makes dates human-readable at a glance while remaining unambiguous.
|
|
91
|
+
*/
|
|
92
|
+
export declare function unixTimestampToLocalIso(timestamp: number | null | undefined): string | null;
|
|
93
|
+
/**
|
|
94
|
+
* Creates a Graph content path from an entity type and ID.
|
|
95
|
+
*/
|
|
96
|
+
export declare function createGraphContentPath(type: string, id: string): string;
|
|
97
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/graph/mappers/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAStD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAehF;AAQD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GAC9D,MAAM,GAAG,IAAI,CAuBf;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CASlF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GAC/C,MAAM,CASR;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE;IAAE,YAAY,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GACnF,MAAM,GAAG,IAAI,CAEf;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE;IAAE,YAAY,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GACnF,MAAM,GAAG,IAAI,CAEf;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,KAAK,CAAC;IAAE,YAAY,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAC3F,MAAM,GAAG,IAAI,CASf;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,KAAK,CAAC;IAAE,YAAY,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAC3F,MAAM,GAAG,IAAI,CASf;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACnC,MAAM,GAAG,IAAI,CAMf;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACnC,MAAM,GAAG,IAAI,CAsBf;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAEvE"}
|