@juzi/wechaty 1.0.21 → 1.0.24

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.
Files changed (106) hide show
  1. package/dist/cjs/src/config.d.ts +2 -0
  2. package/dist/cjs/src/config.d.ts.map +1 -1
  3. package/dist/cjs/src/config.js +3 -1
  4. package/dist/cjs/src/config.js.map +1 -1
  5. package/dist/cjs/src/package-json.js +4 -4
  6. package/dist/cjs/src/package-json.js.map +1 -1
  7. package/dist/cjs/src/pure-functions/update.d.ts +2 -1
  8. package/dist/cjs/src/pure-functions/update.d.ts.map +1 -1
  9. package/dist/cjs/src/pure-functions/update.js +18 -6
  10. package/dist/cjs/src/pure-functions/update.js.map +1 -1
  11. package/dist/cjs/src/schemas/contact-events.d.ts +14 -2
  12. package/dist/cjs/src/schemas/contact-events.d.ts.map +1 -1
  13. package/dist/cjs/src/schemas/contact-events.js.map +1 -1
  14. package/dist/cjs/src/schemas/room-events.d.ts +4 -1
  15. package/dist/cjs/src/schemas/room-events.d.ts.map +1 -1
  16. package/dist/cjs/src/schemas/room-events.js +1 -0
  17. package/dist/cjs/src/schemas/room-events.js.map +1 -1
  18. package/dist/cjs/src/schemas/update.d.ts +30 -11
  19. package/dist/cjs/src/schemas/update.d.ts.map +1 -1
  20. package/dist/cjs/src/schemas/update.js +32 -0
  21. package/dist/cjs/src/schemas/update.js.map +1 -1
  22. package/dist/cjs/src/schemas/wechaty-events.d.ts +26 -2
  23. package/dist/cjs/src/schemas/wechaty-events.d.ts.map +1 -1
  24. package/dist/cjs/src/schemas/wechaty-events.js +7 -0
  25. package/dist/cjs/src/schemas/wechaty-events.js.map +1 -1
  26. package/dist/cjs/src/user-modules/contact.d.ts.map +1 -1
  27. package/dist/cjs/src/user-modules/contact.js +7 -10
  28. package/dist/cjs/src/user-modules/contact.js.map +1 -1
  29. package/dist/cjs/src/user-modules/tag-group.d.ts +54 -20
  30. package/dist/cjs/src/user-modules/tag-group.d.ts.map +1 -1
  31. package/dist/cjs/src/user-modules/tag-group.js +103 -44
  32. package/dist/cjs/src/user-modules/tag-group.js.map +1 -1
  33. package/dist/cjs/src/user-modules/tag.d.ts +57 -22
  34. package/dist/cjs/src/user-modules/tag.d.ts.map +1 -1
  35. package/dist/cjs/src/user-modules/tag.js +140 -48
  36. package/dist/cjs/src/user-modules/tag.js.map +1 -1
  37. package/dist/cjs/src/wechaty/wechaty-base.d.ts +7 -7
  38. package/dist/cjs/src/wechaty-mixins/gerror-mixin.d.ts +1 -1
  39. package/dist/cjs/src/wechaty-mixins/io-mixin.d.ts +2 -2
  40. package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts +5 -5
  41. package/dist/cjs/src/wechaty-mixins/misc-mixin.d.ts +5 -5
  42. package/dist/cjs/src/wechaty-mixins/plugin-mixin.d.ts +6 -6
  43. package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts +4 -4
  44. package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
  45. package/dist/cjs/src/wechaty-mixins/puppet-mixin.js +152 -13
  46. package/dist/cjs/src/wechaty-mixins/puppet-mixin.js.map +1 -1
  47. package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.d.ts +1 -1
  48. package/dist/esm/src/config.d.ts +2 -0
  49. package/dist/esm/src/config.d.ts.map +1 -1
  50. package/dist/esm/src/config.js +2 -0
  51. package/dist/esm/src/config.js.map +1 -1
  52. package/dist/esm/src/package-json.js +4 -4
  53. package/dist/esm/src/package-json.js.map +1 -1
  54. package/dist/esm/src/pure-functions/update.d.ts +2 -1
  55. package/dist/esm/src/pure-functions/update.d.ts.map +1 -1
  56. package/dist/esm/src/pure-functions/update.js +16 -5
  57. package/dist/esm/src/pure-functions/update.js.map +1 -1
  58. package/dist/esm/src/schemas/contact-events.d.ts +14 -2
  59. package/dist/esm/src/schemas/contact-events.d.ts.map +1 -1
  60. package/dist/esm/src/schemas/contact-events.js.map +1 -1
  61. package/dist/esm/src/schemas/room-events.d.ts +4 -1
  62. package/dist/esm/src/schemas/room-events.d.ts.map +1 -1
  63. package/dist/esm/src/schemas/room-events.js +1 -0
  64. package/dist/esm/src/schemas/room-events.js.map +1 -1
  65. package/dist/esm/src/schemas/update.d.ts +30 -11
  66. package/dist/esm/src/schemas/update.d.ts.map +1 -1
  67. package/dist/esm/src/schemas/update.js +8 -1
  68. package/dist/esm/src/schemas/update.js.map +1 -1
  69. package/dist/esm/src/schemas/wechaty-events.d.ts +26 -2
  70. package/dist/esm/src/schemas/wechaty-events.d.ts.map +1 -1
  71. package/dist/esm/src/schemas/wechaty-events.js +7 -0
  72. package/dist/esm/src/schemas/wechaty-events.js.map +1 -1
  73. package/dist/esm/src/user-modules/contact.d.ts.map +1 -1
  74. package/dist/esm/src/user-modules/contact.js +7 -10
  75. package/dist/esm/src/user-modules/contact.js.map +1 -1
  76. package/dist/esm/src/user-modules/tag-group.d.ts +54 -20
  77. package/dist/esm/src/user-modules/tag-group.d.ts.map +1 -1
  78. package/dist/esm/src/user-modules/tag-group.js +104 -45
  79. package/dist/esm/src/user-modules/tag-group.js.map +1 -1
  80. package/dist/esm/src/user-modules/tag.d.ts +57 -22
  81. package/dist/esm/src/user-modules/tag.d.ts.map +1 -1
  82. package/dist/esm/src/user-modules/tag.js +119 -50
  83. package/dist/esm/src/user-modules/tag.js.map +1 -1
  84. package/dist/esm/src/wechaty/wechaty-base.d.ts +7 -7
  85. package/dist/esm/src/wechaty-mixins/gerror-mixin.d.ts +1 -1
  86. package/dist/esm/src/wechaty-mixins/io-mixin.d.ts +2 -2
  87. package/dist/esm/src/wechaty-mixins/login-mixin.d.ts +5 -5
  88. package/dist/esm/src/wechaty-mixins/misc-mixin.d.ts +5 -5
  89. package/dist/esm/src/wechaty-mixins/plugin-mixin.d.ts +6 -6
  90. package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts +4 -4
  91. package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
  92. package/dist/esm/src/wechaty-mixins/puppet-mixin.js +153 -14
  93. package/dist/esm/src/wechaty-mixins/puppet-mixin.js.map +1 -1
  94. package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.d.ts +1 -1
  95. package/package.json +3 -3
  96. package/src/config.ts +3 -0
  97. package/src/package-json.ts +4 -4
  98. package/src/pure-functions/update.ts +20 -8
  99. package/src/schemas/contact-events.ts +22 -3
  100. package/src/schemas/room-events.ts +4 -0
  101. package/src/schemas/update.ts +42 -13
  102. package/src/schemas/wechaty-events.ts +77 -43
  103. package/src/user-modules/contact.ts +7 -10
  104. package/src/user-modules/tag-group.ts +135 -53
  105. package/src/user-modules/tag.ts +124 -57
  106. package/src/wechaty-mixins/puppet-mixin.ts +171 -15
