tmc.js 0.3.33 → 0.3.34

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 CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2022 James ZHANG(TheNorthMemory)
1
+ Copyright (c) 2022-2024 James ZHANG(TheNorthMemory)
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -134,11 +134,11 @@ new Tmc('your_app_key', 'your_app_secret', { autoReplyConfirmation: false })
134
134
 
135
135
  ## 支持的TOPICS
136
136
 
137
- <details><summary>共计 84+ 类别,491+ 消息数</summary>
137
+ <details><summary>共计 84+ 类别,494+ 消息数</summary>
138
138
 
139
139
  | 类别 | 消息数 |
140
140
  | --- | --- |
141
- | 淘宝交易 | 24 |
141
+ | 淘宝交易 | 25 |
142
142
  | 淘宝退款 | 13 |
143
143
  | 淘宝商品 | 13 |
144
144
  | 淘宝分销 | 27 |
@@ -159,7 +159,7 @@ new Tmc('your_app_key', 'your_app_secret', { autoReplyConfirmation: false })
159
159
  | 营销平台 | 1 |
160
160
  | OpenIM消息 | 1 |
161
161
  | 网上法庭 | 8 |
162
- | 电子发票 | 20 |
162
+ | 电子发票 | 21 |
163
163
  | 航旅度假交易 | 8 |
164
164
  | YunOS YoC | 2 |
165
165
  | 淘宝直播API | 3 |
@@ -192,7 +192,7 @@ new Tmc('your_app_key', 'your_app_secret', { autoReplyConfirmation: false })
192
192
  | 商旅API | 3 |
193
193
  | 阿里健康-O2O中台 | 2 |
194
194
  | 业务平台新零售-消息上行 | 2 |
195
- | 大麦第三方票务供应商接入 | 6 |
195
+ | 大麦第三方票务供应商接入 | 7 |
196
196
  | TVOS应用审核平台 | 1 |
197
197
  | Gifting送礼 | 1 |
198
198
  | 五道口商品 | 2 |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tmc.js",
3
- "version": "0.3.33",
3
+ "version": "0.3.34",
4
4
  "description": "Event driven and chained Taobao Message Channel(TMC) for NodeJS",
5
5
  "author": "James ZHANG",
6
6
  "license": "MIT",
@@ -599,6 +599,16 @@ declare namespace Alibaba.Invoice {
599
599
  trade_type: number;
600
600
  }
601
601
 
602
+ /** 获取xml发票文件 */
603
+ interface GetXmlFile {
604
+ /** 全电发票的发票号码 */
605
+ invoice_no: string;
606
+ /** 订单号 */
607
+ platform_tid: string;
608
+ /** 卖家Nick */
609
+ seller_nick?: string;
610
+ }
611
+
602
612
  /** 税控服务开票申请 */
