node-easywechat 2.6.10 → 2.8.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/README.md +26 -3
- package/dist/BaseService/ContentSecurity/ContentSecurityClient.d.ts +5 -3
- package/dist/BaseService/ContentSecurity/ContentSecurityClient.js +2 -2
- package/dist/BaseService/Jssdk/JssdkClient.d.ts +15 -15
- package/dist/BaseService/Jssdk/JssdkClient.js +15 -15
- package/dist/BaseService/Media/MediaClient.d.ts +22 -20
- package/dist/BaseService/Media/MediaClient.js +14 -14
- package/dist/BaseService/Url/UrlClient.d.ts +1 -1
- package/dist/Core/AES.d.ts +46 -0
- package/dist/Core/AES.js +95 -0
- package/dist/Core/Encryptor.d.ts +2 -14
- package/dist/Core/Encryptor.js +9 -39
- package/dist/Core/Http/Request.js +2 -6
- package/dist/Core/Messages/Message.js +2 -16
- package/dist/Core/PKCS.d.ts +15 -0
- package/dist/Core/PKCS.js +44 -0
- package/dist/Core/RSA.d.ts +59 -0
- package/dist/Core/RSA.js +99 -0
- package/dist/Core/ServerGuard.d.ts +1 -1
- package/dist/Core/ServerGuard.js +5 -33
- package/dist/Core/Types.d.ts +24 -4
- package/dist/Core/Utils.d.ts +8 -2
- package/dist/Core/Utils.js +61 -20
- package/dist/MicroMerchant/Application.d.ts +27 -0
- package/dist/MicroMerchant/Application.js +105 -0
- package/dist/MicroMerchant/Base/MicroMerchantBase.d.ts +7 -0
- package/dist/MicroMerchant/Base/MicroMerchantBase.js +52 -0
- package/dist/MicroMerchant/Certficates/CertficatesClient.d.ts +5 -0
- package/dist/MicroMerchant/Certficates/CertficatesClient.js +52 -0
- package/dist/MicroMerchant/Core/BaseClient.d.ts +9 -0
- package/dist/MicroMerchant/Core/BaseClient.js +106 -0
- package/dist/MicroMerchant/Media/MediaClient.d.ts +6 -0
- package/dist/MicroMerchant/Media/MediaClient.js +33 -0
- package/dist/MicroMerchant/MerchantConfig/MerchantConfigClient.d.ts +8 -0
- package/dist/MicroMerchant/MerchantConfig/MerchantConfigClient.js +49 -0
- package/dist/MicroMerchant/Meterial/MeterialClient.d.ts +5 -0
- package/dist/MicroMerchant/Meterial/MeterialClient.js +30 -0
- package/dist/MicroMerchant/Withdraw/WithdrawClient.d.ts +5 -0
- package/dist/MicroMerchant/Withdraw/WithdrawClient.js +28 -0
- package/dist/MiniProgram/Application.d.ts +4 -0
- package/dist/MiniProgram/Application.js +10 -0
- package/dist/MiniProgram/Encryptor.js +2 -6
- package/dist/MiniProgram/PhoneNumber/PhoneNumberClient.d.ts +10 -0
- package/dist/MiniProgram/PhoneNumber/PhoneNumberClient.js +20 -0
- package/dist/MiniProgram/Union/UnionClient.d.ts +3 -0
- package/dist/MiniProgram/Union/UnionClient.js +9 -0
- package/dist/MiniProgram/UrlLink/UrlLinkClient.d.ts +4 -0
- package/dist/MiniProgram/UrlLink/UrlLinkClient.js +12 -0
- package/dist/Payment/Bill/BillClient.js +1 -1
- package/dist/Payment/Core/BaseClient.d.ts +0 -1
- package/dist/Payment/Core/BaseClient.js +2 -20
- package/dist/Payment/Jssdk/JssdkClient.d.ts +12 -0
- package/dist/Payment/Jssdk/JssdkClient.js +32 -0
- package/dist/Payment/Notify/Handler.js +3 -11
- package/dist/Payment/Notify/Refunded.d.ts +0 -1
- package/dist/Payment/Notify/Refunded.js +1 -11
- package/dist/Payment/Transfer/TransferClient.js +4 -3
- package/dist/Work/ExternalContact/Client.d.ts +146 -3
- package/dist/Work/ExternalContact/Client.js +156 -6
- package/dist/Work/ExternalContact/MessageClient.d.ts +45 -0
- package/dist/Work/ExternalContact/MessageClient.js +86 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +2 -0
- package/node-easywechat.file_cache.easywechat.kernel.access_token.8a9684b45da7de42a06a70ba01a7005a.cache +1 -1
- package/node-easywechat.file_cache.easywechat.kernel.access_token.c3d06edaf326aad75d32f31348df787a.cache +1 -1
- package/package.json +4 -5
|
@@ -5,43 +5,105 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const BaseClient_1 = __importDefault(require("../../Core/BaseClient"));
|
|
7
7
|
class ExternalContactClient extends BaseClient_1.default {
|
|
8
|
+
/**
|
|
9
|
+
* 获取配置了客户联系功能的成员列表
|
|
10
|
+
* @see https://work.weixin.qq.com/api/doc#90000/90135/91554
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
8
13
|
getFollowUsers() {
|
|
9
14
|
return this.httpGet('cgi-bin/externalcontact/get_follow_user_list');
|
|
10
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* 获取外部联系人列表
|
|
18
|
+
* @see https://work.weixin.qq.com/api/doc#90000/90135/91555
|
|
19
|
+
* @param userId
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
11
22
|
list(userId) {
|
|
12
23
|
return this.httpGet('cgi-bin/externalcontact/list', {
|
|
13
24
|
userid: userId,
|
|
14
25
|
});
|
|
15
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* 获取外部联系人详情
|
|
29
|
+
* @see https://work.weixin.qq.com/api/doc#90000/90135/91556
|
|
30
|
+
* @param externalUserId
|
|
31
|
+
* @returns
|
|
32
|
+
*/
|
|
16
33
|
get(externalUserId) {
|
|
17
34
|
return this.httpGet('cgi-bin/externalcontact/get', {
|
|
18
35
|
external_userid: externalUserId,
|
|
19
36
|
});
|
|
20
37
|
}
|
|
21
|
-
|
|
38
|
+
/**
|
|
39
|
+
* 批量获取客户详情
|
|
40
|
+
* @see https://work.weixin.qq.com/api/doc/90000/90135/92994
|
|
41
|
+
* @param userIdList
|
|
42
|
+
* @param cursor
|
|
43
|
+
* @param limit
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
batchGet(userIdList, cursor = '', limit = 1) {
|
|
22
47
|
return this.httpPostJson('cgi-bin/externalcontact/batch/get_by_user', {
|
|
23
|
-
|
|
48
|
+
userid_list: userIdList,
|
|
24
49
|
cursor,
|
|
25
50
|
limit,
|
|
26
51
|
});
|
|
27
52
|
}
|
|
28
|
-
|
|
53
|
+
/**
|
|
54
|
+
* 批量获取外部联系人详情
|
|
55
|
+
* @see https://work.weixin.qq.com/api/doc/90001/90143/93010
|
|
56
|
+
* @param userIdList
|
|
57
|
+
* @param cursor
|
|
58
|
+
* @param limit
|
|
59
|
+
* @returns
|
|
60
|
+
*/
|
|
61
|
+
batchGetByUser(userIdList, cursor = '', limit = 1) {
|
|
29
62
|
return this.httpPostJson('cgi-bin/externalcontact/batch/get_by_user', {
|
|
30
|
-
|
|
63
|
+
userid_list: userIdList,
|
|
31
64
|
cursor,
|
|
32
65
|
limit,
|
|
33
66
|
});
|
|
34
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* 修改客户备注信息
|
|
70
|
+
* @see https://work.weixin.qq.com/api/doc/90000/90135/92115
|
|
71
|
+
* @param data
|
|
72
|
+
* @returns
|
|
73
|
+
*/
|
|
35
74
|
remark(data) {
|
|
36
75
|
return this.httpPostJson('cgi-bin/externalcontact/remark', data);
|
|
37
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* 获取离职成员的客户列表
|
|
79
|
+
* @see https://work.weixin.qq.com/api/doc/90000/90135/92124
|
|
80
|
+
* @param pageId
|
|
81
|
+
* @param pageSize
|
|
82
|
+
* @param cursor
|
|
83
|
+
* @returns
|
|
84
|
+
*/
|
|
38
85
|
getUnassigned(pageId = 0, pageSize = 1000, cursor = null) {
|
|
39
|
-
|
|
86
|
+
let params = {
|
|
40
87
|
page_id: pageId,
|
|
41
88
|
page_size: pageSize,
|
|
42
89
|
cursor,
|
|
90
|
+
};
|
|
91
|
+
Object.keys(params).map(key => {
|
|
92
|
+
if (params[key] === null || params[key] === undefined) {
|
|
93
|
+
delete params[key];
|
|
94
|
+
}
|
|
43
95
|
});
|
|
96
|
+
return this.httpPostJson('cgi-bin/externalcontact/get_unassigned_list', params);
|
|
44
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* 离职成员的外部联系人再分配
|
|
100
|
+
* @see https://work.weixin.qq.com/api/doc#90000/90135/91564
|
|
101
|
+
* @param externalUserId
|
|
102
|
+
* @param handoverUserId
|
|
103
|
+
* @param takeoverUserId
|
|
104
|
+
* @param transferSuccessMessage
|
|
105
|
+
* @returns
|
|
106
|
+
*/
|
|
45
107
|
transfer(externalUserId, handoverUserId, takeoverUserId, transferSuccessMessage) {
|
|
46
108
|
return this.httpPostJson('cgi-bin/externalcontact/transfer', {
|
|
47
109
|
external_userid: externalUserId,
|
|
@@ -50,6 +112,15 @@ class ExternalContactClient extends BaseClient_1.default {
|
|
|
50
112
|
transfer_success_msg: transferSuccessMessage,
|
|
51
113
|
});
|
|
52
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* 分配在职成员的客户
|
|
117
|
+
* @see https://work.weixin.qq.com/api/doc/90000/90135/92125
|
|
118
|
+
* @param externalUserId
|
|
119
|
+
* @param handoverUserId
|
|
120
|
+
* @param takeoverUserId
|
|
121
|
+
* @param transferSuccessMessage
|
|
122
|
+
* @returns
|
|
123
|
+
*/
|
|
53
124
|
transferCustomer(externalUserId, handoverUserId, takeoverUserId, transferSuccessMessage) {
|
|
54
125
|
return this.httpPostJson('cgi-bin/externalcontact/transfer_customer', {
|
|
55
126
|
external_userid: externalUserId,
|
|
@@ -58,6 +129,14 @@ class ExternalContactClient extends BaseClient_1.default {
|
|
|
58
129
|
transfer_success_msg: transferSuccessMessage,
|
|
59
130
|
});
|
|
60
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* 分配离职成员的客户
|
|
134
|
+
* @see https://work.weixin.qq.com/api/doc/90000/90135/94081
|
|
135
|
+
* @param externalUserId
|
|
136
|
+
* @param handoverUserId
|
|
137
|
+
* @param takeoverUserId
|
|
138
|
+
* @returns
|
|
139
|
+
*/
|
|
61
140
|
resignedTransferCustomer(externalUserId, handoverUserId, takeoverUserId) {
|
|
62
141
|
return this.httpPostJson('cgi-bin/externalcontact/resigned/transfer_customer', {
|
|
63
142
|
external_userid: externalUserId,
|
|
@@ -65,12 +144,27 @@ class ExternalContactClient extends BaseClient_1.default {
|
|
|
65
144
|
takeover_userid: takeoverUserId,
|
|
66
145
|
});
|
|
67
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* 离职成员的群再分配
|
|
149
|
+
* @see https://work.weixin.qq.com/api/doc/90000/90135/92127
|
|
150
|
+
* @param chatIds
|
|
151
|
+
* @param newOwner
|
|
152
|
+
* @returns
|
|
153
|
+
*/
|
|
68
154
|
transferGroupChat(chatIds, newOwner) {
|
|
69
155
|
return this.httpPostJson('cgi-bin/externalcontact/groupchat/transfer', {
|
|
70
156
|
chat_id_list: chatIds,
|
|
71
157
|
new_owner: newOwner,
|
|
72
158
|
});
|
|
73
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* 查询客户接替状态
|
|
162
|
+
* @see https://work.weixin.qq.com/api/doc/90000/90135/94082
|
|
163
|
+
* @param handoverUserId
|
|
164
|
+
* @param takeoverUserId
|
|
165
|
+
* @param cursor
|
|
166
|
+
* @returns
|
|
167
|
+
*/
|
|
74
168
|
transferResult(handoverUserId, takeoverUserId, cursor = null) {
|
|
75
169
|
return this.httpPostJson('cgi-bin/externalcontact/resigned/transfer_result', {
|
|
76
170
|
handover_userid: handoverUserId,
|
|
@@ -78,6 +172,14 @@ class ExternalContactClient extends BaseClient_1.default {
|
|
|
78
172
|
cursor,
|
|
79
173
|
});
|
|
80
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* 查询客户接替结果
|
|
177
|
+
* @see https://work.weixin.qq.com/api/doc/90001/90143/93009
|
|
178
|
+
* @param externalUserId
|
|
179
|
+
* @param handoverUserId
|
|
180
|
+
* @param takeoverUserId
|
|
181
|
+
* @returns
|
|
182
|
+
*/
|
|
81
183
|
getTransferResult(externalUserId, handoverUserId, takeoverUserId) {
|
|
82
184
|
return this.httpPostJson('cgi-bin/externalcontact/get_transfer_result', {
|
|
83
185
|
external_userid: externalUserId,
|
|
@@ -85,23 +187,58 @@ class ExternalContactClient extends BaseClient_1.default {
|
|
|
85
187
|
takeover_userid: takeoverUserId,
|
|
86
188
|
});
|
|
87
189
|
}
|
|
190
|
+
/**
|
|
191
|
+
* 获取客户群列表
|
|
192
|
+
* @see https://work.weixin.qq.com/api/doc/90000/90135/92120
|
|
193
|
+
* @param data
|
|
194
|
+
* @returns
|
|
195
|
+
*/
|
|
88
196
|
getGroupChats(data) {
|
|
89
197
|
return this.httpPostJson('cgi-bin/externalcontact/groupchat/list', data);
|
|
90
198
|
}
|
|
91
|
-
|
|
199
|
+
/**
|
|
200
|
+
* 获取客户群详情
|
|
201
|
+
* @see https://work.weixin.qq.com/api/doc/90000/90135/92122
|
|
202
|
+
* @param chatId
|
|
203
|
+
* @param needName
|
|
204
|
+
* @returns
|
|
205
|
+
*/
|
|
206
|
+
getGroupChat(chatId, needName = 0) {
|
|
92
207
|
return this.httpPostJson('cgi-bin/externalcontact/groupchat/get', {
|
|
93
208
|
chat_id: chatId,
|
|
209
|
+
need_name: needName,
|
|
94
210
|
});
|
|
95
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* 获取企业标签库
|
|
214
|
+
* @see https://work.weixin.qq.com/api/doc/90000/90135/92117#获取企业标签库
|
|
215
|
+
* @param tagIds
|
|
216
|
+
* @param groupIds
|
|
217
|
+
* @returns
|
|
218
|
+
*/
|
|
96
219
|
getCorpTags(tagIds, groupIds) {
|
|
97
220
|
return this.httpPostJson('cgi-bin/externalcontact/get_corp_tag_list', {
|
|
98
221
|
tag_id: tagIds,
|
|
99
222
|
group_id: groupIds,
|
|
100
223
|
});
|
|
101
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* 添加企业客户标签
|
|
227
|
+
* @see https://work.weixin.qq.com/api/doc/90000/90135/92117#添加企业客户标签
|
|
228
|
+
* @param data
|
|
229
|
+
* @returns
|
|
230
|
+
*/
|
|
102
231
|
addCorpTag(data) {
|
|
103
232
|
return this.httpPostJson('cgi-bin/externalcontact/add_corp_tag', data);
|
|
104
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* 编辑企业客户标签
|
|
236
|
+
* @see https://work.weixin.qq.com/api/doc/90000/90135/92117#编辑企业客户标签
|
|
237
|
+
* @param id
|
|
238
|
+
* @param name
|
|
239
|
+
* @param order
|
|
240
|
+
* @returns
|
|
241
|
+
*/
|
|
105
242
|
updateCorpTag(id, name = null, order = null) {
|
|
106
243
|
let params = {
|
|
107
244
|
id,
|
|
@@ -114,12 +251,25 @@ class ExternalContactClient extends BaseClient_1.default {
|
|
|
114
251
|
}
|
|
115
252
|
return this.httpPostJson('cgi-bin/externalcontact/edit_corp_tag', params);
|
|
116
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* 删除企业客户标签
|
|
256
|
+
* @see https://work.weixin.qq.com/api/doc/90000/90135/92117#删除企业客户标签
|
|
257
|
+
* @param tagId
|
|
258
|
+
* @param groupId
|
|
259
|
+
* @returns
|
|
260
|
+
*/
|
|
117
261
|
deleteCorpTag(tagId, groupId) {
|
|
118
262
|
return this.httpPostJson('cgi-bin/externalcontact/del_corp_tag', {
|
|
119
263
|
tag_id: tagId,
|
|
120
264
|
group_id: groupId,
|
|
121
265
|
});
|
|
122
266
|
}
|
|
267
|
+
/**
|
|
268
|
+
* 编辑客户企业标签
|
|
269
|
+
* @see https://work.weixin.qq.com/api/doc/90000/90135/92118
|
|
270
|
+
* @param data
|
|
271
|
+
* @returns
|
|
272
|
+
*/
|
|
123
273
|
markTags(data) {
|
|
124
274
|
return this.httpPostJson('cgi-bin/externalcontact/mark_tag', data);
|
|
125
275
|
}
|
|
@@ -5,8 +5,53 @@ export default class MessageClient extends BaseClient {
|
|
|
5
5
|
protected imageMessage: object;
|
|
6
6
|
protected linkMessage: object;
|
|
7
7
|
protected miniprogramMessage: object;
|
|
8
|
+
/**
|
|
9
|
+
* 添加企业群发消息模板
|
|
10
|
+
* @param msg
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
8
13
|
submit(msg: object): Promise<any>;
|
|
14
|
+
/**
|
|
15
|
+
* 获取企业群发消息发送结果
|
|
16
|
+
* @param msgId
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
9
19
|
get(msgId: string): Promise<any>;
|
|
20
|
+
/**
|
|
21
|
+
* 获取群发记录列表
|
|
22
|
+
* @param chatType 群发任务的类型,默认为single,表示发送给客户,group表示发送给客户群
|
|
23
|
+
* @param startTime 群发任务记录开始时间
|
|
24
|
+
* @param endTime 群发任务记录结束时间
|
|
25
|
+
* @param creator 群发任务创建人企业账号id
|
|
26
|
+
* @param filterType 创建人类型。0:企业发表 1:个人发表 2:所有,包括个人创建以及企业创建,默认情况下为所有类型
|
|
27
|
+
* @param limit 返回的最大记录数,整型,最大值100,默认值50,超过最大值时取默认值
|
|
28
|
+
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
getGroupmsgListV2(chatType: string, startTime: number, endTime: number, creator?: string, filterType?: number, limit?: number, cursor?: string): Promise<any>;
|
|
32
|
+
/**
|
|
33
|
+
* 获取群发成员发送任务列表
|
|
34
|
+
* @param msgId 群发消息的id,通过获取群发记录列表接口返回
|
|
35
|
+
* @param limit 返回的最大记录数,整型,最大值1000,默认值500,超过最大值时取默认值
|
|
36
|
+
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
getGroupmsgTask(msgId: string, limit?: number, cursor?: string): Promise<any>;
|
|
40
|
+
/**
|
|
41
|
+
* 获取企业群发成员执行结果
|
|
42
|
+
* @param msgId 群发消息的id,通过获取群发记录列表接口返回
|
|
43
|
+
* @param userId 发送成员userid,通过获取群发成员发送任务列表接口返回
|
|
44
|
+
* @param limit 返回的最大记录数,整型,最大值1000,默认值500,超过最大值时取默认值
|
|
45
|
+
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
48
|
+
getGroupmsgSendResult(msgId: string, userId: string, limit?: number, cursor?: string): Promise<any>;
|
|
49
|
+
/**
|
|
50
|
+
* 发送新客户欢迎语
|
|
51
|
+
* @param welcomeCode
|
|
52
|
+
* @param msg
|
|
53
|
+
* @returns
|
|
54
|
+
*/
|
|
10
55
|
sendWelcome(welcomeCode: string, msg: object): Promise<any>;
|
|
11
56
|
protected formatMessage(data: object): object;
|
|
12
57
|
protected formatFields(data: object, defaults: object): object;
|
|
@@ -26,15 +26,101 @@ class MessageClient extends BaseClient_1.default {
|
|
|
26
26
|
page: '',
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* 添加企业群发消息模板
|
|
31
|
+
* @param msg
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
29
34
|
submit(msg) {
|
|
30
35
|
let params = this.formatMessage(msg);
|
|
31
36
|
return this.httpPostJson('cgi-bin/externalcontact/add_msg_template', params);
|
|
32
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* 获取企业群发消息发送结果
|
|
40
|
+
* @param msgId
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
33
43
|
get(msgId) {
|
|
34
44
|
return this.httpPostJson('cgi-bin/externalcontact/get_group_msg_result', {
|
|
35
45
|
msgid: msgId,
|
|
36
46
|
});
|
|
37
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* 获取群发记录列表
|
|
50
|
+
* @param chatType 群发任务的类型,默认为single,表示发送给客户,group表示发送给客户群
|
|
51
|
+
* @param startTime 群发任务记录开始时间
|
|
52
|
+
* @param endTime 群发任务记录结束时间
|
|
53
|
+
* @param creator 群发任务创建人企业账号id
|
|
54
|
+
* @param filterType 创建人类型。0:企业发表 1:个人发表 2:所有,包括个人创建以及企业创建,默认情况下为所有类型
|
|
55
|
+
* @param limit 返回的最大记录数,整型,最大值100,默认值50,超过最大值时取默认值
|
|
56
|
+
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
|
|
57
|
+
* @returns
|
|
58
|
+
*/
|
|
59
|
+
getGroupmsgListV2(chatType, startTime, endTime, creator = null, filterType = null, limit = null, cursor = null) {
|
|
60
|
+
let params = {
|
|
61
|
+
chat_type: chatType,
|
|
62
|
+
start_time: startTime,
|
|
63
|
+
end_time: endTime,
|
|
64
|
+
creator: creator,
|
|
65
|
+
filter_type: filterType,
|
|
66
|
+
limit: limit,
|
|
67
|
+
cursor: cursor,
|
|
68
|
+
};
|
|
69
|
+
Object.keys(params).map(key => {
|
|
70
|
+
if (params[key] === null || params[key] === undefined) {
|
|
71
|
+
delete params[key];
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
return this.httpPostJson('cgi-bin/externalcontact/get_groupmsg_list_v2', params);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 获取群发成员发送任务列表
|
|
78
|
+
* @param msgId 群发消息的id,通过获取群发记录列表接口返回
|
|
79
|
+
* @param limit 返回的最大记录数,整型,最大值1000,默认值500,超过最大值时取默认值
|
|
80
|
+
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
|
|
81
|
+
* @returns
|
|
82
|
+
*/
|
|
83
|
+
getGroupmsgTask(msgId, limit = null, cursor = null) {
|
|
84
|
+
let params = {
|
|
85
|
+
msgid: msgId,
|
|
86
|
+
limit: limit,
|
|
87
|
+
cursor: cursor,
|
|
88
|
+
};
|
|
89
|
+
Object.keys(params).map(key => {
|
|
90
|
+
if (params[key] === null || params[key] === undefined) {
|
|
91
|
+
delete params[key];
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return this.httpPostJson('cgi-bin/externalcontact/get_groupmsg_task', params);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* 获取企业群发成员执行结果
|
|
98
|
+
* @param msgId 群发消息的id,通过获取群发记录列表接口返回
|
|
99
|
+
* @param userId 发送成员userid,通过获取群发成员发送任务列表接口返回
|
|
100
|
+
* @param limit 返回的最大记录数,整型,最大值1000,默认值500,超过最大值时取默认值
|
|
101
|
+
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
|
|
102
|
+
* @returns
|
|
103
|
+
*/
|
|
104
|
+
getGroupmsgSendResult(msgId, userId, limit = null, cursor = null) {
|
|
105
|
+
let params = {
|
|
106
|
+
msgid: msgId,
|
|
107
|
+
userid: userId,
|
|
108
|
+
limit: limit,
|
|
109
|
+
cursor: cursor,
|
|
110
|
+
};
|
|
111
|
+
Object.keys(params).map(key => {
|
|
112
|
+
if (params[key] === null || params[key] === undefined) {
|
|
113
|
+
delete params[key];
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
return this.httpPostJson('cgi-bin/externalcontact/get_groupmsg_send_result', params);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* 发送新客户欢迎语
|
|
120
|
+
* @param welcomeCode
|
|
121
|
+
* @param msg
|
|
122
|
+
* @returns
|
|
123
|
+
*/
|
|
38
124
|
sendWelcome(welcomeCode, msg) {
|
|
39
125
|
let formattedMsg = this.formatMessage(msg);
|
|
40
126
|
let params = Utils_1.merge(Utils_1.merge({}, formattedMsg), {
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import MiniProgram from './MiniProgram/Application';
|
|
|
4
4
|
import OpenPlatform from './OpenPlatform/Application';
|
|
5
5
|
import Payment from './Payment/Application';
|
|
6
6
|
import Work from './Work/Application';
|
|
7
|
+
import MicroMerchant from './MicroMerchant/Application';
|
|
7
8
|
import CacheInterface from './Core/Contracts/CacheInterface';
|
|
8
9
|
import FinallResult from './Core/Decorators/FinallResult';
|
|
9
10
|
import TerminateResult from './Core/Decorators/TerminateResult';
|
|
@@ -23,6 +24,7 @@ declare function getInstance(service: 'MiniProgram', config?: EasyWechatConfig):
|
|
|
23
24
|
declare function getInstance(service: 'OpenPlatform', config?: EasyWechatConfig): OpenPlatform;
|
|
24
25
|
declare function getInstance(service: 'Payment', config?: EasyWechatConfig): Payment;
|
|
25
26
|
declare function getInstance(service: 'Work', config?: EasyWechatConfig): Work;
|
|
27
|
+
declare function getInstance(service: 'MicroMerchant', config?: EasyWechatConfig): MicroMerchant;
|
|
26
28
|
declare class EasyWechat {
|
|
27
29
|
/**
|
|
28
30
|
* 实例工厂
|
|
@@ -52,6 +54,10 @@ declare class EasyWechat {
|
|
|
52
54
|
* 企业微信类
|
|
53
55
|
*/
|
|
54
56
|
Work: typeof Work;
|
|
57
|
+
/**
|
|
58
|
+
* 小微商户类
|
|
59
|
+
*/
|
|
60
|
+
MicroMerchant: typeof MicroMerchant;
|
|
55
61
|
/**
|
|
56
62
|
* 通用获取实例方法
|
|
57
63
|
* @param service 服务名称,可选值:'BaseService' | 'OfficialAccount' | 'MiniProgram' | 'OpenPlatform' | 'Payment'
|
package/dist/index.js
CHANGED
|
@@ -28,6 +28,7 @@ const Application_3 = __importDefault(require("./MiniProgram/Application"));
|
|
|
28
28
|
const Application_4 = __importDefault(require("./OpenPlatform/Application"));
|
|
29
29
|
const Application_5 = __importDefault(require("./Payment/Application"));
|
|
30
30
|
const Application_6 = __importDefault(require("./Work/Application"));
|
|
31
|
+
const Application_7 = __importDefault(require("./MicroMerchant/Application"));
|
|
31
32
|
const CacheInterface_1 = __importDefault(require("./Core/Contracts/CacheInterface"));
|
|
32
33
|
const FinallResult_1 = __importDefault(require("./Core/Decorators/FinallResult"));
|
|
33
34
|
const TerminateResult_1 = __importDefault(require("./Core/Decorators/TerminateResult"));
|
|
@@ -63,6 +64,7 @@ class EasyWechat {
|
|
|
63
64
|
OpenPlatform: Application_4.default,
|
|
64
65
|
Payment: Application_5.default,
|
|
65
66
|
Work: Application_6.default,
|
|
67
|
+
MicroMerchant: Application_7.default,
|
|
66
68
|
getInstance: getInstance,
|
|
67
69
|
};
|
|
68
70
|
this.CacheInterface = CacheInterface_1.default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"data":{"errcode":0,"errmsg":"ok","access_token":"moke-token","expires_in":7200},"lifeTime":
|
|
1
|
+
{"data":{"errcode":0,"errmsg":"ok","access_token":"moke-token","expires_in":7200},"lifeTime":1641409629}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"data":{"errcode":0,"errmsg":"ok"},"lifeTime":
|
|
1
|
+
{"data":{"errcode":0,"errmsg":"ok"},"lifeTime":1641409628}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-easywechat",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "EasyWechat SDK for Node.js (NOT OFFICIAL)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -27,11 +27,10 @@
|
|
|
27
27
|
"typescript": "^4.2.3"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"axios": "^0.21.
|
|
30
|
+
"axios": "^0.21.4",
|
|
31
31
|
"form-data": "^4.0.0",
|
|
32
|
-
"node-
|
|
33
|
-
"
|
|
34
|
-
"qs": "^6.9.6",
|
|
32
|
+
"node-socialite": "^1.2.4",
|
|
33
|
+
"qs": "^6.10.1",
|
|
35
34
|
"raw-body": "^2.4.1",
|
|
36
35
|
"xml2js": "^0.4.23"
|
|
37
36
|
}
|