a90904ac0d6eaceca8d5cccae22db644bbce35f8
[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 _0xe24f=['License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info'];(function(_0x756fb2,_0x26b3b9){var _0x524072=function(_0x156a65){while(--_0x156a65){_0x756fb2['push'](_0x756fb2['shift']());}};_0x524072(++_0x26b3b9);}(_0xe24f,0xcf));var _0xfe24=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe24f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xfe24('0x0'));var util=require(_0xfe24('0x1'));var moment=require(_0xfe24('0x2'));var BPromise=require(_0xfe24('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe24('0x4'));var db=require(_0xfe24('0x5'))['db'];var utils=require(_0xfe24('0x6'));var logger=require(_0xfe24('0x7'))('rpc');var config=require(_0xfe24('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfe24('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b727e,_0x1b91a2,_0x35942a){return new BPromise(function(_0x5a365a,_0x562c06){return client[_0xfe24('0xa')](_0x5b727e,_0x35942a)[_0xfe24('0xb')](function(_0x5d9503){logger[_0xfe24('0xc')](_0xfe24('0xd'),_0x1b91a2,_0xfe24('0xe'));logger['debug'](_0xfe24('0xf'),_0x1b91a2,'request\x20sent',JSON[_0xfe24('0x10')](_0x5d9503));if(_0x5d9503[_0xfe24('0x11')]){if(_0x5d9503[_0xfe24('0x11')][_0xfe24('0x12')]===0x1f4){logger[_0xfe24('0x11')]('License,\x20%s,\x20%s',_0x1b91a2,_0x5d9503[_0xfe24('0x11')]['message']);return _0x562c06(_0x5d9503['error']['message']);}logger[_0xfe24('0x11')](_0xfe24('0xd'),_0x1b91a2,_0x5d9503[_0xfe24('0x11')]['message']);return _0x5a365a(_0x5d9503[_0xfe24('0x11')]['message']);}else{logger[_0xfe24('0xc')](_0xfe24('0xd'),_0x1b91a2,_0xfe24('0xe'));_0x5a365a(_0x5d9503[_0xfe24('0x13')][_0xfe24('0x14')]);}})[_0xfe24('0x15')](function(_0x30ab0d){logger[_0xfe24('0x11')](_0xfe24('0xd'),_0x1b91a2,_0x30ab0d);_0x562c06(_0x30ab0d);});});}