Built motion from commit e6806ed6.|2.6.0
[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 _0x760b=['../../config/logger','../../config/environment','jayson/promise','client','http','then','info','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1c0f3d,_0x55a9e2){var _0x4d71a8=function(_0xeff131){while(--_0xeff131){_0x1c0f3d['push'](_0x1c0f3d['shift']());}};_0x4d71a8(++_0x55a9e2);}(_0x760b,0x1dc));var _0xb760=function(_0x5871c2,_0x371adb){_0x5871c2=_0x5871c2-0x0;var _0x11d9d4=_0x760b[_0x5871c2];return _0x11d9d4;};'use strict';var _=require(_0xb760('0x0'));var util=require(_0xb760('0x1'));var moment=require('moment');var BPromise=require(_0xb760('0x2'));var rs=require(_0xb760('0x3'));var fs=require('fs');var Redis=require(_0xb760('0x4'));var db=require(_0xb760('0x5'))['db'];var utils=require(_0xb760('0x6'));var logger=require(_0xb760('0x7'))('rpc');var config=require(_0xb760('0x8'));var jayson=require(_0xb760('0x9'));var client=jayson[_0xb760('0xa')][_0xb760('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x451a9c,_0x5e79a9,_0x42557a){return new BPromise(function(_0x39e205,_0x1eacde){return client['request'](_0x451a9c,_0x42557a)[_0xb760('0xc')](function(_0x14d08b){logger[_0xb760('0xd')]('CmCustomField,\x20%s,\x20%s',_0x5e79a9,'request\x20sent');logger[_0xb760('0xe')](_0xb760('0xf'),_0x5e79a9,_0xb760('0x10'),JSON[_0xb760('0x11')](_0x14d08b));if(_0x14d08b['error']){if(_0x14d08b[_0xb760('0x12')][_0xb760('0x13')]===0x1f4){logger['error'](_0xb760('0x14'),_0x5e79a9,_0x14d08b[_0xb760('0x12')][_0xb760('0x15')]);return _0x1eacde(_0x14d08b['error'][_0xb760('0x15')]);}logger[_0xb760('0x12')](_0xb760('0x14'),_0x5e79a9,_0x14d08b[_0xb760('0x12')]['message']);return _0x39e205(_0x14d08b[_0xb760('0x12')][_0xb760('0x15')]);}else{logger[_0xb760('0xd')]('CmCustomField,\x20%s,\x20%s',_0x5e79a9,_0xb760('0x10'));_0x39e205(_0x14d08b['result'][_0xb760('0x15')]);}})[_0xb760('0x16')](function(_0x530b08){logger[_0xb760('0x12')](_0xb760('0x14'),_0x5e79a9,_0x530b08);_0x1eacde(_0x530b08);});});}