@juzi/wechaty 1.0.149 → 1.0.155

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 (88) hide show
  1. package/dist/cjs/src/mods/impls.d.ts +3 -3
  2. package/dist/cjs/src/mods/impls.d.ts.map +1 -1
  3. package/dist/cjs/src/mods/impls.js +2 -1
  4. package/dist/cjs/src/mods/impls.js.map +1 -1
  5. package/dist/cjs/src/mods/users.d.ts +1 -1
  6. package/dist/cjs/src/mods/users.d.ts.map +1 -1
  7. package/dist/cjs/src/package-json.js +4 -4
  8. package/dist/cjs/src/user-modules/message.d.ts +15 -0
  9. package/dist/cjs/src/user-modules/message.d.ts.map +1 -1
  10. package/dist/cjs/src/user-modules/message.js +20 -0
  11. package/dist/cjs/src/user-modules/message.js.map +1 -1
  12. package/dist/cjs/src/user-modules/mod.d.ts +4 -3
  13. package/dist/cjs/src/user-modules/mod.d.ts.map +1 -1
  14. package/dist/cjs/src/user-modules/mod.js +3 -1
  15. package/dist/cjs/src/user-modules/mod.js.map +1 -1
  16. package/dist/cjs/src/user-modules/voice.d.ts +72 -0
  17. package/dist/cjs/src/user-modules/voice.d.ts.map +1 -0
  18. package/dist/cjs/src/user-modules/voice.js +116 -0
  19. package/dist/cjs/src/user-modules/voice.js.map +1 -0
  20. package/dist/cjs/src/user-modules/voice.spec.d.ts +3 -0
  21. package/dist/cjs/src/user-modules/voice.spec.d.ts.map +1 -0
  22. package/dist/cjs/src/user-modules/voice.spec.js +155 -0
  23. package/dist/cjs/src/user-modules/voice.spec.js.map +1 -0
  24. package/dist/cjs/src/wechaty/wechaty-base.d.ts +10 -0
  25. package/dist/cjs/src/wechaty/wechaty-base.d.ts.map +1 -1
  26. package/dist/cjs/src/wechaty/wechaty-impl.spec.js +25 -23
  27. package/dist/cjs/src/wechaty/wechaty-impl.spec.js.map +1 -1
  28. package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts +12 -0
  29. package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts.map +1 -1
  30. package/dist/cjs/src/wechaty-mixins/misc-mixin.d.ts +6 -0
  31. package/dist/cjs/src/wechaty-mixins/misc-mixin.d.ts.map +1 -1
  32. package/dist/cjs/src/wechaty-mixins/plugin-mixin.d.ts +8 -12
  33. package/dist/cjs/src/wechaty-mixins/plugin-mixin.d.ts.map +1 -1
  34. package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts +4 -0
  35. package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
  36. package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.d.ts +4 -2
  37. package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.d.ts.map +1 -1
  38. package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.js +3 -0
  39. package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.js.map +1 -1
  40. package/dist/esm/src/mods/impls.d.ts +3 -3
  41. package/dist/esm/src/mods/impls.d.ts.map +1 -1
  42. package/dist/esm/src/mods/impls.js +1 -1
  43. package/dist/esm/src/mods/impls.js.map +1 -1
  44. package/dist/esm/src/mods/users.d.ts +1 -1
  45. package/dist/esm/src/mods/users.d.ts.map +1 -1
  46. package/dist/esm/src/package-json.js +4 -4
  47. package/dist/esm/src/user-modules/message.d.ts +15 -0
  48. package/dist/esm/src/user-modules/message.d.ts.map +1 -1
  49. package/dist/esm/src/user-modules/message.js +20 -0
  50. package/dist/esm/src/user-modules/message.js.map +1 -1
  51. package/dist/esm/src/user-modules/mod.d.ts +4 -3
  52. package/dist/esm/src/user-modules/mod.d.ts.map +1 -1
  53. package/dist/esm/src/user-modules/mod.js +2 -1
  54. package/dist/esm/src/user-modules/mod.js.map +1 -1
  55. package/dist/esm/src/user-modules/voice.d.ts +72 -0
  56. package/dist/esm/src/user-modules/voice.d.ts.map +1 -0
  57. package/dist/esm/src/user-modules/voice.js +113 -0
  58. package/dist/esm/src/user-modules/voice.js.map +1 -0
  59. package/dist/esm/src/user-modules/voice.spec.d.ts +3 -0
  60. package/dist/esm/src/user-modules/voice.spec.d.ts.map +1 -0
  61. package/dist/esm/src/user-modules/voice.spec.js +153 -0
  62. package/dist/esm/src/user-modules/voice.spec.js.map +1 -0
  63. package/dist/esm/src/wechaty/wechaty-base.d.ts +10 -0
  64. package/dist/esm/src/wechaty/wechaty-base.d.ts.map +1 -1
  65. package/dist/esm/src/wechaty/wechaty-impl.spec.js +25 -23
  66. package/dist/esm/src/wechaty/wechaty-impl.spec.js.map +1 -1
  67. package/dist/esm/src/wechaty-mixins/login-mixin.d.ts +12 -0
  68. package/dist/esm/src/wechaty-mixins/login-mixin.d.ts.map +1 -1
  69. package/dist/esm/src/wechaty-mixins/misc-mixin.d.ts +6 -0
  70. package/dist/esm/src/wechaty-mixins/misc-mixin.d.ts.map +1 -1
  71. package/dist/esm/src/wechaty-mixins/plugin-mixin.d.ts +8 -12
  72. package/dist/esm/src/wechaty-mixins/plugin-mixin.d.ts.map +1 -1
  73. package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts +4 -0
  74. package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
  75. package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.d.ts +4 -2
  76. package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.d.ts.map +1 -1
  77. package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.js +4 -1
  78. package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.js.map +1 -1
  79. package/package.json +3 -3
  80. package/src/mods/impls.ts +3 -0
  81. package/src/mods/users.ts +1 -0
  82. package/src/package-json.ts +4 -4
  83. package/src/user-modules/message.ts +24 -0
  84. package/src/user-modules/mod.ts +8 -0
  85. package/src/user-modules/voice.spec.ts +187 -0
  86. package/src/user-modules/voice.ts +159 -0
  87. package/src/wechaty/wechaty-impl.spec.ts +3 -0
  88. package/src/wechaty-mixins/wechatify-user-module-mixin.ts +6 -0
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VoiceImpl = void 0;
4
+ const validation_js_1 = require("../user-mixins/validation.js");
5
+ const config_js_1 = require("../config.js");
6
+ const wechatify_js_1 = require("../user-mixins/wechatify.js");
7
+ /**
8
+ * gRPC status code for an RPC the server does not implement.
9
+ * @see https://grpc.github.io/grpc/core/md_doc_statuscodes.html
10
+ */
11
+ const GRPC_STATUS_UNIMPLEMENTED = 12;
12
+ /**
13
+ * Whether `e` means the puppet / server does not implement the new voice RPC,
14
+ * i.e. it is safe to fall back to the legacy path.
15
+ *
16
+ * Transient errors (network / timeout / file expired / other gRPC codes) must
17
+ * NOT match here: otherwise the fallback silently masks real failures and — for
18
+ * `text()` — discards the `noSpeech` discriminator, making the bot re-run its
19
+ * own paid ASR on voices the puppet already confirmed as empty.
20
+ *
21
+ * Note: the "method does not exist at all" case (an old puppet built against a
22
+ * wechaty-puppet without the method) is detected up-front via a `typeof` guard
23
+ * at the call site, NOT here — matching the `'is not a function'` text would
24
+ * also swallow a genuine `TypeError` raised inside a working implementation.
25
+ */
26
+ function isUnsupportedError(e) {
27
+ const err = e;
28
+ // old wechaty-puppet-service server without the new RPC → gRPC UNIMPLEMENTED
29
+ if (err?.code === GRPC_STATUS_UNIMPLEMENTED) {
30
+ return true;
31
+ }
32
+ // puppet implements the abstract method via throwUnsupportedError()
33
+ return (err?.message || '').includes('Unsupported API');
34
+ }
35
+ class VoiceMixin extends (0, wechatify_js_1.wechatifyMixinBase)() {
36
+ id;
37
+ static create(id) {
38
+ config_js_1.log.verbose('Voice', 'static create(%s)', id);
39
+ const voice = new this(id);
40
+ return voice;
41
+ }
42
+ constructor(id) {
43
+ super();
44
+ this.id = id;
45
+ config_js_1.log.verbose('Voice', 'constructor(%s)', id);
46
+ }
47
+ /**
48
+ * Get the voice file (FileBox) via the puppet's dedicated `messageVoice` RPC.
49
+ *
50
+ * Falls back to the generic `messageFile` when the puppet does not implement
51
+ * `messageVoice` — either the method is absent (old puppet built without it,
52
+ * caught by the `typeof` guard) or it rejects with an unsupported-API error.
53
+ * Keeps the behaviour compatible with the legacy "voice file via messageFile"
54
+ * path. A genuine runtime error from a working `messageVoice` is rethrown.
55
+ */
56
+ async file() {
57
+ config_js_1.log.verbose('Voice', 'file() for id: "%s"', this.id);
58
+ const puppet = this.wechaty.puppet;
59
+ // puppet built against an old wechaty-puppet without the method at all
60
+ if (typeof puppet.messageVoice !== 'function') {
61
+ config_js_1.log.verbose('Voice', 'file() messageVoice() absent, fallback to messageFile()');
62
+ return puppet.messageFile(this.id);
63
+ }
64
+ try {
65
+ const fileBox = await puppet.messageVoice(this.id);
66
+ return fileBox;
67
+ }
68
+ catch (e) {
69
+ if (!isUnsupportedError(e)) {
70
+ throw e;
71
+ }
72
+ config_js_1.log.verbose('Voice', 'file() messageVoice() unsupported, fallback to messageFile(): %s', e.message);
73
+ const fileBox = await puppet.messageFile(this.id);
74
+ return fileBox;
75
+ }
76
+ }
77
+ /**
78
+ * Get the voice-to-text (ASR) result via the puppet's dedicated
79
+ * `messageVoiceText` RPC. Returns a discriminated result so the bot can tell
80
+ * "confirmed no speech" (`noSpeech=true`) from "normal transcription".
81
+ *
82
+ * Falls back to reading the legacy `messagePayload().text` when the puppet
83
+ * does not implement `messageVoiceText` — either the method is absent (old
84
+ * puppet built without it, caught by the `typeof` guard) or it rejects with
85
+ * an unsupported-API error. Old puppets put the ASR result into
86
+ * `payload.text`, so this keeps the behaviour compatible; `noSpeech` is
87
+ * `false` in the fallback. A genuine runtime error is rethrown (so the bot
88
+ * does not silently drop `noSpeech` and re-run its own paid ASR).
89
+ */
90
+ async text() {
91
+ config_js_1.log.verbose('Voice', 'text() for id: "%s"', this.id);
92
+ const puppet = this.wechaty.puppet;
93
+ // puppet built against an old wechaty-puppet without the method at all
94
+ if (typeof puppet.messageVoiceText !== 'function') {
95
+ config_js_1.log.verbose('Voice', 'text() messageVoiceText() absent, fallback to messagePayload().text');
96
+ const payload = await puppet.messagePayload(this.id);
97
+ return { text: payload.text || '', noSpeech: false };
98
+ }
99
+ try {
100
+ const payload = await puppet.messageVoiceText(this.id);
101
+ return payload;
102
+ }
103
+ catch (e) {
104
+ if (!isUnsupportedError(e)) {
105
+ throw e;
106
+ }
107
+ config_js_1.log.verbose('Voice', 'text() messageVoiceText() unsupported, fallback to messagePayload().text: %s', e.message);
108
+ const payload = await puppet.messagePayload(this.id);
109
+ return { text: payload.text || '', noSpeech: false };
110
+ }
111
+ }
112
+ }
113
+ class VoiceImpl extends (0, validation_js_1.validationMixin)(VoiceMixin)() {
114
+ }
115
+ exports.VoiceImpl = VoiceImpl;
116
+ //# sourceMappingURL=voice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voice.js","sourceRoot":"","sources":["../../../../src/user-modules/voice.ts"],"names":[],"mappings":";;;AAwBA,gEAA8D;AAC9D,4CAAkC;AAElC,8DAE0D;AAE1D;;;GAGG;AACH,MAAM,yBAAyB,GAAG,EAAE,CAAA;AAEpC;;;;;;;;;;;;;GAaG;AACH,SAAS,kBAAkB,CAAE,CAAU;IACrC,MAAM,GAAG,GAAG,CAA6D,CAAA;IACzE,6EAA6E;IAC7E,IAAI,GAAG,EAAE,IAAI,KAAK,yBAAyB,EAAE;QAC3C,OAAO,IAAI,CAAA;KACZ;IACD,oEAAoE;IACpE,OAAO,CAAC,GAAG,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAA;AACzD,CAAC;AAED,MAAM,UAAW,SAAQ,IAAA,iCAAkB,GAAE;IAUlC;IART,MAAM,CAAC,MAAM,CAAE,EAAU;QACvB,eAAG,CAAC,OAAO,CAAC,OAAO,EAAE,mBAAmB,EAAE,EAAE,CAAC,CAAA;QAE7C,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC,CAAA;QAC1B,OAAO,KAAK,CAAA;IACd,CAAC;IAED,YACS,EAAU;QAEjB,KAAK,EAAE,CAAA;QAFA,OA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AO,CAAC,OAAO,EAAE,qEAAqE,CAAC,CAAA;YAC3F,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YACpD,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;SACrD;QACD,IAAI;YACF,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YACtD,OAAO,OAAO,CAAA;SACf;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE;gBAC1B,MAAM,CAAC,CAAA;aACR;YACD,eAAG,CAAC,OAAO,CAAC,OAAO,EAAE,8EAA8E,EAAG,CAAW,CAAC,OAAO,CAAC,CAAA;YAC1H,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YACpD,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;SACrD;IACH,CAAC;CAEF;AAED,MAAM,SAAU,SAAQ,IAAA,+BAAe,EAAC,UAAU,CAAC,EAAkB;CAAG;AAatE,8BAAS"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env -S node --no-warnings --loader ts-node/esm
2
+ export {};
3
+ //# sourceMappingURL=voice.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voice.spec.d.ts","sourceRoot":"","sources":["../../../../src/user-modules/voice.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,155 @@
1
+ #!/usr/bin/env -S node --no-warnings --loader ts-node/esm
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /**
5
+ * Wechaty Chatbot SDK - https://github.com/wechaty/wechaty
6
+ *
7
+ * @copyright 2016 Huan LI (李卓桓) <https://github.com/huan>, and
8
+ * Wechaty Contributors <https://github.com/wechaty>.
9
+ *
10
+ * Licensed under the Apache License, Version 2.0 (the "License");
11
+ * you may not use this file except in compliance with the License.
12
+ * You may obtain a copy of the License at
13
+ *
14
+ * http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ *
22
+ */
23
+ const tstest_1 = require("tstest");
24
+ const file_box_1 = require("file-box");
25
+ const wechaty_puppet_mock_1 = require("@juzi/wechaty-puppet-mock");
26
+ const wechaty_builder_js_1 = require("../wechaty-builder.js");
27
+ const MESSAGE_ID = 'message-id-voice';
28
+ /**
29
+ * The fallback must trigger ONLY when the puppet does not implement the new
30
+ * RPC, never on transient failures: otherwise `text()` silently drops the
31
+ * `noSpeech` discriminator and makes the bot re-run its own paid ASR.
32
+ *
33
+ * The puppet is built & started once and reused across cases (`wechaty.Voice`
34
+ * is unavailable before `start()`). `messageVoice` / `messageVoiceText` are
35
+ * assigned directly (rather than via `sinon.stub(puppet, ...)`) because the
36
+ * installed wechaty-puppet-mock predates those methods, so stubbing a
37
+ * non-existent property would throw.
38
+ */
39
+ const puppet = new wechaty_puppet_mock_1.PuppetMock();
40
+ const wechaty = wechaty_builder_js_1.WechatyBuilder.build({ puppet });
41
+ let started = false;
42
+ async function ensureStarted() {
43
+ if (!started) {
44
+ await wechaty.start();
45
+ started = true;
46
+ }
47
+ }
48
+ const voice = () => wechaty.Voice.create(MESSAGE_ID);
49
+ const UNSUPPORTED = new Error('Wechaty Puppet Unsupported API Error.');
50
+ (0, tstest_1.test)('Voice.file() returns the dedicated messageVoice result when supported', async (t) => {
51
+ await ensureStarted();
52
+ puppet.messageVoice = tstest_1.sinon.stub().resolves(file_box_1.FileBox.fromBuffer(Buffer.from('voice'), 'voice.silk'));
53
+ puppet.messageFile = tstest_1.sinon.stub().resolves(file_box_1.FileBox.fromBuffer(Buffer.from('file'), 'file.bin'));
54
+ const fileBox = await voice().file();
55
+ t.equal(fileBox.name, 'voice.silk', 'should return the messageVoice FileBox');
56
+ t.ok(puppet.messageVoice.calledOnceWith(MESSAGE_ID), 'should call messageVoice');
57
+ t.notOk(puppet.messageFile.called, 'should NOT fall back to messageFile when supported');
58
+ });
59
+ (0, tstest_1.test)('Voice.file() falls back to messageFile on unsupported error', async (t) => {
60
+ await ensureStarted();
61
+ puppet.messageVoice = tstest_1.sinon.stub().rejects(UNSUPPORTED);
62
+ puppet.messageFile = tstest_1.sinon.stub().resolves(file_box_1.FileBox.fromBuffer(Buffer.from('file'), 'file.bin'));
63
+ const fileBox = await voice().file();
64
+ t.equal(fileBox.name, 'file.bin', 'should fall back to messageFile');
65
+ t.ok(puppet.messageFile.calledOnceWith(MESSAGE_ID), 'should call messageFile on fallback');
66
+ });
67
+ (0, tstest_1.test)('Voice.file() falls back to messageFile when messageVoice is absent (old puppet)', async (t) => {
68
+ await ensureStarted();
69
+ puppet.messageVoice = undefined; // old puppet built without the method at all
70
+ puppet.messageFile = tstest_1.sinon.stub().resolves(file_box_1.FileBox.fromBuffer(Buffer.from('file'), 'file.bin'));
71
+ const fileBox = await voice().file();
72
+ t.equal(fileBox.name, 'file.bin', 'should fall back to messageFile via the typeof guard');
73
+ t.ok(puppet.messageFile.calledOnceWith(MESSAGE_ID), 'should call messageFile on fallback');
74
+ });
75
+ (0, tstest_1.test)('Voice.file() rethrows a transient error instead of falling back', async (t) => {
76
+ await ensureStarted();
77
+ puppet.messageVoice = tstest_1.sinon.stub().rejects(new Error('socket hang up'));
78
+ puppet.messageFile = tstest_1.sinon.stub().resolves(file_box_1.FileBox.fromBuffer(Buffer.from('file'), 'file.bin'));
79
+ await t.rejects(() => voice().file(), /socket hang up/, 'should rethrow the transient error');
80
+ t.notOk(puppet.messageFile.called, 'should NOT fall back on a transient error');
81
+ });
82
+ (0, tstest_1.test)('Voice.file() rethrows a genuine "is not a function" TypeError from a working messageVoice', async (t) => {
83
+ await ensureStarted();
84
+ // method exists but its implementation throws internally — must NOT be
85
+ // misclassified as unsupported just because the message says "is not a function"
86
+ puppet.messageVoice = tstest_1.sinon.stub().rejects(new TypeError('innerHelper.process is not a function'));
87
+ puppet.messageFile = tstest_1.sinon.stub().resolves(file_box_1.FileBox.fromBuffer(Buffer.from('file'), 'file.bin'));
88
+ await t.rejects(() => voice().file(), /is not a function/, 'should rethrow the internal TypeError');
89
+ t.notOk(puppet.messageFile.called, 'should NOT mask a real implementation bug');
90
+ });
91
+ (0, tstest_1.test)('Voice.text() returns the dedicated messageVoiceText payload when supported', async (t) => {
92
+ await ensureStarted();
93
+ puppet.messageVoiceText = tstest_1.sinon.stub().resolves({ text: 'hello', noSpeech: false });
94
+ puppet.messagePayload = tstest_1.sinon.stub().resolves({ text: 'legacy' });
95
+ const result = await voice().text();
96
+ t.same(result, { text: 'hello', noSpeech: false }, 'should return the messageVoiceText payload');
97
+ t.ok(puppet.messageVoiceText.calledOnceWith(MESSAGE_ID), 'should call messageVoiceText');
98
+ t.notOk(puppet.messagePayload.called, 'should NOT fall back to messagePayload when supported');
99
+ });
100
+ (0, tstest_1.test)('Voice.text() preserves noSpeech=true from the puppet (skip paid ASR)', async (t) => {
101
+ await ensureStarted();
102
+ puppet.messageVoiceText = tstest_1.sinon.stub().resolves({ text: '', noSpeech: true });
103
+ puppet.messagePayload = tstest_1.sinon.stub().resolves({ text: '' });
104
+ const result = await voice().text();
105
+ t.same(result, { text: '', noSpeech: true }, 'should return the puppet payload verbatim');
106
+ t.equal(result.noSpeech, true, 'should preserve noSpeech=true so the bot can skip its own ASR');
107
+ t.ok(puppet.messageVoiceText.calledOnceWith(MESSAGE_ID), 'should call messageVoiceText');
108
+ t.notOk(puppet.messagePayload.called, 'should NOT fall back when supported');
109
+ });
110
+ (0, tstest_1.test)('Voice.text() falls back to messagePayload().text on unsupported error', async (t) => {
111
+ await ensureStarted();
112
+ puppet.messageVoiceText = tstest_1.sinon.stub().rejects(UNSUPPORTED);
113
+ puppet.messagePayload = tstest_1.sinon.stub().resolves({ text: 'legacy asr' });
114
+ const result = await voice().text();
115
+ t.same(result, { text: 'legacy asr', noSpeech: false }, 'should fall back to legacy payload.text with noSpeech=false');
116
+ t.ok(puppet.messagePayload.calledOnceWith(MESSAGE_ID), 'should call messagePayload on fallback');
117
+ });
118
+ (0, tstest_1.test)('Voice.text() falls back on gRPC UNIMPLEMENTED (code 12)', async (t) => {
119
+ await ensureStarted();
120
+ const unimplemented = Object.assign(new Error('12 UNIMPLEMENTED'), { code: 12 });
121
+ puppet.messageVoiceText = tstest_1.sinon.stub().rejects(unimplemented);
122
+ puppet.messagePayload = tstest_1.sinon.stub().resolves({ text: 'legacy asr' });
123
+ const result = await voice().text();
124
+ t.same(result, { text: 'legacy asr', noSpeech: false }, 'should fall back when the server returns UNIMPLEMENTED');
125
+ t.ok(puppet.messagePayload.calledOnceWith(MESSAGE_ID), 'should call messagePayload on fallback');
126
+ });
127
+ (0, tstest_1.test)('Voice.text() falls back to messagePayload when messageVoiceText is absent (old puppet)', async (t) => {
128
+ await ensureStarted();
129
+ puppet.messageVoiceText = undefined; // old puppet built without the method at all
130
+ puppet.messagePayload = tstest_1.sinon.stub().resolves({ text: 'legacy asr' });
131
+ const result = await voice().text();
132
+ t.same(result, { text: 'legacy asr', noSpeech: false }, 'should fall back via the typeof guard with noSpeech=false');
133
+ t.ok(puppet.messagePayload.calledOnceWith(MESSAGE_ID), 'should call messagePayload on fallback');
134
+ });
135
+ (0, tstest_1.test)('Voice.text() rethrows a transient error instead of falling back', async (t) => {
136
+ await ensureStarted();
137
+ puppet.messageVoiceText = tstest_1.sinon.stub().rejects(new Error('ETIMEDOUT'));
138
+ puppet.messagePayload = tstest_1.sinon.stub().resolves({ text: 'legacy asr' });
139
+ await t.rejects(() => voice().text(), /ETIMEDOUT/, 'should rethrow the transient error');
140
+ t.notOk(puppet.messagePayload.called, 'should NOT fall back on a transient error (would drop noSpeech)');
141
+ });
142
+ (0, tstest_1.test)('Voice.text() rethrows a genuine "is not a function" TypeError from a working messageVoiceText', async (t) => {
143
+ await ensureStarted();
144
+ // regression: a real internal TypeError must NOT be downgraded — that would
145
+ // drop noSpeech and make the bot re-run its own paid ASR
146
+ puppet.messageVoiceText = tstest_1.sinon.stub().rejects(new TypeError('innerHelper.process is not a function'));
147
+ puppet.messagePayload = tstest_1.sinon.stub().resolves({ text: 'legacy asr' });
148
+ await t.rejects(() => voice().text(), /is not a function/, 'should rethrow the internal TypeError');
149
+ t.notOk(puppet.messagePayload.called, 'should NOT mask a real implementation bug');
150
+ });
151
+ (0, tstest_1.test)('teardown: stop the shared wechaty', async (t) => {
152
+ await wechaty.stop();
153
+ t.pass('stopped');
154
+ });
155
+ //# sourceMappingURL=voice.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voice.spec.js","sourceRoot":"","sources":["../../../../src/user-modules/voice.spec.ts"],"names":[],"mappings":";;;AACA;;;;;;;;;;;;;;;;;;GAkBG;AACH,mCAG2B;AAE3B,uCAAyC;AAEzC,mEAA0D;AAC1D,8DAAsD;AAEtD,MAAM,UAAU,GAAG,kBAAkB,CAAA;AAErC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,GAAI,IAAI,gCAAU,EAAS,CAAA;AACvC,MAAM,OAAO,GAAG,mCAAc,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;AAEhD,IAAI,OAAO,GAAG,KAAK,CAAA;AACnB,KAAK,UAAU,aAAa;IAC1B,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,OAAO,CAAC,KAAK,EAAE,CAAA;QACrB,OAAO,GAAG,IAAI,CAAA;KACf;AACH,CAAC;AAED,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;AAEpD,MAAM,WA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,EAAE,oCAAoC,CAAC,CAAA;IACxF,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,iEAAiE,CAAC,CAAA;AAC1G,CAAC,CAAC,CAAA;AAEF,IAAA,aAAI,EAAC,+FAA+F,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAC9G,MAAM,aAAa,EAAE,CAAA;IACrB,4EAA4E;IAC5E,yDAAyD;IACzD,MAAM,CAAC,gBAAgB,GAAG,cAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC,uCAAuC,CAAC,CAAC,CAAA;IACtG,MAAM,CAAC,cAAc,GAAK,cAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,YAAY,EAA6B,CAAC,CAAA;IAElG,MAAM,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,mBAAmB,EAAE,uCAAuC,CAAC,CAAA;IACnG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,2CAA2C,CAAC,CAAA;AACpF,CAAC,CAAC,CAAA;AAEF,IAAA,aAAI,EAAC,mCAAmC,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAClD,MAAM,OAAO,CAAC,IAAI,EAAE,CAAA;IACpB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;AACnB,CAAC,CAAC,CAAA"}
@@ -66,6 +66,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
66
66
  __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
