Built motion from commit (unavailable).|2.5.8
[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 _0x4921=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x23a79e,_0x235f89){var _0x3dab57=function(_0x346cf4){while(--_0x346cf4){_0x23a79e['push'](_0x23a79e['shift']());}};_0x3dab57(++_0x235f89);}(_0x4921,0x1e3));var _0x1492=function(_0x281e5e,_0xf320e2){_0x281e5e=_0x281e5e-0x0;var _0x5a22d2=_0x4921[_0x281e5e];return _0x5a22d2;};'use strict';var _=require(_0x1492('0x0'));var util=require(_0x1492('0x1'));var moment=require(_0x1492('0x2'));var BPromise=require(_0x1492('0x3'));var rs=require(_0x1492('0x4'));var fs=require('fs');var Redis=require(_0x1492('0x5'));var db=require(_0x1492('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1492('0x7'))('rpc');var config=require(_0x1492('0x8'));var jayson=require(_0x1492('0x9'));var client=jayson['client'][_0x1492('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36fb8c,_0x49a3d3,_0x571c7b){return new BPromise(function(_0x4db5d5,_0x502696){return client[_0x1492('0xb')](_0x36fb8c,_0x571c7b)[_0x1492('0xc')](function(_0x185fc4){logger['info'](_0x1492('0xd'),_0x49a3d3,_0x1492('0xe'));logger[_0x1492('0xf')](_0x1492('0x10'),_0x49a3d3,_0x1492('0xe'),JSON['stringify'](_0x185fc4));if(_0x185fc4[_0x1492('0x11')]){if(_0x185fc4[_0x1492('0x11')][_0x1492('0x12')]===0x1f4){logger[_0x1492('0x11')](_0x1492('0xd'),_0x49a3d3,_0x185fc4[_0x1492('0x11')][_0x1492('0x13')]);return _0x502696(_0x185fc4[_0x1492('0x11')]['message']);}logger[_0x1492('0x11')](_0x1492('0xd'),_0x49a3d3,_0x185fc4[_0x1492('0x11')][_0x1492('0x13')]);return _0x4db5d5(_0x185fc4['error'][_0x1492('0x13')]);}else{logger[_0x1492('0x14')](_0x1492('0xd'),_0x49a3d3,_0x1492('0xe'));_0x4db5d5(_0x185fc4[_0x1492('0x15')][_0x1492('0x13')]);}})[_0x1492('0x16')](function(_0x4c4602){logger[_0x1492('0x11')]('Schedule,\x20%s,\x20%s',_0x49a3d3,_0x4c4602);_0x502696(_0x4c4602);});});}