Built motion from commit b58257bb.|2.5.37
[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 _0xe067=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x317f33,_0x4688eb){var _0x21208a=function(_0x28b59b){while(--_0x28b59b){_0x317f33['push'](_0x317f33['shift']());}};_0x21208a(++_0x4688eb);}(_0xe067,0xf5));var _0x7e06=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0xe067[_0x47a349];return _0x18ab75;};'use strict';var _=require(_0x7e06('0x0'));var util=require(_0x7e06('0x1'));var moment=require(_0x7e06('0x2'));var BPromise=require(_0x7e06('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e06('0x4'));var db=require(_0x7e06('0x5'))['db'];var utils=require(_0x7e06('0x6'));var logger=require(_0x7e06('0x7'))(_0x7e06('0x8'));var config=require(_0x7e06('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7e06('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa7260a,_0x2d8a33,_0x3a6490){return new BPromise(function(_0x308714,_0x4186c3){return client[_0x7e06('0xb')](_0xa7260a,_0x3a6490)[_0x7e06('0xc')](function(_0x3e63fd){logger[_0x7e06('0xd')](_0x7e06('0xe'),_0x2d8a33,_0x7e06('0xf'));logger[_0x7e06('0x10')]('License,\x20%s,\x20%s,\x20%s',_0x2d8a33,_0x7e06('0xf'),JSON[_0x7e06('0x11')](_0x3e63fd));if(_0x3e63fd['error']){if(_0x3e63fd[_0x7e06('0x12')]['code']===0x1f4){logger[_0x7e06('0x12')]('License,\x20%s,\x20%s',_0x2d8a33,_0x3e63fd[_0x7e06('0x12')][_0x7e06('0x13')]);return _0x4186c3(_0x3e63fd[_0x7e06('0x12')][_0x7e06('0x13')]);}logger[_0x7e06('0x12')]('License,\x20%s,\x20%s',_0x2d8a33,_0x3e63fd['error']['message']);return _0x308714(_0x3e63fd[_0x7e06('0x12')][_0x7e06('0x13')]);}else{logger['info']('License,\x20%s,\x20%s',_0x2d8a33,'request\x20sent');_0x308714(_0x3e63fd[_0x7e06('0x14')][_0x7e06('0x13')]);}})[_0x7e06('0x15')](function(_0x38f3cb){logger[_0x7e06('0x12')](_0x7e06('0xe'),_0x2d8a33,_0x38f3cb);_0x4186c3(_0x38f3cb);});});}