@juzi/wechaty-puppet-service 1.0.19 → 1.0.22

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 (27) hide show
  1. package/dist/cjs/src/client/puppet-service.d.ts +9 -10
  2. package/dist/cjs/src/client/puppet-service.d.ts.map +1 -1
  3. package/dist/cjs/src/client/puppet-service.js +35 -76
  4. package/dist/cjs/src/client/puppet-service.js.map +1 -1
  5. package/dist/cjs/src/package-json.js +3 -3
  6. package/dist/cjs/src/server/event-stream-manager.d.ts.map +1 -1
  7. package/dist/cjs/src/server/event-stream-manager.js +7 -0
  8. package/dist/cjs/src/server/event-stream-manager.js.map +1 -1
  9. package/dist/cjs/src/server/puppet-implementation.d.ts.map +1 -1
  10. package/dist/cjs/src/server/puppet-implementation.js +16 -61
  11. package/dist/cjs/src/server/puppet-implementation.js.map +1 -1
  12. package/dist/esm/src/client/puppet-service.d.ts +9 -10
  13. package/dist/esm/src/client/puppet-service.d.ts.map +1 -1
  14. package/dist/esm/src/client/puppet-service.js +36 -77
  15. package/dist/esm/src/client/puppet-service.js.map +1 -1
  16. package/dist/esm/src/package-json.js +3 -3
  17. package/dist/esm/src/server/event-stream-manager.d.ts.map +1 -1
  18. package/dist/esm/src/server/event-stream-manager.js +7 -0
  19. package/dist/esm/src/server/event-stream-manager.js.map +1 -1
  20. package/dist/esm/src/server/puppet-implementation.d.ts.map +1 -1
  21. package/dist/esm/src/server/puppet-implementation.js +16 -61
  22. package/dist/esm/src/server/puppet-implementation.js.map +1 -1
  23. package/package.json +3 -3
  24. package/src/client/puppet-service.ts +39 -85
  25. package/src/package-json.ts +3 -3
  26. package/src/server/event-stream-manager.ts +7 -0
  27. package/src/server/puppet-implementation.ts +19 -61
@@ -57,7 +57,6 @@ import {
57
57
  } from '../file-box-helper/mod.js'
