Built motion from commit (unavailable).|2.5.8
[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 _0x0490=['debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','License,\x20%s,\x20%s','request\x20sent'];(function(_0x507c4b,_0x36cc1a){var _0x1b8bb6=function(_0x5aa094){while(--_0x5aa094){_0x507c4b['push'](_0x507c4b['shift']());}};_0x1b8bb6(++_0x36cc1a);}(_0x0490,0x147));var _0x0049=function(_0x50f10d,_0x4877cc){_0x50f10d=_0x50f10d-0x0;var _0x551cf7=_0x0490[_0x50f10d];return _0x551cf7;};'use strict';var _=require('lodash');var util=require(_0x0049('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0049('0x1'))['db'];var utils=require(_0x0049('0x2'));var logger=require(_0x0049('0x3'))(_0x0049('0x4'));var config=require(_0x0049('0x5'));var jayson=require(_0x0049('0x6'));var client=jayson[_0x0049('0x7')][_0x0049('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x28c8d2,_0x57fca5,_0x18bff7){return new BPromise(function(_0xe091c4,_0x154219){return client['request'](_0x28c8d2,_0x18bff7)[_0x0049('0x9')](function(_0x3f2ca1){logger[_0x0049('0xa')](_0x0049('0xb'),_0x57fca5,_0x0049('0xc'));logger[_0x0049('0xd')](_0x0049('0xe'),_0x57fca5,_0x0049('0xc'),JSON[_0x0049('0xf')](_0x3f2ca1));if(_0x3f2ca1['error']){if(_0x3f2ca1[_0x0049('0x10')][_0x0049('0x11')]===0x1f4){logger[_0x0049('0x10')]('License,\x20%s,\x20%s',_0x57fca5,_0x3f2ca1['error'][_0x0049('0x12')]);return _0x154219(_0x3f2ca1[_0x0049('0x10')][_0x0049('0x12')]);}logger[_0x0049('0x10')](_0x0049('0xb'),_0x57fca5,_0x3f2ca1['error'][_0x0049('0x12')]);return _0xe091c4(_0x3f2ca1[_0x0049('0x10')]['message']);}else{logger[_0x0049('0xa')](_0x0049('0xb'),_0x57fca5,_0x0049('0xc'));_0xe091c4(_0x3f2ca1[_0x0049('0x13')]['message']);}})['catch'](function(_0x4315b5){logger[_0x0049('0x10')](_0x0049('0xb'),_0x57fca5,_0x4315b5);_0x154219(_0x4315b5);});});}