603
613
  interface InvoiceApply {
604
614
  /** 开票申请ID */
package/types/damai.d.ts CHANGED
@@ -50,6 +50,12 @@ declare namespace Damai.Distribution {
50
50
  voucher_ids: number[];
51
51
  }
52
52
 
53
+ /** 项目退款规则 */
54
+ interface RefundRule {
55
+ /** 项目id */
56
+ project_id: number;
57
+ }
58
+
53
59
  /** 票品状态变更 */
54
60
  interface TicketItemStatus {
55
61
  /** 是否可售 */
package/types/index.d.ts CHANGED
@@ -142,6 +142,8 @@ declare interface TaoTopicsDescriptor {
142
142
  alibaba_invoice_DiskOffline(fn: (this: TaoMessageConsumer, message: IncomingMessage.AlibabaInvoiceDiskOffline) => void): TaoMessageConsumer;
143
143
  /** {@link IncomingMessage.AlibabaInvoiceFlowBuket 电子发票 > 资源包开通/订购记录同步} */
144
144
  alibaba_invoice_FlowBuket(fn: (this: TaoMessageConsumer, message: IncomingMessage.AlibabaInvoiceFlowBuket) => void): TaoMessageConsumer;
145
+ /** {@link IncomingMessage.AlibabaInvoiceGetXmlFile 电子发票 > 获取xml发票文件} */
146
+ alibaba_invoice_GetXmlFile(fn: (this: TaoMessageConsumer, message: IncomingMessage.AlibabaInvoiceGetXmlFile) => void): TaoMessageConsumer;
145
147
  /** {@link IncomingMessage.AlibabaInvoiceInvoiceApply 电子发票 > 税控服务开票申请} */
146
148
  alibaba_invoice_InvoiceApply(fn: (this: TaoMessageConsumer, message: IncomingMessage.AlibabaInvoiceInvoiceApply) => void): TaoMessageConsumer;
147
149
  /** {@link IncomingMessage.AlibabaInvoiceLogistics 电子发票 > 发票对外通知物流信息} */
@@ -386,6 +388,8 @@ declare interface TaoTopicsDescriptor {
386
388
  damai_distribution_ProjectStatus(fn: (this: TaoMessageConsumer, message: IncomingMessage.DamaiDistributionProjectStatus) => void): TaoMessageConsumer;
387
389
  /** {@link IncomingMessage.DamaiDistributionRefundOrder 大麦第三方票务供应商接入 > 退票通知} */
388
390
  damai_distribution_RefundOrder(fn: (this: TaoMessageConsumer, message: IncomingMessage.DamaiDistributionRefundOrder) => void): TaoMessageConsumer;
391
+ /** {@link IncomingMessage.DamaiDistributionRefundRule 大麦第三方票务供应商接入 > 项目退款规则} */
392
+ damai_distribution_RefundRule(fn: (this: TaoMessageConsumer, message: IncomingMessage.DamaiDistributionRefundRule) => void): TaoMessageConsumer;
389
393
  /** {@link IncomingMessage.DamaiDistributionTicketItemStatus 大麦第三方票务供应商接入 > 票品状态变更} */
390
394
  damai_distribution_TicketItemStatus(fn: (this: TaoMessageConsumer, message: IncomingMessage.DamaiDistributionTicketItemStatus) => void): TaoMessageConsumer;
391
395
  /** {@link IncomingMessage.DamaiTradeTicketStatusPush 大麦票单状态 > 大麦票单状态推送} */
@@ -662,6 +666,8 @@ declare interface TaoTopicsDescriptor {
662
666
  taobao_modifysku_ResultNotify(fn: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoModifyskuResultNotify) => void): TaoMessageConsumer;
663
667
  /** {@link IncomingMessage.TaobaoOcTradeTagChanged 交易全链路 > oc订单标签变更} */
664
668
  taobao_oc_TradeTagChanged(fn: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoOcTradeTagChanged) => void): TaoMessageConsumer;
669
+ /** {@link IncomingMessage.TaobaoOfnOrderStatusSync 淘宝交易 > 以旧换新回收单状态同步} */
670
+ taobao_ofn_OrderStatusSync(fn: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoOfnOrderStatusSync) => void): TaoMessageConsumer;
665
671
  /** {@link IncomingMessage.TaobaoOpenaccountDataSync 导购平台 > openaccount数据同步} */
666
672
  taobao_openaccount_DataSync(fn: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoOpenaccountDataSync) => void): TaoMessageConsumer;
667
673
  /** {@link IncomingMessage.TaobaoOpencrmAuthTouchMessage 客户运营平台API > 营销短信授权消息} */
@@ -1190,6 +1196,8 @@ declare interface TaoTopicsDescriptor {
1190
1196
  taobao_modifysku(fn: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoModifysku) => void): TaoMessageConsumer;
1191
1197
  /** {@link IncomingMessage.TaobaoOc} */
1192
1198
  taobao_oc(fn: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoOc) => void): TaoMessageConsumer;
