9467e59425c1d4fa658f90d85b8a82b1df1a1443
[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 _0xf26c=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util'];(function(_0x418504,_0x39fdd6){var _0x150f05=function(_0x391f9a){while(--_0x391f9a){_0x418504['push'](_0x418504['shift']());}};_0x150f05(++_0x39fdd6);}(_0xf26c,0x14e));var _0xcf26=function(_0x2d90ac,_0x2bf19c){_0x2d90ac=_0x2d90ac-0x0;var _0x4a2f53=_0xf26c[_0x2d90ac];return _0x4a2f53;};'use strict';var _=require(_0xcf26('0x0'));var util=require(_0xcf26('0x1'));var moment=require(_0xcf26('0x2'));var BPromise=require(_0xcf26('0x3'));var rs=require(_0xcf26('0x4'));var fs=require('fs');var Redis=require(_0xcf26('0x5'));var db=require(_0xcf26('0x6'))['db'];var utils=require(_0xcf26('0x7'));var logger=require(_0xcf26('0x8'))(_0xcf26('0x9'));var config=require('../../config/environment');var jayson=require(_0xcf26('0xa'));var client=jayson[_0xcf26('0xb')][_0xcf26('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x15b149,_0x3344a0,_0x5424a8){return new BPromise(function(_0xb1c36d,_0x3b9bca){return client['request'](_0x15b149,_0x5424a8)['then'](function(_0x26ea93){logger[_0xcf26('0xd')](_0xcf26('0xe'),_0x3344a0,_0xcf26('0xf'));logger['debug'](_0xcf26('0x10'),_0x3344a0,_0xcf26('0xf'),JSON[_0xcf26('0x11')](_0x26ea93));if(_0x26ea93[_0xcf26('0x12')]){if(_0x26ea93['error'][_0xcf26('0x13')]===0x1f4){logger[_0xcf26('0x12')](_0xcf26('0xe'),_0x3344a0,_0x26ea93['error']['message']);return _0x3b9bca(_0x26ea93[_0xcf26('0x12')][_0xcf26('0x14')]);}logger[_0xcf26('0x12')](_0xcf26('0xe'),_0x3344a0,_0x26ea93[_0xcf26('0x12')][_0xcf26('0x14')]);return _0xb1c36d(_0x26ea93[_0xcf26('0x12')][_0xcf26('0x14')]);}else{logger[_0xcf26('0xd')](_0xcf26('0xe'),_0x3344a0,'request\x20sent');_0xb1c36d(_0x26ea93['result']['message']);}})['catch'](function(_0x22b69f){logger[_0xcf26('0x12')](_0xcf26('0xe'),_0x3344a0,_0x22b69f);_0x3b9bca(_0x22b69f);});});}