Built motion from commit 598073ad.|2.5.44
[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 _0x2e75=['debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','info','request\x20sent'];(function(_0x28fa46,_0x56a7b2){var _0x341a5c=function(_0x39bcec){while(--_0x39bcec){_0x28fa46['push'](_0x28fa46['shift']());}};_0x341a5c(++_0x56a7b2);}(_0x2e75,0x16e));var _0x52e7=function(_0x43de12,_0x15968b){_0x43de12=_0x43de12-0x0;var _0x579829=_0x2e75[_0x43de12];return _0x579829;};'use strict';var _=require(_0x52e7('0x0'));var util=require(_0x52e7('0x1'));var moment=require(_0x52e7('0x2'));var BPromise=require(_0x52e7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52e7('0x4'));var db=require(_0x52e7('0x5'))['db'];var utils=require(_0x52e7('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x52e7('0x7'));var client=jayson[_0x52e7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1431bf,_0x266d6f,_0x1f92b7){return new BPromise(function(_0x2c010f,_0xee2477){return client[_0x52e7('0x9')](_0x1431bf,_0x1f92b7)['then'](function(_0x31c67b){logger[_0x52e7('0xa')]('ZohoField,\x20%s,\x20%s',_0x266d6f,_0x52e7('0xb'));logger[_0x52e7('0xc')](_0x52e7('0xd'),_0x266d6f,_0x52e7('0xb'),JSON[_0x52e7('0xe')](_0x31c67b));if(_0x31c67b['error']){if(_0x31c67b[_0x52e7('0xf')][_0x52e7('0x10')]===0x1f4){logger['error'](_0x52e7('0x11'),_0x266d6f,_0x31c67b[_0x52e7('0xf')][_0x52e7('0x12')]);return _0xee2477(_0x31c67b[_0x52e7('0xf')][_0x52e7('0x12')]);}logger[_0x52e7('0xf')]('ZohoField,\x20%s,\x20%s',_0x266d6f,_0x31c67b[_0x52e7('0xf')][_0x52e7('0x12')]);return _0x2c010f(_0x31c67b[_0x52e7('0xf')][_0x52e7('0x12')]);}else{logger[_0x52e7('0xa')](_0x52e7('0x11'),_0x266d6f,_0x52e7('0xb'));_0x2c010f(_0x31c67b[_0x52e7('0x13')]['message']);}})[_0x52e7('0x14')](function(_0x442162){logger[_0x52e7('0xf')](_0x52e7('0x11'),_0x266d6f,_0x442162);_0xee2477(_0x442162);});});}