fb361c2b20fed3ca2fc4ef43b006f4ef271466f9
[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 _0x33af=['info','request\x20sent','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1e8c72,_0x4a6d36){var _0x707394=function(_0x3d79a4){while(--_0x3d79a4){_0x1e8c72['push'](_0x1e8c72['shift']());}};_0x707394(++_0x4a6d36);}(_0x33af,0x1bc));var _0xf33a=function(_0x5bb4e8,_0x44b756){_0x5bb4e8=_0x5bb4e8-0x0;var _0x2a86f2=_0x33af[_0x5bb4e8];return _0x2a86f2;};'use strict';var _=require(_0xf33a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf33a('0x1'));var rs=require(_0xf33a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf33a('0x3'))['db'];var utils=require(_0xf33a('0x4'));var logger=require(_0xf33a('0x5'))('rpc');var config=require(_0xf33a('0x6'));var jayson=require(_0xf33a('0x7'));var client=jayson[_0xf33a('0x8')][_0xf33a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42e5fd,_0x11a73c,_0x22580c){return new BPromise(function(_0x2775d3,_0x263d4f){return client['request'](_0x42e5fd,_0x22580c)[_0xf33a('0xa')](function(_0x1495f3){logger['info'](_0xf33a('0xb'),_0x11a73c,'request\x20sent');logger[_0xf33a('0xc')](_0xf33a('0xd'),_0x11a73c,'request\x20sent',JSON[_0xf33a('0xe')](_0x1495f3));if(_0x1495f3['error']){if(_0x1495f3[_0xf33a('0xf')][_0xf33a('0x10')]===0x1f4){logger['error'](_0xf33a('0xb'),_0x11a73c,_0x1495f3[_0xf33a('0xf')][_0xf33a('0x11')]);return _0x263d4f(_0x1495f3['error'][_0xf33a('0x11')]);}logger['error'](_0xf33a('0xb'),_0x11a73c,_0x1495f3[_0xf33a('0xf')][_0xf33a('0x11')]);return _0x2775d3(_0x1495f3[_0xf33a('0xf')][_0xf33a('0x11')]);}else{logger[_0xf33a('0x12')]('License,\x20%s,\x20%s',_0x11a73c,_0xf33a('0x13'));_0x2775d3(_0x1495f3[_0xf33a('0x14')][_0xf33a('0x11')]);}})[_0xf33a('0x15')](function(_0x55528c){logger['error']('License,\x20%s,\x20%s',_0x11a73c,_0x55528c);_0x263d4f(_0x55528c);});});}