Built motion from commit (unavailable).|2.3.4
[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 _0x3c8d=['request','then','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x3c8d,0x185));var _0xd3c8=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x3c8d[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0xd3c8('0x0'));var util=require(_0xd3c8('0x1'));var moment=require(_0xd3c8('0x2'));var BPromise=require(_0xd3c8('0x3'));var rs=require(_0xd3c8('0x4'));var fs=require('fs');var Redis=require(_0xd3c8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd3c8('0x6'));var logger=require(_0xd3c8('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd3c8('0x8'));var client=jayson['client'][_0xd3c8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f8f14,_0x169a1b,_0x2e32c5){return new BPromise(function(_0x116b84,_0x247965){return client[_0xd3c8('0xa')](_0x1f8f14,_0x2e32c5)[_0xd3c8('0xb')](function(_0x327a9f){logger['info'](_0xd3c8('0xc'),_0x169a1b,_0xd3c8('0xd'));logger['debug'](_0xd3c8('0xe'),_0x169a1b,_0xd3c8('0xd'),JSON[_0xd3c8('0xf')](_0x327a9f));if(_0x327a9f[_0xd3c8('0x10')]){if(_0x327a9f[_0xd3c8('0x10')][_0xd3c8('0x11')]===0x1f4){logger[_0xd3c8('0x10')]('ZohoField,\x20%s,\x20%s',_0x169a1b,_0x327a9f[_0xd3c8('0x10')][_0xd3c8('0x12')]);return _0x247965(_0x327a9f[_0xd3c8('0x10')][_0xd3c8('0x12')]);}logger[_0xd3c8('0x10')](_0xd3c8('0xc'),_0x169a1b,_0x327a9f[_0xd3c8('0x10')]['message']);return _0x116b84(_0x327a9f[_0xd3c8('0x10')]['message']);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x169a1b,_0xd3c8('0xd'));_0x116b84(_0x327a9f[_0xd3c8('0x13')][_0xd3c8('0x12')]);}})[_0xd3c8('0x14')](function(_0x154343){logger[_0xd3c8('0x10')]('ZohoField,\x20%s,\x20%s',_0x169a1b,_0x154343);_0x247965(_0x154343);});});}