Built motion from commit (unavailable).|2.5.9
[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 _0x153c=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','License,\x20%s,\x20%s'];(function(_0x567aef,_0x3b3373){var _0x201b4b=function(_0x1dad34){while(--_0x1dad34){_0x567aef['push'](_0x567aef['shift']());}};_0x201b4b(++_0x3b3373);}(_0x153c,0x8c));var _0xc153=function(_0x2b3e4d,_0xd60716){_0x2b3e4d=_0x2b3e4d-0x0;var _0x3d1f7d=_0x153c[_0x2b3e4d];return _0x3d1f7d;};'use strict';var _=require(_0xc153('0x0'));var util=require(_0xc153('0x1'));var moment=require(_0xc153('0x2'));var BPromise=require(_0xc153('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc153('0x4'));var db=require(_0xc153('0x5'))['db'];var utils=require(_0xc153('0x6'));var logger=require(_0xc153('0x7'))(_0xc153('0x8'));var config=require(_0xc153('0x9'));var jayson=require(_0xc153('0xa'));var client=jayson['client'][_0xc153('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46a8b7,_0x38e0f8,_0x2144b){return new BPromise(function(_0x374a0c,_0x5a844b){return client['request'](_0x46a8b7,_0x2144b)['then'](function(_0x3843d3){logger[_0xc153('0xc')](_0xc153('0xd'),_0x38e0f8,_0xc153('0xe'));logger[_0xc153('0xf')]('License,\x20%s,\x20%s,\x20%s',_0x38e0f8,'request\x20sent',JSON[_0xc153('0x10')](_0x3843d3));if(_0x3843d3[_0xc153('0x11')]){if(_0x3843d3['error'][_0xc153('0x12')]===0x1f4){logger[_0xc153('0x11')]('License,\x20%s,\x20%s',_0x38e0f8,_0x3843d3['error'][_0xc153('0x13')]);return _0x5a844b(_0x3843d3[_0xc153('0x11')][_0xc153('0x13')]);}logger['error'](_0xc153('0xd'),_0x38e0f8,_0x3843d3[_0xc153('0x11')][_0xc153('0x13')]);return _0x374a0c(_0x3843d3['error'][_0xc153('0x13')]);}else{logger[_0xc153('0xc')]('License,\x20%s,\x20%s',_0x38e0f8,'request\x20sent');_0x374a0c(_0x3843d3[_0xc153('0x14')][_0xc153('0x13')]);}})[_0xc153('0x15')](function(_0x373a99){logger[_0xc153('0x11')](_0xc153('0xd'),_0x38e0f8,_0x373a99);_0x5a844b(_0x373a99);});});}