b4bcc852531b32af27492c48ea1b0094c7c30deb
[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 _0x9c4f=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x9c4f,0x82));var _0xf9c4=function(_0x5d47fe,_0x5d6118){_0x5d47fe=_0x5d47fe-0x0;var _0x4fb7d2=_0x9c4f[_0x5d47fe];return _0x4fb7d2;};'use strict';var _=require(_0xf9c4('0x0'));var util=require(_0xf9c4('0x1'));var moment=require(_0xf9c4('0x2'));var BPromise=require(_0xf9c4('0x3'));var rs=require(_0xf9c4('0x4'));var fs=require('fs');var Redis=require(_0xf9c4('0x5'));var db=require(_0xf9c4('0x6'))['db'];var utils=require(_0xf9c4('0x7'));var logger=require(_0xf9c4('0x8'))(_0xf9c4('0x9'));var config=require('../../config/environment');var jayson=require(_0xf9c4('0xa'));var client=jayson[_0xf9c4('0xb')][_0xf9c4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc3cb6f,_0x29ae76,_0x8652a6){return new BPromise(function(_0x2cab9b,_0x589a65){return client['request'](_0xc3cb6f,_0x8652a6)[_0xf9c4('0xd')](function(_0x414ec1){logger[_0xf9c4('0xe')](_0xf9c4('0xf'),_0x29ae76,_0xf9c4('0x10'));logger[_0xf9c4('0x11')](_0xf9c4('0x12'),_0x29ae76,_0xf9c4('0x10'),JSON[_0xf9c4('0x13')](_0x414ec1));if(_0x414ec1[_0xf9c4('0x14')]){if(_0x414ec1[_0xf9c4('0x14')][_0xf9c4('0x15')]===0x1f4){logger['error'](_0xf9c4('0xf'),_0x29ae76,_0x414ec1[_0xf9c4('0x14')][_0xf9c4('0x16')]);return _0x589a65(_0x414ec1[_0xf9c4('0x14')][_0xf9c4('0x16')]);}logger[_0xf9c4('0x14')]('CmCustomField,\x20%s,\x20%s',_0x29ae76,_0x414ec1[_0xf9c4('0x14')]['message']);return _0x2cab9b(_0x414ec1['error']['message']);}else{logger[_0xf9c4('0xe')](_0xf9c4('0xf'),_0x29ae76,_0xf9c4('0x10'));_0x2cab9b(_0x414ec1[_0xf9c4('0x17')][_0xf9c4('0x16')]);}})[_0xf9c4('0x18')](function(_0x21b557){logger[_0xf9c4('0x14')](_0xf9c4('0xf'),_0x29ae76,_0x21b557);_0x589a65(_0x21b557);});});}