Built motion from commit e02f907f.|2.6.14
[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 _0xba10=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','License,\x20%s,\x20%s','debug','request\x20sent','error','message','info'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0xba10,0x106));var _0x0ba1=function(_0x31eeb3,_0x4f3abb){_0x31eeb3=_0x31eeb3-0x0;var _0x31b430=_0xba10[_0x31eeb3];return _0x31b430;};'use strict';var _=require(_0x0ba1('0x0'));var util=require(_0x0ba1('0x1'));var moment=require(_0x0ba1('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ba1('0x3'));var fs=require('fs');var Redis=require(_0x0ba1('0x4'));var db=require(_0x0ba1('0x5'))['db'];var utils=require(_0x0ba1('0x6'));var logger=require('../../config/logger')(_0x0ba1('0x7'));var config=require('../../config/environment');var jayson=require(_0x0ba1('0x8'));var client=jayson['client'][_0x0ba1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14d64f,_0x1a9c50,_0x276106){return new BPromise(function(_0x345884,_0x1c30ad){return client[_0x0ba1('0xa')](_0x14d64f,_0x276106)[_0x0ba1('0xb')](function(_0x2a8cd2){logger['info'](_0x0ba1('0xc'),_0x1a9c50,'request\x20sent');logger[_0x0ba1('0xd')]('License,\x20%s,\x20%s,\x20%s',_0x1a9c50,_0x0ba1('0xe'),JSON['stringify'](_0x2a8cd2));if(_0x2a8cd2[_0x0ba1('0xf')]){if(_0x2a8cd2[_0x0ba1('0xf')]['code']===0x1f4){logger[_0x0ba1('0xf')](_0x0ba1('0xc'),_0x1a9c50,_0x2a8cd2[_0x0ba1('0xf')][_0x0ba1('0x10')]);return _0x1c30ad(_0x2a8cd2['error'][_0x0ba1('0x10')]);}logger['error'](_0x0ba1('0xc'),_0x1a9c50,_0x2a8cd2['error']['message']);return _0x345884(_0x2a8cd2[_0x0ba1('0xf')][_0x0ba1('0x10')]);}else{logger[_0x0ba1('0x11')](_0x0ba1('0xc'),_0x1a9c50,'request\x20sent');_0x345884(_0x2a8cd2[_0x0ba1('0x12')][_0x0ba1('0x10')]);}})[_0x0ba1('0x13')](function(_0x2e6315){logger[_0x0ba1('0xf')]('License,\x20%s,\x20%s',_0x1a9c50,_0x2e6315);_0x1c30ad(_0x2e6315);});});}