Built motion from commit 85328c08.|2.5.50
[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 _0x7e0a=['request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info'];(function(_0x1c4fa8,_0x10c2cd){var _0x5502cc=function(_0x49505a){while(--_0x49505a){_0x1c4fa8['push'](_0x1c4fa8['shift']());}};_0x5502cc(++_0x10c2cd);}(_0x7e0a,0x152));var _0xa7e0=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x7e0a[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0xa7e0('0x0'));var util=require(_0xa7e0('0x1'));var moment=require(_0xa7e0('0x2'));var BPromise=require(_0xa7e0('0x3'));var rs=require(_0xa7e0('0x4'));var fs=require('fs');var Redis=require(_0xa7e0('0x5'));var db=require(_0xa7e0('0x6'))['db'];var utils=require(_0xa7e0('0x7'));var logger=require(_0xa7e0('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa7e0('0x9'));var client=jayson['client'][_0xa7e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b0121,_0x101460,_0x46f866){return new BPromise(function(_0xde6e12,_0x56bc75){return client[_0xa7e0('0xb')](_0x1b0121,_0x46f866)[_0xa7e0('0xc')](function(_0x2ea329){logger[_0xa7e0('0xd')]('License,\x20%s,\x20%s',_0x101460,_0xa7e0('0xe'));logger['debug'](_0xa7e0('0xf'),_0x101460,_0xa7e0('0xe'),JSON[_0xa7e0('0x10')](_0x2ea329));if(_0x2ea329[_0xa7e0('0x11')]){if(_0x2ea329[_0xa7e0('0x11')][_0xa7e0('0x12')]===0x1f4){logger[_0xa7e0('0x11')](_0xa7e0('0x13'),_0x101460,_0x2ea329[_0xa7e0('0x11')][_0xa7e0('0x14')]);return _0x56bc75(_0x2ea329[_0xa7e0('0x11')][_0xa7e0('0x14')]);}logger[_0xa7e0('0x11')](_0xa7e0('0x13'),_0x101460,_0x2ea329['error']['message']);return _0xde6e12(_0x2ea329[_0xa7e0('0x11')][_0xa7e0('0x14')]);}else{logger[_0xa7e0('0xd')](_0xa7e0('0x13'),_0x101460,_0xa7e0('0xe'));_0xde6e12(_0x2ea329[_0xa7e0('0x15')][_0xa7e0('0x14')]);}})['catch'](function(_0x124f62){logger[_0xa7e0('0x11')](_0xa7e0('0x13'),_0x101460,_0x124f62);_0x56bc75(_0x124f62);});});}