58
58
  import {
59
59
  envVars,
60
- FOUR_PER_EM_SPACE,
61
60
  log,
62
61
  NO_LOG_EVENTS,
63
62
  VERSION,
@@ -69,7 +68,6 @@ import { packageJson } from '../package-json.js'
69
68
 
70
69
  import { GrpcManager } from './grpc-manager.js'
71
70
  import { PayloadStore } from './payload-store.js'
72
- import type { TagIdentifier } from '@juzi/wechaty-puppet/filters'
73
71
 
74
72
  export type PuppetServiceOptions = PUPPET.PuppetOptions & {
75
73
  authority? : string
@@ -352,6 +350,9 @@ class PuppetService extends PUPPET.Puppet {
352
350
  case grpcPuppet.EventType.EVENT_TYPE_TAG:
353
351
  this.emit('tag', JSON.parse(payload) as PUPPET.payloads.EventTag)
354
352
  break
353
+ case grpcPuppet.EventType.EVENT_TYPE_TAG_GROUP:
354
+ this.emit('tag-group', JSON.parse(payload) as PUPPET.payloads.EventTagGroup)
355
+ break
355
356
  case grpcPuppet.EventType.EVENT_TYPE_RESET:
356
357
  log.warn('PuppetService', 'onGrpcStreamEvent() got an EventType.EVENT_TYPE_RESET ?')
357
358
  // the `reset` event should be dealed not send out
@@ -444,6 +445,8 @@ class PuppetService extends PUPPET.Puppet {
444
445
  [PUPPET.types.Dirty.Post]: async (_: string) => {},
445
446
  [PUPPET.types.Dirty.Room]: async (id: string) => this._payloadStore.room?.delete(id),
446
447
  [PUPPET.types.Dirty.RoomMember]: async (id: string) => this._payloadStore.roomMember?.delete(id),
448
+ [PUPPET.types.Dirty.Tag]: async (id: string) => this._payloadStore.tag?.delete(id),
449
+ [PUPPET.types.Dirty.TagGroup]: async (id: string) => this._payloadStore.tagGroup?.delete(id),
447
450
  [PUPPET.types.Dirty.Unspecified]: async (id: string) => { throw new Error('Unspecified type with id: ' + id) },
448
451
  }
449
452
 
@@ -696,6 +699,7 @@ class PuppetService extends PUPPET.Puppet {
696
699
  */
697
700
  weixin : response.getWeixin(),
698
701
  additionalInfo: response.getAdditionalInfo(),
702
+ tags : response.getTagIdsList(),
699
703
  }
700
704
 
701
705
  await this._payloadStore.contact?.set(id, payload)
@@ -1934,19 +1938,14 @@ class PuppetService extends PUPPET.Puppet {
1934
1938
  */
1935
1939
 
1936
1940
  override async tagContactTagAdd (
1937
- tags: TagIdentifier[],
1941
+ tagIds: string[],
1938
1942
  contactIds: string[],
1939
1943
  ): Promise<void> {
1940
- log.verbose('PuppetService', 'tagContactTagAdd(%s, %s)', JSON.stringify(tags), contactIds)
1944
+ log.verbose('PuppetService', 'tagContactTagAdd(%s, %s)', tagIds, contactIds)
1941
1945
 
1942
1946
  const request = new grpcPuppet.TagContactTagAddRequest()
1943
1947
 
1944
- request.setTagsList(tags.map(t => {
1945
- const tag = new grpcPuppet.TagIdentifier()
1946
- t.groupId && tag.setGroupId(t.groupId)
1947
- tag.setId(t.id)
1948
- return tag
1949
- }))
1948
+ request.setTagIdsList(tagIds)
1950
1949
  request.setContactIdsList(contactIds)
1951
1950
 
1952
1951
  await util.promisify(
@@ -1956,19 +1955,14 @@ class PuppetService extends PUPPET.Puppet {
1956
1955
  }
1957
1956
 
1958
1957
  override async tagContactTagRemove (
1959
- tags: TagIdentifier[],
1958
+ tagIds: string[],
1960
1959
  contactIds: string[],
1961
1960
  ): Promise<void> {
1962
- log.verbose('PuppetService', 'tagContactTagRemove(%s, %s)', JSON.stringify(tags), contactIds)
1961
+ log.verbose('PuppetService', 'tagContactTagRemove(%s, %s)', tagIds, contactIds)
1963
1962
 
1964
1963
  const request = new grpcPuppet.TagContactTagRemoveRequest()
1965
1964
 
1966
- request.setTagsList(tags.map(t => {
1967
- const tag = new grpcPuppet.TagIdentifier()
1968
- t.groupId && tag.setGroupId(t.groupId)
1969
- tag.setId(t.id)
1970
- return tag
1971
- }))
1965
+ request.setTagIdsList(tagIds)
1972
1966
  request.setContactIdsList(contactIds)
1973
1967
 
1974
1968
  await util.promisify(
@@ -2015,7 +2009,7 @@ class PuppetService extends PUPPET.Puppet {
2015
2009
  override async tagTagAdd (
2016
2010
  tagName: string,
2017
2011
  tagGroupId?: string,
2018
- ): Promise<PUPPET.filters.TagIdentifier | void> {
2012
+ ): Promise<string | void> {
2019
2013
  log.verbose('PuppetService', 'tagTagAdd(%s, %s)', tagName, tagGroupId)
2020
2014
 
2021
2015
  const request = new grpcPuppet.TagTagAddRequest()
@@ -2030,31 +2024,18 @@ class PuppetService extends PUPPET.Puppet {
2030
2024
  .bind(this.grpcManager.client),
2031
2025
  )(request)
2032
2026
 
2033
- const tag = result.getTag()
2034
- const id = tag?.getId()
2035
- const groupId = tag?.getGroupId()
2027
+ const id = result.getTagId()
2036
2028
 
2037
- if (id) {
2038
- return {
2039
- id,
2040
- groupId,
2041
- }
2042
- }
2029
+ return id
2043
2030
  }
2044
2031
 
2045
2032
  override async tagTagDelete (
2046
- tag: TagIdentifier,
2033
+ tagId: string,
2047
2034
  ): Promise<void> {
2048
- log.verbose('PuppetService', 'tagTagDelete(%s)', JSON.stringify(tag))
2035
+ log.verbose('PuppetService', 'tagTagDelete(%s)', tagId)
2049
2036
 
2050
2037
  const request = new grpcPuppet.TagTagDeleteRequest()
2051
- const tagProb = new grpcPuppet.TagIdentifier()
2052
-
2053
- tag.groupId && tagProb.setGroupId(tag.groupId)
2054
- tagProb.setId(tag.id)
2055
- request.setTag(tagProb)
2056
-
2057
- request.setTag(tagProb)
2038
+ request.setTagId(tagId)
2058
2039
 
2059
2040
  await util.promisify(
2060
2041
  this.grpcManager.client.tagTagDelete
@@ -2079,7 +2060,7 @@ class PuppetService extends PUPPET.Puppet {
2079
2060
 
2080
2061
  override async tagGroupTagList (
2081
2062
  tagGroupId?: string,
2082
- ): Promise<PUPPET.filters.TagIdentifier[]> {
2063
+ ): Promise<string[]> {
2083
2064
  log.verbose('PuppetService', 'tagGroupTagList(%s)', tagGroupId)
2084
2065
 
2085
2066
  const request = new grpcPuppet.TagGroupTagListRequest()
@@ -2092,18 +2073,12 @@ class PuppetService extends PUPPET.Puppet {
2092
2073
  .bind(this.grpcManager.client),
2093
2074
  )(request)
2094
2075
 
2095
- const tags = result.getTagsList()
2096
- const tagIdentifiers = tags.map(tag => {
2097
- return {
2098
- id: tag.getId(),
2099
- groupId: tag.getGroupId(),
2100
- }
2101
- })
2102
- return tagIdentifiers
2076
+ const tagIds = result.getTagIdsList()
2077
+ return tagIds
2103
2078
  }
2104
2079
 
2105
2080
  override async tagTagList (
2106
- ): Promise<PUPPET.filters.TagIdentifier[]> {
2081
+ ): Promise<string[]> {
2107
2082
  log.verbose('PuppetService', 'tagTagList()')
2108
2083
 
2109
2084
  const request = new grpcPuppet.TagTagListRequest()
@@ -2113,19 +2088,13 @@ class PuppetService extends PUPPET.Puppet {
2113
2088
  .bind(this.grpcManager.client),
2114
2089
  )(request)
2115
2090
 
2116
- const tags = result.getTagsList()
2117
- const tagIdentifiers = tags.map(tag => {
2118
- return {
2119
- id: tag.getId(),
2120
- groupId: tag.getGroupId(),
2121
- }
2122
- })
2123
- return tagIdentifiers
2091
+ const tagIds = result.getTagIdsList()
2092
+ return tagIds
2124
2093
  }
2125
2094
 
2126
2095
  override async tagContactTagList (
2127
2096
  contactId: string,
2128
- ): Promise<PUPPET.filters.TagIdentifier[]> {
2097
+ ): Promise<string[]> {
2129
2098
  log.verbose('PuppetService', 'tagContactTagList(%s)', contactId)
2130
2099
 
2131
2100
  const request = new grpcPuppet.TagContactTagListRequest()
@@ -2136,27 +2105,17 @@ class PuppetService extends PUPPET.Puppet {
2136
2105
  .bind(this.grpcManager.client),
2137
2106
  )(request)
2138
2107
 
2139
- const grpcPayloads = result.getTagsList()
2140
- const tags: PUPPET.filters.TagIdentifier[] = grpcPayloads.map(tag => {
2141
- return {
2142
- id: tag.getId(),
2143
- groupId: tag.getGroupId(),
2144
- }
2145
- })
2146
- return tags
2108
+ const tagIds = result.getTagIdsList()
2109
+ return tagIds
2147
2110
  }
2148
2111
 
2149
2112
  override async tagTagContactList (
2150
- tag: TagIdentifier,
2113
+ tagId: string,
2151
2114
  ): Promise<string[]> {
2152
- log.verbose('PuppetService', 'tagTagContactList(%s)', JSON.stringify(tag))
2115
+ log.verbose('PuppetService', 'tagTagContactList(%s)', tagId)
2153
2116
 
2154
2117
  const request = new grpcPuppet.TagTagContactListRequest()
2155
- const tagProb = new grpcPuppet.TagIdentifier()
2156
-
2157
- tag.groupId && tagProb.setGroupId(tag.groupId)
2158
- tagProb.setId(tag.id)
2159
- request.setTag(tagProb)
2118
+ request.setTagId(tagId)
2160
2119
 
2161
2120
  const result = await util.promisify(
2162
2121
  this.grpcManager.client.tagTagContactList
@@ -2192,6 +2151,7 @@ class PuppetService extends PUPPET.Puppet {
2192
2151
  const payload: PUPPET.payloads.TagGroup = {
2193
2152
  id: grpcPayload.getId(),
2194
2153
  name: grpcPayload.getName(),
2154
+ type: grpcPayload.getType(),
2195
2155
  }
2196
2156
 
2197
2157
  await this._payloadStore.tagGroup?.set(id, payload)
@@ -2200,23 +2160,17 @@ class PuppetService extends PUPPET.Puppet {
2200
2160
  return payload
2201
2161
  }
2202
2162
 
2203
- override async tagPayloadPuppet (tag: PUPPET.filters.TagIdentifier): Promise<PUPPET.payloads.Tag> {
2204
- log.verbose('PuppetService', 'tagPayloadPuppet(%s)', JSON.stringify(tag))
2163
+ override async tagPayloadPuppet (tagId: string): Promise<PUPPET.payloads.Tag> {
2164
+ log.verbose('PuppetService', 'tagPayloadPuppet(%s)', tagId)
2205
2165
 
2206
- const key = tag.groupId || '' + FOUR_PER_EM_SPACE + tag.id
2207
- const cachedPayload = await this._payloadStore.tag?.get(key)
2166
+ const cachedPayload = await this._payloadStore.tag?.get(tagId)
2208
2167
  if (cachedPayload) {
2209
- log.silly('PuppetService', 'tagPayloadPuppet(%s) cache HIT', tag)
2168
+ log.silly('PuppetService', 'tagPayloadPuppet(%s) cache HIT', tagId)
2210
2169
  return cachedPayload
2211
2170
  }
2212
2171
 
2213
- const tagIdentifier = new grpcPuppet.TagIdentifier()
2214
- tagIdentifier.setId(tag.id)
2215
- if (tag.groupId) {
2216
- tagIdentifier.setGroupId(tag.groupId)
2217
- }
2218
2172
  const request = new grpcPuppet.TagPayloadRequest()
2219
- request.setTag(tagIdentifier)
2173
+ request.setTagId(tagId)
2220
2174
 
2221
2175
  const response = await util.promisify(
2222
2176
  this.grpcManager.client.tagPayload
@@ -2225,7 +2179,7 @@ class PuppetService extends PUPPET.Puppet {
2225
2179
  const grpcPayload = response.getPayload()
2226
2180
 
2227
2181
  if (!grpcPayload) {
2228
- throw new Error(`tag ${JSON.stringify(tag)} got no payload!`)
2182
+ throw new Error(`tag ${tagId} got no payload!`)
2229
2183
  }
2230
2184
 
2231
2185
  const payload: PUPPET.payloads.Tag = {
@@ -2235,8 +2189,8 @@ class PuppetService extends PUPPET.Puppet {
2235
2189
  type: grpcPayload.getType(),
2236
2190
  }
2237
2191
 
2238
- await this._payloadStore.tag?.set(key, payload)
2239
- log.silly('PuppetService', 'tagPayloadPuppet(%s) cache SET', JSON.stringify(tag))
2192
+ await this._payloadStore.tag?.set(tagId, payload)
2193
+ log.silly('PuppetService', 'tagPayloadPuppet(%s) cache SET', tagId)
2240
2194
 
2241
2195
  return payload
2242
2196
  }
@@ -4,7 +4,7 @@
4
4
  import type { PackageJson } from 'type-fest'
5
5
  export const packageJson: PackageJson = {
6
6
  "name": "@juzi/wechaty-puppet-service",
7
- "version": "1.0.19",
7
+ "version": "1.0.22",
8
8
  "description": "Puppet Service for Wechaty",
9
9
  "type": "module",
10
10
  "exports": {
@@ -69,10 +69,10 @@ export const packageJson: PackageJson = {
69
69
  "why-is-node-running": "^2.2.1"
70
70
  },
71
71
  "peerDependencies": {
72
- "@juzi/wechaty-puppet": "^1.0.22"
72
+ "@juzi/wechaty-puppet": "^1.0.30"
73
73
  },
74
74
  "dependencies": {
75
- "@juzi/wechaty-grpc": "^1.0.13",
75
+ "@juzi/wechaty-grpc": "^1.0.17",
76
76
  "@juzi/wechaty-redux": "^1.0.1",
77
77
  "clone-class": "^1.1.1",
78
78
  "ducks": "^1.0.2",
@@ -280,6 +280,13 @@ class EventStreamManager {
280
280
  this.offCallbackList.push(off)
281
281
  break
282
282
  }
283
+ case 'tag-group': {
284
+ const listener = (payload: PUPPET.payloads.EventTagGroup) => this.grpcEmit(grpcPuppet.EventType.EVENT_TYPE_TAG_GROUP, payload)
285
+ this.puppet.on('tag-group', listener)
286
+ const off = () => this.puppet.off('tag-group', listener)
287
+ this.offCallbackList.push(off)
288
+ break
289
+ }
283
290
  case 'reset':
284
291
  // the `reset` event should be dealed internally, should not send out
285
292
  break
@@ -256,6 +256,7 @@ function puppetImplementation (
256
256
  response.setTitle(payload.title || '')
257
257
  response.setDescription(payload.description || '')
258
258
  response.setAdditionalInfo(payload.additionalInfo || '')
259
+ response.setTagIdsList(payload.tags || [])
259
260
 
260
261
  return callback(null, response)
261
262
  } catch (e) {
@@ -1507,16 +1508,10 @@ function puppetImplementation (
1507
1508
  log.verbose('PuppetServiceImpl', 'tagContactTagAdd()')
1508
1509
 
1509
1510
  try {
1510
- const tagsProb = call.request.getTagsList()
1511
+ const tagIds = call.request.getTagIdsList()
1511
1512
  const contactIds = call.request.getContactIdsList()
1512
- const tags = tagsProb.map(tagProb => {
1513
- return {
1514
- id: tagProb.getId(),
1515
- groupId: tagProb.getGroupId(),
1516
- }
1517
- })
1518
1513
 
1519
- await puppet.tagContactTagAdd(tags, contactIds)
1514
+ await puppet.tagContactTagAdd(tagIds, contactIds)
1520
1515
 
1521
1516
  return callback(null, new grpcPuppet.TagContactTagAddResponse())
1522
1517
  } catch (e) {
@@ -1528,16 +1523,10 @@ function puppetImplementation (
1528
1523
  log.verbose('PuppetServiceImpl', 'tagContactTagRemove()')
1529
1524
 
1530
1525
  try {
1531
- const tagsProb = call.request.getTagsList()
1526
+ const tagIds = call.request.getTagIdsList()
1532
1527
  const contactIds = call.request.getContactIdsList()
1533
- const tags = tagsProb.map(tagProb => {
1534
- return {
1535
- id: tagProb.getId(),
1536
- groupId: tagProb.getGroupId(),
1537
- }
1538
- })
1539
1528
 
1540
- await puppet.tagContactTagRemove(tags, contactIds)
1529
+ await puppet.tagContactTagRemove(tagIds, contactIds)
1541
1530
 
1542
1531
  return callback(null, new grpcPuppet.TagContactTagRemoveResponse())
1543
1532
  } catch (e) {
@@ -1587,15 +1576,10 @@ function puppetImplementation (
1587
1576
  const tagName = call.request.getTagName()
1588
1577
 
1589
1578
  const result = await puppet.tagTagAdd(tagName, tagGroupId)
1590
- const tagIdentifier = new grpcPuppet.TagIdentifier()
1591
1579
  const response = new grpcPuppet.TagTagAddResponse()
1592
1580
 
1593
1581
  if (result) {
1594
- tagIdentifier.setId(result.id)
1595
- if (result.groupId) {
1596
- tagIdentifier.setGroupId(result.groupId)
1597
- }
1598
- response.setTag(tagIdentifier)
1582
+ response.setTagId(result)
1599
1583
  }
1600
1584
 
1601
1585
  return callback(null, response)
@@ -1608,11 +1592,9 @@ function puppetImplementation (
1608
1592
  log.verbose('PuppetServiceImpl', 'tagTagDelete()')
1609
1593
 
1610
1594
  try {
1611
- const tagProb = call.request.getTag()
1612
- const id = tagProb?.getId()!
1613
- const groupId = tagProb?.getGroupId()
1595
+ const tagId = call.request.getTagId()
1614
1596
 
1615
- await puppet.tagTagDelete({ id, groupId })
1597
+ await puppet.tagTagDelete(tagId)
1616
1598
 
1617
1599
  return callback(null, new grpcPuppet.TagTagDeleteResponse())
1618
1600
  } catch (e) {
@@ -1642,16 +1624,9 @@ function puppetImplementation (
1642
1624
  const tagGroupId = call.request.getTagGroupId()
1643
1625
 
1644
1626
  const result = await puppet.tagGroupTagList(tagGroupId)
1645
- const tagIdentifiers = result.map(tag => {
1646
- const tagIdentifier = new grpcPuppet.TagIdentifier()
1647
- tagIdentifier.setId(tag.id)
1648
- if (tag.groupId) {
1649
- tagIdentifier.setGroupId(tag.groupId)
1650
- }
1651
- return tagIdentifier
1652
- })
1627
+
1653
1628
  const response = new grpcPuppet.TagGroupTagListResponse()
1654
- response.setTagsList(tagIdentifiers)
1629
+ response.setTagIdsList(result)
1655
1630
 
1656
1631
  return callback(null, response)
1657
1632
  } catch (e) {
@@ -1665,16 +1640,9 @@ function puppetImplementation (
1665
1640
 
1666
1641
  try {
1667
1642
  const result = await puppet.tagTagList()
1668
- const tagIdentifiers = result.map(tag => {
1669
- const tagIdentifier = new grpcPuppet.TagIdentifier()
1670
- tagIdentifier.setId(tag.id)
1671
- if (tag.groupId) {
1672
- tagIdentifier.setGroupId(tag.groupId)
1673
- }
1674
- return tagIdentifier
1675
- })
1643
+
1676
1644
  const response = new grpcPuppet.TagTagListResponse()
1677
- response.setTagsList(tagIdentifiers)
1645
+ response.setTagIdsList(result)
1678
1646
 
1679
1647
  return callback(null, response)
1680
1648
  } catch (e) {
@@ -1689,16 +1657,9 @@ function puppetImplementation (
1689
1657
  const contactId = call.request.getContactId()
1690
1658
 
1691
1659
  const result = await puppet.tagContactTagList(contactId)
1692
- const tagIdentifiers = result.map(tag => {
1693
- const tagIdentifier = new grpcPuppet.TagIdentifier()
1694
- tagIdentifier.setId(tag.id)
1695
- if (tag.groupId) {
1696
- tagIdentifier.setGroupId(tag.groupId)
1697
- }
1698
- return tagIdentifier
1699
- })
1660
+
1700
1661
  const response = new grpcPuppet.TagContactTagListResponse()
1701
- response.setTagsList(tagIdentifiers)
1662
+ response.setTagIdsList(result)
1702
1663
 
1703
1664
  return callback(null, response)
1704
1665
  } catch (e) {
@@ -1710,11 +1671,9 @@ function puppetImplementation (
1710
1671
  log.verbose('PuppetServiceImpl', 'tagTagContactList()')
1711
1672
 
1712
1673
  try {
1713
- const tagProb = call.request.getTag()
1714
- const id = tagProb?.getId()!
1715
- const groupId = tagProb?.getGroupId()
1674
+ const tagId = call.request.getTagId()
1716
1675
 
1717
- const result = await puppet.tagTagContactList({ id, groupId })
1676
+ const result = await puppet.tagTagContactList(tagId)
1718
1677
 
1719
1678
  const response = new grpcPuppet.TagTagContactListResponse()
1720
1679
  response.setContactIdsList(result)
@@ -1736,6 +1695,7 @@ function puppetImplementation (
1736
1695
  const payload = new grpcPuppet.TagGroupPayload()
1737
1696
  payload.setId(result.id)
1738
1697
  payload.setName(result.name)
1698
+ payload.setType(result.type)
1739
1699
  response.setPayload(payload)
1740
1700
 
1741
1701
  return callback(null, response)
@@ -1749,11 +1709,9 @@ function puppetImplementation (
1749
1709
  log.verbose('PuppetServiceImpl', 'tagPayload()')
1750
1710
 
1751
1711
  try {
1752
- const tag = call.request.getTag()!
1753
- const id = tag.getId()
1754
- const groupId = tag.getGroupId() || ''
1712
+ const tagId = call.request.getTagId()
1755
1713
 
1756
- const result = await puppet.tagPayloadPuppet({ id, groupId })
1714
+ const result = await puppet.tagPayloadPuppet(tagId)
1757
1715
  const response = new grpcPuppet.TagPayloadResponse()
1758
1716
  const payload = new grpcPuppet.TagPayload()
1759
1717
  payload.setId(result.id)