@juzi/wechaty 1.0.68 → 1.0.70
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 +2 -2
- 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 +4 -4
- package/dist/cjs/src/user-modules/call.d.ts +34 -0
- package/dist/cjs/src/user-modules/call.d.ts.map +1 -0
- package/dist/cjs/src/user-modules/call.js +77 -0
- package/dist/cjs/src/user-modules/call.js.map +1 -0
- 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 +12 -4
- 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/wechaty/wechaty-base.d.ts +125 -0
- package/dist/cjs/src/wechaty/wechaty-base.d.ts.map +1 -1
- package/dist/cjs/src/wechaty/wechaty-impl.spec.js +3 -1
- package/dist/cjs/src/wechaty/wechaty-impl.spec.js.map +1 -1
- package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts +18 -0
- package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/misc-mixin.d.ts +9 -9
- 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 +4 -0
- 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 +2 -2
- 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 +4 -4
- package/dist/esm/src/user-modules/call.d.ts +34 -0
- package/dist/esm/src/user-modules/call.d.ts.map +1 -0
- package/dist/esm/src/user-modules/call.js +51 -0
- package/dist/esm/src/user-modules/call.js.map +1 -0
- 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 +12 -4
- 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/wechaty/wechaty-base.d.ts +125 -0
- package/dist/esm/src/wechaty/wechaty-base.d.ts.map +1 -1
- package/dist/esm/src/wechaty/wechaty-impl.spec.js +3 -1
- package/dist/esm/src/wechaty/wechaty-impl.spec.js.map +1 -1
- package/dist/esm/src/wechaty-mixins/login-mixin.d.ts +18 -0
- package/dist/esm/src/wechaty-mixins/login-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/misc-mixin.d.ts +9 -9
- 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 +4 -0
- 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 +3 -3
- package/src/mods/impls.ts +2 -0
- package/src/mods/users.ts +1 -0
- package/src/package-json.ts +4 -4
- package/src/user-modules/call.ts +82 -0
- package/src/user-modules/message.ts +17 -4
- package/src/user-modules/mod.ts +8 -0
- package/src/wechaty/wechaty-impl.spec.ts +3 -0
- package/src/wechaty-mixins/wechatify-user-module-mixin.ts +6 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wechatify-user-module-mixin.js","sourceRoot":"","sources":["../../../../src/wechaty-mixins/wechatify-user-module-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAe,sBAAsB,CAAA;AAEnD,OAAO,EACL,WAAW,EACX,eAAe,EACf,SAAS,EACT,cAAc,EACd,SAAS,EACT,YAAY,EACZ,WAAW,EACX,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,OAAO,EACP,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,
|
|
1
|
+
{"version":3,"file":"wechatify-user-module-mixin.js","sourceRoot":"","sources":["../../../../src/wechaty-mixins/wechatify-user-module-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAe,sBAAsB,CAAA;AAEnD,OAAO,EACL,WAAW,EACX,eAAe,EACf,SAAS,EACT,cAAc,E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BAAgB,GAAc,mBAAmB,CAAC,OAAO,CAAC,CAAC,IAAW,CAAC,CAAA;YAC5E,IAAI,CAAC,qBAAqB,GAAS,mBAAmB,CAAC,YAAY,CAAC,CAAC,IAAW,CAAC,CAAA;YACjF,IAAI,CAAC,oBAAoB,GAAU,mBAAmB,CAAC,WAAW,CAAC,CAAC,IAAW,CAAC,CAAA;YAChF,IAAI,CAAC,oBAAoB,GAAU,mBAAmB,CAAC,WAAW,CAAC,CAAC,IAAW,CAAC,CAAA;YAChF,IAAI,CAAC,mBAAmB,GAAW,mBAAmB,CAAC,UAAU,CAAC,CAAC,IAAW,CAAC,CAAA;YAC/E,IAAI,CAAC,uBAAuB,GAAO,mBAAmB,CAAC,cAAc,CAAC,CAAC,IAAW,CAAC,CAAA;YAEnF,GAAG,CAAC,OAAO,CAAC,0BAA0B,EAAE,wDAAwD,CAAC,CAAA;QACnG,CAAC;KAEF;IAED,OAAO,wBAAwB,CAAA;AACjC,CAAC,CAAA;AAED;;GAEG;AACH,SAAS,cAAc,CAAsB,UAAc;IACzD,IAAI,UAAU,EAAE;QACd,OAAO,UAAU,CAAA;KAClB;IACD,MAAM,IAAI,KAAK,CAAC,8FAA8F,CAAC,CAAA;AACjH,CAAC;AA0BD,OAAO,EACL,wBAAwB,GACzB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juzi/wechaty",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.70",
|
|
4
4
|
"description": "Wechaty is a RPA SDK for Chatbot Makers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
},
|
|
110
110
|
"homepage": "https://github.com/wechaty/",
|
|
111
111
|
"dependencies": {
|
|
112
|
-
"@juzi/wechaty-puppet-service": "^1.0.
|
|
112
|
+
"@juzi/wechaty-puppet-service": "^1.0.73",
|
|
113
113
|
"clone-class": "^1.1.1",
|
|
114
114
|
"cmd-ts": "^0.10.0",
|
|
115
115
|
"cockatiel": "^2.0.2",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"@chatie/eslint-config": "^1.0.4",
|
|
133
133
|
"@chatie/semver": "^0.4.7",
|
|
134
134
|
"@chatie/tsconfig": "^4.6.3",
|
|
135
|
-
"@juzi/wechaty-puppet": "^1.0.
|
|
135
|
+
"@juzi/wechaty-puppet": "^1.0.63",
|
|
136
136
|
"@juzi/wechaty-puppet-mock": "^1.0.1",
|
|
137
137
|
"@swc/core": "1.3.44",
|
|
138
138
|
"@swc/helpers": "^0.3.6",
|
package/src/mods/impls.ts
CHANGED
|
@@ -49,6 +49,7 @@ export {
|
|
|
49
49
|
TagGroupImpl,
|
|
50
50
|
UrlLinkImpl,
|
|
51
51
|
ChannelImpl,
|
|
52
|
+
CallRecordImpl,
|
|
52
53
|
} from '../user-modules/mod.js'
|
|
53
54
|
|
|
54
55
|
// export {
|
|
@@ -89,6 +90,7 @@ export type {
|
|
|
89
90
|
TagGroupInterface,
|
|
90
91
|
UrlLinkInterface,
|
|
91
92
|
ChannelInterface,
|
|
93
|
+
CallRecordInterface,
|
|
92
94
|
} from '../user-modules/mod.js'
|
|
93
95
|
|
|
94
96
|
export type {
|
package/src/mods/users.ts
CHANGED
package/src/package-json.ts
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { PackageJsonWechaty } from './config'
|
|
6
6
|
|
|
7
|
-
export const GIT_COMMIT_HASH: string = '
|
|
7
|
+
export const GIT_COMMIT_HASH: string = '79be2c6076f9017e4c4073517fe81e54f3a56a15'
|
|
8
8
|
export const packageJson: PackageJsonWechaty = {
|
|
9
9
|
"name": "@juzi/wechaty",
|
|
10
|
-
"version": "1.0.
|
|
10
|
+
"version": "1.0.70",
|
|
11
11
|
"description": "Wechaty is a RPA SDK for Chatbot Makers.",
|
|
12
12
|
"type": "module",
|
|
13
13
|
"exports": {
|
|
@@ -116,7 +116,7 @@ export const packageJson: PackageJsonWechaty = {
|
|
|
116
116
|
},
|
|
117
117
|
"homepage": "https://github.com/wechaty/",
|
|
118
118
|
"dependencies": {
|
|
119
|
-
"@juzi/wechaty-puppet-service": "^1.0.
|
|
119
|
+
"@juzi/wechaty-puppet-service": "^1.0.73",
|
|
120
120
|
"clone-class": "^1.1.1",
|
|
121
121
|
"cmd-ts": "^0.10.0",
|
|
122
122
|
"cockatiel": "^2.0.2",
|
|
@@ -139,7 +139,7 @@ export const packageJson: PackageJsonWechaty = {
|
|
|
139
139
|
"@chatie/eslint-config": "^1.0.4",
|
|
140
140
|
"@chatie/semver": "^0.4.7",
|
|
141
141
|
"@chatie/tsconfig": "^4.6.3",
|
|
142
|
-
"@juzi/wechaty-puppet": "^1.0.
|
|
142
|
+
"@juzi/wechaty-puppet": "^1.0.63",
|
|
143
143
|
"@juzi/wechaty-puppet-mock": "^1.0.1",
|
|
144
144
|
"@swc/core": "1.3.44",
|
|
145
145
|
"@swc/helpers": "^0.3.6",
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * 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
|
+
import type { ContactImpl, ContactInterface } from './contact.js'
|
|
12
|
+
|
|
13
|
+
class CallRecordMixin extends wechatifyMixinBase() {
|
|
14
|
+
|
|
15
|
+
static async create (): Promise<CallRecordInterface> {
|
|
16
|
+
log.verbose('CallRecord', 'create()')
|
|
17
|
+
|
|
18
|
+
const payload: PUPPET.payloads.CallRecord = {
|
|
19
|
+
starter: 'todo',
|
|
20
|
+
participants: [ 'todo' ],
|
|
21
|
+
length: 0,
|
|
22
|
+
type: 0,
|
|
23
|
+
status: 0,
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return new this(payload)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/*
|
|
30
|
+
* @hideconstructor
|
|
31
|
+
*/
|
|
32
|
+
constructor (
|
|
33
|
+
public readonly payload: PUPPET.payloads.CallRecord,
|
|
34
|
+
) {
|
|
35
|
+
super()
|
|
36
|
+
log.verbose('CallRecord', 'constructor()')
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
starter (): undefined | ContactInterface {
|
|
40
|
+
const starterId = this.payload.starter
|
|
41
|
+
if (!starterId) {
|
|
42
|
+
return undefined
|
|
43
|
+
}
|
|
44
|
+
const starter = (this.wechaty.Contact as typeof ContactImpl).load(starterId)
|
|
45
|
+
return starter
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
participants (): ContactInterface[] {
|
|
49
|
+
const participantIds = this.payload.participants
|
|
50
|
+
|
|
51
|
+
return participantIds.map((this.wechaty.Contact as typeof ContactImpl).load)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
length (): number {
|
|
55
|
+
return this.payload.length
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
type (): PUPPET.types.Call {
|
|
59
|
+
return this.payload.type || PUPPET.types.Call.UNKNOWN
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
status (): PUPPET.types.CallStatus {
|
|
63
|
+
return this.payload.status || PUPPET.types.CallStatus.UNKNOWN
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
class CallRecordImpl extends validationMixin(CallRecordMixin)<CallRecordInterface>() { }
|
|
69
|
+
interface CallRecordInterface extends CallRecordImpl { }
|
|
70
|
+
|
|
71
|
+
type CallRecordConstructor = Constructor<
|
|
72
|
+
CallRecordInterface,
|
|
73
|
+
typeof CallRecordImpl
|
|
74
|
+
>
|
|
75
|
+
|
|
76
|
+
export type {
|
|
77
|
+
CallRecordConstructor,
|
|
78
|
+
CallRecordInterface,
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
CallRecordImpl,
|
|
82
|
+
}
|
|
@@ -75,6 +75,7 @@ import type {
|
|
|
75
75
|
import { validationMixin } from '../user-mixins/validation.js'
|
|
76
76
|
import type { ContactSelfImpl } from './contact-self.js'
|
|
77
77
|
import { concurrencyExecuter } from 'rx-queue'
|
|
78
|
+
import type { CallRecordInterface } from './call.js'
|
|
78
79
|
|
|
79
80
|
const MixinBase = wechatifyMixin(
|
|
80
81
|
EventEmitter,
|
|
@@ -871,9 +872,6 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
871
872
|
&& 'mentionIdList' in this.payload
|
|
872
873
|
&& Array.isArray(this.payload.mentionIdList)
|
|
873
874
|
) {
|
|
874
|
-
if (this.payload.mentionIdList.some(id => id === this.id)) {
|
|
875
|
-
return room.memberAll()
|
|
876
|
-
}
|
|
877
875
|
const idToContact = (id: string) => this.wechaty.Contact.find({ id })
|
|
878
876
|
const allContact = await Promise.all(
|
|
879
877
|
this.payload.mentionIdList
|
|
@@ -955,7 +953,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
955
953
|
&& 'mentionIdList' in this.payload
|
|
956
954
|
&& Array.isArray(this.payload.mentionIdList)
|
|
957
955
|
) {
|
|
958
|
-
return this.payload.mentionIdList.some(id => id ===
|
|
956
|
+
return this.payload.mentionIdList.some(id => id === this.payload?.talkerId)
|
|
959
957
|
} else {
|
|
960
958
|
return false
|
|
961
959
|
}
|
|
@@ -1332,6 +1330,21 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1332
1330
|
return new this.wechaty.Channel(channelPayload)
|
|
1333
1331
|
}
|
|
1334
1332
|
|
|
1333
|
+
public async toCallRecord (): Promise<CallRecordInterface> {
|
|
1334
|
+
log.verbose('Message', 'toCallRecord()')
|
|
1335
|
+
|
|
1336
|
+
if (!this.payload) {
|
|
1337
|
+
throw new Error('no payload')
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
if (this.type() !== PUPPET.types.Message.CallRecord) {
|
|
1341
|
+
throw new Error('message not a CallRecord')
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
const callRecordPayload = await this.wechaty.puppet.messageCallRecord(this.id)
|
|
1345
|
+
return new this.wechaty.CallRecord(callRecordPayload)
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1335
1348
|
async toSayable (): Promise<undefined | Sayable> {
|
|
1336
1349
|
log.verbose('Message', 'toSayable()')
|
|
1337
1350
|
return messageToSayable(this)
|
package/src/user-modules/mod.ts
CHANGED
|
@@ -107,6 +107,11 @@ import {
|
|
|
107
107
|
ChannelInterface,
|
|
108
108
|
ChannelConstructor,
|
|
109
109
|
} from './channel.js'
|
|
110
|
+
import {
|
|
111
|
+
CallRecordImpl,
|
|
112
|
+
CallRecordInterface,
|
|
113
|
+
CallRecordConstructor,
|
|
114
|
+
} from './call.js'
|
|
110
115
|
|
|
111
116
|
import { wechatifyUserModule } from '../user-mixins/wechatify.js'
|
|
112
117
|
|
|
@@ -129,6 +134,7 @@ export type {
|
|
|
129
134
|
DelayInterface,
|
|
130
135
|
UrlLinkInterface,
|
|
131
136
|
ChannelInterface,
|
|
137
|
+
CallRecordInterface,
|
|
132
138
|
}
|
|
133
139
|
|
|
134
140
|
export type {
|
|
@@ -150,6 +156,7 @@ export type {
|
|
|
150
156
|
TagGroupConstructor,
|
|
151
157
|
UrlLinkConstructor,
|
|
152
158
|
ChannelConstructor,
|
|
159
|
+
CallRecordConstructor,
|
|
153
160
|
}
|
|
154
161
|
|
|
155
162
|
export {
|
|
@@ -173,4 +180,5 @@ export {
|
|
|
173
180
|
TagGroupImpl,
|
|
174
181
|
UrlLinkImpl,
|
|
175
182
|
ChannelImpl,
|
|
183
|
+
CallRecordImpl,
|
|
176
184
|
}
|
|
@@ -22,6 +22,7 @@ import type {
|
|
|
22
22
|
MessageInterface,
|
|
23
23
|
ChannelConstructor,
|
|
24
24
|
MomentConstructor,
|
|
25
|
+
CallRecordConstructor,
|
|
25
26
|
} from '../user-modules/mod.js'
|
|
26
27
|
|
|
27
28
|
import {
|
|
@@ -51,6 +52,7 @@ test('Wechaty interface', async t => {
|
|
|
51
52
|
UrlLink : UrlLinkConstructor
|
|
52
53
|
Channel : ChannelConstructor
|
|
53
54
|
Moment : MomentConstructor
|
|
55
|
+
CallRecord : CallRecordConstructor
|
|
54
56
|
|
|
55
57
|
constructor () {
|
|
56
58
|
super()
|
|
@@ -71,6 +73,7 @@ test('Wechaty interface', async t => {
|
|
|
71
73
|
= this.UrlLink
|
|
72
74
|
= this.Channel
|
|
73
75
|
= this.Moment
|
|
76
|
+
= this.CallRecord
|
|
74
77
|
= {} as any
|
|
75
78
|
}
|
|
76
79
|
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
UrlLinkImpl,
|
|
18
18
|
ChannelImpl,
|
|
19
19
|
MomentImpl,
|
|
20
|
+
CallRecordImpl,
|
|
20
21
|
|
|
21
22
|
ContactConstructor,
|
|
22
23
|
ContactSelfConstructor,
|
|
@@ -34,6 +35,7 @@ import {
|
|
|
34
35
|
UrlLinkConstructor,
|
|
35
36
|
ChannelConstructor,
|
|
36
37
|
MomentConstructor,
|
|
38
|
+
CallRecordConstructor,
|
|
37
39
|
|
|
38
40
|
wechatifyUserModule,
|
|
39
41
|
} from '../user-modules/mod.js'
|
|
@@ -68,6 +70,7 @@ const wechatifyUserModuleMixin = <MixinBase extends typeof WechatySkeleton> (mix
|
|
|
68
70
|
__wechatifiedUrlLink? : UrlLinkConstructor
|
|
69
71
|
__wechatifiedChannel? : ChannelConstructor
|
|
70
72
|
__wechatifiedMoment? : MomentConstructor
|
|
73
|
+
__wechatifiedCallRecord? : CallRecordConstructor
|
|
71
74
|
|
|
72
75
|
get Contact () : ContactConstructor { return guardWechatify(this.__wechatifiedContact) }
|
|
73
76
|
get ContactSelf () : ContactSelfConstructor { return guardWechatify(this.__wechatifiedContactSelf) }
|
|
@@ -85,6 +88,7 @@ const wechatifyUserModuleMixin = <MixinBase extends typeof WechatySkeleton> (mix
|
|
|
85
88
|
get UrlLink () : UrlLinkConstructor { return guardWechatify(this.__wechatifiedUrlLink) }
|
|
86
89
|
get Channel () : ChannelConstructor { return guardWechatify(this.__wechatifiedChannel) }
|
|
87
90
|
get Moment () : MomentConstructor { return guardWechatify(this.__wechatifiedMoment) }
|
|
91
|
+
get CallRecord () : CallRecordConstructor { return guardWechatify(this.__wechatifiedCallRecord) }
|
|
88
92
|
|
|
89
93
|
override async init (): Promise<void> {
|
|
90
94
|
log.verbose('WechatifyUserModuleMixin', 'init()')
|
|
@@ -122,6 +126,7 @@ const wechatifyUserModuleMixin = <MixinBase extends typeof WechatySkeleton> (mix
|
|
|
122
126
|
this.__wechatifiedUrlLink = wechatifyUserModule(UrlLinkImpl)(this as any)
|
|
123
127
|
this.__wechatifiedChannel = wechatifyUserModule(ChannelImpl)(this as any)
|
|
124
128
|
this.__wechatifiedMoment = wechatifyUserModule(MomentImpl)(this as any)
|
|
129
|
+
this.__wechatifiedCallRecord = wechatifyUserModule(CallRecordImpl)(this as any)
|
|
125
130
|
|
|
126
131
|
log.verbose('WechatifyUserModuleMixin', 'init() initializing Wechaty User Module (WUM) ... done')
|
|
127
132
|
}
|
|
@@ -159,6 +164,7 @@ type ProtectedPropertyWechatifyUserModuleMixin =
|
|
|
159
164
|
| '__wechatifiedUrlLink'
|
|
160
165
|
| '__wechatifiedChannel'
|
|
161
166
|
| '__wechatifiedMoment'
|
|
167
|
+
| '__wechatifiedCallRecord'
|
|
162
168
|
|
|
163
169
|
export type {
|
|
164
170
|
WechatifyUserModuleMixin,
|