7f5a83ffcb3b7c098870c8fb82ae79ce760c4345
[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 _0x467a=['stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s'];(function(_0x2ab365,_0xa3812e){var _0x49fef3=function(_0x29b883){while(--_0x29b883){_0x2ab365['push'](_0x2ab365['shift']());}};_0x49fef3(++_0xa3812e);}(_0x467a,0x119));var _0xa467=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x467a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa467('0x0'));var util=require('util');var moment=require(_0xa467('0x1'));var BPromise=require(_0xa467('0x2'));var rs=require(_0xa467('0x3'));var fs=require('fs');var Redis=require(_0xa467('0x4'));var db=require(_0xa467('0x5'))['db'];var utils=require(_0xa467('0x6'));var logger=require(_0xa467('0x7'))(_0xa467('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa467('0x9')][_0xa467('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x109198,_0x55a4e3,_0x4e2fbc){return new BPromise(function(_0x956bbf,_0x35ed8d){return client[_0xa467('0xb')](_0x109198,_0x4e2fbc)[_0xa467('0xc')](function(_0x3f8eee){logger[_0xa467('0xd')](_0xa467('0xe'),_0x55a4e3,_0xa467('0xf'));logger[_0xa467('0x10')](_0xa467('0x11'),_0x55a4e3,_0xa467('0xf'),JSON[_0xa467('0x12')](_0x3f8eee));if(_0x3f8eee[_0xa467('0x13')]){if(_0x3f8eee[_0xa467('0x13')][_0xa467('0x14')]===0x1f4){logger['error'](_0xa467('0xe'),_0x55a4e3,_0x3f8eee[_0xa467('0x13')][_0xa467('0x15')]);return _0x35ed8d(_0x3f8eee[_0xa467('0x13')][_0xa467('0x15')]);}logger[_0xa467('0x13')](_0xa467('0xe'),_0x55a4e3,_0x3f8eee[_0xa467('0x13')][_0xa467('0x15')]);return _0x956bbf(_0x3f8eee[_0xa467('0x13')][_0xa467('0x15')]);}else{logger[_0xa467('0xd')]('License,\x20%s,\x20%s',_0x55a4e3,_0xa467('0xf'));_0x956bbf(_0x3f8eee['result']['message']);}})[_0xa467('0x16')](function(_0x18e898){logger[_0xa467('0x13')](_0xa467('0xe'),_0x55a4e3,_0x18e898);_0x35ed8d(_0x18e898);});});}