Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix(migration): add missing wavoipToken column in MySQL schema #1244

Conversation

AndersonSilvaCavalcante

Precisei executar a Evolution usando MySQL e tive problemas pois não conseguia criar uma instância devido a falta dessa coluna. Segue o log:
wpp_service | [Evolution API] v2.2.3 193 - Fri Feb 14 2025 14:51:54 LOG [SERVER] [string] HTTP - ON: 8080 agilizone_wpp_service | create instance { agilizone_wpp_service | instanceName: 'testando', agilizone_wpp_service | integration: 'WHATSAPP-BAILEYS', agilizone_wpp_service | token: '313E737BA2A2-405A-99E1-2ECBE714A077' agilizone_wpp_service | } agilizone_wpp_service | [Evolution API] v2.2.3 193 - Fri Feb 14 2025 14:52:23 ERROR [InstanceController] [string] agilizone_wpp_service | Invalid S.integrationSession.update() invocation in agilizone_wpp_service | /evolution/dist/main.js:161:10171 agilizone_wpp_service | agilizone_wpp_service | 158 ));let g="";d.bold&&(g+="*"),d.italic&&(g+="_"),d.underline&&(g+="~");let m=${g}${u}${g.split("").reverse().join("")};return d.url&&(m=d.children[0]?.text?[${m}] agilizone_wpp_service | 159 (${d.url}):${d.url}),m}async function l(d,u,g,m,h,y,w,S){for(let E of m){if(E.type==="text"){let b="";for(let C of E.content.richText){for(let N of C.children)b+=w(N);b+= agilizone_wpp_service | 160 }if(b=b.replace(/\*\*/g,"").replace(/__/,"").replace(/~~/,"").replace(/\n$/,""),b=b.replace(/\n$/,""),b.includes("[list]")){let C={number:s.split("@")[0],title:"",description:"",buttonText:"",footerText:"",sections:[]},N=b.match(/\[title\]([\s\S]*?)(?=\[description\])/),_=b.match(/\[description\]([\s\S]*?)(?=\[buttonText\])/),x=b.match(/\[buttonText\]([\s\S]*?)(?=\[footerText\])/),L=b.match(/\[footerText\]([\s\S]*?)(?=\[menu\])/);N&&(C.title=N[1].trim()),_&&(C.description=_[1].trim()),x&&(C.buttonText=x[1].trim()),L&&(C.footerText=L[1].trim());let W=b.match(/\[menu\]([\s\S]*?)\[\/menu\]/)?.[1];if(W){let G=W.match(/\[section\]([\s\S]*?)(?=\[section\]|\[\/section\]|\[\/menu\])/g);G&&G.forEach(K=>{let V=K.match(/title: (.*?)(?:\n|$)/)?.[1]?.trim(),$=K.match(/\[row\]([\s\S]*?)(?=\[row\]|\[\/row\]|\[\/section\]|\[\/menu\])/g),X={title:V,rows:$?.map(Cn=>({title:Cn.match(/title: (.*?)(?:\n|$)/)?.[1]?.trim(),description:Cn.match(/description: (.*?)(?:\n|$)/)?.[1]?.trim(),rowId:Cn.match(/rowId: (.*?)(?:\n|$)/)?.[1]?.trim()}))||[]};C.sections.push(X)})}await d.listMessage(C)}else if(b.includes("[buttons]")){let C={number:s.split("@")[0],thumbnailUrl:void 0,title:"",description:"",footer:"",buttons:[]},N=b.match(/\[thumbnailUrl\]([\s\S]*?)(?=\[title\])/),_=b.match(/\[title\]([\s\S]*?)(?=\[description\])/),x=b.match(/\[description\]([\s\S]*?)(?=\[footer\])/),L=b.match(/\[footer\]([\s\S]*?)(?=\[(?:reply|pix|copy|call|url))/);_&&(C.title=_[1].trim()),N&&(C.thumbnailUrl=N[1].trim()),x&&(C.description=x[1].trim()),L&&(C.footer=L[1].trim());let W={reply:/\[reply\]([\s\S]*?)(?=\[(?:reply|pix|copy|call|url)|$)/g,pix:/\[pix\]([\s\S]*?)(?=\[(?:reply|pix|copy|call|url)|$)/g,copy:/\[copy\]([\s\S]*?)(?=\[(?:reply|pix|copy|call|url)|$)/g,call:/\[call\]([\s\S]*?)(?=\[(?:reply|pix|copy|call|url)|$)/g,url:/\[url\]([\s\S]*?)(?=\[(?:reply|pix|copy|call|url)|$)/g};for(let[G,K]of Object.entries(W)){let V;for(;(V=K.exec(b))!==null;){let $=V[1].trim(),X={type:G};switch(G){case"pix":X.currency=$.match(/currency: (.*?)(?:\n|$)/)?.[1]?.trim(),X.name=$.match(/name: (.*?)(?:\n|$)/)?.[1]?.trim(),X.keyType=$.match(/keyType: (.*?)(?:\n|$)/)?.[1]?.trim(),X.key=$.match(/key: (.*?)(?:\n|$)/)?.[1]?.trim();break;case"reply":X.displayText=$.match(/displayText: (.*?)(?:\n|$)/)?.[1]?.trim(),X.id=$.match(/id: (.*?)(?:\n|$)/)?.[1]?.trim();break;case"copy":X.displayText=$.match(/displayText: (.*?)(?:\n|$)/)?.[1]?.trim(),X.copyCode=$.match(/copyCode: (.*?)(?:\n|$)/)?.[1]?.trim();break;case"call":X.displayText=$.match(/displayText: (.*?)(?:\n|$)/)?.[1]?.trim(),X.phoneNumber=$.match(/phone: (.*?)(?:\n|$)/)?.[1]?.trim();break;case"url":X.displayText=$.match(/displayText: (.*?)(?:\n|$)/)?.[1]?.trim(),X.url=$.match(/url: (.*?)(?:\n|$)/)?.[1]?.trim();break}Object.keys(X).length>1&&C.buttons.push(X)}}await d.buttonMessage(C)}else await d.textMessage({number:s.split("@")[0],delay:g?.delayMessage||1e3,text:b},!1);H("/message/sendText")}E.type==="image"&&(await d.mediaMessage({number:s.split("@")[0],delay:g?.delayMessage||1e3,mediatype:"image",media:E.content.url},null,!1),H("/message/sendMedia")),E.type==="video"&&(await d.mediaMessage({number:s.split("@")[0],delay:g?.delayMessage||1e3,mediatype:"video",media:E.content.url},null,!1),H("/message/sendMedia")),E.type==="audio"&&(await d.audioWhatsapp({number:s.split("@")[0],delay:g?.delayMessage||1e3,encoding:!0,audio:E.content.url},!1),H("/message/sendWhatsAppAudio"));let I=a(y,E.id);I&&await new Promise(b=>setTimeout(b,I*1e3))}if(console.log("input",h),h){if(h.type==="choice input"){let E="",I=h.items;for(let b of I)E+=\u25B6\uFE0F ${b.content} agilizone_wpp_service | → 161 ;if(E=E.replace(/\n$/,""),E.includes("[list]")){let b={number:s.split("@")[0],title:"",description:"",buttonText:"",footerText:"",sections:[]},C=E.match(/\[title\]([\s\S]*?)(?=\[description\])/),N=E.match(/\[description\]([\s\S]*?)(?=\[buttonText\])/),_=E.match(/\[buttonText\]([\s\S]*?)(?=\[footerText\])/),x=E.match(/\[footerText\]([\s\S]*?)(?=\[menu\])/);C&&(b.title=C[1].trim()),N&&(b.description=N[1].trim()),_&&(b.buttonText=_[1].trim()),x&&(b.footerText=x[1].trim());let L=E.match(/\[menu\]([\s\S]*?)\[\/menu\]/)?.[1];if(L){let W=L.match(/\[section\]([\s\S]*?)(?=\[section\]|\[\/section\]|\[\/menu\])/g);W&&W.forEach(G=>{let K=G.match(/title: (.*?)(?:\n|$)/)?.[1]?.trim(),V=G.match(/\[row\]([\s\S]*?)(?=\[row\]|\[\/row\]|\[\/section\]|\[\/menu\])/g),$={title:K,rows:V?.map(X=>({title:X.match(/title: (.*?)(?:\n|$)/)?.[1]?.trim(),description:X.match(/description: (.*?)(?:\n|$)/)?.[1]?.trim(),rowId:X.match(/rowId: (.*?)(?:\n|$)/)?.[1]?.trim()}))||[]};b.sections.push($)})}await d.listMessage(b)}else if(E.includes("[buttons]")){let b={number:s.split("@")[0],thumbnailUrl:void 0,title:"",description:"",footer:"",buttons:[]},C=E.match(/\[thumbnailUrl\]([\s\S]*?)(?=\[title\])/),N=E.match(/\[title\]([\s\S]*?)(?=\[description\])/),_=E.match(/\[description\]([\s\S]*?)(?=\[footer\])/),x=E.match(/\[footer\]([\s\S]*?)(?=\[(?:reply|pix|copy|call|url))/);N&&(b.title=N[1].trim()),C&&(b.thumbnailUrl=C[1].trim()),_&&(b.description=_[1].trim()),x&&(b.footer=x[1].trim());let L={reply:/\[reply\]([\s\S]*?)(?=\[(?:reply|pix|copy|call|url)|$)/g,pix:/\[pix\]([\s\S]*?)(?=\[(?:reply|pix|copy|call|url)|$)/g,copy:/\[copy\]([\s\S]*?)(?=\[(?:reply|pix|copy|call|url)|$)/g,call:/\[call\]([\s\S]*?)(?=\[(?:reply|pix|copy|call|url)|$)/g,url:/\[url\]([\s\S]*?)(?=\[(?:reply|pix|copy|call|url)|$)/g};for(let[W,G]of Object.entries(L)){let K;for(;(K=G.exec(E))!==null;){let V=K[1].trim(),$={type:W};switch(W){case"pix":$.currency=V.match(/currency: (.*?)(?:\n|$)/)?.[1]?.trim(),$.name=V.match(/name: (.*?)(?:\n|$)/)?.[1]?.trim(),$.keyType=V.match(/keyType: (.*?)(?:\n|$)/)?.[1]?.trim(),$.key=V.match(/key: (.*?)(?:\n|$)/)?.[1]?.trim();break;case"reply":$.displayText=V.match(/displayText: (.*?)(?:\n|$)/)?.[1]?.trim(),$.id=V.match(/id: (.*?)(?:\n|$)/)?.[1]?.trim();break;case"copy":$.displayText=V.match(/displayText: (.*?)(?:\n|$)/)?.[1]?.trim(),$.copyCode=V.match(/copyCode: (.*?)(?:\n|$)/)?.[1]?.trim();break;case"call":$.displayText=V.match(/displayText: (.*?)(?:\n|$)/)?.[1]?.trim(),$.phoneNumber=V.match(/phone: (.*?)(?:\n|$)/)?.[1]?.trim();break;case"url":$.displayText=V.match(/displayText: (.*?)(?:\n|$)/)?.[1]?.trim(),$.url=V.match(/url: (.*?)(?:\n|$)/)?.[1]?.trim();break}Object.keys($).length>1&&b.buttons.push($)}}await d.buttonMessage(b)}else await d.textMessage({number:s.split("@")[0],delay:g?.delayMessage||1e3,text:E},!1);H("/message/sendText")}await S.integrationSession.update(

wpp_service | The column wavoipToken does not exist in the current database.

@DavidsonGomes DavidsonGomes changed the base branch from main to develop February 14, 2025 21:03
@nestordavalos
Copy link
Contributor

nestordavalos commented Feb 14, 2025

Isso não é mais o caso, pois a fusão já foi feita aqui? da72edf

@AndersonSilvaCavalcante
Copy link
Author

Isso não é mais o caso, pois a fusão já foi feita aqui? da72edf

Estava usando a main, vi que o commit ai foi na develop. Estarei fechando o PR, ok?

@DavidsonGomes DavidsonGomes merged commit 8f632a6 into EvolutionAPI:develop Feb 16, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants