Built motion from commit (unavailable).|2.2.1
[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 _0x50eb=['request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x52ac91,_0x5e1bfc){var _0x5abb38=function(_0x2ca78a){while(--_0x2ca78a){_0x52ac91['push'](_0x52ac91['shift']());}};_0x5abb38(++_0x5e1bfc);}(_0x50eb,0x1e8));var _0xb50e=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x50eb[_0x2aecb2];return _0x3ebb80;};'use strict';var _=require(_0xb50e('0x0'));var util=require(_0xb50e('0x1'));var moment=require(_0xb50e('0x2'));var BPromise=require('bluebird');var rs=require(_0xb50e('0x3'));var fs=require('fs');var Redis=require(_0xb50e('0x4'));var db=require(_0xb50e('0x5'))['db'];var utils=require(_0xb50e('0x6'));var logger=require(_0xb50e('0x7'))('rpc');var config=require(_0xb50e('0x8'));var jayson=require(_0xb50e('0x9'));var client=jayson[_0xb50e('0xa')][_0xb50e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x404f98,_0x12698c,_0x11ab79){return new BPromise(function(_0x5e33e5,_0x4e55a4){return client[_0xb50e('0xc')](_0x404f98,_0x11ab79)[_0xb50e('0xd')](function(_0x1a9f5d){logger[_0xb50e('0xe')]('Setting,\x20%s,\x20%s',_0x12698c,_0xb50e('0xf'));logger[_0xb50e('0x10')](_0xb50e('0x11'),_0x12698c,_0xb50e('0xf'),JSON[_0xb50e('0x12')](_0x1a9f5d));if(_0x1a9f5d[_0xb50e('0x13')]){if(_0x1a9f5d[_0xb50e('0x13')][_0xb50e('0x14')]===0x1f4){logger[_0xb50e('0x13')](_0xb50e('0x15'),_0x12698c,_0x1a9f5d[_0xb50e('0x13')][_0xb50e('0x16')]);return _0x4e55a4(_0x1a9f5d[_0xb50e('0x13')][_0xb50e('0x16')]);}logger[_0xb50e('0x13')](_0xb50e('0x15'),_0x12698c,_0x1a9f5d['error'][_0xb50e('0x16')]);return _0x5e33e5(_0x1a9f5d['error']['message']);}else{logger['info'](_0xb50e('0x15'),_0x12698c,_0xb50e('0xf'));_0x5e33e5(_0x1a9f5d[_0xb50e('0x17')][_0xb50e('0x16')]);}})[_0xb50e('0x18')](function(_0x46b89d){logger['error']('Setting,\x20%s,\x20%s',_0x12698c,_0x46b89d);_0x4e55a4(_0x46b89d);});});}