node-easywechat 3.6.2 → 3.7.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/.github/ISSUE_TEMPLATE/bug_report.md +16 -0
- package/CHANGELOG.md +11 -0
- package/README.md +25 -0
- package/dist/Channel/AccessToken.d.ts +8 -0
- package/dist/Channel/AccessToken.js +15 -0
- package/dist/Channel/Account.d.ts +4 -0
- package/dist/Channel/Account.js +8 -0
- package/dist/Channel/Application.d.ts +60 -0
- package/dist/Channel/Application.js +125 -0
- package/dist/Channel/Contracts/AccountInterface.d.ts +23 -0
- package/dist/Channel/Contracts/AccountInterface.js +25 -0
- package/dist/Channel/Contracts/ApplicationInterface.d.ts +62 -0
- package/dist/Channel/Contracts/ApplicationInterface.js +55 -0
- package/dist/Channel/Message.d.ts +542 -0
- package/dist/Channel/Message.js +9 -0
- package/dist/Channel/Server.d.ts +91 -0
- package/dist/Channel/Server.js +16 -0
- package/dist/Core/Contracts/ServerInterface.d.ts +3 -3
- package/dist/Core/Contracts/ServerInterface.js +3 -3
- package/dist/Core/Mixins/{DecryptXmlMessageMixin.d.ts → DecryptMessageMixin.d.ts} +2 -2
- package/dist/Core/Mixins/{DecryptXmlMessageMixin.js → DecryptMessageMixin.js} +11 -4
- package/dist/Core/Mixins/HandlersMixin.d.ts +8 -8
- package/dist/Core/Mixins/HandlersMixin.js +8 -8
- package/dist/Core/Mixins/{ResponseXmlMessageMixin.d.ts → ResponseMessageMixin.d.ts} +4 -3
- package/dist/Core/Mixins/{ResponseXmlMessageMixin.js → ResponseMessageMixin.js} +16 -5
- package/dist/OfficialAccount/Server.d.ts +24 -0
- package/dist/OfficialAccount/Server.js +4 -1
- package/dist/Pay/Client.js +10 -1
- package/dist/Types/global.d.ts +31 -0
- package/dist/index.d.ts +14 -2
- package/dist/index.js +19 -1
- package/package.json +1 -1
|
@@ -0,0 +1,542 @@
|
|
|
1
|
+
import BaseMessage from '../OfficialAccount/Message';
|
|
2
|
+
declare class Message extends BaseMessage {
|
|
3
|
+
}
|
|
4
|
+
interface Message {
|
|
5
|
+
/**
|
|
6
|
+
* 消息密文,兼容模式、安全模式才有
|
|
7
|
+
*/
|
|
8
|
+
Encrypt?: string;
|
|
9
|
+
/**
|
|
10
|
+
* 开发者微信号
|
|
11
|
+
*/
|
|
12
|
+
ToUserName?: string;
|
|
13
|
+
/**
|
|
14
|
+
* 发送方帐号 OpenId
|
|
15
|
+
*/
|
|
16
|
+
FromUserName?: string;
|
|
17
|
+
/**
|
|
18
|
+
* 消息创建时间
|
|
19
|
+
*/
|
|
20
|
+
CreateTime?: number;
|
|
21
|
+
/**
|
|
22
|
+
* 消息类型
|
|
23
|
+
* - `event` 事件
|
|
24
|
+
*/
|
|
25
|
+
MsgType?: string;
|
|
26
|
+
/**
|
|
27
|
+
* 事件类型
|
|
28
|
+
* - `product_category_audit` 类目审核结果
|
|
29
|
+
* - `product_spu_audit` 商品审核
|
|
30
|
+
* - `product_spu_listing` 商品上下架
|
|
31
|
+
* - `product_spu_update` 商品更新
|
|
32
|
+
* - `channels_ec_order_new` 订单下单
|
|
33
|
+
* - `channels_ec_order_cancel` 订单取消
|
|
34
|
+
* - `channels_ec_order_pay` 订单支付成功
|
|
35
|
+
* - `channels_ec_order_deliver` 订单发货
|
|
36
|
+
* - `channels_ec_order_confirm` 订单确认收货
|
|
37
|
+
* - `channels_ec_order_settle` 订单结算成功
|
|
38
|
+
* - `channels_ec_order_ext_info_update` 订单其它信息更新
|
|
39
|
+
* - `channels_ec_acct_notify` 结算账户变更
|
|
40
|
+
* - `channels_ec_withdraw_notify` 提现
|
|
41
|
+
* - `qrcode_status` 提现二维码
|
|
42
|
+
* - `channels_ec_coupon_receive` 领取优惠券
|
|
43
|
+
* - `channels_ec_coupon_create` 创建优惠券
|
|
44
|
+
* - `channels_ec_coupon_delete` 删除优惠券
|
|
45
|
+
* - `channels_ec_coupon_expire` 优惠券过期
|
|
46
|
+
* - `channels_ec_coupon_info_change` 更新优惠券信息
|
|
47
|
+
* - `channels_ec_coupon_invalid` 作废优惠券
|
|
48
|
+
* - `channels_ec_user_coupon_expire` 用户优惠券过期
|
|
49
|
+
* - `channels_ec_user_coupon_unuse` 优惠券返还
|
|
50
|
+
* - `channels_ec_user_coupon_use` 优惠券核销
|
|
51
|
+
* - `channels_ec_aftersale_update` 售后单更新
|
|
52
|
+
* - `channels_ec_complaint_update` 纠纷更新
|
|
53
|
+
* - `channels_ec_phonenumberpool_update` 虚拟号更新
|
|
54
|
+
* - `head_supplier_item_update` 团长商品变更
|
|
55
|
+
* - `channels_ec_brand` 品牌资质
|
|
56
|
+
* - `channels_ec_vip_join` 用户加入会员
|
|
57
|
+
* - `channels_ec_vip_close` 用户注销会员
|
|
58
|
+
* - `channels_ec_vip_grade_info_update` 用户等级信息更新
|
|
59
|
+
* - `channels_ec_vip_task_award` 用户获得任务奖励
|
|
60
|
+
* - `channels_ec_vip_score_update` 用户积分更新
|
|
61
|
+
* - `channels_ec_vip_score_exchange` 用户积分兑换
|
|
62
|
+
* @scope MsgType='event'
|
|
63
|
+
*/
|
|
64
|
+
Event?: string;
|
|
65
|
+
/**
|
|
66
|
+
* 类目审核事件主体
|
|
67
|
+
* @scope Event='product_category_audit'
|
|
68
|
+
*/
|
|
69
|
+
ProductCategoryAudit?: {
|
|
70
|
+
/**
|
|
71
|
+
* 审核id
|
|
72
|
+
*/
|
|
73
|
+
audit_id: string;
|
|
74
|
+
/**
|
|
75
|
+
* 审核状态。1: 审核中, 2: 审核拒绝, 3: 审核通过, 12: 主动取消申请单
|
|
76
|
+
*/
|
|
77
|
+
status: number;
|
|
78
|
+
/**
|
|
79
|
+
* 原因
|
|
80
|
+
*/
|
|
81
|
+
reason: string;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* 商品审核事件主体
|
|
85
|
+
* @scope Event='product_spu_audit'
|
|
86
|
+
*/
|
|
87
|
+
ProductSpuAudit?: {
|
|
88
|
+
/**
|
|
89
|
+
* 商品ID
|
|
90
|
+
*/
|
|
91
|
+
product_id: string;
|
|
92
|
+
/**
|
|
93
|
+
* 审核状态。2:审核不通过;3:审核通过;4:撤销审核
|
|
94
|
+
*/
|
|
95
|
+
status: number;
|
|
96
|
+
/**
|
|
97
|
+
* 原因
|
|
98
|
+
*/
|
|
99
|
+
reason: string;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* 商品上下架事件主体
|
|
103
|
+
* @scope Event='product_spu_listing'
|
|
104
|
+
*/
|
|
105
|
+
ProductSpuListing?: {
|
|
106
|
+
/**
|
|
107
|
+
* 商品ID
|
|
108
|
+
*/
|
|
109
|
+
product_id: string;
|
|
110
|
+
/**
|
|
111
|
+
* 状态。5:上架;11:自主下架;13:系统下架;14:保证金违规下架;15:品牌到期下架; 20:封禁下架
|
|
112
|
+
*/
|
|
113
|
+
status: number;
|
|
114
|
+
/**
|
|
115
|
+
* 原因
|
|
116
|
+
*/
|
|
117
|
+
reason: string;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* 商品更新事件主体
|
|
121
|
+
* @scope Event='product_spu_update'
|
|
122
|
+
*/
|
|
123
|
+
ProductSpuUpdate?: {
|
|
124
|
+
/**
|
|
125
|
+
* 商品ID
|
|
126
|
+
*/
|
|
127
|
+
product_id: string;
|
|
128
|
+
/**
|
|
129
|
+
* 操作。0: 更新; 1: 新增; 2: 删除
|
|
130
|
+
*/
|
|
131
|
+
status: number;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* 订单下单事件主体
|
|
135
|
+
* @scope Event='channels_ec_order_new' | 'channels_ec_order_cancel' | 'channels_ec_order_pay' | 'channels_ec_order_deliver' | 'channels_ec_order_confirm' | 'channels_ec_order_settle' | 'channels_ec_order_ext_info_update'
|
|
136
|
+
*/
|
|
137
|
+
order_info?: {
|
|
138
|
+
/**
|
|
139
|
+
* 订单号
|
|
140
|
+
*/
|
|
141
|
+
order_id: string;
|
|
142
|
+
/**
|
|
143
|
+
* 取消原因。1:用户取消;2:超时取消;3:全部商品售后完成,订单取消
|
|
144
|
+
* @scope Event='channels_ec_order_cancel'
|
|
145
|
+
*/
|
|
146
|
+
cancel_type?: number;
|
|
147
|
+
/**
|
|
148
|
+
* 付款时间戳
|
|
149
|
+
* @scope Event='channels_ec_order_pay'
|
|
150
|
+
*/
|
|
151
|
+
pay_time?: number;
|
|
152
|
+
/**
|
|
153
|
+
* 发货状态。0:尚未全部发货;1:全部商品发货完成
|
|
154
|
+
* @scope Event='channels_ec_order_deliver'
|
|
155
|
+
*/
|
|
156
|
+
finish_delivery?: number;
|
|
157
|
+
/**
|
|
158
|
+
* 确认方式。1:用户确认收货;2:超时自动确认收货
|
|
159
|
+
* @scope Event='channels_ec_order_confirm'
|
|
160
|
+
*/
|
|
161
|
+
confirm_type?: number;
|
|
162
|
+
/**
|
|
163
|
+
* 结算时间戳
|
|
164
|
+
* @scope Event='channels_ec_order_settle'
|
|
165
|
+
*/
|
|
166
|
+
settle_time?: number;
|
|
167
|
+
/**
|
|
168
|
+
* 事件类型。
|
|
169
|
+
* - 1:联盟佣金信息
|
|
170
|
+
* - 2:商家主动地址修改或通过用户修改地址申请
|
|
171
|
+
* - 3:商家备注修改
|
|
172
|
+
* - 4:用户发起申请修改收货地址,特殊条件下需要商家审批
|
|
173
|
+
* - 5:订单虚拟号码信息更新
|
|
174
|
+
* - 6:分享员信息更新
|
|
175
|
+
* - 7:用户催发货
|
|
176
|
+
* @scope Event='channels_ec_order_ext_info_update'
|
|
177
|
+
*/
|
|
178
|
+
type?: number;
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* 结算账户变更事件主体
|
|
182
|
+
* @scope Event='channels_ec_acct_notify'
|
|
183
|
+
*/
|
|
184
|
+
account_info?: {
|
|
185
|
+
/**
|
|
186
|
+
* 结算账户变更事件, 1.修改结算账户
|
|
187
|
+
*/
|
|
188
|
+
event: number;
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* 提现事件主体
|
|
192
|
+
* @scope Event='channels_ec_withdraw_notify'
|
|
193
|
+
*/
|
|
194
|
+
withdraw_info?: {
|
|
195
|
+
/**
|
|
196
|
+
* 提现单号
|
|
197
|
+
*/
|
|
198
|
+
withdraw_id: string;
|
|
199
|
+
/**
|
|
200
|
+
* 提现事件。1.发起提现,生成二维码 2.扫码验证成功,申请提现 3.提现成功 4.提现失败
|
|
201
|
+
*/
|
|
202
|
+
event: number;
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* 提现二维码事件主体
|
|
206
|
+
* @scope Event='qrcode_status'
|
|
207
|
+
*/
|
|
208
|
+
qrcode_info?: {
|
|
209
|
+
/**
|
|
210
|
+
* 二维码ticket
|
|
211
|
+
*/
|
|
212
|
+
ticket: string;
|
|
213
|
+
/**
|
|
214
|
+
* 二维码状态,1.已确认 2.已取消 3.已失效 4.已扫码
|
|
215
|
+
*/
|
|
216
|
+
status: number;
|
|
217
|
+
/**
|
|
218
|
+
* 扫码者身份, 0.非管理员 1.管理员
|
|
219
|
+
*/
|
|
220
|
+
scan_user_type: number;
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* 领取优惠券事件主体
|
|
224
|
+
* @scope Event='channels_ec_coupon_receive'
|
|
225
|
+
*/
|
|
226
|
+
receive_info?: {
|
|
227
|
+
/**
|
|
228
|
+
* 领取的优惠券ID
|
|
229
|
+
*/
|
|
230
|
+
coupon_id: string;
|
|
231
|
+
/**
|
|
232
|
+
* 生成的用户券ID
|
|
233
|
+
*/
|
|
234
|
+
user_coupon_id: string;
|
|
235
|
+
/**
|
|
236
|
+
* 领券时间
|
|
237
|
+
*/
|
|
238
|
+
receive_time: number;
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* 优惠券信息主体
|
|
242
|
+
* @scope Event='channels_ec_coupon_create' | 'channels_ec_coupon_delete' | 'channels_ec_coupon_expire' | 'channels_ec_coupon_info_change' | 'channels_ec_coupon_invalid' | 'channels_ec_user_coupon_unuse'
|
|
243
|
+
*/
|
|
244
|
+
coupon_info?: {
|
|
245
|
+
/**
|
|
246
|
+
* 优惠券ID
|
|
247
|
+
*/
|
|
248
|
+
coupon_id: string;
|
|
249
|
+
/**
|
|
250
|
+
* 创建时间
|
|
251
|
+
* @scope Event='channels_ec_coupon_create'
|
|
252
|
+
*/
|
|
253
|
+
create_time?: string;
|
|
254
|
+
/**
|
|
255
|
+
* 删除时间
|
|
256
|
+
* @scope Event='channels_ec_coupon_delete'
|
|
257
|
+
*/
|
|
258
|
+
delete_time?: string;
|
|
259
|
+
/**
|
|
260
|
+
* 过期时间
|
|
261
|
+
* @scope Event='channels_ec_coupon_expire'
|
|
262
|
+
*/
|
|
263
|
+
expire_time?: string;
|
|
264
|
+
/**
|
|
265
|
+
* 更新时间
|
|
266
|
+
* @scope Event='channels_ec_coupon_info_change'
|
|
267
|
+
*/
|
|
268
|
+
change_time?: string;
|
|
269
|
+
/**
|
|
270
|
+
* 作废时间
|
|
271
|
+
* @scope Event='channels_ec_coupon_invalid'
|
|
272
|
+
*/
|
|
273
|
+
invalid_time?: string;
|
|
274
|
+
/**
|
|
275
|
+
* 用户券ID
|
|
276
|
+
* @scope Event='channels_ec_user_coupon_unuse'
|
|
277
|
+
*/
|
|
278
|
+
user_coupon_id?: string;
|
|
279
|
+
/**
|
|
280
|
+
* 用券的订单ID
|
|
281
|
+
* @scope Event='channels_ec_user_coupon_unuse'
|
|
282
|
+
*/
|
|
283
|
+
order_id?: string;
|
|
284
|
+
/**
|
|
285
|
+
* 返还时间
|
|
286
|
+
* @scope Event='channels_ec_user_coupon_unuse'
|
|
287
|
+
*/
|
|
288
|
+
unuse_time?: string;
|
|
289
|
+
};
|
|
290
|
+
/**
|
|
291
|
+
* 用户优惠券过期信息主体
|
|
292
|
+
* @scope Event='channels_ec_user_coupon_expire'
|
|
293
|
+
*/
|
|
294
|
+
user_coupon_info?: {
|
|
295
|
+
/**
|
|
296
|
+
* 优惠券ID
|
|
297
|
+
*/
|
|
298
|
+
coupon_id: string;
|
|
299
|
+
/**
|
|
300
|
+
* 用户券ID
|
|
301
|
+
*/
|
|
302
|
+
user_coupon_id: string;
|
|
303
|
+
/**
|
|
304
|
+
* 过期时间
|
|
305
|
+
*/
|
|
306
|
+
expire_time: string;
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* 优惠券核销信息主体
|
|
310
|
+
* @scope Event='channels_ec_user_coupon_use'
|
|
311
|
+
*/
|
|
312
|
+
use_info?: {
|
|
313
|
+
/**
|
|
314
|
+
* 优惠券ID
|
|
315
|
+
*/
|
|
316
|
+
coupon_id: string;
|
|
317
|
+
/**
|
|
318
|
+
* 用户券ID
|
|
319
|
+
*/
|
|
320
|
+
user_coupon_id: string;
|
|
321
|
+
/**
|
|
322
|
+
* 用券的订单ID
|
|
323
|
+
*/
|
|
324
|
+
order_id: string;
|
|
325
|
+
/**
|
|
326
|
+
* 核销时间
|
|
327
|
+
*/
|
|
328
|
+
use_time: string;
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* 售后单更新信息主体
|
|
332
|
+
* @scope Event='channels_ec_aftersale_update'
|
|
333
|
+
*/
|
|
334
|
+
finder_shop_aftersale_status_update?: {
|
|
335
|
+
/**
|
|
336
|
+
* 售后单状态
|
|
337
|
+
* @see [状态值及说明](https://developers.weixin.qq.com/doc/channels/API/aftersale/ec_callback/channels_ec_aftersale_update.html#枚举-EcAftersaleInfoStatus)
|
|
338
|
+
*/
|
|
339
|
+
status: string;
|
|
340
|
+
/**
|
|
341
|
+
* 小店售后单号
|
|
342
|
+
*/
|
|
343
|
+
after_sale_order_id: string;
|
|
344
|
+
/**
|
|
345
|
+
* 小店订单号
|
|
346
|
+
*/
|
|
347
|
+
order_id: string;
|
|
348
|
+
};
|
|
349
|
+
/**
|
|
350
|
+
* 纠纷更新信息主体
|
|
351
|
+
* @scope Event='channels_ec_complaint_update'
|
|
352
|
+
*/
|
|
353
|
+
finder_shop_complaint?: {
|
|
354
|
+
/**
|
|
355
|
+
* 售后单状态
|
|
356
|
+
* @see [状态值及说明](https://developers.weixin.qq.com/doc/channels/API/complaint/callback/channels_ec_complaint_update.html#枚举-EcComplaintInfoStatus)
|
|
357
|
+
*/
|
|
358
|
+
complaint_status: string;
|
|
359
|
+
/**
|
|
360
|
+
* 小店售后单号
|
|
361
|
+
*/
|
|
362
|
+
after_sale_order_id: string;
|
|
363
|
+
/**
|
|
364
|
+
* 纠纷单号
|
|
365
|
+
*/
|
|
366
|
+
complaint_id: string;
|
|
367
|
+
/**
|
|
368
|
+
* 小店订单号
|
|
369
|
+
*/
|
|
370
|
+
order_id: string;
|
|
371
|
+
};
|
|
372
|
+
/**
|
|
373
|
+
* 虚拟号更新信息主体
|
|
374
|
+
* @scope Event='channels_ec_phonenumberpool_update'
|
|
375
|
+
*/
|
|
376
|
+
update_info?: {
|
|
377
|
+
/**
|
|
378
|
+
* 状态。1:虚拟号池有更新,需重新获取
|
|
379
|
+
*/
|
|
380
|
+
status: string;
|
|
381
|
+
};
|
|
382
|
+
/**
|
|
383
|
+
* 团长商品变更信息主体
|
|
384
|
+
* @scope Event='head_supplier_item_update'
|
|
385
|
+
*/
|
|
386
|
+
item_info?: {
|
|
387
|
+
/**
|
|
388
|
+
* 商品变更类型,1:新增商品;2:更新商品
|
|
389
|
+
*/
|
|
390
|
+
event_type: number;
|
|
391
|
+
/**
|
|
392
|
+
* 团长商品所属小店appid
|
|
393
|
+
*/
|
|
394
|
+
appid: string;
|
|
395
|
+
/**
|
|
396
|
+
* 商品id
|
|
397
|
+
*/
|
|
398
|
+
product_id: string;
|
|
399
|
+
/**
|
|
400
|
+
* 商品版本号
|
|
401
|
+
*/
|
|
402
|
+
version: string;
|
|
403
|
+
/**
|
|
404
|
+
* 商品更新字段,当event_type = 2时有值。
|
|
405
|
+
*
|
|
406
|
+
* commission_ratio、service_ratio、status、active_time分别表示佣金、服务费、商品状态和合作生效时间有变更
|
|
407
|
+
*/
|
|
408
|
+
update_fields: string[];
|
|
409
|
+
};
|
|
410
|
+
/**
|
|
411
|
+
* 品牌资质信息主体
|
|
412
|
+
* @scope Event='channels_ec_brand'
|
|
413
|
+
*/
|
|
414
|
+
BrandEvent?: {
|
|
415
|
+
/**
|
|
416
|
+
* 品牌库中的品牌编号
|
|
417
|
+
*/
|
|
418
|
+
brand_id: string;
|
|
419
|
+
/**
|
|
420
|
+
* 回调状态
|
|
421
|
+
* @see [状态值及说明](https://developers.weixin.qq.com/doc/channels/API/brand/callback/brand_event.html#回调状态枚举-status)
|
|
422
|
+
*/
|
|
423
|
+
status: string;
|
|
424
|
+
/**
|
|
425
|
+
* 审核原因
|
|
426
|
+
*/
|
|
427
|
+
reason?: string;
|
|
428
|
+
};
|
|
429
|
+
/**
|
|
430
|
+
* 会员信息主体
|
|
431
|
+
* @scope Event='channels_ec_vip_join' | 'channels_ec_vip_close' | 'channels_ec_vip_grade_info_update' | 'channels_ec_vip_score_update'
|
|
432
|
+
*/
|
|
433
|
+
user_info?: {
|
|
434
|
+
/**
|
|
435
|
+
* 加入时间戳,单位为秒
|
|
436
|
+
* @scope Event='channels_ec_vip_join'
|
|
437
|
+
*/
|
|
438
|
+
join_time?: number;
|
|
439
|
+
/**
|
|
440
|
+
* 手机号码
|
|
441
|
+
* @scope Event='channels_ec_vip_join'
|
|
442
|
+
*/
|
|
443
|
+
phone_number?: string;
|
|
444
|
+
/**
|
|
445
|
+
* 注销时间戳,单位为秒
|
|
446
|
+
* @scope Event='channels_ec_vip_close'
|
|
447
|
+
*/
|
|
448
|
+
close_time?: string;
|
|
449
|
+
/**
|
|
450
|
+
* 当前会员等级
|
|
451
|
+
* @scope Event='channels_ec_vip_grade_info_update'
|
|
452
|
+
*/
|
|
453
|
+
grade?: number;
|
|
454
|
+
/**
|
|
455
|
+
* 当前等级经验值
|
|
456
|
+
* @scope Event='channels_ec_vip_grade_info_update'
|
|
457
|
+
*/
|
|
458
|
+
experience_value?: number;
|
|
459
|
+
/**
|
|
460
|
+
* 当前积分
|
|
461
|
+
* @scope Event='channels_ec_vip_score_update'
|
|
462
|
+
*/
|
|
463
|
+
score?: number;
|
|
464
|
+
/**
|
|
465
|
+
* 本次改动积分
|
|
466
|
+
* @scope Event='channels_ec_vip_score_update'
|
|
467
|
+
*/
|
|
468
|
+
delta_score?: number;
|
|
469
|
+
/**
|
|
470
|
+
* 流水类型
|
|
471
|
+
* @scope Event='channels_ec_vip_score_update'
|
|
472
|
+
* @see [类型值及说明](https://developers.weixin.qq.com/doc/channels/API/vip/callback/score/user_score_update.html#枚举-flow_type)
|
|
473
|
+
*/
|
|
474
|
+
flow_type?: number;
|
|
475
|
+
};
|
|
476
|
+
/**
|
|
477
|
+
* 会员信息主体
|
|
478
|
+
* @scope Event='channels_ec_vip_task_award'
|
|
479
|
+
*/
|
|
480
|
+
task_info?: {
|
|
481
|
+
/**
|
|
482
|
+
* 任务ID
|
|
483
|
+
*/
|
|
484
|
+
task_id: number;
|
|
485
|
+
/**
|
|
486
|
+
* 任务名称
|
|
487
|
+
*/
|
|
488
|
+
task_name: string;
|
|
489
|
+
/**
|
|
490
|
+
* 奖励
|
|
491
|
+
*/
|
|
492
|
+
award_info: {
|
|
493
|
+
/**
|
|
494
|
+
* 奖励类型
|
|
495
|
+
*/
|
|
496
|
+
award_type: number;
|
|
497
|
+
/**
|
|
498
|
+
* 奖励的优惠券ID
|
|
499
|
+
*/
|
|
500
|
+
coupon_id: number;
|
|
501
|
+
/**
|
|
502
|
+
* 奖励的积分
|
|
503
|
+
*/
|
|
504
|
+
gain_score: number;
|
|
505
|
+
};
|
|
506
|
+
};
|
|
507
|
+
/**
|
|
508
|
+
* 用户积分兑换信息主体
|
|
509
|
+
* @scope Event='channels_ec_vip_score_exchange'
|
|
510
|
+
*/
|
|
511
|
+
exchange_info?: {
|
|
512
|
+
/**
|
|
513
|
+
* 兑换积分
|
|
514
|
+
*/
|
|
515
|
+
pay_score: number;
|
|
516
|
+
/**
|
|
517
|
+
* 兑换类型。1:优惠券,2:商品
|
|
518
|
+
*/
|
|
519
|
+
score_item_type: number;
|
|
520
|
+
/**
|
|
521
|
+
* 兑换的优惠券
|
|
522
|
+
* @scope score_item_type=1
|
|
523
|
+
*/
|
|
524
|
+
coupon_info?: {
|
|
525
|
+
/**
|
|
526
|
+
* 优惠券ID
|
|
527
|
+
*/
|
|
528
|
+
related_coupon_id: number;
|
|
529
|
+
};
|
|
530
|
+
/**
|
|
531
|
+
* 兑换的商品
|
|
532
|
+
* @scope score_item_type=2
|
|
533
|
+
*/
|
|
534
|
+
product_info?: {
|
|
535
|
+
/**
|
|
536
|
+
* 商品ID
|
|
537
|
+
*/
|
|
538
|
+
related_product_id: number;
|
|
539
|
+
};
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
export = Message;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
const Message_1 = __importDefault(require("../OfficialAccount/Message"));
|
|
6
|
+
class Message extends Message_1.default {
|
|
7
|
+
}
|
|
8
|
+
;
|
|
9
|
+
module.exports = Message;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import ServerRequestInterface from '../Core/Http/Contracts/ServerRequestInterface';
|
|
2
|
+
import BaseServer from '../OfficialAccount/Server';
|
|
3
|
+
import { ServerHandlerClosure } from '../Types/global';
|
|
4
|
+
import Message from './Message';
|
|
5
|
+
declare class Server extends BaseServer {
|
|
6
|
+
/**
|
|
7
|
+
* 添加普通消息处理器
|
|
8
|
+
* @deprecated 视频号不支持普通消息
|
|
9
|
+
*/
|
|
10
|
+
addMessageListener(): this;
|
|
11
|
+
}
|
|
12
|
+
interface Server {
|
|
13
|
+
/**
|
|
14
|
+
* 从后添加处理器
|
|
15
|
+
* @param handler
|
|
16
|
+
*/
|
|
17
|
+
with(next: ServerHandlerClosure<Message>): this;
|
|
18
|
+
/**
|
|
19
|
+
* 从后添加处理器
|
|
20
|
+
* @param handler
|
|
21
|
+
*/
|
|
22
|
+
withHandler(next: ServerHandlerClosure<Message>): this;
|
|
23
|
+
/**
|
|
24
|
+
* 从前添加处理器
|
|
25
|
+
* @param handler
|
|
26
|
+
*/
|
|
27
|
+
prepend(next: ServerHandlerClosure<Message>): this;
|
|
28
|
+
/**
|
|
29
|
+
* 从前添加处理器
|
|
30
|
+
* @param handler
|
|
31
|
+
*/
|
|
32
|
+
prependHandler(next: ServerHandlerClosure<Message>): this;
|
|
33
|
+
/**
|
|
34
|
+
* 删除处理器
|
|
35
|
+
* @param handler
|
|
36
|
+
*/
|
|
37
|
+
without(next: ServerHandlerClosure<Message>): this;
|
|
38
|
+
/**
|
|
39
|
+
* 删除处理器
|
|
40
|
+
* @param handler
|
|
41
|
+
*/
|
|
42
|
+
withoutHandler(next: ServerHandlerClosure<Message>): this;
|
|
43
|
+
/**
|
|
44
|
+
* 添加事件消息处理器
|
|
45
|
+
*
|
|
46
|
+
* - `product_category_audit` 类目审核结果
|
|
47
|
+
* - `product_spu_audit` 商品审核
|
|
48
|
+
* - `product_spu_listing` 商品上下架
|
|
49
|
+
* - `product_spu_update` 商品更新
|
|
50
|
+
* - `channels_ec_order_new` 订单下单
|
|
51
|
+
* - `channels_ec_order_cancel` 订单取消
|
|
52
|
+
* - `channels_ec_order_pay` 订单支付成功
|
|
53
|
+
* - `channels_ec_order_deliver` 订单发货
|
|
54
|
+
* - `channels_ec_order_confirm` 订单确认收货
|
|
55
|
+
* - `channels_ec_order_settle` 订单结算成功
|
|
56
|
+
* - `channels_ec_order_ext_info_update` 订单其它信息更新
|
|
57
|
+
* - `channels_ec_acct_notify` 结算账户变更
|
|
58
|
+
* - `channels_ec_withdraw_notify` 提现
|
|
59
|
+
* - `qrcode_status` 提现二维码
|
|
60
|
+
* - `channels_ec_coupon_receive` 领取优惠券
|
|
61
|
+
* - `channels_ec_coupon_create` 创建优惠券
|
|
62
|
+
* - `channels_ec_coupon_delete` 删除优惠券
|
|
63
|
+
* - `channels_ec_coupon_expire` 优惠券过期
|
|
64
|
+
* - `channels_ec_coupon_info_change` 更新优惠券信息
|
|
65
|
+
* - `channels_ec_coupon_invalid` 作废优惠券
|
|
66
|
+
* - `channels_ec_user_coupon_expire` 用户优惠券过期
|
|
67
|
+
* - `channels_ec_user_coupon_unuse` 优惠券返还
|
|
68
|
+
* - `channels_ec_user_coupon_use` 优惠券核销
|
|
69
|
+
* - `channels_ec_aftersale_update` 售后单更新
|
|
70
|
+
* - `channels_ec_complaint_update` 纠纷更新
|
|
71
|
+
* - `channels_ec_phonenumberpool_update` 虚拟号更新
|
|
72
|
+
* - `head_supplier_item_update` 团长商品变更
|
|
73
|
+
* - `channels_ec_brand` 品牌资质
|
|
74
|
+
* - `channels_ec_vip_join` 用户加入会员
|
|
75
|
+
* - `channels_ec_vip_close` 用户注销会员
|
|
76
|
+
* - `channels_ec_vip_grade_info_update` 用户等级信息更新
|
|
77
|
+
* - `channels_ec_vip_task_award` 用户获得任务奖励
|
|
78
|
+
* - `channels_ec_vip_score_update` 用户积分更新
|
|
79
|
+
* - `channels_ec_vip_score_exchange` 用户积分兑换
|
|
80
|
+
*
|
|
81
|
+
* @param event
|
|
82
|
+
* @param handler
|
|
83
|
+
*/
|
|
84
|
+
addEventListener(event: string, handler: ServerHandlerClosure<Message>): this;
|
|
85
|
+
/**
|
|
86
|
+
* 获取来自微信服务器的推送消息
|
|
87
|
+
* @param request 未设置该参数时,则从当前服务端收到的请求中获取
|
|
88
|
+
*/
|
|
89
|
+
getRequestMessage(request: ServerRequestInterface): Promise<Message>;
|
|
90
|
+
}
|
|
91
|
+
export = Server;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
const Server_1 = __importDefault(require("../OfficialAccount/Server"));
|
|
6
|
+
class Server extends Server_1.default {
|
|
7
|
+
/**
|
|
8
|
+
* 添加普通消息处理器
|
|
9
|
+
* @deprecated 视频号不支持普通消息
|
|
10
|
+
*/
|
|
11
|
+
addMessageListener() {
|
|
12
|
+
return this;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
;
|
|
16
|
+
module.exports = Server;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ResponseInterface from "../Http/Contracts/ResponseInterface";
|
|
2
|
-
import
|
|
2
|
+
import DecryptMessageMixin from "../Mixins/DecryptMessageMixin";
|
|
3
3
|
import HandlersMixin from "../Mixins/HandlersMixin";
|
|
4
|
-
import
|
|
4
|
+
import ResponseMessageMixin from "../Mixins/ResponseMessageMixin";
|
|
5
5
|
import ServerRequestMixin from "../Mixins/ServerRequestMixin";
|
|
6
6
|
declare abstract class ServerInterface {
|
|
7
7
|
constructor();
|
|
@@ -10,6 +10,6 @@ declare abstract class ServerInterface {
|
|
|
10
10
|
*/
|
|
11
11
|
serve(): Promise<ResponseInterface>;
|
|
12
12
|
}
|
|
13
|
-
interface ServerInterface extends HandlersMixin,
|
|
13
|
+
interface ServerInterface extends HandlersMixin, DecryptMessageMixin, ResponseMessageMixin, ServerRequestMixin {
|
|
14
14
|
}
|
|
15
15
|
export = ServerInterface;
|
|
@@ -11,9 +11,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
|
-
const
|
|
14
|
+
const DecryptMessageMixin_1 = __importDefault(require("../Mixins/DecryptMessageMixin"));
|
|
15
15
|
const HandlersMixin_1 = __importDefault(require("../Mixins/HandlersMixin"));
|
|
16
|
-
const
|
|
16
|
+
const ResponseMessageMixin_1 = __importDefault(require("../Mixins/ResponseMessageMixin"));
|
|
17
17
|
const ServerRequestMixin_1 = __importDefault(require("../Mixins/ServerRequestMixin"));
|
|
18
18
|
const Utils_1 = require("../Support/Utils");
|
|
19
19
|
class ServerInterface {
|
|
@@ -29,5 +29,5 @@ class ServerInterface {
|
|
|
29
29
|
}
|
|
30
30
|
;
|
|
31
31
|
;
|
|
32
|
-
(0, Utils_1.applyMixins)(ServerInterface, [HandlersMixin_1.default,
|
|
32
|
+
(0, Utils_1.applyMixins)(ServerInterface, [HandlersMixin_1.default, DecryptMessageMixin_1.default, ResponseMessageMixin_1.default, ServerRequestMixin_1.default]);
|
|
33
33
|
module.exports = ServerInterface;
|