Built motion from commit (unavailable).|2.5.27
[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 _0x3e65=['../../config/environment','client','http','request','then','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2a115e,_0x5995c3){var _0x4fe086=function(_0x264850){while(--_0x264850){_0x2a115e['push'](_0x2a115e['shift']());}};_0x4fe086(++_0x5995c3);}(_0x3e65,0x101));var _0x53e6=function(_0xbe664,_0x49a2f5){_0xbe664=_0xbe664-0x0;var _0x1e309c=_0x3e65[_0xbe664];return _0x1e309c;};'use strict';var _=require(_0x53e6('0x0'));var util=require(_0x53e6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x53e6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53e6('0x3'))['db'];var utils=require(_0x53e6('0x4'));var logger=require(_0x53e6('0x5'))(_0x53e6('0x6'));var config=require(_0x53e6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x53e6('0x8')][_0x53e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a2963,_0x330423,_0x157671){return new BPromise(function(_0x363d80,_0x617b81){return client[_0x53e6('0xa')](_0x2a2963,_0x157671)[_0x53e6('0xb')](function(_0xb43ad7){logger[_0x53e6('0xc')](_0x53e6('0xd'),_0x330423,'request\x20sent');logger[_0x53e6('0xe')](_0x53e6('0xf'),_0x330423,'request\x20sent',JSON[_0x53e6('0x10')](_0xb43ad7));if(_0xb43ad7[_0x53e6('0x11')]){if(_0xb43ad7[_0x53e6('0x11')][_0x53e6('0x12')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x330423,_0xb43ad7[_0x53e6('0x11')]['message']);return _0x617b81(_0xb43ad7[_0x53e6('0x11')][_0x53e6('0x13')]);}logger[_0x53e6('0x11')](_0x53e6('0xd'),_0x330423,_0xb43ad7['error'][_0x53e6('0x13')]);return _0x363d80(_0xb43ad7['error'][_0x53e6('0x13')]);}else{logger[_0x53e6('0xc')](_0x53e6('0xd'),_0x330423,'request\x20sent');_0x363d80(_0xb43ad7[_0x53e6('0x14')][_0x53e6('0x13')]);}})[_0x53e6('0x15')](function(_0x29f9bf){logger[_0x53e6('0x11')](_0x53e6('0xd'),_0x330423,_0x29f9bf);_0x617b81(_0x29f9bf);});});}