67
67
  __wechatifiedFriendship?: import("../user-modules/friendship.js").FriendshipConstructor | undefined;
68
68
  __wechatifiedImage?: import("../user-modules/image.js").ImageConstructor | undefined;
69
+ __wechatifiedVoice?: import("../user-modules/voice.js").VoiceConstructor | undefined;
69
70
  __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
70
71
  __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
71
72
  __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
@@ -93,6 +94,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
93
94
  readonly Delay: import("../user-modules/delay.js").DelayConstructor;
94
95
  readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
95
96
  readonly Image: import("../user-modules/image.js").ImageConstructor;
97
+ readonly Voice: import("../user-modules/voice.js").VoiceConstructor;
96
98
  readonly Location: import("../user-modules/location.js").LocationConstructor;
97
99
  readonly Message: import("../user-modules/message.js").MessageConstructor;
98
100
  readonly MiniProgram: import("../user-modules/mini-program.js").MiniProgramConstructor;
@@ -164,6 +166,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
164
166
  __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
165
167
  __wechatifiedFriendship?: import("../user-modules/friendship.js").FriendshipConstructor | undefined;
166
168
  __wechatifiedImage?: import("../user-modules/image.js").ImageConstructor | undefined;
169
+ __wechatifiedVoice?: import("../user-modules/voice.js").VoiceConstructor | undefined;
167
170
  __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
