Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / api / schedule / schedule.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 _0x9dc5=['http','request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0x9dc5,0x1f1));var _0x59dc=function(_0x4c1a53,_0x1ff473){_0x4c1a53=_0x4c1a53-0x0;var _0x1b025b=_0x9dc5[_0x4c1a53];return _0x1b025b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x59dc('0x0'));var BPromise=require(_0x59dc('0x1'));var rs=require(_0x59dc('0x2'));var fs=require('fs');var Redis=require(_0x59dc('0x3'));var db=require(_0x59dc('0x4'))['db'];var utils=require(_0x59dc('0x5'));var logger=require(_0x59dc('0x6'))(_0x59dc('0x7'));var config=require(_0x59dc('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x59dc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48baeb,_0x51dcd0,_0x61a1e9){return new BPromise(function(_0xd4a53f,_0x4724a4){return client[_0x59dc('0xa')](_0x48baeb,_0x61a1e9)[_0x59dc('0xb')](function(_0x498aff){logger['info'](_0x59dc('0xc'),_0x51dcd0,_0x59dc('0xd'));logger[_0x59dc('0xe')](_0x59dc('0xf'),_0x51dcd0,_0x59dc('0xd'),JSON[_0x59dc('0x10')](_0x498aff));if(_0x498aff['error']){if(_0x498aff[_0x59dc('0x11')]['code']===0x1f4){logger[_0x59dc('0x11')](_0x59dc('0xc'),_0x51dcd0,_0x498aff[_0x59dc('0x11')][_0x59dc('0x12')]);return _0x4724a4(_0x498aff[_0x59dc('0x11')]['message']);}logger[_0x59dc('0x11')]('Schedule,\x20%s,\x20%s',_0x51dcd0,_0x498aff[_0x59dc('0x11')]['message']);return _0xd4a53f(_0x498aff['error'][_0x59dc('0x12')]);}else{logger[_0x59dc('0x13')](_0x59dc('0xc'),_0x51dcd0,'request\x20sent');_0xd4a53f(_0x498aff[_0x59dc('0x14')]['message']);}})[_0x59dc('0x15')](function(_0x1fe0eb){logger[_0x59dc('0x11')](_0x59dc('0xc'),_0x51dcd0,_0x1fe0eb);_0x4724a4(_0x1fe0eb);});});}