1199
+ /** {@link IncomingMessage.TaobaoOfn} */
1200
+ taobao_ofn(fn: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoOfn) => void): TaoMessageConsumer;
1193
1201
  /** {@link IncomingMessage.TaobaoOpenaccount} */
1194
1202
  taobao_openaccount(fn: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoOpenaccount) => void): TaoMessageConsumer;
1195
1203
  /** {@link IncomingMessage.TaobaoOpencrm} */
@@ -1403,6 +1411,8 @@ declare interface TaoEventsListener {
1403
1411
  on(topic: 'alibaba_invoice_DiskOffline', listener: (this: TaoMessageConsumer, message: IncomingMessage.AlibabaInvoiceDiskOffline) => void): TaoMessageConsumer;
1404
1412
  /** {@link IncomingMessage.AlibabaInvoiceFlowBuket 电子发票 > 资源包开通/订购记录同步} */
1405
1413
  on(topic: 'alibaba_invoice_FlowBuket', listener: (this: TaoMessageConsumer, message: IncomingMessage.AlibabaInvoiceFlowBuket) => void): TaoMessageConsumer;
1414
+ /** {@link IncomingMessage.AlibabaInvoiceGetXmlFile 电子发票 > 获取xml发票文件} */
1415
+ on(topic: 'alibaba_invoice_GetXmlFile', listener: (this: TaoMessageConsumer, message: IncomingMessage.AlibabaInvoiceGetXmlFile) => void): TaoMessageConsumer;
1406
1416
  /** {@link IncomingMessage.AlibabaInvoiceInvoiceApply 电子发票 > 税控服务开票申请} */
1407
1417
  on(topic: 'alibaba_invoice_InvoiceApply', listener: (this: TaoMessageConsumer, message: IncomingMessage.AlibabaInvoiceInvoiceApply) => void): TaoMessageConsumer;
1408
1418
  /** {@link IncomingMessage.AlibabaInvoiceLogistics 电子发票 > 发票对外通知物流信息} */
@@ -1647,6 +1657,8 @@ declare interface TaoEventsListener {
1647
1657
  on(topic: 'damai_distribution_ProjectStatus', listener: (this: TaoMessageConsumer, message: IncomingMessage.DamaiDistributionProjectStatus) => void): TaoMessageConsumer;
1648
1658
  /** {@link IncomingMessage.DamaiDistributionRefundOrder 大麦第三方票务供应商接入 > 退票通知} */
1649
1659
  on(topic: 'damai_distribution_RefundOrder', listener: (this: TaoMessageConsumer, message: IncomingMessage.DamaiDistributionRefundOrder) => void): TaoMessageConsumer;
1660
+ /** {@link IncomingMessage.DamaiDistributionRefundRule 大麦第三方票务供应商接入 > 项目退款规则} */
1661
+ on(topic: 'damai_distribution_RefundRule', listener: (this: TaoMessageConsumer, message: IncomingMessage.DamaiDistributionRefundRule) => void): TaoMessageConsumer;
1650
1662
  /** {@link IncomingMessage.DamaiDistributionTicketItemStatus 大麦第三方票务供应商接入 > 票品状态变更} */
1651
1663
  on(topic: 'damai_distribution_TicketItemStatus', listener: (this: TaoMessageConsumer, message: IncomingMessage.DamaiDistributionTicketItemStatus) => void): TaoMessageConsumer;
1652
1664
  /** {@link IncomingMessage.DamaiTradeTicketStatusPush 大麦票单状态 > 大麦票单状态推送} */
@@ -1923,6 +1935,8 @@ declare interface TaoEventsListener {
1923
1935
  on(topic: 'taobao_modifysku_ResultNotify', listener: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoModifyskuResultNotify) => void): TaoMessageConsumer;
1924
1936
  /** {@link IncomingMessage.TaobaoOcTradeTagChanged 交易全链路 > oc订单标签变更} */
1925
1937
  on(topic: 'taobao_oc_TradeTagChanged', listener: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoOcTradeTagChanged) => void): TaoMessageConsumer;
1938
+ /** {@link IncomingMessage.TaobaoOfnOrderStatusSync 淘宝交易 > 以旧换新回收单状态同步} */
1939
+ on(topic: 'taobao_ofn_OrderStatusSync', listener: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoOfnOrderStatusSync) => void): TaoMessageConsumer;
1926
1940
  /** {@link IncomingMessage.TaobaoOpenaccountDataSync 导购平台 > openaccount数据同步} */
