Built motion from commit e1760111.|2.6.18
[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 _0x4f8d=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0xecaf2e,_0x4f6a31){var _0x2f87fc=function(_0x2641e1){while(--_0x2641e1){_0xecaf2e['push'](_0xecaf2e['shift']());}};_0x2f87fc(++_0x4f6a31);}(_0x4f8d,0x1ca));var _0xd4f8=function(_0x2c7dc6,_0x3c4ce0){_0x2c7dc6=_0x2c7dc6-0x0;var _0x10002b=_0x4f8d[_0x2c7dc6];return _0x10002b;};'use strict';var _=require(_0xd4f8('0x0'));var util=require(_0xd4f8('0x1'));var moment=require(_0xd4f8('0x2'));var BPromise=require(_0xd4f8('0x3'));var rs=require(_0xd4f8('0x4'));var fs=require('fs');var Redis=require(_0xd4f8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd4f8('0x6'));var logger=require(_0xd4f8('0x7'))(_0xd4f8('0x8'));var config=require(_0xd4f8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd4f8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fe975,_0x2b6921,_0x418f13){return new BPromise(function(_0x246026,_0x34d29c){return client[_0xd4f8('0xb')](_0x1fe975,_0x418f13)[_0xd4f8('0xc')](function(_0x37f7f4){logger[_0xd4f8('0xd')](_0xd4f8('0xe'),_0x2b6921,_0xd4f8('0xf'));logger[_0xd4f8('0x10')](_0xd4f8('0x11'),_0x2b6921,'request\x20sent',JSON[_0xd4f8('0x12')](_0x37f7f4));if(_0x37f7f4[_0xd4f8('0x13')]){if(_0x37f7f4[_0xd4f8('0x13')][_0xd4f8('0x14')]===0x1f4){logger[_0xd4f8('0x13')](_0xd4f8('0xe'),_0x2b6921,_0x37f7f4[_0xd4f8('0x13')][_0xd4f8('0x15')]);return _0x34d29c(_0x37f7f4[_0xd4f8('0x13')][_0xd4f8('0x15')]);}logger[_0xd4f8('0x13')](_0xd4f8('0xe'),_0x2b6921,_0x37f7f4[_0xd4f8('0x13')][_0xd4f8('0x15')]);return _0x246026(_0x37f7f4[_0xd4f8('0x13')][_0xd4f8('0x15')]);}else{logger['info'](_0xd4f8('0xe'),_0x2b6921,_0xd4f8('0xf'));_0x246026(_0x37f7f4[_0xd4f8('0x16')][_0xd4f8('0x15')]);}})['catch'](function(_0x5a8793){logger[_0xd4f8('0x13')](_0xd4f8('0xe'),_0x2b6921,_0x5a8793);_0x34d29c(_0x5a8793);});});}