lansenger-sdk-ts 1.0.0
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/LICENSE +21 -0
- package/README.fr.md +501 -0
- package/README.md +504 -0
- package/README.zhHans.md +501 -0
- package/README.zhHant.md +501 -0
- package/README.zhHantHK.md +501 -0
- package/dist/accountMessages.d.ts +12 -0
- package/dist/accountMessages.js +41 -0
- package/dist/auth.d.ts +13 -0
- package/dist/auth.js +70 -0
- package/dist/calendars.d.ts +84 -0
- package/dist/calendars.js +278 -0
- package/dist/callbacks.d.ts +384 -0
- package/dist/callbacks.js +712 -0
- package/dist/chats.d.ts +22 -0
- package/dist/chats.js +88 -0
- package/dist/client.d.ts +439 -0
- package/dist/client.js +712 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.js +42 -0
- package/dist/constants.d.ts +30 -0
- package/dist/constants.js +187 -0
- package/dist/contacts.d.ts +38 -0
- package/dist/contacts.js +161 -0
- package/dist/departments.d.ts +18 -0
- package/dist/departments.js +69 -0
- package/dist/exceptions.d.ts +20 -0
- package/dist/exceptions.js +42 -0
- package/dist/groupMessages.d.ts +11 -0
- package/dist/groupMessages.js +39 -0
- package/dist/groups.d.ts +66 -0
- package/dist/groups.js +218 -0
- package/dist/http.d.ts +7 -0
- package/dist/http.js +67 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +189 -0
- package/dist/media.d.ts +16 -0
- package/dist/media.js +178 -0
- package/dist/models.d.ts +925 -0
- package/dist/models.js +991 -0
- package/dist/oauth.d.ts +17 -0
- package/dist/oauth.js +107 -0
- package/dist/persistence.d.ts +26 -0
- package/dist/persistence.js +210 -0
- package/dist/reminders.d.ts +10 -0
- package/dist/reminders.js +31 -0
- package/dist/streaming.d.ts +9 -0
- package/dist/streaming.js +40 -0
- package/dist/todos.d.ts +75 -0
- package/dist/todos.js +282 -0
- package/dist/urlHelpers.d.ts +7 -0
- package/dist/urlHelpers.js +22 -0
- package/dist/userMessages.d.ts +8 -0
- package/dist/userMessages.js +34 -0
- package/dist/users.d.ts +6 -0
- package/dist/users.js +32 -0
- package/package.json +33 -0
package/dist/chats.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LansengerConfig } from "./config";
|
|
2
|
+
import { FetchFn } from "./http";
|
|
3
|
+
import { ChatListResult, ChatMessagesResult } from "./models";
|
|
4
|
+
export declare function fetchChatList(config: LansengerConfig, appToken: string, opts?: {
|
|
5
|
+
chat_type?: number;
|
|
6
|
+
keyword?: string;
|
|
7
|
+
start_time?: number;
|
|
8
|
+
end_time?: number;
|
|
9
|
+
user_token?: string;
|
|
10
|
+
fetchFn?: FetchFn;
|
|
11
|
+
}): Promise<ChatListResult>;
|
|
12
|
+
export declare function fetchChatMessages(config: LansengerConfig, appToken: string, opts?: {
|
|
13
|
+
staff_id?: string;
|
|
14
|
+
group_id?: string;
|
|
15
|
+
page_size?: number;
|
|
16
|
+
base_version?: string;
|
|
17
|
+
start_time?: number;
|
|
18
|
+
end_time?: number;
|
|
19
|
+
sender_id?: string;
|
|
20
|
+
user_token?: string;
|
|
21
|
+
fetchFn?: FetchFn;
|
|
22
|
+
}): Promise<ChatMessagesResult>;
|
package/dist/chats.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchChatList = fetchChatList;
|
|
4
|
+
exports.fetchChatMessages = fetchChatMessages;
|
|
5
|
+
const urlHelpers_1 = require("./urlHelpers");
|
|
6
|
+
const http_1 = require("./http");
|
|
7
|
+
const models_1 = require("./models");
|
|
8
|
+
async function fetchChatList(config, appToken, opts) {
|
|
9
|
+
const userToken = opts?.user_token || "";
|
|
10
|
+
const url = (0, urlHelpers_1.buildApiUrl)(config, "chats", "fetch", appToken, { userToken });
|
|
11
|
+
const payload = {};
|
|
12
|
+
if (opts?.chat_type)
|
|
13
|
+
payload.chatType = opts.chat_type;
|
|
14
|
+
if (opts?.keyword)
|
|
15
|
+
payload.keyword = opts.keyword;
|
|
16
|
+
if (opts?.start_time)
|
|
17
|
+
payload.startTime = opts.start_time;
|
|
18
|
+
if (opts?.end_time)
|
|
19
|
+
payload.endTime = opts.end_time;
|
|
20
|
+
const [data, httpErr] = await (0, http_1.doPost)(url, payload, opts?.fetchFn);
|
|
21
|
+
if (httpErr)
|
|
22
|
+
return new models_1.ChatListResult({ success: false, error: httpErr });
|
|
23
|
+
const errCode = data.errCode ?? -1;
|
|
24
|
+
if (errCode !== 0) {
|
|
25
|
+
const msg = data.errMsg || "Unknown error";
|
|
26
|
+
return new models_1.ChatListResult({ success: false, error: `API error (errCode=${errCode}): ${msg}` });
|
|
27
|
+
}
|
|
28
|
+
const rd = data.data || {};
|
|
29
|
+
const staffInfos = [];
|
|
30
|
+
for (const si of (rd.staffIdInfos || [])) {
|
|
31
|
+
staffInfos.push(new models_1.ChatStaffInfo({
|
|
32
|
+
staff_id: si.staffId || "", staff_name: si.staffName || "",
|
|
33
|
+
sector_names: si.sectorName || si.sectorNames,
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
const groupInfos = [];
|
|
37
|
+
for (const gi of (rd.groupIdInfos || [])) {
|
|
38
|
+
groupInfos.push(new models_1.ChatGroupInfo({ group_id: gi.groupId || "", group_name: gi.groupName || "" }));
|
|
39
|
+
}
|
|
40
|
+
return new models_1.ChatListResult({ success: true, staff_infos: staffInfos, group_infos: groupInfos, raw_response: data });
|
|
41
|
+
}
|
|
42
|
+
async function fetchChatMessages(config, appToken, opts) {
|
|
43
|
+
if (!opts?.staff_id && !opts?.group_id)
|
|
44
|
+
return new models_1.ChatMessagesResult({ success: false, error: "staff_id or group_id is required" });
|
|
45
|
+
const userToken = opts?.user_token || "";
|
|
46
|
+
const pageSize = opts?.page_size || 100;
|
|
47
|
+
const baseVersion = opts?.base_version || "0";
|
|
48
|
+
let url = (0, urlHelpers_1.buildApiUrl)(config, "chats", "messages_fetch", appToken, { userToken })
|
|
49
|
+
+ `&page_size=${pageSize}`;
|
|
50
|
+
if (baseVersion)
|
|
51
|
+
url += `&base_version=${baseVersion}`;
|
|
52
|
+
const payload = {};
|
|
53
|
+
if (opts?.staff_id)
|
|
54
|
+
payload.staffId = opts.staff_id;
|
|
55
|
+
if (opts?.group_id)
|
|
56
|
+
payload.groupId = opts.group_id;
|
|
57
|
+
if (opts?.start_time)
|
|
58
|
+
payload.startTime = opts.start_time;
|
|
59
|
+
if (opts?.end_time)
|
|
60
|
+
payload.endTime = opts.end_time;
|
|
61
|
+
if (opts?.sender_id)
|
|
62
|
+
payload.senderId = opts.sender_id;
|
|
63
|
+
const [data, httpErr] = await (0, http_1.doPost)(url, payload, opts?.fetchFn);
|
|
64
|
+
if (httpErr)
|
|
65
|
+
return new models_1.ChatMessagesResult({ success: false, error: httpErr });
|
|
66
|
+
const errCode = data.errCode ?? -1;
|
|
67
|
+
if (errCode !== 0) {
|
|
68
|
+
const msg = data.errMsg || "Unknown error";
|
|
69
|
+
return new models_1.ChatMessagesResult({ success: false, error: `API error (errCode=${errCode}): ${msg}` });
|
|
70
|
+
}
|
|
71
|
+
const rd = data.data || {};
|
|
72
|
+
const messages = [];
|
|
73
|
+
for (const msgItem of (rd.messageList || [])) {
|
|
74
|
+
const msgInfoRaw = msgItem.messageInfo || msgItem.messageInfos || {};
|
|
75
|
+
const mi = Array.isArray(msgInfoRaw) && msgInfoRaw.length > 0 ? msgInfoRaw[0] : msgInfoRaw;
|
|
76
|
+
const content = mi.content || null;
|
|
77
|
+
messages.push(new models_1.ChatMessageInfo({
|
|
78
|
+
send_time: mi.sendTime || "", sender: mi.sender || "",
|
|
79
|
+
message_type: mi.messageType || "", content,
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
return new models_1.ChatMessagesResult({
|
|
83
|
+
success: true, has_more: rd.hasMore || false, total: rd.total || 0,
|
|
84
|
+
last_version: rd.lastVersion || "", name: rd.name || "",
|
|
85
|
+
chat_type: rd.chatType || "", messages, raw_response: data,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=chats.js.map
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
import { LansengerConfig } from "./config";
|
|
2
|
+
import { SendMessageResult, AppCardParams, LinkCardParams, OaCardParams, DynamicCardUpdateParams, QueryGroupsResult, DownloadMediaResult, UserTokenResult, UserInfoResult, StaffBasicInfoResult, StaffDetailResult, DepartmentAncestorsResult, StaffIdMappingResult, ExtraFieldIdsResult, OrgInfoResult, StaffSearchResult, BotMessageResult, AccountMessageResult, UserMessageResult, StreamMessageResult, CreateGroupResult, GroupInfoResult, GroupMemberResult, GroupListResult, IsInGroupResult, UpdateGroupResult, UpdateGroupMembersResult, DepartmentDetailResult, DepartmentChildrenResult, DepartmentStaffsResult, TodoTaskCreateResult, TodoTaskInfoResult, TodoTaskListResult, TodoTaskStatusCountResult, TodoTaskExecutorListResult, CalendarPrimaryResult, ScheduleCreateResult, ScheduleInfoResult, ScheduleUpdateResult, ScheduleListResult, ScheduleAttendeesResult, ScheduleAttendeeMetaResult, ChatListResult, ChatMessagesResult, MediaPathResult } from "./models";
|
|
3
|
+
import { CallbackEvent } from "./callbacks";
|
|
4
|
+
type AnyDict = Record<string, any>;
|
|
5
|
+
export declare class LansengerClient {
|
|
6
|
+
private _config;
|
|
7
|
+
private _fetchFn;
|
|
8
|
+
private _tokenManager;
|
|
9
|
+
private _store;
|
|
10
|
+
constructor(appId: string, appSecret: string, apiGatewayUrl?: string, passportUrl?: string, httpTimeout?: number, storePath?: string, encodingKey?: string, callbackToken?: string);
|
|
11
|
+
static fromEnv(storePath?: string): LansengerClient;
|
|
12
|
+
static fromConfig(config: LansengerConfig, storePath?: string): LansengerClient;
|
|
13
|
+
static fromStore(profile?: string, filePath?: string): LansengerClient;
|
|
14
|
+
get config(): LansengerConfig;
|
|
15
|
+
private _ensureInit;
|
|
16
|
+
getToken(): Promise<string>;
|
|
17
|
+
invalidateToken(): void;
|
|
18
|
+
healthCheck(): Promise<boolean>;
|
|
19
|
+
private _privateMsgUrl;
|
|
20
|
+
private _groupMsgUrl;
|
|
21
|
+
private _sendPrivate;
|
|
22
|
+
private _sendGroup;
|
|
23
|
+
sendText(chatId: string, content: string, opts?: {
|
|
24
|
+
file_path?: string;
|
|
25
|
+
media_type?: number;
|
|
26
|
+
cover_image_path?: string;
|
|
27
|
+
reminder_all?: boolean;
|
|
28
|
+
reminder_user_ids?: string[];
|
|
29
|
+
is_group?: boolean;
|
|
30
|
+
user_token?: string;
|
|
31
|
+
sender_id?: string;
|
|
32
|
+
}): Promise<SendMessageResult>;
|
|
33
|
+
sendMarkdown(chatId: string, content: string, opts?: {
|
|
34
|
+
reminder_all?: boolean;
|
|
35
|
+
reminder_user_ids?: string[];
|
|
36
|
+
is_group?: boolean;
|
|
37
|
+
user_token?: string;
|
|
38
|
+
sender_id?: string;
|
|
39
|
+
}): Promise<SendMessageResult>;
|
|
40
|
+
sendFile(chatId: string, filePath: string, opts?: {
|
|
41
|
+
caption?: string;
|
|
42
|
+
media_type?: number;
|
|
43
|
+
cover_image_path?: string;
|
|
44
|
+
is_group?: boolean;
|
|
45
|
+
user_token?: string;
|
|
46
|
+
sender_id?: string;
|
|
47
|
+
}): Promise<SendMessageResult>;
|
|
48
|
+
sendImageUrl(chatId: string, imageUrl: string, opts?: {
|
|
49
|
+
caption?: string;
|
|
50
|
+
is_group?: boolean;
|
|
51
|
+
user_token?: string;
|
|
52
|
+
sender_id?: string;
|
|
53
|
+
}): Promise<SendMessageResult>;
|
|
54
|
+
sendLinkCard(chatId: string, title: string, link: string, opts?: {
|
|
55
|
+
description?: string;
|
|
56
|
+
icon_link?: string;
|
|
57
|
+
pc_link?: string;
|
|
58
|
+
pad_link?: string;
|
|
59
|
+
from_name?: string;
|
|
60
|
+
from_icon_link?: string;
|
|
61
|
+
is_group?: boolean;
|
|
62
|
+
user_token?: string;
|
|
63
|
+
sender_id?: string;
|
|
64
|
+
}): Promise<SendMessageResult>;
|
|
65
|
+
sendLinkCardWithParams(params: LinkCardParams): Promise<SendMessageResult>;
|
|
66
|
+
sendAppArticles(chatId: string, articles: AnyDict[], opts?: {
|
|
67
|
+
is_group?: boolean;
|
|
68
|
+
user_token?: string;
|
|
69
|
+
sender_id?: string;
|
|
70
|
+
}): Promise<SendMessageResult>;
|
|
71
|
+
sendAppCard(chatId: string, bodyTitle: string, opts?: {
|
|
72
|
+
head_title?: string;
|
|
73
|
+
body_sub_title?: string;
|
|
74
|
+
body_content?: string;
|
|
75
|
+
signature?: string;
|
|
76
|
+
fields?: AnyDict[];
|
|
77
|
+
links?: AnyDict[];
|
|
78
|
+
card_link?: string;
|
|
79
|
+
pc_card_link?: string;
|
|
80
|
+
pad_card_link?: string;
|
|
81
|
+
is_dynamic?: boolean;
|
|
82
|
+
head_status_info?: AnyDict;
|
|
83
|
+
staff_id?: string;
|
|
84
|
+
head_icon_url?: string;
|
|
85
|
+
is_group?: boolean;
|
|
86
|
+
user_token?: string;
|
|
87
|
+
sender_id?: string;
|
|
88
|
+
}): Promise<SendMessageResult>;
|
|
89
|
+
sendAppCardWithParams(params: AppCardParams): Promise<SendMessageResult>;
|
|
90
|
+
sendOacard(chatId: string, title: string, opts?: {
|
|
91
|
+
head?: string;
|
|
92
|
+
sub_title?: string;
|
|
93
|
+
staff_id?: string;
|
|
94
|
+
fields?: AnyDict[];
|
|
95
|
+
link?: string;
|
|
96
|
+
pc_link?: string;
|
|
97
|
+
pad_link?: string;
|
|
98
|
+
card_action?: AnyDict;
|
|
99
|
+
is_group?: boolean;
|
|
100
|
+
user_token?: string;
|
|
101
|
+
sender_id?: string;
|
|
102
|
+
}): Promise<SendMessageResult>;
|
|
103
|
+
sendOacardWithParams(params: OaCardParams): Promise<SendMessageResult>;
|
|
104
|
+
updateDynamicCard(msgId: string, opts?: {
|
|
105
|
+
head_status_info?: AnyDict;
|
|
106
|
+
links?: AnyDict[];
|
|
107
|
+
is_last_update?: boolean;
|
|
108
|
+
}): Promise<SendMessageResult>;
|
|
109
|
+
updateDynamicCardWithParams(params: DynamicCardUpdateParams): Promise<SendMessageResult>;
|
|
110
|
+
revokeMessage(messageIds: string[], opts?: {
|
|
111
|
+
chat_type?: string;
|
|
112
|
+
sender_id?: string;
|
|
113
|
+
}): Promise<SendMessageResult>;
|
|
114
|
+
queryGroups(opts?: {
|
|
115
|
+
page_offset?: number;
|
|
116
|
+
page_size?: number;
|
|
117
|
+
}): Promise<QueryGroupsResult>;
|
|
118
|
+
sendReminderMsg(msgId: string, reminderTypes: number[], userIdList: string[]): Promise<SendMessageResult>;
|
|
119
|
+
uploadMediaFile(filePath: string, opts?: {
|
|
120
|
+
media_type?: number;
|
|
121
|
+
user_token?: string;
|
|
122
|
+
}): Promise<SendMessageResult>;
|
|
123
|
+
uploadAppMediaFile(filePath: string, opts?: {
|
|
124
|
+
media_type?: string;
|
|
125
|
+
width?: number;
|
|
126
|
+
height?: number;
|
|
127
|
+
duration?: number;
|
|
128
|
+
}): Promise<SendMessageResult>;
|
|
129
|
+
downloadMediaFile(mediaId: string): Promise<DownloadMediaResult>;
|
|
130
|
+
downloadMediaToFile(mediaId: string, opts?: {
|
|
131
|
+
target_path?: string;
|
|
132
|
+
media_type?: string;
|
|
133
|
+
}): Promise<string>;
|
|
134
|
+
fetchMediaPathInfo(mediaId: string, opts?: {
|
|
135
|
+
user_token?: string;
|
|
136
|
+
}): Promise<MediaPathResult>;
|
|
137
|
+
buildAuthorizeUrl(redirectUri: string, opts?: {
|
|
138
|
+
scope?: string | string[];
|
|
139
|
+
state?: string;
|
|
140
|
+
}): string;
|
|
141
|
+
static parseAuthorizeCallback(queryString: string | AnyDict): AnyDict;
|
|
142
|
+
static validateCallbackState(callbackState: string, expectedState: string): boolean;
|
|
143
|
+
exchangeCode(code: string, opts?: {
|
|
144
|
+
redirect_uri?: string;
|
|
145
|
+
}): Promise<UserTokenResult>;
|
|
146
|
+
refreshUserToken(refreshToken: string, opts?: {
|
|
147
|
+
scope?: string;
|
|
148
|
+
}): Promise<UserTokenResult>;
|
|
149
|
+
fetchUserInfoByToken(userToken: string): Promise<UserInfoResult>;
|
|
150
|
+
fetchStaffBasicInfo(staffId: string, opts?: {
|
|
151
|
+
user_token?: string;
|
|
152
|
+
}): Promise<StaffBasicInfoResult>;
|
|
153
|
+
fetchStaffDetail(staffId: string, opts?: {
|
|
154
|
+
user_token?: string;
|
|
155
|
+
}): Promise<StaffDetailResult>;
|
|
156
|
+
fetchDepartmentAncestors(staffId: string, opts?: {
|
|
157
|
+
user_token?: string;
|
|
158
|
+
}): Promise<DepartmentAncestorsResult>;
|
|
159
|
+
fetchStaffIdMapping(orgId: string, idType: string, idValue: string, opts?: {
|
|
160
|
+
user_token?: string;
|
|
161
|
+
}): Promise<StaffIdMappingResult>;
|
|
162
|
+
fetchOrgExtraFieldIds(orgId: string, opts?: {
|
|
163
|
+
user_token?: string;
|
|
164
|
+
page?: number;
|
|
165
|
+
page_size?: number;
|
|
166
|
+
}): Promise<ExtraFieldIdsResult>;
|
|
167
|
+
fetchOrgInfo(orgId: string, opts?: {
|
|
168
|
+
user_token?: string;
|
|
169
|
+
}): Promise<OrgInfoResult>;
|
|
170
|
+
searchStaff(keyword: string, opts?: {
|
|
171
|
+
user_token?: string;
|
|
172
|
+
user_id?: string;
|
|
173
|
+
recursive?: boolean;
|
|
174
|
+
sector_ids?: string[];
|
|
175
|
+
page?: number;
|
|
176
|
+
page_size?: number;
|
|
177
|
+
}): Promise<StaffSearchResult>;
|
|
178
|
+
sendBotMessage(msgType: string, msgData: AnyDict, chatIds?: string[], departmentIds?: string[], opts?: {
|
|
179
|
+
user_token?: string;
|
|
180
|
+
entry_id?: string;
|
|
181
|
+
is_group?: boolean;
|
|
182
|
+
}): Promise<BotMessageResult>;
|
|
183
|
+
sendAccountMessage(msgType: string, msgData: AnyDict, chatIds?: string[], departmentIds?: string[], opts?: {
|
|
184
|
+
account_id?: string;
|
|
185
|
+
entry_id?: string;
|
|
186
|
+
attach?: string;
|
|
187
|
+
user_token?: string;
|
|
188
|
+
}): Promise<AccountMessageResult>;
|
|
189
|
+
sendUserMessage(receiverId: string, msgType: string, msgData: AnyDict, opts?: {
|
|
190
|
+
user_token?: string;
|
|
191
|
+
common?: AnyDict;
|
|
192
|
+
uuid?: string;
|
|
193
|
+
}): Promise<UserMessageResult>;
|
|
194
|
+
sendGroupMessage(groupId: string, msgType: string, msgData: AnyDict, opts?: {
|
|
195
|
+
user_token?: string;
|
|
196
|
+
sender_id?: string;
|
|
197
|
+
reminder_all?: boolean;
|
|
198
|
+
reminder_user_ids?: string[];
|
|
199
|
+
outlines?: string;
|
|
200
|
+
uuid?: string;
|
|
201
|
+
entry_id?: string;
|
|
202
|
+
}): Promise<SendMessageResult>;
|
|
203
|
+
createStreamMessage(receiverId: string, receiverType: string, streamId: string): Promise<StreamMessageResult>;
|
|
204
|
+
fetchStreamMessage(msgId: string): Promise<StreamMessageResult>;
|
|
205
|
+
createGroup(name: string, orgId: string, opts?: {
|
|
206
|
+
owner_id?: string;
|
|
207
|
+
description?: string;
|
|
208
|
+
avatar_id?: string;
|
|
209
|
+
staff_id_list?: string[];
|
|
210
|
+
department_id_list?: string[];
|
|
211
|
+
user_token?: string;
|
|
212
|
+
apply_request_id?: string;
|
|
213
|
+
apply_notes?: string;
|
|
214
|
+
apply_global_unique_id?: string;
|
|
215
|
+
apply_session_unique_id?: string;
|
|
216
|
+
}): Promise<CreateGroupResult>;
|
|
217
|
+
fetchGroupInfo(groupId: string, opts?: {
|
|
218
|
+
user_token?: string;
|
|
219
|
+
}): Promise<GroupInfoResult>;
|
|
220
|
+
fetchGroupMembers(groupId: string, opts?: {
|
|
221
|
+
user_token?: string;
|
|
222
|
+
page_offset?: number;
|
|
223
|
+
page_size?: number;
|
|
224
|
+
}): Promise<GroupMemberResult>;
|
|
225
|
+
fetchGroupList(opts?: {
|
|
226
|
+
user_token?: string;
|
|
227
|
+
page_offset?: number;
|
|
228
|
+
page_size?: number;
|
|
229
|
+
}): Promise<GroupListResult>;
|
|
230
|
+
checkIsInGroup(groupId: string, opts?: {
|
|
231
|
+
user_token?: string;
|
|
232
|
+
staff_id?: string;
|
|
233
|
+
}): Promise<IsInGroupResult>;
|
|
234
|
+
updateGroupInfo(groupId: string, opts?: {
|
|
235
|
+
name?: string;
|
|
236
|
+
description?: string;
|
|
237
|
+
avatar_id?: string;
|
|
238
|
+
owner_id?: string;
|
|
239
|
+
assistant?: string[];
|
|
240
|
+
demote_assistant?: string[];
|
|
241
|
+
manage_mode?: number;
|
|
242
|
+
location_share?: boolean;
|
|
243
|
+
needs_confirm?: boolean;
|
|
244
|
+
is_public?: boolean;
|
|
245
|
+
max_members?: number;
|
|
246
|
+
max_history_msg_count?: number;
|
|
247
|
+
remind_all?: boolean;
|
|
248
|
+
send_msg_status?: boolean;
|
|
249
|
+
user_token?: string;
|
|
250
|
+
}): Promise<UpdateGroupResult>;
|
|
251
|
+
updateGroupMembers(groupId: string, opts?: {
|
|
252
|
+
add_user_list?: string[];
|
|
253
|
+
del_user_list?: string[];
|
|
254
|
+
add_department_id_list?: string[];
|
|
255
|
+
user_token?: string;
|
|
256
|
+
}): Promise<UpdateGroupMembersResult>;
|
|
257
|
+
dismissGroup(groupId: string, opts?: {
|
|
258
|
+
user_token?: string;
|
|
259
|
+
}): Promise<UpdateGroupResult>;
|
|
260
|
+
fetchDepartmentDetail(departmentId: string, opts?: {
|
|
261
|
+
user_token?: string;
|
|
262
|
+
tag_id?: string;
|
|
263
|
+
}): Promise<DepartmentDetailResult>;
|
|
264
|
+
fetchDepartmentChildren(departmentId: string, opts?: {
|
|
265
|
+
user_token?: string;
|
|
266
|
+
}): Promise<DepartmentChildrenResult>;
|
|
267
|
+
fetchDepartmentStaffs(departmentId: string, opts?: {
|
|
268
|
+
user_token?: string;
|
|
269
|
+
page?: number;
|
|
270
|
+
page_size?: number;
|
|
271
|
+
}): Promise<DepartmentStaffsResult>;
|
|
272
|
+
createTodoTask(title: string, link: string, pcLink: string, executorIds: string[], orgId: string, type?: number, opts?: {
|
|
273
|
+
source_id?: string;
|
|
274
|
+
desc?: string;
|
|
275
|
+
sender_id?: string;
|
|
276
|
+
user_token?: string;
|
|
277
|
+
}): Promise<TodoTaskCreateResult>;
|
|
278
|
+
updateTodoTask(todotaskId: string, title: string, link: string, pcLink: string, orgId: string, opts?: {
|
|
279
|
+
desc?: string;
|
|
280
|
+
user_token?: string;
|
|
281
|
+
}): Promise<TodoTaskCreateResult>;
|
|
282
|
+
updateTodoTaskStatus(todotaskId: string, status: string, orgId: string, opts?: {
|
|
283
|
+
staff_id?: string;
|
|
284
|
+
user_token?: string;
|
|
285
|
+
}): Promise<TodoTaskCreateResult>;
|
|
286
|
+
deleteTodoTask(todotaskId: string, orgId: string, opts?: {
|
|
287
|
+
staff_id?: string;
|
|
288
|
+
user_token?: string;
|
|
289
|
+
}): Promise<TodoTaskCreateResult>;
|
|
290
|
+
fetchTodoTaskList(orgId: string, opts?: {
|
|
291
|
+
app_ids?: string[];
|
|
292
|
+
staff_id?: string;
|
|
293
|
+
status_list?: string[];
|
|
294
|
+
user_token?: string;
|
|
295
|
+
}): Promise<TodoTaskListResult>;
|
|
296
|
+
fetchTodoTaskBySourceId(sourceId: string, orgId: string, opts?: {
|
|
297
|
+
staff_id?: string;
|
|
298
|
+
user_token?: string;
|
|
299
|
+
}): Promise<TodoTaskInfoResult>;
|
|
300
|
+
fetchTodoTaskById(todotaskId: string, orgId: string, opts?: {
|
|
301
|
+
staff_id?: string;
|
|
302
|
+
user_token?: string;
|
|
303
|
+
}): Promise<TodoTaskInfoResult>;
|
|
304
|
+
fetchTodoTaskStatusCounts(staffId: string, orgId: string, opts?: {
|
|
305
|
+
app_id?: string;
|
|
306
|
+
status_list?: string[];
|
|
307
|
+
user_token?: string;
|
|
308
|
+
}): Promise<TodoTaskStatusCountResult>;
|
|
309
|
+
updateExecutorStatus(executorStatusList: AnyDict[], orgId: string, opts?: {
|
|
310
|
+
todotask_id?: string;
|
|
311
|
+
user_token?: string;
|
|
312
|
+
}): Promise<TodoTaskCreateResult>;
|
|
313
|
+
addExecutors(executorIds: string[], orgId: string, opts?: {
|
|
314
|
+
todotask_id?: string;
|
|
315
|
+
user_token?: string;
|
|
316
|
+
}): Promise<TodoTaskCreateResult>;
|
|
317
|
+
deleteExecutors(executorIds: string[], orgId: string, opts?: {
|
|
318
|
+
todotask_id?: string;
|
|
319
|
+
user_token?: string;
|
|
320
|
+
}): Promise<TodoTaskCreateResult>;
|
|
321
|
+
fetchExecutorList(todotaskId: string, orgId: string, opts?: {
|
|
322
|
+
staff_id?: string;
|
|
323
|
+
status_list?: string[];
|
|
324
|
+
user_token?: string;
|
|
325
|
+
}): Promise<TodoTaskExecutorListResult>;
|
|
326
|
+
fetchPrimaryCalendar(opts?: {
|
|
327
|
+
user_token?: string;
|
|
328
|
+
user_id?: string;
|
|
329
|
+
}): Promise<CalendarPrimaryResult>;
|
|
330
|
+
createSchedule(calendarId: string, summary: string, startTime: AnyDict, endTime: AnyDict, attendees: AnyDict[], opts?: {
|
|
331
|
+
description?: string;
|
|
332
|
+
all_day?: string;
|
|
333
|
+
repeat_type?: string;
|
|
334
|
+
rule?: string;
|
|
335
|
+
expire_date_type?: string;
|
|
336
|
+
reminder_type?: string;
|
|
337
|
+
attendee_permissions?: string;
|
|
338
|
+
user_token?: string;
|
|
339
|
+
user_id?: string;
|
|
340
|
+
}): Promise<ScheduleCreateResult>;
|
|
341
|
+
fetchSchedule(calendarId: string, scheduleId: string, opts?: {
|
|
342
|
+
user_token?: string;
|
|
343
|
+
user_id?: string;
|
|
344
|
+
}): Promise<ScheduleInfoResult>;
|
|
345
|
+
deleteSchedule(calendarId: string, scheduleId: string, opts?: {
|
|
346
|
+
reminder_type?: string;
|
|
347
|
+
operation_type?: string;
|
|
348
|
+
current_time?: number;
|
|
349
|
+
user_token?: string;
|
|
350
|
+
user_id?: string;
|
|
351
|
+
}): Promise<ScheduleCreateResult>;
|
|
352
|
+
updateSchedule(calendarId: string, scheduleId: string, opts?: {
|
|
353
|
+
summary?: string;
|
|
354
|
+
description?: string;
|
|
355
|
+
operation_type?: string;
|
|
356
|
+
current_time?: number;
|
|
357
|
+
reminder_type?: string;
|
|
358
|
+
repeat_type?: string;
|
|
359
|
+
rule?: string;
|
|
360
|
+
expire_date_type?: string;
|
|
361
|
+
all_day?: string;
|
|
362
|
+
attendee_permissions?: string;
|
|
363
|
+
start_time?: AnyDict;
|
|
364
|
+
end_time?: AnyDict;
|
|
365
|
+
user_token?: string;
|
|
366
|
+
user_id?: string;
|
|
367
|
+
}): Promise<ScheduleUpdateResult>;
|
|
368
|
+
fetchScheduleList(calendarId: string, startTime: number, endTime: number, opts?: {
|
|
369
|
+
user_token?: string;
|
|
370
|
+
user_id?: string;
|
|
371
|
+
}): Promise<ScheduleListResult>;
|
|
372
|
+
fetchScheduleAttendees(calendarId: string, scheduleId: string, opts?: {
|
|
373
|
+
page?: number;
|
|
374
|
+
page_size?: number;
|
|
375
|
+
user_token?: string;
|
|
376
|
+
user_id?: string;
|
|
377
|
+
}): Promise<ScheduleAttendeesResult>;
|
|
378
|
+
addScheduleAttendees(calendarId: string, scheduleId: string, attendees: string[], opts?: {
|
|
379
|
+
reminder_type?: string;
|
|
380
|
+
user_token?: string;
|
|
381
|
+
user_id?: string;
|
|
382
|
+
}): Promise<ScheduleCreateResult>;
|
|
383
|
+
deleteScheduleAttendees(calendarId: string, scheduleId: string, attendees: string[], opts?: {
|
|
384
|
+
reminder_type?: string;
|
|
385
|
+
user_token?: string;
|
|
386
|
+
user_id?: string;
|
|
387
|
+
}): Promise<ScheduleCreateResult>;
|
|
388
|
+
updateScheduleAttendeeMeta(calendarId: string, scheduleId: string, opts?: {
|
|
389
|
+
rsvp_status?: string;
|
|
390
|
+
color?: string;
|
|
391
|
+
permissions?: string;
|
|
392
|
+
busy_free_state?: string;
|
|
393
|
+
remind_times?: number[];
|
|
394
|
+
user_token?: string;
|
|
395
|
+
user_id?: string;
|
|
396
|
+
}): Promise<ScheduleAttendeeMetaResult>;
|
|
397
|
+
fetchChatList(opts?: {
|
|
398
|
+
chat_type?: number;
|
|
399
|
+
keyword?: string;
|
|
400
|
+
start_time?: number;
|
|
401
|
+
end_time?: number;
|
|
402
|
+
user_token?: string;
|
|
403
|
+
}): Promise<ChatListResult>;
|
|
404
|
+
fetchChatMessages(opts?: {
|
|
405
|
+
staff_id?: string;
|
|
406
|
+
group_id?: string;
|
|
407
|
+
page_size?: number;
|
|
408
|
+
base_version?: string;
|
|
409
|
+
start_time?: number;
|
|
410
|
+
end_time?: number;
|
|
411
|
+
sender_id?: string;
|
|
412
|
+
user_token?: string;
|
|
413
|
+
}): Promise<ChatMessagesResult>;
|
|
414
|
+
static parseCallbackPayload(encryptedData: string, opts?: {
|
|
415
|
+
encoding_key?: string;
|
|
416
|
+
verify_signature?: boolean;
|
|
417
|
+
timestamp?: string;
|
|
418
|
+
nonce?: string;
|
|
419
|
+
signature?: string;
|
|
420
|
+
callback_token?: string;
|
|
421
|
+
known_app_id?: string;
|
|
422
|
+
}): CallbackEvent[];
|
|
423
|
+
parseCallback(encryptedData: string, opts?: {
|
|
424
|
+
verify_signature?: boolean;
|
|
425
|
+
timestamp?: string;
|
|
426
|
+
nonce?: string;
|
|
427
|
+
signature?: string;
|
|
428
|
+
known_app_id?: string;
|
|
429
|
+
}): CallbackEvent[];
|
|
430
|
+
static verifyCallbackSignature(timestamp: string, nonce: string, signature: string, encodingKey: string, opts?: {
|
|
431
|
+
data_encrypt?: string;
|
|
432
|
+
callback_token?: string;
|
|
433
|
+
}): boolean;
|
|
434
|
+
verifyCallback(timestamp: string, nonce: string, signature: string, opts?: {
|
|
435
|
+
data_encrypt?: string;
|
|
436
|
+
}): boolean;
|
|
437
|
+
static getCallbackEventTypes(): Record<string, string>;
|
|
438
|
+
}
|
|
439
|
+
export {};
|