Built motion from commit cb845558.|2.6.34
[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 _0x9ae4=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x28836b,_0x389433){var _0x51f3f8=function(_0x503226){while(--_0x503226){_0x28836b['push'](_0x28836b['shift']());}};_0x51f3f8(++_0x389433);}(_0x9ae4,0x1e2));var _0x49ae=function(_0xa192cb,_0x5706c7){_0xa192cb=_0xa192cb-0x0;var _0x4f33da=_0x9ae4[_0xa192cb];return _0x4f33da;};'use strict';var _=require(_0x49ae('0x0'));var util=require(_0x49ae('0x1'));var moment=require(_0x49ae('0x2'));var BPromise=require(_0x49ae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49ae('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x49ae('0x5'));var logger=require(_0x49ae('0x6'))(_0x49ae('0x7'));var config=require(_0x49ae('0x8'));var jayson=require(_0x49ae('0x9'));var client=jayson['client'][_0x49ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c4f48,_0x1775e2,_0x121a69){return new BPromise(function(_0x256f13,_0x195cac){return client[_0x49ae('0xb')](_0x3c4f48,_0x121a69)[_0x49ae('0xc')](function(_0x2affd7){logger[_0x49ae('0xd')](_0x49ae('0xe'),_0x1775e2,_0x49ae('0xf'));logger[_0x49ae('0x10')](_0x49ae('0x11'),_0x1775e2,_0x49ae('0xf'),JSON[_0x49ae('0x12')](_0x2affd7));if(_0x2affd7[_0x49ae('0x13')]){if(_0x2affd7['error'][_0x49ae('0x14')]===0x1f4){logger['error']('License,\x20%s,\x20%s',_0x1775e2,_0x2affd7[_0x49ae('0x13')][_0x49ae('0x15')]);return _0x195cac(_0x2affd7[_0x49ae('0x13')][_0x49ae('0x15')]);}logger['error']('License,\x20%s,\x20%s',_0x1775e2,_0x2affd7['error'][_0x49ae('0x15')]);return _0x256f13(_0x2affd7[_0x49ae('0x13')][_0x49ae('0x15')]);}else{logger[_0x49ae('0xd')]('License,\x20%s,\x20%s',_0x1775e2,'request\x20sent');_0x256f13(_0x2affd7[_0x49ae('0x16')][_0x49ae('0x15')]);}})['catch'](function(_0x5f2d3e){logger[_0x49ae('0x13')](_0x49ae('0xe'),_0x1775e2,_0x5f2d3e);_0x195cac(_0x5f2d3e);});});}