ab1fed4f200205c1400b278684868dc550c4f547
[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 _0x062b=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x8c32ff,_0x49d75f){var _0x197b7b=function(_0x2274f1){while(--_0x2274f1){_0x8c32ff['push'](_0x8c32ff['shift']());}};_0x197b7b(++_0x49d75f);}(_0x062b,0x1de));var _0xb062=function(_0x57973f,_0xf86d7b){_0x57973f=_0x57973f-0x0;var _0x4241ee=_0x062b[_0x57973f];return _0x4241ee;};'use strict';var _=require(_0xb062('0x0'));var util=require(_0xb062('0x1'));var moment=require('moment');var BPromise=require(_0xb062('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb062('0x3'));var db=require(_0xb062('0x4'))['db'];var utils=require(_0xb062('0x5'));var logger=require(_0xb062('0x6'))('rpc');var config=require(_0xb062('0x7'));var jayson=require(_0xb062('0x8'));var client=jayson[_0xb062('0x9')][_0xb062('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59517f,_0xe679f4,_0x34feef){return new BPromise(function(_0x46f024,_0xf722d7){return client['request'](_0x59517f,_0x34feef)[_0xb062('0xb')](function(_0x21dca7){logger[_0xb062('0xc')](_0xb062('0xd'),_0xe679f4,'request\x20sent');logger[_0xb062('0xe')](_0xb062('0xf'),_0xe679f4,_0xb062('0x10'),JSON[_0xb062('0x11')](_0x21dca7));if(_0x21dca7['error']){if(_0x21dca7['error'][_0xb062('0x12')]===0x1f4){logger[_0xb062('0x13')](_0xb062('0xd'),_0xe679f4,_0x21dca7[_0xb062('0x13')]['message']);return _0xf722d7(_0x21dca7[_0xb062('0x13')]['message']);}logger[_0xb062('0x13')]('CmCustomField,\x20%s,\x20%s',_0xe679f4,_0x21dca7[_0xb062('0x13')][_0xb062('0x14')]);return _0x46f024(_0x21dca7[_0xb062('0x13')][_0xb062('0x14')]);}else{logger[_0xb062('0xc')]('CmCustomField,\x20%s,\x20%s',_0xe679f4,'request\x20sent');_0x46f024(_0x21dca7['result']['message']);}})['catch'](function(_0x45366e){logger[_0xb062('0x13')](_0xb062('0xd'),_0xe679f4,_0x45366e);_0xf722d7(_0x45366e);});});}