Built motion from commit 85328c08.|2.5.50
[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 _0xb462=['request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x2ac756,_0x33408b){var _0xa621fb=function(_0x5a316f){while(--_0x5a316f){_0x2ac756['push'](_0x2ac756['shift']());}};_0xa621fb(++_0x33408b);}(_0xb462,0x85));var _0x2b46=function(_0x4dafbb,_0xd041a3){_0x4dafbb=_0x4dafbb-0x0;var _0x600535=_0xb462[_0x4dafbb];return _0x600535;};'use strict';var _=require('lodash');var util=require(_0x2b46('0x0'));var moment=require(_0x2b46('0x1'));var BPromise=require(_0x2b46('0x2'));var rs=require(_0x2b46('0x3'));var fs=require('fs');var Redis=require(_0x2b46('0x4'));var db=require(_0x2b46('0x5'))['db'];var utils=require(_0x2b46('0x6'));var logger=require(_0x2b46('0x7'))(_0x2b46('0x8'));var config=require(_0x2b46('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2b46('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2979a0,_0x326b48,_0x340dea){return new BPromise(function(_0x3b0772,_0x33db0c){return client[_0x2b46('0xb')](_0x2979a0,_0x340dea)[_0x2b46('0xc')](function(_0x3102ad){logger[_0x2b46('0xd')](_0x2b46('0xe'),_0x326b48,'request\x20sent');logger[_0x2b46('0xf')](_0x2b46('0x10'),_0x326b48,_0x2b46('0x11'),JSON[_0x2b46('0x12')](_0x3102ad));if(_0x3102ad[_0x2b46('0x13')]){if(_0x3102ad['error'][_0x2b46('0x14')]===0x1f4){logger[_0x2b46('0x13')](_0x2b46('0xe'),_0x326b48,_0x3102ad[_0x2b46('0x13')][_0x2b46('0x15')]);return _0x33db0c(_0x3102ad['error'][_0x2b46('0x15')]);}logger['error'](_0x2b46('0xe'),_0x326b48,_0x3102ad[_0x2b46('0x13')][_0x2b46('0x15')]);return _0x3b0772(_0x3102ad[_0x2b46('0x13')][_0x2b46('0x15')]);}else{logger[_0x2b46('0xd')](_0x2b46('0xe'),_0x326b48,_0x2b46('0x11'));_0x3b0772(_0x3102ad[_0x2b46('0x16')][_0x2b46('0x15')]);}})[_0x2b46('0x17')](function(_0x2433f7){logger[_0x2b46('0x13')](_0x2b46('0xe'),_0x326b48,_0x2433f7);_0x33db0c(_0x2433f7);});});}