@opentabs-dev/opentabs-plugin-outlook 0.0.81
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/README.md +59 -0
- package/dist/adapter.iife.js +15081 -0
- package/dist/adapter.iife.js.map +7 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -0
- package/dist/outlook-api.d.ts +13 -0
- package/dist/outlook-api.d.ts.map +1 -0
- package/dist/outlook-api.js +231 -0
- package/dist/outlook-api.js.map +1 -0
- package/dist/tools/create-draft.d.ts +21 -0
- package/dist/tools/create-draft.d.ts.map +1 -0
- package/dist/tools/create-draft.js +46 -0
- package/dist/tools/create-draft.js.map +1 -0
- package/dist/tools/delete-message.d.ts +7 -0
- package/dist/tools/delete-message.d.ts.map +1 -0
- package/dist/tools/delete-message.js +22 -0
- package/dist/tools/delete-message.js.map +1 -0
- package/dist/tools/forward-message.d.ts +9 -0
- package/dist/tools/forward-message.d.ts.map +1 -0
- package/dist/tools/forward-message.js +30 -0
- package/dist/tools/forward-message.js.map +1 -0
- package/dist/tools/get-attachment-content.d.ts +15 -0
- package/dist/tools/get-attachment-content.d.ts.map +1 -0
- package/dist/tools/get-attachment-content.js +66 -0
- package/dist/tools/get-attachment-content.js.map +1 -0
- package/dist/tools/get-current-user.d.ts +9 -0
- package/dist/tools/get-current-user.d.ts.map +1 -0
- package/dist/tools/get-current-user.js +21 -0
- package/dist/tools/get-current-user.js.map +1 -0
- package/dist/tools/get-message.d.ts +37 -0
- package/dist/tools/get-message.d.ts.map +1 -0
- package/dist/tools/get-message.js +23 -0
- package/dist/tools/get-message.js.map +1 -0
- package/dist/tools/list-attachments.d.ts +13 -0
- package/dist/tools/list-attachments.d.ts.map +1 -0
- package/dist/tools/list-attachments.js +25 -0
- package/dist/tools/list-attachments.js.map +1 -0
- package/dist/tools/list-folders.d.ts +15 -0
- package/dist/tools/list-folders.d.ts.map +1 -0
- package/dist/tools/list-folders.js +36 -0
- package/dist/tools/list-folders.js.map +1 -0
- package/dist/tools/list-messages.d.ts +27 -0
- package/dist/tools/list-messages.d.ts.map +1 -0
- package/dist/tools/list-messages.js +48 -0
- package/dist/tools/list-messages.js.map +1 -0
- package/dist/tools/move-message.d.ts +8 -0
- package/dist/tools/move-message.d.ts.map +1 -0
- package/dist/tools/move-message.js +26 -0
- package/dist/tools/move-message.js.map +1 -0
- package/dist/tools/reply-to-message.d.ts +13 -0
- package/dist/tools/reply-to-message.d.ts.map +1 -0
- package/dist/tools/reply-to-message.js +35 -0
- package/dist/tools/reply-to-message.js.map +1 -0
- package/dist/tools/schemas.d.ts +199 -0
- package/dist/tools/schemas.d.ts.map +1 -0
- package/dist/tools/schemas.js +101 -0
- package/dist/tools/schemas.js.map +1 -0
- package/dist/tools/search-messages.d.ts +24 -0
- package/dist/tools/search-messages.d.ts.map +1 -0
- package/dist/tools/search-messages.js +30 -0
- package/dist/tools/search-messages.js.map +1 -0
- package/dist/tools/send-message.d.ts +21 -0
- package/dist/tools/send-message.d.ts.map +1 -0
- package/dist/tools/send-message.js +46 -0
- package/dist/tools/send-message.js.map +1 -0
- package/dist/tools/update-message.d.ts +19 -0
- package/dist/tools/update-message.d.ts.map +1 -0
- package/dist/tools/update-message.js +38 -0
- package/dist/tools/update-message.js.map +1 -0
- package/dist/tools.json +1113 -0
- package/package.json +64 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-current-user.js","sourceRoot":"","sources":["../../src/tools/get-current-user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAgB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEjE,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;IACvC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,6FAA6F;IAC1G,OAAO,EAAE,8BAA8B;IACvC,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACnB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IACtC,MAAM,EAAE,KAAK,IAAI,EAAE;QACjB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAU,KAAK,EAAE;YACrC,KAAK,EAAE,EAAE,OAAO,EAAE,uCAAuC,EAAE;SAC5D,CAAC,CAAC;QACH,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;IACjC,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const getMessage: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
message_id: z.ZodString;
|
|
4
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5
|
+
message: z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
subject: z.ZodString;
|
|
8
|
+
from: z.ZodObject<{
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
address: z.ZodString;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
to: z.ZodArray<z.ZodObject<{
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
address: z.ZodString;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
received_at: z.ZodString;
|
|
17
|
+
is_read: z.ZodBoolean;
|
|
18
|
+
has_attachments: z.ZodBoolean;
|
|
19
|
+
importance: z.ZodString;
|
|
20
|
+
preview: z.ZodString;
|
|
21
|
+
cc: z.ZodArray<z.ZodObject<{
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
address: z.ZodString;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
bcc: z.ZodArray<z.ZodObject<{
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
address: z.ZodString;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
body_type: z.ZodString;
|
|
30
|
+
body: z.ZodString;
|
|
31
|
+
web_link: z.ZodString;
|
|
32
|
+
conversation_id: z.ZodString;
|
|
33
|
+
categories: z.ZodArray<z.ZodString>;
|
|
34
|
+
flag_status: z.ZodString;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
//# sourceMappingURL=get-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-message.d.ts","sourceRoot":"","sources":["../../src/tools/get-message.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkBrB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../outlook-api.js';
|
|
4
|
+
import { MESSAGE_DETAIL_FIELDS, mapMessageDetail, messageDetailSchema } from './schemas.js';
|
|
5
|
+
export const getMessage = defineTool({
|
|
6
|
+
name: 'get_message',
|
|
7
|
+
displayName: 'Get Message',
|
|
8
|
+
description: 'Get the full content of an email message by ID, including body, all recipients, and metadata. Use list_messages or search_messages to find message IDs.',
|
|
9
|
+
summary: 'Get full email content',
|
|
10
|
+
icon: 'mail-open',
|
|
11
|
+
group: 'Messages',
|
|
12
|
+
input: z.object({
|
|
13
|
+
message_id: z.string().describe('The message ID'),
|
|
14
|
+
}),
|
|
15
|
+
output: z.object({ message: messageDetailSchema }),
|
|
16
|
+
handle: async (params) => {
|
|
17
|
+
const data = await api(`/me/messages/${params.message_id}`, {
|
|
18
|
+
query: { $select: MESSAGE_DETAIL_FIELDS },
|
|
19
|
+
});
|
|
20
|
+
return { message: mapMessageDetail(data) };
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=get-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-message.js","sourceRoot":"","sources":["../../src/tools/get-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAmB,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAE7G,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;IACnC,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EACT,yJAAyJ;IAC3J,OAAO,EAAE,wBAAwB;IACjC,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;KAClD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAClD,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAa,gBAAgB,MAAM,CAAC,UAAU,EAAE,EAAE;YACtE,KAAK,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE;SAC1C,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC7C,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listAttachments: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
message_id: z.ZodString;
|
|
4
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5
|
+
attachments: z.ZodArray<z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
content_type: z.ZodString;
|
|
9
|
+
size: z.ZodNumber;
|
|
10
|
+
is_inline: z.ZodBoolean;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
//# sourceMappingURL=list-attachments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-attachments.d.ts","sourceRoot":"","sources":["../../src/tools/list-attachments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,eAAe;;;;;;;;;;kBAmB1B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../outlook-api.js';
|
|
4
|
+
import { attachmentSchema, mapAttachment } from './schemas.js';
|
|
5
|
+
export const listAttachments = defineTool({
|
|
6
|
+
name: 'list_attachments',
|
|
7
|
+
displayName: 'List Attachments',
|
|
8
|
+
description: 'List attachments on an email message. Returns file names, types, and sizes.',
|
|
9
|
+
summary: 'List email attachments',
|
|
10
|
+
icon: 'paperclip',
|
|
11
|
+
group: 'Messages',
|
|
12
|
+
input: z.object({
|
|
13
|
+
message_id: z.string().describe('The message ID'),
|
|
14
|
+
}),
|
|
15
|
+
output: z.object({
|
|
16
|
+
attachments: z.array(attachmentSchema).describe('Message attachments'),
|
|
17
|
+
}),
|
|
18
|
+
handle: async (params) => {
|
|
19
|
+
const data = await api(`/me/messages/${params.message_id}/attachments`, {
|
|
20
|
+
query: { $select: 'id,name,contentType,size,isInline' },
|
|
21
|
+
});
|
|
22
|
+
return { attachments: (data.value ?? []).map(mapAttachment) };
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=list-attachments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-attachments.js","sourceRoot":"","sources":["../../src/tools/list-attachments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAsB,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEnF,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;IACxC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,6EAA6E;IAC1F,OAAO,EAAE,wBAAwB;IACjC,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;KAClD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC;KACvE,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CAA6B,gBAAgB,MAAM,CAAC,UAAU,cAAc,EAAE;YAClG,KAAK,EAAE,EAAE,OAAO,EAAE,mCAAmC,EAAE;SACxD,CAAC,CAAC;QACH,OAAO,EAAE,WAAW,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;IAChE,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listFolders: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
parent_folder_id: z.ZodOptional<z.ZodString>;
|
|
4
|
+
include_hidden: z.ZodOptional<z.ZodBoolean>;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
folders: z.ZodArray<z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
display_name: z.ZodString;
|
|
9
|
+
parent_folder_id: z.ZodString;
|
|
10
|
+
child_folder_count: z.ZodNumber;
|
|
11
|
+
unread_count: z.ZodNumber;
|
|
12
|
+
total_count: z.ZodNumber;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
}, z.core.$strip>>;
|
|
15
|
+
//# sourceMappingURL=list-folders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-folders.d.ts","sourceRoot":"","sources":["../../src/tools/list-folders.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,WAAW;;;;;;;;;;;;kBA+BtB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../outlook-api.js';
|
|
4
|
+
import { mailFolderSchema, mapMailFolder } from './schemas.js';
|
|
5
|
+
export const listFolders = defineTool({
|
|
6
|
+
name: 'list_folders',
|
|
7
|
+
displayName: 'List Folders',
|
|
8
|
+
description: 'List mail folders in the mailbox. Returns folder names, IDs, and unread/total counts. Use folder IDs with list_messages to read specific folders.',
|
|
9
|
+
summary: 'List mail folders',
|
|
10
|
+
icon: 'folder',
|
|
11
|
+
group: 'Folders',
|
|
12
|
+
input: z.object({
|
|
13
|
+
parent_folder_id: z
|
|
14
|
+
.string()
|
|
15
|
+
.optional()
|
|
16
|
+
.describe('Parent folder ID to list child folders. Omit for top-level folders.'),
|
|
17
|
+
include_hidden: z.boolean().optional().describe('Include hidden folders (default: false)'),
|
|
18
|
+
}),
|
|
19
|
+
output: z.object({
|
|
20
|
+
folders: z.array(mailFolderSchema).describe('Mail folders'),
|
|
21
|
+
}),
|
|
22
|
+
handle: async (params) => {
|
|
23
|
+
const endpoint = params.parent_folder_id
|
|
24
|
+
? `/me/mailFolders/${params.parent_folder_id}/childFolders`
|
|
25
|
+
: '/me/mailFolders';
|
|
26
|
+
const data = await api(endpoint, {
|
|
27
|
+
query: {
|
|
28
|
+
$select: 'id,displayName,parentFolderId,childFolderCount,unreadItemCount,totalItemCount',
|
|
29
|
+
$top: 50,
|
|
30
|
+
includeHiddenFolders: params.include_hidden ? 'true' : undefined,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
return { folders: (data.value ?? []).map(mapMailFolder) };
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=list-folders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-folders.js","sourceRoot":"","sources":["../../src/tools/list-folders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAsB,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEnF,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;IACpC,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EACT,mJAAmJ;IACrJ,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,gBAAgB,EAAE,CAAC;aAChB,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,qEAAqE,CAAC;QAClF,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;KAC3F,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC;KAC5D,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB;YACtC,CAAC,CAAC,mBAAmB,MAAM,CAAC,gBAAgB,eAAe;YAC3D,CAAC,CAAC,iBAAiB,CAAC;QACtB,MAAM,IAAI,GAAG,MAAM,GAAG,CAA6B,QAAQ,EAAE;YAC3D,KAAK,EAAE;gBACL,OAAO,EAAE,+EAA+E;gBACxF,IAAI,EAAE,EAAE;gBACR,oBAAoB,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;aACjE;SACF,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;IAC5D,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listMessages: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
folder_id: z.ZodOptional<z.ZodString>;
|
|
4
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
skip: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
messages: z.ZodArray<z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
subject: z.ZodString;
|
|
11
|
+
from: z.ZodObject<{
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
address: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
to: z.ZodArray<z.ZodObject<{
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
address: z.ZodString;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
received_at: z.ZodString;
|
|
20
|
+
is_read: z.ZodBoolean;
|
|
21
|
+
has_attachments: z.ZodBoolean;
|
|
22
|
+
importance: z.ZodString;
|
|
23
|
+
preview: z.ZodString;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
total_count: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
//# sourceMappingURL=list-messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-messages.d.ts","sourceRoot":"","sources":["../../src/tools/list-messages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;kBA6CvB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../outlook-api.js';
|
|
4
|
+
import { MESSAGE_SUMMARY_FIELDS, mapMessageSummary, messageSummarySchema } from './schemas.js';
|
|
5
|
+
export const listMessages = defineTool({
|
|
6
|
+
name: 'list_messages',
|
|
7
|
+
displayName: 'List Messages',
|
|
8
|
+
description: 'List email messages from a mail folder. Defaults to Inbox. Use folder_id to target other folders (get IDs from list_folders). Results are ordered by most recent first.',
|
|
9
|
+
summary: 'List emails in a folder',
|
|
10
|
+
icon: 'inbox',
|
|
11
|
+
group: 'Messages',
|
|
12
|
+
input: z.object({
|
|
13
|
+
folder_id: z
|
|
14
|
+
.string()
|
|
15
|
+
.optional()
|
|
16
|
+
.describe('Mail folder ID or well-known name (Inbox, Drafts, SentItems, DeletedItems, Archive). Defaults to Inbox.'),
|
|
17
|
+
limit: z.number().int().min(1).max(50).optional().describe('Max results (default 10, max 50)'),
|
|
18
|
+
skip: z.number().int().min(0).optional().describe('Number of messages to skip for pagination'),
|
|
19
|
+
filter: z
|
|
20
|
+
.string()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe('OData $filter expression (e.g. "isRead eq false", "importance eq \'high\'")'),
|
|
23
|
+
}),
|
|
24
|
+
output: z.object({
|
|
25
|
+
messages: z.array(messageSummarySchema).describe('Email messages'),
|
|
26
|
+
total_count: z.number().optional().describe('Total count if available'),
|
|
27
|
+
}),
|
|
28
|
+
handle: async (params) => {
|
|
29
|
+
const folder = params.folder_id ?? 'Inbox';
|
|
30
|
+
const endpoint = `/me/mailFolders/${folder}/messages`;
|
|
31
|
+
const data = await api(endpoint, {
|
|
32
|
+
query: {
|
|
33
|
+
$select: MESSAGE_SUMMARY_FIELDS,
|
|
34
|
+
$orderby: 'receivedDateTime desc',
|
|
35
|
+
$top: params.limit ?? 10,
|
|
36
|
+
$skip: params.skip,
|
|
37
|
+
$filter: params.filter,
|
|
38
|
+
$count: true,
|
|
39
|
+
},
|
|
40
|
+
headers: { ConsistencyLevel: 'eventual' },
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
messages: (data.value ?? []).map(mapMessageSummary),
|
|
44
|
+
total_count: data['@odata.count'],
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=list-messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-messages.js","sourceRoot":"","sources":["../../src/tools/list-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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,MAAM,EAAC,EAAE;QACrB,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,IAAI,OAAO,CAAC;QAC3C,MAAM,QAAQ,GAAG,mBAAmB,MAAM,WAAW,CAAC;QACtD,MAAM,IAAI,GAAG,MAAM,GAAG,CAAmD,QAAQ,EAAE;YACjF,KAAK,EAAE;gBACL,OAAO,EAAE,sBAAsB;gBAC/B,QAAQ,EAAE,uBAAuB;gBACjC,IAAI,EAAE,MAAM,CAAC,KAAK,IAAI,EAAE;gBACxB,KAAK,EAAE,MAAM,CAAC,IAAI;gBAClB,OAAO,EAAE,MAAM,CAAC,MAAM;gBACtB,MAAM,EAAE,IAAI;aACb;YACD,OAAO,EAAE,EAAE,gBAAgB,EAAE,UAAU,EAAE;SAC1C,CAAC,CAAC;QACH,OAAO;YACL,QAAQ,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,iBAAiB,CAAC;YACnD,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC;SAClC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const moveMessage: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
message_id: z.ZodString;
|
|
4
|
+
destination_folder_id: z.ZodString;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
new_message_id: z.ZodString;
|
|
7
|
+
}, z.core.$strip>>;
|
|
8
|
+
//# sourceMappingURL=move-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move-message.d.ts","sourceRoot":"","sources":["../../src/tools/move-message.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,WAAW;;;;;kBAsBtB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../outlook-api.js';
|
|
4
|
+
export const moveMessage = defineTool({
|
|
5
|
+
name: 'move_message',
|
|
6
|
+
displayName: 'Move Message',
|
|
7
|
+
description: 'Move an email message to a different folder. Use well-known names (Inbox, Archive, DeletedItems, Drafts, JunkEmail, SentItems) or folder IDs from list_folders.',
|
|
8
|
+
summary: 'Move email to folder',
|
|
9
|
+
icon: 'folder-input',
|
|
10
|
+
group: 'Messages',
|
|
11
|
+
input: z.object({
|
|
12
|
+
message_id: z.string().describe('The message ID to move'),
|
|
13
|
+
destination_folder_id: z.string().describe('Destination folder ID or well-known name'),
|
|
14
|
+
}),
|
|
15
|
+
output: z.object({
|
|
16
|
+
new_message_id: z.string().describe('The message ID in its new location'),
|
|
17
|
+
}),
|
|
18
|
+
handle: async (params) => {
|
|
19
|
+
const data = await api(`/me/messages/${params.message_id}/move`, {
|
|
20
|
+
method: 'POST',
|
|
21
|
+
body: { destinationId: params.destination_folder_id },
|
|
22
|
+
});
|
|
23
|
+
return { new_message_id: data.id ?? '' };
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=move-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move-message.js","sourceRoot":"","sources":["../../src/tools/move-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;IACpC,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EACT,iKAAiK;IACnK,OAAO,EAAE,sBAAsB;IAC/B,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QACzD,qBAAqB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;KACvF,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;KAC1E,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAiB,gBAAgB,MAAM,CAAC,UAAU,OAAO,EAAE;YAC/E,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,aAAa,EAAE,MAAM,CAAC,qBAAqB,EAAE;SACtD,CAAC,CAAC;QACH,OAAO,EAAE,cAAc,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC;IAC3C,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const replyToMessage: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
message_id: z.ZodString;
|
|
4
|
+
body: z.ZodString;
|
|
5
|
+
body_type: z.ZodOptional<z.ZodEnum<{
|
|
6
|
+
text: "text";
|
|
7
|
+
html: "html";
|
|
8
|
+
}>>;
|
|
9
|
+
reply_all: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
success: z.ZodBoolean;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
//# sourceMappingURL=reply-to-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reply-to-message.d.ts","sourceRoot":"","sources":["../../src/tools/reply-to-message.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,cAAc;;;;;;;;;;kBA+BzB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../outlook-api.js';
|
|
4
|
+
export const replyToMessage = defineTool({
|
|
5
|
+
name: 'reply_to_message',
|
|
6
|
+
displayName: 'Reply to Message',
|
|
7
|
+
description: 'Reply to an email message. Set reply_all to true to reply to all recipients.',
|
|
8
|
+
summary: 'Reply to an email',
|
|
9
|
+
icon: 'reply',
|
|
10
|
+
group: 'Messages',
|
|
11
|
+
input: z.object({
|
|
12
|
+
message_id: z.string().describe('The message ID to reply to'),
|
|
13
|
+
body: z.string().describe('Reply body content'),
|
|
14
|
+
body_type: z.enum(['text', 'html']).optional().describe('Body content type (default: text)'),
|
|
15
|
+
reply_all: z.boolean().optional().describe('Reply to all recipients (default: false)'),
|
|
16
|
+
}),
|
|
17
|
+
output: z.object({
|
|
18
|
+
success: z.boolean().describe('Whether the reply was sent'),
|
|
19
|
+
}),
|
|
20
|
+
handle: async (params) => {
|
|
21
|
+
const action = params.reply_all ? 'replyAll' : 'reply';
|
|
22
|
+
await api(`/me/messages/${params.message_id}/${action}`, {
|
|
23
|
+
method: 'POST',
|
|
24
|
+
body: params.body_type === 'html'
|
|
25
|
+
? {
|
|
26
|
+
message: {
|
|
27
|
+
body: { contentType: 'HTML', content: params.body },
|
|
28
|
+
},
|
|
29
|
+
}
|
|
30
|
+
: { comment: params.body },
|
|
31
|
+
});
|
|
32
|
+
return { success: true };
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=reply-to-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reply-to-message.js","sourceRoot":"","sources":["../../src/tools/reply-to-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MA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,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,IAAI,EAAE;qBACpD;iBACF;gBACH,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,IAAI,EAAE;SAC/B,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const userSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
display_name: z.ZodString;
|
|
5
|
+
email: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export interface RawUser {
|
|
8
|
+
id?: string;
|
|
9
|
+
displayName?: string;
|
|
10
|
+
mail?: string;
|
|
11
|
+
userPrincipalName?: string;
|
|
12
|
+
emailAddress?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const mapUser: (u: RawUser) => {
|
|
15
|
+
id: string;
|
|
16
|
+
display_name: string;
|
|
17
|
+
email: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const emailAddressSchema: z.ZodObject<{
|
|
20
|
+
name: z.ZodString;
|
|
21
|
+
address: z.ZodString;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export interface RawEmailAddress {
|
|
24
|
+
emailAddress?: {
|
|
25
|
+
name?: string;
|
|
26
|
+
address?: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export declare const mapEmailAddress: (e: RawEmailAddress | undefined | null) => {
|
|
30
|
+
name: string;
|
|
31
|
+
address: string;
|
|
32
|
+
};
|
|
33
|
+
export declare const messageSummarySchema: z.ZodObject<{
|
|
34
|
+
id: z.ZodString;
|
|
35
|
+
subject: z.ZodString;
|
|
36
|
+
from: z.ZodObject<{
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
address: z.ZodString;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
to: z.ZodArray<z.ZodObject<{
|
|
41
|
+
name: z.ZodString;
|
|
42
|
+
address: z.ZodString;
|
|
43
|
+
}, z.core.$strip>>;
|
|
44
|
+
received_at: z.ZodString;
|
|
45
|
+
is_read: z.ZodBoolean;
|
|
46
|
+
has_attachments: z.ZodBoolean;
|
|
47
|
+
importance: z.ZodString;
|
|
48
|
+
preview: z.ZodString;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export declare const messageDetailSchema: z.ZodObject<{
|
|
51
|
+
id: z.ZodString;
|
|
52
|
+
subject: z.ZodString;
|
|
53
|
+
from: z.ZodObject<{
|
|
54
|
+
name: z.ZodString;
|
|
55
|
+
address: z.ZodString;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
to: z.ZodArray<z.ZodObject<{
|
|
58
|
+
name: z.ZodString;
|
|
59
|
+
address: z.ZodString;
|
|
60
|
+
}, z.core.$strip>>;
|
|
61
|
+
received_at: z.ZodString;
|
|
62
|
+
is_read: z.ZodBoolean;
|
|
63
|
+
has_attachments: z.ZodBoolean;
|
|
64
|
+
importance: z.ZodString;
|
|
65
|
+
preview: z.ZodString;
|
|
66
|
+
cc: z.ZodArray<z.ZodObject<{
|
|
67
|
+
name: z.ZodString;
|
|
68
|
+
address: z.ZodString;
|
|
69
|
+
}, z.core.$strip>>;
|
|
70
|
+
bcc: z.ZodArray<z.ZodObject<{
|
|
71
|
+
name: z.ZodString;
|
|
72
|
+
address: z.ZodString;
|
|
73
|
+
}, z.core.$strip>>;
|
|
74
|
+
body_type: z.ZodString;
|
|
75
|
+
body: z.ZodString;
|
|
76
|
+
web_link: z.ZodString;
|
|
77
|
+
conversation_id: z.ZodString;
|
|
78
|
+
categories: z.ZodArray<z.ZodString>;
|
|
79
|
+
flag_status: z.ZodString;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
export interface RawMessage {
|
|
82
|
+
id?: string;
|
|
83
|
+
subject?: string;
|
|
84
|
+
from?: RawEmailAddress;
|
|
85
|
+
toRecipients?: RawEmailAddress[];
|
|
86
|
+
ccRecipients?: RawEmailAddress[];
|
|
87
|
+
bccRecipients?: RawEmailAddress[];
|
|
88
|
+
receivedDateTime?: string;
|
|
89
|
+
isRead?: boolean;
|
|
90
|
+
hasAttachments?: boolean;
|
|
91
|
+
importance?: string;
|
|
92
|
+
bodyPreview?: string;
|
|
93
|
+
body?: {
|
|
94
|
+
contentType?: string;
|
|
95
|
+
content?: string;
|
|
96
|
+
};
|
|
97
|
+
webLink?: string;
|
|
98
|
+
conversationId?: string;
|
|
99
|
+
categories?: string[];
|
|
100
|
+
flag?: {
|
|
101
|
+
flagStatus?: string;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
export declare const mapMessageSummary: (m: RawMessage) => {
|
|
105
|
+
id: string;
|
|
106
|
+
subject: string;
|
|
107
|
+
from: {
|
|
108
|
+
name: string;
|
|
109
|
+
address: string;
|
|
110
|
+
};
|
|
111
|
+
to: {
|
|
112
|
+
name: string;
|
|
113
|
+
address: string;
|
|
114
|
+
}[];
|
|
115
|
+
received_at: string;
|
|
116
|
+
is_read: boolean;
|
|
117
|
+
has_attachments: boolean;
|
|
118
|
+
importance: string;
|
|
119
|
+
preview: string;
|
|
120
|
+
};
|
|
121
|
+
export declare const mapMessageDetail: (m: RawMessage) => {
|
|
122
|
+
cc: {
|
|
123
|
+
name: string;
|
|
124
|
+
address: string;
|
|
125
|
+
}[];
|
|
126
|
+
bcc: {
|
|
127
|
+
name: string;
|
|
128
|
+
address: string;
|
|
129
|
+
}[];
|
|
130
|
+
body_type: string;
|
|
131
|
+
body: string;
|
|
132
|
+
web_link: string;
|
|
133
|
+
conversation_id: string;
|
|
134
|
+
categories: string[];
|
|
135
|
+
flag_status: string;
|
|
136
|
+
id: string;
|
|
137
|
+
subject: string;
|
|
138
|
+
from: {
|
|
139
|
+
name: string;
|
|
140
|
+
address: string;
|
|
141
|
+
};
|
|
142
|
+
to: {
|
|
143
|
+
name: string;
|
|
144
|
+
address: string;
|
|
145
|
+
}[];
|
|
146
|
+
received_at: string;
|
|
147
|
+
is_read: boolean;
|
|
148
|
+
has_attachments: boolean;
|
|
149
|
+
importance: string;
|
|
150
|
+
preview: string;
|
|
151
|
+
};
|
|
152
|
+
export declare const mailFolderSchema: z.ZodObject<{
|
|
153
|
+
id: z.ZodString;
|
|
154
|
+
display_name: z.ZodString;
|
|
155
|
+
parent_folder_id: z.ZodString;
|
|
156
|
+
child_folder_count: z.ZodNumber;
|
|
157
|
+
unread_count: z.ZodNumber;
|
|
158
|
+
total_count: z.ZodNumber;
|
|
159
|
+
}, z.core.$strip>;
|
|
160
|
+
export interface RawMailFolder {
|
|
161
|
+
id?: string;
|
|
162
|
+
displayName?: string;
|
|
163
|
+
parentFolderId?: string;
|
|
164
|
+
childFolderCount?: number;
|
|
165
|
+
unreadItemCount?: number;
|
|
166
|
+
totalItemCount?: number;
|
|
167
|
+
}
|
|
168
|
+
export declare const mapMailFolder: (f: RawMailFolder) => {
|
|
169
|
+
id: string;
|
|
170
|
+
display_name: string;
|
|
171
|
+
parent_folder_id: string;
|
|
172
|
+
child_folder_count: number;
|
|
173
|
+
unread_count: number;
|
|
174
|
+
total_count: number;
|
|
175
|
+
};
|
|
176
|
+
export declare const attachmentSchema: z.ZodObject<{
|
|
177
|
+
id: z.ZodString;
|
|
178
|
+
name: z.ZodString;
|
|
179
|
+
content_type: z.ZodString;
|
|
180
|
+
size: z.ZodNumber;
|
|
181
|
+
is_inline: z.ZodBoolean;
|
|
182
|
+
}, z.core.$strip>;
|
|
183
|
+
export interface RawAttachment {
|
|
184
|
+
id?: string;
|
|
185
|
+
name?: string;
|
|
186
|
+
contentType?: string;
|
|
187
|
+
size?: number;
|
|
188
|
+
isInline?: boolean;
|
|
189
|
+
}
|
|
190
|
+
export declare const mapAttachment: (a: RawAttachment) => {
|
|
191
|
+
id: string;
|
|
192
|
+
name: string;
|
|
193
|
+
content_type: string;
|
|
194
|
+
size: number;
|
|
195
|
+
is_inline: boolean;
|
|
196
|
+
};
|
|
197
|
+
export declare const MESSAGE_SUMMARY_FIELDS = "id,subject,from,toRecipients,receivedDateTime,isRead,hasAttachments,importance,bodyPreview";
|
|
198
|
+
export declare const MESSAGE_DETAIL_FIELDS = "id,subject,from,toRecipients,ccRecipients,bccRecipients,receivedDateTime,isRead,hasAttachments,importance,bodyPreview,body,webLink,conversationId,categories,flag";
|
|
199
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/tools/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,UAAU;;;;iBAIrB,CAAC;AAEH,MAAM,WAAW,OAAO;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,OAAO,GAAI,GAAG,OAAO;;;;CAIhC,CAAC;AAIH,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AAEH,MAAM,WAAW,eAAe;IAC9B,YAAY,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpD;AAED,eAAO,MAAM,eAAe,GAAI,GAAG,eAAe,GAAG,SAAS,GAAG,IAAI;;;CAGnE,CAAC;AAIH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;iBAU/B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAS9B,CAAC;AAEH,MAAM,WAAW,UAAU;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAA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