Built motion from commit (unavailable).|2.5.4
[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 _0xce4d=['request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x1793da,_0x397381){var _0xcdf5a2=function(_0x1f8ef8){while(--_0x1f8ef8){_0x1793da['push'](_0x1793da['shift']());}};_0xcdf5a2(++_0x397381);}(_0xce4d,0x1d9));var _0xdce4=function(_0x59373a,_0x147526){_0x59373a=_0x59373a-0x0;var _0x18df11=_0xce4d[_0x59373a];return _0x18df11;};'use strict';var _=require(_0xdce4('0x0'));var util=require(_0xdce4('0x1'));var moment=require(_0xdce4('0x2'));var BPromise=require('bluebird');var rs=require(_0xdce4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdce4('0x4'))['db'];var utils=require(_0xdce4('0x5'));var logger=require('../../config/logger')(_0xdce4('0x6'));var config=require('../../config/environment');var jayson=require(_0xdce4('0x7'));var client=jayson[_0xdce4('0x8')][_0xdce4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4cc9c3,_0x38c428,_0x163ce8){return new BPromise(function(_0x1e1019,_0x4c6203){return client[_0xdce4('0xa')](_0x4cc9c3,_0x163ce8)[_0xdce4('0xb')](function(_0x1ccfbc){logger[_0xdce4('0xc')](_0xdce4('0xd'),_0x38c428,_0xdce4('0xe'));logger[_0xdce4('0xf')]('Schedule,\x20%s,\x20%s,\x20%s',_0x38c428,'request\x20sent',JSON[_0xdce4('0x10')](_0x1ccfbc));if(_0x1ccfbc['error']){if(_0x1ccfbc[_0xdce4('0x11')][_0xdce4('0x12')]===0x1f4){logger[_0xdce4('0x11')]('Schedule,\x20%s,\x20%s',_0x38c428,_0x1ccfbc[_0xdce4('0x11')][_0xdce4('0x13')]);return _0x4c6203(_0x1ccfbc[_0xdce4('0x11')]['message']);}logger[_0xdce4('0x11')]('Schedule,\x20%s,\x20%s',_0x38c428,_0x1ccfbc[_0xdce4('0x11')][_0xdce4('0x13')]);return _0x1e1019(_0x1ccfbc['error']['message']);}else{logger[_0xdce4('0xc')](_0xdce4('0xd'),_0x38c428,_0xdce4('0xe'));_0x1e1019(_0x1ccfbc['result'][_0xdce4('0x13')]);}})[_0xdce4('0x14')](function(_0x3ad938){logger[_0xdce4('0x11')]('Schedule,\x20%s,\x20%s',_0x38c428,_0x3ad938);_0x4c6203(_0x3ad938);});});}