Built motion from commit 6a92c2cd.|2.6.29
[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 _0x1afa=['http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x200549,_0x122279){var _0x1b13c8=function(_0x32c2b4){while(--_0x32c2b4){_0x200549['push'](_0x200549['shift']());}};_0x1b13c8(++_0x122279);}(_0x1afa,0xf3));var _0xa1af=function(_0x572c2d,_0x4a7369){_0x572c2d=_0x572c2d-0x0;var _0x300e02=_0x1afa[_0x572c2d];return _0x300e02;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa1af('0x0'));var rs=require(_0xa1af('0x1'));var fs=require('fs');var Redis=require(_0xa1af('0x2'));var db=require(_0xa1af('0x3'))['db'];var utils=require(_0xa1af('0x4'));var logger=require(_0xa1af('0x5'))(_0xa1af('0x6'));var config=require(_0xa1af('0x7'));var jayson=require(_0xa1af('0x8'));var client=jayson['client'][_0xa1af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd46740,_0x157cc7,_0x346b13){return new BPromise(function(_0x12e260,_0x1dbaae){return client[_0xa1af('0xa')](_0xd46740,_0x346b13)[_0xa1af('0xb')](function(_0xcde52c){logger['info'](_0xa1af('0xc'),_0x157cc7,_0xa1af('0xd'));logger[_0xa1af('0xe')](_0xa1af('0xf'),_0x157cc7,_0xa1af('0xd'),JSON['stringify'](_0xcde52c));if(_0xcde52c[_0xa1af('0x10')]){if(_0xcde52c[_0xa1af('0x10')][_0xa1af('0x11')]===0x1f4){logger[_0xa1af('0x10')](_0xa1af('0xc'),_0x157cc7,_0xcde52c[_0xa1af('0x10')][_0xa1af('0x12')]);return _0x1dbaae(_0xcde52c[_0xa1af('0x10')][_0xa1af('0x12')]);}logger[_0xa1af('0x10')](_0xa1af('0xc'),_0x157cc7,_0xcde52c[_0xa1af('0x10')]['message']);return _0x12e260(_0xcde52c[_0xa1af('0x10')]['message']);}else{logger[_0xa1af('0x13')](_0xa1af('0xc'),_0x157cc7,'request\x20sent');_0x12e260(_0xcde52c['result'][_0xa1af('0x12')]);}})[_0xa1af('0x14')](function(_0x210db3){logger[_0xa1af('0x10')]('CmCustomField,\x20%s,\x20%s',_0x157cc7,_0x210db3);_0x1dbaae(_0x210db3);});});}