msgraph-cli 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/dist/commands/calendar/create.d.ts.map +1 -1
  2. package/dist/commands/calendar/create.js +9 -2
  3. package/dist/commands/calendar/create.js.map +1 -1
  4. package/dist/commands/calendar/events.d.ts.map +1 -1
  5. package/dist/commands/calendar/events.js +2 -1
  6. package/dist/commands/calendar/events.js.map +1 -1
  7. package/dist/commands/calendar/find-times.d.ts.map +1 -1
  8. package/dist/commands/calendar/find-times.js +15 -1
  9. package/dist/commands/calendar/find-times.js.map +1 -1
  10. package/dist/commands/calendar/get-schedule.d.ts +3 -0
  11. package/dist/commands/calendar/get-schedule.d.ts.map +1 -0
  12. package/dist/commands/calendar/get-schedule.js +27 -0
  13. package/dist/commands/calendar/get-schedule.js.map +1 -0
  14. package/dist/commands/calendar/index.d.ts.map +1 -1
  15. package/dist/commands/calendar/index.js +6 -0
  16. package/dist/commands/calendar/index.js.map +1 -1
  17. package/dist/commands/calendar/respond.d.ts +3 -0
  18. package/dist/commands/calendar/respond.d.ts.map +1 -0
  19. package/dist/commands/calendar/respond.js +25 -0
  20. package/dist/commands/calendar/respond.js.map +1 -0
  21. package/dist/commands/calendar/update.d.ts +3 -0
  22. package/dist/commands/calendar/update.d.ts.map +1 -0
  23. package/dist/commands/calendar/update.js +44 -0
  24. package/dist/commands/calendar/update.js.map +1 -0
  25. package/dist/commands/chat/add-member.d.ts +3 -0
  26. package/dist/commands/chat/add-member.d.ts.map +1 -0
  27. package/dist/commands/chat/add-member.js +18 -0
  28. package/dist/commands/chat/add-member.js.map +1 -0
  29. package/dist/commands/chat/get.d.ts.map +1 -1
  30. package/dist/commands/chat/get.js +9 -4
  31. package/dist/commands/chat/get.js.map +1 -1
  32. package/dist/commands/chat/index.d.ts.map +1 -1
  33. package/dist/commands/chat/index.js +6 -0
  34. package/dist/commands/chat/index.js.map +1 -1
  35. package/dist/commands/chat/remove-member.d.ts +3 -0
  36. package/dist/commands/chat/remove-member.d.ts.map +1 -0
  37. package/dist/commands/chat/remove-member.js +13 -0
  38. package/dist/commands/chat/remove-member.js.map +1 -0
  39. package/dist/commands/chat/update.d.ts +3 -0
  40. package/dist/commands/chat/update.d.ts.map +1 -0
  41. package/dist/commands/chat/update.js +13 -0
  42. package/dist/commands/chat/update.js.map +1 -0
  43. package/dist/commands/mail/forward.d.ts +3 -0
  44. package/dist/commands/mail/forward.d.ts.map +1 -0
  45. package/dist/commands/mail/forward.js +15 -0
  46. package/dist/commands/mail/forward.js.map +1 -0
  47. package/dist/commands/mail/get.d.ts +3 -0
  48. package/dist/commands/mail/get.d.ts.map +1 -0
  49. package/dist/commands/mail/get.js +29 -0
  50. package/dist/commands/mail/get.js.map +1 -0
  51. package/dist/commands/mail/index.d.ts.map +1 -1
  52. package/dist/commands/mail/index.js +8 -0
  53. package/dist/commands/mail/index.js.map +1 -1
  54. package/dist/commands/mail/list.d.ts.map +1 -1
  55. package/dist/commands/mail/list.js +16 -1
  56. package/dist/commands/mail/list.js.map +1 -1
  57. package/dist/commands/mail/mark-read.d.ts +3 -0
  58. package/dist/commands/mail/mark-read.d.ts.map +1 -0
  59. package/dist/commands/mail/mark-read.js +15 -0
  60. package/dist/commands/mail/mark-read.js.map +1 -0
  61. package/dist/commands/mail/reply.d.ts +3 -0
  62. package/dist/commands/mail/reply.d.ts.map +1 -0
  63. package/dist/commands/mail/reply.js +15 -0
  64. package/dist/commands/mail/reply.js.map +1 -0
  65. package/dist/commands/mail/search.d.ts.map +1 -1
  66. package/dist/commands/mail/search.js +16 -1
  67. package/dist/commands/mail/search.js.map +1 -1
  68. package/dist/commands/message/get.d.ts.map +1 -1
  69. package/dist/commands/message/get.js +8 -1
  70. package/dist/commands/message/get.js.map +1 -1
  71. package/dist/commands/message/index.d.ts.map +1 -1
  72. package/dist/commands/message/index.js +2 -0
  73. package/dist/commands/message/index.js.map +1 -1
  74. package/dist/commands/message/list.d.ts.map +1 -1
  75. package/dist/commands/message/list.js +12 -1
  76. package/dist/commands/message/list.js.map +1 -1
  77. package/dist/commands/message/search.d.ts.map +1 -1
  78. package/dist/commands/message/search.js +18 -1
  79. package/dist/commands/message/search.js.map +1 -1
  80. package/dist/commands/message/undelete.d.ts +3 -0
  81. package/dist/commands/message/undelete.d.ts.map +1 -0
  82. package/dist/commands/message/undelete.js +13 -0
  83. package/dist/commands/message/undelete.js.map +1 -0
  84. package/dist/commands/room/index.d.ts +3 -0
  85. package/dist/commands/room/index.d.ts.map +1 -0
  86. package/dist/commands/room/index.js +10 -0
  87. package/dist/commands/room/index.js.map +1 -0
  88. package/dist/commands/room/list-buildings.d.ts +3 -0
  89. package/dist/commands/room/list-buildings.d.ts.map +1 -0
  90. package/dist/commands/room/list-buildings.js +17 -0
  91. package/dist/commands/room/list-buildings.js.map +1 -0
  92. package/dist/commands/room/list-rooms.d.ts +3 -0
  93. package/dist/commands/room/list-rooms.d.ts.map +1 -0
  94. package/dist/commands/room/list-rooms.js +18 -0
  95. package/dist/commands/room/list-rooms.js.map +1 -0
  96. package/dist/commands/room/list.d.ts +3 -0
  97. package/dist/commands/room/list.d.ts.map +1 -0
  98. package/dist/commands/room/list.js +19 -0
  99. package/dist/commands/room/list.js.map +1 -0
  100. package/dist/index.js +2 -0
  101. package/dist/index.js.map +1 -1
  102. package/dist/utils/optimize.d.ts +3 -0
  103. package/dist/utils/optimize.d.ts.map +1 -0
  104. package/dist/utils/optimize.js +42 -0
  105. package/dist/utils/optimize.js.map +1 -0
  106. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/calendar/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAwC5C"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/calendar/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAkD5C"}