@@ -26,7 +26,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
26
26
  init: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
27
27
  start: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
28
28
  stop: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
29
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
29
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
30
30
  addListener<E extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E]): any;
31
31
  once<E_1 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_1, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_1]): any;
32
32
  prependListener<E_2 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_2, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_2]): any;
@@ -127,7 +127,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
127
127
  init: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
128
128
  start: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
129
129
  stop: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
130
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
130
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
131
131
  addListener<E_11 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_11, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_11]): any;
132
132
  once<E_12 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_12, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_12]): any;
133
133
  prependListener<E_13 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_13, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_13]): any;
@@ -225,7 +225,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
225
225
  __options: WechatyOptions;
226
226
  start: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
227
227
  stop: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
228
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
228
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
229
229
  addListener<E_18 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_18, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_18]): any;
230
230
  once<E_19 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_19, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_19]): any;
231
231
  prependListener<E_20 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_20, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_20]): any;
@@ -375,7 +375,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
375
375
  __memory?: import("memory-card").MemoryCard | undefined;
376
376
  readonly memory: import("memory-card").MemoryCard;
377
377
  __options: WechatyOptions;
378
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
378
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
379
379
  addListener<E_25 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_25, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_25]): any;
380
380
  once<E_26 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_26, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_26]): any;
