Built motion from commit (unavailable).|2.4.9
[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 _0xa007=['../../config/environment','client','http','request','then','info','Schedule,\x20%s,\x20%s','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x24edf9,_0x184406){var _0x41e036=function(_0x3f7f9f){while(--_0x3f7f9f){_0x24edf9['push'](_0x24edf9['shift']());}};_0x41e036(++_0x184406);}(_0xa007,0x1c4));var _0x7a00=function(_0x359dcf,_0x5786cf){_0x359dcf=_0x359dcf-0x0;var _0x25a5c5=_0xa007[_0x359dcf];return _0x25a5c5;};'use strict';var _=require(_0x7a00('0x0'));var util=require(_0x7a00('0x1'));var moment=require(_0x7a00('0x2'));var BPromise=require(_0x7a00('0x3'));var rs=require(_0x7a00('0x4'));var fs=require('fs');var Redis=require(_0x7a00('0x5'));var db=require(_0x7a00('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a00('0x7'))('rpc');var config=require(_0x7a00('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7a00('0x9')][_0x7a00('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ac07a,_0x341d44,_0x1f7a9f){return new BPromise(function(_0x219903,_0x5e3d1e){return client[_0x7a00('0xb')](_0x4ac07a,_0x1f7a9f)[_0x7a00('0xc')](function(_0x41ae45){logger[_0x7a00('0xd')](_0x7a00('0xe'),_0x341d44,'request\x20sent');logger['debug'](_0x7a00('0xf'),_0x341d44,_0x7a00('0x10'),JSON[_0x7a00('0x11')](_0x41ae45));if(_0x41ae45['error']){if(_0x41ae45[_0x7a00('0x12')][_0x7a00('0x13')]===0x1f4){logger[_0x7a00('0x12')](_0x7a00('0xe'),_0x341d44,_0x41ae45[_0x7a00('0x12')]['message']);return _0x5e3d1e(_0x41ae45[_0x7a00('0x12')][_0x7a00('0x14')]);}logger[_0x7a00('0x12')]('Schedule,\x20%s,\x20%s',_0x341d44,_0x41ae45[_0x7a00('0x12')]['message']);return _0x219903(_0x41ae45[_0x7a00('0x12')][_0x7a00('0x14')]);}else{logger[_0x7a00('0xd')](_0x7a00('0xe'),_0x341d44,_0x7a00('0x10'));_0x219903(_0x41ae45[_0x7a00('0x15')][_0x7a00('0x14')]);}})[_0x7a00('0x16')](function(_0xc575e4){logger['error'](_0x7a00('0xe'),_0x341d44,_0xc575e4);_0x5e3d1e(_0xc575e4);});});}