168
171
  __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
169
172
  __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
@@ -191,6 +194,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
191
194
  readonly Delay: import("../user-modules/delay.js").DelayConstructor;
192
195
  readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
193
196
  readonly Image: import("../user-modules/image.js").ImageConstructor;
197
+ readonly Voice: import("../user-modules/voice.js").VoiceConstructor;
194
198
  readonly Location: import("../user-modules/location.js").LocationConstructor;
195
199
  readonly Message: import("../user-modules/message.js").MessageConstructor;
196
200
  readonly MiniProgram: import("../user-modules/mini-program.js").MiniProgramConstructor;
@@ -289,6 +293,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
289
293
  __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
290
294
  __wechatifiedFriendship?: import("../user-modules/friendship.js").FriendshipConstructor | undefined;
291
295
  __wechatifiedImage?: import("../user-modules/image.js").ImageConstructor | undefined;
296
+ __wechatifiedVoice?: import("../user-modules/voice.js").VoiceConstructor | undefined;
292
297
  __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
293
298
  __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
294
299
  __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
@@ -316,6 +321,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
316
321
  readonly Delay: import("../user-modules/delay.js").DelayConstructor;
317
322
  readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
318
323
  readonly Image: import("../user-modules/image.js").ImageConstructor;
324
+ readonly Voice: import("../user-modules/voice.js").VoiceConstructor;
319
325
  readonly Location: import("../user-modules/location.js").LocationConstructor;
