@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
|
@@ -22,7 +22,6 @@ import type { TagGroupQueryFilter } from '@juzi/wechaty-puppet/dist/esm/src/sche
|
|
|
22
22
|
|
|
23
23
|
import type { Constructor } from 'clone-class'
|
|
24
24
|
import { concurrencyExecuter } from 'rx-queue'
|
|
25
|
-
import { log } from '../config.js'
|
|
26
25
|
import { poolifyMixin } from '../user-mixins/poolify.js'
|
|
27
26
|
|
|
28
27
|
import { validationMixin } from '../user-mixins/validation.js'
|
|
@@ -54,7 +53,7 @@ class TagGroupMixin extends MixinBase {
|
|
|
54
53
|
public readonly id: string,
|
|
55
54
|
) {
|
|
56
55
|
super()
|
|
57
|
-
log.silly('TagGroup', 'constructor()')
|
|
56
|
+
this.log.silly('TagGroup', 'constructor()')
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
name (): string {
|
|
@@ -62,7 +61,7 @@ class TagGroupMixin extends MixinBase {
|
|
|
62
61
|
}
|
|
63
62
|
|
|
64
63
|
static async list (): Promise<TagGroupInterface[]> {
|
|
65
|
-
log.verbose('TagGroup', 'list()')
|
|
64
|
+
this.log.verbose('TagGroup', 'list()')
|
|
66
65
|
|
|
67
66
|
try {
|
|
68
67
|
const tagGroupIds = await this.wechaty.puppet.tagGroupList()
|
|
@@ -103,13 +102,13 @@ class TagGroupMixin extends MixinBase {
|
|
|
103
102
|
|
|
104
103
|
} catch (e) {
|
|
105
104
|
this.wechaty.emitError(e)
|
|
106
|
-
log.error('TagGroup', 'list() exception: %s', (e as Error).message)
|
|
105
|
+
this.log.error('TagGroup', 'list() exception: %s', (e as Error).message)
|
|
107
106
|
return []
|
|
108
107
|
}
|
|
109
108
|
}
|
|
110
109
|
|
|
111
110
|
static async createTagGroup (name: string): Promise<TagGroupInterface | void> {
|
|
112
|
-
log.verbose('TagGroup', 'createTagGroup(%s, %s)', name)
|
|
111
|
+
this.log.verbose('TagGroup', 'createTagGroup(%s, %s)', name)
|
|
113
112
|
|
|
114
113
|
try {
|
|
115
114
|
const groupId = await this.wechaty.puppet.tagGroupAdd(name)
|
|
@@ -119,23 +118,23 @@ class TagGroupMixin extends MixinBase {
|
|
|
119
118
|
}
|
|
120
119
|
} catch (e) {
|
|
121
120
|
this.wechaty.emitError(e)
|
|
122
|
-
log.error('Contact', 'createTag() exception: %s', (e as Error).message)
|
|
121
|
+
this.log.error('Contact', 'createTag() exception: %s', (e as Error).message)
|
|
123
122
|
}
|
|
124
123
|
}
|
|
125
124
|
|
|
126
125
|
static async deleteTagGroup (tagGroup: TagGroupInterface): Promise<TagGroupInterface | void> {
|
|
127
|
-
log.verbose('TagGroup', 'deleteTagGroup(%s)', tagGroup)
|
|
126
|
+
this.log.verbose('TagGroup', 'deleteTagGroup(%s)', tagGroup)
|
|
128
127
|
|
|
129
128
|
try {
|
|
130
129
|
await this.wechaty.puppet.tagGroupDelete(tagGroup.id)
|
|
131
130
|
} catch (e) {
|
|
132
131
|
this.wechaty.emitError(e)
|
|
133
|
-
log.error('TagGroup', 'deleteTagGroup() exception: %s', (e as Error).message)
|
|
132
|
+
this.log.error('TagGroup', 'deleteTagGroup() exception: %s', (e as Error).message)
|
|
134
133
|
}
|
|
135
134
|
}
|
|
136
135
|
|
|
137
136
|
async tags (): Promise<TagInterface[]> {
|
|
138
|
-
log.verbose('TagGroup', 'tags(%s)', this)
|
|
137
|
+
this.log.verbose('TagGroup', 'tags(%s)', this)
|
|
139
138
|
try {
|
|
140
139
|
const tagIdList = await this.wechaty.puppet.tagGroupTagList(this.id)
|
|
141
140
|
|
|
@@ -154,14 +153,14 @@ class TagGroupMixin extends MixinBase {
|
|
|
154
153
|
|
|
155
154
|
} catch (e) {
|
|
156
155
|
this.wechaty.emitError(e)
|
|
157
|
-
log.error('TagGroup', 'list() exception: %s', (e as Error).message)
|
|
156
|
+
this.log.error('TagGroup', 'list() exception: %s', (e as Error).message)
|
|
158
157
|
return []
|
|
159
158
|
}
|
|
160
159
|
|
|
161
160
|
}
|
|
162
161
|
|
|
163
162
|
static async find (filter: TagGroupQueryFilter): Promise<TagGroupInterface | undefined> {
|
|
164
|
-
log.silly('TagGroup', 'find(%s)', JSON.stringify(filter))
|
|
163
|
+
this.log.silly('TagGroup', 'find(%s)', JSON.stringify(filter))
|
|
165
164
|
|
|
166
165
|
if (filter.id) {
|
|
167
166
|
const tagGroup = (this.wechaty.TagGroup as any as typeof TagGroupImpl).load(filter.id)
|
|
@@ -216,10 +215,10 @@ class TagGroupMixin extends MixinBase {
|
|
|
216
215
|
async ready (
|
|
217
216
|
forceSync = false,
|
|
218
217
|
): Promise<void> {
|
|
219
|
-
log.silly('TagGroup', 'ready() @ %s with TagGroup="%s"', this.wechaty.puppet, this.id)
|
|
218
|
+
this.log.silly('TagGroup', 'ready() @ %s with TagGroup="%s"', this.wechaty.puppet, this.id)
|
|
220
219
|
|
|
221
220
|
if (!forceSync && this.isReady()) { // already ready
|
|
222
|
-
log.silly('TagGroup', 'ready() isReady() true')
|
|
221
|
+
this.log.silly('TagGroup', 'ready() isReady() true')
|
|
223
222
|
return
|
|
224
223
|
}
|
|
225
224
|
|
|
@@ -227,7 +226,7 @@ class TagGroupMixin extends MixinBase {
|
|
|
227
226
|
this.payload = await this.wechaty.puppet.tagGroupPayload(this.id)
|
|
228
227
|
} catch (e) {
|
|
229
228
|
this.wechaty.emitError(e)
|
|
230
|
-
log.verbose('TagGroup', 'ready() this.wechaty.puppet.tagGroupPayload(%s) exception: %s',
|
|
229
|
+
this.log.verbose('TagGroup', 'ready() this.wechaty.puppet.tagGroupPayload(%s) exception: %s',
|
|
231
230
|
this.id,
|
|
232
231
|
(e as Error).message,
|
|
233
232
|
)
|
package/src/user-modules/tag.ts
CHANGED
|
@@ -22,7 +22,6 @@ import type { TagQueryFilter } from '@juzi/wechaty-puppet/dist/esm/src/schemas/t
|
|
|
22
22
|
|
|
23
23
|
import type { Constructor } from 'clone-class'
|
|
24
24
|
import { concurrencyExecuter } from 'rx-queue'
|
|
25
|
-
import { log } from '../config.js'
|
|
26
25
|
import { poolifyMixin } from '../user-mixins/poolify.js'
|
|
27
26
|
|
|
28
27
|
import assert from 'assert'
|
|
@@ -56,7 +55,7 @@ class TagMixin extends MixinBase {
|
|
|
56
55
|
public readonly id: string,
|
|
57
56
|
) {
|
|
58
57
|
super()
|
|
59
|
-
log.silly('Tag', 'constructor()')
|
|
58
|
+
this.log.silly('Tag', 'constructor()')
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
type (): PUPPET.types.Tag {
|
|
@@ -76,7 +75,7 @@ class TagMixin extends MixinBase {
|
|
|
76
75
|
}
|
|
77
76
|
|
|
78
77
|
static async list (): Promise<TagInterface[]> {
|
|
79
|
-
log.verbose('Tag', 'list()')
|
|
78
|
+
this.log.verbose('Tag', 'list()')
|
|
80
79
|
|
|
81
80
|
const tagIdList = await this.wechaty.puppet.tagTagList()
|
|
82
81
|
|
|
@@ -116,7 +115,7 @@ class TagMixin extends MixinBase {
|
|
|
116
115
|
}
|
|
117
116
|
|
|
118
117
|
static async find (filter: TagQueryFilter): Promise<TagInterface | undefined> {
|
|
119
|
-
log.silly('Tag', 'find(%s)', JSON.stringify(filter))
|
|
118
|
+
this.log.silly('Tag', 'find(%s)', JSON.stringify(filter))
|
|
120
119
|
|
|
121
120
|
if (filter.id) {
|
|
122
121
|
const tag = (this.wechaty.Tag as any as typeof TagImpl).load(filter.id)
|
|
@@ -142,7 +141,7 @@ class TagMixin extends MixinBase {
|
|
|
142
141
|
}
|
|
143
142
|
|
|
144
143
|
static async findMulti (filters: TagQueryFilter[]): Promise<TagInterface[] | undefined> {
|
|
145
|
-
log.silly('Tag', 'find(%s)', JSON.stringify(filters))
|
|
144
|
+
this.log.silly('Tag', 'find(%s)', JSON.stringify(filters))
|
|
146
145
|
|
|
147
146
|
const filterIdList = filters.filter(i => !!i.id).map(i => i.id)
|
|
148
147
|
const filterNameList = filters.filter(i => !!i.name).map(i => i.name)
|
|
@@ -213,10 +212,10 @@ class TagMixin extends MixinBase {
|
|
|
213
212
|
async ready (
|
|
214
213
|
forceSync = false,
|
|
215
214
|
): Promise<void> {
|
|
216
|
-
log.silly('Tag', 'ready() @ %s with Tag key="%s"', this.wechaty.puppet, this.id)
|
|
215
|
+
this.log.silly('Tag', 'ready() @ %s with Tag key="%s"', this.wechaty.puppet, this.id)
|
|
217
216
|
|
|
218
217
|
if (!forceSync && this.isReady()) { // already ready
|
|
219
|
-
log.silly('Tag', 'ready() isReady() true')
|
|
218
|
+
this.log.silly('Tag', 'ready() isReady() true')
|
|
220
219
|
return
|
|
221
220
|
}
|
|
222
221
|
|
|
@@ -225,7 +224,7 @@ class TagMixin extends MixinBase {
|
|
|
225
224
|
|
|
226
225
|
} catch (e) {
|
|
227
226
|
this.wechaty.emitError(e)
|
|
228
|
-
log.verbose('Tag', 'ready() this.wechaty.puppet.tagPayload(%s) exception: %s',
|
|
227
|
+
this.log.verbose('Tag', 'ready() this.wechaty.puppet.tagPayload(%s) exception: %s',
|
|
229
228
|
this.id,
|
|
230
229
|
(e as Error).message,
|
|
231
230
|
)
|
|
@@ -234,7 +233,7 @@ class TagMixin extends MixinBase {
|
|
|
234
233
|
}
|
|
235
234
|
|
|
236
235
|
async contactList (): Promise<ContactInterface[]> {
|
|
237
|
-
log.verbose('Tag', 'contactList() for tag : %s', this)
|
|
236
|
+
this.log.verbose('Tag', 'contactList() for tag : %s', this)
|
|
238
237
|
|
|
239
238
|
const contactIds = await this.wechaty.puppet.tagTagContactList(this.id)
|
|
240
239
|
const contactPromises = contactIds.map(id => this.wechaty.Contact.find({ id }))
|
|
@@ -242,7 +241,7 @@ class TagMixin extends MixinBase {
|
|
|
242
241
|
}
|
|
243
242
|
|
|
244
243
|
async tag (contacts: ContactInterface | ContactInterface[]): Promise<void> {
|
|
245
|
-
log.verbose('Tag', 'tag(%s) for tag : %s', contacts, this)
|
|
244
|
+
this.log.verbose('Tag', 'tag(%s) for tag : %s', contacts, this)
|
|
246
245
|
|
|
247
246
|
let contactIds: string[]
|
|
248
247
|
if (Array.isArray(contacts)) {
|
|
@@ -254,7 +253,7 @@ class TagMixin extends MixinBase {
|
|
|
254
253
|
}
|
|
255
254
|
|
|
256
255
|
static async createTag (name: string, tagGroup?: TagGroupInterface): Promise<TagInterface | void> {
|
|
257
|
-
log.verbose('Tag', 'createTag(%s, %s)', tagGroup, name)
|
|
256
|
+
this.log.verbose('Tag', 'createTag(%s, %s)', tagGroup, name)
|
|
258
257
|
|
|
259
258
|
try {
|
|
260
259
|
const tagInfoList = await this.wechaty.puppet.tagTagAdd([ name ], tagGroup?.name())
|
|
@@ -267,12 +266,12 @@ class TagMixin extends MixinBase {
|
|
|
267
266
|
}
|
|
268
267
|
} catch (e) {
|
|
269
268
|
this.wechaty.emitError(e)
|
|
270
|
-
log.error('Tag', 'createTag() exception: %s', (e as Error).message)
|
|
269
|
+
this.log.error('Tag', 'createTag() exception: %s', (e as Error).message)
|
|
271
270
|
}
|
|
272
271
|
}
|
|
273
272
|
|
|
274
273
|
static async createMultiTag (nameList: string[], tagGroup?: TagGroupInterface): Promise<TagInterface[] | void> {
|
|
275
|
-
log.verbose('Tag', 'createMultiTag(%s, %s)', tagGroup, nameList)
|
|
274
|
+
this.log.verbose('Tag', 'createMultiTag(%s, %s)', tagGroup, nameList)
|
|
276
275
|
|
|
277
276
|
try {
|
|
278
277
|
const tagInfoList = await this.wechaty.puppet.tagTagAdd(nameList, tagGroup?.name())
|
|
@@ -285,34 +284,34 @@ class TagMixin extends MixinBase {
|
|
|
285
284
|
}
|
|
286
285
|
} catch (e) {
|
|
287
286
|
this.wechaty.emitError(e)
|
|
288
|
-
log.error('Tag', 'createMultiTag() exception: %s', (e as Error).message)
|
|
287
|
+
this.log.error('Tag', 'createMultiTag() exception: %s', (e as Error).message)
|
|
289
288
|
}
|
|
290
289
|
}
|
|
291
290
|
|
|
292
291
|
static async deleteTag (tagInstance: TagInterface): Promise<void> {
|
|
293
|
-
log.verbose('Tag', 'deleteTag(%s, %s)', tagInstance)
|
|
292
|
+
this.log.verbose('Tag', 'deleteTag(%s, %s)', tagInstance)
|
|
294
293
|
|
|
295
294
|
try {
|
|
296
295
|
await this.wechaty.puppet.tagTagDelete([ tagInstance.id ])
|
|
297
296
|
} catch (e) {
|
|
298
297
|
this.wechaty.emitError(e)
|
|
299
|
-
log.error('Tag', 'deleteTag() exception: %s', (e as Error).message)
|
|
298
|
+
this.log.error('Tag', 'deleteTag() exception: %s', (e as Error).message)
|
|
300
299
|
}
|
|
301
300
|
}
|
|
302
301
|
|
|
303
302
|
static async deleteMultiTag (tagInstances: TagInterface[]): Promise<void> {
|
|
304
|
-
log.verbose('Tag', 'deleteMultiTag(%s, %s)', tagInstances)
|
|
303
|
+
this.log.verbose('Tag', 'deleteMultiTag(%s, %s)', tagInstances)
|
|
305
304
|
|
|
306
305
|
try {
|
|
307
306
|
await this.wechaty.puppet.tagTagDelete(tagInstances.map(i => i.id))
|
|
308
307
|
} catch (e) {
|
|
309
308
|
this.wechaty.emitError(e)
|
|
310
|
-
log.error('Tag', 'deleteMultiTag() exception: %s', (e as Error).message)
|
|
309
|
+
this.log.error('Tag', 'deleteMultiTag() exception: %s', (e as Error).message)
|
|
311
310
|
}
|
|
312
311
|
}
|
|
313
312
|
|
|
314
313
|
static async modifyTag (tagInstance: TagInterface, tagNewName: string): Promise<TagInterface | void> {
|
|
315
|
-
log.verbose('Tag', 'modifyTag(%s, %s)', tagInstance)
|
|
314
|
+
this.log.verbose('Tag', 'modifyTag(%s, %s)', tagInstance)
|
|
316
315
|
|
|
317
316
|
try {
|
|
318
317
|
const tagNewInfo: PUPPET.types.TagInfo = {
|
|
@@ -329,14 +328,14 @@ class TagMixin extends MixinBase {
|
|
|
329
328
|
}
|
|
330
329
|
} catch (e) {
|
|
331
330
|
this.wechaty.emitError(e)
|
|
332
|
-
log.error('Tag', 'modifyTag() exception: %s', (e as Error).message)
|
|
331
|
+
this.log.error('Tag', 'modifyTag() exception: %s', (e as Error).message)
|
|
333
332
|
}
|
|
334
333
|
}
|
|
335
334
|
|
|
336
335
|
static async modifyMultiTag (
|
|
337
336
|
tagInfos: Array<{ tag: TagInterface, newName: string }>,
|
|
338
337
|
): Promise<TagInterface[] | void> {
|
|
339
|
-
log.verbose('Tag', 'modifyMultiTag(%o)', tagInfos)
|
|
338
|
+
this.log.verbose('Tag', 'modifyMultiTag(%o)', tagInfos)
|
|
340
339
|
|
|
341
340
|
try {
|
|
342
341
|
const tagNewInfoList: PUPPET.types.TagInfo[] = tagInfos.map(i => ({
|
|
@@ -353,7 +352,7 @@ class TagMixin extends MixinBase {
|
|
|
353
352
|
}
|
|
354
353
|
} catch (e) {
|
|
355
354
|
this.wechaty.emitError(e)
|
|
356
|
-
log.error('Tag', 'modifyMultiTag() exception: %s', (e as Error).message)
|
|
355
|
+
this.log.error('Tag', 'modifyMultiTag() exception: %s', (e as Error).message)
|
|
357
356
|
}
|
|
358
357
|
}
|
|
359
358
|
|
|
@@ -25,7 +25,6 @@ import type { Constructor } from 'clone-class'
|
|
|
25
25
|
import { openGraph } from '../helper-functions/open-graph.js'
|
|
26
26
|
import { validationMixin } from '../user-mixins/validation.js'
|
|
27
27
|
import { wechatifyMixinBase } from '../user-mixins/wechatify.js'
|
|
28
|
-
import { log } from '../config.js'
|
|
29
28
|
import type { FileBoxInterface } from 'file-box'
|
|
30
29
|
|
|
31
30
|
class UrlLinkMixin extends wechatifyMixinBase() {
|
|
@@ -44,7 +43,7 @@ class UrlLinkMixin extends wechatifyMixinBase() {
|
|
|
44
43
|
>
|
|
45
44
|
>,
|
|
46
45
|
): Promise<UrlLinkInterface> {
|
|
47
|
-
log.verbose('UrlLink', 'create(%s)', url)
|
|
46
|
+
this.log.verbose('UrlLink', 'create(%s)', url)
|
|
48
47
|
|
|
49
48
|
const meta = await openGraph(url)
|
|
50
49
|
|
|
@@ -102,7 +101,7 @@ class UrlLinkMixin extends wechatifyMixinBase() {
|
|
|
102
101
|
public readonly payload: PUPPET.payloads.UrlLink,
|
|
103
102
|
) {
|
|
104
103
|
super()
|
|
105
|
-
log.verbose('UrlLink', 'constructor()')
|
|
104
|
+
this.log.verbose('UrlLink', 'constructor()')
|
|
106
105
|
// Huan(202110): it is ok to create a raw one without wechaty instance
|
|
107
106
|
// guardWechatifyClass.call(this, UrlLink)
|
|
108
107
|
}
|
|
@@ -23,7 +23,6 @@ import type {
|
|
|
23
23
|
import type { Constructor } from 'clone-class'
|
|
24
24
|
import type * as PUPPET from '@juzi/wechaty-puppet'
|
|
25
25
|
import { validationMixin } from '../user-mixins/validation.js'
|
|
26
|
-
import { log } from '../config.js'
|
|
27
26
|
|
|
28
27
|
import {
|
|
29
28
|
wechatifyMixinBase,
|
|
@@ -62,7 +61,7 @@ function isUnsupportedError (e: unknown): boolean {
|
|
|
62
61
|
class VoiceMixin extends wechatifyMixinBase() {
|
|
63
62
|
|
|
64
63
|
static create (id: string): VoiceInterface {
|
|
65
|
-
log.verbose('Voice', 'static create(%s)', id)
|
|
64
|
+
this.log.verbose('Voice', 'static create(%s)', id)
|
|
66
65
|
|
|
67
66
|
const voice = new this(id)
|
|
68
67
|
return voice
|
|
@@ -72,7 +71,7 @@ class VoiceMixin extends wechatifyMixinBase() {
|
|
|
72
71
|
public id: string,
|
|
73
72
|
) {
|
|
74
73
|
super()
|
|
75
|
-
log.verbose('Voice', 'constructor(%s)', id)
|
|
74
|
+
this.log.verbose('Voice', 'constructor(%s)', id)
|
|
76
75
|
}
|
|
77
76
|
|
|
78
77
|
/**
|
|
@@ -85,11 +84,11 @@ class VoiceMixin extends wechatifyMixinBase() {
|
|
|
85
84
|
* path. A genuine runtime error from a working `messageVoice` is rethrown.
|
|
86
85
|
*/
|
|
87
86
|
async file (): Promise<FileBoxInterface> {
|
|
88
|
-
log.verbose('Voice', 'file() for id: "%s"', this.id)
|
|
87
|
+
this.log.verbose('Voice', 'file() for id: "%s"', this.id)
|
|
89
88
|
const puppet = this.wechaty.puppet
|
|
90
89
|
// puppet built against an old wechaty-puppet without the method at all
|
|
91
90
|
if (typeof (puppet as { messageVoice?: unknown }).messageVoice !== 'function') {
|
|
92
|
-
log.verbose('Voice', 'file() messageVoice() absent, fallback to messageFile()')
|
|
91
|
+
this.log.verbose('Voice', 'file() messageVoice() absent, fallback to messageFile()')
|
|
93
92
|
return puppet.messageFile(this.id)
|
|
94
93
|
}
|
|
95
94
|
try {
|
|
@@ -99,7 +98,7 @@ class VoiceMixin extends wechatifyMixinBase() {
|
|
|
99
98
|
if (!isUnsupportedError(e)) {
|
|
100
99
|
throw e
|
|
101
100
|
}
|
|
102
|
-
log.verbose('Voice', 'file() messageVoice() unsupported, fallback to messageFile(): %s', (e as Error).message)
|
|
101
|
+
this.log.verbose('Voice', 'file() messageVoice() unsupported, fallback to messageFile(): %s', (e as Error).message)
|
|
103
102
|
const fileBox = await puppet.messageFile(this.id)
|
|
104
103
|
return fileBox
|
|
105
104
|
}
|
|
@@ -119,11 +118,11 @@ class VoiceMixin extends wechatifyMixinBase() {
|
|
|
119
118
|
* does not silently drop `noSpeech` and re-run its own paid ASR).
|
|
120
119
|
*/
|
|
121
120
|
async text (): Promise<PUPPET.payloads.VoiceText> {
|
|
122
|
-
log.verbose('Voice', 'text() for id: "%s"', this.id)
|
|
121
|
+
this.log.verbose('Voice', 'text() for id: "%s"', this.id)
|
|
123
122
|
const puppet = this.wechaty.puppet
|
|
124
123
|
// puppet built against an old wechaty-puppet without the method at all
|
|
125
124
|
if (typeof (puppet as { messageVoiceText?: unknown }).messageVoiceText !== 'function') {
|
|
126
|
-
log.verbose('Voice', 'text() messageVoiceText() absent, fallback to messagePayload().text')
|
|
125
|
+
this.log.verbose('Voice', 'text() messageVoiceText() absent, fallback to messagePayload().text')
|
|
127
126
|
const payload = await puppet.messagePayload(this.id)
|
|
128
127
|
return { text: payload.text || '', noSpeech: false }
|
|
129
128
|
}
|
|
@@ -134,7 +133,7 @@ class VoiceMixin extends wechatifyMixinBase() {
|
|
|
134
133
|
if (!isUnsupportedError(e)) {
|
|
135
134
|
throw e
|
|
136
135
|
}
|
|
137
|
-
log.verbose('Voice', 'text() messageVoiceText() unsupported, fallback to messagePayload().text: %s', (e as Error).message)
|
|
136
|
+
this.log.verbose('Voice', 'text() messageVoiceText() unsupported, fallback to messagePayload().text: %s', (e as Error).message)
|
|
138
137
|
const payload = await puppet.messagePayload(this.id)
|
|
139
138
|
return { text: payload.text || '', noSpeech: false }
|
|
140
139
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { types } from '@juzi/wechaty-puppet'
|
|
2
2
|
import type { Constructor } from 'clone-class'
|
|
3
3
|
|
|
4
4
|
import { validationMixin } from '../user-mixins/validation.js'
|
|
@@ -41,7 +41,7 @@ class WecomMixin extends wechatifyMixinBase() {
|
|
|
41
41
|
const filteredRoomIds = Array.from(rawRoomIdSet).filter(id => !actualRoomIdSet.has(id))
|
|
42
42
|
|
|
43
43
|
if (filteredRoomIds.length) {
|
|
44
|
-
log.warn(`these rooms cannot be applied with anti-spam strategy: ${filteredRoomIds}`)
|
|
44
|
+
this.log.warn(`these rooms cannot be applied with anti-spam strategy: ${filteredRoomIds}`)
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
if (actualRoomIdSet.size) {
|
|
@@ -58,7 +58,7 @@ class WecomMixin extends wechatifyMixinBase() {
|
|
|
58
58
|
*/
|
|
59
59
|
constructor () {
|
|
60
60
|
super()
|
|
61
|
-
log.verbose('Wecom', 'constructor()')
|
|
61
|
+
this.log.verbose('Wecom', 'constructor()')
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
}
|
|
@@ -2,7 +2,6 @@ import type { Constructor } from 'clone-class'
|
|
|
2
2
|
import type { PaginationRequest } from '@juzi/wechaty-puppet/filters'
|
|
3
3
|
import * as PUPPET from '@juzi/wechaty-puppet'
|
|
4
4
|
|
|
5
|
-
import { log } from '../config.js'
|
|
6
5
|
import { poolifyMixin } from '../user-mixins/poolify.js'
|
|
7
6
|
import { validationMixin } from '../user-mixins/validation.js'
|
|
8
7
|
import { wechatifyMixin } from '../user-mixins/wechatify.js'
|
|
@@ -26,14 +25,14 @@ class WxxdOrderMixin extends MixinBase {
|
|
|
26
25
|
public readonly id: string,
|
|
27
26
|
) {
|
|
28
27
|
super()
|
|
29
|
-
log.silly('WxxdOrder', 'constructor(%s)', id)
|
|
28
|
+
this.log.silly('WxxdOrder', 'constructor(%s)', id)
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
/**
|
|
33
32
|
* List all orders
|
|
34
33
|
*/
|
|
35
34
|
static async list (query: PaginationRequest) {
|
|
36
|
-
log.verbose('WxxdOrder', 'list(%s)', JSON.stringify(query))
|
|
35
|
+
this.log.verbose('WxxdOrder', 'list(%s)', JSON.stringify(query))
|
|
37
36
|
|
|
38
37
|
return await this.wechaty.puppet.listWxxdOrders(query)
|
|
39
38
|
}
|
|
@@ -44,7 +43,7 @@ class WxxdOrderMixin extends MixinBase {
|
|
|
44
43
|
static async find (
|
|
45
44
|
query: string | { id: string },
|
|
46
45
|
): Promise<WxxdOrderInterface | undefined> {
|
|
47
|
-
log.verbose('WxxdOrder', 'find(%s)', JSON.stringify(query))
|
|
46
|
+
this.log.verbose('WxxdOrder', 'find(%s)', JSON.stringify(query))
|
|
48
47
|
|
|
49
48
|
const id = typeof query === 'string' ? query : query.id
|
|
50
49
|
|
|
@@ -68,7 +67,7 @@ class WxxdOrderMixin extends MixinBase {
|
|
|
68
67
|
* Send delivery for an order
|
|
69
68
|
*/
|
|
70
69
|
static async deliverySend (orderId: string, deliveryId: string, waybillId: string) {
|
|
71
|
-
log.verbose('WxxdOrder', 'deliverySend(%s, %s, %s)', orderId, deliveryId, waybillId)
|
|
70
|
+
this.log.verbose('WxxdOrder', 'deliverySend(%s, %s, %s)', orderId, deliveryId, waybillId)
|
|
72
71
|
return this.wechaty.puppet.wxxdOrderDeliverySend({ orderId, deliveryId, waybillId })
|
|
73
72
|
}
|
|
74
73
|
|
|
@@ -76,7 +75,7 @@ class WxxdOrderMixin extends MixinBase {
|
|
|
76
75
|
* Generate after sale order
|
|
77
76
|
*/
|
|
78
77
|
static async genAfterSaleOrder (orderId: string, reason: string) {
|
|
79
|
-
log.verbose('WxxdOrder', 'genAfterSaleOrder(%s, %s)', orderId, reason)
|
|
78
|
+
this.log.verbose('WxxdOrder', 'genAfterSaleOrder(%s, %s)', orderId, reason)
|
|
80
79
|
return this.wechaty.puppet.wxxdOrderGenAfterSaleOrder({ orderId, reason })
|
|
81
80
|
}
|
|
82
81
|
|
|
@@ -84,7 +83,7 @@ class WxxdOrderMixin extends MixinBase {
|
|
|
84
83
|
* Update order merchant notes
|
|
85
84
|
*/
|
|
86
85
|
static async updateWxxdMerchantnotes (orderId: string, merchantNotes: string) {
|
|
87
|
-
log.verbose('WxxdOrder', 'updateWxxdMerchantnotes(%s, %s)', orderId, merchantNotes)
|
|
86
|
+
this.log.verbose('WxxdOrder', 'updateWxxdMerchantnotes(%s, %s)', orderId, merchantNotes)
|
|
88
87
|
return this.wechaty.puppet.updateWxxdMerchantnotes(orderId, merchantNotes)
|
|
89
88
|
}
|
|
90
89
|
|
|
@@ -93,10 +92,10 @@ class WxxdOrderMixin extends MixinBase {
|
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
async ready (forceSync = false): Promise<void> {
|
|
96
|
-
log.silly('WxxdOrder', 'ready() @ %s with id="%s"', this.wechaty.puppet, this.id)
|
|
95
|
+
this.log.silly('WxxdOrder', 'ready() @ %s with id="%s"', this.wechaty.puppet, this.id)
|
|
97
96
|
|
|
98
97
|
if (!forceSync && this.isReady()) {
|
|
99
|
-
log.silly('WxxdOrder', 'ready() isReady() true')
|
|
98
|
+
this.log.silly('WxxdOrder', 'ready() isReady() true')
|
|
100
99
|
return
|
|
101
100
|
}
|
|
102
101
|
|
|
@@ -104,7 +103,7 @@ class WxxdOrderMixin extends MixinBase {
|
|
|
104
103
|
this.payload = await this.wechaty.puppet.wxxdOrderPayload(this.id)
|
|
105
104
|
} catch (e) {
|
|
106
105
|
this.wechaty.emitError(e)
|
|
107
|
-
log.verbose('WxxdOrder', 'ready() this.wechaty.puppet.wxxdOrderPayload(%s) exception: %s',
|
|
106
|
+
this.log.verbose('WxxdOrder', 'ready() this.wechaty.puppet.wxxdOrderPayload(%s) exception: %s',
|
|
108
107
|
this.id,
|
|
109
108
|
(e as Error).message,
|
|
110
109
|
)
|
|
@@ -2,7 +2,6 @@ import type { Constructor } from 'clone-class'
|
|
|
2
2
|
import type { PaginationRequest } from '@juzi/wechaty-puppet/filters'
|
|
3
3
|
import * as PUPPET from '@juzi/wechaty-puppet'
|
|
4
4
|
|
|
5
|
-
import { log } from '../config.js'
|
|
6
5
|
import { poolifyMixin } from '../user-mixins/poolify.js'
|
|
7
6
|
import { validationMixin } from '../user-mixins/validation.js'
|
|
8
7
|
import { wechatifyMixin } from '../user-mixins/wechatify.js'
|
|
@@ -26,14 +25,14 @@ class WxxdProductMixin extends MixinBase {
|
|
|
26
25
|
public readonly id: string,
|
|
27
26
|
) {
|
|
28
27
|
super()
|
|
29
|
-
log.silly('WxxdProduct', 'constructor(%s)', id)
|
|
28
|
+
this.log.silly('WxxdProduct', 'constructor(%s)', id)
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
/**
|
|
33
32
|
* List all products
|
|
34
33
|
*/
|
|
35
34
|
static async list (query: PaginationRequest) {
|
|
36
|
-
log.verbose('WxxdProduct', 'list(%s)', JSON.stringify(query))
|
|
35
|
+
this.log.verbose('WxxdProduct', 'list(%s)', JSON.stringify(query))
|
|
37
36
|
|
|
38
37
|
return await this.wechaty.puppet.listWxxdProducts(query)
|
|
39
38
|
}
|
|
@@ -44,7 +43,7 @@ class WxxdProductMixin extends MixinBase {
|
|
|
44
43
|
static async find (
|
|
45
44
|
query: string | { id: string },
|
|
46
45
|
): Promise<WxxdProductInterface | undefined> {
|
|
47
|
-
log.verbose('WxxdProduct', 'find(%s)', JSON.stringify(query))
|
|
46
|
+
this.log.verbose('WxxdProduct', 'find(%s)', JSON.stringify(query))
|
|
48
47
|
|
|
49
48
|
const id = typeof query === 'string' ? query : query.id
|
|
50
49
|
|
|
@@ -69,10 +68,10 @@ class WxxdProductMixin extends MixinBase {
|
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
async ready (forceSync = false): Promise<void> {
|
|
72
|
-
log.silly('WxxdProduct', 'ready() @ %s with id="%s"', this.wechaty.puppet, this.id)
|
|
71
|
+
this.log.silly('WxxdProduct', 'ready() @ %s with id="%s"', this.wechaty.puppet, this.id)
|
|
73
72
|
|
|
74
73
|
if (!forceSync && this.isReady()) {
|
|
75
|
-
log.silly('WxxdProduct', 'ready() isReady() true')
|
|
74
|
+
this.log.silly('WxxdProduct', 'ready() isReady() true')
|
|
76
75
|
return
|
|
77
76
|
}
|
|
78
77
|
|
|
@@ -80,7 +79,7 @@ class WxxdProductMixin extends MixinBase {
|
|
|
80
79
|
this.payload = await this.wechaty.puppet.wxxdProductPayload(this.id)
|
|
81
80
|
} catch (e) {
|
|
82
81
|
this.wechaty.emitError(e)
|
|
83
|
-
log.verbose('WxxdProduct', 'ready() this.wechaty.puppet.wxxdProductPayload(%s) exception: %s',
|
|
82
|
+
this.log.verbose('WxxdProduct', 'ready() this.wechaty.puppet.wxxdProductPayload(%s) exception: %s',
|
|
84
83
|
this.id,
|
|
85
84
|
(e as Error).message,
|
|
86
85
|
)
|
|
@@ -169,41 +169,41 @@ class WechatyBase extends mixinBase implements SayableSayer {
|
|
|
169
169
|
override __options: WechatyOptions = {},
|
|
170
170
|
) {
|
|
171
171
|
super(__options)
|
|
172
|
-
log.verbose('Wechaty', 'constructor()')
|
|
172
|
+
this.log.verbose('Wechaty', 'constructor()')
|
|
173
173
|
|
|
174
174
|
this.__memory = this.__options.memory
|
|
175
175
|
this.wechaty = this
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
override async start (): Promise<void> {
|
|
179
|
-
log.verbose('Wechaty', 'start()')
|
|
179
|
+
this.log.verbose('Wechaty', 'start()')
|
|
180
180
|
await this.init()
|
|
181
181
|
return super.start()
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
override async onStart (): Promise<void> {
|
|
185
|
-
log.verbose('Wechaty', 'onStart()')
|
|
185
|
+
this.log.verbose('Wechaty', 'onStart()')
|
|
186
186
|
|
|
187
|
-
log.verbose('Wechaty', '<%s>(%s) onStart() v%s is starting...',
|
|
187
|
+
this.log.verbose('Wechaty', '<%s>(%s) onStart() v%s is starting...',
|
|
188
188
|
this.__options.puppet || config.systemPuppetName(),
|
|
189
189
|
this.__options.name || '',
|
|
190
190
|
this.version(),
|
|
191
191
|
)
|
|
192
|
-
log.verbose('Wechaty', 'id: %s', this.id)
|
|
192
|
+
this.log.verbose('Wechaty', 'id: %s', this.id)
|
|
193
193
|
|
|
194
194
|
const lifeTimer = setInterval(() => {
|
|
195
|
-
log.silly('Wechaty', 'onStart() setInterval() this timer is to keep Wechaty running...')
|
|
195
|
+
this.log.silly('Wechaty', 'onStart() setInterval() this timer is to keep Wechaty running...')
|
|
196
196
|
}, 1000 * 60 * 60)
|
|
197
197
|
this._stopCallbackList.push(() => clearInterval(lifeTimer))
|
|
198
198
|
|
|
199
199
|
this.emit('start')
|
|
200
|
-
log.verbose('Wechaty', 'onStart() ... done')
|
|
200
|
+
this.log.verbose('Wechaty', 'onStart() ... done')
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
override async onStop (): Promise<void> {
|
|
204
|
-
log.verbose('Wechaty', 'onStop()')
|
|
204
|
+
this.log.verbose('Wechaty', 'onStop()')
|
|
205
205
|
|
|
206
|
-
log.verbose('Wechaty', '<%s> onStop() v%s is stopping ...',
|
|
206
|
+
this.log.verbose('Wechaty', '<%s> onStop() v%s is stopping ...',
|
|
207
207
|
this.__options.puppet || config.systemPuppetName(),
|
|
208
208
|
this.version(),
|
|
209
209
|
)
|
|
@@ -213,7 +213,7 @@ class WechatyBase extends mixinBase implements SayableSayer {
|
|
|
213
213
|
this._stopCallbackList.length = 0
|
|
214
214
|
|
|
215
215
|
this.emit('stop')
|
|
216
|
-
log.verbose('Wechaty', 'onStop() ... done')
|
|
216
|
+
this.log.verbose('Wechaty', 'onStop() ... done')
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
/**
|
|
@@ -273,7 +273,7 @@ class WechatyBase extends mixinBase implements SayableSayer {
|
|
|
273
273
|
async say (
|
|
274
274
|
sayable: Sayable,
|
|
275
275
|
): Promise<void> {
|
|
276
|
-
log.verbose('Wechaty', 'say(%s)', sayable)
|
|
276
|
+
this.log.verbose('Wechaty', 'say(%s)', sayable)
|
|
277
277
|
await this.currentUser.say(sayable)
|
|
278
278
|
}
|
|
279
279
|
|
|
@@ -294,7 +294,7 @@ class WechatyBase extends mixinBase implements SayableSayer {
|
|
|
294
294
|
contacts: ContactInterface[],
|
|
295
295
|
options?: { media?: PUPPET.types.CallMediaType },
|
|
296
296
|
): Promise<CallInterface> {
|
|
297
|
-
log.verbose('Wechaty', 'call(%d contacts, %s)', contacts.length, JSON.stringify(options ?? {}))
|
|
297
|
+
this.log.verbose('Wechaty', 'call(%d contacts, %s)', contacts.length, JSON.stringify(options ?? {}))
|
|
298
298
|
|
|
299
299
|
if (contacts.length === 0) {
|
|
300
300
|
throw new Error('Wechaty.call() requires at least one contact')
|
|
@@ -317,7 +317,7 @@ class WechatyBase extends mixinBase implements SayableSayer {
|
|
|
317
317
|
async publish (
|
|
318
318
|
post: PostInterface,
|
|
319
319
|
): Promise<void | PostInterface> {
|
|
320
|
-
log.verbose('Wechaty', 'publish(%s)',
|
|
320
|
+
this.log.verbose('Wechaty', 'publish(%s)',
|
|
321
321
|
(post.payload.sayableList as PUPPET.payloads.Sayable[])
|
|
322
322
|
.map(s => s.type).join(','),
|
|
323
323
|
)
|
|
@@ -331,7 +331,7 @@ class WechatyBase extends mixinBase implements SayableSayer {
|
|
|
331
331
|
async unpublish (
|
|
332
332
|
post: PostInterface,
|
|
333
333
|
): Promise<void> {
|
|
334
|
-
log.verbose('Wechaty', 'unpublish(%s)', post.id)
|
|
334
|
+
this.log.verbose('Wechaty', 'unpublish(%s)', post.id)
|
|
335
335
|
|
|
336
336
|
if (!post.id) {
|
|
337
337
|
throw new Error('cannot unpublish a post without id')
|
|
@@ -346,7 +346,7 @@ class WechatyBase extends mixinBase implements SayableSayer {
|
|
|
346
346
|
id: string,
|
|
347
347
|
code: string,
|
|
348
348
|
): Promise<void> {
|
|
349
|
-
log.verbose('Wechaty', 'enterVerifyCode(%s, %s)', id, code)
|
|
349
|
+
this.log.verbose('Wechaty', 'enterVerifyCode(%s, %s)', id, code)
|
|
350
350
|
|
|
351
351
|
return this.puppet.enterVerifyCode(id, code)
|
|
352
352
|
}
|
|
@@ -354,14 +354,14 @@ class WechatyBase extends mixinBase implements SayableSayer {
|
|
|
354
354
|
async cancelVerifyCode (
|
|
355
355
|
id: string,
|
|
356
356
|
): Promise<void> {
|
|
357
|
-
log.verbose('Wechaty', 'cancelVerifyCode(%s)', id)
|
|
357
|
+
this.log.verbose('Wechaty', 'cancelVerifyCode(%s)', id)
|
|
358
358
|
|
|
359
359
|
return this.puppet.cancelVerifyCode(id)
|
|
360
360
|
}
|
|
361
361
|
|
|
362
362
|
async refreshQrCode (
|
|
363
363
|
): Promise<void> {
|
|
364
|
-
log.verbose('Wechaty', 'refreshQrCode(%s)')
|
|
364
|
+
this.log.verbose('Wechaty', 'refreshQrCode(%s)')
|
|
365
365
|
|
|
366
366
|
if (this.isLoggedIn) {
|
|
367
367
|
throw new Error('cannot refresh qr because bot is logged in')
|