Built motion from commit (unavailable).|2.5.11
[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 _0xbf50=['rpc','jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x2d4c9e,_0x42d5c9){var _0x37c1c5=function(_0x4b5aad){while(--_0x4b5aad){_0x2d4c9e['push'](_0x2d4c9e['shift']());}};_0x37c1c5(++_0x42d5c9);}(_0xbf50,0x93));var _0x0bf5=function(_0xb5c10c,_0x33d4e6){_0xb5c10c=_0xb5c10c-0x0;var _0x309636=_0xbf50[_0xb5c10c];return _0x309636;};'use strict';var _=require(_0x0bf5('0x0'));var util=require('util');var moment=require(_0x0bf5('0x1'));var BPromise=require(_0x0bf5('0x2'));var rs=require(_0x0bf5('0x3'));var fs=require('fs');var Redis=require(_0x0bf5('0x4'));var db=require(_0x0bf5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0bf5('0x6'))(_0x0bf5('0x7'));var config=require('../../config/environment');var jayson=require(_0x0bf5('0x8'));var client=jayson[_0x0bf5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47584b,_0x169675,_0x130ca0){return new BPromise(function(_0x574158,_0x5bb05e){return client[_0x0bf5('0xa')](_0x47584b,_0x130ca0)[_0x0bf5('0xb')](function(_0x3392e2){logger[_0x0bf5('0xc')](_0x0bf5('0xd'),_0x169675,_0x0bf5('0xe'));logger[_0x0bf5('0xf')](_0x0bf5('0x10'),_0x169675,_0x0bf5('0xe'),JSON[_0x0bf5('0x11')](_0x3392e2));if(_0x3392e2[_0x0bf5('0x12')]){if(_0x3392e2[_0x0bf5('0x12')]['code']===0x1f4){logger[_0x0bf5('0x12')](_0x0bf5('0xd'),_0x169675,_0x3392e2[_0x0bf5('0x12')]['message']);return _0x5bb05e(_0x3392e2[_0x0bf5('0x12')]['message']);}logger['error'](_0x0bf5('0xd'),_0x169675,_0x3392e2[_0x0bf5('0x12')][_0x0bf5('0x13')]);return _0x574158(_0x3392e2[_0x0bf5('0x12')]['message']);}else{logger[_0x0bf5('0xc')](_0x0bf5('0xd'),_0x169675,_0x0bf5('0xe'));_0x574158(_0x3392e2[_0x0bf5('0x14')][_0x0bf5('0x13')]);}})[_0x0bf5('0x15')](function(_0x23d4bf){logger[_0x0bf5('0x12')](_0x0bf5('0xd'),_0x169675,_0x23d4bf);_0x5bb05e(_0x23d4bf);});});}