Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / api / saQuotation / saQuotation.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 _0x0a58=['request\x20sent','debug','SAQuotation,\x20%s,\x20%s,\x20%s','stringify','error','code','SAQuotation,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0x5368ff,_0x45ea0d){var _0x3d7664=function(_0x33aadd){while(--_0x33aadd){_0x5368ff['push'](_0x5368ff['shift']());}};_0x3d7664(++_0x45ea0d);}(_0x0a58,0x8d));var _0x80a5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0a58[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x80a5('0x0'));var util=require(_0x80a5('0x1'));var moment=require(_0x80a5('0x2'));var BPromise=require(_0x80a5('0x3'));var rs=require(_0x80a5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x80a5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x80a5('0x6'))(_0x80a5('0x7'));var config=require(_0x80a5('0x8'));var jayson=require(_0x80a5('0x9'));var client=jayson['client'][_0x80a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34cf23,_0x3c5ec1,_0x828d92){return new BPromise(function(_0x3b6a78,_0x56afd1){return client['request'](_0x34cf23,_0x828d92)[_0x80a5('0xb')](function(_0x4d591c){logger[_0x80a5('0xc')]('SAQuotation,\x20%s,\x20%s',_0x3c5ec1,_0x80a5('0xd'));logger[_0x80a5('0xe')](_0x80a5('0xf'),_0x3c5ec1,_0x80a5('0xd'),JSON[_0x80a5('0x10')](_0x4d591c));if(_0x4d591c[_0x80a5('0x11')]){if(_0x4d591c[_0x80a5('0x11')][_0x80a5('0x12')]===0x1f4){logger[_0x80a5('0x11')](_0x80a5('0x13'),_0x3c5ec1,_0x4d591c['error'][_0x80a5('0x14')]);return _0x56afd1(_0x4d591c[_0x80a5('0x11')][_0x80a5('0x14')]);}logger[_0x80a5('0x11')]('SAQuotation,\x20%s,\x20%s',_0x3c5ec1,_0x4d591c[_0x80a5('0x11')][_0x80a5('0x14')]);return _0x3b6a78(_0x4d591c[_0x80a5('0x11')][_0x80a5('0x14')]);}else{logger['info'](_0x80a5('0x13'),_0x3c5ec1,'request\x20sent');_0x3b6a78(_0x4d591c[_0x80a5('0x15')]['message']);}})['catch'](function(_0x302230){logger[_0x80a5('0x11')](_0x80a5('0x13'),_0x3c5ec1,_0x302230);_0x56afd1(_0x302230);});});}