Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / api / saUnitMeasure / saUnitMeasure.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 _0x30a0=['error','code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SAUnitMeasure,\x20%s,\x20%s','request\x20sent','SAUnitMeasure,\x20%s,\x20%s,\x20%s'];(function(_0x34956e,_0xbcaeef){var _0x156cce=function(_0x16f093){while(--_0x16f093){_0x34956e['push'](_0x34956e['shift']());}};_0x156cce(++_0xbcaeef);}(_0x30a0,0x12a));var _0x030a=function(_0x5da6c8,_0x4cfd67){_0x5da6c8=_0x5da6c8-0x0;var _0x1e4751=_0x30a0[_0x5da6c8];return _0x1e4751;};'use strict';var _=require(_0x030a('0x0'));var util=require(_0x030a('0x1'));var moment=require('moment');var BPromise=require(_0x030a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x030a('0x3'));var db=require(_0x030a('0x4'))['db'];var utils=require(_0x030a('0x5'));var logger=require(_0x030a('0x6'))('rpc');var config=require(_0x030a('0x7'));var jayson=require(_0x030a('0x8'));var client=jayson[_0x030a('0x9')][_0x030a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35ec87,_0x38a687,_0xee3bac){return new BPromise(function(_0x58f681,_0x38a0a8){return client[_0x030a('0xb')](_0x35ec87,_0xee3bac)[_0x030a('0xc')](function(_0x1451ad){logger[_0x030a('0xd')](_0x030a('0xe'),_0x38a687,_0x030a('0xf'));logger['debug'](_0x030a('0x10'),_0x38a687,_0x030a('0xf'),JSON['stringify'](_0x1451ad));if(_0x1451ad['error']){if(_0x1451ad[_0x030a('0x11')][_0x030a('0x12')]===0x1f4){logger[_0x030a('0x11')](_0x030a('0xe'),_0x38a687,_0x1451ad[_0x030a('0x11')]['message']);return _0x38a0a8(_0x1451ad['error']['message']);}logger[_0x030a('0x11')](_0x030a('0xe'),_0x38a687,_0x1451ad[_0x030a('0x11')][_0x030a('0x13')]);return _0x58f681(_0x1451ad['error'][_0x030a('0x13')]);}else{logger[_0x030a('0xd')](_0x030a('0xe'),_0x38a687,'request\x20sent');_0x58f681(_0x1451ad['result'][_0x030a('0x13')]);}})[_0x030a('0x14')](function(_0x6c2dfb){logger['error']('SAUnitMeasure,\x20%s,\x20%s',_0x38a687,_0x6c2dfb);_0x38a0a8(_0x6c2dfb);});});}