Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / api / saPriceList / saPriceList.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 _0x357c=['info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','SAPriceList,\x20%s,\x20%s','request\x20sent','SAPriceList,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x59166d,_0x415c2d){var _0x2184e1=function(_0xb7af45){while(--_0xb7af45){_0x59166d['push'](_0x59166d['shift']());}};_0x2184e1(++_0x415c2d);}(_0x357c,0x159));var _0xc357=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0x357c[_0x454165];return _0x56db53;};'use strict';var _=require(_0xc357('0x0'));var util=require(_0xc357('0x1'));var moment=require(_0xc357('0x2'));var BPromise=require(_0xc357('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc357('0x4'));var db=require(_0xc357('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc357('0x6'))(_0xc357('0x7'));var config=require('../../config/environment');var jayson=require(_0xc357('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c7978,_0x3332ad,_0x2445f1){return new BPromise(function(_0x418885,_0xdc3c68){return client[_0xc357('0x9')](_0x5c7978,_0x2445f1)['then'](function(_0x1e3c18){logger['info'](_0xc357('0xa'),_0x3332ad,_0xc357('0xb'));logger['debug'](_0xc357('0xc'),_0x3332ad,_0xc357('0xb'),JSON['stringify'](_0x1e3c18));if(_0x1e3c18[_0xc357('0xd')]){if(_0x1e3c18[_0xc357('0xd')]['code']===0x1f4){logger[_0xc357('0xd')](_0xc357('0xa'),_0x3332ad,_0x1e3c18['error'][_0xc357('0xe')]);return _0xdc3c68(_0x1e3c18[_0xc357('0xd')][_0xc357('0xe')]);}logger[_0xc357('0xd')](_0xc357('0xa'),_0x3332ad,_0x1e3c18[_0xc357('0xd')][_0xc357('0xe')]);return _0x418885(_0x1e3c18[_0xc357('0xd')][_0xc357('0xe')]);}else{logger[_0xc357('0xf')](_0xc357('0xa'),_0x3332ad,'request\x20sent');_0x418885(_0x1e3c18[_0xc357('0x10')][_0xc357('0xe')]);}})[_0xc357('0x11')](function(_0x3bc44f){logger[_0xc357('0xd')](_0xc357('0xa'),_0x3332ad,_0x3bc44f);_0xdc3c68(_0x3bc44f);});});}