e16419bc5cfc788395b79853606b080a6d4d7b78
[motion2.git] / server / api / saTypeProduct / saTypeProduct.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 _0x0749=['code','error','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SATypeProduct,\x20%s,\x20%s','SATypeProduct,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x7a211c,_0x47d1a7){var _0x51a33c=function(_0x1a4ae5){while(--_0x1a4ae5){_0x7a211c['push'](_0x7a211c['shift']());}};_0x51a33c(++_0x47d1a7);}(_0x0749,0x122));var _0x9074=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x0749[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x9074('0x0'));var util=require(_0x9074('0x1'));var moment=require(_0x9074('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9074('0x3'));var db=require(_0x9074('0x4'))['db'];var utils=require(_0x9074('0x5'));var logger=require(_0x9074('0x6'))(_0x9074('0x7'));var config=require('../../config/environment');var jayson=require(_0x9074('0x8'));var client=jayson[_0x9074('0x9')][_0x9074('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6c0680,_0x55d7a9,_0x896a98){return new BPromise(function(_0x32cac3,_0x2c94f4){return client[_0x9074('0xb')](_0x6c0680,_0x896a98)[_0x9074('0xc')](function(_0x1a6493){logger[_0x9074('0xd')](_0x9074('0xe'),_0x55d7a9,'request\x20sent');logger['debug'](_0x9074('0xf'),_0x55d7a9,_0x9074('0x10'),JSON[_0x9074('0x11')](_0x1a6493));if(_0x1a6493['error']){if(_0x1a6493['error'][_0x9074('0x12')]===0x1f4){logger[_0x9074('0x13')](_0x9074('0xe'),_0x55d7a9,_0x1a6493[_0x9074('0x13')][_0x9074('0x14')]);return _0x2c94f4(_0x1a6493[_0x9074('0x13')]['message']);}logger[_0x9074('0x13')](_0x9074('0xe'),_0x55d7a9,_0x1a6493[_0x9074('0x13')][_0x9074('0x14')]);return _0x32cac3(_0x1a6493[_0x9074('0x13')][_0x9074('0x14')]);}else{logger[_0x9074('0xd')](_0x9074('0xe'),_0x55d7a9,'request\x20sent');_0x32cac3(_0x1a6493[_0x9074('0x15')][_0x9074('0x14')]);}})['catch'](function(_0x1ba1ff){logger[_0x9074('0x13')](_0x9074('0xe'),_0x55d7a9,_0x1ba1ff);_0x2c94f4(_0x1ba1ff);});});}