320
326
  readonly Message: import("../user-modules/message.js").MessageConstructor;
321
327
  readonly MiniProgram: import("../user-modules/mini-program.js").MiniProgramConstructor;
@@ -363,6 +369,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
363
369
  __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
364
370
  __wechatifiedFriendship?: import("../user-modules/friendship.js").FriendshipConstructor | undefined;
365
371
  __wechatifiedImage?: import("../user-modules/image.js").ImageConstructor | undefined;
372
+ __wechatifiedVoice?: import("../user-modules/voice.js").VoiceConstructor | undefined;
366
373
  __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
367
374
  __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
368
375
  __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
@@ -390,6 +397,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
390
397
  readonly Delay: import("../user-modules/delay.js").DelayConstructor;
391
398
  readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
392
399
  readonly Image: import("../user-modules/image.js").ImageConstructor;
400
+ readonly Voice: import("../user-modules/voice.js").VoiceConstructor;
393
401
  readonly Location: import("../user-modules/location.js").LocationConstructor;
394
402
  readonly Message: import("../user-modules/message.js").MessageConstructor;
395
403
  readonly MiniProgram: import("../user-modules/mini-program.js").MiniProgramConstructor;
@@ -478,6 +486,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
478
486
  __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
479
487
  __wechatifiedFriendship?: import("../user-modules/friendship.js").FriendshipConstructor | undefined;
