@juzi/wechaty 1.0.158 → 1.0.160
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/io.js +40 -40
- package/dist/cjs/src/io.js.map +1 -1
- package/dist/cjs/src/package-json.js +4 -4
- package/dist/cjs/src/schemas/logger.d.ts +2 -0
- package/dist/cjs/src/schemas/logger.d.ts.map +1 -0
- package/dist/cjs/src/schemas/logger.js +3 -0
- package/dist/cjs/src/schemas/logger.js.map +1 -0
- package/dist/cjs/src/schemas/mod.d.ts +2 -1
- package/dist/cjs/src/schemas/mod.d.ts.map +1 -1
- package/dist/cjs/src/schemas/mod.js.map +1 -1
- package/dist/cjs/src/schemas/wechaty-options.d.ts +19 -0
- package/dist/cjs/src/schemas/wechaty-options.d.ts.map +1 -1
- package/dist/cjs/src/user-mixins/wechatify.d.ts +23 -0
- package/dist/cjs/src/user-mixins/wechatify.d.ts.map +1 -1
- package/dist/cjs/src/user-mixins/wechatify.js +25 -0
- package/dist/cjs/src/user-mixins/wechatify.js.map +1 -1
- package/dist/cjs/src/user-modules/call.d.ts +4 -0
- package/dist/cjs/src/user-modules/call.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/call.js +6 -7
- package/dist/cjs/src/user-modules/call.js.map +1 -1
- package/dist/cjs/src/user-modules/channel-card.d.ts +2 -0
- package/dist/cjs/src/user-modules/channel-card.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/channel-card.js +2 -3
- package/dist/cjs/src/user-modules/channel-card.js.map +1 -1
- package/dist/cjs/src/user-modules/channel.d.ts +2 -0
- package/dist/cjs/src/user-modules/channel.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/channel.js +2 -3
- package/dist/cjs/src/user-modules/channel.js.map +1 -1
- package/dist/cjs/src/user-modules/chat-history.d.ts +2 -0
- package/dist/cjs/src/user-modules/chat-history.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/chat-history.js +2 -3
- package/dist/cjs/src/user-modules/chat-history.js.map +1 -1
- package/dist/cjs/src/user-modules/consult-card.d.ts +2 -0
- package/dist/cjs/src/user-modules/consult-card.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/consult-card.js +3 -4
- package/dist/cjs/src/user-modules/consult-card.js.map +1 -1
- package/dist/cjs/src/user-modules/contact-self.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/contact-self.js +8 -9
- package/dist/cjs/src/user-modules/contact-self.js.map +1 -1
- package/dist/cjs/src/user-modules/contact.d.ts +2 -0
- package/dist/cjs/src/user-modules/contact.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/contact.js +36 -37
- package/dist/cjs/src/user-modules/contact.js.map +1 -1
- package/dist/cjs/src/user-modules/delay.d.ts +2 -0
- package/dist/cjs/src/user-modules/delay.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/douyin-one-click-phone-collection.d.ts +2 -0
- package/dist/cjs/src/user-modules/douyin-one-click-phone-collection.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/douyin-one-click-phone-collection.js +2 -3
- package/dist/cjs/src/user-modules/douyin-one-click-phone-collection.js.map +1 -1
- package/dist/cjs/src/user-modules/favorite.d.ts +21 -0
- package/dist/cjs/src/user-modules/favorite.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/favorite.js +1 -21
- package/dist/cjs/src/user-modules/favorite.js.map +1 -1
- package/dist/cjs/src/user-modules/friendship.d.ts +2 -0
- package/dist/cjs/src/user-modules/friendship.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/friendship.js +11 -12
- package/dist/cjs/src/user-modules/friendship.js.map +1 -1
- package/dist/cjs/src/user-modules/im-specific.d.ts +2 -0
- package/dist/cjs/src/user-modules/im-specific.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/im-specific.js +1 -2
- package/dist/cjs/src/user-modules/im-specific.js.map +1 -1
- package/dist/cjs/src/user-modules/image.d.ts +22 -0
- package/dist/cjs/src/user-modules/image.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/image.js +5 -6
- package/dist/cjs/src/user-modules/image.js.map +1 -1
- package/dist/cjs/src/user-modules/location.d.ts +2 -0
- package/dist/cjs/src/user-modules/location.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/location.js +2 -3
- package/dist/cjs/src/user-modules/location.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 +55 -55
- package/dist/cjs/src/user-modules/message.js.map +1 -1
- package/dist/cjs/src/user-modules/mini-program.d.ts +2 -0
- package/dist/cjs/src/user-modules/mini-program.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/mini-program.js +2 -3
- package/dist/cjs/src/user-modules/mini-program.js.map +1 -1
- package/dist/cjs/src/user-modules/moment.d.ts +21 -0
- package/dist/cjs/src/user-modules/moment.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/moment.js +5 -25
- package/dist/cjs/src/user-modules/moment.js.map +1 -1
- package/dist/cjs/src/user-modules/money.d.ts +2 -0
- package/dist/cjs/src/user-modules/money.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/post.d.ts +2 -0
- package/dist/cjs/src/user-modules/post.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/post.js +25 -25
- package/dist/cjs/src/user-modules/post.js.map +1 -1
- package/dist/cjs/src/user-modules/premium-online-appointment-card.d.ts +2 -0
- package/dist/cjs/src/user-modules/premium-online-appointment-card.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/premium-online-appointment-card.js +2 -3
- package/dist/cjs/src/user-modules/premium-online-appointment-card.js.map +1 -1
- package/dist/cjs/src/user-modules/room-invitation.d.ts +2 -0
- package/dist/cjs/src/user-modules/room-invitation.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/room-invitation.js +10 -11
- package/dist/cjs/src/user-modules/room-invitation.js.map +1 -1
- package/dist/cjs/src/user-modules/room.d.ts +2 -0
- package/dist/cjs/src/user-modules/room.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/room.js +43 -43
- package/dist/cjs/src/user-modules/room.js.map +1 -1
- package/dist/cjs/src/user-modules/tag-group.d.ts +2 -0
- package/dist/cjs/src/user-modules/tag-group.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/tag-group.js +13 -14
- package/dist/cjs/src/user-modules/tag-group.js.map +1 -1
- package/dist/cjs/src/user-modules/tag.d.ts +2 -0
- package/dist/cjs/src/user-modules/tag.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/tag.js +21 -22
- package/dist/cjs/src/user-modules/tag.js.map +1 -1
- package/dist/cjs/src/user-modules/url-link.d.ts +2 -0
- package/dist/cjs/src/user-modules/url-link.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/url-link.js +2 -3
- package/dist/cjs/src/user-modules/url-link.js.map +1 -1
- package/dist/cjs/src/user-modules/voice.d.ts +2 -0
- package/dist/cjs/src/user-modules/voice.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/voice.js +8 -9
- package/dist/cjs/src/user-modules/voice.js.map +1 -1
- package/dist/cjs/src/user-modules/wecom.d.ts +3 -1
- package/dist/cjs/src/user-modules/wecom.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/wecom.js +2 -3
- package/dist/cjs/src/user-modules/wecom.js.map +1 -1
- package/dist/cjs/src/user-modules/wxxd-order.d.ts +2 -0
- package/dist/cjs/src/user-modules/wxxd-order.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/wxxd-order.js +9 -10
- package/dist/cjs/src/user-modules/wxxd-order.js.map +1 -1
- package/dist/cjs/src/user-modules/wxxd-product.d.ts +2 -0
- package/dist/cjs/src/user-modules/wxxd-product.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/wxxd-product.js +6 -7
- package/dist/cjs/src/user-modules/wxxd-product.js.map +1 -1
- package/dist/cjs/src/wechaty/wechaty-base.d.ts +21 -37
- package/dist/cjs/src/wechaty/wechaty-base.d.ts.map +1 -1
- package/dist/cjs/src/wechaty/wechaty-base.js +17 -17
- package/dist/cjs/src/wechaty/wechaty-base.js.map +1 -1
- package/dist/cjs/src/wechaty/wechaty-skeleton.d.ts +15 -4
- package/dist/cjs/src/wechaty/wechaty-skeleton.d.ts.map +1 -1
- package/dist/cjs/src/wechaty/wechaty-skeleton.js +17 -6
- package/dist/cjs/src/wechaty/wechaty-skeleton.js.map +1 -1
- package/dist/cjs/src/wechaty-mixins/gerror-mixin.d.ts +3 -2
- package/dist/cjs/src/wechaty-mixins/gerror-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/io-mixin.d.ts +12 -6
- package/dist/cjs/src/wechaty-mixins/io-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/io-mixin.js +8 -8
- package/dist/cjs/src/wechaty-mixins/io-mixin.js.map +1 -1
- package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts +53 -19
- package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/login-mixin.js +5 -5
- package/dist/cjs/src/wechaty-mixins/login-mixin.js.map +1 -1
- package/dist/cjs/src/wechaty-mixins/misc-mixin.d.ts +21 -10
- package/dist/cjs/src/wechaty-mixins/misc-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/misc-mixin.js +1 -1
- package/dist/cjs/src/wechaty-mixins/misc-mixin.js.map +1 -1
- package/dist/cjs/src/wechaty-mixins/plugin-mixin.d.ts +18 -12
- package/dist/cjs/src/wechaty-mixins/plugin-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/plugin-mixin.js +5 -5
- package/dist/cjs/src/wechaty-mixins/plugin-mixin.js.map +1 -1
- package/dist/cjs/src/wechaty-mixins/puppet-mixin-dirty-pool.spec.d.ts +3 -0
- package/dist/cjs/src/wechaty-mixins/puppet-mixin-dirty-pool.spec.d.ts.map +1 -0
- package/dist/cjs/src/wechaty-mixins/puppet-mixin-dirty-pool.spec.js +121 -0
- package/dist/cjs/src/wechaty-mixins/puppet-mixin-dirty-pool.spec.js.map +1 -0
- package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts +16 -12
- package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/puppet-mixin.js +116 -64
- package/dist/cjs/src/wechaty-mixins/puppet-mixin.js.map +1 -1
- package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.d.ts +3 -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 +4 -4
- package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.js.map +1 -1
- package/dist/esm/src/io.js +40 -40
- package/dist/esm/src/io.js.map +1 -1
- package/dist/esm/src/package-json.js +4 -4
- package/dist/esm/src/schemas/logger.d.ts +2 -0
- package/dist/esm/src/schemas/logger.d.ts.map +1 -0
- package/dist/esm/src/schemas/logger.js +2 -0
- package/dist/esm/src/schemas/logger.js.map +1 -0
- package/dist/esm/src/schemas/mod.d.ts +2 -1
- package/dist/esm/src/schemas/mod.d.ts.map +1 -1
- package/dist/esm/src/schemas/mod.js.map +1 -1
- package/dist/esm/src/schemas/wechaty-options.d.ts +19 -0
- package/dist/esm/src/schemas/wechaty-options.d.ts.map +1 -1
- package/dist/esm/src/user-mixins/wechatify.d.ts +23 -0
- package/dist/esm/src/user-mixins/wechatify.d.ts.map +1 -1
- package/dist/esm/src/user-mixins/wechatify.js +25 -0
- package/dist/esm/src/user-mixins/wechatify.js.map +1 -1
- package/dist/esm/src/user-modules/call.d.ts +4 -0
- package/dist/esm/src/user-modules/call.d.ts.map +1 -1
- package/dist/esm/src/user-modules/call.js +6 -7
- package/dist/esm/src/user-modules/call.js.map +1 -1
- package/dist/esm/src/user-modules/channel-card.d.ts +2 -0
- package/dist/esm/src/user-modules/channel-card.d.ts.map +1 -1
- package/dist/esm/src/user-modules/channel-card.js +2 -3
- package/dist/esm/src/user-modules/channel-card.js.map +1 -1
- package/dist/esm/src/user-modules/channel.d.ts +2 -0
- package/dist/esm/src/user-modules/channel.d.ts.map +1 -1
- package/dist/esm/src/user-modules/channel.js +2 -3
- package/dist/esm/src/user-modules/channel.js.map +1 -1
- package/dist/esm/src/user-modules/chat-history.d.ts +2 -0
- package/dist/esm/src/user-modules/chat-history.d.ts.map +1 -1
- package/dist/esm/src/user-modules/chat-history.js +2 -3
- package/dist/esm/src/user-modules/chat-history.js.map +1 -1
- package/dist/esm/src/user-modules/consult-card.d.ts +2 -0
- package/dist/esm/src/user-modules/consult-card.d.ts.map +1 -1
- package/dist/esm/src/user-modules/consult-card.js +3 -4
- package/dist/esm/src/user-modules/consult-card.js.map +1 -1
- package/dist/esm/src/user-modules/contact-self.d.ts.map +1 -1
- package/dist/esm/src/user-modules/contact-self.js +8 -9
- package/dist/esm/src/user-modules/contact-self.js.map +1 -1
- package/dist/esm/src/user-modules/contact.d.ts +2 -0
- package/dist/esm/src/user-modules/contact.d.ts.map +1 -1
- package/dist/esm/src/user-modules/contact.js +36 -37
- package/dist/esm/src/user-modules/contact.js.map +1 -1
- package/dist/esm/src/user-modules/delay.d.ts +2 -0
- package/dist/esm/src/user-modules/delay.d.ts.map +1 -1
- package/dist/esm/src/user-modules/douyin-one-click-phone-collection.d.ts +2 -0
- package/dist/esm/src/user-modules/douyin-one-click-phone-collection.d.ts.map +1 -1
- package/dist/esm/src/user-modules/douyin-one-click-phone-collection.js +2 -3
- package/dist/esm/src/user-modules/douyin-one-click-phone-collection.js.map +1 -1
- package/dist/esm/src/user-modules/favorite.d.ts +21 -0
- package/dist/esm/src/user-modules/favorite.d.ts.map +1 -1
- package/dist/esm/src/user-modules/favorite.js +1 -21
- package/dist/esm/src/user-modules/favorite.js.map +1 -1
- package/dist/esm/src/user-modules/friendship.d.ts +2 -0
- package/dist/esm/src/user-modules/friendship.d.ts.map +1 -1
- package/dist/esm/src/user-modules/friendship.js +11 -12
- package/dist/esm/src/user-modules/friendship.js.map +1 -1
- package/dist/esm/src/user-modules/im-specific.d.ts +2 -0
- package/dist/esm/src/user-modules/im-specific.d.ts.map +1 -1
- package/dist/esm/src/user-modules/im-specific.js +1 -2
- package/dist/esm/src/user-modules/im-specific.js.map +1 -1
- package/dist/esm/src/user-modules/image.d.ts +22 -0
- package/dist/esm/src/user-modules/image.d.ts.map +1 -1
- package/dist/esm/src/user-modules/image.js +5 -6
- package/dist/esm/src/user-modules/image.js.map +1 -1
- package/dist/esm/src/user-modules/location.d.ts +2 -0
- package/dist/esm/src/user-modules/location.d.ts.map +1 -1
- package/dist/esm/src/user-modules/location.js +2 -3
- package/dist/esm/src/user-modules/location.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 +56 -56
- package/dist/esm/src/user-modules/message.js.map +1 -1
- package/dist/esm/src/user-modules/mini-program.d.ts +2 -0
- package/dist/esm/src/user-modules/mini-program.d.ts.map +1 -1
- package/dist/esm/src/user-modules/mini-program.js +2 -3
- package/dist/esm/src/user-modules/mini-program.js.map +1 -1
- package/dist/esm/src/user-modules/moment.d.ts +21 -0
- package/dist/esm/src/user-modules/moment.d.ts.map +1 -1
- package/dist/esm/src/user-modules/moment.js +5 -25
- package/dist/esm/src/user-modules/moment.js.map +1 -1
- package/dist/esm/src/user-modules/money.d.ts +2 -0
- package/dist/esm/src/user-modules/money.d.ts.map +1 -1
- package/dist/esm/src/user-modules/post.d.ts +2 -0
- package/dist/esm/src/user-modules/post.d.ts.map +1 -1
- package/dist/esm/src/user-modules/post.js +25 -25
- package/dist/esm/src/user-modules/post.js.map +1 -1
- package/dist/esm/src/user-modules/premium-online-appointment-card.d.ts +2 -0
- package/dist/esm/src/user-modules/premium-online-appointment-card.d.ts.map +1 -1
- package/dist/esm/src/user-modules/premium-online-appointment-card.js +2 -3
- package/dist/esm/src/user-modules/premium-online-appointment-card.js.map +1 -1
- package/dist/esm/src/user-modules/room-invitation.d.ts +2 -0
- package/dist/esm/src/user-modules/room-invitation.d.ts.map +1 -1
- package/dist/esm/src/user-modules/room-invitation.js +10 -11
- package/dist/esm/src/user-modules/room-invitation.js.map +1 -1
- package/dist/esm/src/user-modules/room.d.ts +2 -0
- package/dist/esm/src/user-modules/room.d.ts.map +1 -1
- package/dist/esm/src/user-modules/room.js +44 -44
- package/dist/esm/src/user-modules/room.js.map +1 -1
- package/dist/esm/src/user-modules/tag-group.d.ts +2 -0
- package/dist/esm/src/user-modules/tag-group.d.ts.map +1 -1
- package/dist/esm/src/user-modules/tag-group.js +13 -14
- package/dist/esm/src/user-modules/tag-group.js.map +1 -1
- package/dist/esm/src/user-modules/tag.d.ts +2 -0
- package/dist/esm/src/user-modules/tag.d.ts.map +1 -1
- package/dist/esm/src/user-modules/tag.js +21 -22
- package/dist/esm/src/user-modules/tag.js.map +1 -1
- package/dist/esm/src/user-modules/url-link.d.ts +2 -0
- package/dist/esm/src/user-modules/url-link.d.ts.map +1 -1
- package/dist/esm/src/user-modules/url-link.js +2 -3
- package/dist/esm/src/user-modules/url-link.js.map +1 -1
- package/dist/esm/src/user-modules/voice.d.ts +2 -0
- package/dist/esm/src/user-modules/voice.d.ts.map +1 -1
- package/dist/esm/src/user-modules/voice.js +8 -9
- package/dist/esm/src/user-modules/voice.js.map +1 -1
- package/dist/esm/src/user-modules/wecom.d.ts +3 -1
- package/dist/esm/src/user-modules/wecom.d.ts.map +1 -1
- package/dist/esm/src/user-modules/wecom.js +2 -3
- package/dist/esm/src/user-modules/wecom.js.map +1 -1
- package/dist/esm/src/user-modules/wxxd-order.d.ts +2 -0
- package/dist/esm/src/user-modules/wxxd-order.d.ts.map +1 -1
- package/dist/esm/src/user-modules/wxxd-order.js +9 -10
- package/dist/esm/src/user-modules/wxxd-order.js.map +1 -1
- package/dist/esm/src/user-modules/wxxd-product.d.ts +2 -0
- package/dist/esm/src/user-modules/wxxd-product.d.ts.map +1 -1
- package/dist/esm/src/user-modules/wxxd-product.js +6 -7
- package/dist/esm/src/user-modules/wxxd-product.js.map +1 -1
- package/dist/esm/src/wechaty/wechaty-base.d.ts +21 -37
- package/dist/esm/src/wechaty/wechaty-base.d.ts.map +1 -1
- package/dist/esm/src/wechaty/wechaty-base.js +17 -17
- package/dist/esm/src/wechaty/wechaty-base.js.map +1 -1
- package/dist/esm/src/wechaty/wechaty-skeleton.d.ts +15 -4
- package/dist/esm/src/wechaty/wechaty-skeleton.d.ts.map +1 -1
- package/dist/esm/src/wechaty/wechaty-skeleton.js +17 -6
- package/dist/esm/src/wechaty/wechaty-skeleton.js.map +1 -1
- package/dist/esm/src/wechaty-mixins/gerror-mixin.d.ts +3 -2
- package/dist/esm/src/wechaty-mixins/gerror-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/io-mixin.d.ts +12 -6
- package/dist/esm/src/wechaty-mixins/io-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/io-mixin.js +8 -8
- package/dist/esm/src/wechaty-mixins/io-mixin.js.map +1 -1
- package/dist/esm/src/wechaty-mixins/login-mixin.d.ts +53 -19
- package/dist/esm/src/wechaty-mixins/login-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/login-mixin.js +5 -5
- package/dist/esm/src/wechaty-mixins/login-mixin.js.map +1 -1
- package/dist/esm/src/wechaty-mixins/misc-mixin.d.ts +21 -10
- package/dist/esm/src/wechaty-mixins/misc-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/misc-mixin.js +1 -1
- package/dist/esm/src/wechaty-mixins/misc-mixin.js.map +1 -1
- package/dist/esm/src/wechaty-mixins/plugin-mixin.d.ts +18 -12
- package/dist/esm/src/wechaty-mixins/plugin-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/plugin-mixin.js +5 -5
- package/dist/esm/src/wechaty-mixins/plugin-mixin.js.map +1 -1
- package/dist/esm/src/wechaty-mixins/puppet-mixin-dirty-pool.spec.d.ts +3 -0
- package/dist/esm/src/wechaty-mixins/puppet-mixin-dirty-pool.spec.d.ts.map +1 -0
- package/dist/esm/src/wechaty-mixins/puppet-mixin-dirty-pool.spec.js +96 -0
- package/dist/esm/src/wechaty-mixins/puppet-mixin-dirty-pool.spec.js.map +1 -0
- package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts +16 -12
- package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/puppet-mixin.js +116 -64
- package/dist/esm/src/wechaty-mixins/puppet-mixin.js.map +1 -1
- package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.d.ts +3 -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 -4
- package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.js.map +1 -1
- package/package.json +3 -3
- package/src/io.ts +40 -40
- package/src/package-json.ts +4 -4
- package/src/schemas/logger.ts +1 -0
- package/src/schemas/mod.ts +4 -0
- package/src/schemas/wechaty-options.ts +21 -0
- package/src/user-mixins/wechatify.ts +26 -0
- package/src/user-modules/call.ts +6 -7
- package/src/user-modules/channel-card.ts +2 -3
- package/src/user-modules/channel.ts +2 -3
- package/src/user-modules/chat-history.ts +2 -3
- package/src/user-modules/consult-card.ts +3 -5
- package/src/user-modules/contact-self.ts +8 -11
- package/src/user-modules/contact.ts +36 -40
- package/src/user-modules/douyin-one-click-phone-collection.ts +2 -3
- package/src/user-modules/favorite.ts +1 -2
- package/src/user-modules/friendship.ts +11 -12
- package/src/user-modules/im-specific.ts +1 -2
- package/src/user-modules/image.ts +5 -6
- package/src/user-modules/location.ts +2 -3
- package/src/user-modules/message.ts +55 -56
- package/src/user-modules/mini-program.ts +2 -3
- package/src/user-modules/moment.ts +5 -6
- package/src/user-modules/post.ts +25 -25
- package/src/user-modules/premium-online-appointment-card.ts +2 -3
- package/src/user-modules/room-invitation.ts +10 -11
- package/src/user-modules/room.ts +43 -44
- package/src/user-modules/tag-group.ts +13 -14
- package/src/user-modules/tag.ts +21 -22
- package/src/user-modules/url-link.ts +2 -3
- package/src/user-modules/voice.ts +8 -9
- package/src/user-modules/wecom.ts +3 -3
- package/src/user-modules/wxxd-order.ts +9 -10
- package/src/user-modules/wxxd-product.ts +6 -7
- package/src/wechaty/wechaty-base.ts +17 -17
- package/src/wechaty/wechaty-skeleton.ts +21 -8
- package/src/wechaty-mixins/io-mixin.ts +8 -8
- package/src/wechaty-mixins/login-mixin.ts +5 -5
- package/src/wechaty-mixins/misc-mixin.ts +1 -1
- package/src/wechaty-mixins/plugin-mixin.ts +5 -5
- package/src/wechaty-mixins/puppet-mixin-dirty-pool.spec.ts +144 -0
- package/src/wechaty-mixins/puppet-mixin.ts +114 -69
- package/src/wechaty-mixins/wechatify-user-module-mixin.ts +4 -4
|
@@ -18,9 +18,6 @@
|
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
20
|
import type * as PUPPET from '@juzi/wechaty-puppet'
|
|
21
|
-
import {
|
|
22
|
-
log,
|
|
23
|
-
} from '@juzi/wechaty-puppet'
|
|
24
21
|
import type {
|
|
25
22
|
FileBoxInterface,
|
|
26
23
|
} from 'file-box'
|
|
@@ -68,7 +65,7 @@ class ContactSelfMixin extends MixinBase {
|
|
|
68
65
|
return contact as ContactSelfInterface
|
|
69
66
|
}
|
|
70
67
|
} catch (e) {
|
|
71
|
-
log.silly('ContactSelf', 'find() exception: %s', (e as Error).message)
|
|
68
|
+
this.log.silly('ContactSelf', 'find() exception: %s', (e as Error).message)
|
|
72
69
|
}
|
|
73
70
|
return undefined
|
|
74
71
|
}
|
|
@@ -104,7 +101,7 @@ class ContactSelfMixin extends MixinBase {
|
|
|
104
101
|
*
|
|
105
102
|
*/
|
|
106
103
|
public override async avatar (file?: FileBoxInterface): Promise<void | FileBoxInterface> {
|
|
107
|
-
log.verbose('Contact', 'avatar(%s)', file ? file.name : '')
|
|
104
|
+
this.log.verbose('Contact', 'avatar(%s)', file ? file.name : '')
|
|
108
105
|
|
|
109
106
|
if (!file) {
|
|
110
107
|
const filebox = await super.avatar()
|
|
@@ -133,7 +130,7 @@ class ContactSelfMixin extends MixinBase {
|
|
|
133
130
|
* })
|
|
134
131
|
*/
|
|
135
132
|
public async qrcode (): Promise<string> {
|
|
136
|
-
log.verbose('Contact', 'qrcode()')
|
|
133
|
+
this.log.verbose('Contact', 'qrcode()')
|
|
137
134
|
if (this.id !== this.wechaty.puppet.currentUserId) {
|
|
138
135
|
throw new Error('only can get qrcode for the currentUser')
|
|
139
136
|
}
|
|
@@ -162,7 +159,7 @@ class ContactSelfMixin extends MixinBase {
|
|
|
162
159
|
public override name (name: string): Promise<void>
|
|
163
160
|
|
|
164
161
|
public override name (name?: string): string | Promise<void> {
|
|
165
|
-
log.verbose('ContactSelf', 'name(%s)', name || '')
|
|
162
|
+
this.log.verbose('ContactSelf', 'name(%s)', name || '')
|
|
166
163
|
|
|
167
164
|
if (typeof name === 'undefined') {
|
|
168
165
|
return super.name()
|
|
@@ -179,7 +176,7 @@ class ContactSelfMixin extends MixinBase {
|
|
|
179
176
|
public override realName (realName: string): Promise<void>
|
|
180
177
|
|
|
181
178
|
public override realName (realName?: string): string | Promise<void> {
|
|
182
|
-
log.verbose('ContactSelf', 'realName(%s)', realName || '')
|
|
179
|
+
this.log.verbose('ContactSelf', 'realName(%s)', realName || '')
|
|
183
180
|
|
|
184
181
|
if (typeof realName === 'undefined') {
|
|
185
182
|
return super.realName()
|
|
@@ -196,7 +193,7 @@ class ContactSelfMixin extends MixinBase {
|
|
|
196
193
|
public override aka (aka: string): Promise<void>
|
|
197
194
|
|
|
198
195
|
public override aka (aka?: string): string | Promise<void> {
|
|
199
|
-
log.verbose('ContactSelf', 'aka(%s)', aka || '')
|
|
196
|
+
this.log.verbose('ContactSelf', 'aka(%s)', aka || '')
|
|
200
197
|
|
|
201
198
|
if (typeof aka === 'undefined') {
|
|
202
199
|
return super.aka()
|
|
@@ -225,7 +222,7 @@ class ContactSelfMixin extends MixinBase {
|
|
|
225
222
|
* })
|
|
226
223
|
*/
|
|
227
224
|
public async signature (signature: string): Promise<void> {
|
|
228
|
-
log.verbose('ContactSelf', 'signature()')
|
|
225
|
+
this.log.verbose('ContactSelf', 'signature()')
|
|
229
226
|
|
|
230
227
|
if (this.id !== this.wechaty.puppet.currentUserId) {
|
|
231
228
|
throw new Error('only can change signature for user self')
|
|
@@ -235,7 +232,7 @@ class ContactSelfMixin extends MixinBase {
|
|
|
235
232
|
}
|
|
236
233
|
|
|
237
234
|
public async roomAlias (room: RoomInterface, alias?: string): Promise<void | string> {
|
|
238
|
-
log.verbose('ContactSelf', 'roomAlias()')
|
|
235
|
+
this.log.verbose('ContactSelf', 'roomAlias()')
|
|
239
236
|
|
|
240
237
|
if (typeof alias === 'undefined') {
|
|
241
238
|
return room.alias(this)
|
|
@@ -28,10 +28,6 @@ import type {
|
|
|
28
28
|
Constructor,
|
|
29
29
|
} from 'clone-class'
|
|
30
30
|
|
|
31
|
-
import {
|
|
32
|
-
log,
|
|
33
|
-
} from '../config.js'
|
|
34
|
-
|
|
35
31
|
import { ContactEventEmitter } from '../schemas/mod.js'
|
|
36
32
|
|
|
37
33
|
import {
|
|
@@ -98,7 +94,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
98
94
|
static async find (
|
|
99
95
|
query : string | PUPPET.filters.Contact,
|
|
100
96
|
): Promise<undefined | ContactInterface> {
|
|
101
|
-
log.silly('Contact', 'find(%s)', JSON.stringify(query, stringifyFilter))
|
|
97
|
+
this.log.silly('Contact', 'find(%s)', JSON.stringify(query, stringifyFilter))
|
|
102
98
|
|
|
103
99
|
if (typeof query === 'object' && query.id) {
|
|
104
100
|
let contact: ContactImpl
|
|
@@ -129,7 +125,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
129
125
|
}
|
|
130
126
|
|
|
131
127
|
if (contactList.length > 1) {
|
|
132
|
-
log.warn('Contact', 'find() got more than 1 result: %d total', contactList.length)
|
|
128
|
+
this.log.warn('Contact', 'find() got more than 1 result: %d total', contactList.length)
|
|
133
129
|
}
|
|
134
130
|
|
|
135
131
|
for (const [ idx, contact ] of contactList.entries()) {
|
|
@@ -138,15 +134,15 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
138
134
|
// https://github.com/wechaty/wechaty/issues/1345
|
|
139
135
|
const valid = await this.wechaty.puppet.contactValidate(contact.id)
|
|
140
136
|
if (valid) {
|
|
141
|
-
log.silly('Contact', 'find() contact<id=%s> is valid, return it', idx, contact.id)
|
|
137
|
+
this.log.silly('Contact', 'find() contact<id=%s> is valid, return it', idx, contact.id)
|
|
142
138
|
return contact
|
|
143
139
|
} else {
|
|
144
|
-
log.silly('Contact', 'find() contact<id=%s> is invalid, skip it', idx, contact.id)
|
|
140
|
+
this.log.silly('Contact', 'find() contact<id=%s> is invalid, skip it', idx, contact.id)
|
|
145
141
|
}
|
|
146
142
|
|
|
147
143
|
}
|
|
148
144
|
|
|
149
|
-
log.warn('Contact', 'find() all of %d contacts are invalid', contactList.length)
|
|
145
|
+
this.log.warn('Contact', 'find() all of %d contacts are invalid', contactList.length)
|
|
150
146
|
return undefined
|
|
151
147
|
}
|
|
152
148
|
|
|
@@ -172,7 +168,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
172
168
|
static async findAll (
|
|
173
169
|
query? : string | PUPPET.filters.Contact,
|
|
174
170
|
): Promise<ContactInterface[]> {
|
|
175
|
-
log.verbose('Contact', 'findAll(%s)', JSON.stringify(query, stringifyFilter) || '')
|
|
171
|
+
this.log.verbose('Contact', 'findAll(%s)', JSON.stringify(query, stringifyFilter) || '')
|
|
176
172
|
|
|
177
173
|
const contactIdList: string[] = await this.wechaty.puppet.contactSearch(query)
|
|
178
174
|
|
|
@@ -242,7 +238,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
242
238
|
opts? : { batch?: number },
|
|
243
239
|
): AsyncIterable<ContactInterface[]> {
|
|
244
240
|
const batch = opts?.batch ?? 100
|
|
245
|
-
log.verbose('Contact', 'findAllIter(%s, batch=%d)', JSON.stringify(query, stringifyFilter) || '', batch)
|
|
241
|
+
this.log.verbose('Contact', 'findAllIter(%s, batch=%d)', JSON.stringify(query, stringifyFilter) || '', batch)
|
|
246
242
|
|
|
247
243
|
if (batch <= 0) {
|
|
248
244
|
throw new Error(`Contact.findAllIter() batch must be positive, got ${batch}`)
|
|
@@ -263,7 +259,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
263
259
|
for (const id of idChunk) {
|
|
264
260
|
const payload = payloadMap.get(id)
|
|
265
261
|
if (!payload) {
|
|
266
|
-
log.silly('Contact', 'findAllIter() payload missing for id=%s, skip', id)
|
|
262
|
+
this.log.silly('Contact', 'findAllIter() payload missing for id=%s, skip', id)
|
|
267
263
|
continue
|
|
268
264
|
}
|
|
269
265
|
|
|
@@ -278,7 +274,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
278
274
|
if (contactChunk.length > 0) {
|
|
279
275
|
yield contactChunk
|
|
280
276
|
} else {
|
|
281
|
-
log.warn('Contact', 'findAllIter() batch all missing from payloadMap, idChunk=%j', idChunk)
|
|
277
|
+
this.log.warn('Contact', 'findAllIter() batch all missing from payloadMap, idChunk=%j', idChunk)
|
|
282
278
|
}
|
|
283
279
|
}
|
|
284
280
|
}
|
|
@@ -348,7 +344,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
348
344
|
// TODO
|
|
349
345
|
// eslint-disable-next-line no-use-before-define
|
|
350
346
|
static async delete (contact: ContactInterface): Promise<void> {
|
|
351
|
-
log.verbose('Contact', 'static delete(%s)', contact.id)
|
|
347
|
+
this.log.verbose('Contact', 'static delete(%s)', contact.id)
|
|
352
348
|
await this.wechaty.puppet.contactDelete(contact.id)
|
|
353
349
|
}
|
|
354
350
|
|
|
@@ -367,7 +363,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
367
363
|
public readonly id: string,
|
|
368
364
|
) {
|
|
369
365
|
super()
|
|
370
|
-
log.silly('Contact', `constructor(${id})`)
|
|
366
|
+
this.log.silly('Contact', `constructor(${id})`)
|
|
371
367
|
}
|
|
372
368
|
|
|
373
369
|
/**
|
|
@@ -458,10 +454,10 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
458
454
|
sayable: Sayable,
|
|
459
455
|
options?: SayOptionsObject,
|
|
460
456
|
): Promise<void | MessageInterface> {
|
|
461
|
-
log.verbose('Contact', 'say(%s)', sayable)
|
|
457
|
+
this.log.verbose('Contact', 'say(%s)', sayable)
|
|
462
458
|
|
|
463
459
|
if (options?.mentionList) {
|
|
464
|
-
log.warn('Contact', 'you cannot mention someone in private conversation!')
|
|
460
|
+
this.log.warn('Contact', 'you cannot mention someone in private conversation!')
|
|
465
461
|
delete options.mentionList
|
|
466
462
|
}
|
|
467
463
|
|
|
@@ -488,7 +484,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
488
484
|
* call.on('ended', () => console.log('call ended'))
|
|
489
485
|
*/
|
|
490
486
|
async call (options?: { media?: PUPPET.types.CallMediaType }): Promise<CallInterface> {
|
|
491
|
-
log.verbose('Contact', 'call(%s)', JSON.stringify(options ?? {}))
|
|
487
|
+
this.log.verbose('Contact', 'call(%s)', JSON.stringify(options ?? {}))
|
|
492
488
|
return (this.wechaty as any).call([ this as unknown as ContactInterface ], options)
|
|
493
489
|
}
|
|
494
490
|
|
|
@@ -547,7 +543,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
547
543
|
* }
|
|
548
544
|
*/
|
|
549
545
|
async alias (newAlias?: null | string): Promise<void | undefined | string> {
|
|
550
|
-
log.silly('Contact', 'alias(%s)',
|
|
546
|
+
this.log.silly('Contact', 'alias(%s)',
|
|
551
547
|
newAlias === undefined
|
|
552
548
|
? ''
|
|
553
549
|
: newAlias,
|
|
@@ -594,7 +590,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
594
590
|
}
|
|
595
591
|
} catch (e) {
|
|
596
592
|
this.wechaty.emitError(e)
|
|
597
|
-
log.error('Contact', 'alias(%s) rejected: %s', newAlias, (e as Error).message)
|
|
593
|
+
this.log.error('Contact', 'alias(%s) rejected: %s', newAlias, (e as Error).message)
|
|
598
594
|
}
|
|
599
595
|
}
|
|
600
596
|
|
|
@@ -623,7 +619,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
623
619
|
async phone (): Promise<string[]>
|
|
624
620
|
async phone (phoneList: string[]): Promise<void>
|
|
625
621
|
async phone (phoneList?: string[]): Promise<string[] | void> {
|
|
626
|
-
log.silly('Contact', 'phone(%s)', phoneList === undefined ? '' : JSON.stringify(phoneList))
|
|
622
|
+
this.log.silly('Contact', 'phone(%s)', phoneList === undefined ? '' : JSON.stringify(phoneList))
|
|
627
623
|
|
|
628
624
|
if (!this.payload) {
|
|
629
625
|
throw new Error('no payload')
|
|
@@ -639,14 +635,14 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
639
635
|
this.payload = await this.wechaty.puppet.contactPayload(this.id)
|
|
640
636
|
} catch (e) {
|
|
641
637
|
this.wechaty.emitError(e)
|
|
642
|
-
log.error('Contact', 'phone(%s) rejected: %s', JSON.stringify(phoneList), (e as Error).message)
|
|
638
|
+
this.log.error('Contact', 'phone(%s) rejected: %s', JSON.stringify(phoneList), (e as Error).message)
|
|
643
639
|
}
|
|
644
640
|
}
|
|
645
641
|
|
|
646
642
|
async corporation (): Promise<undefined | string>
|
|
647
643
|
async corporation (remark: string | null): Promise<void>
|
|
648
644
|
async corporation (remark?: string | null): Promise<void | undefined | string> {
|
|
649
|
-
log.silly('Contact', 'corporation(%s)', remark)
|
|
645
|
+
this.log.silly('Contact', 'corporation(%s)', remark)
|
|
650
646
|
|
|
651
647
|
if (!this.payload) {
|
|
652
648
|
throw new Error('no payload')
|
|
@@ -666,14 +662,14 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
666
662
|
this.payload = await this.wechaty.puppet.contactPayload(this.id)
|
|
667
663
|
} catch (e) {
|
|
668
664
|
this.wechaty.emitError(e)
|
|
669
|
-
log.error('Contact', 'corporation(%s) rejected: %s', remark, (e as Error).message)
|
|
665
|
+
this.log.error('Contact', 'corporation(%s) rejected: %s', remark, (e as Error).message)
|
|
670
666
|
}
|
|
671
667
|
}
|
|
672
668
|
|
|
673
669
|
async description (): Promise<undefined | string>
|
|
674
670
|
async description (newDescription: string | null): Promise<void>
|
|
675
671
|
async description (newDescription?: string | null): Promise<void | undefined | string> {
|
|
676
|
-
log.silly('Contact', 'description(%s)', newDescription)
|
|
672
|
+
this.log.silly('Contact', 'description(%s)', newDescription)
|
|
677
673
|
|
|
678
674
|
if (!this.payload) {
|
|
679
675
|
throw new Error('no payload')
|
|
@@ -689,7 +685,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
689
685
|
this.payload = await this.wechaty.puppet.contactPayload(this.id)
|
|
690
686
|
} catch (e) {
|
|
691
687
|
this.wechaty.emitError(e)
|
|
692
|
-
log.error('Contact', 'description(%s) rejected: %s', newDescription, (e as Error).message)
|
|
688
|
+
this.log.error('Contact', 'description(%s) rejected: %s', newDescription, (e as Error).message)
|
|
693
689
|
}
|
|
694
690
|
}
|
|
695
691
|
|
|
@@ -723,7 +719,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
723
719
|
* const isFriend = contact.friend()
|
|
724
720
|
*/
|
|
725
721
|
friend (): undefined | boolean {
|
|
726
|
-
log.verbose('Contact', 'friend()')
|
|
722
|
+
this.log.verbose('Contact', 'friend()')
|
|
727
723
|
return this.payload?.friend
|
|
728
724
|
}
|
|
729
725
|
|
|
@@ -813,7 +809,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
813
809
|
* console.log(`Contact: ${contact.name()} with avatar file: ${name}`)
|
|
814
810
|
*/
|
|
815
811
|
async avatar (): Promise<FileBoxInterface> {
|
|
816
|
-
log.verbose('Contact', 'avatar()')
|
|
812
|
+
this.log.verbose('Contact', 'avatar()')
|
|
817
813
|
|
|
818
814
|
const fileBox = await this.wechaty.puppet.contactAvatar(this.id)
|
|
819
815
|
return fileBox
|
|
@@ -827,7 +823,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
827
823
|
* const tags = await contact.tags()
|
|
828
824
|
*/
|
|
829
825
|
async tags (): Promise<TagInterface[]> {
|
|
830
|
-
log.verbose('Contact', 'tags() for %s', this)
|
|
826
|
+
this.log.verbose('Contact', 'tags() for %s', this)
|
|
831
827
|
|
|
832
828
|
try {
|
|
833
829
|
const tagPayloadList = this.payload?.tags || []
|
|
@@ -837,7 +833,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
837
833
|
return tagList.filter(tag => !!tag) as TagInterface[]
|
|
838
834
|
} catch (e) {
|
|
839
835
|
this.wechaty.emitError(e)
|
|
840
|
-
log.error('Contact', 'tags() exception: %s', (e as Error).message)
|
|
836
|
+
this.log.error('Contact', 'tags() exception: %s', (e as Error).message)
|
|
841
837
|
return []
|
|
842
838
|
}
|
|
843
839
|
}
|
|
@@ -847,7 +843,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
847
843
|
*/
|
|
848
844
|
|
|
849
845
|
async tag (tags: TagInterface | TagInterface[]): Promise<void> {
|
|
850
|
-
log.verbose('Contact', 'tag(%s) for %s', JSON.stringify(tags), this)
|
|
846
|
+
this.log.verbose('Contact', 'tag(%s) for %s', JSON.stringify(tags), this)
|
|
851
847
|
|
|
852
848
|
if (!Array.isArray(tags)) {
|
|
853
849
|
tags = [ tags ]
|
|
@@ -863,7 +859,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
863
859
|
*/
|
|
864
860
|
|
|
865
861
|
async tagRemove (tags: TagInterface | TagInterface[]): Promise<void> {
|
|
866
|
-
log.verbose('Contact', 'tagRemove(%s) for %s', JSON.stringify(tags), this)
|
|
862
|
+
this.log.verbose('Contact', 'tagRemove(%s) for %s', JSON.stringify(tags), this)
|
|
867
863
|
|
|
868
864
|
if (!Array.isArray(tags)) {
|
|
869
865
|
tags = [ tags ]
|
|
@@ -898,20 +894,20 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
898
894
|
async ready (
|
|
899
895
|
forceSync = false,
|
|
900
896
|
): Promise<void> {
|
|
901
|
-
log.silly('Contact', 'ready() @ %s with id="%s"', this.wechaty.puppet, this.id)
|
|
897
|
+
this.log.silly('Contact', 'ready() @ %s with id="%s"', this.wechaty.puppet, this.id)
|
|
902
898
|
|
|
903
899
|
if (!forceSync && this.isReady()) { // already ready
|
|
904
|
-
log.silly('Contact', 'ready() isReady() true')
|
|
900
|
+
this.log.silly('Contact', 'ready() isReady() true')
|
|
905
901
|
return
|
|
906
902
|
}
|
|
907
903
|
|
|
908
904
|
try {
|
|
909
905
|
this.payload = await this.wechaty.puppet.contactPayload(this.id)
|
|
910
|
-
// log.silly('Contact', `ready() this.wechaty.puppet.contactPayload(%s) resolved`, this)
|
|
906
|
+
// this.log.silly('Contact', `ready() this.wechaty.puppet.contactPayload(%s) resolved`, this)
|
|
911
907
|
|
|
912
908
|
} catch (e) {
|
|
913
909
|
this.wechaty.emitError(e)
|
|
914
|
-
log.verbose('Contact', 'ready() this.wechaty.puppet.contactPayload(%s) exception: %s',
|
|
910
|
+
this.log.verbose('Contact', 'ready() this.wechaty.puppet.contactPayload(%s) exception: %s',
|
|
915
911
|
this.id,
|
|
916
912
|
(e as Error).message,
|
|
917
913
|
)
|
|
@@ -941,7 +937,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
941
937
|
}
|
|
942
938
|
} catch (e) {
|
|
943
939
|
this.wechaty.emitError(e)
|
|
944
|
-
log.error('Contact', 'readMark() exception: %s', (e as Error).message)
|
|
940
|
+
this.log.error('Contact', 'readMark() exception: %s', (e as Error).message)
|
|
945
941
|
}
|
|
946
942
|
}
|
|
947
943
|
|
|
@@ -950,7 +946,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
950
946
|
await this.wechaty.puppet.endConversation(this.id)
|
|
951
947
|
} catch (e) {
|
|
952
948
|
this.wechaty.emitError(e)
|
|
953
|
-
log.error('Contact', 'endConversation() exception: %s', (e as Error).message)
|
|
949
|
+
this.log.error('Contact', 'endConversation() exception: %s', (e as Error).message)
|
|
954
950
|
}
|
|
955
951
|
}
|
|
956
952
|
|
|
@@ -994,7 +990,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
994
990
|
* @deprecated use `handle()` instead
|
|
995
991
|
*/
|
|
996
992
|
weixin (): undefined | string {
|
|
997
|
-
// log.warn('Contact', 'weixin() is deprecated, use `handle()` instead.')
|
|
993
|
+
// this.log.warn('Contact', 'weixin() is deprecated, use `handle()` instead.')
|
|
998
994
|
// console.error(new Error().stack)
|
|
999
995
|
return this.payload?.weixin
|
|
1000
996
|
}
|
|
@@ -1005,7 +1001,7 @@ class ContactMixin extends MixinBase implements SayableSayer {
|
|
|
1005
1001
|
try {
|
|
1006
1002
|
additionalInfoObj = JSON.parse(this.payload.additionalInfo)
|
|
1007
1003
|
} catch (e) {
|
|
1008
|
-
log.warn('Contact', 'additionalInfo() parse failed, additionalInfo: %s', this.payload.additionalInfo)
|
|
1004
|
+
this.log.warn('Contact', 'additionalInfo() parse failed, additionalInfo: %s', this.payload.additionalInfo)
|
|
1009
1005
|
}
|
|
1010
1006
|
}
|
|
1011
1007
|
return additionalInfoObj
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Constructor } from 'clone-class'
|
|
2
|
-
import { log } from '../config.js'
|
|
3
2
|
|
|
4
3
|
import { validationMixin } from '../user-mixins/validation.js'
|
|
5
4
|
|
|
@@ -15,7 +14,7 @@ class DouyinOneClickPhoneCollectionMixin extends wechatifyMixinBase() {
|
|
|
15
14
|
*
|
|
16
15
|
*/
|
|
17
16
|
static async create (): Promise<DouyinOneClickPhoneCollectionInterface> {
|
|
18
|
-
log.verbose('DouyinOneClickPhoneCollection', 'create()')
|
|
17
|
+
this.log.verbose('DouyinOneClickPhoneCollection', 'create()')
|
|
19
18
|
|
|
20
19
|
return new this({})
|
|
21
20
|
}
|
|
@@ -27,7 +26,7 @@ class DouyinOneClickPhoneCollectionMixin extends wechatifyMixinBase() {
|
|
|
27
26
|
public readonly payload: {},
|
|
28
27
|
) {
|
|
29
28
|
super()
|
|
30
|
-
log.verbose('DouyinOneClickPhoneCollection', 'constructor()')
|
|
29
|
+
this.log.verbose('DouyinOneClickPhoneCollection', 'constructor()')
|
|
31
30
|
// Huan(202110): it is ok to create a raw one without wechaty instance
|
|
32
31
|
// guardWechatifyClass.call(this, DouyinOneClickPhoneCollection)
|
|
33
32
|
}
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
|
-
import { log } from '@juzi/wechaty-puppet'
|
|
21
20
|
import type { Constructor } from 'clone-class'
|
|
22
21
|
import { validationMixin } from '../user-mixins/validation.js'
|
|
23
22
|
|
|
@@ -41,7 +40,7 @@ class FavoriteMixin extends wechatifyMixinBase() {
|
|
|
41
40
|
* const tags = await wechaty.Favorite.tags()
|
|
42
41
|
*/
|
|
43
42
|
static async tags (): Promise<TagInterface[]> {
|
|
44
|
-
log.verbose('Favorite', 'static tags() for %s', this)
|
|
43
|
+
this.log.verbose('Favorite', 'static tags() for %s', this)
|
|
45
44
|
|
|
46
45
|
// TODO:
|
|
47
46
|
// try {
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { EventEmitter } from 'events'
|
|
21
21
|
import * as PUPPET from '@juzi/wechaty-puppet'
|
|
22
|
-
import { log } from '@juzi/wechaty-puppet'
|
|
23
22
|
import type { Constructor } from 'clone-class'
|
|
24
23
|
|
|
25
24
|
import {
|
|
@@ -98,7 +97,7 @@ class FriendshipMixin extends MixinBase implements Accepter {
|
|
|
98
97
|
queryFilter : PUPPET.filters.Friendship,
|
|
99
98
|
type?: PUPPET.types.Contact,
|
|
100
99
|
): Promise<undefined | ContactInterface> {
|
|
101
|
-
log.verbose('Friendship', 'static search("%s")',
|
|
100
|
+
this.log.verbose('Friendship', 'static search("%s")',
|
|
102
101
|
JSON.stringify(queryFilter),
|
|
103
102
|
)
|
|
104
103
|
if (typeof (type) === 'undefined') {
|
|
@@ -141,13 +140,13 @@ class FriendshipMixin extends MixinBase implements Accepter {
|
|
|
141
140
|
contact : ContactInterface,
|
|
142
141
|
options : FriendshipAddOptions,
|
|
143
142
|
): Promise<void> {
|
|
144
|
-
log.verbose('Friendship', 'static add(%s, %s)',
|
|
143
|
+
this.log.verbose('Friendship', 'static add(%s, %s)',
|
|
145
144
|
contact.id,
|
|
146
145
|
typeof options === 'string' ? options : options.hello,
|
|
147
146
|
)
|
|
148
147
|
|
|
149
148
|
if (typeof options === 'string') {
|
|
150
|
-
log.warn('Friendship', 'the params hello is deprecated in the next version, please put the attr hello into options object, e.g. { hello: "xxxx" }')
|
|
149
|
+
this.log.warn('Friendship', 'the params hello is deprecated in the next version, please put the attr hello into options object, e.g. { hello: "xxxx" }')
|
|
151
150
|
await this.wechaty.puppet.friendshipAdd(contact.id, { hello: options })
|
|
152
151
|
} else {
|
|
153
152
|
const friendOption: PUPPET.types.FriendshipAddOptions = {
|
|
@@ -162,7 +161,7 @@ class FriendshipMixin extends MixinBase implements Accepter {
|
|
|
162
161
|
static async del (
|
|
163
162
|
contact: ContactInterface,
|
|
164
163
|
): Promise<void> {
|
|
165
|
-
log.verbose('Friendship', 'static del(%s)', contact.id)
|
|
164
|
+
this.log.verbose('Friendship', 'static del(%s)', contact.id)
|
|
166
165
|
throw new Error('to be implemented')
|
|
167
166
|
}
|
|
168
167
|
|
|
@@ -184,7 +183,7 @@ class FriendshipMixin extends MixinBase implements Accepter {
|
|
|
184
183
|
public readonly id: string,
|
|
185
184
|
) {
|
|
186
185
|
super()
|
|
187
|
-
log.verbose('Friendship', 'constructor(id=%s)', id)
|
|
186
|
+
this.log.verbose('Friendship', 'constructor(id=%s)', id)
|
|
188
187
|
}
|
|
189
188
|
|
|
190
189
|
override toString () {
|
|
@@ -254,7 +253,7 @@ class FriendshipMixin extends MixinBase implements Accepter {
|
|
|
254
253
|
* .start()
|
|
255
254
|
*/
|
|
256
255
|
async accept (): Promise<void> {
|
|
257
|
-
log.verbose('Friendship', 'accept()')
|
|
256
|
+
this.log.verbose('Friendship', 'accept()')
|
|
258
257
|
|
|
259
258
|
if (!this.payload) {
|
|
260
259
|
throw new Error('no payload')
|
|
@@ -264,7 +263,7 @@ class FriendshipMixin extends MixinBase implements Accepter {
|
|
|
264
263
|
throw new Error('accept() need type to be FriendshipType.Receive, but it got a ' + FriendshipImpl.Type[this.payload.type])
|
|
265
264
|
}
|
|
266
265
|
|
|
267
|
-
log.silly('Friendship', 'accept() to %s', this.payload.contactId)
|
|
266
|
+
this.log.silly('Friendship', 'accept() to %s', this.payload.contactId)
|
|
268
267
|
|
|
269
268
|
await this.wechaty.puppet.friendshipAccept(this.id)
|
|
270
269
|
|
|
@@ -276,14 +275,14 @@ class FriendshipMixin extends MixinBase implements Accepter {
|
|
|
276
275
|
if (!contact.isReady()) {
|
|
277
276
|
throw new Error('Friendship.accept() contact.ready() not ready')
|
|
278
277
|
}
|
|
279
|
-
log.verbose('Friendship', 'accept() with contact %s ready()', contact.name())
|
|
278
|
+
this.log.verbose('Friendship', 'accept() with contact %s ready()', contact.name())
|
|
280
279
|
}
|
|
281
280
|
|
|
282
281
|
await retryPolicy.execute(doSync)
|
|
283
282
|
|
|
284
283
|
} catch (e) {
|
|
285
284
|
this.wechaty.emitError(e)
|
|
286
|
-
log.warn('Friendship', 'accept() contact %s not ready because of %s', contact, (e && (e as Error).message) || e)
|
|
285
|
+
this.log.warn('Friendship', 'accept() contact %s not ready because of %s', contact, (e && (e as Error).message) || e)
|
|
287
286
|
// console.error(e)
|
|
288
287
|
}
|
|
289
288
|
|
|
@@ -384,7 +383,7 @@ class FriendshipMixin extends MixinBase implements Accepter {
|
|
|
384
383
|
* .start()
|
|
385
384
|
*/
|
|
386
385
|
toJSON (): string {
|
|
387
|
-
log.verbose('Friendship', 'toJSON()')
|
|
386
|
+
this.log.verbose('Friendship', 'toJSON()')
|
|
388
387
|
|
|
389
388
|
if (!this.isReady()) {
|
|
390
389
|
throw new Error(`Friendship<${this.id}> needs to be ready. Please call ready() before toJSON()`)
|
|
@@ -405,7 +404,7 @@ class FriendshipMixin extends MixinBase implements Accepter {
|
|
|
405
404
|
static async fromJSON (
|
|
406
405
|
payload: string | PUPPET.payloads.Friendship,
|
|
407
406
|
): Promise<FriendshipInterface> {
|
|
408
|
-
log.verbose('Friendship', 'static fromJSON(%s)',
|
|
407
|
+
this.log.verbose('Friendship', 'static fromJSON(%s)',
|
|
409
408
|
typeof payload === 'string'
|
|
410
409
|
? payload
|
|
411
410
|
: JSON.stringify(payload),
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { log } from '@juzi/wechaty-puppet'
|
|
2
1
|
import type { Constructor } from 'clone-class'
|
|
3
2
|
|
|
4
3
|
import { validationMixin } from '../user-mixins/validation.js'
|
|
@@ -36,7 +35,7 @@ class ImSpecificMixin extends wechatifyMixinBase() {
|
|
|
36
35
|
*/
|
|
37
36
|
constructor () {
|
|
38
37
|
super()
|
|
39
|
-
log.verbose('ImSpecific', 'constructor()')
|
|
38
|
+
this.log.verbose('ImSpecific', 'constructor()')
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
}
|
|
@@ -23,7 +23,6 @@ import type {
|
|
|
23
23
|
} from 'file-box'
|
|
24
24
|
import type { Constructor } from 'clone-class'
|
|
25
25
|
import { validationMixin } from '../user-mixins/validation.js'
|
|
26
|
-
import { log } from '../config.js'
|
|
27
26
|
|
|
28
27
|
import {
|
|
29
28
|
wechatifyMixinBase,
|
|
@@ -32,7 +31,7 @@ import {
|
|
|
32
31
|
class ImageMixin extends wechatifyMixinBase() {
|
|
33
32
|
|
|
34
33
|
static create (id: string): ImageInterface {
|
|
35
|
-
log.verbose('Image', 'static create(%s)', id)
|
|
34
|
+
this.log.verbose('Image', 'static create(%s)', id)
|
|
36
35
|
|
|
37
36
|
const image = new this(id)
|
|
38
37
|
return image
|
|
@@ -42,11 +41,11 @@ class ImageMixin extends wechatifyMixinBase() {
|
|
|
42
41
|
public id: string,
|
|
43
42
|
) {
|
|
44
43
|
super()
|
|
45
|
-
log.verbose('Image', 'constructor(%s)', id)
|
|
44
|
+
this.log.verbose('Image', 'constructor(%s)', id)
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
async thumbnail (): Promise<FileBoxInterface> {
|
|
49
|
-
log.verbose('Image', 'thumbnail() for id: "%s"', this.id)
|
|
48
|
+
this.log.verbose('Image', 'thumbnail() for id: "%s"', this.id)
|
|
50
49
|
const fileBox = await this.wechaty.puppet.messageImage(
|
|
51
50
|
this.id,
|
|
52
51
|
PUPPET.types.Image.Thumbnail,
|
|
@@ -55,7 +54,7 @@ class ImageMixin extends wechatifyMixinBase() {
|
|
|
55
54
|
}
|
|
56
55
|
|
|
57
56
|
async hd (): Promise<FileBoxInterface> {
|
|
58
|
-
log.verbose('Image', 'hd() for id: "%s"', this.id)
|
|
57
|
+
this.log.verbose('Image', 'hd() for id: "%s"', this.id)
|
|
59
58
|
const fileBox = await this.wechaty.puppet.messageImage(
|
|
60
59
|
this.id,
|
|
61
60
|
PUPPET.types.Image.HD,
|
|
@@ -64,7 +63,7 @@ class ImageMixin extends wechatifyMixinBase() {
|
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
async artwork (): Promise<FileBoxInterface> {
|
|
67
|
-
log.verbose('Image', 'artwork() for id: "%s"', this.id)
|
|
66
|
+
this.log.verbose('Image', 'artwork() for id: "%s"', this.id)
|
|
68
67
|
const fileBox = await this.wechaty.puppet.messageImage(
|
|
69
68
|
this.id,
|
|
70
69
|
PUPPET.types.Image.Artwork,
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import type * as PUPPET from '@juzi/wechaty-puppet'
|
|
21
21
|
import type { Constructor } from 'clone-class'
|
|
22
|
-
import { log } from '../config.js'
|
|
23
22
|
|
|
24
23
|
import { validationMixin } from '../user-mixins/validation.js'
|
|
25
24
|
import {
|
|
@@ -35,7 +34,7 @@ class LocationMixin extends wechatifyMixinBase() {
|
|
|
35
34
|
* See: https://en.wikipedia.org/wiki/Point_of_interest
|
|
36
35
|
*/
|
|
37
36
|
static async create (poi: string): Promise<LocationInterface> {
|
|
38
|
-
log.verbose('Location', 'create(%s)', poi)
|
|
37
|
+
this.log.verbose('Location', 'create(%s)', poi)
|
|
39
38
|
|
|
40
39
|
const payload: PUPPET.payloads.Location = {
|
|
41
40
|
accuracy : 15, // in meters
|
|
@@ -55,7 +54,7 @@ class LocationMixin extends wechatifyMixinBase() {
|
|
|
55
54
|
public readonly payload: PUPPET.payloads.Location,
|
|
56
55
|
) {
|
|
57
56
|
super()
|
|
58
|
-
log.verbose('Location', 'constructor()')
|
|
57
|
+
this.log.verbose('Location', 'constructor()')
|
|
59
58
|
// Huan(202110): it is ok to create a raw one without wechaty instance
|
|
60
59
|
// guardWechatifyClass.call(this, Location)
|
|
61
60
|
}
|