@juzi/wechaty-puppet-service 1.0.14 → 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/client/puppet-service.d.ts +13 -19
- package/dist/cjs/src/client/puppet-service.d.ts.map +1 -1
- package/dist/cjs/src/client/puppet-service.js +108 -103
- package/dist/cjs/src/client/puppet-service.js.map +1 -1
- package/dist/cjs/src/package-json.js +3 -3
- package/dist/cjs/src/package-json.js.map +1 -1
- package/dist/cjs/src/server/puppet-implementation.d.ts.map +1 -1
- package/dist/cjs/src/server/puppet-implementation.js +142 -151
- package/dist/cjs/src/server/puppet-implementation.js.map +1 -1
- package/dist/esm/src/client/puppet-service.d.ts +13 -19
- package/dist/esm/src/client/puppet-service.d.ts.map +1 -1
- package/dist/esm/src/client/puppet-service.js +108 -103
- package/dist/esm/src/client/puppet-service.js.map +1 -1
- package/dist/esm/src/package-json.js +3 -3
- package/dist/esm/src/package-json.js.map +1 -1
- package/dist/esm/src/server/puppet-implementation.d.ts.map +1 -1
- package/dist/esm/src/server/puppet-implementation.js +142 -151
- package/dist/esm/src/server/puppet-implementation.js.map +1 -1
- package/package.json +3 -3
- package/src/client/puppet-service.ts +147 -161
- package/src/package-json.ts +3 -3
- package/src/server/puppet-implementation.ts +143 -172
|
@@ -6,6 +6,7 @@ import { Ducks } from 'ducks';
|
|
|
6
6
|
import type { Store } from 'redux';
|
|
7
7
|
import { GrpcManager } from './grpc-manager.js';
|
|
8
8
|
import { PayloadStore } from './payload-store.js';
|
|
9
|
+
import type { TagIdentifier } from '@juzi/wechaty-puppet/filters';
|
|
9
10
|
export declare type PuppetServiceOptions = PUPPET.PuppetOptions & {
|
|
10
11
|
authority?: string;
|
|
11
12
|
tls?: {
|
|
@@ -119,7 +120,7 @@ declare class PuppetService extends PUPPET.Puppet {
|
|
|
119
120
|
roomRawPayload(id: string): Promise<PUPPET.payloads.Room>;
|
|
120
121
|
roomRawPayloadParser(payload: PUPPET.payloads.Room): Promise<PUPPET.payloads.Room>;
|
|
121
122
|
roomList(): Promise<string[]>;
|
|
122
|
-
roomDel(roomId: string,
|
|
123
|
+
roomDel(roomId: string, contactIds: string | string[]): Promise<void>;
|
|
123
124
|
roomAvatar(roomId: string): Promise<FileBoxInterface>;
|
|
124
125
|
roomAdd(roomId: string, contactId: string, inviteOnly: boolean): Promise<void>;
|
|
125
126
|
roomTopic(roomId: string): Promise<string>;
|
|
@@ -151,24 +152,17 @@ declare class PuppetService extends PUPPET.Puppet {
|
|
|
151
152
|
* Tag
|
|
152
153
|
*
|
|
153
154
|
*/
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
corpTagGroupAdd(corpTagGroupName: string): Promise<PUPPET.payloads.CorpTagGroup | void>;
|
|
166
|
-
corpTagGroupDelete(corpTagGroupId: string): Promise<void>;
|
|
167
|
-
corpTagTagAdd(corpTagGroupId: string, corpTagName: string): Promise<PUPPET.payloads.CorpTag | void>;
|
|
168
|
-
corpTagTagDelete(corpTagGroupId: string, corpTagId: string): Promise<void>;
|
|
169
|
-
corpTagGroupList(): Promise<PUPPET.payloads.CorpTagGroup[]>;
|
|
170
|
-
corpTagTagList(corpTagGroupId: string): Promise<PUPPET.payloads.CorpTag[]>;
|
|
171
|
-
corpTagContactTagList(contactId: string): Promise<PUPPET.payloads.CorpTag[]>;
|
|
155
|
+
tagContactTagAdd(tags: TagIdentifier[], contactIds: string[]): Promise<void>;
|
|
156
|
+
tagContactTagRemove(tags: TagIdentifier[], contactIds: string[]): Promise<void>;
|
|
157
|
+
tagGroupAdd(tagGroupName: string): Promise<PUPPET.payloads.TagGroup | void>;
|
|
158
|
+
tagGroupDelete(tagGroupId: string): Promise<void>;
|
|
159
|
+
tagTagAdd(tagName: string, tagGroupId?: string): Promise<PUPPET.payloads.Tag | void>;
|
|
160
|
+
tagTagDelete(tag: TagIdentifier): Promise<void>;
|
|
161
|
+
tagGroupList(): Promise<PUPPET.payloads.TagGroup[]>;
|
|
162
|
+
tagGroupTagList(tagGroupId?: string): Promise<PUPPET.payloads.Tag[]>;
|
|
163
|
+
tagTagList(): Promise<PUPPET.payloads.Tag[]>;
|
|
164
|
+
tagContactTagList(contactId: string): Promise<PUPPET.payloads.Tag[]>;
|
|
165
|
+
tagTagContactList(tag: TagIdentifier): Promise<string[]>;
|
|
172
166
|
/**
|
|
173
167
|
* @deprecated Will be removed in v2.0
|
|
174
168
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"puppet-service.d.ts","sourceRoot":"","sources":["../../../../src/client/puppet-service.ts"],"names":[],"mappings":";AAqBA,OAAO,KAAK,MAAM,MAAa,sBAAsB,CAAA;AAErD,OAAO,KAAK,EACV,gBAAgB,EAChB,OAAO,EACR,MAA8B,UAAU,CAAA;AAKzC,OAAO,EAEL,IAAI,IAAI,UAAU,EACnB,MAA8B,qBAAqB,CAAA;AACpD,OAAO,EACL,KAAK,EAEN,MAA8B,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAU,OAAO,CAAA;AA6BtC,OAAO,EAAE,WAAW,EAAE,MAAO,mBAAmB,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"puppet-service.d.ts","sourceRoot":"","sources":["../../../../src/client/puppet-service.ts"],"names":[],"mappings":";AAqBA,OAAO,KAAK,MAAM,MAAa,sBAAsB,CAAA;AAErD,OAAO,KAAK,EACV,gBAAgB,EAChB,OAAO,EACR,MAA8B,UAAU,CAAA;AAKzC,OAAO,EAEL,IAAI,IAAI,UAAU,EACnB,MAA8B,qBAAqB,CAAA;AACpD,OAAO,EACL,KAAK,EAEN,MAA8B,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAU,OAAO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ACnB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC;IA0B5B,cAAc,CAC3B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC;IAcD,SAAS,CACtB,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,IAAI,CAAC;IAiCvB,YAAY,CACzB,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,IAAI,CAAC;IAmBD,YAAY,IAAK,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAoBpD,eAAe,CAC5B,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;IAyBlB,UAAU,IACtB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;IAsBlB,iBAAiB,CAC9B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;IAuBlB,iBAAiB,CAC9B,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,EAAE,CAAC;IAmBpB;;OAEG;YACW,qBAAqB;IAkCnC,mBAAmB,CAAC,EAAE,MAAM,CAAC,KAAK,CAAA;IAClC,gBAAgB;IAMhB,eAAe;CAIhB;AAED,OAAO,EACL,aAAa,GACd,CAAA;AACD,eAAe,aAAa,CAAA"}
|
|
@@ -1074,11 +1074,19 @@ class PuppetService extends PUPPET.Puppet {
|
|
|
1074
1074
|
.bind(this.grpcManager.client))(new wechaty_grpc_1.puppet.RoomListRequest());
|
|
1075
1075
|
return response.getIdsList();
|
|
1076
1076
|
}
|
|
1077
|
-
async roomDel(roomId,
|
|
1078
|
-
config_js_1.log.verbose('PuppetService', 'roomDel(%s, %s)', roomId,
|
|
1077
|
+
async roomDel(roomId, contactIds) {
|
|
1078
|
+
config_js_1.log.verbose('PuppetService', 'roomDel(%s, %s)', roomId, contactIds);
|
|
1079
1079
|
const request = new wechaty_grpc_1.puppet.RoomDelRequest();
|
|
1080
1080
|
request.setId(roomId);
|
|
1081
|
-
|
|
1081
|
+
if (Array.isArray(contactIds)) {
|
|
1082
|
+
request.setContactIdsList(contactIds);
|
|
1083
|
+
if (contactIds.length === 1) {
|
|
1084
|
+
request.setContactId(contactIds[0]);
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
else {
|
|
1088
|
+
request.setContactId(contactIds);
|
|
1089
|
+
}
|
|
1082
1090
|
await util_1.default.promisify(this.grpcManager.client.roomDel
|
|
1083
1091
|
.bind(this.grpcManager.client))(request);
|
|
1084
1092
|
}
|
|
@@ -1402,79 +1410,37 @@ class PuppetService extends PUPPET.Puppet {
|
|
|
1402
1410
|
* Tag
|
|
1403
1411
|
*
|
|
1404
1412
|
*/
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1413
|
+
async tagContactTagAdd(tags, contactIds) {
|
|
1414
|
+
config_js_1.log.verbose('PuppetService', 'tagContactTagAdd(%s, %s)', JSON.stringify(tags), contactIds);
|
|
1415
|
+
const request = new wechaty_grpc_1.puppet.TagContactTagAddRequest();
|
|
1416
|
+
request.setTagsList(tags.map(t => {
|
|
1417
|
+
const tag = new wechaty_grpc_1.puppet.TagIdentifier();
|
|
1418
|
+
t.groupId && tag.setGroupId(t.groupId);
|
|
1419
|
+
tag.setId(t.id);
|
|
1420
|
+
return tag;
|
|
1421
|
+
}));
|
|
1422
|
+
request.setContactIdsList(contactIds);
|
|
1423
|
+
await util_1.default.promisify(this.grpcManager.client.tagContactTagAdd
|
|
1412
1424
|
.bind(this.grpcManager.client))(request);
|
|
1413
1425
|
}
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1426
|
+
async tagContactTagRemove(tags, contactIds) {
|
|
1427
|
+
config_js_1.log.verbose('PuppetService', 'tagContactTagRemove(%s, %s)', JSON.stringify(tags), contactIds);
|
|
1428
|
+
const request = new wechaty_grpc_1.puppet.TagContactTagRemoveRequest();
|
|
1429
|
+
request.setTagsList(tags.map(t => {
|
|
1430
|
+
const tag = new wechaty_grpc_1.puppet.TagIdentifier();
|
|
1431
|
+
t.groupId && tag.setGroupId(t.groupId);
|
|
1432
|
+
tag.setId(t.id);
|
|
1433
|
+
return tag;
|
|
1434
|
+
}));
|
|
1435
|
+
request.setContactIdsList(contactIds);
|
|
1436
|
+
await util_1.default.promisify(this.grpcManager.client.tagContactTagRemove
|
|
1421
1437
|
.bind(this.grpcManager.client))(request);
|
|
1422
1438
|
}
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
await util_1.default.promisify(this.grpcManager.client.tagContactDelete
|
|
1429
|
-
.bind(this.grpcManager.client))(request);
|
|
1430
|
-
}
|
|
1431
|
-
// get tags from a specific Contact
|
|
1432
|
-
async tagContactList(contactId) {
|
|
1433
|
-
config_js_1.log.verbose('PuppetService', 'tagContactList(%s)', contactId);
|
|
1434
|
-
const request = new wechaty_grpc_1.puppet.TagContactListRequest();
|
|
1435
|
-
if (typeof contactId !== 'undefined') {
|
|
1436
|
-
request.setContactId(contactId);
|
|
1437
|
-
{
|
|
1438
|
-
/**
|
|
1439
|
-
* Huan(202110): Deprecated: will be removed after Dec 31, 2022
|
|
1440
|
-
*/
|
|
1441
|
-
const contactIdWrapper = new wechaty_grpc_1.StringValue();
|
|
1442
|
-
contactIdWrapper.setValue(contactId);
|
|
1443
|
-
request.setContactIdStringValueDeprecated(contactIdWrapper);
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1446
|
-
const response = await util_1.default.promisify(this.grpcManager.client.tagContactList
|
|
1447
|
-
.bind(this.grpcManager.client))(request);
|
|
1448
|
-
return response.getIdsList();
|
|
1449
|
-
}
|
|
1450
|
-
/**
|
|
1451
|
-
*
|
|
1452
|
-
* Tag
|
|
1453
|
-
*
|
|
1454
|
-
*/
|
|
1455
|
-
async corpTagContactTagAdd(corpTagGroupId, corpTagId, contactId) {
|
|
1456
|
-
config_js_1.log.verbose('PuppetService', 'corpTagContactTagAdd(%s, %s, %s)', corpTagGroupId, corpTagId, contactId);
|
|
1457
|
-
const request = new wechaty_grpc_1.puppet.CorpTagContactTagAddRequest();
|
|
1458
|
-
request.setCorpTagGroupId(corpTagGroupId);
|
|
1459
|
-
request.setCorpTagId(corpTagId);
|
|
1460
|
-
request.setContactId(contactId);
|
|
1461
|
-
await util_1.default.promisify(this.grpcManager.client.corpTagContactTagAdd
|
|
1462
|
-
.bind(this.grpcManager.client))(request);
|
|
1463
|
-
}
|
|
1464
|
-
async corpTagContactTagRemove(corpTagGroupId, corpTagId, contactId) {
|
|
1465
|
-
config_js_1.log.verbose('PuppetService', 'corpTagContactRemoveAdd(%s, %s, %s)', corpTagGroupId, corpTagId, contactId);
|
|
1466
|
-
const request = new wechaty_grpc_1.puppet.CorpTagContactTagRemoveRequest();
|
|
1467
|
-
request.setCorpTagGroupId(corpTagGroupId);
|
|
1468
|
-
request.setCorpTagId(corpTagId);
|
|
1469
|
-
request.setContactId(contactId);
|
|
1470
|
-
await util_1.default.promisify(this.grpcManager.client.corpTagContactTagRemove
|
|
1471
|
-
.bind(this.grpcManager.client))(request);
|
|
1472
|
-
}
|
|
1473
|
-
async corpTagGroupAdd(corpTagGroupName) {
|
|
1474
|
-
config_js_1.log.verbose('PuppetService', 'corpTagGroupAdd(%s)', corpTagGroupName);
|
|
1475
|
-
const request = new wechaty_grpc_1.puppet.CorpTagGroupAddRequest();
|
|
1476
|
-
request.setCorpTagGroupName(corpTagGroupName);
|
|
1477
|
-
const result = await util_1.default.promisify(this.grpcManager.client.corpTagGroupAdd
|
|
1439
|
+
async tagGroupAdd(tagGroupName) {
|
|
1440
|
+
config_js_1.log.verbose('PuppetService', 'tagGroupAdd(%s)', tagGroupName);
|
|
1441
|
+
const request = new wechaty_grpc_1.puppet.TagGroupAddRequest();
|
|
1442
|
+
request.setTagGroupName(tagGroupName);
|
|
1443
|
+
const result = await util_1.default.promisify(this.grpcManager.client.tagGroupAdd
|
|
1478
1444
|
.bind(this.grpcManager.client))(request);
|
|
1479
1445
|
const grpcPayload = result.getPayload();
|
|
1480
1446
|
const id = grpcPayload?.getId();
|
|
@@ -1487,60 +1453,85 @@ class PuppetService extends PUPPET.Puppet {
|
|
|
1487
1453
|
return payload;
|
|
1488
1454
|
}
|
|
1489
1455
|
}
|
|
1490
|
-
async
|
|
1491
|
-
config_js_1.log.verbose('PuppetService', '
|
|
1492
|
-
const request = new wechaty_grpc_1.puppet.
|
|
1493
|
-
request.
|
|
1494
|
-
await util_1.default.promisify(this.grpcManager.client.
|
|
1456
|
+
async tagGroupDelete(tagGroupId) {
|
|
1457
|
+
config_js_1.log.verbose('PuppetService', 'tagGroupDelete(%s)', tagGroupId);
|
|
1458
|
+
const request = new wechaty_grpc_1.puppet.TagGroupDeleteRequest();
|
|
1459
|
+
request.setTagGroupId(tagGroupId);
|
|
1460
|
+
await util_1.default.promisify(this.grpcManager.client.tagGroupDelete
|
|
1495
1461
|
.bind(this.grpcManager.client))(request);
|
|
1496
1462
|
}
|
|
1497
|
-
async
|
|
1498
|
-
config_js_1.log.verbose('PuppetService', '
|
|
1499
|
-
const request = new wechaty_grpc_1.puppet.
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1463
|
+
async tagTagAdd(tagName, tagGroupId) {
|
|
1464
|
+
config_js_1.log.verbose('PuppetService', 'tagTagAdd(%s, %s)', tagName, tagGroupId);
|
|
1465
|
+
const request = new wechaty_grpc_1.puppet.TagTagAddRequest();
|
|
1466
|
+
if (typeof tagGroupId !== 'undefined') {
|
|
1467
|
+
request.setTagGroupId(tagGroupId);
|
|
1468
|
+
}
|
|
1469
|
+
request.setTagName(tagName);
|
|
1470
|
+
const result = await util_1.default.promisify(this.grpcManager.client.tagTagAdd
|
|
1503
1471
|
.bind(this.grpcManager.client))(request);
|
|
1504
1472
|
const grpcPayload = result.getPayload();
|
|
1505
1473
|
const id = grpcPayload?.getId();
|
|
1506
1474
|
const name = grpcPayload?.getName();
|
|
1507
1475
|
const groupId = grpcPayload?.getGroupId();
|
|
1508
|
-
|
|
1476
|
+
const type = grpcPayload?.getType();
|
|
1477
|
+
if (id && name && (typeof type !== 'undefined')) {
|
|
1509
1478
|
const payload = {
|
|
1510
1479
|
id,
|
|
1511
1480
|
name,
|
|
1512
1481
|
groupId,
|
|
1482
|
+
type,
|
|
1513
1483
|
};
|
|
1514
1484
|
return payload;
|
|
1515
1485
|
}
|
|
1516
1486
|
}
|
|
1517
|
-
async
|
|
1518
|
-
config_js_1.log.verbose('PuppetService', '
|
|
1519
|
-
const request = new wechaty_grpc_1.puppet.
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1487
|
+
async tagTagDelete(tag) {
|
|
1488
|
+
config_js_1.log.verbose('PuppetService', 'tagTagDelete(%s)', JSON.stringify(tag));
|
|
1489
|
+
const request = new wechaty_grpc_1.puppet.TagTagDeleteRequest();
|
|
1490
|
+
const tagProb = new wechaty_grpc_1.puppet.TagIdentifier();
|
|
1491
|
+
tag.groupId && tagProb.setGroupId(tag.groupId);
|
|
1492
|
+
tagProb.setId(tag.id);
|
|
1493
|
+
request.setTag(tagProb);
|
|
1494
|
+
request.setTag(tagProb);
|
|
1495
|
+
await util_1.default.promisify(this.grpcManager.client.tagTagDelete
|
|
1523
1496
|
.bind(this.grpcManager.client))(request);
|
|
1524
1497
|
}
|
|
1525
|
-
async
|
|
1526
|
-
config_js_1.log.verbose('PuppetService', '
|
|
1527
|
-
const request = new wechaty_grpc_1.puppet.
|
|
1528
|
-
const result = await util_1.default.promisify(this.grpcManager.client.
|
|
1498
|
+
async tagGroupList() {
|
|
1499
|
+
config_js_1.log.verbose('PuppetService', 'tagGroupList()');
|
|
1500
|
+
const request = new wechaty_grpc_1.puppet.TagGroupListRequest();
|
|
1501
|
+
const result = await util_1.default.promisify(this.grpcManager.client.tagGroupList
|
|
1502
|
+
.bind(this.grpcManager.client))(request);
|
|
1503
|
+
const grpcPayloads = result.getPayloadsList();
|
|
1504
|
+
const payloads = grpcPayloads.map(payload => {
|
|
1505
|
+
return {
|
|
1506
|
+
id: payload.getId(),
|
|
1507
|
+
name: payload.getName(),
|
|
1508
|
+
};
|
|
1509
|
+
});
|
|
1510
|
+
return payloads;
|
|
1511
|
+
}
|
|
1512
|
+
async tagGroupTagList(tagGroupId) {
|
|
1513
|
+
config_js_1.log.verbose('PuppetService', 'tagGroupTagList(%s)', tagGroupId);
|
|
1514
|
+
const request = new wechaty_grpc_1.puppet.TagGroupTagListRequest();
|
|
1515
|
+
if (typeof tagGroupId !== 'undefined') {
|
|
1516
|
+
request.setTagGroupId(tagGroupId);
|
|
1517
|
+
}
|
|
1518
|
+
const result = await util_1.default.promisify(this.grpcManager.client.tagGroupTagList
|
|
1529
1519
|
.bind(this.grpcManager.client))(request);
|
|
1530
1520
|
const grpcPayloads = result.getPayloadsList();
|
|
1531
1521
|
const payloads = grpcPayloads.map(payload => {
|
|
1532
1522
|
return {
|
|
1533
1523
|
id: payload.getId(),
|
|
1534
1524
|
name: payload.getName(),
|
|
1525
|
+
groupId: payload.getGroupId(),
|
|
1526
|
+
type: payload.getType(),
|
|
1535
1527
|
};
|
|
1536
1528
|
});
|
|
1537
1529
|
return payloads;
|
|
1538
1530
|
}
|
|
1539
|
-
async
|
|
1540
|
-
config_js_1.log.verbose('PuppetService', '
|
|
1541
|
-
const request = new wechaty_grpc_1.puppet.
|
|
1542
|
-
|
|
1543
|
-
const result = await util_1.default.promisify(this.grpcManager.client.corpTagTagList
|
|
1531
|
+
async tagTagList() {
|
|
1532
|
+
config_js_1.log.verbose('PuppetService', 'tagTagList()');
|
|
1533
|
+
const request = new wechaty_grpc_1.puppet.TagTagListRequest();
|
|
1534
|
+
const result = await util_1.default.promisify(this.grpcManager.client.tagTagList
|
|
1544
1535
|
.bind(this.grpcManager.client))(request);
|
|
1545
1536
|
const grpcPayloads = result.getPayloadsList();
|
|
1546
1537
|
const payloads = grpcPayloads.map(payload => {
|
|
@@ -1548,15 +1539,16 @@ class PuppetService extends PUPPET.Puppet {
|
|
|
1548
1539
|
id: payload.getId(),
|
|
1549
1540
|
name: payload.getName(),
|
|
1550
1541
|
groupId: payload.getGroupId(),
|
|
1542
|
+
type: payload.getType(),
|
|
1551
1543
|
};
|
|
1552
1544
|
});
|
|
1553
1545
|
return payloads;
|
|
1554
1546
|
}
|
|
1555
|
-
async
|
|
1556
|
-
config_js_1.log.verbose('PuppetService', '
|
|
1557
|
-
const request = new wechaty_grpc_1.puppet.
|
|
1547
|
+
async tagContactTagList(contactId) {
|
|
1548
|
+
config_js_1.log.verbose('PuppetService', 'tagContactTagList(%s)', contactId);
|
|
1549
|
+
const request = new wechaty_grpc_1.puppet.TagContactTagListRequest();
|
|
1558
1550
|
request.setContactId(contactId);
|
|
1559
|
-
const result = await util_1.default.promisify(this.grpcManager.client.
|
|
1551
|
+
const result = await util_1.default.promisify(this.grpcManager.client.tagContactTagList
|
|
1560
1552
|
.bind(this.grpcManager.client))(request);
|
|
1561
1553
|
const grpcPayloads = result.getPayloadsList();
|
|
1562
1554
|
const payloads = grpcPayloads.map(payload => {
|
|
@@ -1564,10 +1556,23 @@ class PuppetService extends PUPPET.Puppet {
|
|
|
1564
1556
|
id: payload.getId(),
|
|
1565
1557
|
name: payload.getName(),
|
|
1566
1558
|
groupId: payload.getGroupId(),
|
|
1559
|
+
type: payload.getType(),
|
|
1567
1560
|
};
|
|
1568
1561
|
});
|
|
1569
1562
|
return payloads;
|
|
1570
1563
|
}
|
|
1564
|
+
async tagTagContactList(tag) {
|
|
1565
|
+
config_js_1.log.verbose('PuppetService', 'tagTagContactList(%s)', JSON.stringify(tag));
|
|
1566
|
+
const request = new wechaty_grpc_1.puppet.TagTagContactListRequest();
|
|
1567
|
+
const tagProb = new wechaty_grpc_1.puppet.TagIdentifier();
|
|
1568
|
+
tag.groupId && tagProb.setGroupId(tag.groupId);
|
|
1569
|
+
tagProb.setId(tag.id);
|
|
1570
|
+
request.setTag(tagProb);
|
|
1571
|
+
const result = await util_1.default.promisify(this.grpcManager.client.tagTagContactList
|
|
1572
|
+
.bind(this.grpcManager.client))(request);
|
|
1573
|
+
const payloads = result.getPayloadsList();
|
|
1574
|
+
return payloads;
|
|
1575
|
+
}
|
|
1571
1576
|
/**
|
|
1572
1577
|
* @deprecated Will be removed in v2.0
|
|
1573
1578
|
*/
|