larkmate 0.1.11 → 0.1.12
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 +6 -0
- package/bin/larkmate.js +46 -2
- package/bin/os-delegate-helper.js +2 -1
- package/docs/agent-broker.md +1 -1
- package/package.json +3 -2
- package/proto/calendar-schema.json +1 -0
- package/skills/larkmate/SKILL.md +3 -2
- package/skills/larkmate/references/calendar.md +30 -0
- package/src/agent-broker.js +7 -1
- package/src/calendar.js +125 -0
- package/src/gateway.js +11 -2
package/README.md
CHANGED
|
@@ -62,6 +62,12 @@ npx --registry=https://registry.npmjs.org/ skills add NWYLZW/larkmate --skill la
|
|
|
62
62
|
- [x] 查询任务中心与任务视图,按关键词搜索任务
|
|
63
63
|
- [x] 新建、编辑、完成、重开和删除任务
|
|
64
64
|
- [x] 配置任务时间、负责人、关注人、重复规则及其他字段
|
|
65
|
+
- 日历
|
|
66
|
+
- [x] 查询、搜索、创建和管理日历,订阅或取消订阅
|
|
67
|
+
- [x] 按时间范围查询日程和重复日程,查看日程详情
|
|
68
|
+
- [x] 创建、修改和删除日程,管理参与人、会议室及提醒
|
|
69
|
+
- [x] 分享日程,接受、拒绝或暂定日程邀请
|
|
70
|
+
- [ ] 导入谷歌日历
|
|
65
71
|
- 录制妙记
|
|
66
72
|
- [x] 查询当前用户可访问的录制妙记
|
|
67
73
|
- [x] 导出文字记录,支持说话人和时间戳
|
package/bin/larkmate.js
CHANGED
|
@@ -13,9 +13,11 @@ import { callOsDelegate, osDelegateProxy } from '../src/os-delegate-client.js';
|
|
|
13
13
|
import { SidebarFilters } from '../src/sidebar-filters.js';
|
|
14
14
|
import { FeedGroups } from '../src/feed-groups.js';
|
|
15
15
|
import { Tasks } from '../src/tasks.js';
|
|
16
|
+
import { Calendar } from '../src/calendar.js';
|
|
16
17
|
|
|
18
|
+
const defaultTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC';
|
|
17
19
|
const program = new Command();
|
|
18
|
-
program.name('larkmate').description('Operate Feishu as the logged-in user.').version('0.1.
|
|
20
|
+
program.name('larkmate').description('Operate Feishu as the logged-in user.').version('0.1.12');
|
|
19
21
|
program.option('--credentials-file <path>', 'read LarkMate credentials.json');
|
|
20
22
|
program.option('--broker <path>', 'use a restricted local broker socket (or LARKMATE_BROKER)');
|
|
21
23
|
program.option('--broker-token-file <path>', 'read the agent token (or LARKMATE_BROKER_TOKEN_FILE)');
|
|
@@ -71,6 +73,7 @@ async function sidebar() {
|
|
|
71
73
|
return new SidebarFilters(new Gateway({ cookie: await loadCookie({ file: program.opts().credentialsFile }) }));
|
|
72
74
|
}
|
|
73
75
|
|
|
76
|
+
async function calendar() { const remote = proxy('calendar'); return remote || new Calendar(new Gateway({ cookie: await loadCookie({ file: program.opts().credentialsFile }) })); }
|
|
74
77
|
async function feeds() { const remote = proxy('feeds'); return remote || new FeedGroups(new Gateway({ cookie: await loadCookie({ file: program.opts().credentialsFile }) })); }
|
|
75
78
|
async function tasks() { const remote = proxy('tasks'); return remote || new Tasks(new Gateway({ cookie: await loadCookie({ file: program.opts().credentialsFile }) })); }
|
|
76
79
|
async function readJson(path, fallback) {
|
|
@@ -108,7 +111,7 @@ program.command('broker-serve').description('Start a restricted local agent brok
|
|
|
108
111
|
let promise;
|
|
109
112
|
const getServices = () => promise ||= (async () => {
|
|
110
113
|
const gateway = new Gateway({ cookie: await loadCookie({ file: program.opts().credentialsFile }) });
|
|
111
|
-
return { client: new LarkMateClient(gateway), controls: new SessionControls(gateway), minutes: new Minutes(gateway), sidebar: new SidebarFilters(gateway), feeds: new FeedGroups(gateway), tasks: new Tasks(gateway) };
|
|
114
|
+
return { client: new LarkMateClient(gateway), controls: new SessionControls(gateway), minutes: new Minutes(gateway), sidebar: new SidebarFilters(gateway), feeds: new FeedGroups(gateway), tasks: new Tasks(gateway), calendar: new Calendar(gateway) };
|
|
112
115
|
})().catch(error => { promise = undefined; throw error; });
|
|
113
116
|
const broker = await startBroker({ socketPath: o.socket, policy, token, getServices });
|
|
114
117
|
output({ status: 'listening', socket: broker.socketPath });
|
|
@@ -160,6 +163,47 @@ program.command('group-query').description('Find feed items by sidebar group acr
|
|
|
160
163
|
.option('--cursor <cursor>', 'continue from the previous result').option('--parent <id>', 'search inside a box')
|
|
161
164
|
.action(async o => output(await (await feeds()).query({ group: o.group, query: o.query, limit: Number(o.limit), pages: Number(o.pages), cursor: o.cursor, parent: o.parent })));
|
|
162
165
|
|
|
166
|
+
program.command('calendars').description('List managed and subscribed calendars.')
|
|
167
|
+
.option('--pages <number>', 'maximum pages', '20').action(async o => output(await (await calendar()).calendars({maxPages:Number(o.pages)})));
|
|
168
|
+
program.command('calendar-search').description('Search people, shared calendars and meeting rooms.').requiredOption('--query <text>').option('--offset <number>','search offset','0').option('--limit <number>','result count','20')
|
|
169
|
+
.action(async o => output(await (await calendar()).searchCalendars({query:o.query,offset:Number(o.offset),count:Number(o.limit)})));
|
|
170
|
+
program.command('calendar-events').description('Query calendar events overlapping a time range.')
|
|
171
|
+
.requiredOption('--start <time>','ISO date-time with timezone or Unix seconds').requiredOption('--end <time>','exclusive end')
|
|
172
|
+
.option('--calendar <id>','repeatable calendar ID',collect,[]).option('--all-calendars','include all listed calendars').option('--pages <number>','maximum pages per calendar','20')
|
|
173
|
+
.action(async o => output(await (await calendar()).events({start:o.start,end:o.end,calendarIds:o.calendar,allCalendars:!!o.allCalendars,maxPages:Number(o.pages)})));
|
|
174
|
+
program.command('calendar-rooms').description('Search available meeting rooms.')
|
|
175
|
+
.requiredOption('--start <time>').requiredOption('--end <time>').option('--query <text>','room name','').option('--limit <number>','page size','50').option('--cursor <number>','next page','0').option('--timezone <zone>','IANA timezone',defaultTimezone).option('--repeat <rrule>')
|
|
176
|
+
.action(async o => output(await (await calendar()).rooms({start:o.start,end:o.end,query:o.query,count:Number(o.limit),cursor:Number(o.cursor),timezone:o.timezone,rrule:o.repeat})));
|
|
177
|
+
program.command('event-get').description('Read event details and attendees.').requiredOption('--id <id>').action(async o => output(await (await calendar()).event({eventId:o.id})));
|
|
178
|
+
program.command('event-create').description('Create a calendar event; participants may be notified.')
|
|
179
|
+
.option('--title <text>').option('--start <time>').option('--end <time>').option('--calendar <id>').option('--timezone <zone>','IANA timezone',defaultTimezone)
|
|
180
|
+
.option('--description <text>').option('--location <text>').option('--all-day').option('--repeat <rrule>')
|
|
181
|
+
.option('--user <id>','repeatable attendee user ID',collect,[]).option('--group <id>','repeatable group ID',collect,[]).option('--room <id>','repeatable room calendar ID',collect,[])
|
|
182
|
+
.option('--reminder <minutes>','repeatable reminder before start',collect,[]).option('--no-notify','suppress event notifications').option('--json <path>','WebCalendarEvent JSON or - for stdin')
|
|
183
|
+
.action(async o => {let input=await readJson(o.json,{});if(o.location)input.locations=[{name:o.location}];if(o.reminder.length)input.reminders=o.reminder.map(x=>{let minutes=Number(x);if(!Number.isInteger(minutes)||minutes<0)throw new FeishuError('INVALID_ARGUMENT','Invalid reminder.');return {minutes,method:3}});
|
|
184
|
+
output(await (await calendar()).createEvent({input,title:o.title,start:o.start,end:o.end,calendarId:o.calendar,timezone:o.timezone,description:o.description,allDay:o.allDay,repeat:o.repeat,users:o.user,groups:o.group,rooms:o.room,notify:o.notify}));});
|
|
185
|
+
program.command('event-update').description('Update an event; participants may be notified.').requiredOption('--id <id>')
|
|
186
|
+
.option('--title <text>').option('--start <time>').option('--end <time>').option('--description <text>').option('--repeat <rrule>').option('--location <text>')
|
|
187
|
+
.option('--add-user <id>','repeatable user ID',collect,[]).option('--remove-user <id>','repeatable user ID',collect,[])
|
|
188
|
+
.option('--add-group <id>','repeatable group ID',collect,[]).option('--remove-group <id>','repeatable group ID',collect,[])
|
|
189
|
+
.option('--add-room <id>','repeatable room calendar ID',collect,[]).option('--remove-room <id>','repeatable room calendar ID',collect,[])
|
|
190
|
+
.option('--span <number>','0 normal, 1 occurrence, 2 future or 3 entire series','0').option('--instance-start <time>','occurrence start')
|
|
191
|
+
.option('--no-notify','suppress event notifications').option('--json <path>','event field patch JSON or - for stdin')
|
|
192
|
+
.action(async o => {let patch=await readJson(o.json,{});for(const [opt,key] of [['title','summary'],['start','startTime'],['end','endTime'],['description','description'],['repeat','rrule']])if(o[opt]!=null)patch[key]=o[opt];if(o.location!=null)patch.locations=[{name:o.location}];
|
|
193
|
+
output(await (await calendar()).updateEvent({eventId:o.id,patch,span:Number(o.span),instanceStart:o.instanceStart,notify:o.notify,addUsers:o.addUser,removeUsers:o.removeUser,addGroups:o.addGroup,removeGroups:o.removeGroup,addRooms:o.addRoom,removeRooms:o.removeRoom}));});
|
|
194
|
+
program.command('event-delete').description('Delete an event; participants may be notified.').requiredOption('--id <id>').option('--span <number>','0 normal, 1 occurrence, 2 future or 3 entire series','0').option('--instance-start <time>').option('--no-notify')
|
|
195
|
+
.action(async o => output(await (await calendar()).deleteEvent({eventId:o.id,span:Number(o.span),instanceStart:o.instanceStart,notify:o.notify})));
|
|
196
|
+
program.command('event-share').description('Share an event to one or more chats.').requiredOption('--id <id>').requiredOption('--chat <id>','repeatable numeric chat ID',collect,[])
|
|
197
|
+
.action(async o => output(await (await calendar()).share({eventId:o.id,chatIds:o.chat})));
|
|
198
|
+
program.command('event-reply').description('Respond to a calendar invitation.').requiredOption('--id <id>').requiredOption('--response <status>','accept, decline or tentative').option('--comment <text>').option('--quit-meeting')
|
|
199
|
+
.action(async o => output(await (await calendar()).reply({eventId:o.id,response:o.response,comment:o.comment,quitMeeting:!!o.quitMeeting})));
|
|
200
|
+
program.command('calendar-create').description('Create a calendar.').option('--name <text>').option('--description <text>').option('--timezone <zone>','IANA timezone',defaultTimezone).option('--json <path>','WebCalendar JSON or - for stdin')
|
|
201
|
+
.action(async o => output(await (await calendar()).createCalendar({input:await readJson(o.json,{}),name:o.name,description:o.description,timezone:o.timezone})));
|
|
202
|
+
program.command('calendar-update').description('Update calendar settings and members.').requiredOption('--id <id>').option('--name <text>').option('--description <text>').option('--json <path>','calendar field patch JSON or - for stdin')
|
|
203
|
+
.action(async o => {let patch=await readJson(o.json,{});if(o.name!=null)patch.summary=o.name;if(o.description!=null)patch.description=o.description;output(await (await calendar()).updateCalendar({calendarId:o.id,patch}));});
|
|
204
|
+
program.command('calendar-delete').description('Delete a non-primary calendar.').requiredOption('--id <id>').action(async o => output(await (await calendar()).deleteCalendar({calendarId:o.id})));
|
|
205
|
+
for(const [name,subscribe] of [['calendar-subscribe',true],['calendar-unsubscribe',false]])program.command(name).description('Change a calendar subscription.').requiredOption('--id <id>').action(async o=>output(await (await calendar()).subscription({calendarId:o.id,subscribe})));
|
|
206
|
+
|
|
163
207
|
program.command('task-center').description('List task containers, views and sections.').action(async () => output(await (await tasks()).center()));
|
|
164
208
|
program.command('tasks-list').description('List tasks from a task center view.')
|
|
165
209
|
.option('--scope <name>', 'mine, followed, all, created, assigned or completed', 'mine').option('--container <id>', 'task center container ID')
|
|
@@ -11,6 +11,7 @@ import { FeishuError } from '../src/errors.js';
|
|
|
11
11
|
import { SidebarFilters } from '../src/sidebar-filters.js';
|
|
12
12
|
import { FeedGroups } from '../src/feed-groups.js';
|
|
13
13
|
import { Tasks } from '../src/tasks.js';
|
|
14
|
+
import { Calendar } from '../src/calendar.js';
|
|
14
15
|
|
|
15
16
|
try {
|
|
16
17
|
const caller = process.env.SUDO_UID, owner = process.getuid?.();
|
|
@@ -21,7 +22,7 @@ try {
|
|
|
21
22
|
let services;
|
|
22
23
|
const getServices = () => services ||= (async () => {
|
|
23
24
|
const gateway = new Gateway({ cookie: await loadCookie({ file: config.credentialsFile }) });
|
|
24
|
-
return { client: new LarkMateClient(gateway), controls: new SessionControls(gateway), minutes: new Minutes(gateway), sidebar: new SidebarFilters(gateway), feeds: new FeedGroups(gateway), tasks: new Tasks(gateway) };
|
|
25
|
+
return { client: new LarkMateClient(gateway), controls: new SessionControls(gateway), minutes: new Minutes(gateway), sidebar: new SidebarFilters(gateway), feeds: new FeedGroups(gateway), tasks: new Tasks(gateway), calendar: new Calendar(gateway) };
|
|
25
26
|
})();
|
|
26
27
|
await serveOne({ input: process.stdin, output: process.stdout, uid: caller, profile, getServices });
|
|
27
28
|
} catch (error) {
|
package/docs/agent-broker.md
CHANGED
|
@@ -51,7 +51,7 @@ LarkMate 可以由持有 Cookie 的账户启动本地代理,再让 Agent 使
|
|
|
51
51
|
|
|
52
52
|
`minutes-export`、`minutes-access-info` 和 `minutes-request-access` 按 `minuteTokens` 限制;申请权限会向妙记所有者提交请求。`minutes-list` 除须在 `allow` 中授权外,还必须同时开启 `allowGlobal` 和 `allowAllMinutes`。
|
|
53
53
|
|
|
54
|
-
`status`、用于搜索用户、机器人、群聊的 `search`、`sidebar-list
|
|
54
|
+
`status`、用于搜索用户、机器人、群聊的 `search`、`sidebar-list`、任务命令和日历命令需要开启 `allowGlobal`。日历和日程命令按命令单独授权,目前不能按日历或单个日程限定范围;创建或修改日历可能改变公开范围和共享成员,创建或修改日程可能通知参与人。任务命令分别授权,当前授权范围覆盖该用户可访问的任务,不能按单个任务限制。`group-query`、`sidebar-set` 和 `event-share` 同时需要 `allowGlobal` 与 `allowAllChats`。跨会话搜索、会话及收藏列表、标签管理,以及仅凭消息 ID 操作的链接、编辑、撤回、转发、收藏和表情命令,除须在 `allow` 中各自授权外,还必须同时开启 `allowGlobal` 和 `allowAllChats`——这是因为代理无法仅凭消息 ID 判断其是否属于受限会话。群创建、邀请成员和机器人保护设置同样需要同时开启这两个开关。开启这些权限会扩大 Agent 可访问的信息范围或可执行的操作范围,请按需选择。
|
|
55
55
|
|
|
56
56
|
`send-file`、`send-image` 与 `download-file` 均可单独加入 `allow` 列表,并受 `chatIds` 约束。发送时,由 Agent 进程读取本地文件并传输内容;下载时,由 Agent 进程创建输出文件。代理不接受 Agent 指定的代理端本地路径,而是在私有临时目录中处理中转文件,并在正常结束或失败时将其删除。若进程异常终止,可能会遗留临时文件,因此部署方应保护并按需清理代理账户的临时目录。
|
|
57
57
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "larkmate",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "A small, user-identity Feishu CLI with a modular gateway client",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"commander": "^13.1.0",
|
|
37
|
-
"protobufjs": "^8.6.0"
|
|
37
|
+
"protobufjs": "^8.6.0",
|
|
38
|
+
"rrule": "^2.8.1"
|
|
38
39
|
}
|
|
39
40
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"nested":{"calendar_web":{"nested":{"ListCalendarsRequest":{"fields":{"syncToken":{"type":"string","id":1,"options":{"default":""}},"pageSize":{"type":"int32","id":2,"options":{"default":20}},"filters":{"type":"CalendarFilter","id":3}}},"ListCalendarsResponse":{"fields":{"calendars":{"rule":"repeated","type":"calendar_entities.WebCalendar","id":1},"nextSyncToken":{"type":"string","id":2,"options":{"default":""}},"hasMore":{"type":"bool","id":3,"options":{"default":false}}}},"ListCalendarEventsRequest":{"fields":{"params":{"rule":"repeated","type":"ListCalendarEventsParam","id":1}},"nested":{"ListCalendarEventsParam":{"fields":{"calendarId":{"type":"string","id":1,"options":{"default":""}},"timeMin":{"type":"int64","id":2,"options":{"default":0}},"timeMax":{"type":"int64","id":3,"options":{"default":0}},"pageToken":{"type":"string","id":4,"options":{"default":""}},"pageSize":{"type":"int32","id":5,"options":{"default":200}},"filters":{"type":"CalendarEventFilter","id":6}}}}},"ListCalendarEventsResponse":{"fields":{"results":{"keyType":"string","type":"ListCalendarEventsResult","id":1}},"nested":{"ListCalendarEventsResult":{"fields":{"calendarEvents":{"rule":"repeated","type":"calendar_entities.WebCalendarEvent","id":1},"nextPageToken":{"type":"string","id":2,"options":{"default":""}},"finalSyncToken":{"type":"string","id":3,"options":{"default":""}}}}}},"PullCalendarEventsRequest":{"fields":{"params":{"rule":"repeated","type":"PullCalendarEventsParam","id":1}},"nested":{"PullCalendarEventsParam":{"fields":{"calendarId":{"type":"string","id":1,"options":{"default":""}},"syncToken":{"type":"string","id":2,"options":{"default":""}},"pageSize":{"type":"int32","id":3,"options":{"default":200}},"filters":{"type":"CalendarEventFilter","id":4}}}}},"PullCalendarEventsResponse":{"fields":{"results":{"keyType":"string","type":"PullCalendarEventsResult","id":1}},"nested":{"PullCalendarEventsResult":{"fields":{"calendarEvents":{"rule":"repeated","type":"calendar_entities.WebCalendarEvent","id":1},"nextSyncToken":{"type":"string","id":2,"options":{"default":""}},"hasMore":{"type":"bool","id":3,"options":{"default":false}}}}}},"BatchSubscribeCalendarsRequest":{"fields":{"calendarIds":{"rule":"repeated","type":"string","id":1},"visibilityMask":{"rule":"repeated","type":"entities.Calendar.VisibilityProperty","id":2,"options":{"packed":false}},"subscriptionMask":{"rule":"repeated","type":"entities.Calendar.SubscriptionType","id":3,"options":{"packed":false}}}},"BatchSubscribeCalendarsResponse":{"fields":{"calendars":{"keyType":"string","type":"calendar_entities.WebCalendar","id":1},"normalViewFailedCalendarIdErrCodeMap":{"keyType":"string","type":"int32","id":2}}},"BatchUnsubscribeCalendarsRequest":{"fields":{"calendarIds":{"rule":"repeated","type":"string","id":1},"subscriptionMask":{"rule":"repeated","type":"entities.Calendar.SubscriptionType","id":2,"options":{"packed":false}}}},"BatchUnsubscribeCalendarsResponse":{"fields":{"failedCalendarIds":{"rule":"repeated","type":"string","id":1},"code":{"type":"int64","id":2},"alertTitle":{"type":"string","id":3},"alertContent":{"type":"string","id":4}}},"CreateCalendarRequest":{"fields":{"calendar":{"type":"calendar_entities.WebCalendar","id":1},"visibilityMask":{"rule":"repeated","type":"entities.Calendar.VisibilityProperty","id":2,"options":{"packed":false}}}},"CreateCalendarResponse":{"fields":{}},"DeleteCalendarRequest":{"fields":{"calendarId":{"type":"string","id":1}}},"DeleteCalendarResponse":{"fields":{}},"UpdateCalendarRequest":{"fields":{"calendar":{"type":"calendar_entities.WebCalendar","id":1},"visibilityMask":{"rule":"repeated","type":"entities.Calendar.VisibilityProperty","id":2,"options":{"packed":false}}}},"UpdateCalendarResponse":{"fields":{}},"WebMGetCalendarsWithIDsRequest":{"fields":{"calendarIds":{"rule":"repeated","type":"string","id":1}}},"WebMGetCalendarsWithIDsResponse":{"fields":{"calendars":{"keyType":"string","type":"calendar_entities.WebCalendar","id":1}}},"CreateEventRequest":{"fields":{"event":{"type":"calendar_entities.WebCalendarEvent","id":1},"notificationType":{"type":"entities.CalendarEvent.NotificationType","id":2,"options":{"default":"DEFAULT_NOTIFICATION_TYPE"}}}},"CreateEventResponse":{"fields":{}},"UpdateEventRequest":{"fields":{"event":{"type":"calendar_entities.WebCalendarEvent","id":1},"span":{"type":"SaveSpan","id":2},"instanceStartTime":{"type":"int64","id":3},"notificationType":{"type":"entities.CalendarEvent.NotificationType","id":4,"options":{"default":"DEFAULT_NOTIFICATION_TYPE"}}}},"UpdateEventResponse":{"fields":{}},"DeleteEventRequest":{"fields":{"calendarId":{"type":"string","id":1},"key":{"type":"string","id":2},"originalTime":{"type":"int64","id":3},"span":{"type":"SaveSpan","id":4},"instanceStartTime":{"type":"int64","id":5},"notificationType":{"type":"entities.CalendarEvent.NotificationType","id":6,"options":{"default":"DEFAULT_NOTIFICATION_TYPE"}}}},"DeleteEventResponse":{"fields":{}},"MGetEventsWithIdsRequest":{"fields":{"ids":{"rule":"repeated","type":"string","id":1},"refidCalendarMap":{"keyType":"string","type":"string","id":2}}},"MGetEventsWithIdsResponse":{"fields":{"events":{"keyType":"string","type":"calendar_entities.WebCalendarEvent","id":1},"isEventAttendeeControlApprovalApproved":{"keyType":"string","type":"bool","id":2}}},"GetGroupAttendeesByGroupIdsRequest":{"fields":{"groupIds":{"rule":"repeated","type":"string","id":1}}},"GetGroupAttendeesByGroupIdsResponse":{"fields":{"groupAttendees":{"keyType":"string","type":"calendar_entities.WebCalendarEventAttendee","id":1}}},"GetUserAttendeesByUserIdsRequest":{"fields":{"userIds":{"rule":"repeated","type":"string","id":1}}},"GetUserAttendeesByUserIdsResponse":{"fields":{"userAttendees":{"keyType":"string","type":"calendar_entities.WebCalendarEventAttendee","id":1}}},"GetAttendeesByCalendarIdsRequest":{"fields":{"calendarIds":{"rule":"repeated","type":"string","id":1}}},"GetAttendeesByCalendarIdsResponse":{"fields":{"attendees":{"keyType":"string","type":"calendar_entities.WebCalendarEventAttendee","id":1}}},"ShareCalendarEventRequest":{"fields":{"chatIds":{"rule":"repeated","type":"int64","id":1,"options":{"packed":false}},"calendarId":{"type":"string","id":2},"key":{"type":"string","id":3},"originalTime":{"type":"int64","id":4}}},"ShareCalendarEventResponse":{"fields":{"sharedFailedChats":{"rule":"repeated","type":"int64","id":1,"options":{"packed":false}}}},"CalendarFilter":{"fields":{"maxMembersCountPerCalendar":{"type":"int32","id":1,"options":{"default":5}},"minAccessRole":{"type":"entities.Calendar.AccessRole","id":2},"needsDescription":{"type":"bool","id":3,"options":{"default":false}}}},"SaveSpan":{"values":{"NONE_SPAN":0,"THIS_EVENT":1,"FUTURE_EVENTS":2,"ALL_EVENTS":3}},"CalendarEventFilter":{"fields":{"maxAttendeesCountPerEvent":{"type":"int32","id":1,"options":{"default":0}},"needsReminders":{"type":"bool","id":2,"options":{"default":false}},"needsDescription":{"type":"bool","id":3,"options":{"default":false}},"maxResourcesCountPerEvent":{"type":"int32","id":4,"options":{"default":5}},"sortBy":{"type":"SortMethod","id":5,"options":{"default":"NO_SORT"}}},"nested":{"SortMethod":{"values":{"NO_SORT":1,"BY_START_TIME":2}}}}}},"calendar_events":{"nested":{"ReplyCalendarEventInvitationRequest":{"fields":{"calendarEventKey":{"rule":"required","type":"entities.CalendarEventKey","id":1},"replyType":{"type":"ReplyType","id":2,"options":{"default":"ACCEPT"}},"quitMeeting":{"type":"bool","id":3,"options":{"default":false}},"rsvpCommentInfo":{"type":"entities.RSVPCommentInfo","id":4},"needsBriefEvents":{"type":"bool","id":5,"options":{"default":false}},"useAttendeePageToken":{"type":"bool","id":6,"options":{"default":false}}},"nested":{"ReplyType":{"values":{"ACCEPT":1,"DECLINE":2,"TENTATIVE":3,"DELETE":4,"NEEDS_ACTION":5}}}},"ReplyCalendarEventInvitationResponse":{"fields":{"calendarEvent":{"type":"entities.CalendarEvent","id":1},"rsvpCommentFailed":{"rule":"repeated","type":"RSVPCommentFailed","id":2}},"nested":{"RSVPCommentFailed":{"fields":{"originalTime":{"type":"int64","id":1},"errorCode":{"type":"ErrorCode","id":2}},"nested":{"ErrorCode":{"values":{"InternalErrorCode":500,"MessageEncryptFailCode":311100}}}}}},"SearchMeetingRoomsRequest":{"fields":{"startTime":{"type":"int64","id":1,"options":{"default":0}},"endTime":{"type":"int64","id":2,"options":{"default":0}},"keyword":{"type":"string","id":3,"options":{"default":""}},"count":{"type":"int32","id":4,"options":{"default":50}},"rrule":{"type":"string","id":5,"options":{"default":""}},"needDisabledResource":{"type":"bool","id":6,"options":{"default":false}},"startTimezone":{"type":"string","id":7,"options":{"default":"UTC"}},"meetingRoomFilter":{"type":"entities.MeetingRoomFilter","id":8},"cursor":{"type":"int32","id":9,"options":{"default":0}},"type":{"type":"Type","id":10,"options":{"default":"DEFAULT"}}},"nested":{"Type":{"values":{"UNKNOWN":0,"DEFAULT":1,"BY_PAGE":2}}}},"SearchMeetingRoomsResponse":{"fields":{"buildings":{"rule":"repeated","type":"entities.CalendarBuilding","id":1},"hasMore":{"type":"bool","id":2,"options":{"default":false}},"cursor":{"type":"int32","id":3}}}}},"calendars":{"nested":{"MultiCalendarSearchRequest":{"fields":{"query":{"rule":"required","type":"string","id":1},"offset":{"type":"int32","id":2,"options":{"default":0}},"count":{"type":"int32","id":3,"options":{"default":10}},"needSearchMeetingRoom":{"type":"bool","id":4,"options":{"default":true}},"needSearchSharedCalendar":{"type":"bool","id":5,"options":{"default":true}},"needSearchPrimaryCalendar":{"type":"bool","id":6,"options":{"default":true}},"needSearchExternalPrimaryCalendar":{"type":"bool","id":7,"options":{"default":false}}}},"MultiCalendarSearchResponse":{"fields":{"contents":{"rule":"repeated","type":"entities.MultiCalendarSearchContent","id":1},"calendarChatterMap":{"keyType":"string","type":"string","id":2},"chatterMap":{"keyType":"string","type":"entities.Chatter","id":3},"calendarBriefMap":{"keyType":"string","type":"entities.CalendarBriefInfo","id":4}}}}},"calendar_entities":{"nested":{"WebCalendar":{"oneofs":{"extra":{"oneof":["primaryCalendarInfo","otherCalendarInfo","resourceCalendarInfo","googleCalendarInfo","exchangeCalendarInfo"]}},"fields":{"id":{"type":"string","id":1,"options":{"default":"0"}},"creatorUserId":{"type":"string","id":2,"options":{"default":"0"}},"defaultTimezone":{"type":"string","id":3,"options":{"default":""}},"defaultAccessRole":{"type":"entities.Calendar.AccessRole","id":4,"options":{"default":"FREE_BUSY_READER"}},"type":{"type":"entities.Calendar.Type","id":5,"options":{"default":"OTHER"}},"selfAccessRole":{"type":"entities.Calendar.AccessRole","id":6,"options":{"default":"FREE_BUSY_READER"}},"foregroundColor":{"type":"int32","id":7,"options":{"default":0}},"backgroundColor":{"type":"int32","id":8,"options":{"default":0}},"isPrimary":{"type":"bool","id":10,"options":{"default":false}},"isDeleted":{"type":"bool","id":11,"options":{"default":false}},"isPublic":{"type":"bool","id":12,"options":{"default":false}},"isAllStaff":{"type":"bool","id":13,"options":{"default":false}},"visibilityProperty":{"type":"int32","id":14,"options":{"default":0}},"summary":{"type":"string","id":15,"options":{"default":""}},"note":{"type":"string","id":16,"options":{"default":""}},"description":{"type":"string","id":17,"options":{"default":""}},"members":{"rule":"repeated","type":"WebCalendarMember","id":18},"createTime":{"type":"int64","id":19,"options":{"default":0}},"updateTime":{"type":"int64","id":20,"options":{"default":0}},"calendarSchema":{"type":"bytes","id":22},"schemaExtraData":{"type":"bytes","id":23},"calendarEventSchemaV2":{"type":"bytes","id":24},"primaryCalendarInfo":{"type":"PrimaryCalendarExtra","id":101},"otherCalendarInfo":{"type":"OtherCalendarExtra","id":102},"resourceCalendarInfo":{"type":"ResourceCalendarExtra","id":103},"googleCalendarInfo":{"type":"GoogleCalendarExtra","id":104},"exchangeCalendarInfo":{"type":"ExchangeCalendarExtra","id":105}}},"WebCalendarEvent":{"fields":{"id":{"type":"string","id":1,"options":{"default":"0"}},"key":{"type":"string","id":2,"options":{"default":""}},"originalTime":{"type":"int64","id":3,"options":{"default":0}},"calendarId":{"type":"string","id":4,"options":{"default":"0"}},"organizerCalendarId":{"type":"string","id":5,"options":{"default":"0"}},"creatorCalendarId":{"type":"string","id":6,"options":{"default":"0"}},"successorCalendarId":{"type":"string","id":7,"options":{"default":"0"}},"originalEventKey":{"type":"string","id":8,"options":{"default":""}},"originalIsAllDay":{"type":"bool","id":9,"options":{"default":false}},"isFree":{"type":"bool","id":10,"options":{"default":false}},"isAllDay":{"type":"bool","id":11,"options":{"default":false}},"isCrossTenant":{"type":"bool","id":12,"options":{"default":false}},"isDeleted":{"type":"bool","id":13,"options":{"default":false}},"lastDate":{"type":"int64","id":14,"options":{"default":0}},"source":{"type":"entities.CalendarEvent.Source","id":15,"options":{"default":"UNKNOWN"}},"color":{"type":"int32","id":16,"options":{"default":-1}},"visibility":{"type":"entities.CalendarEvent.Visibility","id":17,"options":{"default":"DEFAULT"}},"version":{"type":"int64","id":18,"options":{"default":0}},"status":{"type":"entities.CalendarEvent.Status","id":19,"options":{"default":"TENTATIVE"}},"rrule":{"type":"string","id":20,"options":{"default":""}},"guestCanInvite":{"type":"bool","id":21,"options":{"default":true}},"guestCanSeeOtherGuests":{"type":"bool","id":22,"options":{"default":true}},"guestCanModify":{"type":"bool","id":23,"options":{"default":false}},"selfAttendeeStatus":{"type":"entities.CalendarEvent.SelfAttendeeStatus","id":24,"options":{"default":"ATTENDEE_STATUS_NEEDS_ACTION"}},"startTime":{"type":"int64","id":25,"options":{"default":0}},"startTimezone":{"type":"string","id":26,"options":{"default":""}},"endTime":{"type":"int64","id":27,"options":{"default":0}},"endTimezone":{"type":"string","id":28,"options":{"default":""}},"summary":{"type":"string","id":29,"options":{"default":""}},"description":{"type":"string","id":30,"options":{"default":""}},"docsDescription":{"type":"string","id":31,"options":{"default":""}},"locations":{"rule":"repeated","type":"entities.CalendarEventLocation","id":32},"attendees":{"rule":"repeated","type":"WebCalendarEventAttendee","id":33},"reminders":{"rule":"repeated","type":"entities.Reminder","id":34},"createTime":{"type":"int64","id":35,"options":{"default":0}},"updateTime":{"type":"int64","id":36,"options":{"default":0}},"organizer":{"type":"WebCalendarEventAttendee","id":37},"creator":{"type":"WebCalendarEventAttendee","id":38},"successor":{"type":"WebCalendarEventAttendee","id":39},"type":{"type":"entities.CalendarEvent.Type","id":40},"attachments":{"rule":"repeated","type":"entities.CalendarEventAttachment","id":41},"attendeeInfo":{"type":"WebCalendarEventAttendeeInfo","id":42},"schema":{"type":"entities.CalendarSchemaCollection","id":43},"attendeeSource":{"type":"AttendeeSource","id":44,"options":{"default":"LARK"}},"meetingMinuteUrl":{"type":"string","id":45,"options":{"default":""}},"inviteOperatorId":{"type":"string","id":46,"options":{"default":""}},"videoMeeting":{"type":"entities.Vchat","id":47},"schemaV2":{"type":"bytes","id":48},"videoConfig":{"type":"entities.EventVChatConfig","id":49},"encryptionInfo":{"type":"entities.EventEncryptionInfo","id":50},"isWebinar":{"type":"bool","id":51}},"nested":{"AttendeeSource":{"values":{"LARK":1,"MAIL":2,"EXCHANGE_SYNC":3}}}},"WebCalendarEventAttendee":{"oneofs":{"dependency":{"oneof":["user","group","resource","thirdPartyUser"]}},"fields":{"id":{"type":"string","id":1,"options":{"default":""}},"key":{"type":"string","id":2,"options":{"default":""}},"originalTime":{"type":"int64","id":3,"options":{"default":0}},"displayName":{"type":"string","id":4,"options":{"default":""}},"attendeeCalendarId":{"type":"string","id":5,"options":{"default":"0"}},"isOrganizer":{"type":"bool","id":6,"options":{"default":false}},"isOptional":{"type":"bool","id":7,"options":{"default":false}},"status":{"type":"entities.CalendarEventAttendee.Status","id":8,"options":{"default":"NEEDS_ACTION"}},"inviterCalendarId":{"type":"string","id":9,"options":{"default":""}},"avatarKey":{"type":"string","id":10,"options":{"default":""}},"category":{"type":"Category","id":11,"options":{"default":"USER"}},"fsUnit":{"type":"string","id":12,"options":{"default":""}},"attendeeSchema":{"type":"bytes","id":13},"schemaExtraData":{"type":"bytes","id":14},"user":{"type":"User","id":100},"group":{"type":"Group","id":101},"resource":{"type":"Resource","id":102},"thirdPartyUser":{"type":"ThirdPartyUser","id":103}},"nested":{"Category":{"values":{"USER":1,"GROUP":2,"RESOURCE":3,"THIRD_PARTY_USER":4}},"User":{"fields":{"userId":{"type":"string","id":1,"options":{"default":"0"}},"tenantId":{"type":"string","id":2,"options":{"default":"0"}},"tags":{"rule":"repeated","type":"entities.CalendarEventAttendeeTag","id":3}}},"Group":{"fields":{"groupId":{"type":"string","id":1,"options":{"default":"0"}},"members":{"rule":"repeated","type":"WebCalendarEventAttendee","id":2},"tenantId":{"type":"string","id":3,"options":{"default":"0"}},"isCrossTenant":{"type":"bool","id":4,"options":{"default":false}},"openSecurity":{"type":"bool","id":5,"options":{"default":false}},"showMemberLimit":{"type":"int32","id":6,"options":{"default":0}},"memberCount":{"type":"int32","id":7,"options":{"default":0}},"hasRemovedMembers":{"type":"bool","id":8,"options":{"default":false}},"isSelfInGroup":{"type":"bool","id":9,"options":{"default":false}}}},"Resource":{"fields":{"tenantId":{"type":"string","id":1,"options":{"default":""}},"isDisabled":{"type":"bool","id":2,"options":{"default":false}}}},"ThirdPartyUser":{"fields":{"email":{"type":"string","id":1}}}}},"WebCalendarMember":{"oneofs":{"extra":{"oneof":["individual","group"]}},"fields":{"type":{"type":"Type","id":1,"options":{"default":"INDIVIDUAL"}},"accessRole":{"type":"entities.Calendar.AccessRole","id":2,"options":{"default":"FREE_BUSY_READER"}},"isDeleted":{"type":"bool","id":3,"options":{"default":false}},"name":{"type":"string","id":4,"options":{"default":""}},"avatarKey":{"type":"string","id":5,"options":{"default":""}},"fsUnit":{"type":"string","id":6,"options":{"default":""}},"individual":{"type":"Individual","id":101},"group":{"type":"Group","id":102}},"nested":{"Type":{"values":{"INDIVIDUAL":1,"GROUP":2}},"Individual":{"fields":{"userId":{"type":"string","id":1,"options":{"default":"0"}}}},"Group":{"fields":{"chatId":{"type":"string","id":1,"options":{"default":"0"}}}}}},"PrimaryCalendarExtra":{"fields":{"workHourSetting":{"type":"entities.WorkHourSetting","id":1},"timezone":{"type":"string","id":2,"options":{"default":""}},"owner":{"type":"WebCalendarMember","id":3}}},"OtherCalendarExtra":{"fields":{}},"ResourceCalendarExtra":{"fields":{"resourceInfo":{"type":"entities.CalendarResourceInfo","id":1}}},"GoogleCalendarExtra":{"fields":{"externalAccount":{"type":"entities.ExternalAccount","id":1}}},"ExchangeCalendarExtra":{"fields":{"externalAccount":{"type":"entities.ExternalAccount","id":1}}},"WebCalendarEventAttendeeInfo":{"fields":{"totalCount":{"type":"int32","id":1,"options":{"default":0}},"acceptCount":{"type":"int32","id":2,"options":{"default":0}},"declineCount":{"type":"int32","id":3,"options":{"default":0}},"tentativeCount":{"type":"int32","id":4,"options":{"default":0}},"needActionCount":{"type":"int32","id":5,"options":{"default":0}}}}}},"entities":{"nested":{"Calendar":{"nested":{"VisibilityProperty":{"values":{"NORMAL_VIEW":1,"MEETING_VIEW":2,"TODAY_FEED_VIEW":4,"MOBILE_NORMAL_VIEW":8,"MOBILE_MEETING_VIEW":16,"WEB_NORMAL_VIEW":32,"WEB_MEETING_VIEW":64}},"SubscriptionType":{"values":{"SUB_NORMAL_VIEW":1,"SUB_MEETING_VIEW":2}},"AccessRole":{"values":{"UNKNOWN":0,"FREE_BUSY_READER":1,"READER":2,"WRITER":3,"OWNER":4}},"Type":{"values":{"UNKNOWN_TYPE":0,"PRIMARY":1,"OTHER":2,"GOOGLE":3,"RESOURCES":4,"GOOGLE_RESOURCES":5,"DISMISSED":6,"EMAIL":7,"EXCHANGE":8,"ACTIVITY":9,"PHONE":10}},"Status":{"values":{"DEFAULT":1,"ACCEPTED":2,"DECLINED":3,"INVITED":4,"REMOVED":5}},"CalendarShareOptions":{"fields":{"defaultShareOption":{"type":"Calendar.ShareOption","id":1},"crossDefaultShareOption":{"type":"Calendar.ShareOption","id":2},"crossTopShareOption":{"type":"Calendar.ShareOption","id":3}}},"CalendarShareInfo":{"fields":{"shareUrl":{"type":"string","id":1},"subscriberNum":{"type":"int32","id":2}}},"OfficialType":{"values":{"NOT_OFFICIAL":0,"BYTEDANCE":1}},"ShareOption":{"values":{"UNKNOWN_SHARE_OPT":0,"SHARE_OPT_PRIVATE":5,"SHARE_OPT_FREE_BUSY_READER":10,"SHARE_OPT_READER":15,"SHARE_OPT_WRITER":20,"SHARE_OPT_OWNER":25}}},"fields":{"id":{"type":"string","id":1,"options":{"default":"0"}},"summary":{"type":"string","id":2,"options":{"default":""}},"description":{"type":"string","id":3,"options":{"default":""}},"defaultTimezone":{"type":"string","id":4},"creatorUserId":{"type":"string","id":5,"options":{"default":"0"}},"createTime":{"type":"int64","id":6,"options":{"default":0}},"updateTime":{"type":"int64","id":7,"options":{"default":0}},"defaultRole":{"type":"AccessRole","id":8,"options":{"default":"FREE_BUSY_READER"}},"type":{"type":"Type","id":9,"options":{"default":"OTHER"}},"accessRole":{"type":"AccessRole","id":10,"options":{"default":"FREE_BUSY_READER"}},"status":{"type":"Status","id":11},"foregroundColor":{"type":"int32","id":12,"options":{"default":0}},"backgroundColor":{"type":"int32","id":13,"options":{"default":0}},"weight":{"type":"int32","id":14,"options":{"default":0}},"isDefault":{"type":"bool","id":15,"options":{"default":false}},"isVisible":{"type":"bool","id":16,"options":{"default":true}},"isPrimary":{"type":"bool","id":17,"options":{"default":false}},"isDeleted":{"type":"bool","id":18,"options":{"default":false}},"defaultReminders":{"type":"string","id":19,"options":{"default":""}},"members":{"rule":"repeated","type":"CalendarMember","id":20},"email":{"type":"string","id":21,"options":{"default":""}},"isSynced":{"type":"bool","id":23,"options":{"default":true}},"isAccept":{"type":"bool","id":24,"options":{"default":false}},"isSubscriber":{"type":"bool","id":25,"options":{"default":false}},"isPublic":{"type":"bool","id":26,"options":{"default":false}},"note":{"type":"string","id":27,"options":{"default":""}},"calendarResourceInfo":{"type":"CalendarResourceInfo","id":28},"isAllStaff":{"type":"bool","id":29,"options":{"default":false}},"externalAccount":{"type":"ExternalAccount","id":30},"workHourSetting":{"type":"WorkHourSetting","id":31},"visibilityProperty":{"type":"int32","id":32,"options":{"default":0}},"timezone":{"type":"string","id":33,"options":{"default":""}},"calendarEventSchema":{"type":"bytes","id":34},"calendarSchema":{"type":"bytes","id":35},"schemaExtraData":{"type":"bytes","id":36},"calendarEventSchemaV2":{"type":"bytes","id":37},"successorUserId":{"type":"string","id":38},"shareOptions":{"type":"CalendarShareOptions","id":39},"shareInfo":{"type":"CalendarShareInfo","id":40},"isCrossTenant":{"type":"bool","id":41},"calendarOwnerId":{"type":"string","id":42},"coverImage":{"type":"ImImage","id":43},"calendarTenantId":{"type":"string","id":44},"officialType":{"type":"OfficialType","id":45}}},"CalendarEvent":{"nested":{"NotificationType":{"values":{"DEFAULT_NOTIFICATION_TYPE":1,"NO_NOTIFICATION":2,"SEND_NOTIFICATION":3,"NO_NOTIFICATION_FOR_DELETE_ATTENDEE":4}},"Source":{"values":{"UNKNOWN":0,"WEB":1,"IOS":2,"IOS_APP":3,"ANDROID":4,"ANDROID_APP":5,"PC_CLIENT":6,"GOOGLE":7,"PEOPLE":8,"PLACE_HOLDER":9,"OPEN_API":10,"CALDAV":11,"TIMEOFF":12,"EMAIL":13,"EXCHANGE":14,"INEMAIL":15,"LIVE_HOST":16,"SCHEDULER":17}},"Visibility":{"values":{"DEFAULT":1,"PUBLIC":2,"PRIVATE":3}},"Status":{"values":{"TENTATIVE":1,"CONFIRMED":2,"CANCELLED":3}},"SelfAttendeeStatus":{"values":{"ATTENDEE_STATUS_NEEDS_ACTION":1,"ATTENDEE_STATUS_ACCEPT":2,"ATTENDEE_STATUS_TENTATIVE":3,"ATTENDEE_STATUS_DECLINE":4,"ATTENDEE_STATUS_REMOVED":5}},"Type":{"values":{"DEFAULT_TYPE":1,"MEETING":2,"BIND_CHAT":3}},"Category":{"values":{"DEFAULT_CATEGORY":1,"SAME_PAGE_MEETING":2,"RESOURCE_STRATEGY":3,"RESOURCE_REQUISITION":4,"WEBINAR":5}}},"fields":{"id":{"type":"string","id":1,"options":{"default":"0"}},"uniqueKey":{"rule":"required","type":"string","id":2},"calendarId":{"rule":"required","type":"string","id":3},"originalTime":{"rule":"required","type":"int64","id":4},"creatorCalendarId":{"type":"string","id":5,"options":{"default":"0"}},"organizerCalendarId":{"type":"string","id":6,"options":{"default":"0"}},"selfAttendeeStatus":{"type":"SelfAttendeeStatus","id":7,"options":{"default":"ATTENDEE_STATUS_ACCEPT"}},"start":{"rule":"required","type":"int64","id":8},"startTimezone":{"rule":"required","type":"string","id":9},"end":{"rule":"required","type":"int64","id":10},"endTimezone":{"type":"string","id":11},"status":{"type":"Status","id":12,"options":{"default":"CONFIRMED"}},"locations":{"rule":"repeated","type":"CalendarEventLocation","id":13},"rrule":{"type":"string","id":14,"options":{"default":""}},"guestsCanInviteOthers":{"type":"bool","id":15,"options":{"default":true}},"guestsCanSeeOtherGuests":{"type":"bool","id":16,"options":{"default":true}},"guestsCanModify":{"type":"bool","id":17,"options":{"default":false}},"createTime":{"type":"int64","id":18,"options":{"default":0}},"updateTime":{"type":"int64","id":19,"options":{"default":0}},"isDeleted":{"type":"bool","id":20,"options":{"default":false}},"color":{"type":"int32","id":21,"options":{"default":-1}},"source":{"type":"Source","id":22,"options":{"default":"PC_CLIENT"}},"visibility":{"type":"Visibility","id":23,"options":{"default":"DEFAULT"}},"importance":{"type":"int32","id":24,"options":{"default":0}},"isAllDay":{"type":"bool","id":25,"options":{"default":false}},"attendees":{"rule":"repeated","type":"CalendarEventAttendee","id":26},"reminders":{"rule":"repeated","type":"Reminder","id":27},"isFree":{"type":"bool","id":28,"options":{"default":false}},"summary":{"type":"string","id":29,"options":{"default":""}},"description":{"type":"string","id":30,"options":{"default":""}},"originalEvent":{"type":"string","id":31,"options":{"default":""}},"originalIsAllDay":{"type":"bool","id":32,"options":{"default":false}},"audioUrl":{"type":"string","id":33,"options":{"default":""}},"url":{"type":"string","id":34,"options":{"default":""}},"hasAlarm":{"type":"bool","id":35,"options":{"default":true}},"hasAttendee":{"type":"bool","id":36,"options":{"default":false}},"hasLocation":{"type":"bool","id":37,"options":{"default":false}},"version":{"type":"int64","id":38,"options":{"default":0}},"sequence":{"type":"int32","id":39,"options":{"default":0}},"type":{"type":"Type","id":40,"options":{"default":"DEFAULT_TYPE"}},"meetingId":{"type":"string","id":41,"options":{"default":""}},"docsObjToken":{"type":"string","id":42,"options":{"default":""}},"docsDescription":{"type":"string","id":43,"options":{"default":""}},"successorCalendarId":{"type":"string","id":44,"options":{"default":""}},"notificationType":{"type":"NotificationType","id":45,"options":{"default":"DEFAULT_NOTIFICATION_TYPE"}},"isCrossTenant":{"type":"bool","id":46,"options":{"default":false}},"dissolveMeeting":{"type":"bool","id":47,"options":{"default":true}},"calendarEventGroupAttendees":{"rule":"repeated","type":"CalendarEventGroupAttendee","id":48},"calendarResources":{"rule":"repeated","type":"CalendarResource","id":49},"calendarBuildings":{"rule":"repeated","type":"CalendarBuilding","id":50},"meetingMinuteUrl":{"type":"string","id":51,"options":{"default":""}},"isMeetingMinuteUpdate":{"type":"bool","id":52,"options":{"default":false}},"vchatUniqueId":{"type":"string","id":53,"options":{"default":""}},"googleEventExtra":{"type":"GoogleEventExtra","id":54},"inviteOperatorId":{"type":"string","id":55,"options":{"default":""}},"attachments":{"rule":"repeated","type":"CalendarEventAttachment","id":56},"attendeeSource":{"type":"int32","id":57,"options":{"default":1}},"schema":{"type":"bytes","id":58},"category":{"type":"Category","id":59,"options":{"default":"DEFAULT_CATEGORY"}},"samePageMeeting":{"type":"SamePageMeetingInfo","id":60},"schemaV2":{"type":"bytes","id":61},"attendeeInfo":{"type":"EventAttendeeInfo","id":62},"videoConfig":{"type":"EventVChatConfig","id":63},"lastDate":{"type":"int64","id":64},"checkInConfig":{"type":"EventCheckInConfig","id":65},"encryptionInfo":{"type":"EventEncryptionInfo","id":66},"webinarInfo":{"type":"CalendarEventWebinarInfo","id":67},"relationTag":{"type":"TagData","id":68},"meetingNotesConfig":{"type":"MeetingNotesConfig","id":69},"sendSmsNotificationSetting":{"type":"bool","id":70},"meetingChatConfig":{"type":"MeetingChatConfig","id":71},"resourceWaitListOrders":{"type":"ResourceWaitListOrders","id":72},"externalEventExtra":{"type":"ExternalEventExtra","id":73}}},"CalendarEventKey":{"fields":{"uniqueKey":{"rule":"required","type":"string","id":1},"calendarId":{"rule":"required","type":"string","id":2},"originalTime":{"rule":"required","type":"int64","id":3}}},"RSVPCommentInfo":{"fields":{"replyCommentId":{"type":"string","id":1,"options":{"default":""}},"comment":{"type":"string","id":2,"options":{"default":""}},"inviteOperatorId":{"type":"string","id":3,"options":{"default":""}}}},"MeetingRoomFilter":{"fields":{"minCapacity":{"type":"int32","id":1},"needEquipments":{"rule":"repeated","type":"string","id":2}}},"CalendarBuilding":{"fields":{"id":{"rule":"required","type":"string","id":1},"name":{"type":"string","id":2,"options":{"default":""}},"description":{"type":"string","id":3,"options":{"default":""}},"latitude":{"type":"float","id":4,"options":{"default":360}},"longitude":{"type":"float","id":5,"options":{"default":360}},"floors":{"rule":"repeated","type":"string","id":6},"meetingRooms":{"rule":"repeated","type":"CalendarResource","id":7},"isDeleted":{"type":"bool","id":8,"options":{"default":false}},"weight":{"type":"int32","id":9,"options":{"default":0}},"seizeTime":{"type":"int64","id":10,"options":{"default":0}},"floorLevelIds":{"keyType":"string","type":"string","id":11}}},"MultiCalendarSearchContent":{"fields":{"calendarId":{"rule":"required","type":"string","id":1},"type":{"type":"MultiCalendarSearchContentType","id":2,"options":{"default":"CHATTER"}},"title":{"type":"string","id":3,"options":{"default":""}},"subtitle":{"type":"string","id":4,"options":{"default":""}},"avatarUrl":{"type":"string","id":5,"options":{"default":""}},"isPrivate":{"type":"bool","id":6,"options":{"default":false}},"isMember":{"type":"bool","id":7,"options":{"default":false}},"isDisabled":{"type":"bool","id":8,"options":{"default":false}},"isDismiss":{"type":"bool","id":9,"options":{"default":false}},"isCrossTenant":{"type":"bool","id":10,"options":{"default":false}},"calendarTenantId":{"type":"string","id":11},"coverImage":{"type":"ImImage","id":14},"subscriberNum":{"type":"int32","id":15}},"nested":{"MultiCalendarSearchContentType":{"values":{"CHATTER":1,"MEETING_ROOM":2,"SHARED_CALENDAR":3}}}},"Chatter":{"fields":{"id":{"type":"string","id":1,"options":{"(open.id)":"user_id"}},"name":{"type":"string","id":2},"avatar":{"type":"ImageSet","id":3},"status":{"type":"int32","id":4},"avatarUrl":{"type":"string","id":5},"updateTime":{"type":"int64","id":6},"namePinyin":{"type":"string","id":7},"creatorId":{"type":"string","id":8},"type":{"type":"ChatterType","id":9},"description":{"type":"string","id":11},"isRegistered":{"type":"bool","id":12},"namePy":{"type":"string","id":13},"enUsName":{"type":"string","id":14},"tenantId":{"type":"string","id":15},"descriptionFlag":{"type":"DescriptionFlag","id":16,"options":{"default":"DEFAULT"}},"botConfig":{"type":"BotConfig","id":17},"internationalName":{"keyType":"string","type":"string","id":18},"alias":{"type":"string","id":19},"workStatus":{"type":"WorkStatus","id":20},"i18nDescriptions":{"keyType":"string","type":"string","id":21,"options":{"deprecated":true}},"accountId":{"type":"string","id":22},"i18nInf":{"type":"I18nInf","id":23},"userConfig":{"type":"UserConfig","id":24},"email":{"type":"string","id":25},"donotDisturbBeforeMs":{"type":"int64","id":26},"acceptSmsPhoneUrgent":{"type":"bool","id":27},"lastLoginTime":{"type":"int64","id":28},"avatarImage":{"type":"Image","id":29},"timeZone":{"type":"TimeZone","id":30},"isGuest":{"type":"bool","id":31},"isFrozen":{"type":"bool","id":32},"isAnonymous":{"type":"bool","id":33},"department":{"rule":"repeated","type":"Department","id":34},"enterpriseEmail":{"type":"string","id":35},"customStatuses":{"rule":"repeated","type":"ChatterCustomStatus","id":36},"avatarMedal":{"type":"AvatarMedal","id":37},"anotherName":{"type":"string","id":38},"activeStatus":{"type":"int32","id":39},"isSpecialFocus":{"type":"bool","id":40},"majorLanguage":{"type":"string","id":41},"mutedInfo":{"type":"BotMutedInfo","id":42},"displayName":{"type":"I18nVal","id":43},"tagData":{"type":"TagData","id":44},"isTenantCertification":{"type":"bool","id":45},"tenantNameStatus":{"type":"TenantNameStatus","id":46},"commonLocales":{"rule":"repeated","type":"string","id":47}},"nested":{"DescriptionFlag":{"values":{"DEFAULT":0,"ON_BUSINESS":1,"ON_LEAVE":2,"ON_MEETING":3}},"I18nInf":{"fields":{"i18nDescriptions":{"keyType":"string","type":"string","id":1}}}}},"CalendarBriefInfo":{"fields":{"id":{"type":"string","id":1},"type":{"type":"Calendar.Type","id":2},"successorUserId":{"type":"int64","id":3},"isAllStaff":{"type":"bool","id":4,"options":{"default":false}},"calendarSummary":{"type":"string","id":5},"creatorUserId":{"type":"int64","id":6}}},"CalendarEventLocation":{"fields":{"name":{"type":"string","id":1,"options":{"default":""}},"address":{"type":"string","id":2,"options":{"default":""}},"type":{"type":"Type","id":3,"options":{"default":"ORDINARY"}},"latitude":{"type":"float","id":4,"options":{"default":360}},"longitude":{"type":"float","id":5,"options":{"default":360}}},"nested":{"Type":{"values":{"MEETING_ROOM":1,"ORDINARY":2}}}},"Reminder":{"fields":{"calendarEventId":{"type":"string","id":1,"options":{"default":"0"}},"minutes":{"rule":"required","type":"int32","id":2},"method":{"rule":"required","type":"Method","id":3}},"nested":{"Method":{"values":{"DEFAULT":1,"EMAIL":2,"POPUP":3,"SMS":4}}}},"CalendarEventAttachment":{"fields":{"fileToken":{"type":"string","id":1},"fileSize":{"type":"string","id":2},"name":{"type":"string","id":3},"type":{"type":"Type","id":4},"uploaderUserId":{"type":"string","id":5},"isDeleted":{"type":"bool","id":6},"position":{"type":"int32","id":7},"docUrls":{"rule":"repeated","type":"string","id":8},"expireTime":{"type":"int64","id":9},"googleDriveLink":{"type":"string","id":10},"urlLink":{"type":"string","id":11}},"nested":{"Type":{"values":{"UNKNOWN":0,"LOCAL":1,"SAMEPAGEMEETING":2,"LARGE":3,"GOOGLEDRIVE":4,"URL":5}}}},"CalendarSchemaCollection":{"fields":{"entitySchemas":{"rule":"repeated","type":"EntitySchema","id":1},"compatibility":{"type":"CalendarSchemaCompatibility","id":2}}},"Vchat":{"fields":{"uniqueId":{"rule":"required","type":"string","id":1},"meetingNo":{"rule":"required","type":"string","id":2},"isExpired":{"type":"bool","id":3,"options":{"default":false}},"meetingUrl":{"type":"string","id":4,"options":{"default":""}},"type":{"type":"Type","id":5,"options":{"default":"VIDEO_CONFERENCE"}},"vchatType":{"type":"VChatType","id":6,"options":{"default":"UN_KNOWN"}}},"nested":{"Type":{"values":{"VIDEO_CONFERENCE":1,"THIRD_PARTY":2}},"VChatType":{"values":{"UN_KNOWN":0,"LARK_VIDEO_CONFERENCE":1,"THIRD_PARTY_URL":2,"LARK_LIVE_HOST":3,"NO_VIDEO_MEETING":4,"GOOGLE_VIDEO_CONFERENCE":5,"ZOOM_MEETING":6}}}},"EventVChatConfig":{"oneofs":{"customizedConfigs":{"oneof":["otherConfigs","googleConfigs","zoomConfigs"]}},"fields":{"vchatType":{"type":"Vchat.VChatType","id":1,"options":{"default":"UN_KNOWN"}},"meetingUrl":{"type":"string","id":2},"otherConfigs":{"type":"OtherVideoMeetingConfigs","id":101},"googleConfigs":{"type":"GoogleVideoConferenceConfig","id":102},"zoomConfigs":{"type":"ZoomVideoMeetingConfigs","id":103},"larkVcBindingData":{"type":"LarkVCBindingData","id":3}},"nested":{"OtherVideoMeetingConfigs":{"fields":{"icon":{"type":"IconType","id":1},"customizedDescription":{"type":"string","id":2,"options":{"default":""}}},"nested":{"IconType":{"values":{"DEFAULT":0,"VIDEO_MEETING":1,"LIVE":2}}}},"GoogleVideoConferenceConfig":{"fields":{"phoneNumber":{"type":"string","id":1},"morePhoneNumberUrl":{"type":"string","id":2}}},"ZoomVideoMeetingConfigs":{"fields":{"meetingId":{"type":"int64","id":1},"meetingNo":{"type":"int64","id":2},"creatorAccount":{"type":"string","id":3},"meetingUrl":{"type":"string","id":4},"password":{"type":"string","id":5},"isEditable":{"type":"bool","id":6},"creatorUserId":{"type":"int64","id":7}}},"LarkVCBindingData":{"fields":{"vcSettingId":{"type":"string","id":1}}}}},"EventEncryptionInfo":{"fields":{"encryptionKey":{"type":"string","id":1},"encryptType":{"type":"EncryptionType","id":2},"keyStatus":{"type":"KeyStatus","id":3},"encryptionStatus":{"type":"EncryptionStatus","id":4}},"nested":{"EncryptionType":{"values":{"UNKNOWN":1,"UN_ENCRYPTION":2,"LOCAL_ENCRYPTION":3,"UNIFIED_ENCRYPTION":4}}}},"CalendarEventAttendee":{"nested":{"Status":{"values":{"NEEDS_ACTION":1,"ACCEPT":2,"TENTATIVE":3,"DECLINE":4,"REMOVED":5}},"ResourceStatus":{"values":{"NORMAL":0,"RELEASED_EARLY":1}},"IndividualAttendeeType":{"values":{"UNKNOWN":0,"USER":1,"RESOURCE":2,"THIRD_PARTY_USER":3,"PHONE":4}}},"fields":{"displayName":{"type":"string","id":1,"options":{"default":""}},"attendeeCalendarId":{"rule":"required","type":"string","id":2},"isOrganizer":{"type":"bool","id":3,"options":{"default":false}},"isResource":{"type":"bool","id":4,"options":{"default":false}},"isOptional":{"type":"bool","id":5,"options":{"default":false}},"status":{"type":"Status","id":6,"options":{"default":"NEEDS_ACTION"}},"additionalGuests":{"type":"int32","id":7,"options":{"default":0}},"createTime":{"type":"int64","id":8,"options":{"default":0}},"updateTime":{"type":"int64","id":9,"options":{"default":0}},"type":{"type":"Calendar.Type","id":10,"options":{"default":"PRIMARY"}},"tags":{"rule":"repeated","type":"CalendarEventAttendeeTag","id":11},"tenantId":{"type":"string","id":12,"options":{"default":""}},"inviteInfo":{"type":"CalendarEventAttendeeInviteInformation","id":13},"isDisabled":{"type":"bool","id":14,"options":{"default":false}},"email":{"type":"string","id":15,"options":{"default":""}},"isThirdParty":{"type":"bool","id":16,"options":{"default":false}},"attendeeSchema":{"type":"bytes","id":17},"schemaExtraData":{"type":"bytes","id":18},"resourceStatus":{"type":"ResourceStatus","id":19,"options":{"default":"NORMAL"}},"resourceReserveOperatorId":{"type":"string","id":20},"relationTag":{"type":"TagData","id":21},"phone":{"type":"string","id":22,"options":{"default":""}},"individualAttendeeType":{"type":"IndividualAttendeeType","id":23}}},"CalendarEventGroupAttendee":{"fields":{"chatId":{"type":"string","id":1},"isRemoved":{"type":"bool","id":2,"options":{"default":false}},"inviteInfo":{"type":"CalendarEventAttendeeInviteInformation","id":3},"validMemberCount":{"type":"int32","id":4},"isSelfInGroupMember":{"type":"bool","id":5,"options":{"default":false}},"relationTag":{"type":"TagData","id":6}}},"CalendarResource":{"fields":{"id":{"rule":"required","type":"string","id":1},"calendarId":{"type":"string","id":2,"options":{"default":""}},"name":{"type":"string","id":3,"options":{"default":""}},"type":{"type":"Type","id":4,"options":{"default":"OTHER"}},"status":{"type":"Status","id":5,"options":{"default":"FREE"}},"buildingId":{"type":"string","id":6,"options":{"default":""}},"description":{"type":"string","id":7,"options":{"default":""}},"capacity":{"type":"int32","id":8,"options":{"default":0}},"floorName":{"type":"string","id":9,"options":{"default":""}},"category":{"type":"string","id":10,"options":{"default":""}},"isDeleted":{"type":"bool","id":11,"options":{"default":false}},"isExternal":{"type":"bool","id":12,"options":{"default":false}},"weight":{"type":"int32","id":13,"options":{"default":0}},"tenantId":{"type":"string","id":14,"options":{"default":""}},"isDisabled":{"type":"bool","id":15,"options":{"default":false}},"resourceSchema":{"type":"bytes","id":16},"schemaExtraData":{"type":"bytes","id":17},"equipmentNames":{"rule":"repeated","type":"string","id":18,"options":{"deprecated":true}},"equipmentNameMap":{"keyType":"string","type":"string","id":19},"resourceNameWithLevelInfo":{"rule":"repeated","type":"string","id":20}},"nested":{"Type":{"values":{"MEETING_ROOM":1,"OTHER":2}},"Status":{"values":{"FREE":1,"BUSY":2}}}},"GoogleEventExtra":{"fields":{"dataSource":{"type":"DataSource","id":1,"options":{"default":"GOOGLE"}}},"nested":{"DataSource":{"values":{"GOOGLE":1,"CACHE":2}}}},"SamePageMeetingInfo":{"fields":{"url":{"rule":"repeated","type":"string","id":1}}},"EventAttendeeInfo":{"fields":{"totalNo":{"type":"int32","id":1},"acceptNo":{"type":"int32","id":2},"declineNo":{"type":"int32","id":3},"tentativeNo":{"type":"int32","id":4},"needActionNo":{"type":"int32","id":5},"eventCreators":{"type":"EventCreators","id":6},"allIndividualAttendee":{"type":"bool","id":7},"snapshotPageToken":{"type":"string","id":8}}},"EventCheckInConfig":{"fields":{"checkInEnable":{"type":"bool","id":1},"checkInStartTime":{"type":"CheckInTime","id":2},"checkInEndTime":{"type":"CheckInTime","id":3},"needNotifyAttendees":{"type":"bool","id":4}},"nested":{"CheckInTime":{"fields":{"type":{"type":"Type","id":1},"duration":{"type":"int64","id":2}},"nested":{"Type":{"values":{"BeforeEventStart":1,"AfterEventStart":2,"AfterEventEnd":3}}}}}},"CalendarEventWebinarInfo":{"fields":{"conf":{"type":"CalendarEventWebinarConf","id":1},"speakers":{"type":"CalendarEventWebinarAttendeeInfo","id":2},"audiences":{"type":"CalendarEventWebinarAttendeeInfo","id":3},"resources":{"rule":"repeated","type":"CalendarEventAttendee","id":4},"webinarAttendeeType":{"type":"entities.WebinarAttendeeType","id":5},"webinarData":{"type":"string","id":6}}},"TagData":{"fields":{"tagDataItems":{"rule":"repeated","type":"TagDataItem","id":1}},"nested":{"TagDataItem":{"fields":{"textVal":{"type":"I18nVal","id":1},"tagId":{"type":"string","id":2},"reqTagType":{"type":"RequestTagTypeEnum","id":3},"respTagType":{"type":"ResponseTagTypeEnum","id":4},"priority":{"type":"int32","id":5}}}}},"MeetingNotesConfig":{"fields":{"createNotesPermission":{"type":"CreateNotesPermission","id":1}},"nested":{"CreateNotesPermission":{"values":{"UNKNOWN":0,"ORGANIZER":1,"ALL":2}}}},"MeetingChatConfig":{"fields":{"forbidCreateChat":{"type":"bool","id":1},"meetingChatSettingType":{"type":"MeetingChatSettingType","id":2},"bindChatId":{"type":"string","id":3},"bindUserId":{"type":"string","id":4},"associateChatId":{"type":"string","id":5}},"nested":{"MeetingChatSettingType":{"values":{"UNKNOWN":0,"ALLOW_CREATE_CHAT":1,"FORBID_CREATE_CHAT":2,"BIND_CHAT":3}}}},"ResourceWaitListOrders":{"fields":{"orders":{"rule":"repeated","type":"ResourceWaitListOrder","id":1}}},"ExternalEventExtra":{"fields":{"directlySyncFromLark":{"type":"bool","id":1},"isOneWaySync":{"type":"bool","id":2}}},"ImImage":{"fields":{"imageKey":{"type":"string","id":1},"fsUnit":{"type":"string","id":2},"crypto":{"type":"Crypto","id":3},"Attrs":{"rule":"repeated","type":"ImageAttribute","id":4}},"nested":{"ImageAttribute":{"fields":{"CropType":{"type":"ImageCropType","id":1},"Width":{"type":"int64","id":2},"Height":{"type":"int64","id":3}}}}},"ImageSet":{"fields":{"key":{"type":"string","id":1,"options":{"deprecated":true}},"origin":{"type":"Image","id":2},"thumbnail":{"type":"Image","id":3},"imageKey":{"type":"string","id":4,"options":{"deprecated":true}},"middle":{"type":"Image","id":5},"thumbnailWebp":{"type":"Image","id":6},"middleWebp":{"type":"Image","id":7},"middleMp4":{"type":"Image","id":8},"cover":{"type":"Image","id":9},"intact":{"type":"Image","id":10}}},"ChatterType":{"values":{"UNKNOWN_CHATTER":0,"USER":1,"BOT":2,"AI":3}},"BotConfig":{"fields":{"withBotTag":{"type":"string","id":1,"options":{"default":"bot"}},"inContacts":{"type":"bool","id":2,"options":{"default":true}},"canJoinGroup":{"type":"bool","id":3,"options":{"default":true}}}},"WorkStatus":{"fields":{"status":{"type":"Status","id":7},"startTime":{"type":"int64","id":8},"endTime":{"type":"int64","id":9},"descriptionTemplates":{"keyType":"string","type":"string","id":10}},"nested":{"Status":{"values":{"UNKNOWN":0,"ON_LEAVE":1,"ON_MEETING":2}}}},"UserConfig":{"fields":{"phoneCallAccessible":{"type":"bool","id":1,"options":{"default":true}},"voiceCallAccessible":{"type":"bool","id":2,"options":{"default":true}},"videoCallAccessible":{"type":"bool","id":3,"options":{"default":true}},"accessPhoneCall":{"type":"AccessibleInfo","id":4},"accessVoiceCall":{"type":"AccessibleInfo","id":5},"accessVideoCall":{"type":"AccessibleInfo","id":6},"accessUrgent":{"type":"AccessibleInfo","id":7}}},"Image":{"fields":{"key":{"type":"string","id":1},"urls":{"rule":"repeated","type":"string","id":2,"options":{"deprecated":true}},"width":{"type":"int32","id":3},"height":{"type":"int32","id":4},"secureKey":{"type":"string","id":5},"secureUrls":{"rule":"repeated","type":"string","id":6,"options":{"deprecated":true}},"secureWidth":{"type":"int32","id":7},"secureHeight":{"type":"int32","id":8},"crypto":{"type":"Crypto","id":9},"size":{"type":"int32","id":10},"fsUnit":{"type":"string","id":11},"params":{"keyType":"string","type":"string","id":12},"etag":{"type":"string","id":13}}},"TimeZone":{"fields":{"name":{"rule":"required","type":"string","id":1}}},"Department":{"fields":{"id":{"rule":"required","type":"string","id":1,"options":{"(open.id)":"department_id"}},"name":{"type":"string","id":2},"parentId":{"type":"string","id":3},"leaderId":{"type":"string","id":4},"memberCount":{"type":"int32","id":5},"status":{"type":"int32","id":6},"namePinyin":{"type":"string","id":7},"chatId":{"type":"string","id":8},"hasChild":{"type":"bool","id":9},"i18nName":{"keyType":"string","type":"string","id":10},"deptLeaders":{"rule":"repeated","type":"DepartmentLeader","id":11},"memberCountByDisplayRule":{"type":"int32","id":12}}},"ChatterCustomStatus":{"fields":{"title":{"type":"string","id":1},"i18nTitle":{"keyType":"string","type":"string","id":2},"iconKey":{"type":"string","id":3},"fsUnit":{"type":"string","id":4},"effectiveInterval":{"type":"EffectiveInterval","id":5},"isNotDisturbMode":{"type":"bool","id":6},"tagInfo":{"type":"TagInfo","id":7},"timeFormat":{"type":"TimeFormat","id":8},"statusId":{"type":"int64","id":9}}},"AvatarMedal":{"fields":{"key":{"type":"string","id":1},"fsUnit":{"type":"string","id":2},"i18nName":{"type":"I18nVal","id":3},"showSwitch":{"type":"bool","id":4}}},"BotMutedInfo":{"fields":{"mutedScenes":{"keyType":"string","type":"bool","id":1}}},"I18nVal":{"fields":{"defaultVal":{"rule":"required","type":"string","id":1},"i18nVals":{"keyType":"string","type":"string","id":2}}},"TenantNameStatus":{"values":{"TENANT_NAME_STATUS_UNKNOWN":0,"TENANT_NAME_STATUS_NOT_FRIEND":1,"TENANT_NAME_STATUS_VISIBLE":2,"TENANT_NAME_STATUS_HIDE":3}},"WorkHourSetting":{"fields":{"enableWorkHour":{"type":"bool","id":1,"options":{"default":false}},"workHourItems":{"keyType":"string","type":"WorkHourItem","id":2},"isFirstSet":{"type":"bool","id":3,"options":{"default":true}}}},"CalendarResourceInfo":{"fields":{"capacity":{"type":"int32","id":1,"options":{"default":0}},"cityName":{"type":"string","id":2,"options":{"default":""}},"buildingName":{"type":"string","id":3,"options":{"default":""}},"resourceName":{"type":"string","id":4,"options":{"default":""}},"floorName":{"type":"string","id":5,"options":{"default":""}},"isDisabled":{"type":"bool","id":6,"options":{"default":false}},"resourceId":{"type":"string","id":7,"options":{"default":""}}}},"ExternalAccount":{"fields":{"email":{"type":"string","id":1},"passwordInvalid":{"type":"bool","id":2,"options":{"default":false}}}},"CalendarMember":{"fields":{"chatterId":{"rule":"required","type":"string","id":1},"accessRole":{"type":"Calendar.AccessRole","id":2,"options":{"default":"FREE_BUSY_READER"}},"status":{"type":"Calendar.Status","id":3,"options":{"default":"DEFAULT"}},"tags":{"rule":"repeated","type":"UserCalendarRefTag","id":4},"memberType":{"type":"CalendarMemberType","id":5,"options":{"default":"INDIVIDUAL"}},"chatId":{"type":"string","id":6,"options":{"default":""}},"useServerMemberNum":{"type":"bool","id":7,"options":{"default":false}},"serverMemberNum":{"type":"int32","id":8,"options":{"default":0}},"departmentName":{"type":"string","id":9},"relationType":{"type":"RelationType","id":10}},"nested":{"CalendarMemberType":{"values":{"INDIVIDUAL":1,"GROUP":2}},"RelationType":{"values":{"INTERNAL":0,"EXTERNAL":1}}}},"EntitySchema":{"fields":{"uniqueName":{"type":"string","id":1},"uiLevel":{"type":"ItemUILevel","id":2},"appLink":{"type":"string","id":3},"incompatibleLevel":{"type":"IncompatibleLevel","id":4}},"nested":{"ItemUILevel":{"values":{"HIDE":1,"READONLY":2,"EDITABLE":3}}}},"CalendarSchemaCompatibility":{"fields":{"minimumCompatibilityVer":{"type":"int32","id":1},"incompatibleLevel":{"type":"IncompatibleLevel","id":2}}},"KeyStatus":{"values":{"KEY_UNKNOWN":0,"KEY_DISABLE":1,"KEY_NORMAL":2}},"EncryptionStatus":{"values":{"ENCRYPTION_UNKNOWN":0,"ENCRYPTION_NORMAL":1,"ENCRYPTION_DISABLE":2}},"CalendarEventAttendeeTag":{"fields":{"type":{"type":"CalendarEventAttendeeTagType","id":1,"options":{"default":"INDIVIDUAL"}},"content":{"type":"string","id":2,"options":{"default":""}}},"nested":{"CalendarEventAttendeeTagType":{"values":{"INDIVIDUAL":1,"GROUP":2}}}},"CalendarEventAttendeeInviteInformation":{"fields":{"inviteOperatorId":{"type":"string","id":1,"options":{"default":""}},"inviteOperatorCalendarId":{"type":"string","id":2,"options":{"default":""}},"inviterCalendarId":{"type":"string","id":3,"options":{"default":""}},"firstInviteOperatorId":{"type":"string","id":4,"options":{"default":""}},"inviteTime":{"type":"int64","id":5,"options":{"default":0}},"removedChatterId":{"type":"string","id":6,"options":{"default":""}},"removedRequestId":{"type":"string","id":7,"options":{"default":""}},"removeTime":{"type":"int64","id":8,"options":{"default":0}}}},"EventCreators":{"fields":{"organizer":{"type":"CalendarEventAttendee","id":1},"creator":{"type":"CalendarEventAttendee","id":2},"successor":{"type":"CalendarEventAttendee","id":3}}},"CalendarEventWebinarConf":{"fields":{"speakerCanSeeOtherSpeakers":{"type":"bool","id":1},"speakerCanInviteOthers":{"type":"bool","id":2},"audienceCanSeeOtherSpeakers":{"type":"bool","id":3},"audienceCanInviteOthers":{"type":"bool","id":4},"speakerCanNotSeeOtherAudience":{"type":"bool","id":5},"audienceCanNotSeeOtherAudience":{"type":"bool","id":6}}},"CalendarEventWebinarAttendeeInfo":{"fields":{"attendees":{"rule":"repeated","type":"CalendarEventWebinarAttendee","id":1},"groupAttendees":{"rule":"repeated","type":"CalendarEventWebinarGroupAttendee","id":2},"eventAttendeeInfo":{"type":"EventAttendeeInfo","id":3},"requireMore":{"type":"bool","id":4},"syncToken":{"type":"string","id":5}}},"WebinarAttendeeType":{"values":{"Unknown":0,"Speaker":1,"Audience":2}},"ResourceWaitListOrder":{"fields":{"buildingLevelId":{"rule":"required","type":"string","id":1},"levelIds":{"rule":"repeated","type":"string","id":2},"capacity":{"rule":"required","type":"int32","id":3},"equipmentRequirement":{"rule":"required","type":"EquipmentRequireType","id":4},"displayName":{"rule":"required","type":"string","id":5},"lastWaitTime":{"rule":"required","type":"LastWaitTime","id":6},"status":{"rule":"required","type":"WaitListStatus","id":7},"createUserId":{"rule":"required","type":"string","id":8},"maxCapacity":{"type":"int32","id":9},"buildingZoneCodes":{"rule":"repeated","type":"string","id":10}}},"Crypto":{"fields":{"type":{"type":"Type","id":1},"cipher":{"type":"Cipher","id":2}},"nested":{"Type":{"values":{"UNKNOWN":0,"AES_256_GCM":1,"AES_CTR":2,"CRYPTO_SDK_UNIFIED":3,"CRYPTO_SDK_DOWNGRADE":4,"CRYPTO_SDK_THIRDPARTY":5,"SM4_128":6}}}},"AccessibleInfo":{"fields":{"isAccessible":{"type":"bool","id":1,"options":{"default":true}},"inaccessibleCode":{"type":"InaccessibleCode","id":2}},"nested":{"InaccessibleCode":{"values":{"DEFAULT":0,"EXECUTIVES":1,"EMPTY_NAME":2,"EMPTY_PHONE":3,"CROSS_TENANT":4,"NOT_FRIEND":5}}}},"DepartmentLeader":{"fields":{"leaderType":{"rule":"required","type":"LeaderType","id":1},"leaderID":{"rule":"required","type":"int64","id":2},"leader":{"type":"Chatter","id":3}}},"EffectiveInterval":{"fields":{"startTime":{"type":"int64","id":1},"endTime":{"type":"int64","id":2},"isShowEndTime":{"type":"bool","id":3,"options":{"default":true}},"isOpenWithoutEndTime":{"type":"bool","id":4}}},"TagInfo":{"fields":{"isShowTag":{"type":"bool","id":1},"tagColor":{"type":"TagColor","id":2}}},"TimeFormat":{"fields":{"timeUnit":{"type":"TimeUnit","id":1},"startEndLayout":{"type":"StartEndLayout","id":2},"isShowToOthers":{"type":"bool","id":3}},"nested":{"StartEndLayout":{"values":{"HIDE":0,"NORMAL":1,"START_ONLY":2,"END_ONLY":3}}}},"WorkHourItem":{"fields":{"spans":{"rule":"repeated","type":"WorkHourSpan","id":1}}},"UserCalendarRefTag":{"fields":{"type":{"type":"UserCalendarRefTagType","id":1,"options":{"default":"INDIVIDUAL"}},"content":{"type":"string","id":2,"options":{"default":""}},"accessRole":{"type":"int32","id":3,"options":{"default":0}}},"nested":{"UserCalendarRefTagType":{"values":{"INDIVIDUAL":1,"GROUP":2}}}},"IncompatibleLevel":{"values":{"SHOW_HINT":1,"DISABLE_EDIT":2,"DISABLE_READ":3}},"CalendarEventWebinarAttendee":{"fields":{"attendeeInfo":{"type":"CalendarEventAttendee","id":1}}},"CalendarEventWebinarGroupAttendee":{"fields":{"attendeeInfo":{"type":"CalendarEventGroupAttendee","id":1}}},"RequestTagTypeEnum":{"values":{"UNKNOWN_TAG_TYPE":0,"RELATION_TAG":1}},"ResponseTagTypeEnum":{"values":{"RELATION_TAG_UNSET":0,"RELATION_TAG_EXTERNAL":1,"RELATION_TAG_PARTNER":2,"RELATION_TAG_TENANT_NAME":3}},"EquipmentRequireType":{"values":{"RequireNoneEquipment":0,"IncludeProjector":1}},"LastWaitTime":{"fields":{"timeType":{"rule":"required","type":"LastWaitTimeType","id":1},"duration":{"type":"int32","id":2}}},"WaitListStatus":{"values":{"WAITING":1,"SUCCEED":2,"FAILED":3,"REMOVED":4}},"Cipher":{"fields":{"secret":{"type":"bytes","id":1},"nonce":{"type":"bytes","id":2},"additionalData":{"type":"bytes","id":3}}},"ImageCropType":{"values":{"ORIGIN":1,"MIDDLE":2,"THUMB":3,"MIDDLE_WEBP":4,"THUMB_WEBP":5,"MIDDLE_MP4":6,"COVER":7,"INTACT":8}},"LeaderType":{"values":{"MainLeader":1,"SubLeader":2}},"TagColor":{"values":{"BLUE":0,"GRAY":1,"INDIGO":2,"WATHET":3,"GREEN":4,"TURQUOISE":5,"YELLOW":6,"LIME":7,"RED":8,"ORANGE":9,"PURPLE":10,"VIOLET":11,"CARMINE":12}},"TimeUnit":{"values":{"SECOND":0,"MINUTE":1,"HOUR":2,"DAY":3,"MONTH":4,"YEAR":5}},"WorkHourSpan":{"fields":{"startMinute":{"rule":"required","type":"int32","id":1},"endMinute":{"rule":"required","type":"int32","id":2}}},"LastWaitTimeType":{"values":{"BEFORE_EVENT_START":1,"WHEN_EVENT_START":2,"AFTER_EVENT_START":3,"WHEN_EVENT_END":4}}}}}}
|
package/skills/larkmate/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: larkmate
|
|
3
|
-
description: 使用 LarkMate
|
|
3
|
+
description: 使用 LarkMate 以当前飞书网页版用户身份管理会话、搜索与操作消息、收发文件及图片、管理群组、飞书任务和日历,以及查询录制妙记、申请访问权限和导出文字记录。当用户要求使用 LarkMate 或需要执行上述个人飞书操作时使用;不负责飞书文档。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# LarkMate
|
|
@@ -16,8 +16,9 @@ description: 使用 LarkMate 以当前飞书网页版用户身份管理会话、
|
|
|
16
16
|
- 查找会话、搜索与导出消息、获取链接、下载资源,以及管理会话状态和标签: [会话与消息](references/chats.md)。
|
|
17
17
|
- 发送与管理消息、文件、图片、表情和收藏,管理群组及成员: [发送与群组](references/writes.md)。
|
|
18
18
|
- 查询和管理飞书任务、任务视图及成员: [飞书任务](references/tasks.md)。
|
|
19
|
+
- 查询和管理日历、日程及邀请: [日历与日程](references/calendar.md)。
|
|
19
20
|
- 查找录制妙记、导出文字记录、查询或申请访问权限: [录制妙记](references/minutes.md)。
|
|
20
21
|
|
|
21
22
|
命令输出 JSON:成功为 `ok: true`,失败为 `ok: false`,检查退出码和错误信息。飞书网页客户端数字 ID 与开放平台 ID 不同;按实际查询结果选定对象,名称相近时先消歧。列表和搜索有分页或扫描范围,无法读取的内容、缺失结果和权限错误应如实说明。
|
|
22
23
|
|
|
23
|
-
`chat-open`
|
|
24
|
+
`chat-open` 会打开或创建私聊;发送、修改消息、表情、收藏、群组、会话状态、任务、日历及妙记权限申请等命令也会修改数据,请按用户的实际意图操作。写入返回 `EFFECT_UNKNOWN`、`submitted_unconfirmed` 或部分成功时,先查询实际状态,避免重复提交。不要将消息已发送当作对方已读。
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# 日历与日程
|
|
2
|
+
|
|
3
|
+
`calendars` 查询管理和订阅的日历;`calendar-search` 搜索联系人、会议室和共享日历。`calendar-events` 按时间范围查询并展开重复日程,默认查询主日历,可选择具体日历或全部日历。结束时间为开区间,一次最长查询 366 天;检查 `complete` 和 `warnings`。遇到无法展开的规则应说明,不要当作没有安排。
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
larkmate calendars
|
|
7
|
+
larkmate calendar-search --query '名称'
|
|
8
|
+
larkmate calendar-events --start '2026-11-30T00:00:00+08:00' --end '2026-12-01T00:00:00+08:00'
|
|
9
|
+
larkmate calendar-events --start '2026-11-30T00:00:00+08:00' --end '2026-12-07T00:00:00+08:00' --all-calendars
|
|
10
|
+
larkmate event-get --id "$EVENT_ID"
|
|
11
|
+
larkmate calendar-rooms --start '2026-11-30T10:00:00+08:00' --end '2026-11-30T11:00:00+08:00' --query '会议室'
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
时间使用带时区的 ISO 时间或 Unix 秒。重复日程结果中的 `startTime`、`endTime` 和 `originalTime` 对应该次发生,`event` 是系列信息。修改或删除重复日程时根据用户意图传 `--span`(1 本次、2 本次及以后、3 整个系列)和 `--instance-start`;普通日程默认 span 0。日历返回的例外或规则若不完整,展开结果可能与网页不同,重要安排应核对详情。
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
larkmate event-create --title '讨论' --start '2026-11-30T10:00:00+08:00' --end '2026-11-30T10:30:00+08:00' --user "$USER_ID" --reminder 15
|
|
18
|
+
larkmate event-update --id "$EVENT_ID" --description '更新说明' --add-user "$USER_ID"
|
|
19
|
+
larkmate event-share --id "$EVENT_ID" --chat "$CHAT_ID"
|
|
20
|
+
larkmate event-reply --id "$EVENT_ID" --response accept
|
|
21
|
+
larkmate event-delete --id "$EVENT_ID"
|
|
22
|
+
larkmate calendar-create --name '团队日历'
|
|
23
|
+
larkmate calendar-update --id "$CALENDAR_ID" --description '说明'
|
|
24
|
+
larkmate calendar-subscribe --id "$CALENDAR_ID"
|
|
25
|
+
larkmate calendar-unsubscribe --id "$CALENDAR_ID"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`event-create` 和 `event-update` 支持参与人、群组和会议室;完整字段可用 `--json` 传入,结构见包内 `proto/calendar-schema.json` 的 `calendar_entities.WebCalendarEvent`。日历创建和更新的 `--json` 使用 `calendar_entities.WebCalendar` 字段,包括公开范围和共享成员。各字段是否可用取决于当前账号权限与飞书接口。命令选项以 `--help` 为准。
|
|
29
|
+
|
|
30
|
+
分享日程会向指定会话发送信息;创建、修改或删除日程可能通知参与人;`--no-notify` 请求不通知,具体行为由飞书决定。不要推断用户已授权邀请其他人或修改共享权限。写入返回 `submitted_unconfirmed`、`EFFECT_UNKNOWN` 或部分成功时,先查询实际状态,不盲目重试。
|
package/src/agent-broker.js
CHANGED
|
@@ -11,6 +11,11 @@ import { handleFileRequest, brokerUpload, brokerDownload } from './agent-files.j
|
|
|
11
11
|
// An explicit mapping prevents callers from reaching arbitrary object methods.
|
|
12
12
|
const routes = {
|
|
13
13
|
status: ['client', 'status', 'global'], search: ['client', 'search', 'global'],
|
|
14
|
+
'calendars': ['calendar','calendars','global'], 'calendar-search': ['calendar','searchCalendars','global'],
|
|
15
|
+
'calendar-events': ['calendar','events','global'], 'event-get': ['calendar','event','global'], 'calendar-rooms': ['calendar','rooms','global'],
|
|
16
|
+
'event-create': ['calendar','createEvent','global'], 'event-update': ['calendar','updateEvent','global'], 'event-delete': ['calendar','deleteEvent','global'],
|
|
17
|
+
'event-share': ['calendar','share','allChats'], 'event-reply': ['calendar','reply','global'], 'calendar-create': ['calendar','createCalendar','global'], 'calendar-update': ['calendar','updateCalendar','global'],
|
|
18
|
+
'calendar-delete': ['calendar','deleteCalendar','global'], 'calendar-subscribe': ['calendar','subscription','global'], 'calendar-unsubscribe': ['calendar','subscription','global'],
|
|
14
19
|
'group-query': ['feeds', 'query', 'allChats'],
|
|
15
20
|
'task-center': ['tasks', 'center', 'global'], 'tasks-list': ['tasks', 'list', 'global'],
|
|
16
21
|
'task-search': ['tasks', 'search', 'global'], 'task-get': ['tasks', 'get', 'global'],
|
|
@@ -50,7 +55,7 @@ const routes = {
|
|
|
50
55
|
const writes = new Set(['send', 'pin', 'unpin', 'mark', 'unmark', 'mute', 'unmute', 'done', 'inbox', 'box', 'unbox', 'read', 'unread',
|
|
51
56
|
'label-create', 'label-rename', 'label-delete', 'label-add', 'label-remove', 'chat-open', 'group-create', 'group-invite',
|
|
52
57
|
'group-update', 'group-dissolve', 'group-bot-protection', 'message-edit', 'message-forward', 'message-recall', 'favorite-add',
|
|
53
|
-
'favorite-remove', 'reaction-add', 'reaction-remove', 'minutes-request-access', 'send-file', 'send-image', 'sidebar-set', 'task-create', 'task-update', 'task-complete', 'task-reopen', 'task-delete']);
|
|
58
|
+
'favorite-remove', 'reaction-add', 'reaction-remove', 'minutes-request-access', 'send-file', 'send-image', 'sidebar-set', 'task-create', 'task-update', 'task-complete', 'task-reopen', 'task-delete', 'event-create', 'event-update', 'event-delete', 'event-share', 'event-reply', 'calendar-create', 'calendar-update', 'calendar-delete', 'calendar-subscribe', 'calendar-unsubscribe']);
|
|
54
59
|
|
|
55
60
|
export function brokerCommands() {
|
|
56
61
|
return Object.entries(routes).map(([command, [, , scope]]) => ({ command,
|
|
@@ -122,6 +127,7 @@ export function authorize(policy, request) {
|
|
|
122
127
|
const args = request.args;
|
|
123
128
|
const chatAllowed = id => numeric(id) && (policy.allowAllChats || policy.chatIds.includes(id));
|
|
124
129
|
if (scope === 'global' && !policy.allowGlobal) denied();
|
|
130
|
+
if (['calendar-subscribe', 'calendar-unsubscribe'].includes(request.command) && (args.length !== 1 || !object(args[0]) || args[0].subscribe !== (request.command === 'calendar-subscribe'))) denied();
|
|
125
131
|
if (['task-complete', 'task-reopen'].includes(request.command) && (args.length !== 1 || !object(args[0]) || args[0].completed !== (request.command === 'task-complete'))) denied();
|
|
126
132
|
if (['allChats', 'labelTrue', 'labelFalse', 'reactionAdd', 'reactionRemove'].includes(scope) && (!policy.allowGlobal || !policy.allowAllChats)) denied();
|
|
127
133
|
if (scope === 'allMinutes' && (!policy.allowGlobal || !policy.allowAllMinutes)) denied();
|
package/src/calendar.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import rrule from 'rrule';
|
|
3
|
+
import { FeishuError } from './errors.js';
|
|
4
|
+
const { RRule } = rrule;
|
|
5
|
+
const defaultTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC';
|
|
6
|
+
const fail = message => { throw new FeishuError('INVALID_ARGUMENT', message); };
|
|
7
|
+
const object = v => v && typeof v === 'object' && !Array.isArray(v);
|
|
8
|
+
const requireId = v => { if (typeof v !== 'string' || !v || v.length > 512) fail('An identifier is required.'); return v; };
|
|
9
|
+
export function epoch(value) {
|
|
10
|
+
if (typeof value !== 'string' && typeof value !== 'number') fail('A date or Unix timestamp is required.');
|
|
11
|
+
const s = String(value); let n;
|
|
12
|
+
if (/^\d+$/.test(s)) n = Number(s); else { if (!/(Z|[+-]\d\d:\d\d)$/i.test(s)) fail('Use an ISO date-time with an explicit timezone, or Unix seconds.'); n = Date.parse(s) / 1000; }
|
|
13
|
+
if (!Number.isSafeInteger(n) || n < 0) fail('Invalid time.'); return n;
|
|
14
|
+
}
|
|
15
|
+
function validate(type, data, path = 'input') {
|
|
16
|
+
if (!object(data)) fail(`${path} must be an object.`); type.resolveAll();
|
|
17
|
+
for (const [key,value] of Object.entries(data)) {
|
|
18
|
+
const f = type.fields[key]; if (!f) fail(`Unknown field ${path}.${key}.`);
|
|
19
|
+
const check = v => { if (f.resolvedType?.fields) validate(f.resolvedType,v,`${path}.${key}`);
|
|
20
|
+
else if (f.resolvedType?.values && !(typeof v === 'string' && Object.hasOwn(f.resolvedType.values,v)) && !(Number.isInteger(v) && Object.values(f.resolvedType.values).includes(v))) fail(`Invalid ${path}.${key}.`); };
|
|
21
|
+
if (f.map) { if (!object(value)) fail(`${path}.${key} must be an object.`); Object.values(value).forEach(check); }
|
|
22
|
+
else if (f.repeated) { if (!Array.isArray(value)) fail(`${path}.${key} must be an array.`); value.forEach(check); }
|
|
23
|
+
else check(value);
|
|
24
|
+
}
|
|
25
|
+
const err = type.verify(type.fromObject(data)); if (err) fail(`${path}: ${err}`);
|
|
26
|
+
}
|
|
27
|
+
function localAsUtc(seconds, zone) {
|
|
28
|
+
const parts = new Intl.DateTimeFormat('en-US', { timeZone: zone, year:'numeric',month:'2-digit',day:'2-digit',hour:'2-digit',minute:'2-digit',second:'2-digit',hourCycle:'h23' }).formatToParts(new Date(seconds*1000));
|
|
29
|
+
const d = Object.fromEntries(parts.map(x => [x.type,x.value])); return new Date(Date.UTC(+d.year,+d.month-1,+d.day,+d.hour,+d.minute,+d.second));
|
|
30
|
+
}
|
|
31
|
+
function wallToEpoch(wall, zone) {
|
|
32
|
+
let guess=wall.getTime(); const target=wall.getTime();
|
|
33
|
+
for(let i=0;i<4;i++){const delta=target-localAsUtc(guess/1000,zone).getTime();if(!delta)return Math.floor(guess/1000);guess+=delta;}
|
|
34
|
+
if(localAsUtc(guess/1000,zone).getTime()!==target)throw Error('Nonexistent local time');return Math.floor(guess/1000);
|
|
35
|
+
}
|
|
36
|
+
export function expandEvents(events, from, to) {
|
|
37
|
+
const out = [], warnings = [], exceptions = new Map();
|
|
38
|
+
for (const e of events) if (Number(e.originalTime) > 0) exceptions.set(`${e.calendarId}\0${e.key}\0${e.originalTime}`,e);
|
|
39
|
+
for (const e of events) {
|
|
40
|
+
if (e.isDeleted || e.status === 3) continue;
|
|
41
|
+
const start = Number(e.startTime), end = Number(e.endTime), duration = Math.max(0,end-start);
|
|
42
|
+
if (!e.rrule) { if (start < to && end > from) out.push({ event:e, startTime:String(start), endTime:String(end), recurring:false }); continue; }
|
|
43
|
+
try {
|
|
44
|
+
if (!Number.isSafeInteger(start) || !Number.isSafeInteger(end) || !e.startTimezone) throw Error();
|
|
45
|
+
const options = RRule.parseString(e.rrule.replace(/^RRULE:/i,'')); options.dtstart = localAsUtc(start,e.startTimezone);
|
|
46
|
+
const until = options.until ? Math.floor(options.until.getTime()/1000) : null; if (until != null) options.until=localAsUtc(until,e.startTimezone);
|
|
47
|
+
const dates = new RRule(options).between(new Date((from-duration-172800)*1000),new Date((to+172800)*1000),true,(_date,index)=>index<10000);
|
|
48
|
+
if (dates.length >= 10000) throw Error();
|
|
49
|
+
for (const date of dates) { const t = wallToEpoch(date,e.startTimezone); if ((until != null && t>until) || t < start || t >= to || t+duration <= from || exceptions.has(`${e.calendarId}\0${e.key}\0${t}`)) continue;
|
|
50
|
+
out.push({ event:e, startTime:String(t), endTime:String(t+duration), recurring:true, originalTime:String(t) }); }
|
|
51
|
+
} catch { warnings.push({ code:'RECURRENCE_UNEXPANDED', eventId:e.id, calendarId:e.calendarId }); }
|
|
52
|
+
}
|
|
53
|
+
out.sort((a,b)=>Number(a.startTime)-Number(b.startTime)); return { items:out, warnings };
|
|
54
|
+
}
|
|
55
|
+
export class Calendar {
|
|
56
|
+
constructor(gateway) { this.gateway=gateway; }
|
|
57
|
+
async call(command,type,body,response,write=false,operation='calendar') {
|
|
58
|
+
const r=await this.gateway.call(command,type,body,{mutating:write,operation});
|
|
59
|
+
return this.gateway.decode(response,r.packet.payload || new Uint8Array());
|
|
60
|
+
}
|
|
61
|
+
async calendars({ maxPages=20 }={}) {
|
|
62
|
+
if (!Number.isInteger(maxPages)||maxPages<1||maxPages>100) fail('Invalid calendar page count.');
|
|
63
|
+
let token='',items=[],seen=new Set(),more=false;
|
|
64
|
+
for(let i=0;i<maxPages;i++){let r=await this.call(1001001,'calendar_web.ListCalendarsRequest',{pageSize:200,...(token?{syncToken:token}:{})},'calendar_web.ListCalendarsResponse');
|
|
65
|
+
if(!r)throw new FeishuError('INVALID_RESPONSE','Calendars were not returned.'); items.push(...r.calendars.filter(x=>!x.isDeleted)); more=r.hasMore;
|
|
66
|
+
if(!more){token='';break}if(!r.nextSyncToken||seen.has(r.nextSyncToken))throw new FeishuError('PAGINATION_INCOMPLETE','Calendar pagination could not advance.');token=r.nextSyncToken;seen.add(token);}
|
|
67
|
+
return {items,complete:!more,nextCursor:token||null};
|
|
68
|
+
}
|
|
69
|
+
async searchCalendars({query,offset=0,count=20}={}) { if(typeof query!=='string'||!query.trim()||!Number.isInteger(offset)||offset<0||!Number.isInteger(count)||count<1||count>100)fail('Invalid calendar search.');
|
|
70
|
+
let r=await this.call(1000017,'calendars.MultiCalendarSearchRequest',{query,offset,count,needSearchMeetingRoom:true,needSearchSharedCalendar:true,needSearchPrimaryCalendar:true},'calendars.MultiCalendarSearchResponse'); if(!r)throw new FeishuError('INVALID_RESPONSE','Calendar search was not returned.'); return {items:r.contents,calendarBriefMap:r.calendarBriefMap,calendarChatterMap:r.calendarChatterMap,chatterMap:r.chatterMap}; }
|
|
71
|
+
async rooms({start,end,query='',count=50,cursor=0,timezone=defaultTimezone,rrule}={}) {start=epoch(start);end=epoch(end);if(end<=start||typeof query!=='string'||!Number.isInteger(count)||count<1||count>100||!Number.isInteger(cursor)||cursor<0)fail('Invalid room search.');
|
|
72
|
+
let r=await this.call(1000016,'calendar_events.SearchMeetingRoomsRequest',{startTime:String(start),endTime:String(end),keyword:query,count,cursor,startTimezone:timezone,...(rrule?{rrule}:{})},'calendar_events.SearchMeetingRoomsResponse');if(!r)throw new FeishuError('INVALID_RESPONSE','Meeting rooms were not returned.');return {items:r.buildings,hasMore:r.hasMore,nextCursor:r.hasMore?r.cursor:null}; }
|
|
73
|
+
async events({start,end,calendarIds=[],allCalendars=false,maxPages=20}={}) {
|
|
74
|
+
let from=epoch(start),to=epoch(end);if(to<=from||to-from>366*86400||!Array.isArray(calendarIds)||!Number.isInteger(maxPages)||maxPages<1||maxPages>100)fail('Use a valid range of at most 366 days.');
|
|
75
|
+
let cal=await this.calendars();if(!cal.complete)throw new FeishuError('PAGINATION_INCOMPLETE','Calendar list is incomplete.');
|
|
76
|
+
let ids=calendarIds.length?calendarIds.map(requireId):cal.items.filter(x=>allCalendars||x.isPrimary).map(x=>x.id);if(!ids.length)throw new FeishuError('NOT_FOUND','No selected calendar was found.');
|
|
77
|
+
let events=[],pending=ids.map(calendarId=>({calendarId,timeMin:String(from),timeMax:String(to),pageSize:200,filters:{maxAttendeesCountPerEvent:100,needsReminders:true,needsDescription:true,maxResourcesCountPerEvent:100}})),seen=new Set();
|
|
78
|
+
for(let i=0;i<maxPages&&pending.length;i++){let r=await this.call(1002001,'calendar_web.ListCalendarEventsRequest',{params:pending},'calendar_web.ListCalendarEventsResponse');if(!r)throw new FeishuError('INVALID_RESPONSE','Calendar events were not returned.');let next=[];
|
|
79
|
+
for(const p of pending){let result=r.results[p.calendarId];if(!result)throw new FeishuError('INVALID_RESPONSE','A selected calendar was omitted.');events.push(...result.calendarEvents);if(result.nextPageToken){const k=p.calendarId+'\0'+result.nextPageToken;if(seen.has(k))throw new FeishuError('PAGINATION_INCOMPLETE','Event pagination repeated its cursor.');seen.add(k);next.push({...p,pageToken:result.nextPageToken})}}pending=next;}
|
|
80
|
+
let expanded=expandEvents(events,from,to);return {...expanded,series:events.filter(e=>e.rrule),complete:pending.length===0,remainingCalendars:pending.map(x=>x.calendarId),range:{start:String(from),end:String(to)}};
|
|
81
|
+
}
|
|
82
|
+
async event({eventId}) { let r=await this.call(1002006,'calendar_web.MGetEventsWithIdsRequest',{ids:[requireId(eventId)]},'calendar_web.MGetEventsWithIdsResponse');let event=r?.events?.[eventId]||Object.values(r?.events||{}).find(x=>x.id===eventId);if(!event)throw new FeishuError('NOT_FOUND','Event not found or inaccessible.');return {event}; }
|
|
83
|
+
async attendees({users=[],groups=[],calendars=[]}={}) { if(![users,groups,calendars].every(Array.isArray))fail('Invalid attendees.');let items=[];
|
|
84
|
+
for(const [values,cmd,req,res,key,param] of [[users,1002008,'GetUserAttendeesByUserIdsRequest','GetUserAttendeesByUserIdsResponse','userAttendees','userIds'],[groups,1002007,'GetGroupAttendeesByGroupIdsRequest','GetGroupAttendeesByGroupIdsResponse','groupAttendees','groupIds'],[calendars,1002009,'GetAttendeesByCalendarIdsRequest','GetAttendeesByCalendarIdsResponse','attendees','calendarIds']])if(values.length){values.forEach(requireId);let r=await this.call(cmd,`calendar_web.${req}`,{[param]:values},`calendar_web.${res}`);if(!r)throw new FeishuError('INVALID_RESPONSE','Attendees could not be resolved.');for(const id of values){if(!r[key]?.[id])throw new FeishuError('NOT_FOUND','An attendee could not be resolved.');items.push(r[key][id]);}}
|
|
85
|
+
return {items}; }
|
|
86
|
+
async createEvent({input={},title,start,end,calendarId,timezone=defaultTimezone,description,allDay,repeat,users=[],groups=[],rooms=[],notify=true}={}) {
|
|
87
|
+
if(!object(input))fail('Event input must be an object.'); await this.gateway.authenticate();await this.gateway.ensureCalendarProto();
|
|
88
|
+
if(!calendarId){const c=await this.calendars();calendarId=c.items.find(x=>x.isPrimary)?.id}requireId(calendarId);
|
|
89
|
+
let event={...input,id:'0',key:input.key||randomUUID(),calendarId,organizerCalendarId:input.organizerCalendarId||calendarId,creatorCalendarId:input.creatorCalendarId||calendarId,source:1,status:input.status||2,selfAttendeeStatus:2};
|
|
90
|
+
if(title!=null)event.summary=title;if(description!=null)event.description=description;if(start!=null)event.startTime=String(epoch(start));if(end!=null)event.endTime=String(epoch(end));if(allDay!=null)event.isAllDay=allDay;if(repeat!=null)event.rrule=repeat;
|
|
91
|
+
event.startTimezone=event.startTimezone||timezone;event.endTimezone=event.endTimezone||timezone;
|
|
92
|
+
if(!event.summary||Number(event.endTime)<=Number(event.startTime)||!Number.isSafeInteger(Number(event.startTime))||!Number.isSafeInteger(Number(event.endTime)))fail('A title and valid start/end are required.');
|
|
93
|
+
if(users.length||groups.length||rooms.length) event.attendees=[...(event.attendees||[]),...(await this.attendees({users,groups,calendars:rooms})).items];
|
|
94
|
+
validate(this.gateway.calendarProto.lookupType('calendar_entities.WebCalendarEvent'),event);
|
|
95
|
+
await this.call(1002003,'calendar_web.CreateEventRequest',{event,notificationType:notify?1:2},'calendar_web.CreateEventResponse',true,'event-create');
|
|
96
|
+
return {status:'submitted_unconfirmed',calendarId,key:event.key,startTime:String(event.startTime),endTime:String(event.endTime)};
|
|
97
|
+
}
|
|
98
|
+
async updateEvent({eventId,patch={},span=0,instanceStart,notify=true,addUsers=[],removeUsers=[],addGroups=[],removeGroups=[],addRooms=[],removeRooms=[]}={}) {
|
|
99
|
+
if(!object(patch)||!Number.isInteger(span)||span<0||span>3)fail('Invalid event update.');const current=(await this.event({eventId})).event;
|
|
100
|
+
let type=this.gateway.calendarProto.lookupType('calendar_entities.WebCalendarEvent'),data=type.toObject(current,{longs:String,enums:Number,bytes:String});
|
|
101
|
+
for(const k of ['id','key','calendarId','creatorCalendarId','organizerCalendarId','originalTime','source','status','isDeleted','selfAttendeeStatus'])if(Object.hasOwn(patch,k))fail(`Cannot change event identity field ${k}.`);
|
|
102
|
+
const memberLists=[addUsers,removeUsers,addGroups,removeGroups,addRooms,removeRooms];if(!memberLists.every(Array.isArray))fail('Attendee changes must be arrays.');
|
|
103
|
+
if(memberLists.some(x=>x.length)&&Object.hasOwn(patch,'attendees'))fail('Do not combine attendee replacement with add/remove options.');
|
|
104
|
+
if(memberLists.some(x=>x.length)){
|
|
105
|
+
let attendees=[...(data.attendees||[])];
|
|
106
|
+
for(const [ids,match] of [[removeUsers,x=>x.user?.userId],[removeGroups,x=>x.group?.groupId],[removeRooms,x=>x.attendeeCalendarId]])for(const id of ids){requireId(id);let index=attendees.findIndex(x=>match(x)===id);if(index<0)fail('An attendee to remove was not found.');attendees.splice(index,1);}
|
|
107
|
+
if(addUsers.length||addGroups.length||addRooms.length)attendees.push(...(await this.attendees({users:addUsers,groups:addGroups,calendars:addRooms})).items);
|
|
108
|
+
patch={...patch,attendees};
|
|
109
|
+
}
|
|
110
|
+
let event={...data,...patch}; if (patch.startTime != null) event.startTime=String(epoch(patch.startTime)); if (patch.endTime != null) event.endTime=String(epoch(patch.endTime)); validate(type,event);if(Number(event.endTime)<=Number(event.startTime))fail('End must be after start.');
|
|
111
|
+
await this.call(1002004,'calendar_web.UpdateEventRequest',{event,span, ...(instanceStart!=null?{instanceStartTime:String(epoch(instanceStart))}:{}),notificationType:notify?1:2},'calendar_web.UpdateEventResponse',true,'event-update');return {status:'submitted_unconfirmed',eventId};
|
|
112
|
+
}
|
|
113
|
+
async deleteEvent({eventId,span=0,instanceStart,notify=true}={}) {if(!Number.isInteger(span)||span<0||span>3)fail('Invalid event span.');let {event}=await this.event({eventId});
|
|
114
|
+
await this.call(1002005,'calendar_web.DeleteEventRequest',{calendarId:event.calendarId,key:event.key,originalTime:String(event.originalTime||0),span,instanceStartTime:String(instanceStart!=null?epoch(instanceStart):event.startTime),notificationType:notify?1:2},'calendar_web.DeleteEventResponse',true,'event-delete');return {status:'submitted_unconfirmed',eventId}; }
|
|
115
|
+
async share({eventId,chatIds=[]}={}) { if(!Array.isArray(chatIds)||!chatIds.length||chatIds.some(id=>typeof id!=='string'||!/^\d{1,19}$/.test(id)))fail('At least one numeric chat ID is required.');let {event}=await this.event({eventId});
|
|
116
|
+
let r=await this.call(1002012,'calendar_web.ShareCalendarEventRequest',{chatIds,calendarId:event.calendarId,key:event.key,originalTime:String(event.originalTime||0)},'calendar_web.ShareCalendarEventResponse',true,'event-share');return {status:r.sharedFailedChats?.length?'partially_rejected':'submitted_unconfirmed',eventId,failedChats:(r.sharedFailedChats||[]).map(String)}; }
|
|
117
|
+
async reply({eventId,response,comment,quitMeeting=false}={}) {let replyType={accept:1,decline:2,tentative:3}[response];if(!replyType)fail('Invalid invitation response.');let {event}=await this.event({eventId});
|
|
118
|
+
await this.call(1020002,'calendar_events.ReplyCalendarEventInvitationRequest',{calendarEventKey:{uniqueKey:event.key,calendarId:event.calendarId,originalTime:String(event.originalTime||0)},replyType,quitMeeting,...(comment?{rsvpCommentInfo:{comment}}:{})},'calendar_events.ReplyCalendarEventInvitationResponse',true,'event-reply');return {status:'submitted_unconfirmed',eventId,response}; }
|
|
119
|
+
async createCalendar({input={},name,description,timezone=defaultTimezone}={}) {if(!object(input))fail('Calendar input must be an object.');let u=await this.gateway.authenticate();await this.gateway.ensureCalendarProto();let calendar={...input,creatorUserId:u.id,defaultTimezone:input.defaultTimezone||timezone,defaultAccessRole:input.defaultAccessRole??1,visibilityProperty:input.visibilityProperty??32};if(name!=null)calendar.summary=name;if(description!=null)calendar.description=description;if(!calendar.summary)fail('Calendar name is required.');validate(this.gateway.calendarProto.lookupType('calendar_entities.WebCalendar'),calendar);
|
|
120
|
+
await this.call(1001004,'calendar_web.CreateCalendarRequest',{calendar},'calendar_web.CreateCalendarResponse',true,'calendar-create');return {status:'submitted_unconfirmed',name:calendar.summary}; }
|
|
121
|
+
async updateCalendar({calendarId,patch={}}={}) {requireId(calendarId);if(!object(patch)||['id','creatorUserId','isPrimary','type'].some(k=>Object.hasOwn(patch,k)))fail('Invalid calendar patch.');let found=(await this.calendars()).items.find(x=>x.id===calendarId);if(!found)throw new FeishuError('NOT_FOUND','Calendar not found.');let type=this.gateway.calendarProto.lookupType('calendar_entities.WebCalendar'),calendar={...type.toObject(found,{longs:String,enums:Number,bytes:String}),...patch};validate(type,calendar);await this.call(1001006,'calendar_web.UpdateCalendarRequest',{calendar},'calendar_web.UpdateCalendarResponse',true,'calendar-update');return {status:'submitted_unconfirmed',calendarId}; }
|
|
122
|
+
async deleteCalendar({calendarId}={}) {requireId(calendarId);let found=(await this.calendars()).items.find(x=>x.id===calendarId);if(!found||found.isPrimary)fail('Cannot delete the primary or an unknown calendar.');await this.call(1001005,'calendar_web.DeleteCalendarRequest',{calendarId},'calendar_web.DeleteCalendarResponse',true,'calendar-delete');return {status:'submitted_unconfirmed',calendarId}; }
|
|
123
|
+
async subscription({calendarId,subscribe}={}) {requireId(calendarId);if(typeof subscribe!=='boolean')fail('Invalid subscription.');let r=await this.call(subscribe?1001002:1001003,`calendar_web.Batch${subscribe?'Subscribe':'Unsubscribe'}CalendarsRequest`,{calendarIds:[calendarId],...(subscribe?{visibilityMask:[32]}:{}),subscriptionMask:[1]},`calendar_web.Batch${subscribe?'Subscribe':'Unsubscribe'}CalendarsResponse`,true,subscribe?'calendar-subscribe':'calendar-unsubscribe');
|
|
124
|
+
if(!r)return {status:'submitted_unconfirmed',calendarId};let rejected=subscribe?!!r.normalViewFailedCalendarIdErrCodeMap?.[calendarId]:r.failedCalendarIds.includes(calendarId);return {status:rejected?'rejected':'submitted',calendarId}; }
|
|
125
|
+
}
|
package/src/gateway.js
CHANGED
|
@@ -5,6 +5,8 @@ import { readFile } from 'node:fs/promises';
|
|
|
5
5
|
import { FeishuError } from './errors.js';
|
|
6
6
|
|
|
7
7
|
const protoFile = fileURLToPath(new URL('../proto/lark.proto', import.meta.url));
|
|
8
|
+
const calendarProtoFile = fileURLToPath(new URL('../proto/calendar-schema.json', import.meta.url));
|
|
9
|
+
let calendarProtoPromise;
|
|
8
10
|
const todoProtoFile = fileURLToPath(new URL('../proto/todo-schema.json', import.meta.url));
|
|
9
11
|
let todoProtoPromise;
|
|
10
12
|
const defaults = {
|
|
@@ -107,7 +109,7 @@ export class Gateway {
|
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
encode(name, data) {
|
|
110
|
-
const type = (name.startsWith('todo.') || name.startsWith('todo_entities.') ? this.todoProto : this.proto).lookupType(name);
|
|
112
|
+
const type = (/^(calendar_web|calendar_events|calendar_entities|calendars)\./.test(name) ? this.calendarProto : name.startsWith('todo.') || name.startsWith('todo_entities.') ? this.todoProto : this.proto).lookupType(name);
|
|
111
113
|
const message = type.fromObject(data);
|
|
112
114
|
const error = type.verify(message);
|
|
113
115
|
if (error) throw new FeishuError('PROTOCOL_INPUT_INVALID', `Invalid ${name} payload.`);
|
|
@@ -115,7 +117,7 @@ export class Gateway {
|
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
decode(name, bytes) {
|
|
118
|
-
return (name.startsWith('todo.') || name.startsWith('todo_entities.') ? this.todoProto : this.proto).lookupType(name).decode(bytes);
|
|
120
|
+
return (/^(calendar_web|calendar_events|calendar_entities|calendars)\./.test(name) ? this.calendarProto : name.startsWith('todo.') || name.startsWith('todo_entities.') ? this.todoProto : this.proto).lookupType(name).decode(bytes);
|
|
119
121
|
}
|
|
120
122
|
|
|
121
123
|
async uploadRequest(path, body, contentType) {
|
|
@@ -160,9 +162,16 @@ export class Gateway {
|
|
|
160
162
|
return this.todoProto;
|
|
161
163
|
}
|
|
162
164
|
|
|
165
|
+
async ensureCalendarProto() {
|
|
166
|
+
calendarProtoPromise ||= readFile(calendarProtoFile, 'utf8').then(text => protobuf.Root.fromJSON(JSON.parse(text)));
|
|
167
|
+
this.calendarProto = await calendarProtoPromise;
|
|
168
|
+
return this.calendarProto;
|
|
169
|
+
}
|
|
170
|
+
|
|
163
171
|
async call(command, requestType, body, { version = '2.7.0', mutating = false, operation } = {}) {
|
|
164
172
|
await this.authenticate();
|
|
165
173
|
if (requestType.startsWith('todo.')) await this.ensureTodoProto();
|
|
174
|
+
if (/^(calendar_web|calendar_events|calendar_entities|calendars)\./.test(requestType)) await this.ensureCalendarProto();
|
|
166
175
|
const requestId = randomUUID();
|
|
167
176
|
const packet = this.encode('Packet', {
|
|
168
177
|
payloadType: 1, cmd: command, cid: requestId,
|