Built motion from commit (unavailable).|2.5.30
[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 _0x0caf=['../../config/logger','rpc','jayson/promise','client','http','request','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','message','info','result','bluebird','randomstring','ioredis'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0x0caf,0x9f));var _0xf0ca=function(_0x1c9d88,_0x42aa93){_0x1c9d88=_0x1c9d88-0x0;var _0x4259b3=_0x0caf[_0x1c9d88];return _0x4259b3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf0ca('0x0'));var rs=require(_0xf0ca('0x1'));var fs=require('fs');var Redis=require(_0xf0ca('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf0ca('0x3'))(_0xf0ca('0x4'));var config=require('../../config/environment');var jayson=require(_0xf0ca('0x5'));var client=jayson[_0xf0ca('0x6')][_0xf0ca('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x59f602,_0x17ab05,_0x3dbde8){return new BPromise(function(_0x10d826,_0x271297){return client[_0xf0ca('0x8')](_0x59f602,_0x3dbde8)[_0xf0ca('0x9')](function(_0x36e2aa){logger['info'](_0xf0ca('0xa'),_0x17ab05,_0xf0ca('0xb'));logger[_0xf0ca('0xc')](_0xf0ca('0xd'),_0x17ab05,_0xf0ca('0xb'),JSON['stringify'](_0x36e2aa));if(_0x36e2aa['error']){if(_0x36e2aa[_0xf0ca('0xe')]['code']===0x1f4){logger[_0xf0ca('0xe')]('License,\x20%s,\x20%s',_0x17ab05,_0x36e2aa[_0xf0ca('0xe')][_0xf0ca('0xf')]);return _0x271297(_0x36e2aa[_0xf0ca('0xe')][_0xf0ca('0xf')]);}logger[_0xf0ca('0xe')](_0xf0ca('0xa'),_0x17ab05,_0x36e2aa['error'][_0xf0ca('0xf')]);return _0x10d826(_0x36e2aa['error']['message']);}else{logger[_0xf0ca('0x10')](_0xf0ca('0xa'),_0x17ab05,_0xf0ca('0xb'));_0x10d826(_0x36e2aa[_0xf0ca('0x11')][_0xf0ca('0xf')]);}})['catch'](function(_0x5cbd5e){logger[_0xf0ca('0xe')]('License,\x20%s,\x20%s',_0x17ab05,_0x5cbd5e);_0x271297(_0x5cbd5e);});});}