tmc.js 0.3.13 → 0.3.15
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 -2
- package/lib/message.js +3 -3
- package/package.json +1 -1
- package/types/index.d.ts +4 -0
- package/types/message.in.d.ts +5 -1
- package/types/taobao.d.ts +6 -0
package/README.md
CHANGED
|
@@ -134,7 +134,7 @@ new Tmc('your_app_key', 'your_app_secret', { autoReplyConfirmation: false })
|
|
|
134
134
|
|
|
135
135
|
## 支持的TOPICS
|
|
136
136
|
|
|
137
|
-
<details><summary>共计 83+ 类别,
|
|
137
|
+
<details><summary>共计 83+ 类别,446+ 消息数</summary>
|
|
138
138
|
|
|
139
139
|
| 类别 | 消息数 |
|
|
140
140
|
| --- | --- |
|
|
@@ -162,7 +162,7 @@ new Tmc('your_app_key', 'your_app_secret', { autoReplyConfirmation: false })
|
|
|
162
162
|
| 电子发票 | 20 |
|
|
163
163
|
| 航旅度假交易 | 8 |
|
|
164
164
|
| YunOS YoC | 2 |
|
|
165
|
-
| 淘宝直播API |
|
|
165
|
+
| 淘宝直播API | 3 |
|
|
166
166
|
| 阿里物联 | 2 |
|
|
167
167
|
| 全球购跨境物流 | 1 |
|
|
168
168
|
| 零售plus | 8 |
|
|
@@ -228,6 +228,10 @@ new Tmc('your_app_key', 'your_app_secret', { autoReplyConfirmation: false })
|
|
|
228
228
|
|
|
229
229
|
- [淘宝开放平台-消息服务使用介绍](https://open.taobao.com/doc.htm?docId=101663&docType=1)
|
|
230
230
|
|
|
231
|
+
## 变更历史
|
|
232
|
+
|
|
233
|
+
It used [the github release page for the Changelog](releases) here.
|
|
234
|
+
|
|
231
235
|
## License
|
|
232
236
|
|
|
233
237
|
[MIT](LICENSE)
|
package/lib/message.js
CHANGED
|
@@ -131,13 +131,13 @@ class Encoder {
|
|
|
131
131
|
|
|
132
132
|
if (type === 'number') {
|
|
133
133
|
switch (true) {
|
|
134
|
-
case value >= -128 && value <
|
|
134
|
+
case value >= -128 && value < 128: //[-(2**7), 2**7)
|
|
135
135
|
return this.put(Byte).put(value);
|
|
136
136
|
|
|
137
|
-
case value >= -32_768 && value <
|
|
137
|
+
case value >= -32_768 && value < 32_768: //[-(2**15), 2**15)
|
|
138
138
|
return this.put(Int16).putShort(value);
|
|
139
139
|
|
|
140
|
-
case value >= -2_147_483_648 && value <
|
|
140
|
+
case value >= -2_147_483_648 && value < 2_147_483_648: //[-(2**31), 2**31)
|
|
141
141
|
return this.put(Int32).putInt(value);
|
|
142
142
|
|
|
143
143
|
default:
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -588,6 +588,8 @@ declare interface TaoTopicsDescriptor {
|
|
|
588
588
|
taobao_jipiao_SellerOrderNotify(fn: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoJipiaoSellerOrderNotify) => void): TaoMessageConsumer;
|
|
589
589
|
/** {@link IncomingMessage.TaobaoJipiaoSellerRefundOrderNotify 淘宝机票 > 【机票代理商】退票订单通知} */
|
|
590
590
|
taobao_jipiao_SellerRefundOrderNotify(fn: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoJipiaoSellerRefundOrderNotify) => void): TaoMessageConsumer;
|
|
591
|
+
/** {@link IncomingMessage.TaobaoLiveAgencyItemChanged 淘宝直播API > 直播严选机构商品池变化通知} */
|
|
592
|
+
taobao_live_AgencyItemChanged(fn: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoLiveAgencyItemChanged) => void): TaoMessageConsumer;
|
|
591
593
|
/** {@link IncomingMessage.TaobaoLiveFeedRelated 淘宝直播API > 淘宝直播上下播消息} */
|
|
592
594
|
taobao_live_FeedRelated(fn: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoLiveFeedRelated) => void): TaoMessageConsumer;
|
|
593
595
|
/** {@link IncomingMessage.TaobaoLiveTcpOrder 淘宝直播API > 淘宝直播订单消息} */
|
|
@@ -1727,6 +1729,8 @@ declare interface TaoEventsListener {
|
|
|
1727
1729
|
on(topic: 'taobao_jipiao_SellerOrderNotify', listener: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoJipiaoSellerOrderNotify) => void): TaoMessageConsumer;
|
|
1728
1730
|
/** {@link IncomingMessage.TaobaoJipiaoSellerRefundOrderNotify 淘宝机票 > 【机票代理商】退票订单通知} */
|
|
1729
1731
|
on(topic: 'taobao_jipiao_SellerRefundOrderNotify', listener: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoJipiaoSellerRefundOrderNotify) => void): TaoMessageConsumer;
|
|
1732
|
+
/** {@link IncomingMessage.TaobaoLiveAgencyItemChanged 淘宝直播API > 直播严选机构商品池变化通知} */
|
|
1733
|
+
on(topic: 'taobao_live_AgencyItemChanged', listener: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoLiveAgencyItemChanged) => void): TaoMessageConsumer;
|
|
1730
1734
|
/** {@link IncomingMessage.TaobaoLiveFeedRelated 淘宝直播API > 淘宝直播上下播消息} */
|
|
1731
1735
|
on(topic: 'taobao_live_FeedRelated', listener: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoLiveFeedRelated) => void): TaoMessageConsumer;
|
|
1732
1736
|
/** {@link IncomingMessage.TaobaoLiveTcpOrder 淘宝直播API > 淘宝直播订单消息} */
|
package/types/message.in.d.ts
CHANGED
|
@@ -547,6 +547,8 @@ declare namespace IncomingMessage {
|
|
|
547
547
|
type TaobaoJipiaoSellerOrderNotify = Message & { content?: MessageContent & { topic?: 'taobao_jipiao_SellerOrderNotify', content?: string | Taobao.Jipiao.SellerOrderNotify } };
|
|
548
548
|
/** {@link Taobao.Jipiao.SellerRefundOrderNotify 淘宝机票 > 【机票代理商】退票订单通知} */
|
|
549
549
|
type TaobaoJipiaoSellerRefundOrderNotify = Message & { content?: MessageContent & { topic?: 'taobao_jipiao_SellerRefundOrderNotify', content?: string | Taobao.Jipiao.SellerRefundOrderNotify } };
|
|
550
|
+
/** {@link Taobao.Live.AgencyItemChanged 淘宝直播API > 直播严选机构商品池变化通知} */
|
|
551
|
+
type TaobaoLiveAgencyItemChanged = Message & { content?: MessageContent & { topic?: 'taobao_live_AgencyItemChanged', content?: string | Taobao.Live.AgencyItemChanged } };
|
|
550
552
|
/** {@link Taobao.Live.FeedRelated 淘宝直播API > 淘宝直播上下播消息} */
|
|
551
553
|
type TaobaoLiveFeedRelated = Message & { content?: MessageContent & { topic?: 'taobao_live_FeedRelated', content?: string | Taobao.Live.FeedRelated } };
|
|
552
554
|
/** {@link Taobao.Live.TcpOrder 淘宝直播API > 淘宝直播订单消息} */
|
|
@@ -1548,10 +1550,12 @@ declare namespace IncomingMessage {
|
|
|
1548
1550
|
| TaobaoJipiaoSellerOrderNotify
|
|
1549
1551
|
| TaobaoJipiaoSellerRefundOrderNotify;
|
|
1550
1552
|
/**
|
|
1553
|
+
* - {@link TaobaoLiveAgencyItemChanged 淘宝直播API > 直播严选机构商品池变化通知}
|
|
1551
1554
|
* - {@link TaobaoLiveFeedRelated 淘宝直播API > 淘宝直播上下播消息}
|
|
1552
1555
|
* - {@link TaobaoLiveTcpOrder 淘宝直播API > 淘宝直播订单消息}
|
|
1553
1556
|
*/
|
|
1554
|
-
type TaobaoLive =
|
|
1557
|
+
type TaobaoLive = TaobaoLiveAgencyItemChanged
|
|
1558
|
+
| TaobaoLiveFeedRelated
|
|
1555
1559
|
| TaobaoLiveTcpOrder;
|
|
1556
1560
|
/**
|
|
1557
1561
|
* - {@link TaobaoLogisticsLogsticDetailTrace 淘宝物流 > 物流详情跟踪消息}
|
package/types/taobao.d.ts
CHANGED
|
@@ -1327,6 +1327,12 @@ declare namespace Taobao.Jipiao {
|
|
|
1327
1327
|
|
|
1328
1328
|
/** 淘宝直播API */
|
|
1329
1329
|
declare namespace Taobao.Live {
|
|
1330
|
+
/** 直播严选机构商品池变化通知 */
|
|
1331
|
+
interface AgencyItemChanged {
|
|
1332
|
+
/** 机构openUid */
|
|
1333
|
+
agency_open_uid: string;
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1330
1336
|
/** 淘宝直播上下播消息 */
|
|
1331
1337
|
interface FeedRelated {
|
|
1332
1338
|
/** 主播openId */
|