d2c008802e77ff82c7c64741b1de0f0129f27804
[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 _0x4013=['http','request','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x26dc58,_0x569567){var _0x202de6=function(_0x3c6e41){while(--_0x3c6e41){_0x26dc58['push'](_0x26dc58['shift']());}};_0x202de6(++_0x569567);}(_0x4013,0x1ee));var _0x3401=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x4013[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x3401('0x0'));var util=require(_0x3401('0x1'));var moment=require(_0x3401('0x2'));var BPromise=require(_0x3401('0x3'));var rs=require(_0x3401('0x4'));var fs=require('fs');var Redis=require(_0x3401('0x5'));var db=require(_0x3401('0x6'))['db'];var utils=require(_0x3401('0x7'));var logger=require(_0x3401('0x8'))(_0x3401('0x9'));var config=require(_0x3401('0xa'));var jayson=require(_0x3401('0xb'));var client=jayson['client'][_0x3401('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x546e33,_0x41e2c2,_0x2cd8bb){return new BPromise(function(_0x31b532,_0x364d54){return client[_0x3401('0xd')](_0x546e33,_0x2cd8bb)['then'](function(_0x4f1432){logger['info'](_0x3401('0xe'),_0x41e2c2,_0x3401('0xf'));logger['debug'](_0x3401('0x10'),_0x41e2c2,_0x3401('0xf'),JSON[_0x3401('0x11')](_0x4f1432));if(_0x4f1432[_0x3401('0x12')]){if(_0x4f1432[_0x3401('0x12')][_0x3401('0x13')]===0x1f4){logger[_0x3401('0x12')]('Schedule,\x20%s,\x20%s',_0x41e2c2,_0x4f1432[_0x3401('0x12')][_0x3401('0x14')]);return _0x364d54(_0x4f1432[_0x3401('0x12')][_0x3401('0x14')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x41e2c2,_0x4f1432[_0x3401('0x12')][_0x3401('0x14')]);return _0x31b532(_0x4f1432[_0x3401('0x12')][_0x3401('0x14')]);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x41e2c2,_0x3401('0xf'));_0x31b532(_0x4f1432[_0x3401('0x15')][_0x3401('0x14')]);}})[_0x3401('0x16')](function(_0x1d6643){logger[_0x3401('0x12')](_0x3401('0xe'),_0x41e2c2,_0x1d6643);_0x364d54(_0x1d6643);});});}