Built motion from commit (unavailable).|2.4.18
[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 _0xf90a=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring'];(function(_0x299c63,_0x80fade){var _0x53904d=function(_0x4914e3){while(--_0x4914e3){_0x299c63['push'](_0x299c63['shift']());}};_0x53904d(++_0x80fade);}(_0xf90a,0x8e));var _0xaf90=function(_0x4eda03,_0x47a200){_0x4eda03=_0x4eda03-0x0;var _0x19a37c=_0xf90a[_0x4eda03];return _0x19a37c;};'use strict';var _=require(_0xaf90('0x0'));var util=require(_0xaf90('0x1'));var moment=require(_0xaf90('0x2'));var BPromise=require(_0xaf90('0x3'));var rs=require(_0xaf90('0x4'));var fs=require('fs');var Redis=require(_0xaf90('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf90('0x6'));var logger=require(_0xaf90('0x7'))('rpc');var config=require(_0xaf90('0x8'));var jayson=require(_0xaf90('0x9'));var client=jayson[_0xaf90('0xa')][_0xaf90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37296e,_0x179345,_0x2c831f){return new BPromise(function(_0x2772f4,_0x187f38){return client['request'](_0x37296e,_0x2c831f)['then'](function(_0x4651a7){logger[_0xaf90('0xc')](_0xaf90('0xd'),_0x179345,_0xaf90('0xe'));logger[_0xaf90('0xf')](_0xaf90('0x10'),_0x179345,_0xaf90('0xe'),JSON[_0xaf90('0x11')](_0x4651a7));if(_0x4651a7[_0xaf90('0x12')]){if(_0x4651a7['error'][_0xaf90('0x13')]===0x1f4){logger[_0xaf90('0x12')](_0xaf90('0xd'),_0x179345,_0x4651a7[_0xaf90('0x12')]['message']);return _0x187f38(_0x4651a7['error'][_0xaf90('0x14')]);}logger[_0xaf90('0x12')](_0xaf90('0xd'),_0x179345,_0x4651a7[_0xaf90('0x12')][_0xaf90('0x14')]);return _0x2772f4(_0x4651a7[_0xaf90('0x12')][_0xaf90('0x14')]);}else{logger[_0xaf90('0xc')]('Schedule,\x20%s,\x20%s',_0x179345,_0xaf90('0xe'));_0x2772f4(_0x4651a7['result'][_0xaf90('0x14')]);}})['catch'](function(_0x3f940f){logger['error'](_0xaf90('0xd'),_0x179345,_0x3f940f);_0x187f38(_0x3f940f);});});}