480
488
  __wechatifiedImage?: import("../user-modules/image.js").ImageConstructor | undefined;
489
+ __wechatifiedVoice?: import("../user-modules/voice.js").VoiceConstructor | undefined;
481
490
  __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
482
491
  __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
483
492
  __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
@@ -505,6 +514,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
505
514
  readonly Delay: import("../user-modules/delay.js").DelayConstructor;
506
515
  readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
507
516
  readonly Image: import("../user-modules/image.js").ImageConstructor;
517
+ readonly Voice: import("../user-modules/voice.js").VoiceConstructor;
508
518
  readonly Location: import("../user-modules/location.js").LocationConstructor;
509
519
  readonly Message: import("../user-modules/message.js").MessageConstructor;
510
520
  readonly MiniProgram: import("../user-modules/mini-program.js").MiniProgramConstructor;
@@ -1 +1 @@
1
- {"version":3,"file":"wechaty-base.d.ts","sourceRoot":"","sources":["../../../../src/wechaty/wechaty-base.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAA;AAQ9C,OAAO,KAAK,EACV,YAAY,EACZ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AAI,CAAC;IAMV,aAAa,IAChB,OAAO,CAAC,IAAI,CAAC;CAUjB;AAED,aAAK,4BAA4B,GAE7B,oBAAoB,GACpB,gCAAgC,GAChC,SAAS,GACT,SAAS,GACT,QAAQ,CAAA;AAEZ,YAAY,EACV,4BAA4B,GAC7B,CAAA;AACD,OAAO,EACL,WAAW,GACZ,CAAA"}
@@ -15,6 +15,7 @@ const wechaty_impl_js_1 = require("./wechaty-impl.js");
15
15
  Delay;
16
16
  Friendship;
17
17
  Image;
18
+ Voice;
18
19
  Location;
19
20
  Message;
20
21
  MiniProgram;
@@ -45,29 +46,30 @@ const wechaty_impl_js_1 = require("./wechaty-impl.js");
45
46
  = this.Delay
46
47
  = this.Friendship
47
48
  = this.Image
48
- = this.Location
49
- = this.Message
50
- = this.MiniProgram
51
- = this.Post
52
- = this.Room
53
- = this.RoomInvitation
54
- = this.Tag
55
- = this.TagGroup
56
- = this.UrlLink
57
- = this.Channel
58
- = this.ChannelCard
59
- = this.ConsultCard
60
- = this.PremiumOnlineAppointmentCard
61
- = this.Moment
62
- = this.Call
63
- = this.CallRecord
64
- = this.ChatHistory
65
- = this.Wecom
66
- = this.DouyinOneClickPhoneCollection
67
- = this.ImSpecific
68
- = this.WxxdProduct
69
- = this.WxxdOrder
70
- = {};
49
+ = this.Voice
50
+ = this.Location
51
+ = this.Message
52
+ = this.MiniProgram
53
+ = this.Post
54
+ = this.Room
55
+ = this.RoomInvitation
56
+ = this.Tag
57
+ = this.TagGroup
58
+ = this.UrlLink
59
+ = this.Channel
60
+ = this.ChannelCard
61
+ = this.ConsultCard
62
+ = this.PremiumOnlineAppointmentCard
63
+ = this.Moment
64
+ = this.Call
65
+ = this.CallRecord
66
+ = this.ChatHistory
67
+ = this.Wecom
68
+ = this.DouyinOneClickPhoneCollection
69
+ = this.ImSpecific
70
+ = this.WxxdProduct
71
+ = this.WxxdOrder
72
+ = {};
71
73
  }
