Built motion from commit (unavailable).|2.5.10
[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 _0xc3b6=['info','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','Schedule,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0xa3e429,_0x5014e1){var _0x14b554=function(_0x2bf804){while(--_0x2bf804){_0xa3e429['push'](_0xa3e429['shift']());}};_0x14b554(++_0x5014e1);}(_0xc3b6,0x14f));var _0x6c3b=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0xc3b6[_0x2b8077];return _0x308091;};'use strict';var _=require(_0x6c3b('0x0'));var util=require(_0x6c3b('0x1'));var moment=require(_0x6c3b('0x2'));var BPromise=require(_0x6c3b('0x3'));var rs=require(_0x6c3b('0x4'));var fs=require('fs');var Redis=require(_0x6c3b('0x5'));var db=require(_0x6c3b('0x6'))['db'];var utils=require(_0x6c3b('0x7'));var logger=require(_0x6c3b('0x8'))(_0x6c3b('0x9'));var config=require(_0x6c3b('0xa'));var jayson=require(_0x6c3b('0xb'));var client=jayson[_0x6c3b('0xc')][_0x6c3b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x19c309,_0x5915c1,_0x8f8078){return new BPromise(function(_0x12e69d,_0x4150ae){return client['request'](_0x19c309,_0x8f8078)[_0x6c3b('0xe')](function(_0x1abe69){logger[_0x6c3b('0xf')]('Schedule,\x20%s,\x20%s',_0x5915c1,'request\x20sent');logger['debug'](_0x6c3b('0x10'),_0x5915c1,_0x6c3b('0x11'),JSON[_0x6c3b('0x12')](_0x1abe69));if(_0x1abe69['error']){if(_0x1abe69['error'][_0x6c3b('0x13')]===0x1f4){logger[_0x6c3b('0x14')](_0x6c3b('0x15'),_0x5915c1,_0x1abe69[_0x6c3b('0x14')][_0x6c3b('0x16')]);return _0x4150ae(_0x1abe69[_0x6c3b('0x14')][_0x6c3b('0x16')]);}logger[_0x6c3b('0x14')](_0x6c3b('0x15'),_0x5915c1,_0x1abe69[_0x6c3b('0x14')][_0x6c3b('0x16')]);return _0x12e69d(_0x1abe69[_0x6c3b('0x14')]['message']);}else{logger[_0x6c3b('0xf')]('Schedule,\x20%s,\x20%s',_0x5915c1,_0x6c3b('0x11'));_0x12e69d(_0x1abe69[_0x6c3b('0x17')][_0x6c3b('0x16')]);}})[_0x6c3b('0x18')](function(_0x507019){logger[_0x6c3b('0x14')](_0x6c3b('0x15'),_0x5915c1,_0x507019);_0x4150ae(_0x507019);});});}