Built motion from commit (unavailable).|2.4.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 _0xd615=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','stringify','error','code','message','ZohoConfiguration,\x20%s,\x20%s','lodash','util','moment','bluebird'];(function(_0x127c7b,_0x1f65e7){var _0x1708eb=function(_0x2033e5){while(--_0x2033e5){_0x127c7b['push'](_0x127c7b['shift']());}};_0x1708eb(++_0x1f65e7);}(_0xd615,0x146));var _0x5d61=function(_0x25f47a,_0x251275){_0x25f47a=_0x25f47a-0x0;var _0x5b94b7=_0xd615[_0x25f47a];return _0x5b94b7;};'use strict';var _=require(_0x5d61('0x0'));var util=require(_0x5d61('0x1'));var moment=require(_0x5d61('0x2'));var BPromise=require(_0x5d61('0x3'));var rs=require(_0x5d61('0x4'));var fs=require('fs');var Redis=require(_0x5d61('0x5'));var db=require(_0x5d61('0x6'))['db'];var utils=require(_0x5d61('0x7'));var logger=require(_0x5d61('0x8'))(_0x5d61('0x9'));var config=require(_0x5d61('0xa'));var jayson=require(_0x5d61('0xb'));var client=jayson[_0x5d61('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c9c3,_0x1247ac,_0x322214){return new BPromise(function(_0xe55b1d,_0x56220f){return client[_0x5d61('0xd')](_0x2c9c3,_0x322214)[_0x5d61('0xe')](function(_0x2618e7){logger[_0x5d61('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x1247ac,_0x5d61('0x10'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x1247ac,_0x5d61('0x10'),JSON[_0x5d61('0x11')](_0x2618e7));if(_0x2618e7[_0x5d61('0x12')]){if(_0x2618e7[_0x5d61('0x12')][_0x5d61('0x13')]===0x1f4){logger[_0x5d61('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x1247ac,_0x2618e7[_0x5d61('0x12')]['message']);return _0x56220f(_0x2618e7[_0x5d61('0x12')][_0x5d61('0x14')]);}logger[_0x5d61('0x12')](_0x5d61('0x15'),_0x1247ac,_0x2618e7['error'][_0x5d61('0x14')]);return _0xe55b1d(_0x2618e7[_0x5d61('0x12')]['message']);}else{logger[_0x5d61('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x1247ac,_0x5d61('0x10'));_0xe55b1d(_0x2618e7['result']['message']);}})['catch'](function(_0x5b4e0d){logger[_0x5d61('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x1247ac,_0x5b4e0d);_0x56220f(_0x5b4e0d);});});}