Built motion from commit (unavailable).|2.5.3
[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 _0x9fc4=['info','Setting,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x262765,_0x92acc2){var _0x5aaffb=function(_0x4e1930){while(--_0x4e1930){_0x262765['push'](_0x262765['shift']());}};_0x5aaffb(++_0x92acc2);}(_0x9fc4,0x1c6));var _0x49fc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9fc4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x49fc('0x0'));var util=require('util');var moment=require(_0x49fc('0x1'));var BPromise=require(_0x49fc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49fc('0x3'));var db=require(_0x49fc('0x4'))['db'];var utils=require(_0x49fc('0x5'));var logger=require(_0x49fc('0x6'))(_0x49fc('0x7'));var config=require(_0x49fc('0x8'));var jayson=require(_0x49fc('0x9'));var client=jayson[_0x49fc('0xa')][_0x49fc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x332426,_0x1612b4,_0x59044e){return new BPromise(function(_0x4a971e,_0x135fad){return client[_0x49fc('0xc')](_0x332426,_0x59044e)[_0x49fc('0xd')](function(_0x4872e3){logger['info']('Setting,\x20%s,\x20%s',_0x1612b4,_0x49fc('0xe'));logger[_0x49fc('0xf')](_0x49fc('0x10'),_0x1612b4,'request\x20sent',JSON[_0x49fc('0x11')](_0x4872e3));if(_0x4872e3[_0x49fc('0x12')]){if(_0x4872e3[_0x49fc('0x12')][_0x49fc('0x13')]===0x1f4){logger[_0x49fc('0x12')]('Setting,\x20%s,\x20%s',_0x1612b4,_0x4872e3[_0x49fc('0x12')][_0x49fc('0x14')]);return _0x135fad(_0x4872e3[_0x49fc('0x12')][_0x49fc('0x14')]);}logger['error']('Setting,\x20%s,\x20%s',_0x1612b4,_0x4872e3['error'][_0x49fc('0x14')]);return _0x4a971e(_0x4872e3[_0x49fc('0x12')][_0x49fc('0x14')]);}else{logger[_0x49fc('0x15')](_0x49fc('0x16'),_0x1612b4,_0x49fc('0xe'));_0x4a971e(_0x4872e3[_0x49fc('0x17')]['message']);}})[_0x49fc('0x18')](function(_0x2df0c3){logger[_0x49fc('0x12')](_0x49fc('0x16'),_0x1612b4,_0x2df0c3);_0x135fad(_0x2df0c3);});});}