Built motion from commit (unavailable).|2.5.3
[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 _0x3aa2=['lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3aa2,0x13b));var _0x23aa=function(_0x26394d,_0x547eea){_0x26394d=_0x26394d-0x0;var _0x5c7861=_0x3aa2[_0x26394d];return _0x5c7861;};'use strict';var _=require(_0x23aa('0x0'));var util=require(_0x23aa('0x1'));var moment=require('moment');var BPromise=require(_0x23aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x23aa('0x3'))['db'];var utils=require(_0x23aa('0x4'));var logger=require('../../config/logger')(_0x23aa('0x5'));var config=require('../../config/environment');var jayson=require(_0x23aa('0x6'));var client=jayson[_0x23aa('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x461bde,_0xacc1a7,_0x31e9e4){return new BPromise(function(_0x5f3efd,_0x41bfc5){return client[_0x23aa('0x8')](_0x461bde,_0x31e9e4)[_0x23aa('0x9')](function(_0x5c2595){logger['info'](_0x23aa('0xa'),_0xacc1a7,'request\x20sent');logger[_0x23aa('0xb')](_0x23aa('0xc'),_0xacc1a7,_0x23aa('0xd'),JSON[_0x23aa('0xe')](_0x5c2595));if(_0x5c2595[_0x23aa('0xf')]){if(_0x5c2595[_0x23aa('0xf')][_0x23aa('0x10')]===0x1f4){logger['error']('License,\x20%s,\x20%s',_0xacc1a7,_0x5c2595['error'][_0x23aa('0x11')]);return _0x41bfc5(_0x5c2595[_0x23aa('0xf')][_0x23aa('0x11')]);}logger[_0x23aa('0xf')](_0x23aa('0xa'),_0xacc1a7,_0x5c2595[_0x23aa('0xf')][_0x23aa('0x11')]);return _0x5f3efd(_0x5c2595[_0x23aa('0xf')]['message']);}else{logger[_0x23aa('0x12')]('License,\x20%s,\x20%s',_0xacc1a7,'request\x20sent');_0x5f3efd(_0x5c2595[_0x23aa('0x13')][_0x23aa('0x11')]);}})[_0x23aa('0x14')](function(_0x4300a0){logger[_0x23aa('0xf')](_0x23aa('0xa'),_0xacc1a7,_0x4300a0);_0x41bfc5(_0x4300a0);});});}