@juzi/wechaty 1.0.159 → 1.0.161
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 +15 -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.d.ts +16 -34
- package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/puppet-mixin.js +90 -90
- 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 +15 -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.d.ts +16 -34
- package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/puppet-mixin.js +90 -90
- 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.ts +97 -86
- package/src/wechaty-mixins/wechatify-user-module-mixin.ts +4 -4
- package/dist/cjs/src/wechaty-mixins/puppet-mixin-dirty-pool.spec.d.ts +0 -3
- package/dist/cjs/src/wechaty-mixins/puppet-mixin-dirty-pool.spec.d.ts.map +0 -1
- package/dist/cjs/src/wechaty-mixins/puppet-mixin-dirty-pool.spec.js +0 -121
- package/dist/cjs/src/wechaty-mixins/puppet-mixin-dirty-pool.spec.js.map +0 -1
- package/dist/esm/src/wechaty-mixins/puppet-mixin-dirty-pool.spec.d.ts +0 -3
- package/dist/esm/src/wechaty-mixins/puppet-mixin-dirty-pool.spec.d.ts.map +0 -1
- package/dist/esm/src/wechaty-mixins/puppet-mixin-dirty-pool.spec.js +0 -96
- package/dist/esm/src/wechaty-mixins/puppet-mixin-dirty-pool.spec.js.map +0 -1
- package/src/wechaty-mixins/puppet-mixin-dirty-pool.spec.ts +0 -144
|
@@ -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
|
}
|
|
@@ -30,7 +30,6 @@ import { escapeRegExp } from '../pure-functions/escape-regexp.js'
|
|
|
30
30
|
import { timestampToDate } from '../pure-functions/timestamp-to-date.js'
|
|
31
31
|
|
|
32
32
|
import {
|
|
33
|
-
log,
|
|
34
33
|
AT_SEPARATOR_REGEX,
|
|
35
34
|
} from '../config.js'
|
|
36
35
|
import type {
|
|
@@ -157,7 +156,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
157
156
|
static async find (
|
|
158
157
|
query : string | PUPPET.filters.Message,
|
|
159
158
|
): Promise<undefined | MessageInterface> {
|
|
160
|
-
log.verbose('Message', 'find(%s)', JSON.stringify(query))
|
|
159
|
+
this.log.verbose('Message', 'find(%s)', JSON.stringify(query))
|
|
161
160
|
|
|
162
161
|
if (typeof query === 'object' && query.id) {
|
|
163
162
|
const message = this.load(query.id)
|
|
@@ -181,7 +180,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
181
180
|
}
|
|
182
181
|
|
|
183
182
|
if (messageList.length > 1) {
|
|
184
|
-
log.warn('Message', 'findAll() got more than one(%d) result', messageList.length)
|
|
183
|
+
this.log.warn('Message', 'findAll() got more than one(%d) result', messageList.length)
|
|
185
184
|
}
|
|
186
185
|
|
|
187
186
|
return messageList[0]!
|
|
@@ -193,7 +192,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
193
192
|
static async findAll (
|
|
194
193
|
query? : PUPPET.filters.Message,
|
|
195
194
|
): Promise<MessageInterface[]> {
|
|
196
|
-
log.verbose('Message', 'findAll(%s)', JSON.stringify(query) || '')
|
|
195
|
+
this.log.verbose('Message', 'findAll(%s)', JSON.stringify(query) || '')
|
|
197
196
|
|
|
198
197
|
// Huan(202111): { id } query has been optimized in the PuppetAbstract class
|
|
199
198
|
|
|
@@ -206,7 +205,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
206
205
|
messageList.map(
|
|
207
206
|
message => message.ready()
|
|
208
207
|
.catch(e => {
|
|
209
|
-
log.warn('Room', 'findAll() message.ready() rejection: %s', e)
|
|
208
|
+
this.log.warn('Room', 'findAll() message.ready() rejection: %s', e)
|
|
210
209
|
invalidDict[message.id] = true
|
|
211
210
|
}),
|
|
212
211
|
),
|
|
@@ -216,7 +215,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
216
215
|
|
|
217
216
|
} catch (e) {
|
|
218
217
|
this.wechaty.emitError(e)
|
|
219
|
-
log.warn('Message', 'findAll() rejected: %s', (e as Error).message)
|
|
218
|
+
this.log.warn('Message', 'findAll() rejected: %s', (e as Error).message)
|
|
220
219
|
return [] // fail safe
|
|
221
220
|
}
|
|
222
221
|
}
|
|
@@ -228,7 +227,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
228
227
|
* https://www.tatango.com/resources/video-lessons/video-mo-mt-sms-messaging/
|
|
229
228
|
*/
|
|
230
229
|
static load (id: string): MessageImplInterface {
|
|
231
|
-
log.verbose('Message', 'static load(%s)', id)
|
|
230
|
+
this.log.verbose('Message', 'static load(%s)', id)
|
|
232
231
|
|
|
233
232
|
/**
|
|
234
233
|
* Must NOT use `Message` at here
|
|
@@ -242,7 +241,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
242
241
|
}
|
|
243
242
|
|
|
244
243
|
static async getBroadcastTargets (): Promise<{ contacts: ContactInterface[]; rooms: RoomInterface[] }> {
|
|
245
|
-
log.verbose('Message', 'static getBroadcastTargets()')
|
|
244
|
+
this.log.verbose('Message', 'static getBroadcastTargets()')
|
|
246
245
|
|
|
247
246
|
const { contactIds = [], roomIds = [] } = await this.wechaty.puppet.getMessageBroadcastTarget()
|
|
248
247
|
|
|
@@ -319,7 +318,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
319
318
|
}
|
|
320
319
|
|
|
321
320
|
static async createBroadcast (targets: (ContactInterface | RoomInterface)[], post: PostInterface): Promise<PostInterface | void> {
|
|
322
|
-
log.verbose('Message', 'static createBroadcast()')
|
|
321
|
+
this.log.verbose('Message', 'static createBroadcast()')
|
|
323
322
|
|
|
324
323
|
const targetIds = targets.map(target => target.id)
|
|
325
324
|
const type = post.payload.type || PUPPET.types.Post.Unspecified
|
|
@@ -336,7 +335,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
336
335
|
}
|
|
337
336
|
|
|
338
337
|
static async batchSendMessage (targets: (ContactInterface | RoomInterface)[], post: PostInterface, sendBatchId: string): Promise<BatchSendMessageResult[]> {
|
|
339
|
-
log.verbose('Message', 'static batchSendMessage()')
|
|
338
|
+
this.log.verbose('Message', 'static batchSendMessage()')
|
|
340
339
|
|
|
341
340
|
const targetIds = targets.map(target => target.id)
|
|
342
341
|
|
|
@@ -452,7 +451,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
452
451
|
status: PUPPET.types.BroadcastTargetStatus,
|
|
453
452
|
}[]
|
|
454
453
|
}> {
|
|
455
|
-
log.verbose('Message', 'static getBroadcastStatus()')
|
|
454
|
+
this.log.verbose('Message', 'static getBroadcastStatus()')
|
|
456
455
|
|
|
457
456
|
const postId = broadcast.id
|
|
458
457
|
if (!postId) {
|
|
@@ -522,7 +521,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
522
521
|
}
|
|
523
522
|
|
|
524
523
|
static async mergeForward (to: ContactInterface | RoomInterface, messageList: MessageInterface[]): Promise<void | MessageInterface> {
|
|
525
|
-
log.verbose('Message', `mergeForward(${messageList})`)
|
|
524
|
+
this.log.verbose('Message', `mergeForward(${messageList})`)
|
|
526
525
|
try {
|
|
527
526
|
const msgId = await this.wechaty.puppet.messageForward(
|
|
528
527
|
to.id,
|
|
@@ -533,7 +532,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
533
532
|
return msg
|
|
534
533
|
}
|
|
535
534
|
} catch (e) {
|
|
536
|
-
log.error('Message', 'forward(%s) exception: %s', to, e)
|
|
535
|
+
this.log.error('Message', 'forward(%s) exception: %s', to, e)
|
|
537
536
|
throw e
|
|
538
537
|
}
|
|
539
538
|
}
|
|
@@ -553,7 +552,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
553
552
|
public readonly id: string,
|
|
554
553
|
) {
|
|
555
554
|
super()
|
|
556
|
-
log.verbose('Message', 'constructor(%s) for class %s',
|
|
555
|
+
this.log.verbose('Message', 'constructor(%s) for class %s',
|
|
557
556
|
id || '',
|
|
558
557
|
this.constructor.name,
|
|
559
558
|
)
|
|
@@ -591,7 +590,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
591
590
|
) {
|
|
592
591
|
msgStrList.push(`\t${this.text().substr(0, 70)}`)
|
|
593
592
|
} else {
|
|
594
|
-
log.silly('Message', 'toString() for message type: %s(%s)', PUPPET.types.Message[this.type()], this.type())
|
|
593
|
+
this.log.silly('Message', 'toString() for message type: %s(%s)', PUPPET.types.Message[this.type()], this.type())
|
|
595
594
|
// if (!this.#payload) {
|
|
596
595
|
// throw new Error('no payload')
|
|
597
596
|
// }
|
|
@@ -643,7 +642,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
643
642
|
throw new Error('no talkerId found for talker')
|
|
644
643
|
}
|
|
645
644
|
|
|
646
|
-
log.warn('Message', 'talker() payload.talkerId not exist! See: https://github.com/wechaty/puppet/issues/187')
|
|
645
|
+
this.log.warn('Message', 'talker() payload.talkerId not exist! See: https://github.com/wechaty/puppet/issues/187')
|
|
647
646
|
console.error('Puppet: %s@%s', this.wechaty.puppet.name(), this.wechaty.puppet.version())
|
|
648
647
|
console.error(new Error().stack)
|
|
649
648
|
}
|
|
@@ -662,7 +661,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
662
661
|
* https://github.com/wechaty/wechaty/issues/2094
|
|
663
662
|
*/
|
|
664
663
|
from (): undefined | ContactInterface {
|
|
665
|
-
log.warn('Message', 'from() is deprecated, use talker() instead. Call stack: %s',
|
|
664
|
+
this.log.warn('Message', 'from() is deprecated, use talker() instead. Call stack: %s',
|
|
666
665
|
new Error().stack,
|
|
667
666
|
)
|
|
668
667
|
try {
|
|
@@ -704,7 +703,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
704
703
|
*/
|
|
705
704
|
listenerId = this.payload.toId
|
|
706
705
|
|
|
707
|
-
log.warn('Message', 'listener() payload.listenerId should be set! See: https://github.com/wechaty/puppet/issues/187')
|
|
706
|
+
this.log.warn('Message', 'listener() payload.listenerId should be set! See: https://github.com/wechaty/puppet/issues/187')
|
|
708
707
|
console.error('Puppet: %s@%s', this.wechaty.puppet.name(), this.wechaty.puppet.version())
|
|
709
708
|
console.error(new Error().stack)
|
|
710
709
|
}
|
|
@@ -784,7 +783,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
784
783
|
const oldText = this.payload.text || ''
|
|
785
784
|
const newText = (this.payload.textContent || []).map(item => item.text).join('')
|
|
786
785
|
if (newText && oldText !== newText) {
|
|
787
|
-
log.warn('Message', `got different text, old: ${oldText}, new: ${newText}`)
|
|
786
|
+
this.log.warn('Message', `got different text, old: ${oldText}, new: ${newText}`)
|
|
788
787
|
}
|
|
789
788
|
|
|
790
789
|
// still use old text before we deprecate old text field
|
|
@@ -821,7 +820,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
821
820
|
|
|
822
821
|
} catch (e) {
|
|
823
822
|
this.wechaty.emitError(e)
|
|
824
|
-
log.verbose(`Can not retrieve the recalled message with id ${originalMessageId}.`)
|
|
823
|
+
this.log.verbose(`Can not retrieve the recalled message with id ${originalMessageId}.`)
|
|
825
824
|
}
|
|
826
825
|
return undefined
|
|
827
826
|
}
|
|
@@ -918,7 +917,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
918
917
|
async say (
|
|
919
918
|
sayable: Sayable,
|
|
920
919
|
): Promise<void | MessageInterface> {
|
|
921
|
-
log.verbose('Message', 'say(%s)', sayable)
|
|
920
|
+
this.log.verbose('Message', 'say(%s)', sayable)
|
|
922
921
|
|
|
923
922
|
const talker = this.talker()
|
|
924
923
|
const room = this.room()
|
|
@@ -939,7 +938,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
939
938
|
text: string,
|
|
940
939
|
mentionList?: ContactInterface[],
|
|
941
940
|
): Promise<void | MessageInterface> {
|
|
942
|
-
log.verbose('Message', 'say(%s)', text)
|
|
941
|
+
this.log.verbose('Message', 'say(%s)', text)
|
|
943
942
|
|
|
944
943
|
const talker = this.talker()
|
|
945
944
|
const room = this.room()
|
|
@@ -973,7 +972,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
973
972
|
*/
|
|
974
973
|
|
|
975
974
|
async recall (): Promise<boolean> {
|
|
976
|
-
log.verbose('Message', 'recall()')
|
|
975
|
+
this.log.verbose('Message', 'recall()')
|
|
977
976
|
const isSuccess = await this.wechaty.puppet.messageRecall(this.id)
|
|
978
977
|
return isSuccess
|
|
979
978
|
}
|
|
@@ -1021,7 +1020,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1021
1020
|
return talker.id === this.wechaty.puppet.currentUserId
|
|
1022
1021
|
} catch (e) {
|
|
1023
1022
|
this.wechaty.emitError(e)
|
|
1024
|
-
log.error('Message', 'self() rejection: %s', (e as Error).message)
|
|
1023
|
+
this.log.error('Message', 'self() rejection: %s', (e as Error).message)
|
|
1025
1024
|
return false
|
|
1026
1025
|
}
|
|
1027
1026
|
}
|
|
@@ -1046,7 +1045,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1046
1045
|
* console.log(contactList)
|
|
1047
1046
|
*/
|
|
1048
1047
|
async mentionList (): Promise<ContactInterface[]> {
|
|
1049
|
-
log.verbose('Message', 'mentionList()')
|
|
1048
|
+
this.log.verbose('Message', 'mentionList()')
|
|
1050
1049
|
|
|
1051
1050
|
const room = this.room()
|
|
1052
1051
|
if (this.type() !== PUPPET.types.Message.Text || !room) {
|
|
@@ -1105,7 +1104,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1105
1104
|
// filter blank string
|
|
1106
1105
|
mentionNameList = mentionNameList.filter(s => !!s)
|
|
1107
1106
|
|
|
1108
|
-
log.verbose('Message', 'mentionList() text = "%s", mentionNameList = "%s"',
|
|
1107
|
+
this.log.verbose('Message', 'mentionList() text = "%s", mentionNameList = "%s"',
|
|
1109
1108
|
this.text(),
|
|
1110
1109
|
JSON.stringify(mentionNameList),
|
|
1111
1110
|
)
|
|
@@ -1120,13 +1119,13 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1120
1119
|
contactList = contactList.concat.apply([], contactListNested)
|
|
1121
1120
|
|
|
1122
1121
|
if (contactList.length === 0) {
|
|
1123
|
-
log.silly('Message', `message.mentionList() can not found member using room.member() from mentionList, mention string: ${JSON.stringify(mentionNameList)}`)
|
|
1122
|
+
this.log.silly('Message', `message.mentionList() can not found member using room.member() from mentionList, mention string: ${JSON.stringify(mentionNameList)}`)
|
|
1124
1123
|
}
|
|
1125
1124
|
return contactList
|
|
1126
1125
|
}
|
|
1127
1126
|
|
|
1128
1127
|
isMentionAll (): boolean {
|
|
1129
|
-
log.verbose('Message', 'isMentionAll()')
|
|
1128
|
+
this.log.verbose('Message', 'isMentionAll()')
|
|
1130
1129
|
|
|
1131
1130
|
const room = this.room()
|
|
1132
1131
|
if (this.type() !== PUPPET.types.Message.Text || !room) {
|
|
@@ -1147,7 +1146,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1147
1146
|
* @deprecated mention() DEPRECATED. use mentionList() instead.
|
|
1148
1147
|
*/
|
|
1149
1148
|
async mention (): Promise<ContactInterface[]> {
|
|
1150
|
-
log.warn('Message', 'mention() DEPRECATED. use mentionList() instead. Call stack: %s',
|
|
1149
|
+
this.log.warn('Message', 'mention() DEPRECATED. use mentionList() instead. Call stack: %s',
|
|
1151
1150
|
new Error().stack,
|
|
1152
1151
|
)
|
|
1153
1152
|
return this.mentionList()
|
|
@@ -1172,7 +1171,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1172
1171
|
case PUPPET.types.TextContentType.At:
|
|
1173
1172
|
return ''
|
|
1174
1173
|
default:
|
|
1175
|
-
log.warn(`got unknown type ${type} in text content`)
|
|
1174
|
+
this.log.warn(`got unknown type ${type} in text content`)
|
|
1176
1175
|
return ''
|
|
1177
1176
|
}
|
|
1178
1177
|
}).join('')
|
|
@@ -1230,7 +1229,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1230
1229
|
* @ignore
|
|
1231
1230
|
*/
|
|
1232
1231
|
async ready (forceSync = false): Promise<void> {
|
|
1233
|
-
log.verbose('Message', 'ready()')
|
|
1232
|
+
this.log.verbose('Message', 'ready()')
|
|
1234
1233
|
|
|
1235
1234
|
if (this.isReady() && !forceSync) {
|
|
1236
1235
|
return
|
|
@@ -1249,7 +1248,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1249
1248
|
throw new Error('no talkerId found for talker')
|
|
1250
1249
|
}
|
|
1251
1250
|
|
|
1252
|
-
log.warn('Message', 'ready() payload.talkerId not exist! See: https://github.com/wechaty/puppet/issues/187')
|
|
1251
|
+
this.log.warn('Message', 'ready() payload.talkerId not exist! See: https://github.com/wechaty/puppet/issues/187')
|
|
1253
1252
|
console.error('Puppet: %s@%s', this.wechaty.puppet.name(), this.wechaty.puppet.version())
|
|
1254
1253
|
console.error(new Error().stack)
|
|
1255
1254
|
}
|
|
@@ -1263,7 +1262,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1263
1262
|
*/
|
|
1264
1263
|
listenerId = this.payload.toId
|
|
1265
1264
|
|
|
1266
|
-
log.warn('Message', 'ready() payload.listenerId should be set! See: https://github.com/wechaty/puppet/issues/187')
|
|
1265
|
+
this.log.warn('Message', 'ready() payload.listenerId should be set! See: https://github.com/wechaty/puppet/issues/187')
|
|
1267
1266
|
console.error('Puppet: %s@%s', this.wechaty.puppet.name(), this.wechaty.puppet.version())
|
|
1268
1267
|
console.error(new Error().stack)
|
|
1269
1268
|
}
|
|
@@ -1303,7 +1302,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1303
1302
|
|
|
1304
1303
|
// default:
|
|
1305
1304
|
// const e = new Error('ready() unsupported typeApp(): ' + this.typeApp())
|
|
1306
|
-
// log.warn('PuppeteerMessage', e.message)
|
|
1305
|
+
// this.log.warn('PuppeteerMessage', e.message)
|
|
1307
1306
|
// throw e
|
|
1308
1307
|
// }
|
|
1309
1308
|
// break
|
|
@@ -1333,7 +1332,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1333
1332
|
* .start()
|
|
1334
1333
|
*/
|
|
1335
1334
|
async forward (to: RoomInterface | ContactInterface): Promise<void | MessageInterface> {
|
|
1336
|
-
log.verbose('Message', 'forward(%s)', to)
|
|
1335
|
+
this.log.verbose('Message', 'forward(%s)', to)
|
|
1337
1336
|
|
|
1338
1337
|
// let roomId
|
|
1339
1338
|
// let contactId
|
|
@@ -1348,7 +1347,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1348
1347
|
return msg
|
|
1349
1348
|
}
|
|
1350
1349
|
} catch (e) {
|
|
1351
|
-
log.error('Message', 'forward(%s) exception: %s', to, e)
|
|
1350
|
+
this.log.error('Message', 'forward(%s) exception: %s', to, e)
|
|
1352
1351
|
throw e
|
|
1353
1352
|
}
|
|
1354
1353
|
}
|
|
@@ -1393,7 +1392,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1393
1392
|
* fileBox.toFile(fileName)
|
|
1394
1393
|
*/
|
|
1395
1394
|
async toFileBox (): Promise<FileBoxInterface> {
|
|
1396
|
-
log.verbose('Message', 'toFileBox()')
|
|
1395
|
+
this.log.verbose('Message', 'toFileBox()')
|
|
1397
1396
|
if (this.type() === PUPPET.types.Message.Text) {
|
|
1398
1397
|
throw new Error('text message no file')
|
|
1399
1398
|
}
|
|
@@ -1415,7 +1414,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1415
1414
|
* fileBox.toFile(fileName)
|
|
1416
1415
|
*/
|
|
1417
1416
|
toImage (): ImageInterface {
|
|
1418
|
-
log.verbose('Message', 'toImage() for message id: %s', this.id)
|
|
1417
|
+
this.log.verbose('Message', 'toImage() for message id: %s', this.id)
|
|
1419
1418
|
if (this.type() !== PUPPET.types.Message.Image) {
|
|
1420
1419
|
throw new Error(`not a image type message. type: ${this.type()}`)
|
|
1421
1420
|
}
|
|
@@ -1436,7 +1435,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1436
1435
|
* const { text, noSpeech } = await voice.text()
|
|
1437
1436
|
*/
|
|
1438
1437
|
toVoice (): VoiceInterface {
|
|
1439
|
-
log.verbose('Message', 'toVoice() for message id: %s', this.id)
|
|
1438
|
+
this.log.verbose('Message', 'toVoice() for message id: %s', this.id)
|
|
1440
1439
|
if (this.type() !== PUPPET.types.Message.Audio) {
|
|
1441
1440
|
throw new Error(`not a voice type message. type: ${this.type()}`)
|
|
1442
1441
|
}
|
|
@@ -1444,7 +1443,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1444
1443
|
}
|
|
1445
1444
|
|
|
1446
1445
|
async toPreview (): Promise<FileBoxInterface | undefined> {
|
|
1447
|
-
log.verbose('Message', 'toPreview() for message id: %s', this.id)
|
|
1446
|
+
this.log.verbose('Message', 'toPreview() for message id: %s', this.id)
|
|
1448
1447
|
if (!ALLOW_PREVIEW_TYPES.some(e => e === this.type())) {
|
|
1449
1448
|
throw new Error(`cannot get preview for this type. type: ${this.type}`)
|
|
1450
1449
|
}
|
|
@@ -1460,7 +1459,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1460
1459
|
* @returns {Promise<ContactInterface>}
|
|
1461
1460
|
*/
|
|
1462
1461
|
async toContact (): Promise<ContactInterface> {
|
|
1463
|
-
log.verbose('Message', 'toContact()')
|
|
1462
|
+
this.log.verbose('Message', 'toContact()')
|
|
1464
1463
|
|
|
1465
1464
|
if (this.type() !== PUPPET.types.Message.Contact) {
|
|
1466
1465
|
throw new Error('message not a ShareCard')
|
|
@@ -1481,7 +1480,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1481
1480
|
}
|
|
1482
1481
|
|
|
1483
1482
|
async toUrlLink (): Promise<UrlLinkInterface> {
|
|
1484
|
-
log.verbose('Message', 'toUrlLink()')
|
|
1483
|
+
this.log.verbose('Message', 'toUrlLink()')
|
|
1485
1484
|
|
|
1486
1485
|
if (!this.payload) {
|
|
1487
1486
|
throw new Error('no payload')
|
|
@@ -1497,7 +1496,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1497
1496
|
}
|
|
1498
1497
|
|
|
1499
1498
|
async toMiniProgram (): Promise<MiniProgramInterface> {
|
|
1500
|
-
log.verbose('Message', 'toMiniProgram()')
|
|
1499
|
+
this.log.verbose('Message', 'toMiniProgram()')
|
|
1501
1500
|
|
|
1502
1501
|
if (!this.payload) {
|
|
1503
1502
|
throw new Error('no payload')
|
|
@@ -1513,7 +1512,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1513
1512
|
}
|
|
1514
1513
|
|
|
1515
1514
|
async toLocation (): Promise<LocationInterface> {
|
|
1516
|
-
log.verbose('Message', 'toLocation()')
|
|
1515
|
+
this.log.verbose('Message', 'toLocation()')
|
|
1517
1516
|
|
|
1518
1517
|
if (!this.payload) {
|
|
1519
1518
|
throw new Error('no payload')
|
|
@@ -1529,7 +1528,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1529
1528
|
}
|
|
1530
1529
|
|
|
1531
1530
|
public async toPost (): Promise<PostInterface> {
|
|
1532
|
-
log.verbose('Message', 'toPost()')
|
|
1531
|
+
this.log.verbose('Message', 'toPost()')
|
|
1533
1532
|
|
|
1534
1533
|
if (!this.payload) {
|
|
1535
1534
|
throw new Error('no payload')
|
|
@@ -1545,7 +1544,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1545
1544
|
}
|
|
1546
1545
|
|
|
1547
1546
|
public async toChannel (): Promise<ChannelInterface> {
|
|
1548
|
-
log.verbose('Message', 'toChannel()')
|
|
1547
|
+
this.log.verbose('Message', 'toChannel()')
|
|
1549
1548
|
|
|
1550
1549
|
if (!this.payload) {
|
|
1551
1550
|
throw new Error('no payload')
|
|
@@ -1560,7 +1559,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1560
1559
|
}
|
|
1561
1560
|
|
|
1562
1561
|
public async toChannelCard (): Promise<ChannelCardInterface> {
|
|
1563
|
-
log.verbose('Message', 'toChannelCard()')
|
|
1562
|
+
this.log.verbose('Message', 'toChannelCard()')
|
|
1564
1563
|
|
|
1565
1564
|
if (!this.payload) {
|
|
1566
1565
|
throw new Error('no payload')
|
|
@@ -1575,7 +1574,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1575
1574
|
}
|
|
1576
1575
|
|
|
1577
1576
|
public async toConsultCard (): Promise<ConsultCardInterface> {
|
|
1578
|
-
log.verbose('Message', 'toConsultCard()')
|
|
1577
|
+
this.log.verbose('Message', 'toConsultCard()')
|
|
1579
1578
|
|
|
1580
1579
|
if (!this.payload) {
|
|
1581
1580
|
throw new Error('no payload')
|
|
@@ -1590,7 +1589,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1590
1589
|
}
|
|
1591
1590
|
|
|
1592
1591
|
public async toPremiumOnlineAppointmentCard (): Promise<PremiumOnlineAppointmentCardInterface> {
|
|
1593
|
-
log.verbose('Message', 'toPremiumOnlineAppointmentCard()')
|
|
1592
|
+
this.log.verbose('Message', 'toPremiumOnlineAppointmentCard()')
|
|
1594
1593
|
|
|
1595
1594
|
if (!this.payload) {
|
|
1596
1595
|
throw new Error('no payload')
|
|
@@ -1605,7 +1604,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1605
1604
|
}
|
|
1606
1605
|
|
|
1607
1606
|
public async toCallRecord (): Promise<CallRecordInterface> {
|
|
1608
|
-
log.verbose('Message', 'toCallRecord()')
|
|
1607
|
+
this.log.verbose('Message', 'toCallRecord()')
|
|
1609
1608
|
|
|
1610
1609
|
if (!this.payload) {
|
|
1611
1610
|
throw new Error('no payload')
|
|
@@ -1620,7 +1619,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1620
1619
|
}
|
|
1621
1620
|
|
|
1622
1621
|
public async toChatHistory (): Promise<ChatHistoryInterface> {
|
|
1623
|
-
log.verbose('Message', 'toChatHistory()')
|
|
1622
|
+
this.log.verbose('Message', 'toChatHistory()')
|
|
1624
1623
|
|
|
1625
1624
|
if (!this.payload) {
|
|
1626
1625
|
throw new Error('no payload')
|
|
@@ -1635,7 +1634,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1635
1634
|
}
|
|
1636
1635
|
|
|
1637
1636
|
public async toWxxdProduct (): Promise<WxxdProductInterface> {
|
|
1638
|
-
log.verbose('Message', 'toWxxdProduct()')
|
|
1637
|
+
this.log.verbose('Message', 'toWxxdProduct()')
|
|
1639
1638
|
|
|
1640
1639
|
if (!this.payload) {
|
|
1641
1640
|
throw new Error('no payload')
|
|
@@ -1652,7 +1651,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1652
1651
|
}
|
|
1653
1652
|
|
|
1654
1653
|
public async toWxxdOrder (): Promise<WxxdOrderInterface> {
|
|
1655
|
-
log.verbose('Message', 'toWxxdOrder()')
|
|
1654
|
+
this.log.verbose('Message', 'toWxxdOrder()')
|
|
1656
1655
|
|
|
1657
1656
|
if (!this.payload) {
|
|
1658
1657
|
throw new Error('no payload')
|
|
@@ -1669,12 +1668,12 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1669
1668
|
}
|
|
1670
1669
|
|
|
1671
1670
|
async toSayable (): Promise<undefined | Sayable> {
|
|
1672
|
-
log.verbose('Message', 'toSayable()')
|
|
1671
|
+
this.log.verbose('Message', 'toSayable()')
|
|
1673
1672
|
return messageToSayable(this)
|
|
1674
1673
|
}
|
|
1675
1674
|
|
|
1676
1675
|
async getQuotedMessage (): Promise<undefined | MessageInterface> {
|
|
1677
|
-
log.verbose('Message', 'getQuotedMessage()')
|
|
1676
|
+
this.log.verbose('Message', 'getQuotedMessage()')
|
|
1678
1677
|
if (!this.payload) {
|
|
1679
1678
|
throw new Error('no payload')
|
|
1680
1679
|
}
|
|
@@ -1692,7 +1691,7 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1692
1691
|
try {
|
|
1693
1692
|
additionalInfoObj = JSON.parse(this.payload.additionalInfo)
|
|
1694
1693
|
} catch (e) {
|
|
1695
|
-
log.warn('Message', 'additionalInfo() parse failed, additionalInfo: %s', this.payload.additionalInfo)
|
|
1694
|
+
this.log.warn('Message', 'additionalInfo() parse failed, additionalInfo: %s', this.payload.additionalInfo)
|
|
1696
1695
|
}
|
|
1697
1696
|
}
|
|
1698
1697
|
return additionalInfoObj
|