Built motion from commit (unavailable).|2.5.4
[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 _0xa74f=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x14c8ee,_0x34d4fb){var _0x51acc2=function(_0x4c1277){while(--_0x4c1277){_0x14c8ee['push'](_0x14c8ee['shift']());}};_0x51acc2(++_0x34d4fb);}(_0xa74f,0x1b2));var _0xfa74=function(_0x3cec8c,_0x3f6c1d){_0x3cec8c=_0x3cec8c-0x0;var _0x38032e=_0xa74f[_0x3cec8c];return _0x38032e;};'use strict';var _=require(_0xfa74('0x0'));var util=require(_0xfa74('0x1'));var moment=require('moment');var BPromise=require(_0xfa74('0x2'));var rs=require(_0xfa74('0x3'));var fs=require('fs');var Redis=require(_0xfa74('0x4'));var db=require(_0xfa74('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfa74('0x6'))(_0xfa74('0x7'));var config=require(_0xfa74('0x8'));var jayson=require(_0xfa74('0x9'));var client=jayson[_0xfa74('0xa')][_0xfa74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a8094,_0x1850be,_0x2d44fc){return new BPromise(function(_0x593e3b,_0x39e9a5){return client[_0xfa74('0xc')](_0x5a8094,_0x2d44fc)['then'](function(_0x1173bc){logger[_0xfa74('0xd')](_0xfa74('0xe'),_0x1850be,_0xfa74('0xf'));logger[_0xfa74('0x10')](_0xfa74('0x11'),_0x1850be,_0xfa74('0xf'),JSON[_0xfa74('0x12')](_0x1173bc));if(_0x1173bc['error']){if(_0x1173bc[_0xfa74('0x13')][_0xfa74('0x14')]===0x1f4){logger['error'](_0xfa74('0xe'),_0x1850be,_0x1173bc[_0xfa74('0x13')]['message']);return _0x39e9a5(_0x1173bc[_0xfa74('0x13')][_0xfa74('0x15')]);}logger[_0xfa74('0x13')]('Schedule,\x20%s,\x20%s',_0x1850be,_0x1173bc[_0xfa74('0x13')]['message']);return _0x593e3b(_0x1173bc[_0xfa74('0x13')][_0xfa74('0x15')]);}else{logger[_0xfa74('0xd')](_0xfa74('0xe'),_0x1850be,_0xfa74('0xf'));_0x593e3b(_0x1173bc[_0xfa74('0x16')][_0xfa74('0x15')]);}})[_0xfa74('0x17')](function(_0x1ae318){logger[_0xfa74('0x13')]('Schedule,\x20%s,\x20%s',_0x1850be,_0x1ae318);_0x39e9a5(_0x1ae318);});});}