Built motion from commit b5413ace.|2.6.9
[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 _0x7140=['License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','info','request\x20sent','debug'];(function(_0x333869,_0x349bfd){var _0xc4ac44=function(_0x19fd19){while(--_0x19fd19){_0x333869['push'](_0x333869['shift']());}};_0xc4ac44(++_0x349bfd);}(_0x7140,0x198));var _0x0714=function(_0x457b64,_0x49a219){_0x457b64=_0x457b64-0x0;var _0x437111=_0x7140[_0x457b64];return _0x437111;};'use strict';var _=require('lodash');var util=require(_0x0714('0x0'));var moment=require(_0x0714('0x1'));var BPromise=require('bluebird');var rs=require(_0x0714('0x2'));var fs=require('fs');var Redis=require(_0x0714('0x3'));var db=require(_0x0714('0x4'))['db'];var utils=require(_0x0714('0x5'));var logger=require(_0x0714('0x6'))(_0x0714('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0714('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38a150,_0x2a493a,_0x5bbbc6){return new BPromise(function(_0x24a812,_0x4519d3){return client['request'](_0x38a150,_0x5bbbc6)['then'](function(_0x3b847f){logger[_0x0714('0x9')]('License,\x20%s,\x20%s',_0x2a493a,_0x0714('0xa'));logger[_0x0714('0xb')](_0x0714('0xc'),_0x2a493a,_0x0714('0xa'),JSON[_0x0714('0xd')](_0x3b847f));if(_0x3b847f[_0x0714('0xe')]){if(_0x3b847f[_0x0714('0xe')][_0x0714('0xf')]===0x1f4){logger[_0x0714('0xe')](_0x0714('0x10'),_0x2a493a,_0x3b847f['error'][_0x0714('0x11')]);return _0x4519d3(_0x3b847f[_0x0714('0xe')][_0x0714('0x11')]);}logger[_0x0714('0xe')](_0x0714('0x10'),_0x2a493a,_0x3b847f[_0x0714('0xe')][_0x0714('0x11')]);return _0x24a812(_0x3b847f[_0x0714('0xe')]['message']);}else{logger[_0x0714('0x9')](_0x0714('0x10'),_0x2a493a,_0x0714('0xa'));_0x24a812(_0x3b847f[_0x0714('0x12')]['message']);}})[_0x0714('0x13')](function(_0x29e42f){logger['error'](_0x0714('0x10'),_0x2a493a,_0x29e42f);_0x4519d3(_0x29e42f);});});}