Built motion from commit f25620e4.|2.6.30
[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 _0x210e=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x9b7a64,_0x38d4a8){var _0x33fd98=function(_0x15c82b){while(--_0x15c82b){_0x9b7a64['push'](_0x9b7a64['shift']());}};_0x33fd98(++_0x38d4a8);}(_0x210e,0x17f));var _0xe210=function(_0x1c2d01,_0x55590b){_0x1c2d01=_0x1c2d01-0x0;var _0x2fe07e=_0x210e[_0x1c2d01];return _0x2fe07e;};'use strict';var _=require(_0xe210('0x0'));var util=require(_0xe210('0x1'));var moment=require('moment');var BPromise=require(_0xe210('0x2'));var rs=require(_0xe210('0x3'));var fs=require('fs');var Redis=require(_0xe210('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe210('0x5'))('rpc');var config=require(_0xe210('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe210('0x7')][_0xe210('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10adc8,_0x348fdd,_0x8fcde5){return new BPromise(function(_0x34bd6b,_0x30cbf8){return client['request'](_0x10adc8,_0x8fcde5)[_0xe210('0x9')](function(_0x56a138){logger[_0xe210('0xa')](_0xe210('0xb'),_0x348fdd,_0xe210('0xc'));logger[_0xe210('0xd')](_0xe210('0xe'),_0x348fdd,_0xe210('0xc'),JSON[_0xe210('0xf')](_0x56a138));if(_0x56a138['error']){if(_0x56a138[_0xe210('0x10')][_0xe210('0x11')]===0x1f4){logger[_0xe210('0x10')]('License,\x20%s,\x20%s',_0x348fdd,_0x56a138[_0xe210('0x10')][_0xe210('0x12')]);return _0x30cbf8(_0x56a138['error'][_0xe210('0x12')]);}logger[_0xe210('0x10')](_0xe210('0xb'),_0x348fdd,_0x56a138['error'][_0xe210('0x12')]);return _0x34bd6b(_0x56a138[_0xe210('0x10')][_0xe210('0x12')]);}else{logger[_0xe210('0xa')](_0xe210('0xb'),_0x348fdd,_0xe210('0xc'));_0x34bd6b(_0x56a138[_0xe210('0x13')][_0xe210('0x12')]);}})[_0xe210('0x14')](function(_0xb08899){logger[_0xe210('0x10')]('License,\x20%s,\x20%s',_0x348fdd,_0xb08899);_0x30cbf8(_0xb08899);});});}