Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / setting / setting.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 _0xb3c4=['result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent','stringify','error','Setting,\x20%s,\x20%s','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb3c4,0x18d));var _0x4b3c=function(_0x22ca29,_0x17a9b3){_0x22ca29=_0x22ca29-0x0;var _0x5194b6=_0xb3c4[_0x22ca29];return _0x5194b6;};'use strict';var _=require(_0x4b3c('0x0'));var util=require('util');var moment=require(_0x4b3c('0x1'));var BPromise=require(_0x4b3c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b3c('0x3'));var db=require(_0x4b3c('0x4'))['db'];var utils=require(_0x4b3c('0x5'));var logger=require(_0x4b3c('0x6'))(_0x4b3c('0x7'));var config=require(_0x4b3c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4b3c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa9bf96,_0x5d9a96,_0x5dcf02){return new BPromise(function(_0x516e79,_0x246e02){return client[_0x4b3c('0xa')](_0xa9bf96,_0x5dcf02)['then'](function(_0x4abbc2){logger[_0x4b3c('0xb')]('Setting,\x20%s,\x20%s',_0x5d9a96,_0x4b3c('0xc'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x5d9a96,_0x4b3c('0xc'),JSON[_0x4b3c('0xd')](_0x4abbc2));if(_0x4abbc2[_0x4b3c('0xe')]){if(_0x4abbc2[_0x4b3c('0xe')]['code']===0x1f4){logger[_0x4b3c('0xe')](_0x4b3c('0xf'),_0x5d9a96,_0x4abbc2['error'][_0x4b3c('0x10')]);return _0x246e02(_0x4abbc2[_0x4b3c('0xe')]['message']);}logger[_0x4b3c('0xe')]('Setting,\x20%s,\x20%s',_0x5d9a96,_0x4abbc2['error']['message']);return _0x516e79(_0x4abbc2['error'][_0x4b3c('0x10')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x5d9a96,'request\x20sent');_0x516e79(_0x4abbc2[_0x4b3c('0x11')][_0x4b3c('0x10')]);}})['catch'](function(_0x593303){logger[_0x4b3c('0xe')]('Setting,\x20%s,\x20%s',_0x5d9a96,_0x593303);_0x246e02(_0x593303);});});}