Built motion from commit (unavailable).|2.5.16
[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 _0xf9bc=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','error','message','info','result','catch'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0xf9bc,0x7e));var _0xcf9b=function(_0x27cc9c,_0x4d18e0){_0x27cc9c=_0x27cc9c-0x0;var _0xdf26fe=_0xf9bc[_0x27cc9c];return _0xdf26fe;};'use strict';var _=require('lodash');var util=require(_0xcf9b('0x0'));var moment=require(_0xcf9b('0x1'));var BPromise=require(_0xcf9b('0x2'));var rs=require(_0xcf9b('0x3'));var fs=require('fs');var Redis=require(_0xcf9b('0x4'));var db=require(_0xcf9b('0x5'))['db'];var utils=require(_0xcf9b('0x6'));var logger=require(_0xcf9b('0x7'))(_0xcf9b('0x8'));var config=require(_0xcf9b('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcf9b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ba407,_0xbf765c,_0x2493f0){return new BPromise(function(_0x1ec363,_0x2c0e77){return client[_0xcf9b('0xb')](_0x2ba407,_0x2493f0)[_0xcf9b('0xc')](function(_0x3447ef){logger['info'](_0xcf9b('0xd'),_0xbf765c,_0xcf9b('0xe'));logger['debug'](_0xcf9b('0xf'),_0xbf765c,'request\x20sent',JSON['stringify'](_0x3447ef));if(_0x3447ef['error']){if(_0x3447ef[_0xcf9b('0x10')]['code']===0x1f4){logger[_0xcf9b('0x10')](_0xcf9b('0xd'),_0xbf765c,_0x3447ef['error'][_0xcf9b('0x11')]);return _0x2c0e77(_0x3447ef[_0xcf9b('0x10')][_0xcf9b('0x11')]);}logger[_0xcf9b('0x10')](_0xcf9b('0xd'),_0xbf765c,_0x3447ef['error'][_0xcf9b('0x11')]);return _0x1ec363(_0x3447ef[_0xcf9b('0x10')][_0xcf9b('0x11')]);}else{logger[_0xcf9b('0x12')]('License,\x20%s,\x20%s',_0xbf765c,'request\x20sent');_0x1ec363(_0x3447ef[_0xcf9b('0x13')][_0xcf9b('0x11')]);}})[_0xcf9b('0x14')](function(_0x3276a8){logger[_0xcf9b('0x10')](_0xcf9b('0xd'),_0xbf765c,_0x3276a8);_0x2c0e77(_0x3276a8);});});}