381
381
  prependListener<E_27 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_27, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_27]): any;
@@ -410,7 +410,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
410
410
  readonly memory: import("memory-card").MemoryCard;
411
411
  __options: WechatyOptions;
412
412
  init(): Promise<void>;
413
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
413
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
414
414
  addListener<E_32 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_32, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_32]): any;
415
415
  once<E_33 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_33, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_33]): any;
416
416
  prependListener<E_34 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_34, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_34]): any;
@@ -492,7 +492,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
492
492
  __options: WechatyOptions;
493
493
  start(): Promise<void>;
494
494
  stop(): Promise<void>;
495
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
495
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
496
496
  addListener<E_39 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_39, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_39]): any;
497
497
  once<E_40 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_40, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_40]): any;
498
498
  prependListener<E_41 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_41, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_41]): any;
@@ -522,7 +522,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
522
522
  init(): Promise<void>;
523
523
  start(): Promise<void>;
524
524
  stop(): Promise<void>;
525
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
525
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
526
526
  addListener<E_46 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_46, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_46]): any;
527
527
  once<E_47 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_47, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_47]): any;
528
528
  prependListener<E_48 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_48, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_48]): any;
@@ -27,7 +27,7 @@ declare const gErrorMixin: <MixinBase extends typeof WechatySkeleton>(mixinBase:
27
27
  init(): Promise<void>;
28
28
  start(): Promise<void>;
29
29
  stop(): Promise<void>;
30
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
30
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
31
31
  addListener<E extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E]): any;
32
32
  once<E_1 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_1, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_1]): any;
33
33
  prependListener<E_2 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_2, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_2]): any;
@@ -18,7 +18,7 @@ declare const ioMixin: <MixinBase extends typeof WechatySkeleton & ((abstract ne
18
18
  init(): Promise<void>;
19
19
  start(): Promise<void>;
20
20
  stop(): Promise<void>;
21
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
21
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
22
22
  addListener<E extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E]): any;
23
23
  once<E_1 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_1, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_1]): any;
24
24
  prependListener<E_2 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_2, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_2]): any;
@@ -47,7 +47,7 @@ declare const ioMixin: <MixinBase extends typeof WechatySkeleton & ((abstract ne
47
47
  readonly memory: import("memory-card").MemoryCard;
48
48
  __options: WechatyOptions;
49
49
  init(): Promise<void>;
50
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
50
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
51
51
  addListener<E_10 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_10, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_10]): any;
52
52
  once<E_11 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_11, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_11]): any;
53
53
  prependListener<E_12 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_12, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_12]): any;
@@ -45,7 +45,7 @@ declare const loginMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
45
45
  __memory?: import("memory-card").MemoryCard | undefined;
46
46
  readonly memory: import("memory-card").MemoryCard;
47
47
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
48
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
48
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
49
49
  addListener<E extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E]): any;
50
50
  once<E_1 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_1, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_1]): any;
51
51
  prependListener<E_2 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_2, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_2]): any;
@@ -107,7 +107,7 @@ declare const loginMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
107
107
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
108
108
  start(): Promise<void>;
109
109
  stop(): Promise<void>;
