Built motion from commit (unavailable).|2.3.10
[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 _0x30d7=['then','info','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request'];(function(_0x4f084b,_0x2ab0f4){var _0x182099=function(_0x5a76f7){while(--_0x5a76f7){_0x4f084b['push'](_0x4f084b['shift']());}};_0x182099(++_0x2ab0f4);}(_0x30d7,0x15b));var _0x730d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x30d7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x730d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x730d('0x1'));var rs=require(_0x730d('0x2'));var fs=require('fs');var Redis=require(_0x730d('0x3'));var db=require(_0x730d('0x4'))['db'];var utils=require(_0x730d('0x5'));var logger=require(_0x730d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x730d('0x7'));var client=jayson['client'][_0x730d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5df757,_0x394fa7,_0x3df176){return new BPromise(function(_0x2e578e,_0x58f94d){return client[_0x730d('0x9')](_0x5df757,_0x3df176)[_0x730d('0xa')](function(_0x4be7c2){logger[_0x730d('0xb')](_0x730d('0xc'),_0x394fa7,_0x730d('0xd'));logger[_0x730d('0xe')]('License,\x20%s,\x20%s,\x20%s',_0x394fa7,'request\x20sent',JSON[_0x730d('0xf')](_0x4be7c2));if(_0x4be7c2[_0x730d('0x10')]){if(_0x4be7c2[_0x730d('0x10')][_0x730d('0x11')]===0x1f4){logger[_0x730d('0x10')](_0x730d('0xc'),_0x394fa7,_0x4be7c2[_0x730d('0x10')][_0x730d('0x12')]);return _0x58f94d(_0x4be7c2[_0x730d('0x10')]['message']);}logger[_0x730d('0x10')](_0x730d('0xc'),_0x394fa7,_0x4be7c2['error'][_0x730d('0x12')]);return _0x2e578e(_0x4be7c2[_0x730d('0x10')][_0x730d('0x12')]);}else{logger['info'](_0x730d('0xc'),_0x394fa7,_0x730d('0xd'));_0x2e578e(_0x4be7c2[_0x730d('0x13')][_0x730d('0x12')]);}})[_0x730d('0x14')](function(_0x29ba0f){logger[_0x730d('0x10')]('License,\x20%s,\x20%s',_0x394fa7,_0x29ba0f);_0x58f94d(_0x29ba0f);});});}