@teamclaw/feishu-agent 1.0.8 → 1.0.9

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 (2) hide show
  1. package/dist/cli.js +15 -18
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -3179,17 +3179,14 @@ class CalendarManager {
3179
3179
  start_time: event.startTime,
3180
3180
  end_time: event.endTime
3181
3181
  };
3182
- const res = await this.client.post(`/open-apis/calendar/v4/calendars/${calendarId}/events`, body, { user_id_type: "union_id" }, true);
3183
- const createdEvent = res.event;
3184
- if (event.attendeeUserIds && event.attendeeUserIds.length > 0) {
3185
- await this.client.post(`/open-apis/calendar/v4/calendars/${calendarId}/events/${createdEvent.event_id}/attendees`, {
3186
- attendees: event.attendeeUserIds.map((id) => ({
3187
- type: "user",
3188
- user_id: id
3189
- }))
3190
- }, {});
3182
+ if (event.attendeeOpenIds && event.attendeeOpenIds.length > 0) {
3183
+ body.attendees = event.attendeeOpenIds.map((id) => ({
3184
+ type: "user",
3185
+ user_id: id
3186
+ }));
3191
3187
  }
3192
- return createdEvent;
3188
+ const res = await this.client.post(`/open-apis/calendar/v4/calendars/${calendarId}/events`, body, { user_id_type: "union_id" }, true);
3189
+ return res.event;
3193
3190
  }
3194
3191
  async deleteEvent(calendarId, eventId) {
3195
3192
  await this.client.request(`/open-apis/calendar/v4/calendars/${calendarId}/events/${eventId}`, { method: "DELETE" }, true);
@@ -3474,7 +3471,7 @@ async function handleCreateEvent(config, options) {
3474
3471
  console.error("Error: --summary, --start, and --end are required.");
3475
3472
  process.exit(1);
3476
3473
  }
3477
- let attendeeUnionIds = [];
3474
+ let attendeeOpenIds = [];
3478
3475
  if (attendeeName && attendeeName.length > 0) {
3479
3476
  console.log(`
3480
3477
  \uD83D\uDD0D Resolving attendee names...`);
@@ -3491,12 +3488,12 @@ async function handleCreateEvent(config, options) {
3491
3488
  });
3492
3489
  console.log(" Using the first match.");
3493
3490
  }
3494
- attendeeUnionIds.push(results[0].union_id);
3495
- console.log(` \u2713 "${name}" -> ${results[0].name} (${results[0].union_id})`);
3491
+ attendeeOpenIds.push(results[0].open_id || results[0].union_id);
3492
+ console.log(` \u2713 "${name}" -> ${results[0].name} (${results[0].open_id || results[0].union_id})`);
3496
3493
  }
3497
3494
  }
3498
3495
  if (attendee && attendee.length > 0) {
3499
- attendeeUnionIds = [...attendeeUnionIds, ...attendee];
3496
+ attendeeOpenIds = [...attendeeOpenIds, ...attendee];
3500
3497
  }
3501
3498
  let targetCalendarId = calendarId;
3502
3499
  if (!targetCalendarId) {
@@ -3515,15 +3512,15 @@ async function handleCreateEvent(config, options) {
3515
3512
  summary,
3516
3513
  startTime: { timestamp: startTimestamp },
3517
3514
  endTime: { timestamp: endTimestamp },
3518
- attendeeUserIds: attendeeUnionIds.length > 0 ? attendeeUnionIds : undefined
3515
+ attendeeOpenIds: attendeeOpenIds.length > 0 ? attendeeOpenIds : undefined
3519
3516
  });
3520
3517
  console.log(`
3521
3518
  \u2705 Event created!`);
3522
3519
  console.log(` Title: ${summary}`);
3523
3520
  console.log(` Time: ${new Date(parseInt(startTimestamp) * 1000).toLocaleString()} - ${new Date(parseInt(endTimestamp) * 1000).toLocaleString()}`);
3524
3521
  console.log(` Calendar ID: ${targetCalendarId}`);
3525
- if (attendeeUnionIds.length > 0) {
3526
- console.log(` Attendees: ${attendeeUnionIds.join(", ")}`);
3522
+ if (attendeeOpenIds.length > 0) {
3523
+ console.log(` Attendees: ${attendeeOpenIds.join(", ")}`);
3527
3524
  }
3528
3525
  }
3529
3526
  async function handleDeleteEvent(config, options) {
@@ -3768,7 +3765,7 @@ async function handleSearch(config, query) {
3768
3765
  // package.json
3769
3766
  var package_default = {
3770
3767
  name: "@teamclaw/feishu-agent",
3771
- version: "1.0.8",
3768
+ version: "1.0.9",
3772
3769
  description: "Feishu Agent CLI for AI assistants",
3773
3770
  type: "module",
3774
3771
  private: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamclaw/feishu-agent",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Feishu Agent CLI for AI assistants",
5
5
  "type": "module",
6
6
  "private": false,