Built motion from commit f0b1811d.|2.6.6
[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 _0x4135=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x4135,0x74));var _0x5413=function(_0x17c2c1,_0x134ca3){_0x17c2c1=_0x17c2c1-0x0;var _0x2f5830=_0x4135[_0x17c2c1];return _0x2f5830;};'use strict';var _=require(_0x5413('0x0'));var util=require(_0x5413('0x1'));var moment=require(_0x5413('0x2'));var BPromise=require(_0x5413('0x3'));var rs=require(_0x5413('0x4'));var fs=require('fs');var Redis=require(_0x5413('0x5'));var db=require(_0x5413('0x6'))['db'];var utils=require(_0x5413('0x7'));var logger=require(_0x5413('0x8'))(_0x5413('0x9'));var config=require(_0x5413('0xa'));var jayson=require(_0x5413('0xb'));var client=jayson[_0x5413('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x537595,_0x292121,_0x4fdd2e){return new BPromise(function(_0x259279,_0x4c2c4b){return client[_0x5413('0xd')](_0x537595,_0x4fdd2e)[_0x5413('0xe')](function(_0x23e53a){logger[_0x5413('0xf')](_0x5413('0x10'),_0x292121,_0x5413('0x11'));logger[_0x5413('0x12')](_0x5413('0x13'),_0x292121,_0x5413('0x11'),JSON['stringify'](_0x23e53a));if(_0x23e53a[_0x5413('0x14')]){if(_0x23e53a['error'][_0x5413('0x15')]===0x1f4){logger['error'](_0x5413('0x10'),_0x292121,_0x23e53a[_0x5413('0x14')]['message']);return _0x4c2c4b(_0x23e53a[_0x5413('0x14')][_0x5413('0x16')]);}logger['error'](_0x5413('0x10'),_0x292121,_0x23e53a['error'][_0x5413('0x16')]);return _0x259279(_0x23e53a[_0x5413('0x14')]['message']);}else{logger['info'](_0x5413('0x10'),_0x292121,'request\x20sent');_0x259279(_0x23e53a[_0x5413('0x17')]['message']);}})['catch'](function(_0x3b5886){logger[_0x5413('0x14')](_0x5413('0x10'),_0x292121,_0x3b5886);_0x4c2c4b(_0x3b5886);});});}