@juzi/wechaty 1.0.146 → 1.0.148
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 +2 -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/package-json.js.map +1 -1
- package/dist/cjs/src/schemas/call-events.d.ts +20 -0
- package/dist/cjs/src/schemas/call-events.d.ts.map +1 -0
- package/dist/cjs/src/schemas/call-events.js +7 -0
- package/dist/cjs/src/schemas/call-events.js.map +1 -0
- package/dist/cjs/src/schemas/mod.d.ts +3 -2
- package/dist/cjs/src/schemas/mod.d.ts.map +1 -1
- package/dist/cjs/src/schemas/mod.js +3 -1
- package/dist/cjs/src/schemas/mod.js.map +1 -1
- package/dist/cjs/src/schemas/wechaty-events.d.ts +23 -2
- package/dist/cjs/src/schemas/wechaty-events.d.ts.map +1 -1
- package/dist/cjs/src/schemas/wechaty-events.js +6 -0
- package/dist/cjs/src/schemas/wechaty-events.js.map +1 -1
- package/dist/cjs/src/user-modules/call.d.ts +158 -0
- package/dist/cjs/src/user-modules/call.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/call.js +289 -1
- package/dist/cjs/src/user-modules/call.js.map +1 -1
- package/dist/cjs/src/user-modules/call.spec.d.ts +7 -0
- package/dist/cjs/src/user-modules/call.spec.d.ts.map +1 -0
- package/dist/cjs/src/user-modules/call.spec.js +759 -0
- package/dist/cjs/src/user-modules/call.spec.js.map +1 -0
- package/dist/cjs/src/user-modules/contact.d.ts +16 -0
- package/dist/cjs/src/user-modules/contact.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/contact.js +16 -0
- package/dist/cjs/src/user-modules/contact.js.map +1 -1
- package/dist/cjs/src/user-modules/mod.d.ts +5 -4
- package/dist/cjs/src/user-modules/mod.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/mod.js +2 -1
- package/dist/cjs/src/user-modules/mod.js.map +1 -1
- package/dist/cjs/src/wechaty/wechaty-base.d.ts +66 -7
- package/dist/cjs/src/wechaty/wechaty-base.d.ts.map +1 -1
- package/dist/cjs/src/wechaty/wechaty-base.js +28 -0
- package/dist/cjs/src/wechaty/wechaty-base.js.map +1 -1
- package/dist/cjs/src/wechaty/wechaty-impl.spec.js +10 -8
- package/dist/cjs/src/wechaty/wechaty-impl.spec.js.map +1 -1
- package/dist/cjs/src/wechaty-mixins/gerror-mixin.d.ts +1 -1
- package/dist/cjs/src/wechaty-mixins/io-mixin.d.ts +2 -2
- package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts +15 -5
- package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/misc-mixin.d.ts +15 -5
- package/dist/cjs/src/wechaty-mixins/misc-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/plugin-mixin.d.ts +32 -6
- package/dist/cjs/src/wechaty-mixins/plugin-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts +39 -5
- package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/puppet-mixin.js +149 -0
- package/dist/cjs/src/wechaty-mixins/puppet-mixin.js.map +1 -1
- package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.d.ts +5 -3
- 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 +2 -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/package-json.js.map +1 -1
- package/dist/esm/src/schemas/call-events.d.ts +20 -0
- package/dist/esm/src/schemas/call-events.d.ts.map +1 -0
- package/dist/esm/src/schemas/call-events.js +4 -0
- package/dist/esm/src/schemas/call-events.js.map +1 -0
- package/dist/esm/src/schemas/mod.d.ts +3 -2
- package/dist/esm/src/schemas/mod.d.ts.map +1 -1
- package/dist/esm/src/schemas/mod.js +2 -1
- package/dist/esm/src/schemas/mod.js.map +1 -1
- package/dist/esm/src/schemas/wechaty-events.d.ts +23 -2
- package/dist/esm/src/schemas/wechaty-events.d.ts.map +1 -1
- package/dist/esm/src/schemas/wechaty-events.js +6 -0
- package/dist/esm/src/schemas/wechaty-events.js.map +1 -1
- package/dist/esm/src/user-modules/call.d.ts +158 -0
- package/dist/esm/src/user-modules/call.d.ts.map +1 -1
- package/dist/esm/src/user-modules/call.js +289 -1
- package/dist/esm/src/user-modules/call.js.map +1 -1
- package/dist/esm/src/user-modules/call.spec.d.ts +7 -0
- package/dist/esm/src/user-modules/call.spec.d.ts.map +1 -0
- package/dist/esm/src/user-modules/call.spec.js +734 -0
- package/dist/esm/src/user-modules/call.spec.js.map +1 -0
- package/dist/esm/src/user-modules/contact.d.ts +16 -0
- package/dist/esm/src/user-modules/contact.d.ts.map +1 -1
- package/dist/esm/src/user-modules/contact.js +16 -0
- package/dist/esm/src/user-modules/contact.js.map +1 -1
- package/dist/esm/src/user-modules/mod.d.ts +5 -4
- package/dist/esm/src/user-modules/mod.d.ts.map +1 -1
- package/dist/esm/src/user-modules/mod.js +2 -2
- package/dist/esm/src/user-modules/mod.js.map +1 -1
- package/dist/esm/src/wechaty/wechaty-base.d.ts +66 -7
- package/dist/esm/src/wechaty/wechaty-base.d.ts.map +1 -1
- package/dist/esm/src/wechaty/wechaty-base.js +28 -0
- package/dist/esm/src/wechaty/wechaty-base.js.map +1 -1
- package/dist/esm/src/wechaty/wechaty-impl.spec.js +10 -8
- package/dist/esm/src/wechaty/wechaty-impl.spec.js.map +1 -1
- package/dist/esm/src/wechaty-mixins/gerror-mixin.d.ts +1 -1
- package/dist/esm/src/wechaty-mixins/io-mixin.d.ts +2 -2
- package/dist/esm/src/wechaty-mixins/login-mixin.d.ts +15 -5
- package/dist/esm/src/wechaty-mixins/login-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/misc-mixin.d.ts +15 -5
- package/dist/esm/src/wechaty-mixins/misc-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/plugin-mixin.d.ts +32 -6
- package/dist/esm/src/wechaty-mixins/plugin-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts +39 -5
- package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/puppet-mixin.js +149 -0
- package/dist/esm/src/wechaty-mixins/puppet-mixin.js.map +1 -1
- package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.d.ts +5 -3
- 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 +6 -0
- package/src/package-json.ts +4 -4
- package/src/schemas/call-events.ts +35 -0
- package/src/schemas/mod.ts +6 -0
- package/src/schemas/wechaty-events.ts +28 -0
- package/src/user-modules/call.spec.ts +929 -0
- package/src/user-modules/call.ts +373 -0
- package/src/user-modules/contact.ts +18 -0
- package/src/user-modules/mod.ts +11 -0
- package/src/wechaty/wechaty-base.ts +40 -1
- package/src/wechaty/wechaty-impl.spec.ts +4 -0
- package/src/wechaty-mixins/puppet-mixin.ts +184 -0
- package/src/wechaty-mixins/wechatify-user-module-mixin.ts +6 -0
|
@@ -15,7 +15,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
15
15
|
init(): Promise<void>;
|
|
16
16
|
start(): Promise<void>;
|
|
17
17
|
stop(): Promise<void>;
|
|
18
|
-
on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
|
|
18
|
+
on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
|
|
19
19
|
addListener<E extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E]): any;
|
|
20
20
|
once<E_1 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_1, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_1]): any;
|
|
21
21
|
prependListener<E_2 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_2, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_2]): any;
|
|
@@ -65,7 +65,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
65
65
|
init: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
|
|
66
66
|
start: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
|
|
67
67
|
stop: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
|
|
68
|
-
on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
|
|
68
|
+
on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
|
|
69
69
|
addListener<E_10 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_10, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_10]): any;
|
|
70
70
|
once<E_11 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_11, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_11]): any;
|
|
71
71
|
prependListener<E_12 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_12, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_12]): any;
|
|
@@ -82,12 +82,15 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
82
82
|
setMaxListeners(maxListeners: number): any;
|
|
83
83
|
__events: import("../schemas/wechaty-events.js").WechatyEventListeners;
|
|
84
84
|
__puppet?: import("@juzi/wechaty-puppet/dist/esm/src/puppet/puppet-interface.js").PuppetInterface | undefined;
|
|
85
|
+
__callPool: Map<string, import("../user-modules/call.js").CallImpl>;
|
|
85
86
|
readonly puppet: import("@juzi/wechaty-puppet/dist/esm/src/puppet/puppet-interface.js").PuppetInterface;
|
|
86
87
|
readonly __readyState: import("state-switch/dist/esm/src/interfaces.js").StateSwitchInterface;
|
|
87
88
|
__loginIndicator: import("state-switch/dist/esm/src/boolean-indicator.js").BooleanIndicator;
|
|
88
89
|
__puppetMixinInited: boolean;
|
|
89
90
|
ready(): Promise<void>;
|
|
90
91
|
__setupPuppetEvents(puppet: import("@juzi/wechaty-puppet/dist/esm/src/puppet/puppet-interface.js").PuppetInterface): void;
|
|
92
|
+
__finalizeIfEnded(call: import("../user-modules/call.js").CallImpl, force?: boolean): Promise<void>;
|
|
93
|
+
__wechatifiedCall?: import("../user-modules/call.js").CallConstructor | undefined;
|
|
91
94
|
__wechatifiedContact?: import("../user-modules/contact.js").ContactConstructor | undefined;
|
|
92
95
|
__wechatifiedContactSelf?: import("../user-modules/contact-self.js").ContactSelfConstructor | undefined;
|
|
93
96
|
__wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
|
|
@@ -96,6 +99,9 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
96
99
|
__wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
|
|
97
100
|
__wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
|
|
98
101
|
__wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Return the function to uninstall all plugins
|
|
104
|
+
*/
|
|
99
105
|
__wechatifiedPost?: import("../user-modules/post.js").PostConstructor | undefined;
|
|
100
106
|
__wechatifiedRoom?: import("../user-modules/room.js").RoomConstructor | undefined;
|
|
101
107
|
__wechatifiedRoomInvitation?: import("../user-modules/room-invitation.js").RoomInvitationConstructor | undefined;
|
|
@@ -114,6 +120,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
114
120
|
__wechatifiedImSpecific?: import("../user-modules/im-specific.js").ImSpecificConstructor | undefined;
|
|
115
121
|
__wechatifiedWxxdProduct?: import("../user-modules/wxxd-product.js").WxxdProductConstructor | undefined;
|
|
116
122
|
__wechatifiedWxxdOrder?: import("../user-modules/wxxd-order.js").WxxdOrderConstructor | undefined;
|
|
123
|
+
readonly Call: import("../user-modules/call.js").CallConstructor;
|
|
117
124
|
readonly Contact: import("../user-modules/contact.js").ContactConstructor;
|
|
118
125
|
readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor;
|
|
119
126
|
readonly Delay: import("../user-modules/delay.js").DelayConstructor;
|
|
@@ -149,6 +156,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
149
156
|
readonly log: import("brolog/dist/esm/src/logger.js").Loggable;
|
|
150
157
|
}) & ((abstract new (...args: any[]) => {
|
|
151
158
|
__puppet?: import("@juzi/wechaty-puppet/dist/esm/src/puppet/puppet-interface.js").PuppetInterface | undefined;
|
|
159
|
+
__callPool: Map<string, import("../user-modules/call.js").CallImpl>;
|
|
152
160
|
readonly puppet: import("@juzi/wechaty-puppet/dist/esm/src/puppet/puppet-interface.js").PuppetInterface;
|
|
153
161
|
readonly __readyState: import("state-switch/dist/esm/src/interfaces.js").StateSwitchInterface;
|
|
154
162
|
__loginIndicator: import("state-switch/dist/esm/src/boolean-indicator.js").BooleanIndicator;
|
|
@@ -158,6 +166,8 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
158
166
|
ready(): Promise<void>;
|
|
159
167
|
init(): Promise<void>;
|
|
160
168
|
__setupPuppetEvents(puppet: import("@juzi/wechaty-puppet/dist/esm/src/puppet/puppet-interface.js").PuppetInterface): void;
|
|
169
|
+
__finalizeIfEnded(call: import("../user-modules/call.js").CallImpl, force?: boolean): Promise<void>;
|
|
170
|
+
__wechatifiedCall?: import("../user-modules/call.js").CallConstructor | undefined;
|
|
161
171
|
__wechatifiedContact?: import("../user-modules/contact.js").ContactConstructor | undefined;
|
|
162
172
|
__wechatifiedContactSelf?: import("../user-modules/contact-self.js").ContactSelfConstructor | undefined;
|
|
163
173
|
__wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
|
|
@@ -166,6 +176,9 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
166
176
|
__wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
|
|
167
177
|
__wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
|
|
168
178
|
__wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* Return the function to uninstall all plugins
|
|
181
|
+
*/
|
|
169
182
|
__wechatifiedPost?: import("../user-modules/post.js").PostConstructor | undefined;
|
|
170
183
|
__wechatifiedRoom?: import("../user-modules/room.js").RoomConstructor | undefined;
|
|
171
184
|
__wechatifiedRoomInvitation?: import("../user-modules/room-invitation.js").RoomInvitationConstructor | undefined;
|
|
@@ -184,6 +197,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
184
197
|
__wechatifiedImSpecific?: import("../user-modules/im-specific.js").ImSpecificConstructor | undefined;
|
|
185
198
|
__wechatifiedWxxdProduct?: import("../user-modules/wxxd-product.js").WxxdProductConstructor | undefined;
|
|
186
199
|
__wechatifiedWxxdOrder?: import("../user-modules/wxxd-order.js").WxxdOrderConstructor | undefined;
|
|
200
|
+
readonly Call: import("../user-modules/call.js").CallConstructor;
|
|
187
201
|
readonly Contact: import("../user-modules/contact.js").ContactConstructor;
|
|
188
202
|
readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor;
|
|
189
203
|
readonly Delay: import("../user-modules/delay.js").DelayConstructor;
|
|
@@ -215,7 +229,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
215
229
|
__memory?: import("memory-card").MemoryCard | undefined;
|
|
216
230
|
readonly memory: import("memory-card").MemoryCard;
|
|
217
231
|
__options: import("../schemas/wechaty-options.js").WechatyOptions;
|
|
218
|
-
on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
|
|
232
|
+
on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
|
|
219
233
|
addListener<E_18 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_18, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_18]): any;
|
|
220
234
|
once<E_19 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_19, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_19]): any;
|
|
221
235
|
prependListener<E_20 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_20, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_20]): any;
|
|
@@ -239,6 +253,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
239
253
|
}) & {
|
|
240
254
|
readonly log: import("brolog/dist/esm/src/logger.js").Loggable;
|
|
241
255
|
}) & ((abstract new (...args: any[]) => {
|
|
256
|
+
__wechatifiedCall?: import("../user-modules/call.js").CallConstructor | undefined;
|
|
242
257
|
__wechatifiedContact?: import("../user-modules/contact.js").ContactConstructor | undefined;
|
|
243
258
|
__wechatifiedContactSelf?: import("../user-modules/contact-self.js").ContactSelfConstructor | undefined;
|
|
244
259
|
__wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
|
|
@@ -247,6 +262,9 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
247
262
|
__wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
|
|
248
263
|
__wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
|
|
249
264
|
__wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
|
|
265
|
+
/**
|
|
266
|
+
* Return the function to uninstall all plugins
|
|
267
|
+
*/
|
|
250
268
|
__wechatifiedPost?: import("../user-modules/post.js").PostConstructor | undefined;
|
|
251
269
|
__wechatifiedRoom?: import("../user-modules/room.js").RoomConstructor | undefined;
|
|
252
270
|
__wechatifiedRoomInvitation?: import("../user-modules/room-invitation.js").RoomInvitationConstructor | undefined;
|
|
@@ -265,6 +283,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
265
283
|
__wechatifiedImSpecific?: import("../user-modules/im-specific.js").ImSpecificConstructor | undefined;
|
|
266
284
|
__wechatifiedWxxdProduct?: import("../user-modules/wxxd-product.js").WxxdProductConstructor | undefined;
|
|
267
285
|
__wechatifiedWxxdOrder?: import("../user-modules/wxxd-order.js").WxxdOrderConstructor | undefined;
|
|
286
|
+
readonly Call: import("../user-modules/call.js").CallConstructor;
|
|
268
287
|
readonly Contact: import("../user-modules/contact.js").ContactConstructor;
|
|
269
288
|
readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor;
|
|
270
289
|
readonly Delay: import("../user-modules/delay.js").DelayConstructor;
|
|
@@ -299,7 +318,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
299
318
|
__options: import("../schemas/wechaty-options.js").WechatyOptions;
|
|
300
319
|
start(): Promise<void>;
|
|
301
320
|
stop(): Promise<void>;
|
|
302
|
-
on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
|
|
321
|
+
on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
|
|
303
322
|
addListener<E_25 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_25, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_25]): any;
|
|
304
323
|
once<E_26 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_26, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_26]): any;
|
|
305
324
|
prependListener<E_27 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_27, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_27]): any;
|
|
@@ -329,7 +348,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
329
348
|
readonly memory: import("memory-card").MemoryCard;
|
|
330
349
|
__options: import("../schemas/wechaty-options.js").WechatyOptions;
|
|
331
350
|
init(): Promise<void>;
|
|
332
|
-
on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
|
|
351
|
+
on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
|
|
333
352
|
addListener<E_32 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_32, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_32]): any;
|
|
334
353
|
once<E_33 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_33, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_33]): any;
|
|
335
354
|
prependListener<E_34 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_34, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_34]): any;
|
|
@@ -378,7 +397,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
378
397
|
init: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
|
|
379
398
|
start: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
|
|
380
399
|
stop: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
|
|
381
|
-
on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
|
|
400
|
+
on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
|
|
382
401
|
addListener<E_39 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_39, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_39]): any;
|
|
383
402
|
once<E_40 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_40, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_40]): any;
|
|
384
403
|
prependListener<E_41 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_41, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_41]): any;
|
|
@@ -421,12 +440,15 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
421
440
|
sleep(milliseconds: number): Promise<void>;
|
|
422
441
|
ding(data?: string | undefined): void;
|
|
423
442
|
__puppet?: import("@juzi/wechaty-puppet/dist/esm/src/puppet/puppet-interface.js").PuppetInterface | undefined;
|
|
443
|
+
__callPool: Map<string, import("../user-modules/call.js").CallImpl>;
|
|
424
444
|
readonly puppet: import("@juzi/wechaty-puppet/dist/esm/src/puppet/puppet-interface.js").PuppetInterface;
|
|
425
445
|
readonly __readyState: import("state-switch/dist/esm/src/interfaces.js").StateSwitchInterface;
|
|
426
446
|
__loginIndicator: import("state-switch/dist/esm/src/boolean-indicator.js").BooleanIndicator;
|
|
427
447
|
__puppetMixinInited: boolean;
|
|
428
448
|
ready(): Promise<void>;
|
|
429
449
|
__setupPuppetEvents(puppet: import("@juzi/wechaty-puppet/dist/esm/src/puppet/puppet-interface.js").PuppetInterface): void;
|
|
450
|
+
__finalizeIfEnded(call: import("../user-modules/call.js").CallImpl, force?: boolean): Promise<void>;
|
|
451
|
+
__wechatifiedCall?: import("../user-modules/call.js").CallConstructor | undefined;
|
|
430
452
|
__wechatifiedContact?: import("../user-modules/contact.js").ContactConstructor | undefined;
|
|
431
453
|
__wechatifiedContactSelf?: import("../user-modules/contact-self.js").ContactSelfConstructor | undefined;
|
|
432
454
|
__wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
|
|
@@ -435,6 +457,9 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
435
457
|
__wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
|
|
436
458
|
__wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
|
|
437
459
|
__wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
|
|
460
|
+
/**
|
|
461
|
+
* Return the function to uninstall all plugins
|
|
462
|
+
*/
|
|
438
463
|
__wechatifiedPost?: import("../user-modules/post.js").PostConstructor | undefined;
|
|
439
464
|
__wechatifiedRoom?: import("../user-modules/room.js").RoomConstructor | undefined;
|
|
440
465
|
__wechatifiedRoomInvitation?: import("../user-modules/room-invitation.js").RoomInvitationConstructor | undefined;
|
|
@@ -453,6 +478,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
|
|
|
453
478
|
__wechatifiedImSpecific?: import("../user-modules/im-specific.js").ImSpecificConstructor | undefined;
|
|
454
479
|
__wechatifiedWxxdProduct?: import("../user-modules/wxxd-product.js").WxxdProductConstructor | undefined;
|
|
455
480
|
__wechatifiedWxxdOrder?: import("../user-modules/wxxd-order.js").WxxdOrderConstructor | undefined;
|
|
481
|
+
readonly Call: import("../user-modules/call.js").CallConstructor;
|
|
456
482
|
readonly Contact: import("../user-modules/contact.js").ContactConstructor;
|
|
457
483
|
readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor;
|
|
458
484
|
readonly Delay: import("../user-modules/delay.js").DelayConstructor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-mixin.d.ts","sourceRoot":"","sources":["../../../../src/wechaty-mixins/plugin-mixin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,EACzB,MAAkC,cAAc,CAAA;AAKjD,OAAO,KAAK,EACV,eAAe,EAChB,MAA4B,mBAAmB,CAAA;AAKhD,UAAU,QAAQ;IAChB,GAAG,CACD,GAAG,OAAO,EAAE,CACR,aAAa,GACb,aAAa,EAAE,CAClB,EAAE,GACF,wBAAwB,CAAA;CAC5B;AAED,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASb;;;;;;;;;;;;;;;;;;OAkBG
|
|
1
|
+
{"version":3,"file":"plugin-mixin.d.ts","sourceRoot":"","sources":["../../../../src/wechaty-mixins/plugin-mixin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,EACzB,MAAkC,cAAc,CAAA;AAKjD,OAAO,KAAK,EACV,eAAe,EAChB,MAA4B,mBAAmB,CAAA;AAKhD,UAAU,QAAQ;IAChB,GAAG,CACD,GAAG,OAAO,EAAE,CACR,aAAa,GACb,aAAa,EAAE,CAClB,EAAE,GACF,wBAAwB,CAAA;CAC5B;AAED,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASb;;;;;;;;;;;;;;;;;;OAkBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqBD;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAFH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAFH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDA7CiB,GAAG,EAAE;IAI3B;;;;;;;;;;;;;;;;;;OAkBG;oBAEW,CACV,aAAa,GAAG,aAAa,EAAE,CAChC,EAAE,GACF,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAvB3B;;;;;;;;;;;;;;;;;;OAkBG;;;;;;;;;;;;;;;;;;;;;;;IAqBD;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAWR,CAAA;AAED,aAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA;AAEjD,aAAK,4BAA4B,GAAG,KAAK,CAAA;AAEzC,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,4BAA4B,EACjC,WAAW,GACZ,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as PUPPET from '@juzi/wechaty-puppet';
|
|
2
2
|
import { BooleanIndicator, StateSwitchInterface } from 'state-switch';
|
|
3
|
+
import type { CallImpl } from '../user-modules/mod.js';
|
|
3
4
|
/**
|
|
4
5
|
* Huan(202111): `puppetMixin` must extend `pluginMixin`
|
|
5
6
|
* because the `wechaty-redux` plugin need to be installed before
|
|
@@ -9,6 +10,7 @@ import { BooleanIndicator, StateSwitchInterface } from 'state-switch';
|
|
|
9
10
|
* because the Io need the puppet instance to be ready when it starts
|
|
10
11
|
*/
|
|
11
12
|
declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) => {
|
|
13
|
+
__wechatifiedCall?: import("../user-modules/call.js").CallConstructor | undefined;
|
|
12
14
|
__wechatifiedContact?: import("../user-modules/contact.js").ContactConstructor | undefined;
|
|
13
15
|
__wechatifiedContactSelf?: import("../user-modules/contact-self.js").ContactSelfConstructor | undefined;
|
|
14
16
|
__wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
|
|
@@ -35,6 +37,7 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
|
|
|
35
37
|
__wechatifiedImSpecific?: import("../user-modules/im-specific.js").ImSpecificConstructor | undefined;
|
|
36
38
|
__wechatifiedWxxdProduct?: import("../user-modules/wxxd-product.js").WxxdProductConstructor | undefined;
|
|
37
39
|
__wechatifiedWxxdOrder?: import("../user-modules/wxxd-order.js").WxxdOrderConstructor | undefined;
|
|
40
|
+
readonly Call: import("../user-modules/call.js").CallConstructor;
|
|
38
41
|
readonly Contact: import("../user-modules/contact.js").ContactConstructor;
|
|
39
42
|
readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor;
|
|
40
43
|
readonly Delay: import("../user-modules/delay.js").DelayConstructor;
|
|
@@ -69,7 +72,7 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
|
|
|
69
72
|
__options: import("../schemas/wechaty-options.js").WechatyOptions;
|
|
70
73
|
start(): Promise<void>;
|
|
71
74
|
stop(): Promise<void>;
|
|
72
|
-
on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
|
|
75
|
+
on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
|
|
73
76
|
addListener<E extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E]): any;
|
|
74
77
|
once<E_1 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_1, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_1]): any;
|
|
75
78
|
prependListener<E_2 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_2, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_2]): any;
|
|
@@ -99,7 +102,7 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
|
|
|
99
102
|
init(): Promise<void>;
|
|
100
103
|
start(): Promise<void>;
|
|
101
104
|
stop(): Promise<void>;
|
|
102
|
-
on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
|
|
105
|
+
on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
|
|
103
106
|
addListener<E_11 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_11, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_11]): any;
|
|
104
107
|
once<E_12 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_12, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_12]): any;
|
|
105
108
|
prependListener<E_13 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_13, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_13]): any;
|
|
@@ -128,7 +131,7 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
|
|
|
128
131
|
readonly memory: import("memory-card").MemoryCard;
|
|
129
132
|
__options: import("../schemas/wechaty-options.js").WechatyOptions;
|
|
130
133
|
init(): Promise<void>;
|
|
131
|
-
on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
|
|
134
|
+
on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
|
|
132
135
|
addListener<E_18 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_18, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_18]): any;
|
|
133
136
|
once<E_19 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_19, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_19]): any;
|
|
134
137
|
prependListener<E_20 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_20, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_20]): any;
|
|
@@ -150,6 +153,8 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
|
|
|
150
153
|
readonly log: import("brolog/dist/esm/src/logger.js").Loggable;
|
|
151
154
|
})>(mixinBase: MixinBase) => ((abstract new (...args: any[]) => {
|
|
152
155
|
__puppet?: PUPPET.impls.PuppetInterface | undefined;
|
|
156
|
+
/** Registry of active Call instances keyed by callId. */
|
|
157
|
+
__callPool: Map<string, CallImpl>;
|
|
153
158
|
readonly puppet: PUPPET.impls.PuppetInterface;
|
|
154
159
|
readonly __readyState: StateSwitchInterface;
|
|
155
160
|
__loginIndicator: BooleanIndicator;
|
|
@@ -159,6 +164,34 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
|
|
|
159
164
|
ready(): Promise<void>;
|
|
160
165
|
init(): Promise<void>;
|
|
161
166
|
__setupPuppetEvents(puppet: PUPPET.impls.PuppetInterface): void;
|
|
167
|
+
/**
|
|
168
|
+
* Decide whether a call has reached its terminal state and, if so, drive
|
|
169
|
+
* the local lifecycle to ended by invoking {@link CallImpl.__markEnded},
|
|
170
|
+
* which routes through __finalize and is responsible for emitting both
|
|
171
|
+
* the object 'ended' and the bot 'call-ended' lifecycle events as well
|
|
172
|
+
* as evicting the call from the pool. This method does NOT emit
|
|
173
|
+
* 'call-ended' directly — that would risk a double-emit if a local
|
|
174
|
+
* control path (reject/cancel/hangup) finalizes the call before the
|
|
175
|
+
* puppet echo reaches here. The `__endedEmitted` sentinel inside
|
|
176
|
+
* __finalize makes the joint behavior idempotent.
|
|
177
|
+
*
|
|
178
|
+
* Strategy:
|
|
179
|
+
* - `force=true` short-circuits when the caller already knows the call is
|
|
180
|
+
* over (Cancel from the receiver's perspective).
|
|
181
|
+
* - Otherwise, refresh the payload via dirty + ready and check
|
|
182
|
+
* `endTime`, with a short retry budget so transient puppet hiccups do
|
|
183
|
+
* not strand a Call in the pool.
|
|
184
|
+
* - As a last-resort heuristic, an ended-leaning signal (Reject / Hangup)
|
|
185
|
+
* on a strict 1v1 call (participants.length === 2: the starter plus
|
|
186
|
+
* exactly one invitee) is treated as terminal even if sync never
|
|
187
|
+
* recovered: in 1v1 the protocol has no other peer to keep the
|
|
188
|
+
* session alive. Other roster shapes (length 0/1/3+) fall through
|
|
189
|
+
* and wait for the next dirty signal — length<=1 is a stranded-but-
|
|
190
|
+
* recoverable shape (empty roster from a sync hiccup, or a multi-
|
|
191
|
+
* party call whose other members already left).
|
|
192
|
+
*/
|
|
193
|
+
__finalizeIfEnded(call: CallImpl, force?: boolean): Promise<void>;
|
|
194
|
+
__wechatifiedCall?: import("../user-modules/call.js").CallConstructor | undefined;
|
|
162
195
|
__wechatifiedContact?: import("../user-modules/contact.js").ContactConstructor | undefined;
|
|
163
196
|
__wechatifiedContactSelf?: import("../user-modules/contact-self.js").ContactSelfConstructor | undefined;
|
|
164
197
|
__wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
|
|
@@ -185,6 +218,7 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
|
|
|
185
218
|
__wechatifiedImSpecific?: import("../user-modules/im-specific.js").ImSpecificConstructor | undefined;
|
|
186
219
|
__wechatifiedWxxdProduct?: import("../user-modules/wxxd-product.js").WxxdProductConstructor | undefined;
|
|
187
220
|
__wechatifiedWxxdOrder?: import("../user-modules/wxxd-order.js").WxxdOrderConstructor | undefined;
|
|
221
|
+
readonly Call: import("../user-modules/call.js").CallConstructor;
|
|
188
222
|
readonly Contact: import("../user-modules/contact.js").ContactConstructor;
|
|
189
223
|
readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor;
|
|
190
224
|
readonly Delay: import("../user-modules/delay.js").DelayConstructor;
|
|
@@ -216,7 +250,7 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
|
|
|
216
250
|
__memory?: import("memory-card").MemoryCard | undefined;
|
|
217
251
|
readonly memory: import("memory-card").MemoryCard;
|
|
218
252
|
__options: import("../schemas/wechaty-options.js").WechatyOptions;
|
|
219
|
-
on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
|
|
253
|
+
on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
|
|
220
254
|
addListener<E_25 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_25, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_25]): any;
|
|
221
255
|
once<E_26 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_26, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_26]): any;
|
|
222
256
|
prependListener<E_27 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_27, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_27]): any;
|
|
@@ -241,7 +275,7 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
|
|
|
241
275
|
readonly log: import("brolog/dist/esm/src/logger.js").Loggable;
|
|
242
276
|
}) & MixinBase;
|
|
243
277
|
declare type PuppetMixin = ReturnType<typeof puppetMixin>;
|
|
244
|
-
declare type ProtectedPropertyPuppetMixin = '__puppet' | '__readyState' | '__setupPuppetEvents' | '__loginIndicator';
|
|
278
|
+
declare type ProtectedPropertyPuppetMixin = '__puppet' | '__callPool' | '__readyState' | '__setupPuppetEvents' | '__finalizeIfEnded' | '__loginIndicator';
|
|
245
279
|
export type { PuppetMixin, ProtectedPropertyPuppetMixin, };
|
|
246
280
|
export { puppetMixin, };
|
|
247
281
|
//# sourceMappingURL=puppet-mixin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"puppet-mixin.d.ts","sourceRoot":"","sources":["../../../../src/wechaty-mixins/puppet-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAW,sBAAsB,CAAA;AAQnD,OAAO,EAEL,gBAAgB,EAChB,oBAAoB,EACrB,MAAO,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"puppet-mixin.d.ts","sourceRoot":"","sources":["../../../../src/wechaty-mixins/puppet-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAW,sBAAsB,CAAA;AAQnD,OAAO,EAEL,gBAAgB,EAChB,oBAAoB,EACrB,MAAO,cAAc,CAAA;AAItB,OAAO,KAAK,EACV,QAAQ,EAST,MAAoC,wBAAwB,CAAA;AAa7D;;;;;;;GAOG;AACH,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDAwBS,GAAG,EAAE;;IAjB3B,yDAAyD;gBAC7C,IAAI,MAAM,EAAE,QAAQ,CAAC;;2BAUT,oBAAoB;sBAE1B,gBAAgB;;aAmBT,QAAQ,IAAI,CAAC;YA+Cd,QAAQ,IAAI,CAAC;aAyBrB,QAAQ,IAAI,CAAC;YAML,QAAQ,IAAI,CAAC;gCA8CR,OAAO,KAAK,CAAC,eAAe,GAAG,IAAI;IAsrBhE;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;4BAC4B,QAAQ,oBAAkB,QAAQ,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4DzE,CAAA;AAED,aAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA;AAEjD,aAAK,4BAA4B,GAC7B,UAAU,GACV,YAAY,GACZ,cAAc,GACd,qBAAqB,GACrB,mBAAmB,GACnB,kBAAkB,CAAA;AAEtB,YAAY,EACV,WAAW,EACX,4BAA4B,GAC7B,CAAA;AACD,OAAO,EACL,WAAW,GACZ,CAAA"}
|
|
@@ -45,6 +45,8 @@ const puppetMixin = (mixinBase) => {
|
|
|
45
45
|
wechaty_puppet_1.log.verbose('WechatyPuppetMixin', 'puppetMixin(%s)', mixinBase.name);
|
|
46
46
|
class PuppetMixin extends mixinBase {
|
|
47
47
|
__puppet;
|
|
48
|
+
/** Registry of active Call instances keyed by callId. */
|
|
49
|
+
__callPool = new Map();
|
|
48
50
|
get puppet() {
|
|
49
51
|
if (!this.__puppet) {
|
|
50
52
|
throw new Error('NOPUPPET');
|
|
@@ -125,6 +127,7 @@ const puppetMixin = (mixinBase) => {
|
|
|
125
127
|
wechaty_puppet_1.log.verbose('WechatyPuppetMixin', 'stop() super.stop() ...');
|
|
126
128
|
await super.stop();
|
|
127
129
|
wechaty_puppet_1.log.verbose('WechatyPuppetMixin', 'stop() super.stop() ... done');
|
|
130
|
+
this.__callPool.clear();
|
|
128
131
|
}
|
|
129
132
|
async ready() {
|
|
130
133
|
wechaty_puppet_1.log.verbose('WechatyPuppetMixin', 'ready()');
|
|
@@ -662,6 +665,29 @@ const puppetMixin = (mixinBase) => {
|
|
|
662
665
|
await order?.ready(true);
|
|
663
666
|
break;
|
|
664
667
|
}
|
|
668
|
+
case PUPPET.types.Payload.Call: {
|
|
669
|
+
/**
|
|
670
|
+
* Invalidate the puppet-side cache so the next callPayload()
|
|
671
|
+
* pull reflects the latest server state, then refresh the
|
|
672
|
+
* user-layer Call payload so getters (media / participants /
|
|
673
|
+
* endTime) reflect the new view immediately. Whether the
|
|
674
|
+
* call is still alive is still decided by the call-event
|
|
675
|
+
* handler via __finalizeIfEnded; we do not touch the pool
|
|
676
|
+
* here, and we do not emit a synthetic user event — the
|
|
677
|
+
* UI is expected to read getters when it needs the value.
|
|
678
|
+
*/
|
|
679
|
+
await this.puppet.callPayloadDirty(payloadId);
|
|
680
|
+
const call = this.__callPool.get(payloadId);
|
|
681
|
+
if (call) {
|
|
682
|
+
try {
|
|
683
|
+
await call.ready(true);
|
|
684
|
+
}
|
|
685
|
+
catch (e) {
|
|
686
|
+
wechaty_puppet_1.log.warn('WechatyPuppetMixin', 'dirty(Call) ready failed for callId=%s: %s', payloadId, e.message);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
break;
|
|
690
|
+
}
|
|
665
691
|
case PUPPET.types.Payload.Unspecified:
|
|
666
692
|
default:
|
|
667
693
|
wechaty_puppet_1.log.warn('unknown payload type: ' + payloadType);
|
|
@@ -702,6 +728,68 @@ const puppetMixin = (mixinBase) => {
|
|
|
702
728
|
this.emit('wxxd-order', payload?.payload);
|
|
703
729
|
});
|
|
704
730
|
break;
|
|
731
|
+
case 'call':
|
|
732
|
+
puppet.on('call', async (payload) => {
|
|
733
|
+
try {
|
|
734
|
+
if (payload.signal === PUPPET.types.CallSignal.Invite) {
|
|
735
|
+
if (this.__callPool.has(payload.callId)) {
|
|
736
|
+
wechaty_puppet_1.log.warn('WechatyPuppetMixin', '__setupPuppetEvents() duplicate Invite for callId=%s, ignoring', payload.callId);
|
|
737
|
+
return;
|
|
738
|
+
}
|
|
739
|
+
const call = new this.Call({
|
|
740
|
+
id: payload.callId,
|
|
741
|
+
direction: 'incoming',
|
|
742
|
+
});
|
|
743
|
+
await call.ready();
|
|
744
|
+
this.__callPool.set(call.id, call);
|
|
745
|
+
this.emit('call', call);
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
const call = this.__callPool.get(payload.callId);
|
|
749
|
+
if (!call) {
|
|
750
|
+
// Under the protocol-mints-id model, signals for an unknown callId
|
|
751
|
+
// are expected within race windows (e.g. a Ringing ack arriving
|
|
752
|
+
// before callInvite returns) or after the Call has been finalized
|
|
753
|
+
// and removed from the pool. Drop silently — log.warn, not error.
|
|
754
|
+
wechaty_puppet_1.log.warn('WechatyPuppetMixin', '__setupPuppetEvents() call event for unknown callId=%s, dropping', payload.callId);
|
|
755
|
+
return;
|
|
756
|
+
}
|
|
757
|
+
const actor = await this.Contact.find({ id: payload.contactId });
|
|
758
|
+
if (!actor) {
|
|
759
|
+
wechaty_puppet_1.log.warn('WechatyPuppetMixin', '__setupPuppetEvents() actor contact not found for callId=%s contactId=%s, dropping', payload.callId, payload.contactId);
|
|
760
|
+
return;
|
|
761
|
+
}
|
|
762
|
+
call.__handleSignal(payload.signal, actor, payload.reason);
|
|
763
|
+
switch (payload.signal) {
|
|
764
|
+
case PUPPET.types.CallSignal.Ringing:
|
|
765
|
+
this.emit('call-ringing', call);
|
|
766
|
+
break;
|
|
767
|
+
case PUPPET.types.CallSignal.Accept:
|
|
768
|
+
this.emit('call-accept', call, actor);
|
|
769
|
+
break;
|
|
770
|
+
case PUPPET.types.CallSignal.Reject:
|
|
771
|
+
this.emit('call-reject', call, actor, payload.reason);
|
|
772
|
+
await this.__finalizeIfEnded(call);
|
|
773
|
+
break;
|
|
774
|
+
case PUPPET.types.CallSignal.Cancel:
|
|
775
|
+
this.emit('call-cancel', call, payload.reason);
|
|
776
|
+
// Cancel is a peer-side terminal action on the receiving side:
|
|
777
|
+
// the caller has withdrawn, so the local call necessarily ends.
|
|
778
|
+
await this.__finalizeIfEnded(call, /* force */ true);
|
|
779
|
+
break;
|
|
780
|
+
case PUPPET.types.CallSignal.Hangup:
|
|
781
|
+
this.emit('call-hangup', call, actor, payload.reason);
|
|
782
|
+
await this.__finalizeIfEnded(call);
|
|
783
|
+
break;
|
|
784
|
+
default:
|
|
785
|
+
break;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
catch (e) {
|
|
789
|
+
this.emit('error', gerror_1.GError.from(e));
|
|
790
|
+
}
|
|
791
|
+
});
|
|
792
|
+
break;
|
|
705
793
|
default:
|
|
706
794
|
/**
|
|
707
795
|
* Check: The eventName here should have the type `never`
|
|
@@ -711,6 +799,67 @@ const puppetMixin = (mixinBase) => {
|
|
|
711
799
|
}
|
|
712
800
|
wechaty_puppet_1.log.verbose('WechatyPuppetMixin', '__setupPuppetEvents() ... done');
|
|
713
801
|
}
|
|
802
|
+
/**
|
|
803
|
+
* Decide whether a call has reached its terminal state and, if so, drive
|
|
804
|
+
* the local lifecycle to ended by invoking {@link CallImpl.__markEnded},
|
|
805
|
+
* which routes through __finalize and is responsible for emitting both
|
|
806
|
+
* the object 'ended' and the bot 'call-ended' lifecycle events as well
|
|
807
|
+
* as evicting the call from the pool. This method does NOT emit
|
|
808
|
+
* 'call-ended' directly — that would risk a double-emit if a local
|
|
809
|
+
* control path (reject/cancel/hangup) finalizes the call before the
|
|
810
|
+
* puppet echo reaches here. The `__endedEmitted` sentinel inside
|
|
811
|
+
* __finalize makes the joint behavior idempotent.
|
|
812
|
+
*
|
|
813
|
+
* Strategy:
|
|
814
|
+
* - `force=true` short-circuits when the caller already knows the call is
|
|
815
|
+
* over (Cancel from the receiver's perspective).
|
|
816
|
+
* - Otherwise, refresh the payload via dirty + ready and check
|
|
817
|
+
* `endTime`, with a short retry budget so transient puppet hiccups do
|
|
818
|
+
* not strand a Call in the pool.
|
|
819
|
+
* - As a last-resort heuristic, an ended-leaning signal (Reject / Hangup)
|
|
820
|
+
* on a strict 1v1 call (participants.length === 2: the starter plus
|
|
821
|
+
* exactly one invitee) is treated as terminal even if sync never
|
|
822
|
+
* recovered: in 1v1 the protocol has no other peer to keep the
|
|
823
|
+
* session alive. Other roster shapes (length 0/1/3+) fall through
|
|
824
|
+
* and wait for the next dirty signal — length<=1 is a stranded-but-
|
|
825
|
+
* recoverable shape (empty roster from a sync hiccup, or a multi-
|
|
826
|
+
* party call whose other members already left).
|
|
827
|
+
*/
|
|
828
|
+
async __finalizeIfEnded(call, force = false) {
|
|
829
|
+
let ended = force;
|
|
830
|
+
if (!ended) {
|
|
831
|
+
for (let attempt = 0; attempt < 3 && !ended; attempt++) {
|
|
832
|
+
try {
|
|
833
|
+
await call.sync();
|
|
834
|
+
ended = !!call.endTime();
|
|
835
|
+
}
|
|
836
|
+
catch (e) {
|
|
837
|
+
wechaty_puppet_1.log.warn('WechatyPuppetMixin', '__finalizeIfEnded() sync attempt %d failed for callId=%s: %s', attempt + 1, call.id, e.message);
|
|
838
|
+
}
|
|
839
|
+
if (!ended && attempt < 2) {
|
|
840
|
+
await new Promise(resolve => setTimeout(resolve, 500));
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
if (!ended) {
|
|
845
|
+
try {
|
|
846
|
+
const participants = await call.participants();
|
|
847
|
+
if (participants.length === 2) {
|
|
848
|
+
wechaty_puppet_1.log.warn('WechatyPuppetMixin', '__finalizeIfEnded() 1v1 fallback after sync failure for callId=%s (rosterLength=%d)', call.id, participants.length);
|
|
849
|
+
ended = true;
|
|
850
|
+
}
|
|
851
|
+
else {
|
|
852
|
+
wechaty_puppet_1.log.error('WechatyPuppetMixin', '__finalizeIfEnded() sync failed, leaving callId=%s in pool for next dirty signal (rosterLength=%d)', call.id, participants.length);
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
catch (e) {
|
|
856
|
+
wechaty_puppet_1.log.error('WechatyPuppetMixin', '__finalizeIfEnded() participants lookup failed for callId=%s: %s', call.id, e.message);
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
if (ended) {
|
|
860
|
+
call.__markEnded();
|
|
861
|
+
}
|
|
862
|
+
}
|
|
714
863
|
}
|
|
715
864
|
return PuppetMixin;
|
|
716
865
|
};
|