Built motion from commit 15aa0e42.|2.6.19
[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 _0x3820=['request','then','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2417a0,_0x20ea27){var _0x113f27=function(_0x3cb0b4){while(--_0x3cb0b4){_0x2417a0['push'](_0x2417a0['shift']());}};_0x113f27(++_0x20ea27);}(_0x3820,0x14c));var _0x0382=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0x3820[_0x836465];return _0x2150ea;};'use strict';var _=require('lodash');var util=require(_0x0382('0x0'));var moment=require(_0x0382('0x1'));var BPromise=require(_0x0382('0x2'));var rs=require(_0x0382('0x3'));var fs=require('fs');var Redis=require(_0x0382('0x4'));var db=require(_0x0382('0x5'))['db'];var utils=require(_0x0382('0x6'));var logger=require(_0x0382('0x7'))(_0x0382('0x8'));var config=require(_0x0382('0x9'));var jayson=require(_0x0382('0xa'));var client=jayson[_0x0382('0xb')][_0x0382('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3315a6,_0xfaf3e7,_0x3f89aa){return new BPromise(function(_0x5556f0,_0x193785){return client[_0x0382('0xd')](_0x3315a6,_0x3f89aa)[_0x0382('0xe')](function(_0x261ccb){logger['info'](_0x0382('0xf'),_0xfaf3e7,_0x0382('0x10'));logger[_0x0382('0x11')]('License,\x20%s,\x20%s,\x20%s',_0xfaf3e7,'request\x20sent',JSON[_0x0382('0x12')](_0x261ccb));if(_0x261ccb[_0x0382('0x13')]){if(_0x261ccb[_0x0382('0x13')][_0x0382('0x14')]===0x1f4){logger[_0x0382('0x13')](_0x0382('0xf'),_0xfaf3e7,_0x261ccb['error']['message']);return _0x193785(_0x261ccb['error']['message']);}logger[_0x0382('0x13')](_0x0382('0xf'),_0xfaf3e7,_0x261ccb[_0x0382('0x13')][_0x0382('0x15')]);return _0x5556f0(_0x261ccb[_0x0382('0x13')][_0x0382('0x15')]);}else{logger['info'](_0x0382('0xf'),_0xfaf3e7,'request\x20sent');_0x5556f0(_0x261ccb[_0x0382('0x16')][_0x0382('0x15')]);}})['catch'](function(_0x2ac843){logger[_0x0382('0x13')](_0x0382('0xf'),_0xfaf3e7,_0x2ac843);_0x193785(_0x2ac843);});});}