3ec2bed85d9becc2abb35baec954ed22127175d9
[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 _0xf068=['../../config/utils','../../config/logger','jayson/promise','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x277293,_0x2dcda1){var _0xcde159=function(_0x2deb8c){while(--_0x2deb8c){_0x277293['push'](_0x277293['shift']());}};_0xcde159(++_0x2dcda1);}(_0xf068,0x93));var _0x8f06=function(_0x496a13,_0x381406){_0x496a13=_0x496a13-0x0;var _0x18ad08=_0xf068[_0x496a13];return _0x18ad08;};'use strict';var _=require(_0x8f06('0x0'));var util=require(_0x8f06('0x1'));var moment=require(_0x8f06('0x2'));var BPromise=require(_0x8f06('0x3'));var rs=require(_0x8f06('0x4'));var fs=require('fs');var Redis=require(_0x8f06('0x5'));var db=require(_0x8f06('0x6'))['db'];var utils=require(_0x8f06('0x7'));var logger=require(_0x8f06('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8f06('0x9'));var client=jayson['client'][_0x8f06('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4113b8,_0x1ee02d,_0x2d84a1){return new BPromise(function(_0xf3588b,_0x27d376){return client[_0x8f06('0xb')](_0x4113b8,_0x2d84a1)[_0x8f06('0xc')](function(_0x4b4dbd){logger[_0x8f06('0xd')](_0x8f06('0xe'),_0x1ee02d,_0x8f06('0xf'));logger['debug'](_0x8f06('0x10'),_0x1ee02d,_0x8f06('0xf'),JSON[_0x8f06('0x11')](_0x4b4dbd));if(_0x4b4dbd[_0x8f06('0x12')]){if(_0x4b4dbd[_0x8f06('0x12')]['code']===0x1f4){logger[_0x8f06('0x12')](_0x8f06('0xe'),_0x1ee02d,_0x4b4dbd['error'][_0x8f06('0x13')]);return _0x27d376(_0x4b4dbd[_0x8f06('0x12')]['message']);}logger[_0x8f06('0x12')]('License,\x20%s,\x20%s',_0x1ee02d,_0x4b4dbd[_0x8f06('0x12')][_0x8f06('0x13')]);return _0xf3588b(_0x4b4dbd[_0x8f06('0x12')][_0x8f06('0x13')]);}else{logger[_0x8f06('0xd')](_0x8f06('0xe'),_0x1ee02d,_0x8f06('0xf'));_0xf3588b(_0x4b4dbd[_0x8f06('0x14')]['message']);}})[_0x8f06('0x15')](function(_0x1d754d){logger[_0x8f06('0x12')](_0x8f06('0xe'),_0x1ee02d,_0x1d754d);_0x27d376(_0x1d754d);});});}