@littlebearapps/outlook-assistant 3.4.0 → 3.4.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/advanced/index.js CHANGED
@@ -11,6 +11,7 @@
11
11
  const { callGraphAPI } = require('../utils/graph-api');
12
12
  const { ensureAuthenticated } = require('../auth');
13
13
  const { FIELD_PRESETS } = require('../utils/field-presets');
14
+ const { DEFAULT_TIMEZONE } = require('../config');
14
15
 
15
16
  /**
16
17
  * Format an email for display (simplified)
@@ -224,16 +225,32 @@ async function handleSetMessageFlag(args) {
224
225
  };
225
226
 
226
227
  if (dueDateTime) {
228
+ // Graph API expects { dateTime, timeZone } envelope without trailing Z
229
+ // When timeZone is specified, the dateTime value is interpreted in that zone
230
+ const dueDt = dueDateTime.replace(/Z$/i, '');
227
231
  flag.dueDateTime = {
228
- dateTime: new Date(dueDateTime).toISOString(),
229
- timeZone: 'UTC',
232
+ dateTime: dueDt,
233
+ timeZone: DEFAULT_TIMEZONE,
230
234
  };
231
- }
232
235
 
233
- if (startDateTime) {
236
+ // Graph API requires startDateTime when dueDateTime is set
237
+ // Default to start of the same day if not explicitly provided
238
+ if (startDateTime) {
239
+ flag.startDateTime = {
240
+ dateTime: startDateTime.replace(/Z$/i, ''),
241
+ timeZone: DEFAULT_TIMEZONE,
242
+ };
243
+ } else {
244
+ const startOfDay = dueDt.split('T')[0] + 'T09:00:00';
245
+ flag.startDateTime = {
246
+ dateTime: startOfDay,
247
+ timeZone: DEFAULT_TIMEZONE,
248
+ };
249
+ }
250
+ } else if (startDateTime) {
234
251
  flag.startDateTime = {
235
- dateTime: new Date(startDateTime).toISOString(),
236
- timeZone: 'UTC',
252
+ dateTime: startDateTime.replace(/Z$/i, ''),
253
+ timeZone: DEFAULT_TIMEZONE,
237
254
  };
238
255
  }
239
256
 
package/config.js CHANGED
@@ -26,7 +26,7 @@ if (!homeDir) {
26
26
  module.exports = {
27
27
  // Server information
28
28
  SERVER_NAME: 'outlook-assistant',
29
- SERVER_VERSION: '3.3.0',
29
+ SERVER_VERSION: require('./package.json').version,
30
30
 
31
31
  // Test mode setting
32
32
  USE_TEST_MODE: process.env.USE_TEST_MODE === 'true',
@@ -10,15 +10,39 @@ const { callGraphAPI } = require('../utils/graph-api');
10
10
  const _folderCache = {};
11
11
 
12
12
  /**
13
- * Well-known folder names and their endpoints
13
+ * Well-known folder names and their endpoints.
14
+ * Includes Graph API well-known names (sentitems, deleteditems, junkemail),
15
+ * common display names (Sent Items, Deleted Items, Junk Email), and
16
+ * short aliases (sent, deleted, junk) for consistent resolution across tools.
14
17
  */
15
18
  const WELL_KNOWN_FOLDERS = {
19
+ // Inbox
16
20
  inbox: 'me/mailFolders/inbox/messages',
21
+
22
+ // Drafts
17
23
  drafts: 'me/mailFolders/drafts/messages',
24
+
25
+ // Sent Items - alias, Graph API name, display name
18
26
  sent: 'me/mailFolders/sentItems/messages',
27
+ sentitems: 'me/mailFolders/sentItems/messages',
28
+ 'sent items': 'me/mailFolders/sentItems/messages',
29
+
30
+ // Deleted Items - alias, Graph API name, display name
19
31
  deleted: 'me/mailFolders/deletedItems/messages',
32
+ deleteditems: 'me/mailFolders/deletedItems/messages',
33
+ 'deleted items': 'me/mailFolders/deletedItems/messages',
34
+
35
+ // Junk Email - alias, Graph API name, display name, common alias
20
36
  junk: 'me/mailFolders/junkemail/messages',
37
+ junkemail: 'me/mailFolders/junkemail/messages',
38
+ 'junk email': 'me/mailFolders/junkemail/messages',
39
+ spam: 'me/mailFolders/junkemail/messages',
40
+
41
+ // Archive
21
42
  archive: 'me/mailFolders/archive/messages',
43
+
44
+ // Outbox
45
+ outbox: 'me/mailFolders/outbox/messages',
22
46
  };
23
47
 
24
48
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@littlebearapps/outlook-assistant",
3
- "version": "3.4.0",
3
+ "version": "3.4.1",
4
4
  "mcpName": "io.github.littlebearapps/outlook-assistant",
5
5
  "description": "Outlook Assistant — MCP server with 20 tools for email, calendar, contacts, and settings via Microsoft Graph API",
6
6
  "main": "index.js",
@@ -17,7 +17,8 @@
17
17
  "lint:fix": "eslint . --fix",
18
18
  "format": "prettier --write .",
19
19
  "format:check": "prettier --check .",
20
- "prepare": "husky || true"
20
+ "prepare": "husky || true",
21
+ "version": "node -e \"const s=require('./server.json');const p=require('./package.json');s.version=p.version;s.packages[0].version=p.version;require('fs').writeFileSync('./server.json',JSON.stringify(s,null,2)+'\\n')\" && git add server.json"
21
22
  },
22
23
  "lint-staged": {
23
24
  "*.js": [
package/settings/index.js CHANGED
@@ -129,7 +129,9 @@ async function handleGetMailboxSettings(args) {
129
129
  output.push(`**Locale**: ${settings.locale || 'Not set'}`);
130
130
  output.push(`**Display Name**: ${settings.displayName || 'Not set'}`);
131
131
  } else if (section === 'timeZone') {
132
- output.push(`**Zone**: ${settings}`);
132
+ // Graph API returns { value: "timezone string" } for scalar properties
133
+ const tz = typeof settings === 'string' ? settings : settings.value;
134
+ output.push(`**Zone**: ${tz || 'Not set'}`);
133
135
  } else {
134
136
  // Fallback for unknown sections
135
137
  output.push('```json');