Built motion from commit (unavailable).|2.4.17
[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 _0x5269=['../../config/environment','client','http','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','ioredis','../../mysqldb','../../config/utils'];(function(_0x78054e,_0x1cdb98){var _0x3a0960=function(_0x1a2657){while(--_0x1a2657){_0x78054e['push'](_0x78054e['shift']());}};_0x3a0960(++_0x1cdb98);}(_0x5269,0x150));var _0x9526=function(_0x373ff9,_0x3d0127){_0x373ff9=_0x373ff9-0x0;var _0x4674d5=_0x5269[_0x373ff9];return _0x4674d5;};'use strict';var _=require(_0x9526('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9526('0x1'));var db=require(_0x9526('0x2'))['db'];var utils=require(_0x9526('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x9526('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x9526('0x5')][_0x9526('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2e217a,_0x2082b4,_0x1d4acf){return new BPromise(function(_0x4569a0,_0x161880){return client[_0x9526('0x7')](_0x2e217a,_0x1d4acf)[_0x9526('0x8')](function(_0x320908){logger[_0x9526('0x9')](_0x9526('0xa'),_0x2082b4,'request\x20sent');logger[_0x9526('0xb')](_0x9526('0xc'),_0x2082b4,'request\x20sent',JSON[_0x9526('0xd')](_0x320908));if(_0x320908[_0x9526('0xe')]){if(_0x320908[_0x9526('0xe')][_0x9526('0xf')]===0x1f4){logger[_0x9526('0xe')](_0x9526('0xa'),_0x2082b4,_0x320908[_0x9526('0xe')]['message']);return _0x161880(_0x320908[_0x9526('0xe')][_0x9526('0x10')]);}logger['error'](_0x9526('0xa'),_0x2082b4,_0x320908[_0x9526('0xe')]['message']);return _0x4569a0(_0x320908['error']['message']);}else{logger[_0x9526('0x9')]('License,\x20%s,\x20%s',_0x2082b4,_0x9526('0x11'));_0x4569a0(_0x320908[_0x9526('0x12')][_0x9526('0x10')]);}})[_0x9526('0x13')](function(_0x3108ba){logger[_0x9526('0xe')]('License,\x20%s,\x20%s',_0x2082b4,_0x3108ba);_0x161880(_0x3108ba);});});}