510d76f101bc1a22b61e3cc31a99a060eaae64f5
[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 _0xf80f=['error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x215c7f,_0x445791){var _0x5e0d70=function(_0x998e7a){while(--_0x998e7a){_0x215c7f['push'](_0x215c7f['shift']());}};_0x5e0d70(++_0x445791);}(_0xf80f,0x196));var _0xff80=function(_0x32fc0c,_0x520834){_0x32fc0c=_0x32fc0c-0x0;var _0x229503=_0xf80f[_0x32fc0c];return _0x229503;};'use strict';var _=require(_0xff80('0x0'));var util=require(_0xff80('0x1'));var moment=require(_0xff80('0x2'));var BPromise=require('bluebird');var rs=require(_0xff80('0x3'));var fs=require('fs');var Redis=require(_0xff80('0x4'));var db=require(_0xff80('0x5'))['db'];var utils=require(_0xff80('0x6'));var logger=require(_0xff80('0x7'))(_0xff80('0x8'));var config=require(_0xff80('0x9'));var jayson=require(_0xff80('0xa'));var client=jayson[_0xff80('0xb')][_0xff80('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11ad9f,_0x11186e,_0x15d47b){return new BPromise(function(_0x320222,_0xfdfca1){return client['request'](_0x11ad9f,_0x15d47b)[_0xff80('0xd')](function(_0x487e06){logger[_0xff80('0xe')]('CmCustomField,\x20%s,\x20%s',_0x11186e,_0xff80('0xf'));logger[_0xff80('0x10')](_0xff80('0x11'),_0x11186e,'request\x20sent',JSON[_0xff80('0x12')](_0x487e06));if(_0x487e06[_0xff80('0x13')]){if(_0x487e06[_0xff80('0x13')][_0xff80('0x14')]===0x1f4){logger[_0xff80('0x13')](_0xff80('0x15'),_0x11186e,_0x487e06[_0xff80('0x13')][_0xff80('0x16')]);return _0xfdfca1(_0x487e06[_0xff80('0x13')][_0xff80('0x16')]);}logger[_0xff80('0x13')]('CmCustomField,\x20%s,\x20%s',_0x11186e,_0x487e06[_0xff80('0x13')][_0xff80('0x16')]);return _0x320222(_0x487e06[_0xff80('0x13')][_0xff80('0x16')]);}else{logger[_0xff80('0xe')](_0xff80('0x15'),_0x11186e,_0xff80('0xf'));_0x320222(_0x487e06[_0xff80('0x17')][_0xff80('0x16')]);}})[_0xff80('0x18')](function(_0x330b26){logger['error'](_0xff80('0x15'),_0x11186e,_0x330b26);_0xfdfca1(_0x330b26);});});}