Built motion from commit (unavailable).|2.5.6
[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 _0x4fdb=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xf9cb7a,_0x155fd9){var _0x337245=function(_0x385c3b){while(--_0x385c3b){_0xf9cb7a['push'](_0xf9cb7a['shift']());}};_0x337245(++_0x155fd9);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x59aa1c,_0x5898ad){_0x59aa1c=_0x59aa1c-0x0;var _0x3ce1c5=_0x4fdb[_0x59aa1c];return _0x3ce1c5;};'use strict';var _=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var moment=require(_0xb4fd('0x2'));var BPromise=require(_0xb4fd('0x3'));var rs=require(_0xb4fd('0x4'));var fs=require('fs');var Redis=require(_0xb4fd('0x5'));var db=require(_0xb4fd('0x6'))['db'];var utils=require(_0xb4fd('0x7'));var logger=require(_0xb4fd('0x8'))('rpc');var config=require(_0xb4fd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb4fd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53273f,_0x299bff,_0x3af8e3){return new BPromise(function(_0x1151b5,_0x52dca2){return client['request'](_0x53273f,_0x3af8e3)[_0xb4fd('0xb')](function(_0x4f9d18){logger[_0xb4fd('0xc')]('CmCustomField,\x20%s,\x20%s',_0x299bff,_0xb4fd('0xd'));logger[_0xb4fd('0xe')](_0xb4fd('0xf'),_0x299bff,_0xb4fd('0xd'),JSON[_0xb4fd('0x10')](_0x4f9d18));if(_0x4f9d18['error']){if(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x12')]===0x1f4){logger[_0xb4fd('0x11')](_0xb4fd('0x13'),_0x299bff,_0x4f9d18['error'][_0xb4fd('0x14')]);return _0x52dca2(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);}logger['error'](_0xb4fd('0x13'),_0x299bff,_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);return _0x1151b5(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);}else{logger[_0xb4fd('0xc')](_0xb4fd('0x13'),_0x299bff,'request\x20sent');_0x1151b5(_0x4f9d18[_0xb4fd('0x15')][_0xb4fd('0x14')]);}})[_0xb4fd('0x16')](function(_0x2d4701){logger[_0xb4fd('0x11')](_0xb4fd('0x13'),_0x299bff,_0x2d4701);_0x52dca2(_0x2d4701);});});}