Built motion from commit bab6f49e.|2.6.17
[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 _0xe012=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','CmCustomField,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','lodash','util'];(function(_0x11527f,_0x26bfda){var _0x40df18=function(_0x2eaba9){while(--_0x2eaba9){_0x11527f['push'](_0x11527f['shift']());}};_0x40df18(++_0x26bfda);}(_0xe012,0xa0));var _0x2e01=function(_0x2edbf9,_0x1f52a9){_0x2edbf9=_0x2edbf9-0x0;var _0x3f0791=_0xe012[_0x2edbf9];return _0x3f0791;};'use strict';var _=require(_0x2e01('0x0'));var util=require(_0x2e01('0x1'));var moment=require(_0x2e01('0x2'));var BPromise=require(_0x2e01('0x3'));var rs=require(_0x2e01('0x4'));var fs=require('fs');var Redis=require(_0x2e01('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2e01('0x6'));var logger=require(_0x2e01('0x7'))(_0x2e01('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2e01('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59dbf8,_0x4108bb,_0x4ece20){return new BPromise(function(_0x28c337,_0x3e22aa){return client[_0x2e01('0xa')](_0x59dbf8,_0x4ece20)['then'](function(_0x4b29db){logger['info'](_0x2e01('0xb'),_0x4108bb,_0x2e01('0xc'));logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0x4108bb,'request\x20sent',JSON['stringify'](_0x4b29db));if(_0x4b29db['error']){if(_0x4b29db[_0x2e01('0xd')][_0x2e01('0xe')]===0x1f4){logger[_0x2e01('0xd')](_0x2e01('0xb'),_0x4108bb,_0x4b29db[_0x2e01('0xd')][_0x2e01('0xf')]);return _0x3e22aa(_0x4b29db['error']['message']);}logger[_0x2e01('0xd')]('CmCustomField,\x20%s,\x20%s',_0x4108bb,_0x4b29db[_0x2e01('0xd')][_0x2e01('0xf')]);return _0x28c337(_0x4b29db[_0x2e01('0xd')][_0x2e01('0xf')]);}else{logger[_0x2e01('0x10')](_0x2e01('0xb'),_0x4108bb,_0x2e01('0xc'));_0x28c337(_0x4b29db['result']['message']);}})[_0x2e01('0x11')](function(_0x5118fc){logger[_0x2e01('0xd')](_0x2e01('0xb'),_0x4108bb,_0x5118fc);_0x3e22aa(_0x5118fc);});});}