27a2b142d7d3dda007509d35b7c35f911dd99a81
[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 _0x6b0e=['Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info'];(function(_0x43f489,_0x2b4fea){var _0x4134b4=function(_0x4365f6){while(--_0x4365f6){_0x43f489['push'](_0x43f489['shift']());}};_0x4134b4(++_0x2b4fea);}(_0x6b0e,0x141));var _0xe6b0=function(_0x514833,_0x4f691e){_0x514833=_0x514833-0x0;var _0x1879fb=_0x6b0e[_0x514833];return _0x1879fb;};'use strict';var _=require(_0xe6b0('0x0'));var util=require(_0xe6b0('0x1'));var moment=require(_0xe6b0('0x2'));var BPromise=require(_0xe6b0('0x3'));var rs=require(_0xe6b0('0x4'));var fs=require('fs');var Redis=require(_0xe6b0('0x5'));var db=require(_0xe6b0('0x6'))['db'];var utils=require(_0xe6b0('0x7'));var logger=require(_0xe6b0('0x8'))(_0xe6b0('0x9'));var config=require(_0xe6b0('0xa'));var jayson=require(_0xe6b0('0xb'));var client=jayson[_0xe6b0('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c5500,_0x26bfb9,_0x55d1c1){return new BPromise(function(_0x4fff4,_0x22d974){return client['request'](_0x1c5500,_0x55d1c1)[_0xe6b0('0xd')](function(_0x5937d7){logger[_0xe6b0('0xe')](_0xe6b0('0xf'),_0x26bfb9,_0xe6b0('0x10'));logger[_0xe6b0('0x11')](_0xe6b0('0x12'),_0x26bfb9,_0xe6b0('0x10'),JSON[_0xe6b0('0x13')](_0x5937d7));if(_0x5937d7[_0xe6b0('0x14')]){if(_0x5937d7[_0xe6b0('0x14')][_0xe6b0('0x15')]===0x1f4){logger[_0xe6b0('0x14')](_0xe6b0('0xf'),_0x26bfb9,_0x5937d7[_0xe6b0('0x14')][_0xe6b0('0x16')]);return _0x22d974(_0x5937d7[_0xe6b0('0x14')][_0xe6b0('0x16')]);}logger[_0xe6b0('0x14')]('Schedule,\x20%s,\x20%s',_0x26bfb9,_0x5937d7[_0xe6b0('0x14')][_0xe6b0('0x16')]);return _0x4fff4(_0x5937d7['error'][_0xe6b0('0x16')]);}else{logger[_0xe6b0('0xe')]('Schedule,\x20%s,\x20%s',_0x26bfb9,_0xe6b0('0x10'));_0x4fff4(_0x5937d7['result']['message']);}})[_0xe6b0('0x17')](function(_0x971561){logger[_0xe6b0('0x14')](_0xe6b0('0xf'),_0x26bfb9,_0x971561);_0x22d974(_0x971561);});});}