Built motion from commit 43538d75.|2.5.35
[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 _0xbf1d=['http','then','info','Schedule,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x215fb5,_0x5711db){var _0x112cd8=function(_0x10cbef){while(--_0x10cbef){_0x215fb5['push'](_0x215fb5['shift']());}};_0x112cd8(++_0x5711db);}(_0xbf1d,0x186));var _0xdbf1=function(_0x394814,_0x4c25f4){_0x394814=_0x394814-0x0;var _0x15deb3=_0xbf1d[_0x394814];return _0x15deb3;};'use strict';var _=require('lodash');var util=require(_0xdbf1('0x0'));var moment=require('moment');var BPromise=require(_0xdbf1('0x1'));var rs=require(_0xdbf1('0x2'));var fs=require('fs');var Redis=require(_0xdbf1('0x3'));var db=require(_0xdbf1('0x4'))['db'];var utils=require(_0xdbf1('0x5'));var logger=require(_0xdbf1('0x6'))(_0xdbf1('0x7'));var config=require(_0xdbf1('0x8'));var jayson=require(_0xdbf1('0x9'));var client=jayson['client'][_0xdbf1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5afdeb,_0x1bc7b0,_0x3c932b){return new BPromise(function(_0x5af776,_0x1dd7dd){return client['request'](_0x5afdeb,_0x3c932b)[_0xdbf1('0xb')](function(_0x2f8fea){logger[_0xdbf1('0xc')](_0xdbf1('0xd'),_0x1bc7b0,'request\x20sent');logger[_0xdbf1('0xe')]('Schedule,\x20%s,\x20%s,\x20%s',_0x1bc7b0,_0xdbf1('0xf'),JSON['stringify'](_0x2f8fea));if(_0x2f8fea['error']){if(_0x2f8fea[_0xdbf1('0x10')][_0xdbf1('0x11')]===0x1f4){logger[_0xdbf1('0x10')](_0xdbf1('0xd'),_0x1bc7b0,_0x2f8fea['error'][_0xdbf1('0x12')]);return _0x1dd7dd(_0x2f8fea['error'][_0xdbf1('0x12')]);}logger[_0xdbf1('0x10')](_0xdbf1('0xd'),_0x1bc7b0,_0x2f8fea['error'][_0xdbf1('0x12')]);return _0x5af776(_0x2f8fea[_0xdbf1('0x10')]['message']);}else{logger[_0xdbf1('0xc')](_0xdbf1('0xd'),_0x1bc7b0,_0xdbf1('0xf'));_0x5af776(_0x2f8fea[_0xdbf1('0x13')][_0xdbf1('0x12')]);}})['catch'](function(_0x312121){logger['error'](_0xdbf1('0xd'),_0x1bc7b0,_0x312121);_0x1dd7dd(_0x312121);});});}