@juzi/wechaty 1.0.15 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/src/mods/impls.d.ts +3 -3
- package/dist/cjs/src/mods/impls.d.ts.map +1 -1
- package/dist/cjs/src/mods/impls.js +2 -1
- package/dist/cjs/src/mods/impls.js.map +1 -1
- package/dist/cjs/src/mods/users.d.ts +1 -1
- package/dist/cjs/src/mods/users.d.ts.map +1 -1
- package/dist/cjs/src/package-json.js +4 -4
- package/dist/cjs/src/package-json.js.map +1 -1
- package/dist/cjs/src/user-modules/contact.d.ts +8 -0
- package/dist/cjs/src/user-modules/contact.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/contact.js +19 -5
- package/dist/cjs/src/user-modules/contact.js.map +1 -1
- package/dist/cjs/src/user-modules/mod.d.ts +4 -3
- package/dist/cjs/src/user-modules/mod.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/mod.js +3 -1
- package/dist/cjs/src/user-modules/mod.js.map +1 -1
- package/dist/cjs/src/user-modules/post.js +1 -1
- package/dist/cjs/src/user-modules/room.d.ts +0 -4
- package/dist/cjs/src/user-modules/room.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/room.js +3 -15
- package/dist/cjs/src/user-modules/room.js.map +1 -1
- package/dist/cjs/src/user-modules/tag-group.d.ts +60 -0
- package/dist/cjs/src/user-modules/tag-group.d.ts.map +1 -0
- package/dist/cjs/src/user-modules/tag-group.js +71 -0
- package/dist/cjs/src/user-modules/tag-group.js.map +1 -0
- package/dist/cjs/src/user-modules/tag.d.ts +37 -64
- package/dist/cjs/src/user-modules/tag.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/tag.js +52 -127
- package/dist/cjs/src/user-modules/tag.js.map +1 -1
- package/dist/cjs/src/wechaty/wechaty-base.d.ts +15 -5
- package/dist/cjs/src/wechaty/wechaty-base.d.ts.map +1 -1
- package/dist/cjs/src/wechaty/wechaty-impl.spec.js +5 -3
- package/dist/cjs/src/wechaty/wechaty-impl.spec.js.map +1 -1
- package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts +6 -0
- package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/misc-mixin.d.ts +9 -9
- package/dist/cjs/src/wechaty-mixins/misc-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/plugin-mixin.d.ts +8 -0
- package/dist/cjs/src/wechaty-mixins/plugin-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts +14 -20
- package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/puppet-mixin.js +6 -2
- package/dist/cjs/src/wechaty-mixins/puppet-mixin.js.map +1 -1
- package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.d.ts +4 -2
- package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.js +3 -0
- package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.js.map +1 -1
- package/dist/esm/src/mods/impls.d.ts +3 -3
- package/dist/esm/src/mods/impls.d.ts.map +1 -1
- package/dist/esm/src/mods/impls.js +1 -1
- package/dist/esm/src/mods/impls.js.map +1 -1
- package/dist/esm/src/mods/users.d.ts +1 -1
- package/dist/esm/src/mods/users.d.ts.map +1 -1
- package/dist/esm/src/package-json.js +4 -4
- package/dist/esm/src/package-json.js.map +1 -1
- package/dist/esm/src/user-modules/contact.d.ts +8 -0
- package/dist/esm/src/user-modules/contact.d.ts.map +1 -1
- package/dist/esm/src/user-modules/contact.js +19 -5
- package/dist/esm/src/user-modules/contact.js.map +1 -1
- package/dist/esm/src/user-modules/mod.d.ts +4 -3
- package/dist/esm/src/user-modules/mod.d.ts.map +1 -1
- package/dist/esm/src/user-modules/mod.js +2 -1
- package/dist/esm/src/user-modules/mod.js.map +1 -1
- package/dist/esm/src/user-modules/post.js +1 -1
- package/dist/esm/src/user-modules/room.d.ts +0 -4
- package/dist/esm/src/user-modules/room.d.ts.map +1 -1
- package/dist/esm/src/user-modules/room.js +3 -15
- package/dist/esm/src/user-modules/room.js.map +1 -1
- package/dist/esm/src/user-modules/tag-group.d.ts +60 -0
- package/dist/esm/src/user-modules/tag-group.d.ts.map +1 -0
- package/dist/esm/src/user-modules/tag-group.js +68 -0
- package/dist/esm/src/user-modules/tag-group.js.map +1 -0
- package/dist/esm/src/user-modules/tag.d.ts +37 -64
- package/dist/esm/src/user-modules/tag.d.ts.map +1 -1
- package/dist/esm/src/user-modules/tag.js +52 -127
- package/dist/esm/src/user-modules/tag.js.map +1 -1
- package/dist/esm/src/wechaty/wechaty-base.d.ts +15 -5
- package/dist/esm/src/wechaty/wechaty-base.d.ts.map +1 -1
- package/dist/esm/src/wechaty/wechaty-impl.spec.js +5 -3
- package/dist/esm/src/wechaty/wechaty-impl.spec.js.map +1 -1
- package/dist/esm/src/wechaty-mixins/login-mixin.d.ts +6 -0
- package/dist/esm/src/wechaty-mixins/login-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/misc-mixin.d.ts +9 -9
- package/dist/esm/src/wechaty-mixins/misc-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/plugin-mixin.d.ts +8 -0
- package/dist/esm/src/wechaty-mixins/plugin-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts +14 -20
- package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/puppet-mixin.js +6 -2
- package/dist/esm/src/wechaty-mixins/puppet-mixin.js.map +1 -1
- package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.d.ts +4 -2
- package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.js +4 -1
- package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.js.map +1 -1
- package/package.json +3 -3
- package/src/mods/impls.ts +3 -0
- package/src/mods/users.ts +1 -0
- package/src/package-json.ts +4 -4
- package/src/user-modules/contact.ts +27 -5
- package/src/user-modules/mod.ts +8 -0
- package/src/user-modules/post.ts +1 -1
- package/src/user-modules/room.ts +3 -17
- package/src/user-modules/tag-group.ts +115 -0
- package/src/user-modules/tag.ts +61 -124
- package/src/wechaty/wechaty-impl.spec.ts +3 -0
- package/src/wechaty-mixins/puppet-mixin.ts +6 -2
- package/src/wechaty-mixins/wechatify-user-module-mixin.ts +6 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TagGroupImpl = void 0;
|
|
4
|
+
const config_js_1 = require("../config.js");
|
|
5
|
+
const validation_js_1 = require("../user-mixins/validation.js");
|
|
6
|
+
const wechatify_js_1 = require("../user-mixins/wechatify.js");
|
|
7
|
+
class TagGroupMixin extends (0, wechatify_js_1.wechatifyMixinBase)() {
|
|
8
|
+
payload;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* Create
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
static create(payload) {
|
|
15
|
+
config_js_1.log.verbose('TagGroup', 'create()');
|
|
16
|
+
return new this(payload);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @hideconstructor
|
|
20
|
+
*/
|
|
21
|
+
constructor(payload) {
|
|
22
|
+
super();
|
|
23
|
+
this.payload = payload;
|
|
24
|
+
config_js_1.log.silly('TagGroup', 'constructor()');
|
|
25
|
+
}
|
|
26
|
+
id() {
|
|
27
|
+
return this.payload.id;
|
|
28
|
+
}
|
|
29
|
+
name() {
|
|
30
|
+
return this.payload.name;
|
|
31
|
+
}
|
|
32
|
+
static async createTagGroup(name) {
|
|
33
|
+
config_js_1.log.verbose('TagGroup', 'createTagGroup(%s, %s)', name);
|
|
34
|
+
try {
|
|
35
|
+
const payload = await this.wechaty.puppet.tagGroupAdd(name);
|
|
36
|
+
if (payload) {
|
|
37
|
+
return new this(payload);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
this.wechaty.emitError(e);
|
|
42
|
+
config_js_1.log.error('Contact', 'createTag() exception: %s', e.message);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
static async deleteTagGroup(tagGroup) {
|
|
46
|
+
config_js_1.log.verbose('TagGroup', 'deleteTagGroup(%s)', tagGroup);
|
|
47
|
+
try {
|
|
48
|
+
await this.wechaty.puppet.tagGroupDelete(tagGroup.id());
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
this.wechaty.emitError(e);
|
|
52
|
+
config_js_1.log.error('Contact', 'createTag() exception: %s', e.message);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
static async list() {
|
|
56
|
+
config_js_1.log.verbose('TagGroup', 'list()');
|
|
57
|
+
try {
|
|
58
|
+
const payloads = await this.wechaty.puppet.tagGroupList();
|
|
59
|
+
return payloads.map(payload => new this(payload));
|
|
60
|
+
}
|
|
61
|
+
catch (e) {
|
|
62
|
+
this.wechaty.emitError(e);
|
|
63
|
+
config_js_1.log.error('TagGroup', 'list() exception: %s', e.message);
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
class TagGroupImpl extends (0, validation_js_1.validationMixin)(TagGroupMixin)() {
|
|
69
|
+
}
|
|
70
|
+
exports.TagGroupImpl = TagGroupImpl;
|
|
71
|
+
//# sourceMappingURL=tag-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag-group.js","sourceRoot":"","sources":["../../../../src/user-modules/tag-group.ts"],"names":[],"mappings":";;;AAsBA,4CAAkC;AAElC,gEAA8D;AAC9D,8DAEoC;AAEpC,MAAM,aAAc,S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,CAAC,CAAA;SACxD;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;YACzB,eAAG,CAAC,KAAK,CAAC,SAAS,EAAE,2BAA2B,EAAG,CAAW,CAAC,OAAO,CAAC,CAAA;SACxE;IACH,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,IAAI;QACf,eAAG,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;QAEjC,IAAI;YACF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,CAAA;YACzD,OAAO,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;SAClD;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;YACzB,eAAG,CAAC,KAAK,CAAC,UAAU,EAAE,sBAAsB,EAAG,CAAW,CAAC,OAAO,CAAC,CAAA;YACnE,OAAO,EAAE,CAAA;SACV;IACH,CAAC;CAEF;AAED,MAAM,YAAa,SAAQ,IAAA,+BAAe,EAAC,aAAa,CAAC,EAAqB;CAAI;AAahF,oCAAY"}
|
|
@@ -1,80 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wechaty Chatbot SDK - https://github.com/wechaty/wechaty
|
|
3
|
+
*
|
|
4
|
+
* @copyright 2016 Huan LI (李卓桓) <https://github.com/huan>, and
|
|
5
|
+
* Wechaty Contributors <https://github.com/wechaty>.
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
import type * as PUPPET from '@juzi/wechaty-puppet';
|
|
1
21
|
import type { Constructor } from 'clone-class';
|
|
2
|
-
import { ContactInterface
|
|
3
|
-
|
|
4
|
-
declare const MixinBase: ((abstract new (...args: any[]) => {}) & {
|
|
5
|
-
_pool?: Map<string, TagInterface> | undefined;
|
|
6
|
-
readonly pool: Map<string, TagInterface>;
|
|
7
|
-
load<L extends import("clone-class/dist/esm/src/constructor.js").ClassInterface<{}> & {
|
|
8
|
-
new (...args: any[]): TagInterface;
|
|
9
|
-
prototype: TagInterface;
|
|
10
|
-
} & import("../user-mixins/poolify.js").PoolifyMixin<TagInterface>>(this: L, id: string): TagInterface;
|
|
11
|
-
}) & ((abstract new (...args: any[]) => {
|
|
22
|
+
import type { ContactInterface } from './contact.js';
|
|
23
|
+
declare const TagMixin_base: ((abstract new (...args: any[]) => {
|
|
12
24
|
readonly wechaty: import("../wechaty/wechaty-impl.js").WechatyInterface;
|
|
13
25
|
}) & {
|
|
14
26
|
readonly wechaty: import("../wechaty/wechaty-impl.js").WechatyInterface;
|
|
15
27
|
}) & {
|
|
16
28
|
new (): {};
|
|
17
29
|
};
|
|
18
|
-
declare class TagMixin extends
|
|
19
|
-
readonly
|
|
30
|
+
declare class TagMixin extends TagMixin_base {
|
|
31
|
+
readonly payload: PUPPET.payloads.Tag;
|
|
20
32
|
/**
|
|
21
|
-
* @hideconstructor
|
|
22
|
-
*/
|
|
23
|
-
constructor(id: string);
|
|
24
|
-
/**
|
|
25
|
-
* Get a Tag instance for "tag"
|
|
26
|
-
*
|
|
27
|
-
* > Tips:
|
|
28
|
-
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
|
|
29
|
-
*
|
|
30
|
-
* @static
|
|
31
|
-
* @param {string} [tag] the tag name which want to create
|
|
32
|
-
* @returns {Promise<TagImpl>}
|
|
33
|
-
* @example
|
|
34
|
-
* const bot = new Wechaty()
|
|
35
|
-
* await bot.Tag.get('TagName')
|
|
36
|
-
*/
|
|
37
|
-
static get(tag: string): Promise<TagInterface>;
|
|
38
|
-
/**
|
|
39
|
-
* Delete a tag from Wechat
|
|
40
|
-
*
|
|
41
|
-
* If you want to delete a tag, please make sure there's no more Contact/Favorite(s) are using this tag.
|
|
42
|
-
* If this tag is be used by any Contact/Favorite, then it can not be deleted.
|
|
43
|
-
* (This is for protecting the tag being deleted by mistake)
|
|
44
33
|
*
|
|
45
|
-
*
|
|
46
|
-
* @returns {Promise<TagInterface[]>}
|
|
47
|
-
* @example
|
|
48
|
-
* const tag = wechaty.Tag.get('tag')
|
|
49
|
-
* await wechaty.Tag.delete(tag)
|
|
50
|
-
*/
|
|
51
|
-
/**
|
|
52
|
-
* TODO: refactoring the target: do not use ContactIml or FavoriteImpl
|
|
53
|
-
*/
|
|
54
|
-
static delete(tag: TagInterface, target?: typeof ContactImpl | typeof FavoriteImpl): Promise<void>;
|
|
55
|
-
/**
|
|
56
|
-
* Add tag for contact
|
|
34
|
+
* Create
|
|
57
35
|
*
|
|
58
|
-
* > Tips:
|
|
59
|
-
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
|
|
60
|
-
*
|
|
61
|
-
* @param {ContactInterface} [to] the contact which need to add tag
|
|
62
|
-
* @returns {Promise<void>}
|
|
63
|
-
* @example
|
|
64
|
-
* await tag.add(contact)
|
|
65
36
|
*/
|
|
66
|
-
|
|
37
|
+
static create(payload: PUPPET.payloads.Tag): TagInterface;
|
|
67
38
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* > Tips:
|
|
71
|
-
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
|
|
72
|
-
*
|
|
73
|
-
* @returns {Promise<void>}
|
|
74
|
-
* @example
|
|
75
|
-
* await tag.remove(contact)
|
|
39
|
+
* @hideconstructor
|
|
76
40
|
*/
|
|
77
|
-
|
|
41
|
+
constructor(payload: PUPPET.payloads.Tag);
|
|
42
|
+
id(): string;
|
|
43
|
+
type(): PUPPET.types.Tag;
|
|
44
|
+
groupId(): string;
|
|
45
|
+
name(): string;
|
|
46
|
+
static list(): Promise<TagInterface[]>;
|
|
47
|
+
contactList(): Promise<ContactInterface[]>;
|
|
48
|
+
tag(contact: ContactInterface): Promise<void>;
|
|
49
|
+
static createTag(tagGroupId: string | undefined, name: string): Promise<TagInterface | void>;
|
|
50
|
+
static deleteTag(tag: TagInterface): Promise<void>;
|
|
78
51
|
}
|
|
79
52
|
declare const TagImpl_base: {
|
|
80
53
|
new (...args: any[]): {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../../src/user-modules/tag.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../../src/user-modules/tag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,sBAAsB,CAAA;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAO9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;;;;;;;;AAEpD,cAAM,QAAS,SAAQ,aAAoB;aAiBvB,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG;IAf9C;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAE,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,YAAY;IAM1D;;OAEG;gBAEe,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG;IAM9C,EAAE,IAAK,MAAM;IAIb,IAAI,IAAK,MAAM,CAAC,KAAK,CAAC,GAAG;IAIzB,OAAO,IAAK,MAAM;IAIlB,IAAI,IAAK,MAAM;WAIF,IAAI,IAAK,OAAO,CAAC,YAAY,EAAE,CAAC;IAavC,WAAW,IAAK,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAQ3C,GAAG,CAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;WAOvC,SAAS,CAAE,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;WActF,SAAS,CAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;CAW1D;;;;;;;AAED,cAAM,OAAQ,SAAQ,YAAyC;CAAG;AAClE,UAAU,YAAa,SAAQ,OAAO;CAAG;AAEzC,aAAK,cAAc,GAAG,WAAW,CAC/B,YAAY,EACZ,OAAO,OAAO,CACf,CAAA;AAED,YAAY,EACV,cAAc,EACd,YAAY,GACb,CAAA;AACD,OAAO,EACL,OAAO,GACR,CAAA"}
|
|
@@ -1,159 +1,84 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TagImpl = void 0;
|
|
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 wechaty_puppet_1 = require("@juzi/wechaty-puppet");
|
|
24
|
-
const contact_js_1 = require("./contact.js");
|
|
25
|
-
const favorite_js_1 = require("./favorite.js");
|
|
26
|
-
const poolify_js_1 = require("../user-mixins/poolify.js");
|
|
4
|
+
const config_js_1 = require("../config.js");
|
|
27
5
|
const validation_js_1 = require("../user-mixins/validation.js");
|
|
28
6
|
const wechatify_js_1 = require("../user-mixins/wechatify.js");
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
id;
|
|
7
|
+
class TagMixin extends (0, wechatify_js_1.wechatifyMixinBase)() {
|
|
8
|
+
payload;
|
|
32
9
|
/**
|
|
33
|
-
* @hideconstructor
|
|
34
|
-
*/
|
|
35
|
-
constructor(id) {
|
|
36
|
-
super();
|
|
37
|
-
this.id = id;
|
|
38
|
-
wechaty_puppet_1.log.silly('Tag', `constructor(${id})`);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Get a Tag instance for "tag"
|
|
42
10
|
*
|
|
43
|
-
*
|
|
44
|
-
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
|
|
11
|
+
* Create
|
|
45
12
|
*
|
|
46
|
-
* @static
|
|
47
|
-
* @param {string} [tag] the tag name which want to create
|
|
48
|
-
* @returns {Promise<TagImpl>}
|
|
49
|
-
* @example
|
|
50
|
-
* const bot = new Wechaty()
|
|
51
|
-
* await bot.Tag.get('TagName')
|
|
52
13
|
*/
|
|
53
|
-
static
|
|
54
|
-
|
|
55
|
-
return this
|
|
14
|
+
static create(payload) {
|
|
15
|
+
config_js_1.log.verbose('Tag', 'create()');
|
|
16
|
+
return new this(payload);
|
|
56
17
|
}
|
|
57
18
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* If you want to delete a tag, please make sure there's no more Contact/Favorite(s) are using this tag.
|
|
61
|
-
* If this tag is be used by any Contact/Favorite, then it can not be deleted.
|
|
62
|
-
* (This is for protecting the tag being deleted by mistake)
|
|
63
|
-
*
|
|
64
|
-
* @static
|
|
65
|
-
* @returns {Promise<TagInterface[]>}
|
|
66
|
-
* @example
|
|
67
|
-
* const tag = wechaty.Tag.get('tag')
|
|
68
|
-
* await wechaty.Tag.delete(tag)
|
|
69
|
-
*/
|
|
70
|
-
/**
|
|
71
|
-
* TODO: refactoring the target: do not use ContactIml or FavoriteImpl
|
|
19
|
+
* @hideconstructor
|
|
72
20
|
*/
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
21
|
+
constructor(payload) {
|
|
22
|
+
super();
|
|
23
|
+
this.payload = payload;
|
|
24
|
+
config_js_1.log.silly('Tag', 'constructor()');
|
|
25
|
+
}
|
|
26
|
+
id() {
|
|
27
|
+
return this.payload.id;
|
|
28
|
+
}
|
|
29
|
+
type() {
|
|
30
|
+
return this.payload.type;
|
|
31
|
+
}
|
|
32
|
+
groupId() {
|
|
33
|
+
return this.payload.groupId || '';
|
|
34
|
+
}
|
|
35
|
+
name() {
|
|
36
|
+
return this.payload.name;
|
|
37
|
+
}
|
|
38
|
+
static async list() {
|
|
39
|
+
config_js_1.log.verbose('Tag', 'list()');
|
|
80
40
|
try {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
*/
|
|
84
|
-
if (!target || target === contact_js_1.ContactImpl || target === this.wechaty.Contact) {
|
|
85
|
-
await this.wechaty.puppet.tagContactDelete(tag.id);
|
|
86
|
-
// TODO:
|
|
87
|
-
// } else if (!target || target === Favorite || target === this.wechaty.Favorite) {
|
|
88
|
-
// await this.wechaty.puppet.tagFavoriteDelete(tag.id)
|
|
89
|
-
}
|
|
41
|
+
const payloads = await this.wechaty.puppet.tagTagList();
|
|
42
|
+
return payloads.map(payload => new this(payload));
|
|
90
43
|
}
|
|
91
44
|
catch (e) {
|
|
92
45
|
this.wechaty.emitError(e);
|
|
93
|
-
|
|
46
|
+
config_js_1.log.error('Tag', 'list() exception: %s', e.message);
|
|
47
|
+
return [];
|
|
94
48
|
}
|
|
95
49
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
async
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Huan(202110): TODO: refactory this design:
|
|
111
|
-
* 1. we should not pass `typeof ContactImpl` as argument
|
|
112
|
-
* 2. use instanceof to check the type of `to`
|
|
113
|
-
*/
|
|
50
|
+
async contactList() {
|
|
51
|
+
config_js_1.log.verbose('Tag', 'contactList() for tag id: %s', this.id());
|
|
52
|
+
const contactIds = await this.wechaty.puppet.tagTagContactList(this.groupId(), this.id());
|
|
53
|
+
const contactPromises = contactIds.map(id => this.wechaty.Contact.find({ id }));
|
|
54
|
+
return Promise.all(contactPromises);
|
|
55
|
+
}
|
|
56
|
+
async tag(contact) {
|
|
57
|
+
config_js_1.log.verbose('Tag', 'tag(%s) for tag id: %s', contact, this.id());
|
|
58
|
+
const contactId = contact.id;
|
|
59
|
+
await this.wechaty.puppet.tagContactTagAdd(this.groupId(), this.id(), contactId);
|
|
60
|
+
}
|
|
61
|
+
static async createTag(tagGroupId, name) {
|
|
62
|
+
config_js_1.log.verbose('Tag', 'createTag(%s, %s)', tagGroupId, name);
|
|
114
63
|
try {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
else if (favorite_js_1.FavoriteImpl.valid(to)) {
|
|
119
|
-
// TODO: await this.wechaty.puppet.tagAddFavorite(this.tag, to.id)
|
|
64
|
+
const payload = await this.wechaty.puppet.tagTagAdd(tagGroupId, name);
|
|
65
|
+
if (payload) {
|
|
66
|
+
return new this(payload);
|
|
120
67
|
}
|
|
121
68
|
}
|
|
122
69
|
catch (e) {
|
|
123
70
|
this.wechaty.emitError(e);
|
|
124
|
-
|
|
125
|
-
throw new Error(`add error : ${e}`);
|
|
71
|
+
config_js_1.log.error('Contact', 'createTag() exception: %s', e.message);
|
|
126
72
|
}
|
|
127
73
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
*
|
|
131
|
-
* > Tips:
|
|
132
|
-
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
|
|
133
|
-
*
|
|
134
|
-
* @returns {Promise<void>}
|
|
135
|
-
* @example
|
|
136
|
-
* await tag.remove(contact)
|
|
137
|
-
*/
|
|
138
|
-
async remove(from) {
|
|
139
|
-
wechaty_puppet_1.log.verbose('Tag', 'remove(%s) for %s', from, this.id);
|
|
140
|
-
/**
|
|
141
|
-
* Huan(202110): TODO: refactory this design:
|
|
142
|
-
* 1. we should not pass `typeof ContactImpl` as argument
|
|
143
|
-
* 2. use instanceof to check the type of `to`
|
|
144
|
-
*/
|
|
74
|
+
static async deleteTag(tag) {
|
|
75
|
+
config_js_1.log.verbose('Tag', 'deleteTag(%s, %s)', tag);
|
|
145
76
|
try {
|
|
146
|
-
|
|
147
|
-
await this.wechaty.puppet.tagContactRemove(this.id, from.id);
|
|
148
|
-
}
|
|
149
|
-
else if (from instanceof favorite_js_1.FavoriteImpl) {
|
|
150
|
-
// TODO await this.wechaty.puppet.tagRemoveFavorite(this.tag, from.id)
|
|
151
|
-
}
|
|
77
|
+
await this.wechaty.puppet.tagTagDelete(tag.groupId(), tag.id());
|
|
152
78
|
}
|
|
153
79
|
catch (e) {
|
|
154
80
|
this.wechaty.emitError(e);
|
|
155
|
-
|
|
156
|
-
throw new Error(`remove error : ${e}`);
|
|
81
|
+
config_js_1.log.error('Contact', 'deleteTag() exception: %s', e.message);
|
|
157
82
|
}
|
|
158
83
|
}
|
|
159
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../../../../src/user-modules/tag.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../../../../src/user-modules/tag.ts"],"names":[],"mappings":";;;AAsBA,4CAAkC;AAElC,gEAA8D;AAC9D,8DAEwD;AAGxD,MAAM,QAAS,SAAQ,IAAA,iCAAkB,GAAE;IAiBvB;IAflB;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAE,OAA4B;QACzC,eAAG,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;QAE9B,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,CAAA;IAC1B,CAAC;IAED;;OAEG;IACH,YACkB,OAA4B;QAE5C,KAAK,EAAE,CAAA;QAFS,YAAO,GAAP,OAAO,CAAqB;QAG5C,eAAG,CAAC,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,CAAA;IACnC,CAAC;IAED,EAAE;QACA,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAA;IACxB,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAA;IAC1B,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAA;IACnC,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAA;IAC1B,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,IAAI;QACf,eAAG,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;QAE5B,IAAI;YACF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,CAAA;YACvD,OAAO,QAAQ,CAAC,GAAG,CA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E,UAAU,EAAE,IAAI,CAAC,CAAA;QAEzD,IAAI;YACF,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;YACrE,IAAI,OAAO,EAAE;gBACX,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,CAAA;aACzB;SACF;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;YACzB,eAAG,CAAC,KAAK,CAAC,SAAS,EAAE,2BAA2B,EAAG,CAAW,CAAC,OAAO,CAAC,CAAA;SACxE;IACH,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,SAAS,CAAE,GAAiB;QACvC,eAAG,CAAC,OAAO,CAAC,KAAK,EAAE,mBAAmB,EAAE,GAAG,CAAC,CAAA;QAE5C,IAAI;YACF,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAA;SAChE;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;YACzB,eAAG,CAAC,KAAK,CAAC,SAAS,EAAE,2BAA2B,EAAG,CAAW,CAAC,OAAO,CAAC,CAAA;SACxE;IACH,CAAC;CAEF;AAED,MAAM,OAAQ,SAAQ,IAAA,+BAAe,EAAC,QAAQ,CAAC,EAAgB;CAAG;AAahE,0BAAO"}
|
|
@@ -67,12 +67,12 @@ declare const mixinBase: (abstract new (...args: any[]) => {
|
|
|
67
67
|
__wechatifiedRoom?: import("../user-modules/room.js").RoomConstructor | undefined;
|
|
68
68
|
__wechatifiedRoomInvitation?: import("../user-modules/room-invitation.js").RoomInvitationConstructor | undefined;
|
|
69
69
|
__wechatifiedTag?: import("../user-modules/tag.js").TagConstructor | undefined;
|
|
70
|
+
__wechatifiedTagGroup?: import("../user-modules/tag-group.js").TagGroupConstructor | undefined;
|
|
70
71
|
__wechatifiedUrlLink?: import("../user-modules/url-link.js").UrlLinkConstructor | undefined;
|
|
71
72
|
__wechatifiedChannel?: import("../user-modules/channel.js").ChannelConstructor | undefined;
|
|
72
73
|
readonly Contact: import("../user-modules/contact.js").ContactConstructor;
|
|
73
74
|
readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor;
|
|
74
75
|
readonly Delay: import("../user-modules/delay.js").DelayConstructor;
|
|
75
|
-
readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
|
|
76
76
|
/**
|
|
77
77
|
* Main bot class.
|
|
78
78
|
*
|
|
@@ -96,6 +96,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
|
|
|
96
96
|
* bot.on('message', message => console.log(`Message: ${message}`))
|
|
97
97
|
* bot.start()
|
|
98
98
|
*/
|
|
99
|
+
readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
|
|
99
100
|
readonly Image: import("../user-modules/image.js").ImageConstructor;
|
|
100
101
|
readonly Location: import("../user-modules/location.js").LocationConstructor;
|
|
101
102
|
readonly Message: import("../user-modules/message.js").MessageConstructor;
|
|
@@ -104,6 +105,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
|
|
|
104
105
|
readonly Room: import("../user-modules/room.js").RoomConstructor;
|
|
105
106
|
readonly RoomInvitation: import("../user-modules/room-invitation.js").RoomInvitationConstructor;
|
|
106
107
|
readonly Tag: import("../user-modules/tag.js").TagConstructor;
|
|
108
|
+
readonly TagGroup: import("../user-modules/tag-group.js").TagGroupConstructor;
|
|
107
109
|
readonly UrlLink: import("../user-modules/url-link.js").UrlLinkConstructor;
|
|
108
110
|
readonly Channel: import("../user-modules/channel.js").ChannelConstructor;
|
|
109
111
|
__io?: import("../io.js").Io | undefined;
|
|
@@ -159,12 +161,12 @@ declare const mixinBase: (abstract new (...args: any[]) => {
|
|
|
159
161
|
__wechatifiedRoom?: import("../user-modules/room.js").RoomConstructor | undefined;
|
|
160
162
|
__wechatifiedRoomInvitation?: import("../user-modules/room-invitation.js").RoomInvitationConstructor | undefined;
|
|
161
163
|
__wechatifiedTag?: import("../user-modules/tag.js").TagConstructor | undefined;
|
|
164
|
+
__wechatifiedTagGroup?: import("../user-modules/tag-group.js").TagGroupConstructor | undefined;
|
|
162
165
|
__wechatifiedUrlLink?: import("../user-modules/url-link.js").UrlLinkConstructor | undefined;
|
|
163
166
|
__wechatifiedChannel?: import("../user-modules/channel.js").ChannelConstructor | undefined;
|
|
164
167
|
readonly Contact: import("../user-modules/contact.js").ContactConstructor;
|
|
165
168
|
readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor;
|
|
166
169
|
readonly Delay: import("../user-modules/delay.js").DelayConstructor;
|
|
167
|
-
readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
|
|
168
170
|
/**
|
|
169
171
|
* Main bot class.
|
|
170
172
|
*
|
|
@@ -188,6 +190,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
|
|
|
188
190
|
* bot.on('message', message => console.log(`Message: ${message}`))
|
|
189
191
|
* bot.start()
|
|
190
192
|
*/
|
|
193
|
+
readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
|
|
191
194
|
readonly Image: import("../user-modules/image.js").ImageConstructor;
|
|
192
195
|
readonly Location: import("../user-modules/location.js").LocationConstructor;
|
|
193
196
|
readonly Message: import("../user-modules/message.js").MessageConstructor;
|
|
@@ -196,6 +199,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
|
|
|
196
199
|
readonly Room: import("../user-modules/room.js").RoomConstructor;
|
|
197
200
|
readonly RoomInvitation: import("../user-modules/room-invitation.js").RoomInvitationConstructor;
|
|
198
201
|
readonly Tag: import("../user-modules/tag.js").TagConstructor;
|
|
202
|
+
readonly TagGroup: import("../user-modules/tag-group.js").TagGroupConstructor;
|
|
199
203
|
readonly UrlLink: import("../user-modules/url-link.js").UrlLinkConstructor;
|
|
200
204
|
readonly Channel: import("../user-modules/channel.js").ChannelConstructor;
|
|
201
205
|
wrapAsync: import("gerror/dist/esm/src/wrap-async-error/wrap-async-error.js").WrapAsync;
|
|
@@ -255,12 +259,12 @@ declare const mixinBase: (abstract new (...args: any[]) => {
|
|
|
255
259
|
__wechatifiedRoom?: import("../user-modules/room.js").RoomConstructor | undefined;
|
|
256
260
|
__wechatifiedRoomInvitation?: import("../user-modules/room-invitation.js").RoomInvitationConstructor | undefined;
|
|
257
261
|
__wechatifiedTag?: import("../user-modules/tag.js").TagConstructor | undefined;
|
|
262
|
+
__wechatifiedTagGroup?: import("../user-modules/tag-group.js").TagGroupConstructor | undefined;
|
|
258
263
|
__wechatifiedUrlLink?: import("../user-modules/url-link.js").UrlLinkConstructor | undefined;
|
|
259
264
|
__wechatifiedChannel?: import("../user-modules/channel.js").ChannelConstructor | undefined;
|
|
260
265
|
readonly Contact: import("../user-modules/contact.js").ContactConstructor;
|
|
261
266
|
readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor;
|
|
262
267
|
readonly Delay: import("../user-modules/delay.js").DelayConstructor;
|
|
263
|
-
readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
|
|
264
268
|
/**
|
|
265
269
|
* Main bot class.
|
|
266
270
|
*
|
|
@@ -284,6 +288,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
|
|
|
284
288
|
* bot.on('message', message => console.log(`Message: ${message}`))
|
|
285
289
|
* bot.start()
|
|
286
290
|
*/
|
|
291
|
+
readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
|
|
287
292
|
readonly Image: import("../user-modules/image.js").ImageConstructor;
|
|
288
293
|
readonly Location: import("../user-modules/location.js").LocationConstructor;
|
|
289
294
|
readonly Message: import("../user-modules/message.js").MessageConstructor;
|
|
@@ -292,6 +297,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
|
|
|
292
297
|
readonly Room: import("../user-modules/room.js").RoomConstructor;
|
|
293
298
|
readonly RoomInvitation: import("../user-modules/room-invitation.js").RoomInvitationConstructor;
|
|
294
299
|
readonly Tag: import("../user-modules/tag.js").TagConstructor;
|
|
300
|
+
readonly TagGroup: import("../user-modules/tag-group.js").TagGroupConstructor;
|
|
295
301
|
readonly UrlLink: import("../user-modules/url-link.js").UrlLinkConstructor;
|
|
296
302
|
readonly Channel: import("../user-modules/channel.js").ChannelConstructor;
|
|
297
303
|
wrapAsync: import("gerror/dist/esm/src/wrap-async-error/wrap-async-error.js").WrapAsync;
|
|
@@ -323,12 +329,12 @@ declare const mixinBase: (abstract new (...args: any[]) => {
|
|
|
323
329
|
__wechatifiedRoom?: import("../user-modules/room.js").RoomConstructor | undefined;
|
|
324
330
|
__wechatifiedRoomInvitation?: import("../user-modules/room-invitation.js").RoomInvitationConstructor | undefined;
|
|
325
331
|
__wechatifiedTag?: import("../user-modules/tag.js").TagConstructor | undefined;
|
|
332
|
+
__wechatifiedTagGroup?: import("../user-modules/tag-group.js").TagGroupConstructor | undefined;
|
|
326
333
|
__wechatifiedUrlLink?: import("../user-modules/url-link.js").UrlLinkConstructor | undefined;
|
|
327
334
|
__wechatifiedChannel?: import("../user-modules/channel.js").ChannelConstructor | undefined;
|
|
328
335
|
readonly Contact: import("../user-modules/contact.js").ContactConstructor;
|
|
329
336
|
readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor;
|
|
330
337
|
readonly Delay: import("../user-modules/delay.js").DelayConstructor;
|
|
331
|
-
readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
|
|
332
338
|
/**
|
|
333
339
|
* Main bot class.
|
|
334
340
|
*
|
|
@@ -352,6 +358,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
|
|
|
352
358
|
* bot.on('message', message => console.log(`Message: ${message}`))
|
|
353
359
|
* bot.start()
|
|
354
360
|
*/
|
|
361
|
+
readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
|
|
355
362
|
readonly Image: import("../user-modules/image.js").ImageConstructor;
|
|
356
363
|
readonly Location: import("../user-modules/location.js").LocationConstructor;
|
|
357
364
|
readonly Message: import("../user-modules/message.js").MessageConstructor;
|
|
@@ -360,6 +367,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
|
|
|
360
367
|
readonly Room: import("../user-modules/room.js").RoomConstructor;
|
|
361
368
|
readonly RoomInvitation: import("../user-modules/room-invitation.js").RoomInvitationConstructor;
|
|
362
369
|
readonly Tag: import("../user-modules/tag.js").TagConstructor;
|
|
370
|
+
readonly TagGroup: import("../user-modules/tag-group.js").TagGroupConstructor;
|
|
363
371
|
readonly UrlLink: import("../user-modules/url-link.js").UrlLinkConstructor;
|
|
364
372
|
readonly Channel: import("../user-modules/channel.js").ChannelConstructor;
|
|
365
373
|
readonly log: import("brolog/dist/esm/src/logger.js").Loggable;
|
|
@@ -435,12 +443,12 @@ declare const mixinBase: (abstract new (...args: any[]) => {
|
|
|
435
443
|
__wechatifiedRoom?: import("../user-modules/room.js").RoomConstructor | undefined;
|
|
436
444
|
__wechatifiedRoomInvitation?: import("../user-modules/room-invitation.js").RoomInvitationConstructor | undefined;
|
|
437
445
|
__wechatifiedTag?: import("../user-modules/tag.js").TagConstructor | undefined;
|
|
446
|
+
__wechatifiedTagGroup?: import("../user-modules/tag-group.js").TagGroupConstructor | undefined;
|
|
438
447
|
__wechatifiedUrlLink?: import("../user-modules/url-link.js").UrlLinkConstructor | undefined;
|
|
439
448
|
__wechatifiedChannel?: import("../user-modules/channel.js").ChannelConstructor | undefined;
|
|
440
449
|
readonly Contact: import("../user-modules/contact.js").ContactConstructor;
|
|
441
450
|
readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor;
|
|
442
451
|
readonly Delay: import("../user-modules/delay.js").DelayConstructor;
|
|
443
|
-
readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
|
|
444
452
|
/**
|
|
445
453
|
* Main bot class.
|
|
446
454
|
*
|
|
@@ -464,6 +472,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
|
|
|
464
472
|
* bot.on('message', message => console.log(`Message: ${message}`))
|
|
465
473
|
* bot.start()
|
|
466
474
|
*/
|
|
475
|
+
readonly Friendship: import("../user-modules/friendship.js").FriendshipConstructor;
|
|
467
476
|
readonly Image: import("../user-modules/image.js").ImageConstructor;
|
|
468
477
|
readonly Location: import("../user-modules/location.js").LocationConstructor;
|
|
469
478
|
readonly Message: import("../user-modules/message.js").MessageConstructor;
|
|
@@ -472,6 +481,7 @@ declare const mixinBase: (abstract new (...args: any[]) => {
|
|
|
472
481
|
readonly Room: import("../user-modules/room.js").RoomConstructor;
|
|
473
482
|
readonly RoomInvitation: import("../user-modules/room-invitation.js").RoomInvitationConstructor;
|
|
474
483
|
readonly Tag: import("../user-modules/tag.js").TagConstructor;
|
|
484
|
+
readonly TagGroup: import("../user-modules/tag-group.js").TagGroupConstructor;
|
|
475
485
|
readonly UrlLink: import("../user-modules/url-link.js").UrlLinkConstructor;
|
|
476
486
|
readonly Channel: import("../user-modules/channel.js").ChannelConstructor;
|
|
477
487
|
init(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wechaty-base.d.ts","sourceRoot":"","sources":["../../../../src/wechaty/wechaty-base.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,KAAK,MAAM,MAAM,sBAAsB,CAAA;AAQnD,OAAO,KAAK,EACV,YAAY,EACZ,OAAO,EACR,MAAkC,mBAAmB,CAAA;AAWtD,OAAO,EACL,eAAe,EAChB,MAAkC,uBAAuB,CAAA;AAC1D,OAAO,KAAK,EACV,gBAAgB,EACjB,MAAkC,mBAAmB,CAAA;AACtD,OAAO,KAAK,EACV,cAAc,EACf,MAAkC,+BAA+B,CAAA;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAE5D,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoCf;;;;;;;;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;;;;;;;;;;;;;;;GAsBG;AACH,cAAM,WAAY,SAAQ,SAAU,YAAW,YAAY;IAmD9C,SAAS,EAAE,cAAc;IAjDpC,gBAA2B,OAAO,SAAU;IAC5C,QAAQ,CAAC,OAAO,EAAG,gBAAgB,CAAA;IAEnC,QAAQ,CAAC,iBAAiB,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,CAAK;IAE/C;;;;;;;;;;;;;;;;;;;OAmBG;IAEH;;;;;;;;;;;;;;;OAeG;IAEH;;;;OAIG;gBAEQ,SAAS,GAAE,cAAmB;IAS1B,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;IAMvB,OAAO,IAAK,OAAO,CAAC,IAAI,CAAC;IAmBzB,MAAM,IAAK,OAAO,CAAC,IAAI,CAAC;IAgBvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoDG;IAEG,GAAG,CACP,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,IAAI,CAAC;IAKV,OAAO,CACX,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,IAAI,GAAG,aAAa,CAAC;CAYjC;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"}
|
|
@@ -22,6 +22,7 @@ const wechaty_impl_js_1 = require("./wechaty-impl.js");
|
|
|
22
22
|
Room;
|
|
23
23
|
RoomInvitation;
|
|
24
24
|
Tag;
|
|
25
|
+
TagGroup;
|
|
25
26
|
UrlLink;
|
|
26
27
|
Channel;
|
|
27
28
|
constructor() {
|
|
@@ -39,9 +40,10 @@ const wechaty_impl_js_1 = require("./wechaty-impl.js");
|
|
|
39
40
|
= this.Room
|
|
40
41
|
= this.RoomInvitation
|
|
41
42
|
= this.Tag
|
|
42
|
-
= this.
|
|
43
|
-
= this.
|
|
44
|
-
=
|
|
43
|
+
= this.TagGroup
|
|
44
|
+
= this.UrlLink
|
|
45
|
+
= this.Channel
|
|
46
|
+
= {};
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
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;
|
|
1
|
+
{"version":3,"file":"wechaty-impl.spec.js","sourceRoot":"","sources":["../../../../src/wechaty/wechaty-impl.spec.ts"],"names":[],"mappings":";;;;;;AACA,mCAA6B;AAC7B,oFAAkD;AAElD,oEAAkE;AAqBlE,uDAMgD;AAEhD,IAAA,aAAI,EAAC,mBAAmB,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAClC,MAAe,qBAAsB,SAAQ,uCAAmB;QAE9D,OAAO,CAA4B;QACnC,WAAW,CAA4B;QACvC,KAAK,CAA4B;QACjC,UAAU,CAA4B;QACtC,KAAK,CAA4B;QACjC,QAAQ,CAA4B;QACpC,OAAO,CAA4B;QACnC,WAAW,CAA4B;QACvC,IAAI,CAA4B;QAChC,IAAI,CAA4B;QAChC,cAAc,CAA4B;QAC1C,GAAG,CAA4B;QAC/B,QAAQ,CAA4B;QACpC,OAAO,CAA4B;QACnC,OAAO,CAA4B;QAEnC;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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