Built motion from commit (unavailable).|2.5.4
[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 _0x7d13=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','result','catch','util','bluebird'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x7d13,0x6c));var _0x37d1=function(_0x4505cb,_0x135d7d){_0x4505cb=_0x4505cb-0x0;var _0x188f78=_0x7d13[_0x4505cb];return _0x188f78;};'use strict';var _=require('lodash');var util=require(_0x37d1('0x0'));var moment=require('moment');var BPromise=require(_0x37d1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37d1('0x2'));var db=require(_0x37d1('0x3'))['db'];var utils=require(_0x37d1('0x4'));var logger=require(_0x37d1('0x5'))(_0x37d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x37d1('0x7'));var client=jayson[_0x37d1('0x8')][_0x37d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27ac1d,_0x5146e3,_0x9302bd){return new BPromise(function(_0x41dfaa,_0x115eca){return client[_0x37d1('0xa')](_0x27ac1d,_0x9302bd)[_0x37d1('0xb')](function(_0x636359){logger[_0x37d1('0xc')]('License,\x20%s,\x20%s',_0x5146e3,'request\x20sent');logger[_0x37d1('0xd')](_0x37d1('0xe'),_0x5146e3,'request\x20sent',JSON[_0x37d1('0xf')](_0x636359));if(_0x636359[_0x37d1('0x10')]){if(_0x636359[_0x37d1('0x10')][_0x37d1('0x11')]===0x1f4){logger[_0x37d1('0x10')](_0x37d1('0x12'),_0x5146e3,_0x636359[_0x37d1('0x10')][_0x37d1('0x13')]);return _0x115eca(_0x636359['error'][_0x37d1('0x13')]);}logger[_0x37d1('0x10')]('License,\x20%s,\x20%s',_0x5146e3,_0x636359[_0x37d1('0x10')][_0x37d1('0x13')]);return _0x41dfaa(_0x636359['error'][_0x37d1('0x13')]);}else{logger[_0x37d1('0xc')]('License,\x20%s,\x20%s',_0x5146e3,'request\x20sent');_0x41dfaa(_0x636359[_0x37d1('0x14')][_0x37d1('0x13')]);}})[_0x37d1('0x15')](function(_0x5ded71){logger[_0x37d1('0x10')](_0x37d1('0x12'),_0x5146e3,_0x5ded71);_0x115eca(_0x5ded71);});});}