Built motion from commit (unavailable).|2.5.4
[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 _0xbb53=['http','then','info','request\x20sent','stringify','error','message','CmCustomField,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xbb53,0x121));var _0x3bb5=function(_0x38e1c0,_0x439ba1){_0x38e1c0=_0x38e1c0-0x0;var _0x31d04b=_0xbb53[_0x38e1c0];return _0x31d04b;};'use strict';var _=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var moment=require(_0x3bb5('0x2'));var BPromise=require(_0x3bb5('0x3'));var rs=require(_0x3bb5('0x4'));var fs=require('fs');var Redis=require(_0x3bb5('0x5'));var db=require(_0x3bb5('0x6'))['db'];var utils=require(_0x3bb5('0x7'));var logger=require(_0x3bb5('0x8'))(_0x3bb5('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3bb5('0xa')][_0x3bb5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28aa7d,_0x157e04,_0x22f92f){return new BPromise(function(_0x480f9c,_0x5a4ae3){return client['request'](_0x28aa7d,_0x22f92f)[_0x3bb5('0xc')](function(_0x2e0cfa){logger[_0x3bb5('0xd')]('CmCustomField,\x20%s,\x20%s',_0x157e04,_0x3bb5('0xe'));logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0x157e04,_0x3bb5('0xe'),JSON[_0x3bb5('0xf')](_0x2e0cfa));if(_0x2e0cfa['error']){if(_0x2e0cfa[_0x3bb5('0x10')]['code']===0x1f4){logger[_0x3bb5('0x10')]('CmCustomField,\x20%s,\x20%s',_0x157e04,_0x2e0cfa['error'][_0x3bb5('0x11')]);return _0x5a4ae3(_0x2e0cfa[_0x3bb5('0x10')][_0x3bb5('0x11')]);}logger['error'](_0x3bb5('0x12'),_0x157e04,_0x2e0cfa[_0x3bb5('0x10')]['message']);return _0x480f9c(_0x2e0cfa[_0x3bb5('0x10')][_0x3bb5('0x11')]);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0x157e04,'request\x20sent');_0x480f9c(_0x2e0cfa[_0x3bb5('0x13')][_0x3bb5('0x11')]);}})['catch'](function(_0x25d774){logger[_0x3bb5('0x10')](_0x3bb5('0x12'),_0x157e04,_0x25d774);_0x5a4ae3(_0x25d774);});});}