Built motion from commit 00bf23f6.|2.6.16
[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 _0xa1ac=['info','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0xce0a55,_0xa2d909){var _0x302e4a=function(_0x5c5386){while(--_0x5c5386){_0xce0a55['push'](_0xce0a55['shift']());}};_0x302e4a(++_0xa2d909);}(_0xa1ac,0xde));var _0xca1a=function(_0x2f88cc,_0x29800f){_0x2f88cc=_0x2f88cc-0x0;var _0x3c8e1f=_0xa1ac[_0x2f88cc];return _0x3c8e1f;};'use strict';var _=require(_0xca1a('0x0'));var util=require('util');var moment=require(_0xca1a('0x1'));var BPromise=require(_0xca1a('0x2'));var rs=require(_0xca1a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca1a('0x4'))['db'];var utils=require(_0xca1a('0x5'));var logger=require(_0xca1a('0x6'))(_0xca1a('0x7'));var config=require(_0xca1a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xca1a('0x9')][_0xca1a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5903af,_0x56d151,_0x5b8132){return new BPromise(function(_0x146519,_0x16624a){return client[_0xca1a('0xb')](_0x5903af,_0x5b8132)[_0xca1a('0xc')](function(_0x114e4b){logger['info'](_0xca1a('0xd'),_0x56d151,_0xca1a('0xe'));logger[_0xca1a('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x56d151,_0xca1a('0xe'),JSON[_0xca1a('0x10')](_0x114e4b));if(_0x114e4b[_0xca1a('0x11')]){if(_0x114e4b[_0xca1a('0x11')][_0xca1a('0x12')]===0x1f4){logger[_0xca1a('0x11')](_0xca1a('0xd'),_0x56d151,_0x114e4b[_0xca1a('0x11')][_0xca1a('0x13')]);return _0x16624a(_0x114e4b['error']['message']);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x56d151,_0x114e4b[_0xca1a('0x11')][_0xca1a('0x13')]);return _0x146519(_0x114e4b[_0xca1a('0x11')][_0xca1a('0x13')]);}else{logger[_0xca1a('0x14')](_0xca1a('0xd'),_0x56d151,_0xca1a('0xe'));_0x146519(_0x114e4b[_0xca1a('0x15')]['message']);}})['catch'](function(_0x476ee4){logger[_0xca1a('0x11')](_0xca1a('0xd'),_0x56d151,_0x476ee4);_0x16624a(_0x476ee4);});});}