Built motion from commit (unavailable).|2.5.25
[motion2.git] / server / api / intDeskConfiguration / intDeskConfiguration.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 _0x2121=['request\x20sent','stringify','error','message','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s'];(function(_0x861543,_0x3e8a72){var _0x14def8=function(_0xdb2190){while(--_0xdb2190){_0x861543['push'](_0x861543['shift']());}};_0x14def8(++_0x3e8a72);}(_0x2121,0x1b4));var _0x1212=function(_0x3c1566,_0x51f2f3){_0x3c1566=_0x3c1566-0x0;var _0x532f0a=_0x2121[_0x3c1566];return _0x532f0a;};'use strict';var _=require(_0x1212('0x0'));var util=require(_0x1212('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1212('0x2'));var fs=require('fs');var Redis=require(_0x1212('0x3'));var db=require(_0x1212('0x4'))['db'];var utils=require(_0x1212('0x5'));var logger=require(_0x1212('0x6'))('rpc');var config=require(_0x1212('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1212('0x8')][_0x1212('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20fadc,_0x1b1ef5,_0x233a53){return new BPromise(function(_0x642ed5,_0x4a3d2a){return client[_0x1212('0xa')](_0x20fadc,_0x233a53)[_0x1212('0xb')](function(_0x434d23){logger[_0x1212('0xc')](_0x1212('0xd'),_0x1b1ef5,_0x1212('0xe'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1b1ef5,_0x1212('0xe'),JSON[_0x1212('0xf')](_0x434d23));if(_0x434d23[_0x1212('0x10')]){if(_0x434d23[_0x1212('0x10')]['code']===0x1f4){logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);return _0x4a3d2a(_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);}logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);return _0x642ed5(_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);}else{logger[_0x1212('0xc')](_0x1212('0xd'),_0x1b1ef5,_0x1212('0xe'));_0x642ed5(_0x434d23['result']['message']);}})['catch'](function(_0x3cfe21){logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x3cfe21);_0x4a3d2a(_0x3cfe21);});});}