1927
1941
  on(topic: 'taobao_openaccount_DataSync', listener: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoOpenaccountDataSync) => void): TaoMessageConsumer;
1928
1942
  /** {@link IncomingMessage.TaobaoOpencrmAuthTouchMessage 客户运营平台API > 营销短信授权消息} */
@@ -2451,6 +2465,8 @@ declare interface TaoEventsListener {
2451
2465
  on(topic: 'taobao_modifysku', listener: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoModifysku) => void): TaoMessageConsumer;
2452
2466
  /** {@link IncomingMessage.TaobaoOc} */
2453
2467
  on(topic: 'taobao_oc', listener: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoOc) => void): TaoMessageConsumer;
2468
+ /** {@link IncomingMessage.TaobaoOfn} */
2469
+ on(topic: 'taobao_ofn', listener: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoOfn) => void): TaoMessageConsumer;
2454
2470
  /** {@link IncomingMessage.TaobaoOpenaccount} */
2455
2471
  on(topic: 'taobao_openaccount', listener: (this: TaoMessageConsumer, message: IncomingMessage.TaobaoOpenaccount) => void): TaoMessageConsumer;
2456
2472
  /** {@link IncomingMessage.TaobaoOpencrm} */
@@ -103,6 +103,8 @@ declare namespace IncomingMessage {
103
103
  type AlibabaInvoiceDiskOffline = Message & { content?: MessageContent & { topic?: 'alibaba_invoice_DiskOffline', content?: string | Alibaba.Invoice.DiskOffline } };
104
104
  /** {@link Alibaba.Invoice.FlowBuket 电子发票 > 资源包开通/订购记录同步} */
105
105
  type AlibabaInvoiceFlowBuket = Message & { content?: MessageContent & { topic?: 'alibaba_invoice_FlowBuket', content?: string | Alibaba.Invoice.FlowBuket } };
106
+ /** {@link Alibaba.Invoice.GetXmlFile 电子发票 > 获取xml发票文件} */
107
+ type AlibabaInvoiceGetXmlFile = Message & { content?: MessageContent & { topic?: 'alibaba_invoice_GetXmlFile', content?: string | Alibaba.Invoice.GetXmlFile } };
106
108
  /** {@link Alibaba.Invoice.InvoiceApply 电子发票 > 税控服务开票申请} */
107
109
  type AlibabaInvoiceInvoiceApply = Message & { content?: MessageContent & { topic?: 'alibaba_invoice_InvoiceApply', content?: string | Alibaba.Invoice.InvoiceApply } };
108
110
  /** {@link Alibaba.Invoice.Logistics 电子发票 > 发票对外通知物流信息} */
@@ -347,6 +349,8 @@ declare namespace IncomingMessage {
347
349
  type DamaiDistributionProjectStatus = Message & { content?: MessageContent & { topic?: 'damai_distribution_ProjectStatus', content?: string | Damai.Distribution.ProjectStatus } };
348
350
  /** {@link Damai.Distribution.RefundOrder 大麦第三方票务供应商接入 > 退票通知} */
349
351
  type DamaiDistributionRefundOrder = Message & { content?: MessageContent & { topic?: 'damai_distribution_RefundOrder', content?: string | Damai.Distribution.RefundOrder } };
352
+ /** {@link Damai.Distribution.RefundRule 大麦第三方票务供应商接入 > 项目退款规则} */
353
+ type DamaiDistributionRefundRule = Message & { content?: MessageContent & { topic?: 'damai_distribution_RefundRule', content?: string | Damai.Distribution.RefundRule } };
350
354
  /** {@link Damai.Distribution.TicketItemStatus 大麦第三方票务供应商接入 > 票品状态变更} */
351
355
  type DamaiDistributionTicketItemStatus = Message & { content?: MessageContent & { topic?: 'damai_distribution_TicketItemStatus', content?: string | Damai.Distribution.TicketItemStatus } };
352
356
  /** {@link Damai.Trade.TicketStatusPush 大麦票单状态 > 大麦票单状态推送} */
@@ -623,6 +627,8 @@ declare namespace IncomingMessage {
623
627
  type TaobaoModifyskuResultNotify = Message & { content?: MessageContent & { topic?: 'taobao_modifysku_ResultNotify', content?: string | Taobao.Modifysku.ResultNotify } };
624
628
  /** {@link Taobao.Oc.TradeTagChanged 交易全链路 > oc订单标签变更} */
625
629
  type TaobaoOcTradeTagChanged = Message & { content?: MessageContent & { topic?: 'taobao_oc_TradeTagChanged', content?: string | Taobao.Oc.TradeTagChanged } };
630
+ /** {@link Taobao.Ofn.OrderStatusSync 淘宝交易 > 以旧换新回收单状态同步} */
631
+ type TaobaoOfnOrderStatusSync = Message & { content?: MessageContent & { topic?: 'taobao_ofn_OrderStatusSync', content?: string | Taobao.Ofn.OrderStatusSync } };
626
632
  /** {@link Taobao.Openaccount.DataSync 导购平台 > openaccount数据同步} */
627
633
  type TaobaoOpenaccountDataSync = Message & { content?: MessageContent & { topic?: 'taobao_openaccount_DataSync', content?: string | Taobao.Openaccount.DataSync } };
628
634
  /** {@link Taobao.Opencrm.AuthTouchMessage 客户运营平台API > 营销短信授权消息} */
@@ -1048,6 +1054,7 @@ declare namespace IncomingMessage {
1048
1054
  * - {@link AlibabaInvoiceApplyResult 电子发票 > 开票申请审核结果}
1049
1055
  * - {@link AlibabaInvoiceDiskOffline 电子发票 > 税盘下架单新增和更新通知}
1050
1056
  * - {@link AlibabaInvoiceFlowBuket 电子发票 > 资源包开通/订购记录同步}
1057
+ * - {@link AlibabaInvoiceGetXmlFile 电子发票 > 获取xml发票文件}
1051
1058
  * - {@link AlibabaInvoiceInvoiceApply 电子发票 > 税控服务开票申请}
1052
1059
  * - {@link AlibabaInvoiceLogistics 电子发票 > 发票对外通知物流信息}
1053
1060
  * - {@link AlibabaInvoicePaperOpsReturn 电子发票 > 纸票操作结果回传(打印、作废等)}
@@ -1064,6 +1071,7 @@ declare namespace IncomingMessage {
1064
1071
  | AlibabaInvoiceApplyResult
1065
1072
  | AlibabaInvoiceDiskOffline
1066
1073
  | AlibabaInvoiceFlowBuket
1074
+ | AlibabaInvoiceGetXmlFile
1067
1075
  | AlibabaInvoiceInvoiceApply
1068
1076
  | AlibabaInvoiceLogistics
1069
1077
  | AlibabaInvoicePaperOpsReturn
@@ -1371,6 +1379,7 @@ declare namespace IncomingMessage {
1371
1379
  * - {@link DamaiDistributionPreSaleToNow 大麦第三方票务供应商接入 > 预售改开票}
1372
1380
  * - {@link DamaiDistributionProjectStatus 大麦第三方票务供应商接入 > 项目状态推送}
1373
1381
  * - {@link DamaiDistributionRefundOrder 大麦第三方票务供应商接入 > 退票通知}
1382
+ * - {@link DamaiDistributionRefundRule 大麦第三方票务供应商接入 > 项目退款规则}
1374
1383
  * - {@link DamaiDistributionTicketItemStatus 大麦第三方票务供应商接入 > 票品状态变更}
1375
1384
  */
1376
1385
  type DamaiDistribution = DamaiDistributionPerformCancel
@@ -1378,6 +1387,7 @@ declare namespace IncomingMessage {
1378
1387
  | DamaiDistributionPreSaleToNow
1379
1388
  | DamaiDistributionProjectStatus
1380
1389
  | DamaiDistributionRefundOrder
1390
+ | DamaiDistributionRefundRule
1381
1391
  | DamaiDistributionTicketItemStatus;
1382
1392
  /**
1383
1393
  * - {@link DamaiTradeTicketStatusPush 大麦票单状态 > 大麦票单状态推送}
@@ -1749,6 +1759,10 @@ declare namespace IncomingMessage {
1749
1759
  * - {@link TaobaoOcTradeTagChanged 交易全链路 > oc订单标签变更}
1750
1760
  */
1751
1761
  type TaobaoOc = TaobaoOcTradeTagChanged;
1762
+ /**
1763
+ * - {@link TaobaoOfnOrderStatusSync 淘宝交易 > 以旧换新回收单状态同步}
1764
+ */
1765
+ type TaobaoOfn = TaobaoOfnOrderStatusSync;
1752
1766
  /**
1753
1767
  * - {@link TaobaoOpenaccountDataSync 导购平台 > openaccount数据同步}
1754
1768
  */
@@ -2365,6 +2379,7 @@ declare namespace IncomingMessage {
2365
2379
  * - {@link TaobaoModifyorder}
2366
2380
  * - {@link TaobaoModifysku}
2367
2381
  * - {@link TaobaoOc}
2382
+ * - {@link TaobaoOfn}
2368
2383
  * - {@link TaobaoOpenaccount}
2369
2384
  * - {@link TaobaoOpencrm}
2370
2385
  * - {@link TaobaoOpenim}
@@ -2417,6 +2432,7 @@ declare namespace IncomingMessage {
2417
2432
  | TaobaoModifyorder
2418
2433
  | TaobaoModifysku
2419
2434
  | TaobaoOc
2435
+ | TaobaoOfn
2420
2436
  | TaobaoOpenaccount
2421
2437
  | TaobaoOpencrm
2422
2438
  | TaobaoOpenim
package/types/taobao.d.ts CHANGED
@@ -1623,6 +1623,37 @@ declare namespace Taobao.Oc {
1623
1623
  }
1624
1624
  }
1625
1625
 
1626
+ /** 淘宝交易 */
1627
+ declare namespace Taobao.Ofn {
1628
+ /** 以旧换新回收单状态同步 */
1629
+ interface OrderStatusSync {
1630
+ /** 估价金额,单位 分 */
1631
+ apprize_amount?: string;
1632
+ /** 回收单 ID */
1633
+ biz_order_id: string;
1634
+ /** 渠道 */
1635
+ channel: string;
1636
+ /** 渠道数据,json格式 */
1637
+ channel_data?: string;
1638
+ /** 信用预付金额,单位分 */
1639
+ credit_pay_amount?: string;
1640
+ /** 创单时间 */
1641
+ gmt_create?: string;
1642
+ /** 订单状态 */
1643
+ order_status: string;
1644
+ /** 1 现金支付 / 2 红包支付 */
1645
+ pay_type?: string;
1646
+ /** 估价 ID */
1647
+ quote_id?: string;
1648
+ /** 上门取件时间 */
1649
+ ship_time?: string;
1650
+ /** SPU ID */
1651
+ spu_id: string;
1652
+ /** 回收商 appKey */
1653
+ supplier_id?: string;
1654
+ }
1655
+ }
1656
+
1626
1657
  /** 导购平台 */
1627
1658
  declare namespace Taobao.Openaccount {
1628
1659
  /** openaccount数据同步 */