Built motion from commit 753c950e.|2.5.42
[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 _0x2d2a=['http','request','then','info','request\x20sent','debug','error','code','message','Schedule,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x793366,_0x117316){var _0x28cb8d=function(_0x344f23){while(--_0x344f23){_0x793366['push'](_0x793366['shift']());}};_0x28cb8d(++_0x117316);}(_0x2d2a,0x1f0));var _0xa2d2=function(_0x4ac707,_0x44e1ff){_0x4ac707=_0x4ac707-0x0;var _0x135595=_0x2d2a[_0x4ac707];return _0x135595;};'use strict';var _=require(_0xa2d2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa2d2('0x1'));var rs=require(_0xa2d2('0x2'));var fs=require('fs');var Redis=require(_0xa2d2('0x3'));var db=require(_0xa2d2('0x4'))['db'];var utils=require(_0xa2d2('0x5'));var logger=require(_0xa2d2('0x6'))('rpc');var config=require(_0xa2d2('0x7'));var jayson=require(_0xa2d2('0x8'));var client=jayson[_0xa2d2('0x9')][_0xa2d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a26da,_0xa1dd38,_0x6b359d){return new BPromise(function(_0x31a67b,_0x2f300f){return client[_0xa2d2('0xb')](_0x3a26da,_0x6b359d)[_0xa2d2('0xc')](function(_0x1a1f53){logger[_0xa2d2('0xd')]('Schedule,\x20%s,\x20%s',_0xa1dd38,_0xa2d2('0xe'));logger[_0xa2d2('0xf')]('Schedule,\x20%s,\x20%s,\x20%s',_0xa1dd38,_0xa2d2('0xe'),JSON['stringify'](_0x1a1f53));if(_0x1a1f53[_0xa2d2('0x10')]){if(_0x1a1f53[_0xa2d2('0x10')][_0xa2d2('0x11')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0xa1dd38,_0x1a1f53[_0xa2d2('0x10')][_0xa2d2('0x12')]);return _0x2f300f(_0x1a1f53[_0xa2d2('0x10')][_0xa2d2('0x12')]);}logger[_0xa2d2('0x10')](_0xa2d2('0x13'),_0xa1dd38,_0x1a1f53[_0xa2d2('0x10')][_0xa2d2('0x12')]);return _0x31a67b(_0x1a1f53['error'][_0xa2d2('0x12')]);}else{logger[_0xa2d2('0xd')](_0xa2d2('0x13'),_0xa1dd38,'request\x20sent');_0x31a67b(_0x1a1f53[_0xa2d2('0x14')][_0xa2d2('0x12')]);}})[_0xa2d2('0x15')](function(_0x4edfa9){logger[_0xa2d2('0x10')](_0xa2d2('0x13'),_0xa1dd38,_0x4edfa9);_0x2f300f(_0x4edfa9);});});}