Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / api / saInvoiceLaw / saInvoiceLaw.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 _0x1540=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','SAInvoiceLaw,\x20%s,\x20%s','request\x20sent','debug','SAInvoiceLaw,\x20%s,\x20%s,\x20%s','code','error','message','info','catch','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1540,0x11d));var _0x0154=function(_0x2bc103,_0x9a7597){_0x2bc103=_0x2bc103-0x0;var _0xd190a3=_0x1540[_0x2bc103];return _0xd190a3;};'use strict';var _=require('lodash');var util=require(_0x0154('0x0'));var moment=require(_0x0154('0x1'));var BPromise=require(_0x0154('0x2'));var rs=require(_0x0154('0x3'));var fs=require('fs');var Redis=require(_0x0154('0x4'));var db=require(_0x0154('0x5'))['db'];var utils=require(_0x0154('0x6'));var logger=require(_0x0154('0x7'))(_0x0154('0x8'));var config=require(_0x0154('0x9'));var jayson=require(_0x0154('0xa'));var client=jayson[_0x0154('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x499bd8,_0x5c9469,_0x520512){return new BPromise(function(_0x1219e8,_0x1a3d31){return client[_0x0154('0xc')](_0x499bd8,_0x520512)['then'](function(_0x4c7604){logger['info'](_0x0154('0xd'),_0x5c9469,_0x0154('0xe'));logger[_0x0154('0xf')](_0x0154('0x10'),_0x5c9469,_0x0154('0xe'),JSON['stringify'](_0x4c7604));if(_0x4c7604['error']){if(_0x4c7604['error'][_0x0154('0x11')]===0x1f4){logger[_0x0154('0x12')](_0x0154('0xd'),_0x5c9469,_0x4c7604['error'][_0x0154('0x13')]);return _0x1a3d31(_0x4c7604[_0x0154('0x12')][_0x0154('0x13')]);}logger[_0x0154('0x12')](_0x0154('0xd'),_0x5c9469,_0x4c7604['error']['message']);return _0x1219e8(_0x4c7604[_0x0154('0x12')][_0x0154('0x13')]);}else{logger[_0x0154('0x14')](_0x0154('0xd'),_0x5c9469,'request\x20sent');_0x1219e8(_0x4c7604['result'][_0x0154('0x13')]);}})[_0x0154('0x15')](function(_0x5e32a7){logger[_0x0154('0x12')](_0x0154('0xd'),_0x5c9469,_0x5e32a7);_0x1a3d31(_0x5e32a7);});});}