Built motion from commit ddca4d0d.|2.5.47
[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 _0x1080=['message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3ae96c,_0x5f1e7e){var _0x1b0c90=function(_0x1ecc83){while(--_0x1ecc83){_0x3ae96c['push'](_0x3ae96c['shift']());}};_0x1b0c90(++_0x5f1e7e);}(_0x1080,0x64));var _0x0108=function(_0x513c64,_0x4509a4){_0x513c64=_0x513c64-0x0;var _0x5351a9=_0x1080[_0x513c64];return _0x5351a9;};'use strict';var _=require(_0x0108('0x0'));var util=require('util');var moment=require(_0x0108('0x1'));var BPromise=require(_0x0108('0x2'));var rs=require(_0x0108('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0108('0x4'))['db'];var utils=require(_0x0108('0x5'));var logger=require(_0x0108('0x6'))(_0x0108('0x7'));var config=require(_0x0108('0x8'));var jayson=require(_0x0108('0x9'));var client=jayson[_0x0108('0xa')][_0x0108('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x182190,_0x14d392,_0xb8b09c){return new BPromise(function(_0x3958d8,_0x93bf30){return client[_0x0108('0xc')](_0x182190,_0xb8b09c)[_0x0108('0xd')](function(_0x4a7adf){logger['info'](_0x0108('0xe'),_0x14d392,_0x0108('0xf'));logger[_0x0108('0x10')](_0x0108('0x11'),_0x14d392,_0x0108('0xf'),JSON['stringify'](_0x4a7adf));if(_0x4a7adf[_0x0108('0x12')]){if(_0x4a7adf[_0x0108('0x12')][_0x0108('0x13')]===0x1f4){logger[_0x0108('0x12')]('Schedule,\x20%s,\x20%s',_0x14d392,_0x4a7adf[_0x0108('0x12')]['message']);return _0x93bf30(_0x4a7adf['error'][_0x0108('0x14')]);}logger[_0x0108('0x12')](_0x0108('0xe'),_0x14d392,_0x4a7adf['error'][_0x0108('0x14')]);return _0x3958d8(_0x4a7adf[_0x0108('0x12')][_0x0108('0x14')]);}else{logger[_0x0108('0x15')]('Schedule,\x20%s,\x20%s',_0x14d392,_0x0108('0xf'));_0x3958d8(_0x4a7adf[_0x0108('0x16')][_0x0108('0x14')]);}})[_0x0108('0x17')](function(_0xb19fb3){logger[_0x0108('0x12')](_0x0108('0xe'),_0x14d392,_0xb19fb3);_0x93bf30(_0xb19fb3);});});}