lansenger-sdk-ts 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chats.js +5 -5
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +11 -11
- package/dist/oauth.js +3 -1
- package/package.json +1 -1
package/dist/chats.js
CHANGED
|
@@ -9,13 +9,13 @@ async function fetchChatList(config, appToken, opts) {
|
|
|
9
9
|
const userToken = opts?.user_token || "";
|
|
10
10
|
const url = (0, urlHelpers_1.buildApiUrl)(config, "chats", "fetch", appToken, { userToken });
|
|
11
11
|
const payload = {};
|
|
12
|
-
if (opts?.chat_type)
|
|
12
|
+
if (opts?.chat_type != null)
|
|
13
13
|
payload.chatType = opts.chat_type;
|
|
14
14
|
if (opts?.keyword)
|
|
15
15
|
payload.keyword = opts.keyword;
|
|
16
|
-
if (opts?.start_time)
|
|
16
|
+
if (opts?.start_time != null)
|
|
17
17
|
payload.startTime = opts.start_time;
|
|
18
|
-
if (opts?.end_time)
|
|
18
|
+
if (opts?.end_time != null)
|
|
19
19
|
payload.endTime = opts.end_time;
|
|
20
20
|
const [data, httpErr] = await (0, http_1.doPost)(url, payload, opts?.fetchFn);
|
|
21
21
|
if (httpErr)
|
|
@@ -54,9 +54,9 @@ async function fetchChatMessages(config, appToken, opts) {
|
|
|
54
54
|
payload.staffId = opts.staff_id;
|
|
55
55
|
if (opts?.group_id)
|
|
56
56
|
payload.groupId = opts.group_id;
|
|
57
|
-
if (opts?.start_time)
|
|
57
|
+
if (opts?.start_time != null)
|
|
58
58
|
payload.startTime = opts.start_time;
|
|
59
|
-
if (opts?.end_time)
|
|
59
|
+
if (opts?.end_time != null)
|
|
60
60
|
payload.endTime = opts.end_time;
|
|
61
61
|
if (opts?.sender_id)
|
|
62
62
|
payload.senderId = opts.sender_id;
|
package/dist/constants.d.ts
CHANGED
|
@@ -27,4 +27,4 @@ export declare const REMINDER_TYPE_PHONE = 3;
|
|
|
27
27
|
export declare const CALLBACK_EVENT_TYPES: Record<string, string>;
|
|
28
28
|
export declare function guessMediaType(filePath: string): number;
|
|
29
29
|
export declare function guessAppMediaType(filePath: string): string;
|
|
30
|
-
export declare const VERSION = "1.
|
|
30
|
+
export declare const VERSION = "1.1.0";
|
package/dist/constants.js
CHANGED
|
@@ -139,31 +139,31 @@ exports.REMINDER_TYPE_POPUP = 1;
|
|
|
139
139
|
exports.REMINDER_TYPE_SMS = 2;
|
|
140
140
|
exports.REMINDER_TYPE_PHONE = 3;
|
|
141
141
|
exports.CALLBACK_EVENT_TYPES = {
|
|
142
|
+
account_message: "public_account",
|
|
142
143
|
account_subscribe: "public_account",
|
|
143
144
|
account_unsubscribe: "public_account",
|
|
144
|
-
account_message: "public_account",
|
|
145
145
|
staff_info: "staff",
|
|
146
146
|
staff_modify: "staff",
|
|
147
147
|
staff_create: "staff",
|
|
148
148
|
staff_delete: "staff",
|
|
149
|
-
telephone_track: "telephone_track",
|
|
150
|
-
dept_create: "department",
|
|
151
149
|
dept_modify: "department",
|
|
150
|
+
dept_create: "department",
|
|
152
151
|
dept_delete: "department",
|
|
153
152
|
tag_member: "tag",
|
|
154
|
-
app_install_org: "
|
|
155
|
-
app_uninstall_org: "
|
|
153
|
+
app_install_org: "app",
|
|
154
|
+
app_uninstall_org: "app",
|
|
156
155
|
bot_private_message: "bot",
|
|
157
156
|
bot_group_message: "bot",
|
|
158
157
|
group_create_approve: "group",
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
telephone_track: "notification",
|
|
159
|
+
ua_cert_create: "certificate",
|
|
160
|
+
ua_cert_delete: "certificate",
|
|
161
161
|
report_location: "location",
|
|
162
|
-
user_logout: "
|
|
162
|
+
user_logout: "auth",
|
|
163
163
|
data_scope: "data_scope",
|
|
164
164
|
wb_visible_config: "workbench",
|
|
165
|
-
schedule_modify: "
|
|
166
|
-
schedule_delete: "
|
|
165
|
+
schedule_modify: "calendar",
|
|
166
|
+
schedule_delete: "calendar",
|
|
167
167
|
};
|
|
168
168
|
function guessMediaType(filePath) {
|
|
169
169
|
const ext = filePath.substring(filePath.lastIndexOf(".")).toLowerCase();
|
|
@@ -183,5 +183,5 @@ function guessAppMediaType(filePath) {
|
|
|
183
183
|
return exports.APP_MEDIA_TYPE_AUDIO;
|
|
184
184
|
return exports.APP_MEDIA_TYPE_FILE;
|
|
185
185
|
}
|
|
186
|
-
exports.VERSION = "1.
|
|
186
|
+
exports.VERSION = "1.1.0";
|
|
187
187
|
//# sourceMappingURL=constants.js.map
|
package/dist/oauth.js
CHANGED
|
@@ -87,7 +87,9 @@ function parseAuthorizeCallback(queryString) {
|
|
|
87
87
|
params = {};
|
|
88
88
|
for (const part of queryString.replace(/^\?/, "").split("&")) {
|
|
89
89
|
if (part.includes("=")) {
|
|
90
|
-
const
|
|
90
|
+
const eqIdx = part.indexOf("=");
|
|
91
|
+
const key = part.substring(0, eqIdx);
|
|
92
|
+
const value = part.substring(eqIdx + 1);
|
|
91
93
|
params[key] = value || "";
|
|
92
94
|
}
|
|
93
95
|
}
|