@juzi/wechaty 1.0.132 → 1.0.134

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.
Files changed (113) hide show
  1. package/dist/cjs/src/package-json.js +3 -3
  2. package/dist/cjs/src/sayable/deliver-sayable.d.ts.map +1 -1
  3. package/dist/cjs/src/sayable/deliver-sayable.js +6 -0
  4. package/dist/cjs/src/sayable/deliver-sayable.js.map +1 -1
  5. package/dist/cjs/src/sayable/types.d.ts +2 -2
  6. package/dist/cjs/src/sayable/types.d.ts.map +1 -1
  7. package/dist/cjs/src/sayable/types.js.map +1 -1
  8. package/dist/cjs/src/schemas/wechaty-events.d.ts +9 -0
  9. package/dist/cjs/src/schemas/wechaty-events.d.ts.map +1 -1
  10. package/dist/cjs/src/schemas/wechaty-events.js.map +1 -1
  11. package/dist/cjs/src/user-modules/im-specific.d.ts +1 -0
  12. package/dist/cjs/src/user-modules/im-specific.d.ts.map +1 -1
  13. package/dist/cjs/src/user-modules/im-specific.js +4 -0
  14. package/dist/cjs/src/user-modules/im-specific.js.map +1 -1
  15. package/dist/cjs/src/user-modules/message.d.ts +1 -1
  16. package/dist/cjs/src/user-modules/message.d.ts.map +1 -1
  17. package/dist/cjs/src/user-modules/message.js +1 -2
  18. package/dist/cjs/src/user-modules/message.js.map +1 -1
  19. package/dist/cjs/src/user-modules/mod.d.ts +5 -3
  20. package/dist/cjs/src/user-modules/mod.d.ts.map +1 -1
  21. package/dist/cjs/src/user-modules/mod.js +5 -1
  22. package/dist/cjs/src/user-modules/mod.js.map +1 -1
  23. package/dist/cjs/src/user-modules/wxxd-order.d.ts +91 -0
  24. package/dist/cjs/src/user-modules/wxxd-order.d.ts.map +1 -0
  25. package/dist/cjs/src/user-modules/wxxd-order.js +140 -0
  26. package/dist/cjs/src/user-modules/wxxd-order.js.map +1 -0
  27. package/dist/cjs/src/user-modules/wxxd-product.d.ts +87 -0
  28. package/dist/cjs/src/user-modules/wxxd-product.d.ts.map +1 -0
  29. package/dist/cjs/src/user-modules/wxxd-product.js +134 -0
  30. package/dist/cjs/src/user-modules/wxxd-product.js.map +1 -0
  31. package/dist/cjs/src/wechaty/wechaty-base.d.ts +27 -7
  32. package/dist/cjs/src/wechaty/wechaty-base.d.ts.map +1 -1
  33. package/dist/cjs/src/wechaty/wechaty-impl.spec.js +5 -1
  34. package/dist/cjs/src/wechaty/wechaty-impl.spec.js.map +1 -1
  35. package/dist/cjs/src/wechaty-mixins/gerror-mixin.d.ts +1 -1
  36. package/dist/cjs/src/wechaty-mixins/io-mixin.d.ts +2 -2
  37. package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts +17 -5
  38. package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts.map +1 -1
  39. package/dist/cjs/src/wechaty-mixins/misc-mixin.d.ts +17 -5
  40. package/dist/cjs/src/wechaty-mixins/misc-mixin.d.ts.map +1 -1
  41. package/dist/cjs/src/wechaty-mixins/plugin-mixin.d.ts +22 -6
  42. package/dist/cjs/src/wechaty-mixins/plugin-mixin.d.ts.map +1 -1
  43. package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts +14 -10
  44. package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
  45. package/dist/cjs/src/wechaty-mixins/puppet-mixin.js +18 -0
  46. package/dist/cjs/src/wechaty-mixins/puppet-mixin.js.map +1 -1
  47. package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.d.ts +7 -3
  48. package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.d.ts.map +1 -1
  49. package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.js +6 -0
  50. package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.js.map +1 -1
  51. package/dist/esm/src/package-json.js +3 -3
  52. package/dist/esm/src/sayable/deliver-sayable.d.ts.map +1 -1
  53. package/dist/esm/src/sayable/deliver-sayable.js +7 -1
  54. package/dist/esm/src/sayable/deliver-sayable.js.map +1 -1
  55. package/dist/esm/src/sayable/types.d.ts +2 -2
  56. package/dist/esm/src/sayable/types.d.ts.map +1 -1
  57. package/dist/esm/src/sayable/types.js.map +1 -1
  58. package/dist/esm/src/schemas/wechaty-events.d.ts +9 -0
  59. package/dist/esm/src/schemas/wechaty-events.d.ts.map +1 -1
  60. package/dist/esm/src/schemas/wechaty-events.js.map +1 -1
  61. package/dist/esm/src/user-modules/im-specific.d.ts +1 -0
  62. package/dist/esm/src/user-modules/im-specific.d.ts.map +1 -1
  63. package/dist/esm/src/user-modules/im-specific.js +4 -0
  64. package/dist/esm/src/user-modules/im-specific.js.map +1 -1
  65. package/dist/esm/src/user-modules/message.d.ts +1 -1
  66. package/dist/esm/src/user-modules/message.d.ts.map +1 -1
  67. package/dist/esm/src/user-modules/message.js +1 -2
  68. package/dist/esm/src/user-modules/message.js.map +1 -1
  69. package/dist/esm/src/user-modules/mod.d.ts +5 -3
  70. package/dist/esm/src/user-modules/mod.d.ts.map +1 -1
  71. package/dist/esm/src/user-modules/mod.js +3 -1
  72. package/dist/esm/src/user-modules/mod.js.map +1 -1
  73. package/dist/esm/src/user-modules/wxxd-order.d.ts +91 -0
  74. package/dist/esm/src/user-modules/wxxd-order.d.ts.map +1 -0
  75. package/dist/esm/src/user-modules/wxxd-order.js +114 -0
  76. package/dist/esm/src/user-modules/wxxd-order.js.map +1 -0
  77. package/dist/esm/src/user-modules/wxxd-product.d.ts +87 -0
  78. package/dist/esm/src/user-modules/wxxd-product.d.ts.map +1 -0
  79. package/dist/esm/src/user-modules/wxxd-product.js +108 -0
  80. package/dist/esm/src/user-modules/wxxd-product.js.map +1 -0
  81. package/dist/esm/src/wechaty/wechaty-base.d.ts +27 -7
  82. package/dist/esm/src/wechaty/wechaty-base.d.ts.map +1 -1
  83. package/dist/esm/src/wechaty/wechaty-impl.spec.js +5 -1
  84. package/dist/esm/src/wechaty/wechaty-impl.spec.js.map +1 -1
  85. package/dist/esm/src/wechaty-mixins/gerror-mixin.d.ts +1 -1
  86. package/dist/esm/src/wechaty-mixins/io-mixin.d.ts +2 -2
  87. package/dist/esm/src/wechaty-mixins/login-mixin.d.ts +17 -5
  88. package/dist/esm/src/wechaty-mixins/login-mixin.d.ts.map +1 -1
  89. package/dist/esm/src/wechaty-mixins/misc-mixin.d.ts +17 -5
  90. package/dist/esm/src/wechaty-mixins/misc-mixin.d.ts.map +1 -1
  91. package/dist/esm/src/wechaty-mixins/plugin-mixin.d.ts +22 -6
  92. package/dist/esm/src/wechaty-mixins/plugin-mixin.d.ts.map +1 -1
  93. package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts +14 -10
  94. package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
  95. package/dist/esm/src/wechaty-mixins/puppet-mixin.js +18 -0
  96. package/dist/esm/src/wechaty-mixins/puppet-mixin.js.map +1 -1
  97. package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.d.ts +7 -3
  98. package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.d.ts.map +1 -1
  99. package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.js +7 -1
  100. package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.js.map +1 -1
  101. package/package.json +2 -2
  102. package/src/package-json.ts +3 -3
  103. package/src/sayable/deliver-sayable.ts +12 -0
  104. package/src/sayable/types.ts +4 -0
  105. package/src/schemas/wechaty-events.ts +6 -0
  106. package/src/user-modules/im-specific.ts +5 -0
  107. package/src/user-modules/message.ts +2 -3
  108. package/src/user-modules/mod.ts +16 -0
  109. package/src/user-modules/wxxd-order.ts +161 -0
  110. package/src/user-modules/wxxd-product.ts +154 -0
  111. package/src/wechaty/wechaty-impl.spec.ts +6 -0
  112. package/src/wechaty-mixins/puppet-mixin.ts +21 -0
  113. package/src/wechaty-mixins/wechatify-user-module-mixin.ts +12 -0
