Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / api / intZohoField / intZohoField.rpc.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x1025=['request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x1025,0x1ef));var _0x5102=function(_0xa277de,_0x2ad712){_0xa277de=_0xa277de-0x0;var _0x27c2da=_0x1025[_0xa277de];return _0x27c2da;};'use strict';var _=require(_0x5102('0x0'));var util=require('util');var moment=require(_0x5102('0x1'));var BPromise=require(_0x5102('0x2'));var rs=require(_0x5102('0x3'));var fs=require('fs');var Redis=require(_0x5102('0x4'));var db=require(_0x5102('0x5'))['db'];var utils=require(_0x5102('0x6'));var logger=require('../../config/logger')(_0x5102('0x7'));var config=require(_0x5102('0x8'));var jayson=require(_0x5102('0x9'));var client=jayson['client'][_0x5102('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x390e04,_0x21fb22,_0x30aa25){return new BPromise(function(_0x45fe1f,_0x3024ee){return client[_0x5102('0xb')](_0x390e04,_0x30aa25)[_0x5102('0xc')](function(_0x4c5fa6){logger[_0x5102('0xd')](_0x5102('0xe'),_0x21fb22,'request\x20sent');logger[_0x5102('0xf')](_0x5102('0x10'),_0x21fb22,'request\x20sent',JSON['stringify'](_0x4c5fa6));if(_0x4c5fa6[_0x5102('0x11')]){if(_0x4c5fa6['error'][_0x5102('0x12')]===0x1f4){logger[_0x5102('0x11')](_0x5102('0xe'),_0x21fb22,_0x4c5fa6[_0x5102('0x11')][_0x5102('0x13')]);return _0x3024ee(_0x4c5fa6[_0x5102('0x11')][_0x5102('0x13')]);}logger['error'](_0x5102('0xe'),_0x21fb22,_0x4c5fa6[_0x5102('0x11')][_0x5102('0x13')]);return _0x45fe1f(_0x4c5fa6[_0x5102('0x11')][_0x5102('0x13')]);}else{logger['info'](_0x5102('0xe'),_0x21fb22,_0x5102('0x14'));_0x45fe1f(_0x4c5fa6[_0x5102('0x15')][_0x5102('0x13')]);}})[_0x5102('0x16')](function(_0xab239d){logger[_0x5102('0x11')](_0x5102('0xe'),_0x21fb22,_0xab239d);_0x3024ee(_0xab239d);});});}