110
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
110
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
111
111
  addListener<E_11 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_11, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_11]): any;
112
112
  once<E_12 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_12, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_12]): any;
113
113
  prependListener<E_13 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_13, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_13]): any;
@@ -137,7 +137,7 @@ declare const loginMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
137
137
  init(): Promise<void>;
138
138
  start(): Promise<void>;
139
139
  stop(): Promise<void>;
140
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
140
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
141
141
  addListener<E_18 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_18, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_18]): any;
142
142
  once<E_19 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_19, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_19]): any;
143
143
  prependListener<E_20 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_20, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_20]): any;
@@ -166,7 +166,7 @@ declare const loginMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
166
166
  readonly memory: import("memory-card").MemoryCard;
167
167
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
168
168
  init(): Promise<void>;
169
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
169
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
170
170
  addListener<E_25 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_25, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_25]): any;
171
171
  once<E_26 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_26, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_26]): any;
172
172
  prependListener<E_27 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_27, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_27]): any;
@@ -235,7 +235,7 @@ declare const loginMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
235
235
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
236
236
  start: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
237
237
  stop: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
238
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
238
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
239
239
  addListener<E_32 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_32, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_32]): any;
240
240
  once<E_33 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_33, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_33]): any;
241
241
  prependListener<E_34 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_34, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_34]): any;
@@ -44,7 +44,7 @@ declare const miscMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
44
44
  __memory?: import("memory-card").MemoryCard | undefined;
45
45
  readonly memory: import("memory-card").MemoryCard;
46
46
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
47
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
47
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
48
48
  addListener<E extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E]): any;
49
49
  once<E_1 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_1, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_1]): any;
50
50
  prependListener<E_2 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_2, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_2]): any;
@@ -108,7 +108,7 @@ declare const miscMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
108
108
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
109
109
  start(): Promise<void>;
110
110
  stop(): Promise<void>;
111
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
111
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
112
112
  addListener<E_11 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_11, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_11]): any;
113
113
  once<E_12 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_12, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_12]): any;
114
114
  prependListener<E_13 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_13, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_13]): any;
@@ -140,7 +140,7 @@ declare const miscMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
140
140
  init(): Promise<void>;
141
141
  start(): Promise<void>;
142
142
  stop(): Promise<void>;
143
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
143
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
144
144
  addListener<E_18 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_18, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_18]): any;
145
145
  once<E_19 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_19, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_19]): any;
146
146
  prependListener<E_20 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_20, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_20]): any;
@@ -171,7 +171,7 @@ declare const miscMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
171
171
  readonly memory: import("memory-card").MemoryCard;
172
172
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
173
173
  init(): Promise<void>;
174
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
174
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
175
175
  addListener<E_25 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_25, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_25]): any;
176
176
  once<E_26 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_26, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_26]): any;
177
177
  prependListener<E_27 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_27, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_27]): any;
@@ -229,7 +229,7 @@ declare const miscMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
229
229
  init: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
230
230
  start: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
231
231
  stop: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
232
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
232
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
233
233
  addListener<E_32 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_32, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_32]): any;
234
234
  once<E_33 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_33, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_33]): any;
235
235
  prependListener<E_34 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_34, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_34]): any;
@@ -15,7 +15,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
15
15
  init(): Promise<void>;
16
16
  start(): Promise<void>;
17
17
  stop(): Promise<void>;
18
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
18
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
19
19
  addListener<E extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E]): any;
20
20
  once<E_1 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_1, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_1]): any;
21
21
  prependListener<E_2 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_2, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_2]): any;
@@ -65,7 +65,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
65
65
  init: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
66
66
  start: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
67
67
  stop: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
68
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
68
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
69
69
  addListener<E_10 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_10, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_10]): any;
70
70
  once<E_11 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_11, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_11]): any;
71
71
  prependListener<E_12 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_12, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_12]): any;
@@ -169,7 +169,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
169
169
  __memory?: import("memory-card").MemoryCard | undefined;
170
170
  readonly memory: import("memory-card").MemoryCard;
171
171
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
172
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
172
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
173
173
  addListener<E_18 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_18, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_18]): any;
