Built motion from commit 9d0783e6.|2.6.13
[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 _0x9e6d=['error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1c5417,_0x21b96c){var _0x5b2ec0=function(_0x17bdf2){while(--_0x17bdf2){_0x1c5417['push'](_0x1c5417['shift']());}};_0x5b2ec0(++_0x21b96c);}(_0x9e6d,0x1d2));var _0xd9e6=function(_0x9d485,_0x21d5fb){_0x9d485=_0x9d485-0x0;var _0x530758=_0x9e6d[_0x9d485];return _0x530758;};'use strict';var _=require(_0xd9e6('0x0'));var util=require('util');var moment=require(_0xd9e6('0x1'));var BPromise=require(_0xd9e6('0x2'));var rs=require(_0xd9e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9e6('0x4'))['db'];var utils=require(_0xd9e6('0x5'));var logger=require(_0xd9e6('0x6'))(_0xd9e6('0x7'));var config=require('../../config/environment');var jayson=require(_0xd9e6('0x8'));var client=jayson[_0xd9e6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57a688,_0x1cb696,_0x44ac22){return new BPromise(function(_0x1103ba,_0x5b296b){return client[_0xd9e6('0xa')](_0x57a688,_0x44ac22)[_0xd9e6('0xb')](function(_0x596895){logger[_0xd9e6('0xc')](_0xd9e6('0xd'),_0x1cb696,'request\x20sent');logger['debug'](_0xd9e6('0xe'),_0x1cb696,_0xd9e6('0xf'),JSON[_0xd9e6('0x10')](_0x596895));if(_0x596895[_0xd9e6('0x11')]){if(_0x596895[_0xd9e6('0x11')][_0xd9e6('0x12')]===0x1f4){logger[_0xd9e6('0x11')](_0xd9e6('0xd'),_0x1cb696,_0x596895[_0xd9e6('0x11')]['message']);return _0x5b296b(_0x596895[_0xd9e6('0x11')][_0xd9e6('0x13')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x1cb696,_0x596895[_0xd9e6('0x11')]['message']);return _0x1103ba(_0x596895[_0xd9e6('0x11')][_0xd9e6('0x13')]);}else{logger[_0xd9e6('0xc')](_0xd9e6('0xd'),_0x1cb696,_0xd9e6('0xf'));_0x1103ba(_0x596895['result']['message']);}})[_0xd9e6('0x14')](function(_0x5dfc4b){logger[_0xd9e6('0x11')](_0xd9e6('0xd'),_0x1cb696,_0x5dfc4b);_0x5b296b(_0x5dfc4b);});});}