Built motion from commit 1ea47bf4.|2.6.34
[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 _0xd822=['result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x53b76e,_0x209fe3){var _0x311645=function(_0x314846){while(--_0x314846){_0x53b76e['push'](_0x53b76e['shift']());}};_0x311645(++_0x209fe3);}(_0xd822,0xd1));var _0x2d82=function(_0x5b0c60,_0x10f29b){_0x5b0c60=_0x5b0c60-0x0;var _0x5683a6=_0xd822[_0x5b0c60];return _0x5683a6;};'use strict';var _=require(_0x2d82('0x0'));var util=require(_0x2d82('0x1'));var moment=require('moment');var BPromise=require(_0x2d82('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d82('0x3'));var db=require(_0x2d82('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2d82('0x5'))(_0x2d82('0x6'));var config=require(_0x2d82('0x7'));var jayson=require(_0x2d82('0x8'));var client=jayson[_0x2d82('0x9')][_0x2d82('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b6a79,_0x179091,_0x1432b8){return new BPromise(function(_0x38b37b,_0x210ef6){return client['request'](_0x1b6a79,_0x1432b8)[_0x2d82('0xb')](function(_0x329171){logger[_0x2d82('0xc')](_0x2d82('0xd'),_0x179091,'request\x20sent');logger[_0x2d82('0xe')](_0x2d82('0xf'),_0x179091,_0x2d82('0x10'),JSON[_0x2d82('0x11')](_0x329171));if(_0x329171[_0x2d82('0x12')]){if(_0x329171[_0x2d82('0x12')][_0x2d82('0x13')]===0x1f4){logger[_0x2d82('0x12')](_0x2d82('0xd'),_0x179091,_0x329171[_0x2d82('0x12')]['message']);return _0x210ef6(_0x329171['error'][_0x2d82('0x14')]);}logger['error'](_0x2d82('0xd'),_0x179091,_0x329171[_0x2d82('0x12')][_0x2d82('0x14')]);return _0x38b37b(_0x329171[_0x2d82('0x12')]['message']);}else{logger[_0x2d82('0xc')](_0x2d82('0xd'),_0x179091,_0x2d82('0x10'));_0x38b37b(_0x329171[_0x2d82('0x15')]['message']);}})[_0x2d82('0x16')](function(_0x367e0a){logger[_0x2d82('0x12')]('License,\x20%s,\x20%s',_0x179091,_0x367e0a);_0x210ef6(_0x367e0a);});});}