LivePersonInc / node-agent-sdk

LivePerson Agent Messaging SDK for NodeJS
MIT License
49 stars 78 forks source link

Exposing Transformer and Adding it to Constructor #56

Closed ChristianJGarrido closed 6 years ago

ChristianJGarrido commented 6 years ago
const Agent = require('node-agent-sdk').Agent;
let Transformer = require('node-agent-sdk').Transformer;

Transformer['.ams.userprofile.GetUserProfile$Response'] = (msg) => {
  //add own code
  return msg;
});

const agent = new Agent({
    accountId: process.env.LP_ACCOUNT,
    username: process.env.LP_USER,
    password: process.env.LP_PASS
    transformer: Transformer
});
miki2826 commented 6 years ago

Hi, The whole point is to mask the transformer and not to expose it. This is internal implementation in order to mask transformation between API versions. You shouldn't use the fields that are not available to you since they will probably be deprecated.