Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / api / smsInteraction / smsInteraction.rpc.js
1 const a667_0xbd34=['register','omit','body','./smsInteraction.socket','where','limit','options','stringify','findOne','SmsInteraction','addTags','AddTagsToSmsInteraction','message','UpdateSmsInteraction','AddTags','info','ids','raw','catch','debug','attributes','../../rediscache','../../mysqldb','error','then','../../config/logger'];(function(_0x4748c7,_0x5903ea){const _0xbd340b=function(_0x2ffc82){while(--_0x2ffc82){_0x4748c7['push'](_0x4748c7['shift']());}};_0xbd340b(++_0x5903ea);}(a667_0xbd34,0x10e));const a667_0x2ffc=function(_0x4748c7,_0x5903ea){_0x4748c7=_0x4748c7-0x172;let _0xbd340b=a667_0xbd34[_0x4748c7];return _0xbd340b;};const a667_0x44620f=a667_0x2ffc;'use strict';const _=require('lodash'),db=require(a667_0x44620f(0x17e))['db'],logger=require(a667_0x44620f(0x181))('rpc'),{getSocket}=require(a667_0x44620f(0x17d)),socket=getSocket();require(a667_0x44620f(0x185))[a667_0x44620f(0x182)](socket),exports[a667_0x44620f(0x175)]=function(_0x22903e){const _0x4c09a7=this;return new Promise(function(_0x55be9b,_0x1a10c5){const _0x2e7120=a667_0x2ffc;return db[_0x2e7120(0x18b)]['update'](_0x22903e[_0x2e7120(0x184)],{'raw':_0x22903e[_0x2e7120(0x188)]?_0x22903e[_0x2e7120(0x188)][_0x2e7120(0x179)]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22903e[_0x2e7120(0x188)]?_0x22903e[_0x2e7120(0x188)][_0x2e7120(0x186)]||null:null,'attributes':_0x22903e['options']?_0x22903e[_0x2e7120(0x188)][_0x2e7120(0x17c)]||null:null,'limit':_0x22903e[_0x2e7120(0x188)]?_0x22903e[_0x2e7120(0x188)][_0x2e7120(0x187)]||null:null})[_0x2e7120(0x180)](function(_0x12d0d5){const _0x3e0281=_0x2e7120;logger[_0x3e0281(0x177)](_0x3e0281(0x175),_0x22903e),logger[_0x3e0281(0x17b)]('UpdateSmsInteraction',_0x22903e,JSON['stringify'](_0x12d0d5)),_0x55be9b(_0x12d0d5);})['catch'](function(_0x2121ea){const _0x282b80=_0x2e7120;logger['error'](_0x282b80(0x175),_0x2121ea['message'],_0x22903e),_0x1a10c5(_0x4c09a7[_0x282b80(0x17f)](0x1f4,_0x2121ea[_0x282b80(0x174)]));});});},exports[a667_0x44620f(0x173)]=function(_0x2f4747){const _0x1fccb5=this;return new Promise(function(_0xe56919,_0x1a86a6){const _0x2f11d3=a667_0x2ffc;return db['SmsInteraction'][_0x2f11d3(0x18a)]({'where':_0x2f4747['options']?_0x2f4747[_0x2f11d3(0x188)][_0x2f11d3(0x186)]||null:null})[_0x2f11d3(0x180)](function(_0x3e99b5){const _0x2e0662=_0x2f11d3;if(_0x3e99b5)return _0x3e99b5[_0x2e0662(0x172)](_0x2f4747[_0x2e0662(0x184)]['ids'],{'through':_[_0x2e0662(0x183)](_0x2f4747[_0x2e0662(0x184)],[_0x2e0662(0x178),'id'])});})[_0x2f11d3(0x180)](function([_0xb516c2]){const _0x176976=_0x2f11d3;logger['info']('AddTags',_0x2f4747),logger[_0x176976(0x17b)](_0x176976(0x176),_0x2f4747,JSON[_0x176976(0x189)](_0xb516c2)),_0xe56919(_0xb516c2);})[_0x2f11d3(0x17a)](function(_0x283a0f){const _0x571a08=_0x2f11d3;logger[_0x571a08(0x17f)]('AddTags',_0x283a0f[_0x571a08(0x174)],_0x2f4747),_0x1a86a6(_0x1fccb5['error'](0x1f4,_0x283a0f[_0x571a08(0x174)]));});});};