@@ -9,19 +9,26 @@ export function create(parent) {
9
9
  .requiredOption('--end <datetime>', 'End time (ISO 8601 UTC)')
10
10
  .requiredOption('--body <text>', 'Event description/agenda')
11
11
  .option('--attendees <json>', 'Attendees as JSON array: [{"email":"a@b.com","type":"required"}] or ["a@b.com"]')
12
+ .option('--rooms <emails...>', 'Room email addresses to book as resource attendees')
12
13
  .option('--location <text>', 'Location')
13
14
  .option('--online', 'Create as Teams online meeting')
14
15
  .action(async (opts) => {
15
16
  const client = await getClient();
16
17
  const attendees = opts.attendees
17
18
  ? JSON.parse(opts.attendees)
18
- : undefined;
19
+ : [];
20
+ // Add rooms as resource attendees
21
+ if (opts.rooms) {
22
+ for (const roomEmail of opts.rooms) {
23
+ attendees.push({ email: roomEmail, type: 'resource' });
24
+ }
25
+ }
19
26
  const result = await client.calendar.createEvent({
20
27
  subject: opts.subject,
21
28
  startDateTime: opts.start,
22
29
  endDateTime: opts.end,
23
30
  body: opts.body,
24
- attendees,
31
+ attendees: attendees.length ? attendees : undefined,
25
32
  location: opts.location,
26
33
  isOnlineMeeting: opts.online,
27
34
  });
@@ -1 +1 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/calendar/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,yBAAyB,CAAC;SACtC,cAAc,CAAC,kBAAkB,EAAE,aAAa,CAAC;SACjD,cAAc,CAAC,oBAAoB,EAAE,2BAA2B,CAAC;SACjE,cAAc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"","sources":["../../../src/commands/calendar/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAkB5C"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/commands/calendar/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAkB5C"}
@@ -1,4 +1,5 @@
1
1
  import { getClient } from '../../utils/client.js';
2
+ import { optimizeEvent } from '../../utils/optimize.js';
2
3
  import { output } from '../../utils/output.js';
3
4
  export function events(parent) {
4
5
  parent
@@ -16,7 +17,7 @@ export function events(parent) {
16
17
  subject: opts.subject,
17
18
  limit: parseInt(opts.limit, 10),
18
19
  });
19
- output(result);
20
+ output(result.map(optimizeEvent));
20
21
  });
21
22
  }
22
23
  //# sourceMappingURL=events.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/commands/calendar/events.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,iDAAiD,CAAC;SAC9D,MAAM,CAAC,mBAAmB,EAAE,wCAAwC,CAAC;SACrE,MAAM,CAAC,iBAAiB,EAAE,sCAAsC,CAAC;SACjE,MAAM,CAAC,kBAAkB,EAAE,wBAAwB,CAAC;SACpD,MAAM,CAAC,aAAa,EAAE,oBAAoB,EAAE,IAAI,CAAC;SACjD,MAAM,CAAC,KAAK,EAAE,IAAqE,EAAE,EAAE;QACtF,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,C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MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"find-times.d.ts","sourceRoot":"","sources":["../../../src/commands/calendar/find-times.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAkB/C"}
1
+ {"version":3,"file":"find-times.d.ts","sourceRoot":"","sources":["../../../src/commands/calendar/find-times.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAiD/C"}
@@ -3,18 +3,32 @@ import { output } from '../../utils/output.js';
3
3
  export function findTimes(parent) {
4
4
  parent
5
5
  .command('find-times')
6
- .description('Find available meeting times')
6
+ .description('Find available meeting times (optionally with room suggestions)')
7
7
  .requiredOption('--attendees <json>', 'Attendees JSON: [{"email":"a@b.com","type":"required"}]')
8
8
  .requiredOption('--start <datetime>', 'Start of search window (ISO 8601 UTC)')
9
9
  .requiredOption('--end <datetime>', 'End of search window (ISO 8601 UTC)')
10
10
  .requiredOption('--duration <iso8601>', 'Meeting duration (e.g., PT30M, PT1H)')
11
+ .option('--suggest-room', 'Ask Graph API to suggest available rooms')
12
+ .option('--room <name>', 'Prefer a specific room by name (checks its availability)')
11
13
  .action(async (opts) => {
12
14
  const client = await getClient();
15
+ let locationConstraint;
16
+ if (opts.suggestRoom) {
17
+ locationConstraint = { isRequired: false, suggestLocation: true };
18
+ }
19
+ else if (opts.room) {
20
+ locationConstraint = {
21
+ isRequired: true,
22
+ suggestLocation: false,
23
+ locations: [{ displayName: opts.room, resolveAvailability: true }],
24
+ };
25
+ }
13
26
  const result = await client.calendar.findMeetingTimes({
14
27
  attendees: JSON.parse(opts.attendees),
15
28
  startDateTime: opts.start,
16
29
  endDateTime: opts.end,
17
30
  meetingDuration: opts.duration,
31
+ locationConstraint,
18
32
  });
19
33
  output(result);
20
34
  });
@@ -1 +1 @@
1
- {"version":3,"file":"find-times.js","sourceRoot":"","sources":["../../../src/commands/calendar/find-times.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,SAAS,CAAC,MAAe;IACvC,MAAM;SACH,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CAAC,8BAA8B,CAAC;SAC3C,cAAc,CAAC,oBAAoB,EAAE,yDAAyD,CAAC;SAC/F,cAAc,CAAC,oBAAoB,EAAE,uCAAuC,CAAC;SAC7E,cAAc,CAAC,kBAAkB,EAAE,qCAAqC,CAAC;SACzE,cAAc,CAAC,sBAAsB,EAAE,sCAAsC,CAAC;SAC9E,MAAM,CAAC,KAAK,EAAE,IAAyE,EAAE,EAAE;QAC1F,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC;YACpD,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAuD;YAC3F,aAAa,EAAE,IAAI,CAAC,KAAK;YACzB,WAAW,EAAE,IAAI,CAAC,GAAG;YACrB,eAAe,EAAE,IAAI,CAAC,QAAQ;SAC/B,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC"}
1
+ {"version":3,"file":"find-times.js","sourceRoot":"","sources":["../../../src/commands/calendar/find-times.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,SAA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
1
+ import { Command } from 'commander';
2
+ export declare function getSchedule(parent: Command): void;
3
+ //# sourceMappingURL=get-schedule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-schedule.d.ts","sourceRoot":"","sources":["../../../src/commands/calendar/get-schedule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAyBjD"}
@@ -0,0 +1,27 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function getSchedule(parent) {
4
+ parent
5
+ .command('get-schedule')
6
+ .description('Check free/busy availability for people or rooms')
7
+ .requiredOption('--schedules <emails...>', 'Email addresses of people or rooms to check')
8
+ .requiredOption('--start <datetime>', 'Start of time range (ISO 8601 UTC)')
9
+ .requiredOption('--end <datetime>', 'End of time range (ISO 8601 UTC)')
10
+ .option('--interval <minutes>', 'Availability view interval in minutes', '60')
11
+ .action(async (opts) => {
12
+ const client = await getClient();
13
+ const result = await client.calendar.getSchedule({
14
+ schedules: opts.schedules,
15
+ startDateTime: opts.start,
16
+ endDateTime: opts.end,
17
+ intervalMinutes: parseInt(opts.interval, 10),
18
+ });
19
+ output(result.map((s) => ({
20
+ scheduleId: s.scheduleId,
21
+ availabilityView: s.availabilityView,
22
+ legend: '0=free, 1=tentative, 2=busy, 3=oof, 4=working-elsewhere',
23
+ items: s.scheduleItems,
24
+ })));
25
+ });
26
+ }
27
+ //# sourceMappingURL=get-schedule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-schedule.js","sourceRoot":"","sources":["../../../src/commands/calendar/get-schedule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,WAAW,CAAC,MAAe;IACzC,MAAM;SACH,OAAO,CAAC,cAAc,CAAC;SACvB,WAAW,CAAC,kDAAkD,CAAC;SAC/D,cAAc,CAAC,yBAAyB,EAAE,6CAA6C,CAAC;SACxF,cAAc,CAAC,oBAAoB,EAAE,oCAAoC,CAAC;SAC1E,cAAc,CAAC,kBAAkB,EAAE,kCAAkC,CAAC;SACtE,MAAM,CAAC,sBAAsB,EAAE,uCAAuC,EAAE,IAAI,CAAC;SAC7E,MAAM,CAAC,KAAK,EAAE,IAA2E,EAAE,EAAE;QAC5F,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC;YAC/C,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,aAAa,EAAE,IAAI,CAAC,KAAK;YACzB,WAAW,EAAE,IAAI,CAAC,GAAG;YACrB,eAAe,EAAE,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;SAC7C,CAAC,CAAC;QACH,MAAM,CACJ,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACjB,UAAU,EAAE,CAAC,CAAC,UAAU;YACxB,gBAAgB,EAAE,CAAC,CAAC,gBAAgB;YACpC,MAAM,EAAE,yDAAyD;YACjE,KAAK,EAAE,CAAC,CAAC,aAAa;SACvB,CAAC,CAAC,CACJ,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/calendar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAM/D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/calendar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAS/D"}
@@ -2,11 +2,17 @@ import { cancel } from './cancel.js';
2
2
  import { create } from './create.js';
3
3
  import { events } from './events.js';
4
4
  import { findTimes } from './find-times.js';
5
+ import { getSchedule } from './get-schedule.js';
6
+ import { respond } from './respond.js';
7
+ import { update } from './update.js';
5
8
  export function registerCalendarCommands(program) {
6
9
  const calendar = program.command('calendar').description('Calendar operations');
7
10
  events(calendar);
8
11
  create(calendar);
12
+ update(calendar);
9
13
  cancel(calendar);
14
+ respond(calendar);
10
15
  findTimes(calendar);
16
+ getSchedule(calendar);
11
17
  }
12
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/calendar/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,UAAU,wBAAwB,CAAC,OAAgB;IACvD,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAChF,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjB,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjB,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjB,SAAS,CAAC,QAAQ,CAAC,CAAC;AACtB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/calendar/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,UAAU,wBAAwB,CAAC,OAAgB;IACvD,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAChF,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjB,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjB,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjB,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjB,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClB,SAAS,CAAC,QAAQ,CAAC,CAAC;IACpB,WAAW,CAAC,QAAQ,CAAC,CAAC;AACxB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function respond(parent: Command): void;
3
+ //# sourceMappingURL=respond.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"respond.d.ts","sourceRoot":"","sources":["../../../src/commands/calendar/respond.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAuB7C"}
@@ -0,0 +1,25 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function respond(parent) {
4
+ parent
5
+ .command('respond <eventId> <response>')
6
+ .description('Respond to a calendar event: accept, decline, or tentative')
7
+ .option('--comment <text>', 'Comment to include with the response')
8
+ .option('--no-send', 'Do not send a response to the organizer')
9
+ .action(async (eventId, response, opts) => {
10
+ const validResponses = ['accept', 'decline', 'tentative'];
11
+ const mapped = response === 'tentative' ? 'tentativelyAccept' : response;
12
+ if (!validResponses.includes(response)) {
13
+ throw new Error(`Invalid response: "${response}". Must be one of: accept, decline, tentative`);
14
+ }
15
+ const client = await getClient();
16
+ await client.calendar.respondToEvent({
17
+ eventId,
18
+ response: mapped,
19
+ comment: opts.comment,
20
+ sendResponse: opts.send,
21
+ });
22
+ output({ status: 'ok', eventId, response });
23
+ });
24
+ }
25
+ //# sourceMappingURL=respond.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"respond.js","sourceRoot":"","sources":["../../../src/commands/calendar/respond.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,OAAO,CAAC,MAAe;IACrC,MAAM;SACH,OAAO,CAAC,8BAA8B,CAAC;SACvC,WAAW,CAAC,4DAA4D,CAAC;SACzE,MAAM,CAAC,kBAAkB,EAAE,sCAAsC,CAAC;SAClE,MAAM,CAAC,WAAW,EAAE,yCAAyC,CAAC;SAC9D,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,QAAgB,EAAE,IAAyC,EAAE,EAAE;QAC7F,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAU,CAAC;QACnE,MAAM,MAAM,GAAG,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,QAAQ,CAAC;QAEzE,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,QAA2C,CAAC,EAAE,CAAC;YAC1E,MAAM,IAAI,KAAK,CAAC,sBAAsB,QAAQ,+CAA+C,CAAC,CAAC;QACjG,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC;YACnC,OAAO;YACP,QAAQ,EAAE,MAAoD;YAC9D,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,YAAY,EAAE,IAAI,CAAC,IAAI;SACxB,CAAC,CAAC;QACH,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function update(parent: Command): void;
3
+ //# sourceMappingURL=update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/calendar/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAuD5C"}
@@ -0,0 +1,44 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { optimizeEvent } from '../../utils/optimize.js';
3
+ import { output } from '../../utils/output.js';
4
+ export function update(parent) {
5
+ parent
6
+ .command('update <eventId>')
7
+ .description('Update a calendar event (subject, time, attendees, location, body)')
8
+ .option('--subject <text>', 'New subject')
9
+ .option('--start <datetime>', 'New start time (ISO datetime UTC)')
10
+ .option('--end <datetime>', 'New end time (ISO datetime UTC)')
11
+ .option('--body <text>', 'New body/agenda text')
12
+ .option('--attendees <emails...>', 'Set attendees (replaces existing)')
13
+ .option('--rooms <emails...>', 'Room email addresses to book as resource attendees')
14
+ .option('--location <text>', 'New location')
15
+ .option('--online', 'Make it an online meeting')
16
+ .action(async (eventId, opts) => {
17
+ const client = await getClient();
18
+ // Merge attendees and rooms into a single list
19
+ let attendees;
20
+ if (opts.attendees || opts.rooms) {
21
+ attendees = [];
22
+ if (opts.attendees) {
23
+ attendees.push(...opts.attendees);
24
+ }
25
+ if (opts.rooms) {
26
+ for (const roomEmail of opts.rooms) {
27
+ attendees.push({ email: roomEmail, type: 'resource' });
28
+ }
29
+ }
30
+ }
31
+ const updated = await client.calendar.updateEvent({
32
+ eventId,
33
+ subject: opts.subject,
34
+ startDateTime: opts.start,
35
+ endDateTime: opts.end,
36
+ body: opts.body,
37
+ attendees,
38
+ location: opts.location,
39
+ isOnlineMeeting: opts.online,
40
+ });
41
+ output(optimizeEvent(updated));
42
+ });
43
+ }
44
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/calendar/update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,kBAAkB,CAAC;SAC3B,WAAW,CAAC,oEAAoE,CAAC;SACjF,MAAM,CAAC,kBAAkB,EAAE,aAAa,CAAC;SACzC,MAAM,CAAC,oBAAoB,EAAE,mCAAmC,CAAC;SACjE,MAAM,CAAC,kBAAkB,EAAE,iCAAiC,CAAC;SAC7D,MAAM,CAAC,eAAe,EAAE,sBAAsB,CAAC;SAC/C,MAAM,CAAC,yBAAyB,EAAE,mCAAmC,CAAC;SACtE,MAAM,CAAC,qBAAqB,EAAE,oDAAoD,CAAC;SACnF,MAAM,CAAC,mBAAmB,EAAE,cAAc,CAAC;SAC3C,MAAM,CAAC,UAAU,EAAE,2BAA2B,CAAC;SAC/C,MAAM,CACL,KAAK,EACH,OAAe,EACf,IASC,EACD,EAAE;QACF,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QAEjC,+CAA+C;QAC/C,IAAI,SAAoF,CAAC;QACzF,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACjC,SAAS,GAAG,EAAE,CAAC;YACf,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;gBACnB,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;YACpC,CAAC;YACD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;gBACf,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;oBACnC,SAAS,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;gBACzD,CAAC;YACH,CAAC;QACH,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC;YAChD,OAAO;YACP,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,aAAa,EAAE,IAAI,CAAC,KAAK;YACzB,WAAW,EAAE,IAAI,CAAC,GAAG;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,SAAS;YACT,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,eAAe,EAAE,IAAI,CAAC,MAAM;SAC7B,CAAC,CAAC;QACH,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;IACjC,CAAC,CACF,CAAC;AACN,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function addMember(parent: Command): void;
3
+ //# sourceMappingURL=add-member.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-member.d.ts","sourceRoot":"","sources":["../../../src/commands/chat/add-member.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAc/C"}
@@ -0,0 +1,18 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function addMember(parent) {
4
+ parent
5
+ .command('add-member <chatId> <userId>')
6
+ .description('Add a member to a chat (user ID or email)')
7
+ .option('--role <role>', 'Member role: owner, guest', 'owner')
8
+ .action(async (chatId, userId, opts) => {
9
+ const client = await getClient();
10
+ await client.chats.addMember({
11
+ chatId,
12
+ userId,
13
+ role: opts.role,
14
+ });
15
+ output({ status: 'ok', chatId, userId, role: opts.role });
16
+ });
17
+ }
18
+ //# sourceMappingURL=add-member.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-member.js","sourceRoot":"","sources":["../../../src/commands/chat/add-member.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,SAAS,CAAC,MAAe;IACvC,MAAM;SACH,OAAO,CAAC,8BAA8B,CAAC;SACvC,WAAW,CAAC,2CAA2C,CAAC;SACxD,MAAM,CAAC,eAAe,EAAE,2BAA2B,EAAE,OAAO,CAAC;SAC7D,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,MAAc,EAAE,IAAsB,EAAE,EAAE;QACvE,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC;YAC3B,MAAM;YACN,MAAM;YACN,IAAI,EAAE,IAAI,CAAC,IAAyB;SACrC,CAAC,CAAC;QACH,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/commands/chat/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAiBzC"}
1
+ {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/commands/chat/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAsBzC"}
@@ -11,10 +11,15 @@ export function get(parent) {
11
11
  id: chat.id,
12
12
  topic: chat.topic,
13
13
  chatType: chat.chatType,
14
- members: chat.members?.map((m) => ({
15
- displayName: m.displayName,
16
- id: m.id,
17
- })),
14
+ members: chat.members?.map((m) => {
15
+ const member = m;
16
+ return {
17
+ displayName: m.displayName,
18
+ userId: member.userId,
19
+ email: member.email,
20
+ id: m.id,
21
+ };
22
+ }),
18
23
  });
19
24
  });
20
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/chat/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,GAAG,CAAC,MAAe;IACjC,MAAM;SACH,OAAO,CAAC,cAAc,CAAC;SACvB,WAAW,CAAC,wBAAwB,CAAC;SACrC,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,EAAE;QAC/B,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QAChD,MAAM,CAAC;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBACjC,WAAW,EAAE,CAAC,CAAC,WAAW;gBAC1B,EAAE,EAAE,CAAC,CAAC,EAAE;aACT,CAAC,CAAC;SACJ,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/chat/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,GAAG,CAAC,MAAe;IACjC,MAAM;SACH,OAAO,CAAC,cAAc,CAAC;SACvB,WAAW,CAAC,wBAAwB,CAAC;SACrC,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,EAAE;QAC/B,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QAChD,MAAM,CAAC;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBAC/B,MAAM,MAAM,GAAG,CAA4B,CAAC;gBAC5C,OAAO;oBACL,WAAW,EAAE,CAAC,CAAC,WAAW;oBAC1B,MAAM,EAAE,MAAM,CAAC,MAAM;oBACrB,KAAK,EAAE,MAAM,CAAC,KAAK;oBACnB,EAAE,EAAE,CAAC,CAAC,EAAE;iBACT,CAAC;YACJ,CAAC,CAAC;SACH,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/chat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAK3D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/chat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAQ3D"}
@@ -1,10 +1,16 @@
1
+ import { addMember } from './add-member.js';
1
2
  import { create } from './create.js';
2
3
  import { get } from './get.js';
4
+ import { removeMember } from './remove-member.js';
3
5
  import { search } from './search.js';
6
+ import { update } from './update.js';
4
7
  export function registerChatCommands(program) {
5
8
  const chat = program.command('chat').description('Chat operations');
6
9
  get(chat);
7
10
  search(chat);
8
11
  create(chat);
12
+ update(chat);
13
+ addMember(chat);
14
+ removeMember(chat);
9
15
  }
10
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/chat/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IACpE,GAAG,CAAC,IAAI,CAAC,CAAC;IACV,MAAM,CAAC,IAAI,CAAC,CAAC;IACb,MAAM,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/chat/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IACpE,GAAG,CAAC,IAAI,CAAC,CAAC;IACV,MAAM,CAAC,IAAI,CAAC,CAAC;IACb,MAAM,CAAC,IAAI,CAAC,CAAC;IACb,MAAM,CAAC,IAAI,CAAC,CAAC;IACb,SAAS,CAAC,IAAI,CAAC,CAAC;IAChB,YAAY,CAAC,IAAI,CAAC,CAAC;AACrB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function removeMember(parent: Command): void;
3
+ //# sourceMappingURL=remove-member.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-member.d.ts","sourceRoot":"","sources":["../../../src/commands/chat/remove-member.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CASlD"}
@@ -0,0 +1,13 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function removeMember(parent) {
4
+ parent
5
+ .command('remove-member <chatId> <membershipId>')
6
+ .description('Remove a member from a chat (use membership ID from chat get)')
7
+ .action(async (chatId, membershipId) => {
8
+ const client = await getClient();
9
+ await client.chats.removeMember({ chatId, membershipId });
10
+ output({ status: 'ok', chatId, membershipId, action: 'removed' });
11
+ });
12
+ }
13
+ //# sourceMappingURL=remove-member.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-member.js","sourceRoot":"","sources":["../../../src/commands/chat/remove-member.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,YAAY,CAAC,MAAe;IAC1C,MAAM;SACH,OAAO,CAAC,uCAAuC,CAAC;SAChD,WAAW,CAAC,+DAA+D,CAAC;SAC5E,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,YAAoB,EAAE,EAAE;QACrD,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;QAC1D,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function update(parent: Command): void;
3
+ //# sourceMappingURL=update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/chat/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAS5C"}
@@ -0,0 +1,13 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function update(parent) {
4
+ parent
5
+ .command('update <chatId> <topic>')
6
+ .description('Update chat topic (group chats only)')
7
+ .action(async (chatId, topic) => {
8
+ const client = await getClient();
9
+ await client.chats.updateTopic({ chatId, topic });
10
+ output({ status: 'ok', chatId, topic });
11
+ });
12
+ }
13
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/chat/update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,MAAM;SACH,OAAO,CAAC,yBAAyB,CAAC;SAClC,WAAW,CAAC,sCAAsC,CAAC;SACnD,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,KAAa,EAAE,EAAE;QAC9C,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QAClD,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function forward(parent: Command): void;
3
+ //# sourceMappingURL=forward.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forward.d.ts","sourceRoot":"","sources":["../../../src/commands/mail/forward.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAW7C"}
@@ -0,0 +1,15 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function forward(parent) {
4
+ parent
5
+ .command('forward <messageId>')
6
+ .description('Forward an email to recipients')
7
+ .requiredOption('--to <emails...>', 'Recipients to forward to')
8
+ .option('--comment <text>', 'Introductory comment')
9
+ .action(async (messageId, opts) => {
10
+ const client = await getClient();
11
+ await client.mail.forward({ messageId, to: opts.to, comment: opts.comment });
12
+ output({ status: 'ok', messageId, action: 'forwarded', to: opts.to });
13
+ });
14
+ }
15
+ //# sourceMappingURL=forward.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forward.js","sourceRoot":"","sources":["../../../src/commands/mail/forward.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,OAAO,CAAC,MAAe;IACrC,MAAM;SACH,OAAO,CAAC,qBAAqB,CAAC;SAC9B,WAAW,CAAC,gCAAgC,CAAC;SAC7C,cAAc,CAAC,kBAAkB,EAAE,0BAA0B,CAAC;SAC9D,MAAM,CAAC,kBAAkB,EAAE,sBAAsB,CAAC;SAClD,MAAM,CAAC,KAAK,EAAE,SAAiB,EAAE,IAAwC,EAAE,EAAE;QAC5E,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC7E,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function get(parent: Command): void;
3
+ //# sourceMappingURL=get.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/commands/mail/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAyBzC"}
@@ -0,0 +1,29 @@
1
+ import { getClient } from '../../utils/client.js';
2
+ import { output } from '../../utils/output.js';
3
+ export function get(parent) {
4
+ parent
5
+ .command('get <messageId>')
6
+ .description('Get a single email by ID')
7
+ .option('--body-format <format>', 'Body format: text, html', 'html')
8
+ .action(async (messageId, opts) => {
9
+ const client = await getClient();
10
+ const msg = await client.mail.get({
11
+ messageId,
12
+ includeBody: true,
13
+ bodyFormat: opts.bodyFormat,
14
+ });
15
+ output({
16
+ id: msg.id,
17
+ subject: msg.subject,
18
+ from: { name: msg.from?.emailAddress?.name, address: msg.from?.emailAddress?.address },
19
+ toRecipients: msg.toRecipients?.map((r) => r.emailAddress?.address),
20
+ ccRecipients: msg.ccRecipients?.length ? msg.ccRecipients.map((r) => r.emailAddress?.address) : undefined,
21
+ receivedDateTime: msg.receivedDateTime,
22
+ body: msg.body,
23
+ isRead: msg.isRead,
24
+ hasAttachments: msg.hasAttachments,
25
+ importance: msg.importance,
26
+ });
27
+ });
28
+ }
29
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/mail/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,UAAU,GAAG,CAAC,MAAe;IACjC,MAAM;SACH,OAAO,CAAC,iBAAiB,CAAC;SAC1B,WAAW,CAAC,0BAA0B,CAAC;SACvC,MAAM,CAAC,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,CAAC;SACnE,MAAM,CAAC,KAAK,EAAE,SAAiB,EAAE,IAA4B,EAAE,EAAE;QAChE,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;YAChC,SAAS;YACT,WAAW,EAAE,IAAI;YACjB,UAAU,EAAE,IAAI,CAAC,UAA6B;SAC/C,CAAC,CAAC;QACH,MAAM,CAAC;YACL,EAAE,EAAE,GAAG,CAAC,EAAE;YACV,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE;YACtF,YAAY,EAAE,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,EAAE,OAAO,CAAC;YACnE,YAAY,EAAE,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;YACzG,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;YACtC,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,cAAc,EAAE,GAAG,CAAC,cAAc;YAClC,UAAU,EAAE,GAAG,CAAC,UAAU;SAC3B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/mail/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAM3D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/mail/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAU3D"}
@@ -1,12 +1,20 @@
1
1
  import { del } from './delete.js';
2
+ import { forward } from './forward.js';
3
+ import { get } from './get.js';
2
4
  import { list } from './list.js';
5
+ import { markRead } from './mark-read.js';
6
+ import { reply } from './reply.js';
3
7
  import { search } from './search.js';
4
8
  import { send } from './send.js';
5
9
  export function registerMailCommands(program) {
6
10
  const mail = program.command('mail').description('Mail operations');
7
11
  list(mail);
12
+ get(mail);
8
13
  search(mail);
9
14
  send(mail);
15
+ reply(mail);
16
+ forward(mail);
17
+ markRead(mail);
10
18
  del(mail);
11
19
  }
12
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/mail/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IACpE,IAAI,CAAC,IAAI,CAAC,CAAC;IACX,MAAM,CAAC,IAAI,CAAC,CAAC;IACb,IAAI,CAAC,IAAI,CAAC,CAAC;IACX,GAAG,CAAC,IAAI,CAAC,CAAC;AACZ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/mail/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IACpE,IAAI,CAAC,IAAI,CAAC,CAAC;IACX,GAAG,CAAC,IAAI,CAAC,CAAC;IACV,MAAM,CAAC,IAAI,CAAC,CAAC;IACb,IAAI,CAAC,IAAI,CAAC,CAAC;IACX,KAAK,CAAC,IAAI,CAAC,CAAC;IACZ,OAAO,CAAC,IAAI,CAAC,CAAC;IACd,QAAQ,CAAC,IAAI,CAAC,CAAC;IACf,GAAG,CAAC,IAAI,CAAC,CAAC;AACZ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/mail/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAwC1C"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/mail/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAuD1C"}
@@ -26,7 +26,22 @@ export function list(parent) {
26
26
  includeBody: opts.includeBody,
27
27
  bodyFormat: opts.bodyFormat,
28
28
  });
29
- output(result);
29
+ const messages = (result?.value || []).map((m) => {
30
+ const msg = {
31
+ id: m.id,
32
+ subject: m.subject,
33
+ from: { name: m.from?.emailAddress?.name, address: m.from?.emailAddress?.address },
34
+ receivedDateTime: m.receivedDateTime,
35
+ bodyPreview: m.bodyPreview,
36
+ isRead: m.isRead,
37
+ hasAttachments: m.hasAttachments,
38
+ };
39
+ if (opts.includeBody && m.body) {
40
+ msg.body = m.body;
41
+ }
42
+ return msg;
43
+ });
44
+ output(messages);
30
45
  });
31
46
  }
32
47
  //# sourceMappingURL=list.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/mail/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