Built motion from commit f7863d46.|2.5.41
[motion2.git] / server / api / intZohoConfiguration / intZohoConfiguration.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 _0xed22=['request','then','info','request\x20sent','debug','error','code','ZohoConfiguration,\x20%s,\x20%s','message','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xed22,0x11a));var _0x2ed2=function(_0x3d6cd7,_0x1066a5){_0x3d6cd7=_0x3d6cd7-0x0;var _0x1df47b=_0xed22[_0x3d6cd7];return _0x1df47b;};'use strict';var _=require('lodash');var util=require(_0x2ed2('0x0'));var moment=require(_0x2ed2('0x1'));var BPromise=require('bluebird');var rs=require(_0x2ed2('0x2'));var fs=require('fs');var Redis=require(_0x2ed2('0x3'));var db=require(_0x2ed2('0x4'))['db'];var utils=require(_0x2ed2('0x5'));var logger=require(_0x2ed2('0x6'))(_0x2ed2('0x7'));var config=require(_0x2ed2('0x8'));var jayson=require(_0x2ed2('0x9'));var client=jayson[_0x2ed2('0xa')][_0x2ed2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb1fa02,_0x22ad12,_0x2cab17){return new BPromise(function(_0x2a039e,_0x3365b3){return client[_0x2ed2('0xc')](_0xb1fa02,_0x2cab17)[_0x2ed2('0xd')](function(_0xef7e63){logger[_0x2ed2('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x22ad12,_0x2ed2('0xf'));logger[_0x2ed2('0x10')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x22ad12,'request\x20sent',JSON['stringify'](_0xef7e63));if(_0xef7e63[_0x2ed2('0x11')]){if(_0xef7e63[_0x2ed2('0x11')][_0x2ed2('0x12')]===0x1f4){logger[_0x2ed2('0x11')](_0x2ed2('0x13'),_0x22ad12,_0xef7e63[_0x2ed2('0x11')][_0x2ed2('0x14')]);return _0x3365b3(_0xef7e63[_0x2ed2('0x11')][_0x2ed2('0x14')]);}logger[_0x2ed2('0x11')](_0x2ed2('0x13'),_0x22ad12,_0xef7e63[_0x2ed2('0x11')][_0x2ed2('0x14')]);return _0x2a039e(_0xef7e63[_0x2ed2('0x11')][_0x2ed2('0x14')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x22ad12,_0x2ed2('0xf'));_0x2a039e(_0xef7e63['result'][_0x2ed2('0x14')]);}})['catch'](function(_0x54859f){logger[_0x2ed2('0x11')](_0x2ed2('0x13'),_0x22ad12,_0x54859f);_0x3365b3(_0x54859f);});});}