c470f938c4d77a1d86f0a102660d6df0ef737dfd
[motion2.git] / server / api / saSalesCondition / saSalesCondition.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 _0x1ccd=['info','SASalesCondition,\x20%s,\x20%s','request\x20sent','debug','SASalesCondition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','then'];(function(_0x49fb3a,_0x576296){var _0xae6d0f=function(_0x124282){while(--_0x124282){_0x49fb3a['push'](_0x49fb3a['shift']());}};_0xae6d0f(++_0x576296);}(_0x1ccd,0x15b));var _0xd1cc=function(_0x3c4a7c,_0x2f4e3c){_0x3c4a7c=_0x3c4a7c-0x0;var _0xf13d1e=_0x1ccd[_0x3c4a7c];return _0xf13d1e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd1cc('0x0'));var BPromise=require(_0xd1cc('0x1'));var rs=require(_0xd1cc('0x2'));var fs=require('fs');var Redis=require(_0xd1cc('0x3'));var db=require(_0xd1cc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd1cc('0x5'))('rpc');var config=require(_0xd1cc('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd1cc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xa21e25,_0x9598a6,_0x58a1e6){return new BPromise(function(_0x286d9d,_0x30b077){return client[_0xd1cc('0x8')](_0xa21e25,_0x58a1e6)[_0xd1cc('0x9')](function(_0x33fac0){logger[_0xd1cc('0xa')](_0xd1cc('0xb'),_0x9598a6,_0xd1cc('0xc'));logger[_0xd1cc('0xd')](_0xd1cc('0xe'),_0x9598a6,_0xd1cc('0xc'),JSON[_0xd1cc('0xf')](_0x33fac0));if(_0x33fac0['error']){if(_0x33fac0[_0xd1cc('0x10')][_0xd1cc('0x11')]===0x1f4){logger[_0xd1cc('0x10')](_0xd1cc('0xb'),_0x9598a6,_0x33fac0[_0xd1cc('0x10')]['message']);return _0x30b077(_0x33fac0[_0xd1cc('0x10')]['message']);}logger[_0xd1cc('0x10')](_0xd1cc('0xb'),_0x9598a6,_0x33fac0['error'][_0xd1cc('0x12')]);return _0x286d9d(_0x33fac0[_0xd1cc('0x10')][_0xd1cc('0x12')]);}else{logger[_0xd1cc('0xa')](_0xd1cc('0xb'),_0x9598a6,'request\x20sent');_0x286d9d(_0x33fac0[_0xd1cc('0x13')][_0xd1cc('0x12')]);}})[_0xd1cc('0x14')](function(_0x58b58f){logger[_0xd1cc('0x10')]('SASalesCondition,\x20%s,\x20%s',_0x9598a6,_0x58b58f);_0x30b077(_0x58b58f);});});}