Built motion from commit (unavailable).|2.5.21
[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 _0x0b78=['request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info'];(function(_0x38e67d,_0xf280af){var _0x3b9450=function(_0xd9823c){while(--_0xd9823c){_0x38e67d['push'](_0x38e67d['shift']());}};_0x3b9450(++_0xf280af);}(_0x0b78,0x1ad));var _0x80b7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0b78[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var moment=require('moment');var BPromise=require(_0x80b7('0x2'));var rs=require(_0x80b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x80b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x80b7('0x5'))(_0x80b7('0x6'));var config=require(_0x80b7('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x80b7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x584401,_0x5e19ef,_0x122ebe){return new BPromise(function(_0x3c248d,_0x445c23){return client['request'](_0x584401,_0x122ebe)[_0x80b7('0x9')](function(_0x25a015){logger[_0x80b7('0xa')]('CmCustomField,\x20%s,\x20%s',_0x5e19ef,_0x80b7('0xb'));logger['debug'](_0x80b7('0xc'),_0x5e19ef,_0x80b7('0xb'),JSON[_0x80b7('0xd')](_0x25a015));if(_0x25a015[_0x80b7('0xe')]){if(_0x25a015[_0x80b7('0xe')][_0x80b7('0xf')]===0x1f4){logger[_0x80b7('0xe')](_0x80b7('0x10'),_0x5e19ef,_0x25a015[_0x80b7('0xe')][_0x80b7('0x11')]);return _0x445c23(_0x25a015[_0x80b7('0xe')]['message']);}logger[_0x80b7('0xe')](_0x80b7('0x10'),_0x5e19ef,_0x25a015['error'][_0x80b7('0x11')]);return _0x3c248d(_0x25a015[_0x80b7('0xe')]['message']);}else{logger[_0x80b7('0xa')](_0x80b7('0x10'),_0x5e19ef,_0x80b7('0xb'));_0x3c248d(_0x25a015[_0x80b7('0x12')][_0x80b7('0x11')]);}})[_0x80b7('0x13')](function(_0x1e3d1c){logger[_0x80b7('0xe')](_0x80b7('0x10'),_0x5e19ef,_0x1e3d1c);_0x445c23(_0x1e3d1c);});});}