@@ -36,6 +36,8 @@ import {
36
36
  ConsultCardInterface,
37
37
  PremiumOnlineAppointmentCardInterface,
38
38
  DouyinOneClickPhoneCollectionInterface,
39
+ WxxdProductInterface,
40
+ WxxdOrderInterface,
39
41
  } from '../user-modules/mod.js'
40
42
 
41
43
  import type {
@@ -58,6 +60,8 @@ type Sayable =
58
60
  | ConsultCardInterface
59
61
  | PremiumOnlineAppointmentCardInterface
60
62
  | DouyinOneClickPhoneCollectionInterface
63
+ | WxxdProductInterface
64
+ | WxxdOrderInterface
61
65
 
62
66
  interface SayableSayer {
63
67
  id : string,
@@ -60,6 +60,9 @@ type WechatyEventListenerLoginUrl = (url: string) => void | Promise<vo
60
60
  type WechatyEventListenerIntentComment = (payload: PUPPET.payloads.IntentComment) => void | Promise<void>
61
61
  type WechatyEventListenerContactEnterConversation = (contact: ContactInterface, date?: Date) => void | Promise<void>
62
62
  type WechatyEventListenerContactLeadFilled = (contact: ContactInterface, leads: { name: string, value: string }[], date?: Date) => void | Promise<void>
63
+ type WechatyEventListenerWxxdShop = (payload: PUPPET.payloads.WxxdShop) => void | Promise<void>
64
+ type WechatyEventListenerWxxdProduct = (payload: PUPPET.payloads.WxxdProduct) => void | Promise<void>
65
+ type WechatyEventListenerWxxdOrder = (payload: PUPPET.payloads.WxxdOrder) => void | Promise<void>
63
66
 
64
67
  /**
65
68
  * @desc Wechaty Class Event Type
@@ -245,6 +248,9 @@ interface WechatyEventListeners {
245
248
  'verify-slide' : WechatyEventListenerVerifySlide
246
249
  'contact-enter-conversation' : WechatyEventListenerContactEnterConversation
247
250
  'contact-lead-filled' : WechatyEventListenerContactLeadFilled
251
+ 'wxxd-shop' : WechatyEventListenerWxxdShop
252
+ 'wxxd-product' : WechatyEventListenerWxxdProduct
253
+ 'wxxd-order' : WechatyEventListenerWxxdOrder
248
254
  }
249
255
 
250
256
  const WechatyEventEmitter = EventEmitter as any as new () => TypedEventEmitter<
@@ -22,6 +22,11 @@ class ImSpecificMixin extends wechatifyMixinBase() {
22
22
  return this.wechaty.puppet.intentCommentPayload(id)
23
23
  }
24
24
 
25
+ // 微信小店
26
+ static async getWxxdShop () {
27
+ return this.wechaty.puppet.wxxdShopPayload()
28
+ }
29
+
25
30
  /*
26
31
  * @hideconstructor
27
32
  */
@@ -61,9 +61,8 @@ import type {
61
61
  import type {
62
62
  ImageInterface,
63
63
  } from './image.js'
64
- import {
64
+ import type {
65
65
  PostInterface,
66
- PostImpl,
67
66
  } from './post.js'
68
67
  import type {
69
68
  LocationInterface,
@@ -1377,7 +1376,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
1377
1376
  throw new Error('message type not a Post')
1378
1377
  }
1379
1378
 
1380
- const post = PostImpl.load(this.id)
1379
+ const post = this.wechaty.Post.load(this.id)
1381
1380
  await post.ready()
1382
1381
  return post
1383
1382
  }
@@ -147,6 +147,16 @@ import {
147
147
  ImSpecificInterface,
148
148
  ImSpecificConstructor,
149
149
  } from './im-specific.js'
150
+ import {
151
+ WxxdProductImpl,
152
+ WxxdProductInterface,
153
+ WxxdProductConstructor,
154
+ } from './wxxd-product.js'
155
+ import {
156
+ WxxdOrderImpl,
157
+ WxxdOrderInterface,
158
+ WxxdOrderConstructor,
159
+ } from './wxxd-order.js'
150
160
 
151
161
  import { wechatifyUserModule } from '../user-mixins/wechatify.js'
152
162
 
@@ -177,6 +187,8 @@ export type {
177
187
  WecomInterface,
178
188
  DouyinOneClickPhoneCollectionInterface,
179
189
  ImSpecificInterface,
190
+ WxxdProductInterface,
191
+ WxxdOrderInterface,
180
192
  }
181
193
 
182
194
  export type {
@@ -206,6 +218,8 @@ export type {
206
218
  WecomConstructor,
207
219
  DouyinOneClickPhoneCollectionConstructor,
208
220
  ImSpecificConstructor,
221
+ WxxdProductConstructor,
222
+ WxxdOrderConstructor,
209
223
  }
210
224
 
211
225
  export {
@@ -237,4 +251,6 @@ export {
237
251
  WecomImpl,
238
252
  DouyinOneClickPhoneCollectionImpl,
239
253
  ImSpecificImpl,
254
+ WxxdProductImpl,
255
+ WxxdOrderImpl,
240
256
  }
@@ -0,0 +1,161 @@
1
+ import type { Constructor } from 'clone-class'
2
+ import type { PaginationRequest } from '@juzi/wechaty-puppet/filters'
3
+ import * as PUPPET from '@juzi/wechaty-puppet'
4
+
5
+ import { log } from '../config.js'
6
+ import { poolifyMixin } from '../user-mixins/poolify.js'
7
+ import { validationMixin } from '../user-mixins/validation.js'
8
+ import { wechatifyMixin } from '../user-mixins/wechatify.js'
9
+
10
+ const MixinBase = wechatifyMixin(
11
+ poolifyMixin(Object)<WxxdOrderImplInterface>(),
12
+ )
13
+
14
+ class WxxdOrderMixin extends MixinBase {
15
+
16
+ /**
17
+ * Instance properties
18
+ * @ignore
19
+ */
20
+ payload?: PUPPET.payloads.WxxdOrder
21
+
22
+ /**
23
+ * @hideconstructor
24
+ */
25
+ constructor (
26
+ public readonly id: string,
27
+ ) {
28
+ super()
29
+ log.silly('WxxdOrder', 'constructor(%s)', id)
30
+ }
31
+
32
+ /**
33
+ * List all orders
34
+ */
35
+ static async list (query: PaginationRequest) {
36
+ log.verbose('WxxdOrder', 'list(%s)', JSON.stringify(query))
37
+
38
+ return await this.wechaty.puppet.listWxxdOrders(query)
39
+ }
40
+
41
+ /**
42
+ * Find order by id or filter
43
+ */
44
+ static async find (
45
+ query: string | { id: string },
46
+ ): Promise<WxxdOrderInterface | undefined> {
47
+ log.verbose('WxxdOrder', 'find(%s)', JSON.stringify(query))
48
+
49
+ const id = typeof query === 'string' ? query : query.id
50
+
51
+ if (!id) {
52
+ return undefined
53
+ }
54
+
55
+ const order = (this.wechaty.WxxdOrder as any as typeof WxxdOrderImpl).load(id)
56
+
57
+ try {
58
+ await order.ready()
59
+ } catch (e) {
60
+ this.wechaty.emitError(e)
61
+ return undefined
62
+ }
63
+
64
+ return order
65
+ }
66
+
67
+ isReady (): boolean {
68
+ return !!(this.payload && this.payload.orderId)
69
+ }
70
+
71
+ async ready (forceSync = false): Promise<void> {
72
+ log.silly('WxxdOrder', 'ready() @ %s with id="%s"', this.wechaty.puppet, this.id)
73
+
74
+ if (!forceSync && this.isReady()) {
75
+ log.silly('WxxdOrder', 'ready() isReady() true')
76
+ return
77
+ }
78
+
79
+ try {
80
+ this.payload = await this.wechaty.puppet.wxxdOrderPayload(this.id)
81
+ } catch (e) {
82
+ this.wechaty.emitError(e)
83
+ log.verbose('WxxdOrder', 'ready() this.wechaty.puppet.wxxdOrderPayload(%s) exception: %s',
84
+ this.id,
85
+ (e as Error).message,
86
+ )
87
+ throw e
88
+ }
89
+ }
90
+
91
+ /**
92
+ * Get order ID
93
+ */
94
+ orderId (): string {
95
+ return this.payload?.orderId || this.id
96
+ }
97
+
98
+ /**
99
+ * Get order open ID
100
+ */
101
+ openId (): string {
102
+ return this.payload?.openId || ''
103
+ }
104
+
105
+ /**
106
+ * Get order status
107
+ */
108
+ status (): PUPPET.types.WxxdOrderStatus {
109
+ return this.payload?.status || PUPPET.types.WxxdOrderStatus.Unpaid
110
+ }
111
+
112
+ /**
113
+ * Get order create time
114
+ */
115
+ createTime (): number {
116
+ return this.payload?.createTime || 0
117
+ }
118
+
119
+ /**
120
+ * Get order update time
121
+ */
122
+ updateTime (): number {
123
+ return this.payload?.updateTime || 0
124
+ }
125
+
126
+ /**
127
+ * Get order products
128
+ */
129
+ products (): PUPPET.payloads.WxxdOrderProduct[] {
130
+ return this.payload?.products || []
131
+ }
132
+
133
+ /**
134
+ * Get order ext info
135
+ */
136
+ extInfo (): PUPPET.payloads.WxxdOrderExtInfo | undefined {
137
+ return this.payload?.extInfo
138
+ }
139
+
140
+ }
141
+
142
+ class WxxdOrderImplBase extends validationMixin(WxxdOrderMixin)<WxxdOrderImplInterface>() { }
143
+ interface WxxdOrderImplInterface extends WxxdOrderImplBase { }
144
+
145
+ type WxxdOrderProtectedProperty = 'ready'
146
+ type WxxdOrderInterface = Omit<WxxdOrderImplInterface, WxxdOrderProtectedProperty>
147
+ class WxxdOrderImpl extends validationMixin(WxxdOrderImplBase)<WxxdOrderInterface>() { }
148
+
149
+ type WxxdOrderConstructor = Constructor<
150
+ WxxdOrderImplInterface,
151
+ typeof WxxdOrderImpl
152
+ >
153
+
154
+ export type {
155
+ WxxdOrderConstructor,
156
+ WxxdOrderProtectedProperty,
157
+ WxxdOrderInterface,
158
+ }
159
+ export {
160
+ WxxdOrderImpl,
161
+ }
@@ -0,0 +1,154 @@
1
+ import type { Constructor } from 'clone-class'
2
+ import type { PaginationRequest } from '@juzi/wechaty-puppet/filters'
3
+ import * as PUPPET from '@juzi/wechaty-puppet'
4
+
5
+ import { log } from '../config.js'
6
+ import { poolifyMixin } from '../user-mixins/poolify.js'
7
+ import { validationMixin } from '../user-mixins/validation.js'
8
+ import { wechatifyMixin } from '../user-mixins/wechatify.js'
9
+
10
+ const MixinBase = wechatifyMixin(
11
+ poolifyMixin(Object)<WxxdProductImplInterface>(),
12
+ )
13
+
14
+ class WxxdProductMixin extends MixinBase {
15
+
16
+ /**
17
+ * Instance properties
18
+ * @ignore
19
+ */
20
+ payload?: PUPPET.payloads.WxxdProduct
21
+
22
+ /**
23
+ * @hideconstructor
24
+ */
25
+ constructor (
26
+ public readonly id: string,
27
+ ) {
28
+ super()
29
+ log.silly('WxxdProduct', 'constructor(%s)', id)
30
+ }
31
+
32
+ /**
33
+ * List all products
34
+ */
35
+ static async list (query: PaginationRequest) {
36
+ log.verbose('WxxdProduct', 'list(%s)', JSON.stringify(query))
37
+
38
+ return await this.wechaty.puppet.listWxxdProducts(query)
39
+ }
40
+
41
+ /**
42
+ * Find product by id or filter
43
+ */
44
+ static async find (
45
+ query: string | { id: string },
46
+ ): Promise<WxxdProductInterface | undefined> {
47
+ log.verbose('WxxdProduct', 'find(%s)', JSON.stringify(query))
48
+
49
+ const id = typeof query === 'string' ? query : query.id
50
+
51
+ if (!id) {
52
+ return undefined
53
+ }
54
+
55
+ const product = (this.wechaty.WxxdProduct as any as typeof WxxdProductImpl).load(id)
56
+
57
+ try {
58
+ await product.ready()
59
+ } catch (e) {
60
+ this.wechaty.emitError(e)
61
+ return undefined
62
+ }
63
+
64
+ return product
65
+ }
66
+
67
+ isReady (): boolean {
68
+ return !!(this.payload && this.payload.productId)
69
+ }
70
+
71
+ async ready (forceSync = false): Promise<void> {
72
+ log.silly('WxxdProduct', 'ready() @ %s with id="%s"', this.wechaty.puppet, this.id)
73
+
74
+ if (!forceSync && this.isReady()) {
75
+ log.silly('WxxdProduct', 'ready() isReady() true')
76
+ return
77
+ }
78
+
79
+ try {
80
+ this.payload = await this.wechaty.puppet.wxxdProductPayload(this.id)
81
+ } catch (e) {
82
+ this.wechaty.emitError(e)
83
+ log.verbose('WxxdProduct', 'ready() this.wechaty.puppet.wxxdProductPayload(%s) exception: %s',
84
+ this.id,
85
+ (e as Error).message,
86
+ )
87
+ throw e
88
+ }
89
+ }
90
+
91
+ /**
92
+ * Get product title
93
+ */
94
+ title (): string {
95
+ return this.payload?.title || ''
96
+ }
97
+
98
+ /**
99
+ * Get product short title
100
+ */
101
+ shortTitle (): string {
102
+ return this.payload?.shortTitle || ''
103
+ }
104
+
105
+ /**
106
+ * Get product status
107
+ */
108
+ status (): PUPPET.types.WxxdProductStatus {
109
+ return this.payload?.status || PUPPET.types.WxxdProductStatus.NotExist
110
+ }
111
+
112
+ /**
113
+ * Get product min price
114
+ */
115
+ minPrice (): number {
116
+ return this.payload?.minPrice || 0
117
+ }
118
+
119
+ /**
120
+ * Get product total sold number
121
+ */
122
+ totalSoldNum (): number {
123
+ return this.payload?.totalSoldNum || 0
124
+ }
125
+
126
+ /**
127
+ * Get product SKUs
128
+ */
129
+ skus (): PUPPET.payloads.WxxdProductSku[] {
130
+ return this.payload?.skus || []
131
+ }
132
+
133
+ }
134
+
135
+ class WxxdProductImplBase extends validationMixin(WxxdProductMixin)<WxxdProductImplInterface>() { }
136
+ interface WxxdProductImplInterface extends WxxdProductImplBase { }
137
+
138
+ type WxxdProductProtectedProperty = 'ready'
139
+ type WxxdProductInterface = Omit<WxxdProductImplInterface, WxxdProductProtectedProperty>
140
+ class WxxdProductImpl extends validationMixin(WxxdProductImplBase)<WxxdProductInterface>() { }
141
+
142
+ type WxxdProductConstructor = Constructor<
143
+ WxxdProductImplInterface,
144
+ typeof WxxdProductImpl
145
+ >
146
+
147
+ export type {
148
+ WxxdProductConstructor,
149
+ WxxdProductProtectedProperty,
150
+ WxxdProductInterface,
151
+ }
152
+ export {
153
+ WxxdProductImpl,
154
+ }
@@ -30,6 +30,8 @@ import type {
30
30
  WecomConstructor,
31
31
  DouyinOneClickPhoneCollectionConstructor,
32
32
  ImSpecificConstructor,
33
+ WxxdProductConstructor,
34
+ WxxdOrderConstructor,
33
35
  } from '../user-modules/mod.js'
34
36
 
35
37
  import {
@@ -67,6 +69,8 @@ test('Wechaty interface', async t => {
67
69
  Wecom : WecomConstructor
68
70
  DouyinOneClickPhoneCollection : DouyinOneClickPhoneCollectionConstructor
69
71
  ImSpecific : ImSpecificConstructor
72
+ WxxdProduct : WxxdProductConstructor
73
+ WxxdOrder : WxxdOrderConstructor
70
74
 
71
75
  constructor () {
72
76
  super()
@@ -95,6 +99,8 @@ test('Wechaty interface', async t => {
95
99
  = this.Wecom
96
100
  = this.DouyinOneClickPhoneCollection
97
101
  = this.ImSpecific
102
+ = this.WxxdProduct
103
+ = this.WxxdOrder
98
104
  = {} as any
99
105
  }
100
106
 
@@ -758,6 +758,27 @@ const puppetMixin = <MixinBase extends WechatifyUserModuleMixin & GErrorMixin &
758
758
  })
759
759
  break
760
760
 
761
+ case 'wxxd-shop':
762
+ puppet.on('wxxd-shop', async () => {
763
+ const payload = await this.ImSpecific.getWxxdShop()
764
+ this.emit('wxxd-shop', payload)
765
+ })
766
+ break
767
+
768
+ case 'wxxd-product':
769
+ puppet.on('wxxd-product', async ({ productId: id }) => {
770
+ const payload = await this.WxxdProduct.find({ id })
771
+ this.emit('wxxd-product', payload)
772
+ })
773
+ break
774
+
775
+ case 'wxxd-order':
776
+ puppet.on('wxxd-order', async ({ orderId: id }) => {
777
+ const payload = await this.WxxdOrder.find({ id })
778
+ this.emit('wxxd-order', payload)
779
+ })
780
+ break
781
+
761
782
  default:
762
783
  /**
763
784
  * Check: The eventName here should have the type `never`
@@ -25,6 +25,8 @@ import {
25
25
  WecomImpl,
26
26
  DouyinOneClickPhoneCollectionImpl,
27
27
  ImSpecificImpl,
28
+ WxxdProductImpl,
29
+ WxxdOrderImpl,
28
30
 
29
31
  ContactConstructor,
30
32
  ContactSelfConstructor,
@@ -50,6 +52,8 @@ import {
50
52
  WecomConstructor,
51
53
  DouyinOneClickPhoneCollectionConstructor,
52
54
  ImSpecificConstructor,
55
+ WxxdProductConstructor,
56
+ WxxdOrderConstructor,
53
57
  wechatifyUserModule,
54
58
  } from '../user-modules/mod.js'
55
59
 
@@ -91,6 +95,8 @@ const wechatifyUserModuleMixin = <MixinBase extends typeof WechatySkeleton> (mix
91
95
  __wechatifiedWecom? : WecomConstructor
92
96
  __wechatifiedDouyinOneClickPhoneCollection? : DouyinOneClickPhoneCollectionConstructor
93
97
  __wechatifiedImSpecific? : ImSpecificConstructor
98
+ __wechatifiedWxxdProduct? : WxxdProductConstructor
99
+ __wechatifiedWxxdOrder? : WxxdOrderConstructor
94
100
 
95
101
  get Contact () : ContactConstructor { return guardWechatify(this.__wechatifiedContact) }
96
102
  get ContactSelf () : ContactSelfConstructor { return guardWechatify(this.__wechatifiedContactSelf) }
@@ -116,6 +122,8 @@ const wechatifyUserModuleMixin = <MixinBase extends typeof WechatySkeleton> (mix
116
122
  get Wecom () : WecomConstructor { return guardWechatify(this.__wechatifiedWecom) }
117
123
  get DouyinOneClickPhoneCollection () : DouyinOneClickPhoneCollectionConstructor { return guardWechatify(this.__wechatifiedDouyinOneClickPhoneCollection) }
118
124
  get ImSpecific () : ImSpecificConstructor { return guardWechatify(this.__wechatifiedImSpecific) }
125
+ get WxxdProduct () : WxxdProductConstructor { return guardWechatify(this.__wechatifiedWxxdProduct) }
126
+ get WxxdOrder () : WxxdOrderConstructor { return guardWechatify(this.__wechatifiedWxxdOrder) }
119
127
 
120
128
  override async init (): Promise<void> {
121
129
  log.verbose('WechatifyUserModuleMixin', 'init()')
@@ -161,6 +169,8 @@ const wechatifyUserModuleMixin = <MixinBase extends typeof WechatySkeleton> (mix
161
169
  this.__wechatifiedWecom = wechatifyUserModule(WecomImpl)(this as any)
162
170
  this.__wechatifiedDouyinOneClickPhoneCollection = wechatifyUserModule(DouyinOneClickPhoneCollectionImpl)(this as any)
163
171
  this.__wechatifiedImSpecific = wechatifyUserModule(ImSpecificImpl)(this as any)
172
+ this.__wechatifiedWxxdProduct = wechatifyUserModule(WxxdProductImpl)(this as any)
173
+ this.__wechatifiedWxxdOrder = wechatifyUserModule(WxxdOrderImpl)(this as any)
164
174
 
165
175
  log.verbose('WechatifyUserModuleMixin', 'init() initializing Wechaty User Module (WUM) ... done')
166
176
  }
@@ -206,6 +216,8 @@ type ProtectedPropertyWechatifyUserModuleMixin =
206
216
  | '__wechatifiedWecom'
207
217
  | '__wechatifiedDouyinOneClickPhoneCollection'
208
218
  | '__wechatifiedImSpecific'
219
+ | '__wechatifiedWxxdProduct'
220
+ | '__wechatifiedWxxdOrder'
209
221
 
210
222
  export type {
211
223
  WechatifyUserModuleMixin,