(
client: MqttClient,
context: MqttContext,
id: string,
)
| 167 | } |
| 168 | |
| 169 | public getPublisher( |
| 170 | client: MqttClient, |
| 171 | context: MqttContext, |
| 172 | id: string, |
| 173 | ): any { |
| 174 | return (response: any) => { |
| 175 | Object.assign(response, { id }); |
| 176 | |
| 177 | const options = |
| 178 | isObject(response?.data) && response.data instanceof MqttRecord |
| 179 | ? (response.data as MqttRecord)?.options |
| 180 | : {}; |
| 181 | delete response?.data?.options; |
| 182 | |
| 183 | const outgoingResponse: string | Buffer = |
| 184 | this.serializer.serialize(response); |
| 185 | |
| 186 | this.onProcessingEndHook?.(this.transportId, context); |
| 187 | return client.publish( |
| 188 | this.getReplyPattern(context.getTopic()), |
| 189 | outgoingResponse, |
| 190 | options, |
| 191 | ); |
| 192 | }; |
| 193 | } |
| 194 | |
| 195 | public parseMessage(content: any): ReadPacket & PacketId { |
| 196 | try { |
no test coverage detected