@juzi/wechaty 1.0.117 → 1.0.118
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/dist/cjs/src/mods/impls.d.ts +3 -3
- package/dist/cjs/src/mods/impls.d.ts.map +1 -1
- package/dist/cjs/src/mods/impls.js +2 -1
- package/dist/cjs/src/mods/impls.js.map +1 -1
- package/dist/cjs/src/mods/users.d.ts +1 -1
- package/dist/cjs/src/mods/users.d.ts.map +1 -1
- package/dist/cjs/src/package-json.js +3 -3
- package/dist/cjs/src/sayable/deliver-sayable.d.ts +1 -1
- package/dist/cjs/src/sayable/deliver-sayable.d.ts.map +1 -1
- package/dist/cjs/src/sayable/deliver-sayable.js +30 -2
- package/dist/cjs/src/sayable/deliver-sayable.js.map +1 -1
- package/dist/cjs/src/sayable/message-to-sayable.d.ts.map +1 -1
- package/dist/cjs/src/sayable/message-to-sayable.js +2 -0
- package/dist/cjs/src/sayable/message-to-sayable.js.map +1 -1
- package/dist/cjs/src/sayable/payload-to-sayable.d.ts.map +1 -1
- package/dist/cjs/src/sayable/payload-to-sayable.js +2 -0
- package/dist/cjs/src/sayable/payload-to-sayable.js.map +1 -1
- package/dist/cjs/src/sayable/sayable-to-payload.d.ts.map +1 -1
- package/dist/cjs/src/sayable/sayable-to-payload.js +3 -0
- package/dist/cjs/src/sayable/sayable-to-payload.js.map +1 -1
- package/dist/cjs/src/sayable/types.d.ts +2 -2
- package/dist/cjs/src/sayable/types.d.ts.map +1 -1
- package/dist/cjs/src/sayable/types.js.map +1 -1
- package/dist/cjs/src/user-modules/consult-card.d.ts +11 -9
- package/dist/cjs/src/user-modules/consult-card.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/consult-card.js +26 -25
- package/dist/cjs/src/user-modules/consult-card.js.map +1 -1
- package/dist/cjs/src/user-modules/message.d.ts +2 -0
- package/dist/cjs/src/user-modules/message.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/message.js +11 -0
- package/dist/cjs/src/user-modules/message.js.map +1 -1
- package/dist/cjs/src/user-modules/mod.d.ts +4 -3
- package/dist/cjs/src/user-modules/mod.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/mod.js +3 -1
- package/dist/cjs/src/user-modules/mod.js.map +1 -1
- package/dist/cjs/src/user-modules/premium-online-appointment-card.d.ts +40 -0
- package/dist/cjs/src/user-modules/premium-online-appointment-card.d.ts.map +1 -0
- package/dist/cjs/src/user-modules/premium-online-appointment-card.js +60 -0
- package/dist/cjs/src/user-modules/premium-online-appointment-card.js.map +1 -0
- package/dist/cjs/src/wechaty/wechaty-base.d.ts +11 -1
- package/dist/cjs/src/wechaty/wechaty-base.d.ts.map +1 -1
- package/dist/cjs/src/wechaty/wechaty-base.js +1 -1
- package/dist/cjs/src/wechaty/wechaty-impl.spec.js +7 -5
- package/dist/cjs/src/wechaty/wechaty-impl.spec.js.map +1 -1
- package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts +15 -3
- package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/misc-mixin.d.ts +6 -0
- package/dist/cjs/src/wechaty-mixins/misc-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/plugin-mixin.d.ts +8 -0
- package/dist/cjs/src/wechaty-mixins/plugin-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts +6 -20
- package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.d.ts +4 -2
- package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.js +3 -0
- package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.js.map +1 -1
- package/dist/esm/src/mods/impls.d.ts +3 -3
- package/dist/esm/src/mods/impls.d.ts.map +1 -1
- package/dist/esm/src/mods/impls.js +1 -1
- package/dist/esm/src/mods/impls.js.map +1 -1
- package/dist/esm/src/mods/users.d.ts +1 -1
- package/dist/esm/src/mods/users.d.ts.map +1 -1
- package/dist/esm/src/package-json.js +3 -3
- package/dist/esm/src/sayable/deliver-sayable.d.ts +1 -1
- package/dist/esm/src/sayable/deliver-sayable.d.ts.map +1 -1
- package/dist/esm/src/sayable/deliver-sayable.js +8 -3
- package/dist/esm/src/sayable/deliver-sayable.js.map +1 -1
- package/dist/esm/src/sayable/message-to-sayable.d.ts.map +1 -1
- package/dist/esm/src/sayable/message-to-sayable.js +2 -0
- package/dist/esm/src/sayable/message-to-sayable.js.map +1 -1
- package/dist/esm/src/sayable/payload-to-sayable.d.ts.map +1 -1
- package/dist/esm/src/sayable/payload-to-sayable.js +2 -0
- package/dist/esm/src/sayable/payload-to-sayable.js.map +1 -1
- package/dist/esm/src/sayable/sayable-to-payload.d.ts.map +1 -1
- package/dist/esm/src/sayable/sayable-to-payload.js +4 -1
- package/dist/esm/src/sayable/sayable-to-payload.js.map +1 -1
- package/dist/esm/src/sayable/types.d.ts +2 -2
- package/dist/esm/src/sayable/types.d.ts.map +1 -1
- package/dist/esm/src/sayable/types.js.map +1 -1
- package/dist/esm/src/user-modules/consult-card.d.ts +11 -9
- package/dist/esm/src/user-modules/consult-card.d.ts.map +1 -1
- package/dist/esm/src/user-modules/consult-card.js +26 -25
- package/dist/esm/src/user-modules/consult-card.js.map +1 -1
- package/dist/esm/src/user-modules/message.d.ts +2 -0
- package/dist/esm/src/user-modules/message.d.ts.map +1 -1
- package/dist/esm/src/user-modules/message.js +11 -0
- package/dist/esm/src/user-modules/message.js.map +1 -1
- package/dist/esm/src/user-modules/mod.d.ts +4 -3
- package/dist/esm/src/user-modules/mod.d.ts.map +1 -1
- package/dist/esm/src/user-modules/mod.js +2 -1
- package/dist/esm/src/user-modules/mod.js.map +1 -1
- package/dist/esm/src/user-modules/premium-online-appointment-card.d.ts +40 -0
- package/dist/esm/src/user-modules/premium-online-appointment-card.d.ts.map +1 -0
- package/dist/esm/src/user-modules/premium-online-appointment-card.js +57 -0
- package/dist/esm/src/user-modules/premium-online-appointment-card.js.map +1 -0
- package/dist/esm/src/wechaty/wechaty-base.d.ts +11 -1
- package/dist/esm/src/wechaty/wechaty-base.d.ts.map +1 -1
- package/dist/esm/src/wechaty/wechaty-base.js +1 -1
- package/dist/esm/src/wechaty/wechaty-impl.spec.js +7 -5
- package/dist/esm/src/wechaty/wechaty-impl.spec.js.map +1 -1
- package/dist/esm/src/wechaty-mixins/login-mixin.d.ts +15 -3
- package/dist/esm/src/wechaty-mixins/login-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/misc-mixin.d.ts +6 -0
- package/dist/esm/src/wechaty-mixins/misc-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/plugin-mixin.d.ts +8 -0
- package/dist/esm/src/wechaty-mixins/plugin-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts +6 -20
- package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.d.ts +4 -2
- package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.js +4 -1
- package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.js.map +1 -1
- package/package.json +2 -2
- package/src/mods/impls.ts +3 -0
- package/src/mods/users.ts +23 -22
- package/src/package-json.ts +3 -3
- package/src/sayable/deliver-sayable.ts +9 -5
- package/src/sayable/message-to-sayable.ts +3 -0
- package/src/sayable/payload-to-sayable.ts +3 -0
- package/src/sayable/sayable-to-payload.ts +3 -0
- package/src/sayable/types.ts +2 -0
- package/src/user-modules/consult-card.ts +42 -28
- package/src/user-modules/message.ts +18 -0
- package/src/user-modules/mod.ts +8 -0
- package/src/user-modules/premium-online-appointment-card.ts +100 -0
- package/src/wechaty/wechaty-base.ts +1 -1
- package/src/wechaty/wechaty-impl.spec.ts +24 -21
- package/src/wechaty-mixins/wechatify-user-module-mixin.ts +70 -64
|
@@ -50,6 +50,9 @@ const payloadToSayableWechaty: (w: WechatyInterface) => (p: PUPPET.payloads.Saya
|
|
|
50
50
|
case PUPPET.types.Sayable.ConsultCard:
|
|
51
51
|
return new wechaty.ConsultCard(sayable.payload)
|
|
52
52
|
|
|
53
|
+
case PUPPET.types.Sayable.PremiumOnlineAppointmentCard:
|
|
54
|
+
return new wechaty.PremiumOnlineAppointmentCard(sayable.payload)
|
|
55
|
+
|
|
53
56
|
default:
|
|
54
57
|
throw new Error('payloadToSayable() not support payload: ' + JSON.stringify(sayable))
|
|
55
58
|
}
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
ChannelImpl,
|
|
14
14
|
ChannelCardImpl,
|
|
15
15
|
ConsultCardImpl,
|
|
16
|
+
PremiumOnlineAppointmentCardImpl,
|
|
16
17
|
} from '../user-modules/mod.js'
|
|
17
18
|
|
|
18
19
|
import type {
|
|
@@ -52,6 +53,8 @@ async function sayableToPayload (sayable: Sayable): Promise<undefined | PUPPET.p
|
|
|
52
53
|
return PUPPET.payloads.sayable.channelCard(sayable.payload)
|
|
53
54
|
} else if (ConsultCardImpl.validInstance(sayable)) {
|
|
54
55
|
return PUPPET.payloads.sayable.consultCard(sayable.payload)
|
|
56
|
+
} else if (PremiumOnlineAppointmentCardImpl.validInstance(sayable)) {
|
|
57
|
+
return PUPPET.payloads.sayable.premiumOnlineAppointmentCard(sayable.payload)
|
|
55
58
|
} else {
|
|
56
59
|
log.error('Wechaty', 'sayableToPayload() unsupported sayable: %s', sayable)
|
|
57
60
|
return undefined
|
package/src/sayable/types.ts
CHANGED
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
MessageImpl,
|
|
35
35
|
ChannelCardInterface,
|
|
36
36
|
ConsultCardInterface,
|
|
37
|
+
PremiumOnlineAppointmentCardInterface,
|
|
37
38
|
} from '../user-modules/mod.js'
|
|
38
39
|
|
|
39
40
|
import type {
|
|
@@ -54,6 +55,7 @@ type Sayable =
|
|
|
54
55
|
| ChannelInterface
|
|
55
56
|
| ChannelCardInterface
|
|
56
57
|
| ConsultCardInterface
|
|
58
|
+
| PremiumOnlineAppointmentCardInterface
|
|
57
59
|
|
|
58
60
|
interface SayableSayer {
|
|
59
61
|
id : string,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type * as PUPPET from '@juzi/wechaty-puppet'
|
|
2
2
|
|
|
3
3
|
import type { Constructor } from 'clone-class'
|
|
4
|
+
|
|
4
5
|
import { log } from '../config.js'
|
|
5
6
|
|
|
6
7
|
import { validationMixin } from '../user-mixins/validation.js'
|
|
@@ -11,26 +12,6 @@ import {
|
|
|
11
12
|
|
|
12
13
|
class ConsultCardMixin extends wechatifyMixinBase() {
|
|
13
14
|
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
* Create
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
static async create (msgType: number, componentType: number, componentId: number): Promise<ConsultCardInterface> {
|
|
20
|
-
log.verbose('ConsultCard', 'create()')
|
|
21
|
-
|
|
22
|
-
const payload: PUPPET.payloads.ConsultCard = {
|
|
23
|
-
msgType,
|
|
24
|
-
componentType,
|
|
25
|
-
componentId,
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return new this(payload)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/*
|
|
32
|
-
* @hideconstructor
|
|
33
|
-
*/
|
|
34
15
|
constructor (
|
|
35
16
|
public readonly payload: PUPPET.payloads.ConsultCard,
|
|
36
17
|
) {
|
|
@@ -38,19 +19,52 @@ class ConsultCardMixin extends wechatifyMixinBase() {
|
|
|
38
19
|
log.verbose('ConsultCard', 'constructor()')
|
|
39
20
|
}
|
|
40
21
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
22
|
+
static async findAll (query: {
|
|
23
|
+
cardType: number,
|
|
24
|
+
status?: number,
|
|
25
|
+
ids?: number[],
|
|
26
|
+
page?: number,
|
|
27
|
+
pageSize?: number
|
|
28
|
+
}): Promise<ConsultCardInterface[]> {
|
|
29
|
+
log.verbose('ConsultCard', 'findAll(%s)', JSON.stringify(query))
|
|
30
|
+
|
|
31
|
+
const params = {
|
|
32
|
+
cardType: query.cardType,
|
|
33
|
+
status: query.status,
|
|
34
|
+
ids: query.ids,
|
|
35
|
+
page: query.page || 1,
|
|
36
|
+
pageSize: query.pageSize || 50,
|
|
37
|
+
}
|
|
44
38
|
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
const result = await (this.wechaty.puppet as any).listConsultCards(params)
|
|
40
|
+
|
|
41
|
+
if (!result || !result.cards) {
|
|
42
|
+
return []
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const consultCardList: ConsultCardInterface[] = result.cards.map((payload: any) => {
|
|
46
|
+
return new this(payload)
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
return consultCardList
|
|
47
50
|
}
|
|
48
51
|
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
static async find (query: {
|
|
53
|
+
cardType: number,
|
|
54
|
+
id: number
|
|
55
|
+
}): Promise<ConsultCardInterface | undefined> {
|
|
56
|
+
log.verbose('ConsultCard', 'find(%s)', JSON.stringify(query))
|
|
57
|
+
|
|
58
|
+
const consultCardList = await this.findAll({
|
|
59
|
+
cardType: query.cardType,
|
|
60
|
+
ids: [ query.id ],
|
|
61
|
+
page: 1,
|
|
62
|
+
pageSize: 1,
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
return consultCardList.length > 0 ? consultCardList[0] : undefined
|
|
51
66
|
}
|
|
52
67
|
|
|
53
|
-
// 接收/查询时的详细字段
|
|
54
68
|
id (): number | undefined {
|
|
55
69
|
return this.payload.id
|
|
56
70
|
}
|
|
@@ -77,6 +77,9 @@ import type {
|
|
|
77
77
|
import type {
|
|
78
78
|
ConsultCardInterface,
|
|
79
79
|
} from './consult-card.js'
|
|
80
|
+
import type {
|
|
81
|
+
PremiumOnlineAppointmentCardInterface,
|
|
82
|
+
} from './premium-online-appointment-card.js'
|
|
80
83
|
|
|
81
84
|
import { validationMixin } from '../user-mixins/validation.js'
|
|
82
85
|
import type { ContactSelfImpl } from './contact-self.js'
|
|
@@ -1424,6 +1427,21 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1424
1427
|
return new this.wechaty.ConsultCard(consultCardPayload)
|
|
1425
1428
|
}
|
|
1426
1429
|
|
|
1430
|
+
public async toPremiumOnlineAppointmentCard (): Promise<PremiumOnlineAppointmentCardInterface> {
|
|
1431
|
+
log.verbose('Message', 'toPremiumOnlineAppointmentCard()')
|
|
1432
|
+
|
|
1433
|
+
if (!this.payload) {
|
|
1434
|
+
throw new Error('no payload')
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
if (this.type() !== PUPPET.types.Message.PremiumOnlineAppointmentCard) {
|
|
1438
|
+
throw new Error('message not a PremiumOnlineAppointmentCard')
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
const premiumOnlineAppointmentCardPayload = await this.wechaty.puppet.messagePremiumOnlineAppointmentCard(this.id)
|
|
1442
|
+
return new this.wechaty.PremiumOnlineAppointmentCard(premiumOnlineAppointmentCardPayload)
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1427
1445
|
public async toCallRecord (): Promise<CallRecordInterface> {
|
|
1428
1446
|
log.verbose('Message', 'toCallRecord()')
|
|
1429
1447
|
|
package/src/user-modules/mod.ts
CHANGED
|
@@ -117,6 +117,11 @@ import {
|
|
|
117
117
|
ConsultCardInterface,
|
|
118
118
|
ConsultCardConstructor,
|
|
119
119
|
} from './consult-card.js'
|
|
120
|
+
import {
|
|
121
|
+
PremiumOnlineAppointmentCardImpl,
|
|
122
|
+
PremiumOnlineAppointmentCardInterface,
|
|
123
|
+
PremiumOnlineAppointmentCardConstructor,
|
|
124
|
+
} from './premium-online-appointment-card.js'
|
|
120
125
|
import {
|
|
121
126
|
CallRecordImpl,
|
|
122
127
|
CallRecordInterface,
|
|
@@ -156,6 +161,7 @@ export type {
|
|
|
156
161
|
ChannelInterface,
|
|
157
162
|
ChannelCardInterface,
|
|
158
163
|
ConsultCardInterface,
|
|
164
|
+
PremiumOnlineAppointmentCardInterface,
|
|
159
165
|
CallRecordInterface,
|
|
160
166
|
ChatHistoryInterface,
|
|
161
167
|
WecomInterface,
|
|
@@ -182,6 +188,7 @@ export type {
|
|
|
182
188
|
ChannelConstructor,
|
|
183
189
|
ChannelCardConstructor,
|
|
184
190
|
ConsultCardConstructor,
|
|
191
|
+
PremiumOnlineAppointmentCardConstructor,
|
|
185
192
|
CallRecordConstructor,
|
|
186
193
|
ChatHistoryConstructor,
|
|
187
194
|
WecomConstructor,
|
|
@@ -210,6 +217,7 @@ export {
|
|
|
210
217
|
ChannelImpl,
|
|
211
218
|
ChannelCardImpl,
|
|
212
219
|
ConsultCardImpl,
|
|
220
|
+
PremiumOnlineAppointmentCardImpl,
|
|
213
221
|
CallRecordImpl,
|
|
214
222
|
ChatHistoryImpl,
|
|
215
223
|
WecomImpl,
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type * as PUPPET from '@juzi/wechaty-puppet'
|
|
2
|
+
|
|
3
|
+
import type { Constructor } from 'clone-class'
|
|
4
|
+
import { log } from '../config.js'
|
|
5
|
+
|
|
6
|
+
import { validationMixin } from '../user-mixins/validation.js'
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
wechatifyMixinBase,
|
|
10
|
+
} from '../user-mixins/wechatify.js'
|
|
11
|
+
|
|
12
|
+
const PREMIUM_ONLINE_APPOINTMENT_CARD_LINK_TYPE = 45
|
|
13
|
+
|
|
14
|
+
class PremiumOnlineAppointmentCardMixin extends wechatifyMixinBase() {
|
|
15
|
+
|
|
16
|
+
constructor (
|
|
17
|
+
public readonly payload: PUPPET.payloads.PremiumOnlineAppointmentCard,
|
|
18
|
+
) {
|
|
19
|
+
super()
|
|
20
|
+
log.verbose('PremiumOnlineAppointmentCard', 'constructor()')
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static async findAll (query: {
|
|
24
|
+
linkTypes?: number[],
|
|
25
|
+
page?: number,
|
|
26
|
+
pageSize?: number
|
|
27
|
+
}): Promise<PremiumOnlineAppointmentCardInterface[]> {
|
|
28
|
+
log.verbose('PremiumOnlineAppointmentCard', 'findAll(%s)', JSON.stringify(query))
|
|
29
|
+
|
|
30
|
+
const params = {
|
|
31
|
+
linkTypes: query.linkTypes || [ PREMIUM_ONLINE_APPOINTMENT_CARD_LINK_TYPE ],
|
|
32
|
+
page: query.page || 1,
|
|
33
|
+
pageSize: query.pageSize || 50,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const result = await (this.wechaty.puppet as any).listPremiumOnlineAppointmentCards(params)
|
|
37
|
+
|
|
38
|
+
if (!result || !result.tools) {
|
|
39
|
+
return []
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const cardList: PremiumOnlineAppointmentCardInterface[] = result.tools.map((payload: any) => {
|
|
43
|
+
return new this(payload)
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
return cardList
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static async find (query: {
|
|
50
|
+
componentId: number
|
|
51
|
+
}): Promise<PremiumOnlineAppointmentCardInterface | undefined> {
|
|
52
|
+
log.verbose('PremiumOnlineAppointmentCard', 'find(%s)', JSON.stringify(query))
|
|
53
|
+
|
|
54
|
+
const linkTypes = [ PREMIUM_ONLINE_APPOINTMENT_CARD_LINK_TYPE ]
|
|
55
|
+
const cardList = await this.findAll({
|
|
56
|
+
linkTypes,
|
|
57
|
+
page: 1,
|
|
58
|
+
pageSize: 50,
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
return cardList.find(card => card.componentId() === query.componentId)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
componentId (): number {
|
|
65
|
+
return this.payload.componentId
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
titleImage (): string | undefined {
|
|
69
|
+
return this.payload.titleImage
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
createTime (): number | undefined {
|
|
73
|
+
return this.payload.createTime
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
title (): string | undefined {
|
|
77
|
+
return this.payload.title
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
subTitle (): string | undefined {
|
|
81
|
+
return this.payload.subTitle
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
class PremiumOnlineAppointmentCardImpl extends validationMixin(PremiumOnlineAppointmentCardMixin)<PremiumOnlineAppointmentCardInterface>() { }
|
|
87
|
+
interface PremiumOnlineAppointmentCardInterface extends PremiumOnlineAppointmentCardImpl { }
|
|
88
|
+
|
|
89
|
+
type PremiumOnlineAppointmentCardConstructor = Constructor<
|
|
90
|
+
PremiumOnlineAppointmentCardInterface,
|
|
91
|
+
typeof PremiumOnlineAppointmentCardImpl
|
|
92
|
+
>
|
|
93
|
+
|
|
94
|
+
export type {
|
|
95
|
+
PremiumOnlineAppointmentCardConstructor,
|
|
96
|
+
PremiumOnlineAppointmentCardInterface,
|
|
97
|
+
}
|
|
98
|
+
export {
|
|
99
|
+
PremiumOnlineAppointmentCardImpl,
|
|
100
|
+
}
|
|
@@ -219,7 +219,7 @@ class WechatyBase extends mixinBase implements SayableSayer {
|
|
|
219
219
|
* > Tips:
|
|
220
220
|
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/wechaty/wechaty/wiki/Puppet#3-puppet-compatible-table)
|
|
221
221
|
*
|
|
222
|
-
* @param {(string | Contact | FileBox | UrlLink | MiniProgram | Location | Channel | ChannelCard | ConsultCard)} sayable
|
|
222
|
+
* @param {(string | Contact | FileBox | UrlLink | MiniProgram | Location | Channel | ChannelCard | ConsultCard | PremiumOnlineAppointmentCard)} sayable
|
|
223
223
|
* send text, Contact, or file to bot. </br>
|
|
224
224
|
* You can use {@link https://www.npmjs.com/package/file-box|FileBox} to send file
|
|
225
225
|
*
|
|
@@ -23,6 +23,7 @@ import type {
|
|
|
23
23
|
ChannelConstructor,
|
|
24
24
|
ChannelCardConstructor,
|
|
25
25
|
ConsultCardConstructor,
|
|
26
|
+
PremiumOnlineAppointmentCardConstructor,
|
|
26
27
|
MomentConstructor,
|
|
27
28
|
CallRecordConstructor,
|
|
28
29
|
ChatHistoryConstructor,
|
|
@@ -40,27 +41,28 @@ import {
|
|
|
40
41
|
test('Wechaty interface', async t => {
|
|
41
42
|
abstract class WechatyImplementation extends WechatyEventEmitter implements WechatyInterface {
|
|
42
43
|
|
|
43
|
-
Contact
|
|
44
|
-
ContactSelf
|
|
45
|
-
Delay
|
|
46
|
-
Friendship
|
|
47
|
-
Image
|
|
48
|
-
Location
|
|
49
|
-
Message
|
|
50
|
-
MiniProgram
|
|
51
|
-
Post
|
|
52
|
-
Room
|
|
53
|
-
RoomInvitation
|
|
54
|
-
Tag
|
|
55
|
-
TagGroup
|
|
56
|
-
UrlLink
|
|
57
|
-
Channel
|
|
58
|
-
ChannelCard
|
|
59
|
-
ConsultCard
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
44
|
+
Contact : ContactConstructor
|
|
45
|
+
ContactSelf : ContactSelfConstructor
|
|
46
|
+
Delay : DelayConstructor
|
|
47
|
+
Friendship : FriendshipConstructor
|
|
48
|
+
Image : ImageConstructor
|
|
49
|
+
Location : LocationConstructor
|
|
50
|
+
Message : MessageConstructor
|
|
51
|
+
MiniProgram : MiniProgramConstructor
|
|
52
|
+
Post : PostConstructor
|
|
53
|
+
Room : RoomConstructor
|
|
54
|
+
RoomInvitation : RoomInvitationConstructor
|
|
55
|
+
Tag : TagConstructor
|
|
56
|
+
TagGroup : TagGroupConstructor
|
|
57
|
+
UrlLink : UrlLinkConstructor
|
|
58
|
+
Channel : ChannelConstructor
|
|
59
|
+
ChannelCard : ChannelCardConstructor
|
|
60
|
+
ConsultCard : ConsultCardConstructor
|
|
61
|
+
PremiumOnlineAppointmentCard : PremiumOnlineAppointmentCardConstructor
|
|
62
|
+
Moment : MomentConstructor
|
|
63
|
+
CallRecord : CallRecordConstructor
|
|
64
|
+
ChatHistory : ChatHistoryConstructor
|
|
65
|
+
Wecom : WecomConstructor
|
|
64
66
|
|
|
65
67
|
constructor () {
|
|
66
68
|
super()
|
|
@@ -82,6 +84,7 @@ test('Wechaty interface', async t => {
|
|
|
82
84
|
= this.Channel
|
|
83
85
|
= this.ChannelCard
|
|
84
86
|
= this.ConsultCard
|
|
87
|
+
= this.PremiumOnlineAppointmentCard
|
|
85
88
|
= this.Moment
|
|
86
89
|
= this.CallRecord
|
|
87
90
|
= this.ChatHistory
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
ChannelImpl,
|
|
19
19
|
ChannelCardImpl,
|
|
20
20
|
ConsultCardImpl,
|
|
21
|
+
PremiumOnlineAppointmentCardImpl,
|
|
21
22
|
MomentImpl,
|
|
22
23
|
CallRecordImpl,
|
|
23
24
|
ChatHistoryImpl,
|
|
@@ -40,6 +41,7 @@ import {
|
|
|
40
41
|
ChannelConstructor,
|
|
41
42
|
ChannelCardConstructor,
|
|
42
43
|
ConsultCardConstructor,
|
|
44
|
+
PremiumOnlineAppointmentCardConstructor,
|
|
43
45
|
MomentConstructor,
|
|
44
46
|
CallRecordConstructor,
|
|
45
47
|
ChatHistoryConstructor,
|
|
@@ -62,49 +64,51 @@ const wechatifyUserModuleMixin = <MixinBase extends typeof WechatySkeleton> (mix
|
|
|
62
64
|
super(...args)
|
|
63
65
|
}
|
|
64
66
|
|
|
65
|
-
__wechatifiedContact?
|
|
66
|
-
__wechatifiedContactSelf?
|
|
67
|
-
__wechatifiedDelay?
|
|
68
|
-
__wechatifiedFriendship?
|
|
69
|
-
__wechatifiedImage?
|
|
70
|
-
__wechatifiedLocation?
|
|
71
|
-
__wechatifiedMessage?
|
|
72
|
-
__wechatifiedMiniProgram?
|
|
73
|
-
__wechatifiedPost?
|
|
74
|
-
__wechatifiedRoom?
|
|
75
|
-
__wechatifiedRoomInvitation?
|
|
76
|
-
__wechatifiedTag?
|
|
77
|
-
__wechatifiedTagGroup?
|
|
78
|
-
__wechatifiedUrlLink?
|
|
79
|
-
__wechatifiedChannel?
|
|
80
|
-
__wechatifiedChannelCard?
|
|
81
|
-
__wechatifiedConsultCard?
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
get
|
|
89
|
-
get
|
|
90
|
-
get
|
|
91
|
-
get
|
|
92
|
-
get
|
|
93
|
-
get
|
|
94
|
-
get
|
|
95
|
-
get
|
|
96
|
-
get
|
|
97
|
-
get
|
|
98
|
-
get
|
|
99
|
-
get
|
|
100
|
-
get
|
|
101
|
-
get
|
|
102
|
-
get
|
|
103
|
-
get
|
|
104
|
-
get
|
|
105
|
-
get
|
|
106
|
-
get
|
|
107
|
-
get
|
|
67
|
+
__wechatifiedContact? : ContactConstructor
|
|
68
|
+
__wechatifiedContactSelf? : ContactSelfConstructor
|
|
69
|
+
__wechatifiedDelay? : DelayConstructor
|
|
70
|
+
__wechatifiedFriendship? : FriendshipConstructor
|
|
71
|
+
__wechatifiedImage? : ImageConstructor
|
|
72
|
+
__wechatifiedLocation? : LocationConstructor
|
|
73
|
+
__wechatifiedMessage? : MessageConstructor
|
|
74
|
+
__wechatifiedMiniProgram? : MiniProgramConstructor
|
|
75
|
+
__wechatifiedPost? : PostConstructor
|
|
76
|
+
__wechatifiedRoom? : RoomConstructor
|
|
77
|
+
__wechatifiedRoomInvitation? : RoomInvitationConstructor
|
|
78
|
+
__wechatifiedTag? : TagConstructor
|
|
79
|
+
__wechatifiedTagGroup? : TagGroupConstructor
|
|
80
|
+
__wechatifiedUrlLink? : UrlLinkConstructor
|
|
81
|
+
__wechatifiedChannel? : ChannelConstructor
|
|
82
|
+
__wechatifiedChannelCard? : ChannelCardConstructor
|
|
83
|
+
__wechatifiedConsultCard? : ConsultCardConstructor
|
|
84
|
+
__wechatifiedPremiumOnlineAppointmentCard? : PremiumOnlineAppointmentCardConstructor
|
|
85
|
+
__wechatifiedMoment? : MomentConstructor
|
|
86
|
+
__wechatifiedCallRecord? : CallRecordConstructor
|
|
87
|
+
__wechatifiedChatHistory? : ChatHistoryConstructor
|
|
88
|
+
__wechatifiedWecom? : WecomConstructor
|
|
89
|
+
|
|
90
|
+
get Contact () : ContactConstructor { return guardWechatify(this.__wechatifiedContact) }
|
|
91
|
+
get ContactSelf () : ContactSelfConstructor { return guardWechatify(this.__wechatifiedContactSelf) }
|
|
92
|
+
get Delay () : DelayConstructor { return guardWechatify(this.__wechatifiedDelay) }
|
|
93
|
+
get Friendship () : FriendshipConstructor { return guardWechatify(this.__wechatifiedFriendship) }
|
|
94
|
+
get Image () : ImageConstructor { return guardWechatify(this.__wechatifiedImage) }
|
|
95
|
+
get Location () : LocationConstructor { return guardWechatify(this.__wechatifiedLocation) }
|
|
96
|
+
get Message () : MessageConstructor { return guardWechatify(this.__wechatifiedMessage) }
|
|
97
|
+
get MiniProgram () : MiniProgramConstructor { return guardWechatify(this.__wechatifiedMiniProgram) }
|
|
98
|
+
get Post () : PostConstructor { return guardWechatify(this.__wechatifiedPost) }
|
|
99
|
+
get Room () : RoomConstructor { return guardWechatify(this.__wechatifiedRoom) }
|
|
100
|
+
get RoomInvitation () : RoomInvitationConstructor { return guardWechatify(this.__wechatifiedRoomInvitation) }
|
|
101
|
+
get Tag () : TagConstructor { return guardWechatify(this.__wechatifiedTag) }
|
|
102
|
+
get TagGroup () : TagGroupConstructor { return guardWechatify(this.__wechatifiedTagGroup) }
|
|
103
|
+
get UrlLink () : UrlLinkConstructor { return guardWechatify(this.__wechatifiedUrlLink) }
|
|
104
|
+
get Channel () : ChannelConstructor { return guardWechatify(this.__wechatifiedChannel) }
|
|
105
|
+
get ChannelCard () : ChannelCardConstructor { return guardWechatify(this.__wechatifiedChannelCard) }
|
|
106
|
+
get ConsultCard () : ConsultCardConstructor { return guardWechatify(this.__wechatifiedConsultCard) }
|
|
107
|
+
get PremiumOnlineAppointmentCard () : PremiumOnlineAppointmentCardConstructor { return guardWechatify(this.__wechatifiedPremiumOnlineAppointmentCard) }
|
|
108
|
+
get Moment () : MomentConstructor { return guardWechatify(this.__wechatifiedMoment) }
|
|
109
|
+
get CallRecord () : CallRecordConstructor { return guardWechatify(this.__wechatifiedCallRecord) }
|
|
110
|
+
get ChatHistory () : ChatHistoryConstructor { return guardWechatify(this.__wechatifiedChatHistory) }
|
|
111
|
+
get Wecom () : WecomConstructor { return guardWechatify(this.__wechatifiedWecom) }
|
|
108
112
|
|
|
109
113
|
override async init (): Promise<void> {
|
|
110
114
|
log.verbose('WechatifyUserModuleMixin', 'init()')
|
|
@@ -126,27 +130,28 @@ const wechatifyUserModuleMixin = <MixinBase extends typeof WechatySkeleton> (mix
|
|
|
126
130
|
*
|
|
127
131
|
* Huan(202110): FIXME: remove any
|
|
128
132
|
*/
|
|
129
|
-
this.__wechatifiedContact
|
|
130
|
-
this.__wechatifiedContactSelf
|
|
131
|
-
this.__wechatifiedDelay
|
|
132
|
-
this.__wechatifiedFriendship
|
|
133
|
-
this.__wechatifiedImage
|
|
134
|
-
this.__wechatifiedLocation
|
|
135
|
-
this.__wechatifiedMessage
|
|
136
|
-
this.__wechatifiedMiniProgram
|
|
137
|
-
this.__wechatifiedPost
|
|
138
|
-
this.__wechatifiedRoom
|
|
139
|
-
this.__wechatifiedRoomInvitation
|
|
140
|
-
this.__wechatifiedTag
|
|
141
|
-
this.__wechatifiedTagGroup
|
|
142
|
-
this.__wechatifiedUrlLink
|
|
143
|
-
this.__wechatifiedChannel
|
|
144
|
-
this.__wechatifiedChannelCard
|
|
145
|
-
this.__wechatifiedConsultCard
|
|
146
|
-
this.
|
|
147
|
-
this.
|
|
148
|
-
this.
|
|
149
|
-
this.
|
|
133
|
+
this.__wechatifiedContact = wechatifyUserModule(ContactImpl)(this as any)
|
|
134
|
+
this.__wechatifiedContactSelf = wechatifyUserModule(ContactSelfImpl)(this as any)
|
|
135
|
+
this.__wechatifiedDelay = wechatifyUserModule(DelayImpl)(this as any)
|
|
136
|
+
this.__wechatifiedFriendship = wechatifyUserModule(FriendshipImpl)(this as any)
|
|
137
|
+
this.__wechatifiedImage = wechatifyUserModule(ImageImpl)(this as any)
|
|
138
|
+
this.__wechatifiedLocation = wechatifyUserModule(LocationImpl)(this as any)
|
|
139
|
+
this.__wechatifiedMessage = wechatifyUserModule(MessageImpl)(this as any)
|
|
140
|
+
this.__wechatifiedMiniProgram = wechatifyUserModule(MiniProgramImpl)(this as any)
|
|
141
|
+
this.__wechatifiedPost = wechatifyUserModule(PostImpl)(this as any)
|
|
142
|
+
this.__wechatifiedRoom = wechatifyUserModule(RoomImpl)(this as any)
|
|
143
|
+
this.__wechatifiedRoomInvitation = wechatifyUserModule(RoomInvitationImpl)(this as any)
|
|
144
|
+
this.__wechatifiedTag = wechatifyUserModule(TagImpl)(this as any)
|
|
145
|
+
this.__wechatifiedTagGroup = wechatifyUserModule(TagGroupImpl)(this as any)
|
|
146
|
+
this.__wechatifiedUrlLink = wechatifyUserModule(UrlLinkImpl)(this as any)
|
|
147
|
+
this.__wechatifiedChannel = wechatifyUserModule(ChannelImpl)(this as any)
|
|
148
|
+
this.__wechatifiedChannelCard = wechatifyUserModule(ChannelCardImpl)(this as any)
|
|
149
|
+
this.__wechatifiedConsultCard = wechatifyUserModule(ConsultCardImpl)(this as any)
|
|
150
|
+
this.__wechatifiedPremiumOnlineAppointmentCard = wechatifyUserModule(PremiumOnlineAppointmentCardImpl)(this as any)
|
|
151
|
+
this.__wechatifiedMoment = wechatifyUserModule(MomentImpl)(this as any)
|
|
152
|
+
this.__wechatifiedCallRecord = wechatifyUserModule(CallRecordImpl)(this as any)
|
|
153
|
+
this.__wechatifiedChatHistory = wechatifyUserModule(ChatHistoryImpl)(this as any)
|
|
154
|
+
this.__wechatifiedWecom = wechatifyUserModule(WecomImpl)(this as any)
|
|
150
155
|
|
|
151
156
|
log.verbose('WechatifyUserModuleMixin', 'init() initializing Wechaty User Module (WUM) ... done')
|
|
152
157
|
}
|
|
@@ -185,6 +190,7 @@ type ProtectedPropertyWechatifyUserModuleMixin =
|
|
|
185
190
|
| '__wechatifiedChannel'
|
|
186
191
|
| '__wechatifiedChannelCard'
|
|
187
192
|
| '__wechatifiedConsultCard'
|
|
193
|
+
| '__wechatifiedPremiumOnlineAppointmentCard'
|
|
188
194
|
| '__wechatifiedMoment'
|
|
189
195
|
| '__wechatifiedCallRecord'
|
|
190
196
|
| '__wechatifiedChatHistory'
|