Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / api / whatsappMessage / whatsappMessage.options.js
index e68a449..1c08cf6 100644 (file)
@@ -1 +1 @@
-const a962_0x25b2=['messageId','get','secret','../../config/logger','then','update','toLowerCase','type','out','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','/status?token=','whatsapp:','create','WhatsappAccountId','catch','findOne','accountSid','messages','exports','twilio','createdAt','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','body','whatsapp_messages','afterCreate','direction','isNil','authToken','token','lodash','find','fti_whatsapp_messages','sid','/api/whatsapp/messages/','util','inspect','phone','WhatsappInteraction'];(function(_0x3018d0,_0x374cbe){const _0x25b26c=function(_0x4be0b3){while(--_0x4be0b3){_0x3018d0['push'](_0x3018d0['shift']());}};_0x25b26c(++_0x374cbe);}(a962_0x25b2,0x8b));const a962_0x4be0=function(_0x3018d0,_0x374cbe){_0x3018d0=_0x3018d0-0x16e;let _0x25b26c=a962_0x25b2[_0x3018d0];return _0x25b26c;};const a962_0x4df732=a962_0x4be0,util=require(a962_0x4df732(0x17b)),_=require(a962_0x4df732(0x176)),twilio=require(a962_0x4df732(0x192)),logger=require(a962_0x4df732(0x182))('api');function options(_0x4e8df2){const _0x310005=a962_0x4df732;return{'sequelize':_0x4e8df2,'tableName':_0x310005(0x170),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x310005(0x17f)]},{'name':_0x310005(0x178),'fields':[_0x310005(0x16f)],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1b9a3c){const _0x28401c=_0x310005,_0x18c3bf=_0x4e8df2['models'],_0x47eac2=_0x1b9a3c[_0x28401c(0x180)]({'plain':!![]});(_0x47eac2[_0x28401c(0x172)]['toLowerCase']()==='in'||_0x47eac2[_0x28401c(0x172)][_0x28401c(0x185)]()==='out'&&!_0x47eac2[_0x28401c(0x181)]&&!_[_0x28401c(0x173)](_0x47eac2['UserId']))&&_0x18c3bf[_0x28401c(0x17e)][_0x28401c(0x18e)]({'where':{'id':_0x47eac2['WhatsappInteractionId']}})[_0x28401c(0x183)](function(_0x29beb5){const _0x2ddf9c=_0x28401c;_0x29beb5&&_0x29beb5['update']({'lastMsgAt':_0x47eac2[_0x2ddf9c(0x193)],'lastMsgDirection':_0x47eac2[_0x2ddf9c(0x172)][_0x2ddf9c(0x185)]()});})[_0x28401c(0x18d)](function(_0x50c3cf){console['error'](_0x50c3cf);});if(_0x47eac2[_0x28401c(0x172)]===_0x28401c(0x187)&&!_0x47eac2[_0x28401c(0x181)]){let _0x22914f;_0x18c3bf['WhatsappAccount'][_0x28401c(0x177)]({'where':{'id':_0x47eac2[_0x28401c(0x18c)]},'raw':!![]})['then'](function(_0xfaf89c){const _0x2520c4=_0x28401c;_0x22914f=_0xfaf89c;if(_0x22914f&&_0x22914f[_0x2520c4(0x186)])switch(_0x22914f['type']){case _0x2520c4(0x192):if(_0x22914f[_0x2520c4(0x18f)]&&_0x22914f['authToken']&&_0x22914f[_0x2520c4(0x17d)]){const _0x5c026e=new twilio(_0x22914f['accountSid'],_0x22914f[_0x2520c4(0x174)]);_0x5c026e[_0x2520c4(0x190)][_0x2520c4(0x18b)]({'body':_0x47eac2[_0x2520c4(0x16f)],'to':_0x2520c4(0x18a)+_0x47eac2[_0x2520c4(0x17d)],'from':'whatsapp:'+_0x22914f[_0x2520c4(0x17d)],'statusCallback':_0x22914f['remote']+_0x2520c4(0x17a)+_0x47eac2['id']+_0x2520c4(0x189)+_0x22914f[_0x2520c4(0x175)]})[_0x2520c4(0x183)](function(_0x6b93a9){const _0x39b115=_0x2520c4;if(_0x6b93a9[_0x39b115(0x179)])return _0x1b9a3c[_0x39b115(0x184)]({'messageId':_0x6b93a9[_0x39b115(0x179)]});})['catch'](function(_0x124f25){const _0x25f493=_0x2520c4;logger[_0x25f493(0x16e)](_0x25f493(0x194),_0x25f493(0x171),_0x25f493(0x192),util[_0x25f493(0x17c)](_0x124f25,{'showHidden':![],'depth':null}));});}else logger[_0x2520c4(0x16e)](_0x2520c4(0x194),'afterCreate','twilio',_0x2520c4(0x188));break;}});}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'};}module[a962_0x4df732(0x191)]['options']=options;
\ No newline at end of file
+const a962_0x619a=['direction','utf8mb4_unicode_ci','utf8mb4','WhatsappInteraction','/api/whatsapp/messages/','find','FULLTEXT','WhatsappAccountId','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','exports','WhatsappInteractionId','authToken','createdAt','lodash','api','create','util','error','inspect','secret','whatsapp_messages','WhatsappAccount','findOne','get','out','messageId','whatsapp:','then','accountSid','token','sid','toLowerCase','update','options','isNil','/status?token=','twilio','type'];(function(_0x1f3dfe,_0x3dffab){const _0x619aff=function(_0x459f15){while(--_0x459f15){_0x1f3dfe['push'](_0x1f3dfe['shift']());}};_0x619aff(++_0x3dffab);}(a962_0x619a,0x6e));const a962_0x459f=function(_0x1f3dfe,_0x3dffab){_0x1f3dfe=_0x1f3dfe-0x11f;let _0x619aff=a962_0x619a[_0x1f3dfe];return _0x619aff;};const a962_0x36959b=a962_0x459f,util=require(a962_0x36959b(0x137)),_=require(a962_0x36959b(0x134)),twilio=require('twilio'),logger=require('../../config/logger')(a962_0x36959b(0x135));function options(_0x119957){const _0x2b6520=a962_0x36959b;return{'sequelize':_0x119957,'tableName':_0x2b6520(0x13b),'paranoid':![],'indexes':[{'name':_0x2b6520(0x140),'fields':['messageId']},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0x2b6520(0x12c)}],'timestamps':!![],'hooks':{'afterCreate':function(_0x30c035){const _0x4d3ae4=_0x2b6520,_0x22b43c=_0x119957['models'],_0x4e9c64=_0x30c035[_0x4d3ae4(0x13e)]({'plain':!![]});(_0x4e9c64['direction'][_0x4d3ae4(0x11f)]()==='in'||_0x4e9c64[_0x4d3ae4(0x126)][_0x4d3ae4(0x11f)]()===_0x4d3ae4(0x13f)&&!_0x4e9c64[_0x4d3ae4(0x13a)]&&!_[_0x4d3ae4(0x122)](_0x4e9c64['UserId']))&&_0x22b43c[_0x4d3ae4(0x129)][_0x4d3ae4(0x13d)]({'where':{'id':_0x4e9c64[_0x4d3ae4(0x131)]}})[_0x4d3ae4(0x142)](function(_0x54604f){const _0x42d9d9=_0x4d3ae4;_0x54604f&&_0x54604f[_0x42d9d9(0x120)]({'lastMsgAt':_0x4e9c64[_0x42d9d9(0x133)],'lastMsgDirection':_0x4e9c64[_0x42d9d9(0x126)]['toLowerCase']()});})['catch'](function(_0x31e7bc){const _0x48f9ef=_0x4d3ae4;console[_0x48f9ef(0x138)](_0x31e7bc);});if(_0x4e9c64[_0x4d3ae4(0x126)]===_0x4d3ae4(0x13f)&&!_0x4e9c64[_0x4d3ae4(0x13a)]){let _0x3afd2f;_0x22b43c[_0x4d3ae4(0x13c)][_0x4d3ae4(0x12b)]({'where':{'id':_0x4e9c64[_0x4d3ae4(0x12d)]},'raw':!![]})['then'](function(_0x33bbc9){const _0x43446f=_0x4d3ae4;_0x3afd2f=_0x33bbc9;if(_0x3afd2f&&_0x3afd2f[_0x43446f(0x125)])switch(_0x3afd2f[_0x43446f(0x125)]){case _0x43446f(0x124):if(_0x3afd2f['accountSid']&&_0x3afd2f[_0x43446f(0x132)]&&_0x3afd2f['phone']){const _0x4be157=new twilio(_0x3afd2f[_0x43446f(0x143)],_0x3afd2f[_0x43446f(0x132)]);_0x4be157['messages'][_0x43446f(0x136)]({'body':_0x4e9c64['body'],'to':_0x43446f(0x141)+_0x4e9c64['phone'],'from':_0x43446f(0x141)+_0x3afd2f['phone'],'statusCallback':_0x3afd2f['remote']+_0x43446f(0x12a)+_0x4e9c64['id']+_0x43446f(0x123)+_0x3afd2f[_0x43446f(0x144)]})[_0x43446f(0x142)](function(_0x2f05d3){const _0x39cb8c=_0x43446f;if(_0x2f05d3[_0x39cb8c(0x145)])return _0x30c035['update']({'messageId':_0x2f05d3[_0x39cb8c(0x145)]});})['catch'](function(_0x5583c3){const _0x130677=_0x43446f;logger[_0x130677(0x138)](_0x130677(0x12e),'afterCreate',_0x130677(0x124),util[_0x130677(0x139)](_0x5583c3,{'showHidden':![],'depth':null}));});}else logger[_0x43446f(0x138)](_0x43446f(0x12e),'afterCreate',_0x43446f(0x124),_0x43446f(0x12f));break;}});}}},'charset':_0x2b6520(0x128),'collate':_0x2b6520(0x127)};}module[a962_0x36959b(0x130)][a962_0x36959b(0x121)]=options;
\ No newline at end of file