Built motion from commit (unavailable).|2.5.6
[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 _0x24a0=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x497759,_0x4bbdce){var _0x32c544=function(_0x263b21){while(--_0x263b21){_0x497759['push'](_0x497759['shift']());}};_0x32c544(++_0x4bbdce);}(_0x24a0,0xec));var _0x024a=function(_0x16e2ca,_0x137f8a){_0x16e2ca=_0x16e2ca-0x0;var _0x475760=_0x24a0[_0x16e2ca];return _0x475760;};'use strict';var _=require(_0x024a('0x0'));var util=require(_0x024a('0x1'));var moment=require(_0x024a('0x2'));var BPromise=require(_0x024a('0x3'));var rs=require(_0x024a('0x4'));var fs=require('fs');var Redis=require(_0x024a('0x5'));var db=require(_0x024a('0x6'))['db'];var utils=require(_0x024a('0x7'));var logger=require(_0x024a('0x8'))('rpc');var config=require(_0x024a('0x9'));var jayson=require(_0x024a('0xa'));var client=jayson['client'][_0x024a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44255d,_0x3e0e5d,_0x29e3c1){return new BPromise(function(_0x1cf0c3,_0x55d9be){return client[_0x024a('0xc')](_0x44255d,_0x29e3c1)['then'](function(_0x5bb5cd){logger[_0x024a('0xd')](_0x024a('0xe'),_0x3e0e5d,'request\x20sent');logger[_0x024a('0xf')](_0x024a('0x10'),_0x3e0e5d,_0x024a('0x11'),JSON[_0x024a('0x12')](_0x5bb5cd));if(_0x5bb5cd[_0x024a('0x13')]){if(_0x5bb5cd[_0x024a('0x13')][_0x024a('0x14')]===0x1f4){logger[_0x024a('0x13')](_0x024a('0xe'),_0x3e0e5d,_0x5bb5cd[_0x024a('0x13')][_0x024a('0x15')]);return _0x55d9be(_0x5bb5cd[_0x024a('0x13')][_0x024a('0x15')]);}logger[_0x024a('0x13')](_0x024a('0xe'),_0x3e0e5d,_0x5bb5cd['error'][_0x024a('0x15')]);return _0x1cf0c3(_0x5bb5cd['error'][_0x024a('0x15')]);}else{logger['info'](_0x024a('0xe'),_0x3e0e5d,'request\x20sent');_0x1cf0c3(_0x5bb5cd[_0x024a('0x16')][_0x024a('0x15')]);}})[_0x024a('0x17')](function(_0x8fde2c){logger[_0x024a('0x13')]('Schedule,\x20%s,\x20%s',_0x3e0e5d,_0x8fde2c);_0x55d9be(_0x8fde2c);});});}