Built motion from commit b5996064.|2.6.21
[motion2.git] / server / api / license / license.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 _0x1e26=['message','info','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','client','http','request','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x32efa9,_0x17b106){var _0x238d45=function(_0x27894a){while(--_0x27894a){_0x32efa9['push'](_0x32efa9['shift']());}};_0x238d45(++_0x17b106);}(_0x1e26,0x76));var _0x61e2=function(_0x2a6406,_0x52e64d){_0x2a6406=_0x2a6406-0x0;var _0x36349b=_0x1e26[_0x2a6406];return _0x36349b;};'use strict';var _=require(_0x61e2('0x0'));var util=require(_0x61e2('0x1'));var moment=require(_0x61e2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x61e2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x61e2('0x4'));var logger=require(_0x61e2('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x61e2('0x6')][_0x61e2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5672a1,_0x4ab57a,_0x1d9c86){return new BPromise(function(_0xe53d12,_0x25caa7){return client[_0x61e2('0x8')](_0x5672a1,_0x1d9c86)['then'](function(_0x1562dd){logger['info'](_0x61e2('0x9'),_0x4ab57a,_0x61e2('0xa'));logger[_0x61e2('0xb')](_0x61e2('0xc'),_0x4ab57a,'request\x20sent',JSON['stringify'](_0x1562dd));if(_0x1562dd[_0x61e2('0xd')]){if(_0x1562dd[_0x61e2('0xd')][_0x61e2('0xe')]===0x1f4){logger[_0x61e2('0xd')](_0x61e2('0x9'),_0x4ab57a,_0x1562dd[_0x61e2('0xd')][_0x61e2('0xf')]);return _0x25caa7(_0x1562dd[_0x61e2('0xd')]['message']);}logger[_0x61e2('0xd')]('License,\x20%s,\x20%s',_0x4ab57a,_0x1562dd['error'][_0x61e2('0xf')]);return _0xe53d12(_0x1562dd[_0x61e2('0xd')][_0x61e2('0xf')]);}else{logger[_0x61e2('0x10')](_0x61e2('0x9'),_0x4ab57a,_0x61e2('0xa'));_0xe53d12(_0x1562dd[_0x61e2('0x11')]['message']);}})[_0x61e2('0x12')](function(_0x424283){logger[_0x61e2('0xd')](_0x61e2('0x9'),_0x4ab57a,_0x424283);_0x25caa7(_0x424283);});});}