174
174
  once<E_19 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_19, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_19]): any;
175
175
  prependListener<E_20 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_20, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_20]): any;
@@ -231,7 +231,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
231
231
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
232
232
  start(): Promise<void>;
233
233
  stop(): Promise<void>;
234
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
234
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
235
235
  addListener<E_25 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_25, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_25]): any;
236
236
  once<E_26 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_26, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_26]): any;
237
237
  prependListener<E_27 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_27, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_27]): any;
@@ -261,7 +261,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
261
261
  readonly memory: import("memory-card").MemoryCard;
262
262
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
263
263
  init(): Promise<void>;
264
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
264
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
265
265
  addListener<E_32 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_32, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_32]): any;
266
266
  once<E_33 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_33, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_33]): any;
267
267
  prependListener<E_34 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_34, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_34]): any;
@@ -310,7 +310,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
310
310
  init: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
311
311
  start: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
312
312
  stop: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
313
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
313
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
314
314
  addListener<E_39 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_39, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_39]): any;
315
315
  once<E_40 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_40, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_40]): any;
316
316
  prependListener<E_41 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_41, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_41]): any;
@@ -47,7 +47,7 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
47
47
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
48
48
  start(): Promise<void>;
49
49
  stop(): Promise<void>;
50
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
50
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
51
51
  addListener<E extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E]): any;
52
52
  once<E_1 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_1, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_1]): any;
53
53
  prependListener<E_2 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_2, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_2]): any;
@@ -77,7 +77,7 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
77
77
  init(): Promise<void>;
78
78
  start(): Promise<void>;
79
79
  stop(): Promise<void>;
80
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
80
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
81
81
  addListener<E_11 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_11, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_11]): any;
82
82
  once<E_12 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_12, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_12]): any;
83
83
  prependListener<E_13 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_13, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_13]): any;
@@ -106,7 +106,7 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
106
106
  readonly memory: import("memory-card").MemoryCard;
107
107
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
108
108
  init(): Promise<void>;
109
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
109
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
110
110
  addListener<E_18 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_18, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_18]): any;
111
111
  once<E_19 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_19, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_19]): any;
112
112
  prependListener<E_20 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_20, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_20]): any;
@@ -171,7 +171,7 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
171
171
  __memory?: import("memory-card").MemoryCard | undefined;
172
172
  readonly memory: import("memory-card").MemoryCard;
173
173
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
174
- on(event: "error" | "ready" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update", listener: (...args: any[]) => any): any;
174
+ on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "update" | "contact-tag-add" | "contact-tag-remove" | "contact-name" | "contact-alias" | "contact-phone" | "contact-description" | "room-owner", listener: (...args: any[]) => any): any;
175
175
  addListener<E_25 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_25, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_25]): any;
176
176
  once<E_26 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_26, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_26]): any;
177
177
  prependListener<E_27 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_27, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_27]): any;
