Built motion from commit (unavailable).|2.4.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 _0x7bd5=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','Schedule,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x24aac0,_0x1b166f){var _0x5572ac=function(_0x175a9f){while(--_0x175a9f){_0x24aac0['push'](_0x24aac0['shift']());}};_0x5572ac(++_0x1b166f);}(_0x7bd5,0x14e));var _0x57bd=function(_0x586181,_0x56c574){_0x586181=_0x586181-0x0;var _0x369a76=_0x7bd5[_0x586181];return _0x369a76;};'use strict';var _=require(_0x57bd('0x0'));var util=require(_0x57bd('0x1'));var moment=require(_0x57bd('0x2'));var BPromise=require(_0x57bd('0x3'));var rs=require(_0x57bd('0x4'));var fs=require('fs');var Redis=require(_0x57bd('0x5'));var db=require(_0x57bd('0x6'))['db'];var utils=require(_0x57bd('0x7'));var logger=require(_0x57bd('0x8'))(_0x57bd('0x9'));var config=require(_0x57bd('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x57bd('0xb')][_0x57bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9171c7,_0x4b960f,_0x298c16){return new BPromise(function(_0x15c137,_0x492c8a){return client['request'](_0x9171c7,_0x298c16)[_0x57bd('0xd')](function(_0x5a49f6){logger[_0x57bd('0xe')]('Schedule,\x20%s,\x20%s',_0x4b960f,_0x57bd('0xf'));logger[_0x57bd('0x10')](_0x57bd('0x11'),_0x4b960f,'request\x20sent',JSON[_0x57bd('0x12')](_0x5a49f6));if(_0x5a49f6['error']){if(_0x5a49f6[_0x57bd('0x13')]['code']===0x1f4){logger[_0x57bd('0x13')](_0x57bd('0x14'),_0x4b960f,_0x5a49f6['error'][_0x57bd('0x15')]);return _0x492c8a(_0x5a49f6[_0x57bd('0x13')]['message']);}logger['error'](_0x57bd('0x14'),_0x4b960f,_0x5a49f6[_0x57bd('0x13')][_0x57bd('0x15')]);return _0x15c137(_0x5a49f6[_0x57bd('0x13')][_0x57bd('0x15')]);}else{logger['info'](_0x57bd('0x14'),_0x4b960f,_0x57bd('0xf'));_0x15c137(_0x5a49f6[_0x57bd('0x16')]['message']);}})[_0x57bd('0x17')](function(_0x5cfa02){logger[_0x57bd('0x13')](_0x57bd('0x14'),_0x4b960f,_0x5cfa02);_0x492c8a(_0x5cfa02);});});}