Built motion from commit (unavailable).|2.5.18
[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 _0xb332=['ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb332,0xd9));var _0x2b33=function(_0x290694,_0x281935){_0x290694=_0x290694-0x0;var _0x5a0f2e=_0xb332[_0x290694];return _0x5a0f2e;};'use strict';var _=require(_0x2b33('0x0'));var util=require('util');var moment=require(_0x2b33('0x1'));var BPromise=require(_0x2b33('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b33('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b33('0x4'));var logger=require('../../config/logger')(_0x2b33('0x5'));var config=require('../../config/environment');var jayson=require(_0x2b33('0x6'));var client=jayson[_0x2b33('0x7')][_0x2b33('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x461d44,_0x5a7a3f,_0x5ccf2d){return new BPromise(function(_0x4302b7,_0x5f29ab){return client[_0x2b33('0x9')](_0x461d44,_0x5ccf2d)[_0x2b33('0xa')](function(_0x2f2cb3){logger[_0x2b33('0xb')]('CmCustomField,\x20%s,\x20%s',_0x5a7a3f,_0x2b33('0xc'));logger[_0x2b33('0xd')](_0x2b33('0xe'),_0x5a7a3f,_0x2b33('0xc'),JSON[_0x2b33('0xf')](_0x2f2cb3));if(_0x2f2cb3[_0x2b33('0x10')]){if(_0x2f2cb3[_0x2b33('0x10')][_0x2b33('0x11')]===0x1f4){logger[_0x2b33('0x10')](_0x2b33('0x12'),_0x5a7a3f,_0x2f2cb3[_0x2b33('0x10')]['message']);return _0x5f29ab(_0x2f2cb3[_0x2b33('0x10')][_0x2b33('0x13')]);}logger[_0x2b33('0x10')]('CmCustomField,\x20%s,\x20%s',_0x5a7a3f,_0x2f2cb3[_0x2b33('0x10')]['message']);return _0x4302b7(_0x2f2cb3[_0x2b33('0x10')][_0x2b33('0x13')]);}else{logger[_0x2b33('0xb')]('CmCustomField,\x20%s,\x20%s',_0x5a7a3f,'request\x20sent');_0x4302b7(_0x2f2cb3[_0x2b33('0x14')][_0x2b33('0x13')]);}})[_0x2b33('0x15')](function(_0x2f5119){logger[_0x2b33('0x10')]('CmCustomField,\x20%s,\x20%s',_0x5a7a3f,_0x2f5119);_0x5f29ab(_0x2f5119);});});}