@@ -1 +1 @@
1
- {"version":3,"file":"puppet-mixin.d.ts","sourceRoot":"","sources":["../../../../src/wechaty-mixins/puppet-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAW,sBAAsB,CAAA;AASnD,OAAO,KAAK,EACV,oBAAoB,EACrB,MAA4B,cAAc,CAAA;AAqB3C;;;;;;;GAOG;AACH,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDAmBS,GAAG,EAAE;;;2BAJH,oBAAoB;;aAWnB,QAAQ,IAAI,CAAC;YA+Cd,QAAQ,IAAI,CAAC;aAuBrB,QAAQ,IAAI,CAAC;YAML,QAAQ,IAAI,CAAC;gCA8CR,OAAO,KAAK,CAAC,eAAe,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqUnE,CAAA;AAED,aAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA;AAEjD,aAAK,4BAA4B,GAC7B,UAAU,GACV,cAAc,GACd,qBAAqB,CAAA;AAEzB,YAAY,EACV,WAAW,EACX,4BAA4B,GAC7B,CAAA;AACD,OAAO,EACL,WAAW,GACZ,CAAA"}
1
+ {"version":3,"file":"puppet-mixin.d.ts","sourceRoot":"","sources":["../../../../src/wechaty-mixins/puppet-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAW,sBAAsB,CAAA;AASnD,OAAO,KAAK,EACV,oBAAoB,EACrB,MAA4B,cAAc,CAAA;AAwB3C;;;;;;;GAOG;AACH,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDAmBS,GAAG,EAAE;;;2BAJH,oBAAoB;;aAWnB,QAAQ,IAAI,CAAC;YA+Cd,QAAQ,IAAI,CAAC;aAuBrB,QAAQ,IAAI,CAAC;YAML,QAAQ,IAAI,CAAC;gCA8CR,OAAO,KAAK,CAAC,eAAe,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA8dnE,CAAA;AAED,aAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA;AAEjD,aAAK,4BAA4B,GAC7B,UAAU,GACV,cAAc,GACd,qBAAqB,CAAA;AAEzB,YAAY,EACV,WAAW,EACX,4BAA4B,GAC7B,CAAA;AACD,OAAO,EACL,WAAW,GACZ,CAAA"}
@@ -2,9 +2,11 @@ import * as PUPPET from '@juzi/wechaty-puppet';
2
2
  import { log } from '@juzi/wechaty-puppet';
3
3
  import { GError, timeoutPromise, TimeoutPromiseGError, } from 'gerror';
4
4
  import { StateSwitch } from 'state-switch';
5
- import { config } from '../config.js';
5
+ import { config, PUPPET_PAYLOAD_SYNC_GAP, PUPPET_PAYLOAD_SYNC_MAX_RETRY } from '../config.js';
6
6
  import { timestampToDate } from '../pure-functions/timestamp-to-date.js';
7
- import { diffPayload } from '../pure-functions/update.js';
7
+ import { ContactImportantFields, RoomImportantFields } from '../schemas/update.js';
8
+ import { checkUntilChanged, diffPayload } from '../pure-functions/update.js';
9
+ import { getTagKey } from '@juzi/wechaty-puppet/helpers';
8
10
  const PUPPET_MEMORY_NAME = 'puppet';
9
11
  /**
10
12
  * Huan(202111): `puppetMixin` must extend `pluginMixin`
@@ -344,6 +346,81 @@ const puppetMixin = (mixinBase) => {
344
346
  this.emit('scan', payload.qrcode || '', payload.status, payload.data);
345
347
  });
346
348
  break;
349
+ case 'tag':
350
+ puppet.on('tag', async (payload) => {
351
+ switch (payload.tagEventType) {
352
+ case PUPPET.types.TagEvent.TagCreate: {
353
+ const newTagPromises = payload.tagEventPayload.map(tag => this.Tag.find({
354
+ id: tag.tagId,
355
+ groupId: tag.tagGroupId,
356
+ }));
357
+ const newTags = await Promise.all(newTagPromises);
358
+ this.emit('tag', payload.tagEventType, newTags);
359
+ break;
360
+ }
361
+ case PUPPET.types.TagEvent.TagDelete: {
362
+ const deletedTagPromises = payload.tagEventPayload.map(tag => this.Tag.find({
363
+ id: tag.tagId,
364
+ groupId: tag.tagGroupId,
365
+ }));
366
+ const deletedTags = await Promise.all(deletedTagPromises);
367
+ this.emit('tag', payload.tagEventType, deletedTags);
368
+ // TODO: bind tag-delete to tag instance
369
+ break;
370
+ }
371
+ case PUPPET.types.TagEvent.TagRename: {
372
+ const renamedTagPromises = payload.tagEventPayload.map(tag => this.Tag.find({
373
+ id: tag.tagId,
374
+ groupId: tag.tagGroupId,
375
+ }));
376
+ const renamedTags = (await Promise.all(renamedTagPromises));
377
+ await Promise.all(renamedTags.map(async (tag) => {
378
+ const oldName = tag.name();
379
+ const result = await checkUntilChanged(PUPPET_PAYLOAD_SYNC_GAP, PUPPET_PAYLOAD_SYNC_MAX_RETRY, async () => {
380
+ await tag.sync();
381
+ return tag.name() === oldName;
382
+ });
383
+ if (!result) {
384
+ log.warn('WechatyPuppetMixin', 'tagRenameEvent still get old name after %s retries for tag %s', PUPPET_PAYLOAD_SYNC_MAX_RETRY, tag.key);
385
+ }
386
+ }));
387
+ this.emit('tag', payload.tagEventType, renamedTags);
388
+ // TODO: bind tag-rename to tag instance
389
+ break;
390
+ }
391
+ case PUPPET.types.TagEvent.TagGroupCreate: {
392
+ const newTagGroupPromises = payload.tagEventPayload.map(tagGroup => this.TagGroup.find(tagGroup.tagGroupId));
393
+ const newTagGroups = await Promise.all(newTagGroupPromises);
394
+ this.emit('tag', payload.tagEventType, newTagGroups);
395
+ break;
396
+ }
397
+ case PUPPET.types.TagEvent.TagGroupDelete: {
398
+ const deletedTagGroupPromises = payload.tagEventPayload.map(tagGroup => this.TagGroup.find(tagGroup.tagGroupId));
399
+ const deletedTagGroups = await Promise.all(deletedTagGroupPromises);
400
+ this.emit('tag', payload.tagEventType, deletedTagGroups);
401
+ break;
402
+ // TODO: bind tagGroup-delete to tagGroup instance
403
+ }
404
+ case PUPPET.types.TagEvent.TagGroupRename: {
405
+ const renamedTagGroupPromises = payload.tagEventPayload.map(tagGroup => this.TagGroup.find(tagGroup.tagGroupId));
406
+ const renamedTagGroups = (await Promise.all(renamedTagGroupPromises));
407
+ await Promise.all(renamedTagGroups.map(async (tagGroup) => {
408
+ const oldName = tagGroup.name();
409
+ const result = await checkUntilChanged(PUPPET_PAYLOAD_SYNC_GAP, PUPPET_PAYLOAD_SYNC_MAX_RETRY, async () => {
410
+ await tagGroup.sync();
411
+ return tagGroup.name() === oldName;
412
+ });
413
+ if (!result) {
414
+ log.warn('WechatyPuppetMixin', 'tagGroupRenameEvent still get old name after %s retries for tagGroup %s', PUPPET_PAYLOAD_SYNC_MAX_RETRY, tagGroup.id);
415
+ }
416
+ }));
417
+ this.emit('tag', payload.tagEventType, renamedTagGroups);
418
+ // TODO: bind tagGroup-rename to tagGroup instance
419
+ break;
420
+ }
421
+ }
422
+ });
423
+ break;
347
424
  case 'reset':
348
425
  // Do not propagation `reset` event from puppet
349
426
  break;
@@ -359,15 +436,57 @@ const puppetMixin = (mixinBase) => {
359
436
  const oldPayload = JSON.parse(JSON.stringify(contact?.payload || {}));
360
437
  await contact?.ready(true);
361
438
  const newPayload = JSON.parse(JSON.stringify(contact?.payload || {}));
362
- const updateEvent = {
363
- type: payloadType,
364
- id: payloadId,
365
- updates: diffPayload(oldPayload, newPayload),
366
- };
367
- if (updateEvent.updates.length > 0) {
439
+ const differences = diffPayload(oldPayload, newPayload);
440
+ const importantDifferences = differences.filter(ele => ele && ContactImportantFields.some(key => key === ele.key));
441
+ const regularDifferences = differences.filter(ele => ele && !ContactImportantFields.some(key => key === ele.key));
442
+ if (regularDifferences.length > 0) {
443
+ const updateEvent = {
444
+ type: payloadType,
445
+ id: payloadId,
446
+ updates: regularDifferences,
447
+ };
368
448
  this.emit('update', updateEvent);
369
449
  contact?.emit('update', updateEvent);
370
450
  }
451
+ for (const difference of importantDifferences) {
452
+ switch (difference?.key) {
453
+ case 'tags': {
454
+ const oldTagsSet = new Set(difference.oldValue?.map(ele => getTagKey(ele)));
455
+ const newTagsSet = new Set(difference.newValue?.map(ele => getTagKey(ele)));
456
+ const addedTags = difference.newValue?.filter(ele => !oldTagsSet.has(getTagKey(ele))).map(ele => this.Tag.find(ele)) || [];
457
+ const removedTags = difference.oldValue?.filter(ele => !newTagsSet.has(getTagKey(ele))).map(ele => this.Tag.find(ele)) || [];
458
+ if (addedTags.length > 0) {
459
+ this.emit('contact-tag-add', contact, addedTags);
460
+ }
461
+ if (removedTags.length > 0) {
462
+ this.emit('contact-tag-remove', contact, removedTags);
463
+ }
464
+ break;
465
+ }
466
+ case 'name': {
467
+ this.emit('contact-name', contact, difference.newValue || '', difference.oldValue || '');
468
+ contact?.emit('name', difference.newValue || '', difference.oldValue || '');
469
+ break;
470
+ }
471
+ case 'alias': {
472
+ this.emit('contact-alias', contact, difference.newValue || '', difference.oldValue || '');
473
+ contact?.emit('alias', difference.newValue || '', difference.oldValue || '');
474
+ break;
475
+ }
476
+ case 'phone': {
477
+ this.emit('contact-phone', contact, difference.newValue || [], difference.oldValue || []);
478
+ contact?.emit('phone', difference.newValue || [], difference.oldValue || []);
479
+ break;
480
+ }
481
+ case 'description': {
482
+ this.emit('contact-description', contact, difference.newValue || '', difference.oldValue || '');
483
+ contact?.emit('description', difference.newValue || '', difference.oldValue || '');
484
+ break;
485
+ }
486
+ default:
487
+ log.warn('WechatyPuppetMixin', 'puppet dirty unsupported difference type: %s', JSON.stringify(difference));
488
+ }
489
+ }
371
490
  break;
372
491
  }
373
492
  case PUPPET.types.Payload.Room: {
@@ -375,15 +494,31 @@ const puppetMixin = (mixinBase) => {
375
494
  const oldPayload = JSON.parse(JSON.stringify(room?.payload || {}));
376
495
  await room?.ready(true);
377
496
  const newPayload = JSON.parse(JSON.stringify(room?.payload || {}));
378
- const updateEvent = {
379
- type: payloadType,
380
- id: payloadId,
381
- updates: diffPayload(oldPayload, newPayload),
382
- };
383
- if (updateEvent.updates.length > 0) {
497
+ const differences = diffPayload(oldPayload, newPayload);
498
+ const importantDifferences = differences.filter(ele => ele && RoomImportantFields.some(key => key === ele.key));
499
+ const regularDifferences = differences.filter(ele => ele && !RoomImportantFields.some(key => key === ele.key));
500
+ if (regularDifferences.length > 0) {
501
+ const updateEvent = {
502
+ type: payloadType,
503
+ id: payloadId,
504
+ updates: regularDifferences,
505
+ };
384
506
  this.emit('update', updateEvent);
385
507
  room?.emit('update', updateEvent);
386
508
  }
509
+ for (const difference of importantDifferences) {
510
+ switch (difference?.key) {
511
+ case 'ownerId': {
512
+ const oldOwner = (await this.Contact.find({ id: difference.oldValue }));
513
+ const newOwner = (await this.Contact.find({ id: difference.newValue }));
514
+ this.emit('room-owner', room, newOwner, oldOwner);
515
+ room?.emit('owner', newOwner, oldOwner);
516
+ break;
517
+ }
518
+ default:
519
+ log.warn('WechatyPuppetMixin', 'puppet dirty unsupported difference type: %s', JSON.stringify(difference));
520
+ }
521
+ }
387
522
  break;
388
523
  }
389
524
  case PUPPET.types.Payload.RoomMember: {
@@ -400,6 +535,10 @@ const puppetMixin = (mixinBase) => {
400
535
  case PUPPET.types.Payload.Message:
401
536
  // Message does not need to dirty (?)
402
537
  break;
538
+ case PUPPET.types.Payload.Tag:
539
+ break;
540
+ case PUPPET.types.Payload.TagGroup:
541
+ break;
403
542
  case PUPPET.types.Payload.Unspecified:
404
543
  default:
405
544
  throw new Error('unknown payload type: ' + payloadType);