Built motion from commit (unavailable).|2.5.21
[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 _0x716c=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x47dde4,_0xc8fe9e){var _0x46bd3e=function(_0x4ec841){while(--_0x4ec841){_0x47dde4['push'](_0x47dde4['shift']());}};_0x46bd3e(++_0xc8fe9e);}(_0x716c,0x6c));var _0xc716=function(_0x34fb2d,_0x4d39de){_0x34fb2d=_0x34fb2d-0x0;var _0x280e92=_0x716c[_0x34fb2d];return _0x280e92;};'use strict';var _=require(_0xc716('0x0'));var util=require(_0xc716('0x1'));var moment=require(_0xc716('0x2'));var BPromise=require(_0xc716('0x3'));var rs=require(_0xc716('0x4'));var fs=require('fs');var Redis=require(_0xc716('0x5'));var db=require(_0xc716('0x6'))['db'];var utils=require(_0xc716('0x7'));var logger=require(_0xc716('0x8'))(_0xc716('0x9'));var config=require(_0xc716('0xa'));var jayson=require(_0xc716('0xb'));var client=jayson[_0xc716('0xc')][_0xc716('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x534f97,_0x3749db,_0x7c007e){return new BPromise(function(_0x44ba8b,_0x237a47){return client[_0xc716('0xe')](_0x534f97,_0x7c007e)[_0xc716('0xf')](function(_0x2f1e28){logger[_0xc716('0x10')](_0xc716('0x11'),_0x3749db,'request\x20sent');logger[_0xc716('0x12')]('Schedule,\x20%s,\x20%s,\x20%s',_0x3749db,'request\x20sent',JSON['stringify'](_0x2f1e28));if(_0x2f1e28[_0xc716('0x13')]){if(_0x2f1e28[_0xc716('0x13')][_0xc716('0x14')]===0x1f4){logger['error'](_0xc716('0x11'),_0x3749db,_0x2f1e28[_0xc716('0x13')][_0xc716('0x15')]);return _0x237a47(_0x2f1e28[_0xc716('0x13')]['message']);}logger['error'](_0xc716('0x11'),_0x3749db,_0x2f1e28[_0xc716('0x13')][_0xc716('0x15')]);return _0x44ba8b(_0x2f1e28['error']['message']);}else{logger[_0xc716('0x10')](_0xc716('0x11'),_0x3749db,'request\x20sent');_0x44ba8b(_0x2f1e28[_0xc716('0x16')][_0xc716('0x15')]);}})['catch'](function(_0x2406e9){logger[_0xc716('0x13')](_0xc716('0x11'),_0x3749db,_0x2406e9);_0x237a47(_0x2406e9);});});}