Built motion from commit (unavailable).|2.5.25
[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 _0x5598=['result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x5598,0x87));var _0x8559=function(_0xf104db,_0x3bb494){_0xf104db=_0xf104db-0x0;var _0xab56c5=_0x5598[_0xf104db];return _0xab56c5;};'use strict';var _=require(_0x8559('0x0'));var util=require('util');var moment=require(_0x8559('0x1'));var BPromise=require(_0x8559('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8559('0x3'));var db=require(_0x8559('0x4'))['db'];var utils=require(_0x8559('0x5'));var logger=require('../../config/logger')(_0x8559('0x6'));var config=require(_0x8559('0x7'));var jayson=require(_0x8559('0x8'));var client=jayson[_0x8559('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a115d,_0x58e970,_0x3bb116){return new BPromise(function(_0x3b36f9,_0x55b63b){return client['request'](_0x1a115d,_0x3bb116)[_0x8559('0xa')](function(_0x1b3d31){logger[_0x8559('0xb')](_0x8559('0xc'),_0x58e970,_0x8559('0xd'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x58e970,_0x8559('0xd'),JSON[_0x8559('0xe')](_0x1b3d31));if(_0x1b3d31[_0x8559('0xf')]){if(_0x1b3d31[_0x8559('0xf')]['code']===0x1f4){logger[_0x8559('0xf')](_0x8559('0xc'),_0x58e970,_0x1b3d31[_0x8559('0xf')][_0x8559('0x10')]);return _0x55b63b(_0x1b3d31[_0x8559('0xf')]['message']);}logger[_0x8559('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x58e970,_0x1b3d31[_0x8559('0xf')][_0x8559('0x10')]);return _0x3b36f9(_0x1b3d31['error']['message']);}else{logger[_0x8559('0xb')](_0x8559('0xc'),_0x58e970,_0x8559('0xd'));_0x3b36f9(_0x1b3d31[_0x8559('0x11')][_0x8559('0x10')]);}})[_0x8559('0x12')](function(_0x3319d1){logger[_0x8559('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x58e970,_0x3319d1);_0x55b63b(_0x3319d1);});});}