Built motion from commit 3e059bc2.|2.5.32
[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 _0x5702=['http','request','then','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client'];(function(_0x226df0,_0x264154){var _0x3c06a3=function(_0x4f27bb){while(--_0x4f27bb){_0x226df0['push'](_0x226df0['shift']());}};_0x3c06a3(++_0x264154);}(_0x5702,0x183));var _0x2570=function(_0x1dbc53,_0x41883c){_0x1dbc53=_0x1dbc53-0x0;var _0x5de976=_0x5702[_0x1dbc53];return _0x5de976;};'use strict';var _=require(_0x2570('0x0'));var util=require(_0x2570('0x1'));var moment=require('moment');var BPromise=require(_0x2570('0x2'));var rs=require(_0x2570('0x3'));var fs=require('fs');var Redis=require(_0x2570('0x4'));var db=require(_0x2570('0x5'))['db'];var utils=require(_0x2570('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x2570('0x7'));var client=jayson[_0x2570('0x8')][_0x2570('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x415838,_0x4194ea,_0x59a6b3){return new BPromise(function(_0xbb108,_0x3c466c){return client[_0x2570('0xa')](_0x415838,_0x59a6b3)[_0x2570('0xb')](function(_0x44567d){logger[_0x2570('0xc')]('License,\x20%s,\x20%s',_0x4194ea,_0x2570('0xd'));logger[_0x2570('0xe')](_0x2570('0xf'),_0x4194ea,_0x2570('0xd'),JSON[_0x2570('0x10')](_0x44567d));if(_0x44567d[_0x2570('0x11')]){if(_0x44567d[_0x2570('0x11')][_0x2570('0x12')]===0x1f4){logger[_0x2570('0x11')]('License,\x20%s,\x20%s',_0x4194ea,_0x44567d[_0x2570('0x11')][_0x2570('0x13')]);return _0x3c466c(_0x44567d['error']['message']);}logger[_0x2570('0x11')]('License,\x20%s,\x20%s',_0x4194ea,_0x44567d[_0x2570('0x11')][_0x2570('0x13')]);return _0xbb108(_0x44567d[_0x2570('0x11')][_0x2570('0x13')]);}else{logger[_0x2570('0xc')]('License,\x20%s,\x20%s',_0x4194ea,_0x2570('0xd'));_0xbb108(_0x44567d[_0x2570('0x14')]['message']);}})[_0x2570('0x15')](function(_0x447a17){logger[_0x2570('0x11')]('License,\x20%s,\x20%s',_0x4194ea,_0x447a17);_0x3c466c(_0x447a17);});});}