Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / api / cmCustomField / cmCustomField.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 _0x6809=['CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent'];(function(_0x43b9df,_0x48e578){var _0xb0cb10=function(_0x1ad726){while(--_0x1ad726){_0x43b9df['push'](_0x43b9df['shift']());}};_0xb0cb10(++_0x48e578);}(_0x6809,0x97));var _0x9680=function(_0x271537,_0x8b7b3b){_0x271537=_0x271537-0x0;var _0x19dc22=_0x6809[_0x271537];return _0x19dc22;};'use strict';var _=require(_0x9680('0x0'));var util=require(_0x9680('0x1'));var moment=require(_0x9680('0x2'));var BPromise=require(_0x9680('0x3'));var rs=require(_0x9680('0x4'));var fs=require('fs');var Redis=require(_0x9680('0x5'));var db=require(_0x9680('0x6'))['db'];var utils=require(_0x9680('0x7'));var logger=require(_0x9680('0x8'))(_0x9680('0x9'));var config=require(_0x9680('0xa'));var jayson=require(_0x9680('0xb'));var client=jayson['client'][_0x9680('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb1710a,_0x3f3550,_0x109e9f){return new BPromise(function(_0x16978a,_0x3e8876){return client[_0x9680('0xd')](_0xb1710a,_0x109e9f)[_0x9680('0xe')](function(_0x33fc50){logger['info'](_0x9680('0xf'),_0x3f3550,_0x9680('0x10'));logger['debug'](_0x9680('0x11'),_0x3f3550,_0x9680('0x10'),JSON[_0x9680('0x12')](_0x33fc50));if(_0x33fc50[_0x9680('0x13')]){if(_0x33fc50[_0x9680('0x13')][_0x9680('0x14')]===0x1f4){logger[_0x9680('0x13')](_0x9680('0xf'),_0x3f3550,_0x33fc50[_0x9680('0x13')]['message']);return _0x3e8876(_0x33fc50['error'][_0x9680('0x15')]);}logger['error'](_0x9680('0xf'),_0x3f3550,_0x33fc50[_0x9680('0x13')][_0x9680('0x15')]);return _0x16978a(_0x33fc50[_0x9680('0x13')][_0x9680('0x15')]);}else{logger[_0x9680('0x16')](_0x9680('0xf'),_0x3f3550,_0x9680('0x10'));_0x16978a(_0x33fc50[_0x9680('0x17')]['message']);}})['catch'](function(_0x467ce8){logger[_0x9680('0x13')](_0x9680('0xf'),_0x3f3550,_0x467ce8);_0x3e8876(_0x467ce8);});});}