Built motion from commit (unavailable).|2.5.11
[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 _0x9c02=['stringify','error','code','message','License,\x20%s,\x20%s','result','catch','lodash','util','moment','../../config/utils','rpc','jayson/promise','http','request','then','info','debug','request\x20sent'];(function(_0x45bda0,_0x4b7880){var _0x57746a=function(_0x1e5acf){while(--_0x1e5acf){_0x45bda0['push'](_0x45bda0['shift']());}};_0x57746a(++_0x4b7880);}(_0x9c02,0x196));var _0x29c0=function(_0x566b41,_0x3b7500){_0x566b41=_0x566b41-0x0;var _0x5e5d73=_0x9c02[_0x566b41];return _0x5e5d73;};'use strict';var _=require(_0x29c0('0x0'));var util=require(_0x29c0('0x1'));var moment=require(_0x29c0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x29c0('0x3'));var logger=require('../../config/logger')(_0x29c0('0x4'));var config=require('../../config/environment');var jayson=require(_0x29c0('0x5'));var client=jayson['client'][_0x29c0('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x308869,_0x1ac647,_0x5beeb6){return new BPromise(function(_0x58fa3e,_0x18c44c){return client[_0x29c0('0x7')](_0x308869,_0x5beeb6)[_0x29c0('0x8')](function(_0x2e83cb){logger[_0x29c0('0x9')]('License,\x20%s,\x20%s',_0x1ac647,'request\x20sent');logger[_0x29c0('0xa')]('License,\x20%s,\x20%s,\x20%s',_0x1ac647,_0x29c0('0xb'),JSON[_0x29c0('0xc')](_0x2e83cb));if(_0x2e83cb[_0x29c0('0xd')]){if(_0x2e83cb[_0x29c0('0xd')][_0x29c0('0xe')]===0x1f4){logger[_0x29c0('0xd')]('License,\x20%s,\x20%s',_0x1ac647,_0x2e83cb[_0x29c0('0xd')][_0x29c0('0xf')]);return _0x18c44c(_0x2e83cb[_0x29c0('0xd')][_0x29c0('0xf')]);}logger[_0x29c0('0xd')](_0x29c0('0x10'),_0x1ac647,_0x2e83cb[_0x29c0('0xd')][_0x29c0('0xf')]);return _0x58fa3e(_0x2e83cb[_0x29c0('0xd')][_0x29c0('0xf')]);}else{logger[_0x29c0('0x9')](_0x29c0('0x10'),_0x1ac647,_0x29c0('0xb'));_0x58fa3e(_0x2e83cb[_0x29c0('0x11')][_0x29c0('0xf')]);}})[_0x29c0('0x12')](function(_0x6a0177){logger[_0x29c0('0xd')](_0x29c0('0x10'),_0x1ac647,_0x6a0177);_0x18c44c(_0x6a0177);});});}