Built motion from commit 85328c08.|2.5.50
[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 _0xcbf6=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','message','catch','util','moment','randomstring'];(function(_0x4168a7,_0x5433ff){var _0x375c46=function(_0x10a962){while(--_0x10a962){_0x4168a7['push'](_0x4168a7['shift']());}};_0x375c46(++_0x5433ff);}(_0xcbf6,0x18d));var _0x6cbf=function(_0x22ae56,_0x16955c){_0x22ae56=_0x22ae56-0x0;var _0x1544f5=_0xcbf6[_0x22ae56];return _0x1544f5;};'use strict';var _=require('lodash');var util=require(_0x6cbf('0x0'));var moment=require(_0x6cbf('0x1'));var BPromise=require('bluebird');var rs=require(_0x6cbf('0x2'));var fs=require('fs');var Redis=require(_0x6cbf('0x3'));var db=require(_0x6cbf('0x4'))['db'];var utils=require(_0x6cbf('0x5'));var logger=require(_0x6cbf('0x6'))(_0x6cbf('0x7'));var config=require(_0x6cbf('0x8'));var jayson=require(_0x6cbf('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2924e9,_0x441c72,_0x1e1108){return new BPromise(function(_0x1b9a69,_0x527433){return client[_0x6cbf('0xa')](_0x2924e9,_0x1e1108)[_0x6cbf('0xb')](function(_0x5df65c){logger[_0x6cbf('0xc')](_0x6cbf('0xd'),_0x441c72,_0x6cbf('0xe'));logger[_0x6cbf('0xf')](_0x6cbf('0x10'),_0x441c72,_0x6cbf('0xe'),JSON['stringify'](_0x5df65c));if(_0x5df65c[_0x6cbf('0x11')]){if(_0x5df65c[_0x6cbf('0x11')]['code']===0x1f4){logger[_0x6cbf('0x11')](_0x6cbf('0xd'),_0x441c72,_0x5df65c[_0x6cbf('0x11')][_0x6cbf('0x12')]);return _0x527433(_0x5df65c[_0x6cbf('0x11')][_0x6cbf('0x12')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x441c72,_0x5df65c[_0x6cbf('0x11')]['message']);return _0x1b9a69(_0x5df65c[_0x6cbf('0x11')][_0x6cbf('0x12')]);}else{logger[_0x6cbf('0xc')](_0x6cbf('0xd'),_0x441c72,_0x6cbf('0xe'));_0x1b9a69(_0x5df65c['result'][_0x6cbf('0x12')]);}})[_0x6cbf('0x13')](function(_0x212aa5){logger[_0x6cbf('0x11')](_0x6cbf('0xd'),_0x441c72,_0x212aa5);_0x527433(_0x212aa5);});});}