Built motion from commit 3c2ce842.|2.6.31
[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 _0x44b3=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x20e295,_0x308599){var _0x33ffbe=function(_0x2eeb46){while(--_0x2eeb46){_0x20e295['push'](_0x20e295['shift']());}};_0x33ffbe(++_0x308599);}(_0x44b3,0x1b8));var _0x344b=function(_0x2403fd,_0x4e4aec){_0x2403fd=_0x2403fd-0x0;var _0x4ca7fc=_0x44b3[_0x2403fd];return _0x4ca7fc;};'use strict';var _=require(_0x344b('0x0'));var util=require(_0x344b('0x1'));var moment=require('moment');var BPromise=require(_0x344b('0x2'));var rs=require(_0x344b('0x3'));var fs=require('fs');var Redis=require(_0x344b('0x4'));var db=require(_0x344b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x344b('0x6'))(_0x344b('0x7'));var config=require(_0x344b('0x8'));var jayson=require(_0x344b('0x9'));var client=jayson[_0x344b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f8739,_0x134494,_0x3840a7){return new BPromise(function(_0x54db0b,_0x3dc87a){return client[_0x344b('0xb')](_0x3f8739,_0x3840a7)[_0x344b('0xc')](function(_0x187f37){logger[_0x344b('0xd')](_0x344b('0xe'),_0x134494,_0x344b('0xf'));logger[_0x344b('0x10')](_0x344b('0x11'),_0x134494,'request\x20sent',JSON[_0x344b('0x12')](_0x187f37));if(_0x187f37[_0x344b('0x13')]){if(_0x187f37[_0x344b('0x13')][_0x344b('0x14')]===0x1f4){logger[_0x344b('0x13')](_0x344b('0xe'),_0x134494,_0x187f37[_0x344b('0x13')][_0x344b('0x15')]);return _0x3dc87a(_0x187f37[_0x344b('0x13')][_0x344b('0x15')]);}logger[_0x344b('0x13')](_0x344b('0xe'),_0x134494,_0x187f37['error'][_0x344b('0x15')]);return _0x54db0b(_0x187f37[_0x344b('0x13')]['message']);}else{logger[_0x344b('0xd')](_0x344b('0xe'),_0x134494,'request\x20sent');_0x54db0b(_0x187f37['result'][_0x344b('0x15')]);}})['catch'](function(_0x1322f6){logger[_0x344b('0x13')](_0x344b('0xe'),_0x134494,_0x1322f6);_0x3dc87a(_0x1322f6);});});}