Built motion from commit (unavailable).|2.5.10
[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 _0xb688=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x305403,_0x4f21c9){var _0x4d90ef=function(_0x54b431){while(--_0x54b431){_0x305403['push'](_0x305403['shift']());}};_0x4d90ef(++_0x4f21c9);}(_0xb688,0xcf));var _0x8b68=function(_0x220419,_0x16987b){_0x220419=_0x220419-0x0;var _0x494842=_0xb688[_0x220419];return _0x494842;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var moment=require(_0x8b68('0x1'));var BPromise=require(_0x8b68('0x2'));var rs=require(_0x8b68('0x3'));var fs=require('fs');var Redis=require(_0x8b68('0x4'));var db=require(_0x8b68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b68('0x6'))(_0x8b68('0x7'));var config=require(_0x8b68('0x8'));var jayson=require(_0x8b68('0x9'));var client=jayson['client'][_0x8b68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ee56,_0x37677d,_0x2bbffd){return new BPromise(function(_0x130892,_0xa5571b){return client[_0x8b68('0xb')](_0x57ee56,_0x2bbffd)[_0x8b68('0xc')](function(_0x261753){logger[_0x8b68('0xd')](_0x8b68('0xe'),_0x37677d,_0x8b68('0xf'));logger[_0x8b68('0x10')](_0x8b68('0x11'),_0x37677d,_0x8b68('0xf'),JSON['stringify'](_0x261753));if(_0x261753[_0x8b68('0x12')]){if(_0x261753[_0x8b68('0x12')][_0x8b68('0x13')]===0x1f4){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);return _0xa5571b(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}logger['error'](_0x8b68('0xe'),_0x37677d,_0x261753['error']['message']);return _0x130892(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}else{logger[_0x8b68('0xd')]('License,\x20%s,\x20%s',_0x37677d,'request\x20sent');_0x130892(_0x261753[_0x8b68('0x15')]['message']);}})[_0x8b68('0x16')](function(_0xb44923){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0xb44923);_0xa5571b(_0xb44923);});});}