Built motion from commit (unavailable).|2.5.8
[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 _0xdaed=['request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','ZohoConfiguration,\x20%s,\x20%s'];(function(_0x14dbaf,_0x3cdfe4){var _0x25b340=function(_0x1d9fe2){while(--_0x1d9fe2){_0x14dbaf['push'](_0x14dbaf['shift']());}};_0x25b340(++_0x3cdfe4);}(_0xdaed,0x151));var _0xddae=function(_0x47a868,_0x485646){_0x47a868=_0x47a868-0x0;var _0x1d4ddd=_0xdaed[_0x47a868];return _0x1d4ddd;};'use strict';var _=require(_0xddae('0x0'));var util=require(_0xddae('0x1'));var moment=require(_0xddae('0x2'));var BPromise=require(_0xddae('0x3'));var rs=require(_0xddae('0x4'));var fs=require('fs');var Redis=require(_0xddae('0x5'));var db=require(_0xddae('0x6'))['db'];var utils=require(_0xddae('0x7'));var logger=require(_0xddae('0x8'))(_0xddae('0x9'));var config=require('../../config/environment');var jayson=require(_0xddae('0xa'));var client=jayson[_0xddae('0xb')][_0xddae('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ac927,_0x20b230,_0x22a862){return new BPromise(function(_0x4e81a5,_0x1f1495){return client[_0xddae('0xd')](_0x1ac927,_0x22a862)['then'](function(_0x3ed8f1){logger['info'](_0xddae('0xe'),_0x20b230,_0xddae('0xf'));logger['debug'](_0xddae('0x10'),_0x20b230,_0xddae('0xf'),JSON[_0xddae('0x11')](_0x3ed8f1));if(_0x3ed8f1[_0xddae('0x12')]){if(_0x3ed8f1[_0xddae('0x12')]['code']===0x1f4){logger[_0xddae('0x12')](_0xddae('0xe'),_0x20b230,_0x3ed8f1[_0xddae('0x12')][_0xddae('0x13')]);return _0x1f1495(_0x3ed8f1[_0xddae('0x12')][_0xddae('0x13')]);}logger[_0xddae('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x20b230,_0x3ed8f1[_0xddae('0x12')][_0xddae('0x13')]);return _0x4e81a5(_0x3ed8f1[_0xddae('0x12')]['message']);}else{logger[_0xddae('0x14')](_0xddae('0xe'),_0x20b230,_0xddae('0xf'));_0x4e81a5(_0x3ed8f1['result'][_0xddae('0x13')]);}})[_0xddae('0x15')](function(_0x52dd06){logger[_0xddae('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x20b230,_0x52dd06);_0x1f1495(_0x52dd06);});});}