72
74
  }
73
75
  const WechatyTest = WechatyImplementation;
@@ -1 +1 @@
1
- {"version":3,"file":"wechaty-impl.spec.js","sourceRoot":"","sources":["../../../../src/wechaty/wechaty-impl.spec.ts"],"names":[],"mappings":";;;;;;AACA,mCAA6B;AAC7B,oFAAkD;AAElD,oEAAkE;AAiClE,uDAMgD;AAEhD,IAAA,aAAI,EAAC,mBAAmB,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAClC,MAAe,qBAAsB,SAAQ,uCAAmB;QAE9D,OAAO,CAA2C;QAClD,WAAW,CAA2C;QACtD,KAAK,CAA2C;QAChD,UAAU,CAA2C;QACrD,KAAK,CAA2C;QAChD,QAAQ,CAA2C;QACnD,OAAO,CAA2C;QAClD,WAAW,CAA2C;QACtD,IAAI,CAA2C;QAC/C,IAAI,CAA2C;QAC/C,cAAc,CAA2C;QACzD,GAAG,CAA2C;QAC9C,QAAQ,CAA2C;QACnD,OAAO,CAA2C;QAClD,OAAO,CAA2C;QAClD,WAAW,CAA2C;QACtD,WAAW,CAA2C;QACtD,4BAA4B,CAA2C;QACvE,MAAM,CAA2C;QACjD,IAAI,CAA2C;QAC/C,UAAU,CAA2C;QACrD,WAAW,CAA2C;QACtD,KAAK,CAA2C;QAChD,6BAA6B,CAA2C;QACxE,UAAU,CAA2C;QACrD,WAAW,CAA2C;QACtD,SAAS,CAA2C;QAEpD;YACE,KAAK,EAAE,CAAA;YACP,cAAc;YACd,IAAI,CAAC,OAAO;kBACR,IAAI,CAAC,WAAW;sBAChB,IAAI,CAAC,KAAK;0BACV,IAAI,CAAC,UAAU;8BACf,IAAI,CAAC,KAAK;kCACV,IAAI,CAAC,QAAQ;sCACb,IAAI,CAAC,OAAO;0CACZ,IAAI,CAAC,WAAW;8CAChB,IAAI,CAAC,IAAI;kDACT,IAAI,CAAC,IAAI;sDACT,IAAI,CAAC,cAAc;0DACnB,IAAI,CAAC,GAAG;8DACR,IAAI,CAAC,QAAQ;kEACb,IAAI,CAAC,OAAO;sEACZ,IAAI,CAAC,OAAO;0EACZ,IAAI,CAAC,WAAW;8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AC,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,4DAA4D,CAAC,CAAA;AACpF,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"wechaty-impl.spec.js","sourceRoot":"","sources":["../../../../src/wechaty/wechaty-impl.spec.ts"],"names":[],"mappings":";;;;;;AACA,mCAA6B;AAC7B,oFAAkD;AAElD,oEAAkE;AAkClE,uDAMgD;AAEhD,IAAA,aAAI,EAAC,mBAAmB,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAClC,MAAe,qBAAsB,SAAQ,uCAAmB;QAE9D,OAAO,CAA2C;QAClD,WAAW,CAA2C;QACtD,KAAK,CAA2C;QAChD,UAAU,CAA2C;QACrD,KAAK,CAA2C;QAChD,KAAK,CAA2C;QAChD,QAAQ,CAA2C;QACnD,OAAO,CAA2C;QAClD,WAAW,CAA2C;QACtD,IAAI,CAA2C;QAC/C,IAAI,CAA2C;QAC/C,cAAc,CAA2C;QACzD,GAAG,CAA2C;QAC9C,QAAQ,CAA2C;QACnD,OAAO,CAA2C;QAClD,OAAO,CAA2C;QAClD,WAAW,CAA2C;QACtD,WAAW,CAA2C;QACtD,4BAA4B,CAA2C;QACvE,MAAM,CAA2C;QACjD,IAAI,CAA2C;QAC/C,UAAU,CAA2C;QACrD,WAAW,CAA2C;QACtD,KAAK,CAA2C;QAChD,6BAA6B,CAA2C;QACxE,UAAU,CAA2C;QACrD,WAAW,CAA2C;QACtD,SAAS,CAA2C;QAEpD;YACE,KAAK,EAAE,CAAA;YACP,cAAc;YACd,IAAI,CAAC,OAAO;kBACR,IAAI,CAAC,WAAW;sBAChB,IAAI,CAAC,KAAK;0BACV,IAAI,CAAC,UAAU;8BACf,IAAI,CAAC,KAAK;kCACV,IAAI,CAAC,KAAK;sCACV,IAAI,CAAC,QAAQ;0CACb,IAAI,CAAC,OAAO;8CACZ,IAAI,CAAC,WAAW;kDAChB,IAAI,CAAC,IAAI;sDACT,IAAI,CAAC,IAAI;0DACT,IAAI,CAAC,cA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AC,IAAI,EAAE,CAAA;IACpB,CAAC,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,yDAAyD,CAAC,CAAA;IAC/F,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,4DAA4D,CAAC,CAAA;AACpF,CAAC,CAAC,CAAA"}
@@ -19,6 +19,9 @@ declare const loginMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
19
19
  __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
20
20
  __wechatifiedFriendship?: import("../user-modules/friendship.js").FriendshipConstructor | undefined;
21
21
  __wechatifiedImage?: import("../user-modules/image.js").ImageConstructor | undefined;
22
+ __wechatifiedVoice?: import("../user-modules/voice.js").VoiceConstructor | undefined; /**
23
+ * @deprecated: use `isLoggedIn` property instead. will be removed after Dec 31, 2022
24
+ */
22
25
  __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
23
26
  __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
24
27
  __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
@@ -46,6 +49,7 @@ declare const loginMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
46
49
  readonly Delay: import("../user-modules/delay.js").DelayConstructor;
47
50
  readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
48
51
  readonly Image: import("../user-modules/image.js").ImageConstructor;
52
+ readonly Voice: import("../user-modules/voice.js").VoiceConstructor;
49
53
  readonly Location: import("../user-modules/location.js").LocationConstructor;
50
54
  readonly Message: import("../user-modules/message.js").MessageConstructor;
51
55
  readonly MiniProgram: import("../user-modules/mini-program.js").MiniProgramConstructor;
@@ -102,6 +106,9 @@ declare const loginMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
102
106
  __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
103
107
  __wechatifiedFriendship?: import("../user-modules/friendship.js").FriendshipConstructor | undefined;
104
108
  __wechatifiedImage?: import("../user-modules/image.js").ImageConstructor | undefined;
109
+ __wechatifiedVoice?: import("../user-modules/voice.js").VoiceConstructor | undefined; /**
110
+ * @deprecated: use `isLoggedIn` property instead. will be removed after Dec 31, 2022
111
+ */
105
112
  __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
106
113
  __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
107
114
  __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
@@ -129,6 +136,7 @@ declare const loginMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
129
136
  readonly Delay: import("../user-modules/delay.js").DelayConstructor;
130
137
  readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
131
138
  readonly Image: import("../user-modules/image.js").ImageConstructor;
139
+ readonly Voice: import("../user-modules/voice.js").VoiceConstructor;
132
140
  readonly Location: import("../user-modules/location.js").LocationConstructor;
133
141
  readonly Message: import("../user-modules/message.js").MessageConstructor;
134
142
  readonly MiniProgram: import("../user-modules/mini-program.js").MiniProgramConstructor;
@@ -317,6 +325,9 @@ declare const loginMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
317
325
  __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
318
326
  __wechatifiedFriendship?: import("../user-modules/friendship.js").FriendshipConstructor | undefined;
319
327
  __wechatifiedImage?: import("../user-modules/image.js").ImageConstructor | undefined;
328
+ __wechatifiedVoice?: import("../user-modules/voice.js").VoiceConstructor | undefined; /**
329
+ * @deprecated: use `isLoggedIn` property instead. will be removed after Dec 31, 2022
330
+ */
320
331
  __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
321
332
  __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
322
333
  __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
@@ -344,6 +355,7 @@ declare const loginMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
344
355
  readonly Delay: import("../user-modules/delay.js").DelayConstructor;
345
356
  readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
346
357
  readonly Image: import("../user-modules/image.js").ImageConstructor;
358
+ readonly Voice: import("../user-modules/voice.js").VoiceConstructor;
347
359
  readonly Location: import("../user-modules/location.js").LocationConstructor;
348
360
  readonly Message: import("../user-modules/message.js").MessageConstructor;
349
361
  readonly MiniProgram: import("../user-modules/mini-program.js").MiniProgramConstructor;
@@ -1 +1 @@
1
- {"version":3,"file":"login-mixin.d.ts","sourceRoot":"","sources":["../../../../src/wechaty-mixins/login-mixin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,oBAAoB,EACrB,MAAoC,wBAAwB,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAKxD,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDAgDU,GAAG,EAAE;;IAvC3B;;;;;;;OAOG;;IAMH;;;;;;;;;;OAUG;;;YAqBqB,QAAQ,IAAI,CAAC;IAUrC;;;;;;OAMG;oBACoB,MAAM,GAAG,QAAQ,IAAI,CAAC;IAK7C;;OAEG;gBACU,OAAO;IAKpB;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAWN,CAAA;AAED,aAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AAE/C,aAAK,2BAA2B,GAC5B,UA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@@ declare const miscMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
18
18
  __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
19
19
  __wechatifiedFriendship?: import("../user-modules/friendship.js").FriendshipConstructor | undefined;
20
20
  __wechatifiedImage?: import("../user-modules/image.js").ImageConstructor | undefined;
21
+ __wechatifiedVoice?: import("../user-modules/voice.js").VoiceConstructor | undefined;
21
22
  __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
22
23
  __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
23
24
  __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
@@ -45,6 +46,7 @@ declare const miscMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
45
46
  readonly Delay: import("../user-modules/delay.js").DelayConstructor;
46
47
  readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
47
48
  readonly Image: import("../user-modules/image.js").ImageConstructor;
49
+ readonly Voice: import("../user-modules/voice.js").VoiceConstructor;
48
50
  readonly Location: import("../user-modules/location.js").LocationConstructor;
49
51
  readonly Message: import("../user-modules/message.js").MessageConstructor;
50
52
  readonly MiniProgram: import("../user-modules/mini-program.js").MiniProgramConstructor;
@@ -103,6 +105,7 @@ declare const miscMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
103
105
  __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
104
106
  __wechatifiedFriendship?: import("../user-modules/friendship.js").FriendshipConstructor | undefined;
105
107
  __wechatifiedImage?: import("../user-modules/image.js").ImageConstructor | undefined;
108
+ __wechatifiedVoice?: import("../user-modules/voice.js").VoiceConstructor | undefined;
106
109
  __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
107
110
  __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
108
111
  __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
@@ -130,6 +133,7 @@ declare const miscMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
130
133
  readonly Delay: import("../user-modules/delay.js").DelayConstructor;
131
134
  readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
132
135
  readonly Image: import("../user-modules/image.js").ImageConstructor;
136
+ readonly Voice: import("../user-modules/voice.js").VoiceConstructor;
133
137
  readonly Location: import("../user-modules/location.js").LocationConstructor;
134
138
  readonly Message: import("../user-modules/message.js").MessageConstructor;
135
139
  readonly MiniProgram: import("../user-modules/mini-program.js").MiniProgramConstructor;
@@ -313,6 +317,7 @@ declare const miscMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
313
317
  __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
314
318
  __wechatifiedFriendship?: import("../user-modules/friendship.js").FriendshipConstructor | undefined;
315
319
  __wechatifiedImage?: import("../user-modules/image.js").ImageConstructor | undefined;
320
+ __wechatifiedVoice?: import("../user-modules/voice.js").VoiceConstructor | undefined;
316
321
  __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
317
322
  __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
318
323
  __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
@@ -340,6 +345,7 @@ declare const miscMixin: <MixinBase extends typeof WechatySkeleton & ((abstract
340
345
  readonly Delay: import("../user-modules/delay.js").DelayConstructor;
341
346
  readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
342
347
  readonly Image: import("../user-modules/image.js").ImageConstructor;
348
+ readonly Voice: import("../user-modules/voice.js").VoiceConstructor;
343
349
  readonly Location: import("../user-modules/location.js").LocationConstructor;
344
350
  readonly Message: import("../user-modules/message.js").MessageConstructor;
345
351
  readonly MiniProgram: import("../user-modules/mini-program.js").MiniProgramConstructor;
@@ -1 +1 @@
1
- {"version":3,"file":"misc-mixin.d.ts","sourceRoot":"","sources":["../../../../src/wechaty-mixins/misc-mixin.ts"],"names":[],"mappings":"AAIA,OAAO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