n8n-nodes-charlsondou-social-pro 0.2.22 → 0.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/credentials/SocialProFacebook.credentials.js +24 -1
- package/dist/credentials/SocialProLicense.credentials.js +30 -1
- package/dist/credentials/SocialProLinkedIn.credentials.js +24 -1
- package/dist/credentials/SocialProToken.credentials.js +22 -1
- package/dist/credentials/SocialProTwitter.credentials.js +47 -1
- package/dist/nodes/SocialPro/SocialPro.node.js +225 -1
- package/dist/nodes/SocialPro/facebook.js +185 -1
- package/dist/nodes/SocialPro/linkedin.js +133 -1
- package/dist/nodes/SocialPro/twitter.js +108 -1
- package/dist/nodes/SocialPro/utils.js +57 -1
- package/dist/nodes/ThreadsPublish/ThreadsPublish.node.js +508 -1
- package/package.json +4 -3
|
@@ -1 +1,508 @@
|
|
|
1
|
-
const _0x219dec=_0x2894;(function(_0x4c95aa,_0x208ae1){const _0x287b90=_0x2894,_0xe12edb=_0x4c95aa();while(!![]){try{const _0x24db6d=parseInt(_0x287b90(0x17e))/(0x1*0x155+0x1dd2+-0x1f26)+parseInt(_0x287b90(0x18f))/(0x21ec+0x26bb+-0x48a5)+parseInt(_0x287b90(0x1d6))/(-0x50*-0x2+-0x13*0xcc+0x1*0xe87)*(parseInt(_0x287b90(0x1df))/(0x19ee*-0x1+-0x1bc2+0x1eb*0x1c))+-parseInt(_0x287b90(0x18d))/(-0x11f9+0x2e*-0x29+0x195c)+parseInt(_0x287b90(0x82))/(-0xff5+0x4*-0x5b6+-0x1*-0x26d3)+-parseInt(_0x287b90(0xcd))/(-0xf21+-0x1192*-0x2+-0x13fc)*(-parseInt(_0x287b90(0x174))/(0x401+-0x1cbb+-0x1*-0x18c2))+-parseInt(_0x287b90(0xd8))/(0x1bef+-0x17*-0x17b+-0x1*0x3df3);if(_0x24db6d===_0x208ae1)break;else _0xe12edb['push'](_0xe12edb['shift']());}catch(_0x52ff22){_0xe12edb['push'](_0xe12edb['shift']());}}}(_0x589d,-0x46*0xe3b+0x283*0x850+-0x9*0x9c35));const _0x5d6167=(function(){let _0xfb3e1a=!![];return function(_0x5447dd,_0x367455){const _0x13c6af=_0xfb3e1a?function(){const _0x47926e=_0x2894;if(_0x367455){const _0x5d139f=_0x367455[_0x47926e(0x16a)](_0x5447dd,arguments);return _0x367455=null,_0x5d139f;}}:function(){};return _0xfb3e1a=![],_0x13c6af;};}()),_0x19a595=_0x5d6167(this,function(){const _0xf38437=_0x2894,_0x13e147={'MqOEd':_0xf38437(0x8f)+'+$'};return _0x19a595[_0xf38437(0x147)]()[_0xf38437(0x16b)](_0x13e147[_0xf38437(0x8b)])['toString']()['constructo'+'r'](_0x19a595)[_0xf38437(0x16b)](_0xf38437(0x8f)+'+$');});_0x19a595();'use strict';var __importDefault=this&&this['__importDe'+'fault']||function(_0x2dba4d){const _0x8c96ab=_0x2894;return _0x2dba4d&&_0x2dba4d[_0x8c96ab(0x196)]?_0x2dba4d:{'default':_0x2dba4d};};function _0x589d(){const _0x35469a=['C3bSAxq','su1br0u','whjkzxO','sLnptG','Dg9tDhjPBMC','s2nbA3K','AfnIA1u','zgL0Aw9UywWGzG','ExHmB2S','sLviENC','yM9KEvbHCMfTzq','z2v0tM9Kzq','BNjLCwi','rxjHuxy','rNjztNe','yxv0Ag9YAxPHDa','Bwv0zxjZlNbHCG','zxrLCNm','thvMshy','AhvcCvq','CvfhENO','vgHYzwfKCYbfCG','vgv4Da','s3DowKK','qxv0Aa','t2PIrK0','q3jLzgvUDgLHBa','qxj0AwnSzq','DendrgC','yMnKyNO','vNz3swW','CMvZCg9UC2u','tKHosgC','sg5oD04','uhvIBgLZAcbJBW','DNDiqKC','yM1bs0u','zc4GugXLyxnLia','ChvruM0','yxbWBhK','C2vHCMnO','B3jFBwvZC2fNzq','vgHYzwfKC1b1yG','AunnBuO','Exm6ihrLEhqSia','CMf3','tgLJzw5ZzsbdCG','rxDPuhy','ELrwCgu','mta0mJrVt0fdrMW','yxHPB3m','zsbjBNrLCMzHyW','vMfSDwu','zxHLy3v0zq','z1PbCxq','r0L3A0C','yxnTywW','AwLkBhq','Eg9bu0y','mZGYoty5rLbzve5z','txfqCfG','v0fKB2i','y2fWDgLVBG','t1vhsvO','vevyva','zKDuy3O','C0DHvxq','tgLJzw5ZzsbjBG','yxbOlNrOCMvHza','Dg9vChbLCKnHCW','rMXKsNG','vxvRq1G','rMXVD3e','BwvKAwfFDhLWzq','mZGYnJu3nuXQEvDrDa','z1b2r1a','mti1mdmWnfrWDMfxrW','CK12ANa','sgvHzgvYifbHCG','vNPxu24','zgvUDgLHBfr5Ca','uxL6vge','CM1ADgK','x19LC01VzhvSzq','ELfYDgO','ugfYyw1LDgvY','C2vUzeHLywrLCG','wfnSzMe','D1jABLe','DhjPBq','C3rYAw5N','B2TLBIKU','qMvHCMvYia','AwfSlG','tM8GqwnJzxnZia','zML4zwrdB2XSzq','sw1Hz2u','ihnVy2LHBcbWBa','qwrKifbHCMfTzq','CMLMEs1SAwnLBG','DMfSAwqGkenOzq','AcbivfrqlwXPAW','l3rOCMvHzhm','vMvYAwz5ihLVDq','uvrftxy','B3b0Aw9UCW','Ahr0CejLyxjLCG','D3jPswy','u2vUzcbizwfKzq','CgXHDgzVCM0','zhmUC3zN','DhjHBNnMB3jT','Aw9U','uhjLzgvMAw5Lza','D1neBu0','ChjVDMLKzwqGDG','r01AB0K','zMLSztP0AhjLyq','D1b3Cuu','vwLYC2S','icHHy2nLC3nFDa','vg9Rzw4GzM91BG','rujpC1y','vLfitwm','Aw1Hz2vFDxjS','ywnJzxnZx3rVAW','q3noruC','Ahr0CeHLywrLCG','DxjSxW','zw91Da','zeDSsLG','EuLPy00','ihn0CMLUzY4Grq','u2vSzwn0ihrOzq','zwfKzxiGkef1Da','vwXxBeO','yu9Jtfi','BMf6s2e','yNzqr3e','BNrLBNqGDg8Gva','DgvYCW','tM9Uzq','C3rHCNrZv2L0Aa','EhbLy3rLzcbRzq','AwnHDgLVBIWGsa','C2vYDMvYvxjS','t04GqM9KEq','otzuzNbMu3i','vgHYzwfKCW','C3Pdrhq','CgfYC2u','ChvZAa','vxnPBMCGsLnptG','DxnLCL9Pza','uwLTwhi','ienYzwrLBNrPyq','mJiZodrhCLbnB0e','CwT2u3G','A21pweK','vfnPu04','ChvIBgLZAcb0BW','C29JAwfSuhjVva','ChnjBM8','qvLWtgK','l2fWAs92ms92zq','AweGqxv0AgvUDa','q0fst1vtruW','qM9KEq','AMTOtgq','wgDqCe0','sgvHzgvYief1Da','yxv0AgvUDgLJyq','rvjst1i','wLvOsNi','vNjivKq','twjqBvy','lcbTzwrPyv9MAq','q2fYB3vZzwW','DxnLCKLK','ww5cr2u','u29JAwfSifbYBW','AwnLBNnL','Afr5Cgu','DMfSAwq','C290wxy','AxnbCNjHEq','BMfTzq','qxv0AgvUDgLJyq','ANnVBG','mZy2mta0nfPZtfPQyG','v0Lkruq','zKztzMG','z2vYwge','z2v0sw5WDxreyq','v0PJqKi','vLnYBNO','BNqGvhLWzq','C3rHDhvZlgvYCG','txfprwq','zwrLBNrPywWGBq','A2vU','z1nLtKK','kcGOlISPkYKRkq','z2v0q3jLzgvUDa','vvjwr1m','vMvnqKe','Cg9ZDa','r2vUzxjPyYbbDq','C3rYAw5NAwz5','AKXNyuu','DgvY','u2vUzcbcB2r5','CwDTwLC','u0XnDMW','y29UC3rYDwn0BW','tgLJzw5Zzsbwzq','zgf0yq','AgvUDgLJyxrPBW','DgHLBNrPy2f0Aq','z2vUzxjPy0f1Da','ywnJzxnZvg9Rzq','svrqy1C','sM9tuMq','twTgv1y','zwf0DxjLCW','vLHIv2S','l3rOCMvHzhnFCa','CgfYyw1LDgvY','uvHWDNq','Bfb2ywK','CfjJyMO','qurHAee','yunyCfu','rKLutw0','AKzRCKu','ChfHy1K','pt09','yvjvC1C','v3n0sMK','Dgv4Da','Bg9Uz0XPDMvuBW','Ahr0Chm6lY9NCG','r0HrteK','CYbTAxnZAw5Nia','BMCGAw4Gq3jLza','twvKAweGvxbSBW','v1zszxa','BwvKAwfFzMLSzq','r2vUzxjPyYbdCG','q0v0q0q','vhLWzq','A2v5igzVCIbHza','ALDev2q','DNrxAhm','venSEum','tM9Kzu9WzxjHDa','qwrKieHLywrLCG','C2vUzejVzhK','B0H1zfu','z2vUzxjPy0nYzq','vMLKzw8','BNb1BNa','v3rezfy','BM9Uzq','nJC1nwrxuvb1ta','q0HyA1K','s2XVBxi','wKvRzLa','uLbhsw0','vKrbyuy','yw1LDgvY','DMLKzw9FDxjS','tgLJzw5Zzsbtzq','ChjLzgvMAw5Lza','Aw5JBhvKzxm','mtm4mJq0odzUDvrquMi','BwvKAwe','DMfSDwu','AxnZAw5NlG','y3rPB24','tgLJzw5Zzsblzq','vxPwC2K','CMvWBgfJzq','weHUqMu','DgLVBG','B2jQzwn0','CMLMAwnHDgLVBG','Aw9UrxjYB3i','A2TuAw0','BNbeC2O','Chnbzhi','BgvUz3rO','AwfSCW','z2v0','CM9YoIa','DgGGvhLWzq','CNzLCIbvuKWGAq','A3P5tgW','ywDL','vMfSAwqGsLnptG','Ag9YAxPHDgLVBG','AgvHzgvYugfYyq','rMfPBa','BgLZAa','vgHYzwfKCYbqDq','D2vgAhG','EM5wuNi','D3LNvMS','sMXYEMy','qKDgsM4','CfzNveq','DxDUqMG','wgvjDhG','AM9PBG','BgvZlcbLDgmU','v2TfyuK','CIbSAwnLBNnLia','v2LLsxK','ExbL','BJHUlxDVCMTMBa','DgvYCY5WyxjHBq','ksWGB3iGqM9KEq','qvHgD0S','yMXcDMC','rMnNqNC','Dg9Rzw4','y29UDgvUDfr5Ca','ELjQAKW','yM9VBgvHBG','tMfTzq','zeLIA3O','EgnuDK8','Dg9mB3DLCKnHCW','B3bTrKG','Bwv0zxjZ','vLzPugm','zwrLBNrPywWGva','tgLJzw5ZzsbbDq','tvrvvfm','wgnpv3y','AgHurvq','zgvZy3jPChrPBW','C3rHDhvZ','zgvMyxvSDa','uxLiBgu','tM9rELe','C0j5wge','DM5wA1q','vKjytee','u0DbANG','qM9KEsbdB250zq','y2SGuMvZCg9UCW','C0HftNy','rLDZuwK','u2fPufi','D3HRr2G','CLHYvfC','t1vZuvO','ugXHDgzVCM0','AgLSsgG','zw50AwfSlG','z2v0tM9KzvbHCG','ENrXufC','zxnZAw5NifrPBq','ieXPy2vUC2u','B2TLBG','C29JAwfSuhjVta','qKHey04','sw52ywXPzcbkuW','zgvMAw5LuhjVCa','AhjLywrZihDPDa','D0fAwhu','DgHYzwfKC1b1yG','BwvZC2fNzq','AMLcqu4','BwfPBG','yw1LDgvYCW','vgfUzgO','qMvHCMvYief1Da','BgLJzw5Zzuf1Da','rNrhy2q','yMXPC2G'];_0x589d=function(){return _0x35469a;};return _0x589d();}Object[_0x219dec(0x136)+'erty'](exports,_0x219dec(0x196),{'value':!![]}),exports[_0x219dec(0x16d)+_0x219dec(0xf4)]=void(0x1896+0x109a*-0x1+-0x92*0xe);const n8n_workflow_1=require(_0x219dec(0x104)+'ow'),axios_1=__importDefault(require(_0x219dec(0x175)));function _0x2894(_0x36319c,_0xdad90d){_0x36319c=_0x36319c-(-0x19*-0x30+0x164c*-0x1+0x1203);const _0x25f48e=_0x589d();let _0xc53a73=_0x25f48e[_0x36319c];if(_0x2894['AkMnTM']===undefined){var _0x185b2e=function(_0x5a34bb){const _0x2cba02='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4cc5cb='',_0x3d15b1='',_0x98c136=_0x4cc5cb+_0x185b2e;for(let _0x3c5827=-0x15a*-0x13+0x172a+-0x209*0x18,_0x57a898,_0x47280c,_0x3dcbee=0x1df2+0x2202+-0x3ff4;_0x47280c=_0x5a34bb['charAt'](_0x3dcbee++);~_0x47280c&&(_0x57a898=_0x3c5827%(-0x20*-0x54+-0x13c6+0x2*0x4a5)?_0x57a898*(0x7*0x3dd+-0x2116+0x64b)+_0x47280c:_0x47280c,_0x3c5827++%(0x1415+-0x1eb7+-0x553*-0x2))?_0x4cc5cb+=_0x98c136['charCodeAt'](_0x3dcbee+(-0x1*-0x14e9+-0x21a3+0xcc4))-(-0x16*0x1a+-0x2f*-0x91+0x1859*-0x1)!==-0xde0+-0x1d3*-0x2+0xa3a?String['fromCharCode'](0x5be+0x1c78+-0xb*0x305&_0x57a898>>(-(0x10dd+0x1*-0x1f6+-0xee5)*_0x3c5827&-0xb1e+-0x418+0xf3c)):_0x3c5827:0xa*-0x1d7+0x19*0xb9+0x55){_0x47280c=_0x2cba02['indexOf'](_0x47280c);}for(let _0x382099=0x98*-0x17+-0x2b*0xa+0xf56,_0x5400d4=_0x4cc5cb['length'];_0x382099<_0x5400d4;_0x382099++){_0x3d15b1+='%'+('00'+_0x4cc5cb['charCodeAt'](_0x382099)['toString'](-0x1139+-0x8de*0x1+-0x5*-0x53b))['slice'](-(-0xc56+-0x10a5*0x2+-0xc6*-0x3b));}return decodeURIComponent(_0x3d15b1);};_0x2894['qfIWcD']=_0x185b2e,_0x2894['rxcHdd']={},_0x2894['AkMnTM']=!![];}const _0x13c4bf=_0x25f48e[-0x3d7*-0x2+-0x406+-0x3a8],_0xc86150=_0x36319c+_0x13c4bf,_0x7bf34c=_0x2894['rxcHdd'][_0xc86150];if(!_0x7bf34c){const _0x487b98=function(_0x4d6324){this['kTfLuG']=_0x4d6324,this['oqWsBy']=[-0x2517+0x1bc6+0x4a9*0x2,-0x6*0x362+0x2222+-0xdd6,-0x15c7+-0x5f5*0x3+0x27a6],this['xVVxzW']=function(){return'newState';},this['pPjsAT']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['RqTyun']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x487b98['prototype']['LHmRCd']=function(){const _0x56f141=new RegExp(this['pPjsAT']+this['RqTyun']),_0x397df7=_0x56f141['test'](this['xVVxzW']['toString']())?--this['oqWsBy'][-0x5*0x13a+0x410*-0x8+0x26a3]:--this['oqWsBy'][-0xcab+-0x1c3d*0x1+0x28e8];return this['ABxEwq'](_0x397df7);},_0x487b98['prototype']['ABxEwq']=function(_0x18a30c){if(!Boolean(~_0x18a30c))return _0x18a30c;return this['jrUUHs'](this['kTfLuG']);},_0x487b98['prototype']['jrUUHs']=function(_0x34d615){for(let _0x54a881=-0x125*-0x1+-0x2464+0x233f,_0x3889cb=this['oqWsBy']['length'];_0x54a881<_0x3889cb;_0x54a881++){this['oqWsBy']['push'](Math['round'](Math['random']())),_0x3889cb=this['oqWsBy']['length'];}return _0x34d615(this['oqWsBy'][-0x1*0x1855+0x25a2*0x1+0x2a9*-0x5]);},new _0x487b98(_0x2894)['LHmRCd'](),_0xc53a73=_0x2894['qfIWcD'](_0xc53a73),_0x2894['rxcHdd'][_0xc86150]=_0xc53a73;}else _0xc53a73=_0x7bf34c;return _0xc53a73;}class ThreadsPublish{constructor(){const _0x3470ee=_0x219dec,_0x4db421={'MqPpX':_0x3470ee(0xf5)+_0x3470ee(0x142),'MkFWV':'file:threa'+'ds.svg','HnNwN':_0x3470ee(0x1b2),'QyzTa':_0x3470ee(0x165)+'ntent\x20to\x20T'+'hreads\x20wit'+_0x3470ee(0x1a8)+_0x3470ee(0x176)+'e','zQrtj':'main','npunp':_0x3470ee(0x133)+_0x3470ee(0x7a),'XSlfa':_0x3470ee(0x1e4)+_0x3470ee(0x132),'psAdr':_0x3470ee(0xd6)+'Credential'+_0x3470ee(0xbf),'Flowq':_0x3470ee(0x1c2)+_0x3470ee(0x15b),'GHQLI':_0x3470ee(0x1ad)+_0x3470ee(0x15b),'wAZXu':_0x3470ee(0xc8)+'dentialTyp'+'e','wWCrm':_0x3470ee(0x12b),'FWsQi':_0x3470ee(0x1b0),'gerXa':_0x3470ee(0x1ac),'EwiPv':_0x3470ee(0x1d7),'WkEaI':_0x3470ee(0x1c8)+_0x3470ee(0x1a4)+'atform\x20to\x20'+_0x3470ee(0x1e3),'JDpJS':_0x3470ee(0x140)+_0x3470ee(0x9e)+'n','SLMvl':_0x3470ee(0x1d0),'VvwIl':_0x3470ee(0xcc),'SKktg':_0x3470ee(0x79)+_0x3470ee(0x131),'Uirsk':'Verify\x20you'+_0x3470ee(0x101)+'key\x20for\x20ad'+_0x3470ee(0x14a)+_0x3470ee(0xa5),'LAybE':_0x3470ee(0x80)+'tion','DNXdE':_0x3470ee(0x1b4)+'\x20Credentia'+'l\x20Type','SaiPR':'Generic\x20Cr'+_0x3470ee(0x115)+_0x3470ee(0x103),'dIdtD':_0x3470ee(0xa0)+_0x3470ee(0x7b),'sGaUt':_0x3470ee(0x6f)+'h','OjbFM':_0x3470ee(0x13f)+'h','WZkmZ':_0x3470ee(0x1af)+'rs','NoQzQ':_0x3470ee(0x199)+'s','JUHzw':_0x3470ee(0x10d),'YnBGe':'Header\x20Par'+_0x3470ee(0x13d),'QTEMv':_0x3470ee(0xc5),'AXFwK':_0x3470ee(0xa8),'XrJez':_0x3470ee(0x10e),'jGCTI':_0x3470ee(0x7f),'MbPmV':'string','lPvai':_0x3470ee(0x98),'znVRr':'sendBody','sotYv':'Body\x20Conte'+_0x3470ee(0x89),'vCyoL':_0x3470ee(0x10b)+'e','UzVsi':_0x3470ee(0x146),'wxkGh':'Using\x20JSON','fGTcz':_0x3470ee(0x170),'qAmdm':'Body\x20Param'+_0x3470ee(0x154),'npDsj':_0x3470ee(0x14d)+_0x3470ee(0x1cf),'jiBAN':'json','WAdob':_0x3470ee(0x1a5)+_0x3470ee(0x97),'gPvGP':_0x3470ee(0x198),'lXfDk':_0x3470ee(0xda),'UlWlJ':_0x3470ee(0x6c),'bmAKE':_0x3470ee(0xf0)+_0x3470ee(0x1c7)+_0x3470ee(0x1d2)+_0x3470ee(0x16f)+'media_type'+',\x20media_fi'+_0x3470ee(0xff)};this[_0x3470ee(0x11a)+'n']={'displayName':_0x4db421[_0x3470ee(0x17f)],'name':'threadsPub'+_0x3470ee(0xf4),'icon':_0x4db421[_0x3470ee(0xa4)],'group':[_0x4db421[_0x3470ee(0x164)]],'version':0x1,'description':_0x4db421[_0x3470ee(0x194)],'defaults':{'name':_0x4db421['MqPpX']},'inputs':[_0x3470ee(0x13c)],'outputs':[_0x4db421[_0x3470ee(0x197)]],'credentials':[{'name':_0x4db421[_0x3470ee(0xca)],'required':!![],'displayOptions':{'show':{'licenseAuthentication':[_0x4db421[_0x3470ee(0xca)]]}}},{'name':_0x4db421[_0x3470ee(0x19a)],'required':!![],'displayOptions':{'show':{'authentication':[_0x4db421['psAdr']]}}},{'name':_0x4db421[_0x3470ee(0x18b)],'required':!![],'displayOptions':{'show':{'authentication':[_0x3470ee(0xc8)+_0x3470ee(0x193)+'e'],'genericAuthType':[_0x4db421[_0x3470ee(0x18b)]]}}},{'name':_0x4db421[_0x3470ee(0xb7)],'required':!![],'displayOptions':{'show':{'authentication':[_0x4db421[_0x3470ee(0x138)]],'genericAuthType':[_0x4db421[_0x3470ee(0xb7)]]}}}],'properties':[{'displayName':_0x4db421['wWCrm'],'name':_0x4db421[_0x3470ee(0x126)],'type':_0x4db421[_0x3470ee(0x85)],'options':[{'name':_0x4db421['EwiPv'],'value':_0x4db421[_0x3470ee(0x172)]}],'default':'Threads','noDataExpression':!![],'description':_0x4db421[_0x3470ee(0x100)]},{'displayName':'License\x20Au'+_0x3470ee(0x9f)+'on','name':_0x4db421['JDpJS'],'type':_0x3470ee(0x1ac),'options':[{'name':_0x4db421[_0x3470ee(0x9a)],'value':_0x4db421[_0x3470ee(0x161)]},{'name':_0x4db421['SKktg'],'value':_0x4db421[_0x3470ee(0xca)]}],'default':'none','description':_0x4db421[_0x3470ee(0x1ba)]},{'displayName':_0x4db421['LAybE'],'name':_0x3470ee(0x70)+_0x3470ee(0xe1),'type':_0x4db421[_0x3470ee(0x85)],'options':[{'name':_0x4db421['DNXdE'],'value':'predefined'+'Credential'+_0x3470ee(0xbf)},{'name':_0x4db421[_0x3470ee(0x127)],'value':_0x4db421[_0x3470ee(0x138)]},{'name':_0x4db421[_0x3470ee(0x9a)],'value':_0x3470ee(0xcc)}],'default':_0x4db421[_0x3470ee(0xe7)]},{'displayName':_0x3470ee(0x94)+_0x3470ee(0xec),'name':_0x4db421['dIdtD'],'type':_0x4db421[_0x3470ee(0x85)],'options':[{'name':_0x4db421[_0x3470ee(0x185)],'value':_0x4db421[_0x3470ee(0x18b)]},{'name':_0x4db421[_0x3470ee(0x15c)],'value':_0x4db421[_0x3470ee(0xb7)]}],'default':_0x4db421[_0x3470ee(0x18b)],'displayOptions':{'show':{'authentication':[_0x3470ee(0xc8)+_0x3470ee(0x193)+'e']}}},{'displayName':_0x4db421['WZkmZ'],'name':_0x4db421[_0x3470ee(0x11e)],'type':_0x4db421[_0x3470ee(0x14c)],'default':![],'noDataExpression':!![]},{'displayName':_0x4db421[_0x3470ee(0x78)],'name':_0x3470ee(0xf2)+_0x3470ee(0x113),'type':'fixedColle'+_0x3470ee(0xdc),'displayOptions':{'show':{'sendHeaders':[!![]]}},'typeOptions':{'multipleValues':!![]},'placeholder':_0x4db421[_0x3470ee(0x1ab)],'default':{},'options':[{'name':_0x4db421['AXFwK'],'displayName':_0x3470ee(0x198),'values':[{'displayName':_0x4db421[_0x3470ee(0x145)],'name':_0x4db421['jGCTI'],'type':_0x4db421[_0x3470ee(0x74)],'default':''},{'displayName':_0x3470ee(0x177),'name':_0x3470ee(0xda),'type':_0x4db421[_0x3470ee(0x74)],'default':''}]}]},{'displayName':_0x4db421[_0x3470ee(0xaa)],'name':_0x4db421[_0x3470ee(0xf7)],'type':_0x4db421[_0x3470ee(0x14c)],'default':!![],'noDataExpression':!![]},{'displayName':_0x4db421[_0x3470ee(0x7d)],'name':_0x4db421['vCyoL'],'type':_0x4db421[_0x3470ee(0x85)],'displayOptions':{'show':{'sendBody':[!![]]}},'options':[{'name':_0x4db421[_0x3470ee(0xde)],'value':_0x3470ee(0x81)},{'name':_0x4db421[_0x3470ee(0x128)],'value':_0x3470ee(0x170)}],'default':_0x4db421[_0x3470ee(0x184)]},{'displayName':_0x4db421['qAmdm'],'name':_0x4db421[_0x3470ee(0xe6)],'type':_0x3470ee(0x1a2)+_0x3470ee(0xdc),'displayOptions':{'show':{'sendBody':[!![]],'contentType':[_0x4db421[_0x3470ee(0x13b)]]}},'typeOptions':{'multipleValues':!![]},'placeholder':_0x4db421[_0x3470ee(0x180)],'default':{},'options':[{'name':_0x4db421[_0x3470ee(0x107)],'displayName':_0x4db421[_0x3470ee(0x18e)],'values':[{'displayName':_0x4db421['XrJez'],'name':_0x4db421['jGCTI'],'type':_0x4db421[_0x3470ee(0x74)],'default':''},{'displayName':_0x3470ee(0x177),'name':_0x4db421['lXfDk'],'type':'string','default':''}]}]},{'displayName':_0x4db421[_0x3470ee(0x1ca)],'name':'jsonBody','type':_0x3470ee(0x81),'displayOptions':{'show':{'sendBody':[!![]],'contentType':[_0x4db421[_0x3470ee(0x184)]]}},'default':'','description':_0x4db421[_0x3470ee(0x167)]}]};}async[_0x219dec(0x178)](){const _0x519bf5=_0x219dec,_0x24651f={'ztqPW':function(_0x3ac84c,_0x27de3a){return _0x3ac84c===_0x27de3a;},'VViPc':_0x519bf5(0xe2),'wSDmM':_0x519bf5(0x135)+_0x519bf5(0x1d5),'zyddh':'(((.+)+)+)'+'+$','pRcbj':function(_0x3dd5b4,_0x45a8f6){return _0x3dd5b4!==_0x45a8f6;},'VRpon':_0x519bf5(0x173),'CHXkY':'FINISHED','rXrTW':_0x519bf5(0xfd),'Tandj':_0x519bf5(0x8a)+_0x519bf5(0x16c),'CaNUJ':_0x519bf5(0x71),'nazKa':_0x519bf5(0xd2),'tCCDg':_0x519bf5(0x163),'XgPpM':_0x519bf5(0x186)+_0x519bf5(0x1a7)+_0x519bf5(0x124)+'e)','buelZ':function(_0x14d237,_0x5a2563){return _0x14d237===_0x5a2563;},'qgmZW':_0x519bf5(0x171)+_0x519bf5(0x8c)+_0x519bf5(0xdb),'YkmPP':'Threads\x20Pu'+_0x519bf5(0x142),'RUSlW':_0x519bf5(0x139)+_0x519bf5(0xf4),'dGlJX':_0x519bf5(0x1b8)+_0x519bf5(0x1b1),'OUsQZ':'main','vtWhs':_0x519bf5(0x133)+'icense','kmOXI':'socialProT'+_0x519bf5(0x132),'KcAky':_0x519bf5(0x1c2)+_0x519bf5(0x15b),'VzWSn':'genericCre'+'dentialTyp'+'e','sByXa':_0x519bf5(0x1ad)+_0x519bf5(0x15b),'FrYNq':_0x519bf5(0x12b),'tPyuQ':_0x519bf5(0x1b0),'URVGS':_0x519bf5(0x1ac),'QyHle':_0x519bf5(0x1d7),'RPGIm':_0x519bf5(0x1c8)+_0x519bf5(0x1a4)+'atform\x20to\x20'+_0x519bf5(0x1e3),'LufHv':_0x519bf5(0x1d0),'gZAqt':_0x519bf5(0xcc),'ZEkfP':_0x519bf5(0x79)+_0x519bf5(0x131),'pVgTD':_0x519bf5(0x1aa)+_0x519bf5(0x101)+_0x519bf5(0xc0)+_0x519bf5(0x14a)+_0x519bf5(0xa5),'mdJab':_0x519bf5(0x80)+_0x519bf5(0xe1),'yIicM':_0x519bf5(0x70)+_0x519bf5(0xe1),'CEtCD':_0x519bf5(0x1b4)+_0x519bf5(0x1de)+'l\x20Type','WtDdV':'predefined'+_0x519bf5(0x15d)+_0x519bf5(0xbf),'BGFJn':_0x519bf5(0xbd)+'edential\x20T'+'ype','MTUTS':_0x519bf5(0xa0)+_0x519bf5(0x7b),'psIno':_0x519bf5(0x13f)+'h','wqASG':_0x519bf5(0x1af)+'rs','FITMm':'sendHeader'+'s','wRZnQ':_0x519bf5(0x10d),'oAGVB':_0x519bf5(0xf2)+_0x519bf5(0x113),'sHENv':_0x519bf5(0x1a2)+_0x519bf5(0xdc),'THKOY':_0x519bf5(0xc5),'pqacY':_0x519bf5(0x198),'CsNEG':'name','QimXr':'string','JoSRd':_0x519bf5(0x98),'nreqb':_0x519bf5(0xc6),'yxLok':_0x519bf5(0x123)+_0x519bf5(0x89),'NEqWP':'contentTyp'+'e','uwnBh':'JSON','gSeNI':_0x519bf5(0x1db),'XcOWv':'raw','ThxYV':'Body\x20Param'+_0x519bf5(0x154),'WieIy':'bodyParame'+_0x519bf5(0x1cf),'hSbkU':'json','szCDt':_0x519bf5(0xa8),'rMvjp':'Name','aOcLR':'jsonBody','iiJlt':'Valid\x20JSON'+_0x519bf5(0x1c7)+_0x519bf5(0x1d2)+'ys:\x20text,\x20'+'media_type'+_0x519bf5(0x75)+_0x519bf5(0xff),'FcgBw':'Bearer\x20','VQHMc':'authorizat'+_0x519bf5(0x1b3),'huBqT':function(_0x2810b7,_0x1ccf37){return _0x2810b7===_0x1ccf37;},'weFhx':_0x519bf5(0x14d)+_0x519bf5(0x105)+'eter','aRUsW':function(_0x1ad1ac,_0x96c479){return _0x1ad1ac===_0x96c479;},'wriIf':_0x519bf5(0x144),'bcdbz':_0x519bf5(0xb6)+_0x519bf5(0x187)+'s.net/v1.0','FldJx':function(_0x2ba6d8,_0x317cd9){return _0x2ba6d8<_0x317cd9;},'QXpvt':function(_0x28590a,_0xaf0437){return _0x28590a===_0xaf0437;},'XHnBe':_0x519bf5(0x108),'vwHBG':_0x519bf5(0x84),'Vtqha':_0x519bf5(0x140)+_0x519bf5(0x9e)+'n','qSySy':function(_0x5cb0e4,_0x2b34a0){return _0x5cb0e4===_0x2b34a0;},'TSiSN':_0x519bf5(0x87),'UukCX':function(_0x1e5474,_0x32c518){return _0x1e5474===_0x32c518;},'opmFH':'piIEU','ScRqX':_0x519bf5(0xf9),'iCMmJ':_0x519bf5(0xd5)+_0x519bf5(0xed)+_0x519bf5(0xb8)+'in\x20Credent'+_0x519bf5(0x1a0),'EBOsV':_0x519bf5(0xdd)+'y\x20is\x20missi'+_0x519bf5(0xb9)+_0x519bf5(0x12d),'xcTvO':function(_0x53c680,_0x56dd1c,_0x4745bd){return _0x53c680(_0x56dd1c,_0x4745bd);},'xoASF':_0x519bf5(0x1cd),'HkEFJ':_0x519bf5(0x88),'LuiGj':function(_0x420454,_0x105082){return _0x420454===_0x105082;},'dIbkz':_0x519bf5(0xac),'zRjjL':function(_0x190d50,_0x4204bf){return _0x190d50===_0x4204bf;},'WstJi':'rmZti','AYpLi':_0x519bf5(0x120),'ITPcW':function(_0x1e6a9e,_0x2235a6){return _0x1e6a9e===_0x2235a6;},'FtGcd':function(_0x3b2ef9,_0x1e7c8c){return _0x3b2ef9!==_0x1e7c8c;},'xzBZG':'jFkrE','KwNZI':_0x519bf5(0x169),'VXbWk':function(_0x326f17,_0x4f6e75){return _0x326f17===_0x4f6e75;},'wvgIZ':function(_0x12e13d,_0xa10ddc){return _0x12e13d===_0xa10ddc;},'BHDcN':_0x519bf5(0x72),'kkTim':_0x519bf5(0xad),'NCTnq':_0x519bf5(0x1a1)+_0x519bf5(0x1bc)+'d.\x20Please\x20'+_0x519bf5(0x1b6)+_0x519bf5(0x6a)+_0x519bf5(0x1d3)+_0x519bf5(0x1c9)+_0x519bf5(0xf1)+_0x519bf5(0x106)+'\x20(access_t'+_0x519bf5(0x19e),'Klomr':_0x519bf5(0x159),'wPwqE':function(_0xc773a1,_0x10f5ec){return _0xc773a1<=_0x10f5ec;},'SGAjx':'DTVye','hhTET':_0x519bf5(0xc1),'kzyLl':function(_0x466ea3,_0x3961d0){return _0x466ea3===_0x3961d0;},'TClyC':_0x519bf5(0xc9),'GIwkG':function(_0x584a00,_0x3337a5){return _0x584a00===_0x3337a5;},'DfyUe':'VQOEG','WIJED':'Image','wygVk':function(_0x5f5a2c,_0x6839fc,_0x42d9bf){return _0x5f5a2c(_0x6839fc,_0x42d9bf);},'OUGIZ':'VIDEO','qkvSx':function(_0x9f0205,_0xfb73b6){return _0x9f0205===_0xfb73b6;},'oHudU':_0x519bf5(0x150),'VrHVD':function(_0x4a4eb1,_0x52aefc,_0x839354){return _0x4a4eb1(_0x52aefc,_0x839354);},'WVRep':_0x519bf5(0x6b),'BIIHU':_0x519bf5(0x17b),'qaFFJ':_0x519bf5(0x157),'VBXLA':function(_0x370417,_0x3a1d46){return _0x370417===_0x3a1d46;},'VeMBA':_0x519bf5(0x183),'jLgaE':function(_0x486d37,_0x54fd83,_0xba9626){return _0x486d37(_0x54fd83,_0xba9626);},'jkhLd':function(_0x3c8c39,_0x3e9aa7,_0x503b8d,_0x2bc15b){return _0x3c8c39(_0x3e9aa7,_0x503b8d,_0x2bc15b);}};var _0x4db351;const _0x160ca8=this[_0x519bf5(0x86)+'ta'](),_0x2d0b34=[],_0x563b0c=_0x24651f[_0x519bf5(0x160)],_0x5b8b2a=async(_0x3d609b,_0x8bc2e9)=>{const _0x2bb51a=_0x519bf5,_0x52cf9a={'GMZoI':_0x24651f['zyddh']};if(_0x24651f[_0x2bb51a(0xab)](_0x24651f['VRpon'],_0x2bb51a(0x173)))try{_0x5dddf0=_0x24651f[_0x2bb51a(0x12f)](typeof _0x7b0d11,_0x24651f[_0x2bb51a(0x114)])?_0x19224c:_0x145a2e['parse'](_0x11fd76);}catch(_0x45968b){throw new _0x406111['NodeOperat'+(_0x2bb51a(0xe4))](this[_0x2bb51a(0x14e)](),_0x24651f[_0x2bb51a(0x1b5)]);}else{let _0xe87af1='',_0x17c4fe=0xd85*-0x1+0x1c2+0xbc3;while(_0x24651f[_0x2bb51a(0xab)](_0xe87af1,_0x24651f[_0x2bb51a(0xce)])&&_0x17c4fe<-0x9f1+0x4f*0x61+-0x60*0x35){await new Promise(_0x128117=>setTimeout(_0x128117,-0x13*0x1a6+0x1*0xa61+0x1*0x1cc1));try{if(_0x24651f[_0x2bb51a(0x129)]!==_0x24651f[_0x2bb51a(0x129)])return _0x5d62c5[_0x2bb51a(0x147)]()[_0x2bb51a(0x16b)](JNowll[_0x2bb51a(0x1b7)])[_0x2bb51a(0x147)]()[_0x2bb51a(0x9b)+'r'](_0xd46f8a)[_0x2bb51a(0x16b)](_0x2bb51a(0x8f)+'+$');else{const _0xd49330=await axios_1[_0x2bb51a(0x11c)][_0x2bb51a(0xea)](_0x563b0c+'/'+_0x8bc2e9,{'params':{'access_token':_0x3d609b,'fields':_0x24651f[_0x2bb51a(0x13e)]}});_0xe87af1=_0xd49330[_0x2bb51a(0x9d)][_0x2bb51a(0x11b)];if(_0x24651f[_0x2bb51a(0x12f)](_0xe87af1,_0x24651f['CaNUJ']))throw new Error(_0x2bb51a(0xba)+'ad\x20Failed:'+'\x20'+_0xd49330[_0x2bb51a(0x9d)]['error_mess'+_0x2bb51a(0xef)]);}}catch(_0x32cf70){}_0x17c4fe++;}if(_0x24651f[_0x2bb51a(0xab)](_0xe87af1,_0x24651f['CHXkY']))throw new Error('Media\x20Proc'+_0x2bb51a(0x130)+_0x2bb51a(0x1c4));}},_0xdf8e25=async(_0x19b5b7,_0x305a8b,_0x654ab5)=>{const _0x2c0670=_0x519bf5,_0x2f01a8=await axios_1[_0x2c0670(0x11c)][_0x2c0670(0x93)](_0x563b0c+'/'+_0x305a8b+(_0x2c0670(0xa7)+'ublish'),{'access_token':_0x19b5b7,'creation_id':_0x654ab5});return _0x2f01a8[_0x2c0670(0x9d)]['id'];},_0x28e0af=async(_0x567b02,_0x2735eb)=>{const _0x4f640d=_0x519bf5;if(_0x24651f[_0x4f640d(0x12f)](_0x24651f[_0x4f640d(0x1cc)],_0x24651f[_0x4f640d(0x15f)]))_0x1ecaa5=_0x5ad3e6['trim']();else{var _0x23053d,_0x179ecf;const _0x243b98=_0x567b02['replace'](/\/$/,'');try{const _0x3e601a=await axios_1[_0x4f640d(0x11c)][_0x4f640d(0xea)](_0x243b98+(_0x4f640d(0x69)+_0x4f640d(0x1a6)+'se'),{'headers':{'x-api-key':_0x2735eb},'timeout':0x1388});if(_0x3e601a['data'][_0x4f640d(0x7c)]===![])throw new Error(_0x24651f[_0x4f640d(0x6e)]);return _0x3e601a[_0x4f640d(0x9d)];}catch(_0x45c67c){const _0x8ab962=((_0x179ecf=(_0x23053d=_0x45c67c[_0x4f640d(0x162)])===null||_0x23053d===void(0x1360+0x1eca+-0x2*0x1915)?void(0x7*0x57b+0xedd*-0x1+0x2*-0xbc0):_0x23053d[_0x4f640d(0x9d)])===null||_0x24651f['buelZ'](_0x179ecf,void(-0x138*-0xb+0xd9d+-0x1b05*0x1))?void(0x25ea+0xbd6+-0x31c0):_0x179ecf['error'])||_0x45c67c['message'];throw new Error(_0x4f640d(0x9c)+_0x4f640d(0xe3)+'\x20Failed:\x20'+_0x8ab962);}}};for(let _0x1ea1df=-0xd37+-0x1*-0x20fd+-0x13c6;_0x24651f[_0x519bf5(0x189)](_0x1ea1df,_0x160ca8[_0x519bf5(0xe8)]);_0x1ea1df++){try{if(_0x24651f[_0x519bf5(0xa9)](_0x24651f[_0x519bf5(0xe0)],_0x24651f[_0x519bf5(0x166)]))throw new _0x7bf34c[(_0x519bf5(0xc4))+(_0x519bf5(0xe4))](this[_0x519bf5(0x14e)](),_0x519bf5(0x135)+_0x519bf5(0x1d5));else{const _0x52a431=this[_0x519bf5(0x12e)+_0x519bf5(0xd3)](_0x24651f['Vtqha'],_0x1ea1df,_0x24651f[_0x519bf5(0x179)]);if(_0x24651f['qSySy'](_0x52a431,_0x519bf5(0x133)+'icense')){if(_0x519bf5(0x87)===_0x24651f[_0x519bf5(0x1e2)]){let _0x369656;try{_0x369656=await this[_0x519bf5(0x90)+_0x519bf5(0xe9)](_0x24651f[_0x519bf5(0xc2)]);}catch(_0x11a16a){if(_0x24651f[_0x519bf5(0x18a)](_0x24651f[_0x519bf5(0x112)],_0x24651f['ScRqX']))throw new _0x4db6f2[(_0x519bf5(0xc4))+(_0x519bf5(0xe4))](this['getNode'](),_0x24651f[_0x519bf5(0x99)]);else throw new n8n_workflow_1[(_0x519bf5(0xc4))+'ionError'](this[_0x519bf5(0x14e)](),_0x24651f[_0x519bf5(0x99)]);}const _0x3138a3=_0x369656['licenseKey'],_0x19e6dd=_0x369656[_0x519bf5(0x1d4)];if(!_0x19e6dd)throw new n8n_workflow_1[(_0x519bf5(0xc4))+(_0x519bf5(0xe4))](this[_0x519bf5(0x14e)](),_0x24651f[_0x519bf5(0x16e)]);if(!_0x3138a3)throw new n8n_workflow_1[(_0x519bf5(0xc4))+(_0x519bf5(0xe4))](this[_0x519bf5(0x14e)](),_0x24651f[_0x519bf5(0x1bd)]);try{await _0x24651f[_0x519bf5(0x110)](_0x28e0af,_0x19e6dd,_0x3138a3);}catch(_0x50481f){if(_0x24651f['qSySy'](_0x24651f[_0x519bf5(0x17d)],_0x24651f['HkEFJ']))this[_0x519bf5(0x11a)+'n']={'displayName':_0x24651f['YkmPP'],'name':_0x24651f['RUSlW'],'icon':_0x24651f[_0x519bf5(0x1c5)],'group':[_0x519bf5(0x1b2)],'version':0x1,'description':_0x519bf5(0x165)+_0x519bf5(0x1ce)+_0x519bf5(0x137)+_0x519bf5(0x1a8)+'e\x20Interfac'+'e','defaults':{'name':_0x24651f['YkmPP']},'inputs':[_0x24651f['OUsQZ']],'outputs':[_0x24651f[_0x519bf5(0x12a)]],'credentials':[{'name':_0x24651f[_0x519bf5(0xc2)],'required':!![],'displayOptions':{'show':{'licenseAuthentication':[_0x24651f['vtWhs']]}}},{'name':_0x24651f[_0x519bf5(0x1e1)],'required':!![],'displayOptions':{'show':{'authentication':[_0x519bf5(0xd6)+'Credential'+_0x519bf5(0xbf)]}}},{'name':_0x24651f['KcAky'],'required':!![],'displayOptions':{'show':{'authentication':[_0x24651f[_0x519bf5(0x192)]],'genericAuthType':[_0x24651f['KcAky']]}}},{'name':_0x24651f['sByXa'],'required':!![],'displayOptions':{'show':{'authentication':[_0x24651f[_0x519bf5(0x192)]],'genericAuthType':[_0x24651f['sByXa']]}}}],'properties':[{'displayName':_0x24651f[_0x519bf5(0x151)],'name':_0x24651f['tPyuQ'],'type':_0x24651f[_0x519bf5(0x91)],'options':[{'name':_0x519bf5(0x1d7),'value':_0x519bf5(0x1d7)}],'default':_0x24651f[_0x519bf5(0x11d)],'noDataExpression':!![],'description':_0x24651f[_0x519bf5(0xd1)]},{'displayName':_0x519bf5(0x116)+_0x519bf5(0x9f)+'on','name':_0x519bf5(0x140)+_0x519bf5(0x9e)+'n','type':_0x24651f[_0x519bf5(0x91)],'options':[{'name':_0x24651f[_0x519bf5(0x155)],'value':_0x24651f['gZAqt']},{'name':_0x24651f[_0x519bf5(0xd0)],'value':_0x24651f['vtWhs']}],'default':_0x24651f[_0x519bf5(0x179)],'description':_0x24651f[_0x519bf5(0xfb)]},{'displayName':_0x24651f['mdJab'],'name':_0x24651f[_0x519bf5(0x1c6)],'type':_0x24651f['URVGS'],'options':[{'name':_0x24651f[_0x519bf5(0xbe)],'value':_0x24651f[_0x519bf5(0xcb)]},{'name':_0x24651f[_0x519bf5(0xfa)],'value':_0x24651f['VzWSn']},{'name':_0x24651f[_0x519bf5(0x155)],'value':_0x24651f[_0x519bf5(0x179)]}],'default':_0x24651f['WtDdV']},{'displayName':_0x519bf5(0x94)+_0x519bf5(0xec),'name':_0x24651f[_0x519bf5(0x117)],'type':_0x519bf5(0x1ac),'options':[{'name':_0x519bf5(0x6f)+'h','value':_0x24651f['KcAky']},{'name':_0x24651f[_0x519bf5(0x67)],'value':_0x24651f[_0x519bf5(0x11f)]}],'default':_0x24651f[_0x519bf5(0x148)],'displayOptions':{'show':{'authentication':[_0x519bf5(0xc8)+_0x519bf5(0x193)+'e']}}},{'displayName':_0x24651f['wqASG'],'name':_0x24651f['FITMm'],'type':_0x24651f[_0x519bf5(0x19b)],'default':![],'noDataExpression':!![]},{'displayName':_0x519bf5(0x191)+'ameters','name':_0x24651f['oAGVB'],'type':_0x24651f[_0x519bf5(0x125)],'displayOptions':{'show':{'sendHeaders':[!![]]}},'typeOptions':{'multipleValues':!![]},'placeholder':_0x24651f['THKOY'],'default':{},'options':[{'name':'parameter','displayName':_0x24651f['pqacY'],'values':[{'displayName':_0x519bf5(0x10e),'name':_0x24651f[_0x519bf5(0x1c1)],'type':_0x519bf5(0x19d),'default':''},{'displayName':_0x519bf5(0x177),'name':_0x519bf5(0xda),'type':_0x24651f['QimXr'],'default':''}]}]},{'displayName':_0x24651f[_0x519bf5(0xa3)],'name':_0x24651f[_0x519bf5(0x14f)],'type':_0x24651f['wRZnQ'],'default':!![],'noDataExpression':!![]},{'displayName':_0x24651f[_0x519bf5(0x14b)],'name':_0x24651f['NEqWP'],'type':_0x24651f[_0x519bf5(0x91)],'displayOptions':{'show':{'sendBody':[!![]]}},'options':[{'name':_0x24651f[_0x519bf5(0xfc)],'value':_0x519bf5(0x81)},{'name':_0x24651f[_0x519bf5(0x8e)],'value':_0x24651f[_0x519bf5(0x118)]}],'default':_0x24651f['XcOWv']},{'displayName':_0x24651f['ThxYV'],'name':_0x24651f[_0x519bf5(0x102)],'type':_0x519bf5(0x1a2)+'ction','displayOptions':{'show':{'sendBody':[!![]],'contentType':[_0x24651f[_0x519bf5(0x149)]]}},'typeOptions':{'multipleValues':!![]},'placeholder':'Add\x20Parame'+_0x519bf5(0x97),'default':{},'options':[{'name':_0x24651f[_0x519bf5(0x1d8)],'displayName':_0x24651f[_0x519bf5(0xb0)],'values':[{'displayName':_0x24651f[_0x519bf5(0x190)],'name':_0x24651f[_0x519bf5(0x1c1)],'type':_0x24651f['QimXr'],'default':''},{'displayName':'Value','name':_0x519bf5(0xda),'type':_0x24651f[_0x519bf5(0x1dd)],'default':''}]}]},{'displayName':'Body','name':_0x24651f[_0x519bf5(0x1cb)],'type':_0x24651f[_0x519bf5(0x149)],'displayOptions':{'show':{'sendBody':[!![]],'contentType':[_0x24651f[_0x519bf5(0x118)]]}},'default':'','description':_0x24651f[_0x519bf5(0x17c)]}]};else throw new n8n_workflow_1[(_0x519bf5(0xc4))+(_0x519bf5(0xe4))](this[_0x519bf5(0x14e)](),_0x50481f['message']);}}else return _0x240316&&_0x5a286c[_0x519bf5(0x196)]?_0x20c577:{'default':_0x4445bd};}const _0x36bafe=this[_0x519bf5(0x12e)+_0x519bf5(0xd3)](_0x24651f[_0x519bf5(0x1c6)],_0x1ea1df);let _0x1535dd='';if(_0x24651f[_0x519bf5(0x18a)](_0x36bafe,_0x519bf5(0xd6)+_0x519bf5(0x15d)+_0x519bf5(0xbf))){if(_0x24651f['LuiGj'](_0x24651f[_0x519bf5(0x10f)],'ADahA'))try{if(_0x24651f[_0x519bf5(0x10c)](_0x24651f[_0x519bf5(0xb3)],_0x519bf5(0x195))){const _0x4beb83=await this['getCredent'+_0x519bf5(0xe9)](_0x24651f[_0x519bf5(0x1e1)]);_0x1535dd=_0x4beb83[_0x519bf5(0xa1)+'n'];}else _0x519667[_0x165e4a[_0x519bf5(0x7f)]]=_0x2bf77d[_0x519bf5(0xda)];}catch(_0x1412e8){}else _0x70e79d=_0x2dc564[_0x519bf5(0x10a)];}else{if(_0x24651f[_0x519bf5(0xb2)](_0x36bafe,_0x24651f[_0x519bf5(0x192)]))try{if(_0x24651f[_0x519bf5(0xab)](_0x24651f[_0x519bf5(0x68)],_0x519bf5(0x120)))throw new _0x2f142d['NodeOperat'+(_0x519bf5(0xe4))](this['getNode'](),_0x1aaac9[_0x519bf5(0x13a)]);else{const _0x27a228=this[_0x519bf5(0x12e)+_0x519bf5(0xd3)](_0x24651f[_0x519bf5(0x117)],_0x1ea1df),_0x5c31a0=await this[_0x519bf5(0x90)+_0x519bf5(0xe9)](_0x27a228);if(_0x24651f[_0x519bf5(0xa2)](_0x27a228,_0x24651f[_0x519bf5(0x148)])){if(_0x24651f[_0x519bf5(0x141)](_0x24651f['xzBZG'],_0x519bf5(0xaf))){let _0x50d63c=_0x3c6a31[_0x519bf5(0xda)]||'';if(_0x50d63c[_0x519bf5(0x1d1)](_0x24651f['FcgBw']))_0x50d63c=_0x50d63c[_0x519bf5(0xdf)](_0x519bf5(0x19f),'')[_0x519bf5(0x19c)]();_0x268d60=_0x50d63c;}else{let _0x343c1b=_0x5c31a0[_0x519bf5(0xda)]||'';if(_0x343c1b['startsWith'](_0x24651f[_0x519bf5(0x109)]))_0x343c1b=_0x343c1b[_0x519bf5(0xdf)](_0x519bf5(0x19f),'')[_0x519bf5(0x19c)]();_0x1535dd=_0x343c1b;}}else _0x27a228===_0x24651f[_0x519bf5(0x11f)]&&(_0x1535dd=_0x5c31a0[_0x519bf5(0x10a)]);}}catch(_0x43b9c0){}}const _0x1d3bfe=this[_0x519bf5(0x12e)+_0x519bf5(0xd3)](_0x24651f[_0x519bf5(0x14f)],_0x1ea1df,![]);let _0x27efae={};if(_0x1d3bfe){if(_0x24651f[_0x519bf5(0x15a)]!==_0x24651f['KwNZI']){const _0x445e3d=_0x54a881[_0x519bf5(0xda)];_0x445e3d[_0x519bf5(0x1d1)](_0x24651f[_0x519bf5(0x109)])?_0x5c2d74=_0x445e3d['replace'](_0x24651f[_0x519bf5(0x109)],'')[_0x519bf5(0x19c)]():_0x1c80c1=_0x445e3d[_0x519bf5(0x19c)]();}else{const _0x20e609=this[_0x519bf5(0x12e)+_0x519bf5(0xd3)](_0x24651f['NEqWP'],_0x1ea1df);if(_0x24651f[_0x519bf5(0xa6)](_0x20e609,_0x24651f[_0x519bf5(0x149)])){const _0x5e728a=this[_0x519bf5(0x12e)+_0x519bf5(0xd3)](_0x24651f[_0x519bf5(0xf6)],_0x1ea1df,[]);for(const _0x8541b6 of _0x5e728a){if(_0x519bf5(0x12c)==='hilHh')_0x27efae[_0x8541b6['name']]=_0x8541b6[_0x519bf5(0xda)];else{if(_0x9a417b['url_'+_0x331d16])_0x3371b7['push'](_0x491eaa[_0x519bf5(0x1c3)+_0x179131]);}}}else{const _0x358b35=this[_0x519bf5(0x12e)+_0x519bf5(0xd3)](_0x24651f[_0x519bf5(0x1cb)],_0x1ea1df,'');if(_0x358b35)try{_0x27efae=typeof _0x358b35===_0x24651f[_0x519bf5(0x114)]?_0x358b35:JSON['parse'](_0x358b35);}catch(_0x144b61){throw new n8n_workflow_1[(_0x519bf5(0xc4))+(_0x519bf5(0xe4))](this[_0x519bf5(0x14e)](),_0x24651f[_0x519bf5(0x1b5)]);}}}}const _0x387275=this[_0x519bf5(0x12e)+_0x519bf5(0xd3)](_0x24651f[_0x519bf5(0xae)],_0x1ea1df,![]);if(_0x387275){const _0x8ecbb3=this[_0x519bf5(0x12e)+_0x519bf5(0xd3)](_0x519bf5(0xf2)+_0x519bf5(0x153)+_0x519bf5(0xd3),_0x1ea1df,[]);for(const _0x594a1f of _0x8ecbb3){if(_0x594a1f[_0x519bf5(0x7f)][_0x519bf5(0x111)+'e']()===_0x519bf5(0x152)+'ion'){if(_0x24651f['wvgIZ'](_0x24651f['BHDcN'],_0x24651f[_0x519bf5(0x134)])){const _0x24a14d=_0x594a1f[_0x519bf5(0xda)];if(_0x24a14d['startsWith'](_0x24651f[_0x519bf5(0x109)])){if(_0x24651f['ztqPW'](_0x519bf5(0xad),_0x24651f[_0x519bf5(0xe5)]))_0x1535dd=_0x24a14d['replace'](_0x24651f[_0x519bf5(0x109)],'')[_0x519bf5(0x19c)]();else{if(_0x98c136[_0x519bf5(0x7f)]['toLowerCas'+'e']()===_0x24651f[_0x519bf5(0x1be)]){const _0x7c26d1=_0x3dcbee[_0x519bf5(0xda)];_0x7c26d1['startsWith']('Bearer\x20')?_0x487b98=_0x7c26d1[_0x519bf5(0xdf)](_0x24651f[_0x519bf5(0x109)],'')[_0x519bf5(0x19c)]():_0x4d6324=_0x7c26d1['trim']();}}}else _0x1535dd=_0x24a14d[_0x519bf5(0x19c)]();}else throw new _0x314fd3(_0x519bf5(0x158)+_0x519bf5(0xeb)+_0x243ee4[_0x519bf5(0x13a)]+'\x20'+((_0x24651f[_0x519bf5(0x12f)](_0x325354=_0x5bc09c[_0x519bf5(0x162)],null)||_0x24651f[_0x519bf5(0x156)](_0x2fb7f0,void(-0x2709+-0x287*0x2+0x2c17))?void(0xf9f+-0x1c66+0xcc7*0x1):_0x95dc44['data'])?_0x13b887[_0x519bf5(0x95)](_0x91e666['response'][_0x519bf5(0x9d)]):''));}}}if(_0x27efae[_0x519bf5(0x1c0)+'en'])_0x1535dd=_0x27efae[_0x519bf5(0x1c0)+'en'];if(_0x27efae[_0x519bf5(0xb5)+_0x519bf5(0x8d)])_0x1535dd=_0x27efae[_0x519bf5(0xb5)+_0x519bf5(0x8d)];if(_0x27efae['accessToke'+'n'])_0x1535dd=_0x27efae[_0x519bf5(0xa1)+'n'];if(!_0x1535dd)throw new n8n_workflow_1[(_0x519bf5(0xc4))+(_0x519bf5(0xe4))](this['getNode'](),_0x24651f['NCTnq']);const _0x424686=this['getNodePar'+_0x519bf5(0xd3)](_0x24651f['tPyuQ'],_0x1ea1df);let _0x7070ef='me';if(_0x27efae[_0x519bf5(0x1dc)])_0x7070ef=_0x27efae[_0x519bf5(0x1dc)];if(_0x27efae[_0x519bf5(0x77)])_0x7070ef=_0x27efae[_0x519bf5(0x77)];let _0x48431b=_0x27efae[_0x519bf5(0xb4)]||_0x27efae[_0x519bf5(0x181)]||_0x27efae['content']||'',_0x20ef66=_0x27efae[_0x519bf5(0x18c)]||_0x27efae['type']||_0x24651f[_0x519bf5(0xcf)],_0x4e1754=[];if(Array[_0x519bf5(0x7e)](_0x27efae[_0x519bf5(0xbc)+'s']))_0x4e1754=_0x27efae[_0x519bf5(0xbc)+'s'];if(Array[_0x519bf5(0x7e)](_0x27efae['media']))_0x4e1754=_0x27efae[_0x519bf5(0xd9)];for(let _0x5e149b=-0x2456+-0x7*0xac+0x290b;_0x24651f[_0x519bf5(0x1b9)](_0x5e149b,0x4a*0x1f+0x3+0x21*-0x45);_0x5e149b++){if(_0x24651f[_0x519bf5(0x12f)](_0x24651f['SGAjx'],_0x24651f[_0x519bf5(0x122)])){if(_0x27efae[_0x519bf5(0x1c3)+_0x5e149b])_0x4e1754['push'](_0x27efae[_0x519bf5(0x1c3)+_0x5e149b]);}else{const _0x39d2de=this[_0x519bf5(0x12e)+'ameter'](_0x24651f[_0x519bf5(0xf6)],_0x4eb183,[]);for(const _0x5ba11f of _0x39d2de){_0x2ac70d[_0x5ba11f['name']]=_0x5ba11f[_0x519bf5(0xda)];}}}if(_0x24651f['QXpvt'](_0x20ef66,_0x519bf5(0x15e)))_0x20ef66='Text';const _0x50344a=_0x48431b[_0x519bf5(0x143)](_0x519bf5(0xb1)),_0x3ff2e4=[];let _0x39cc3c=null;for(let _0x55aa7c=-0x1ac2+-0x2f*-0x21+-0x1*-0x14b3;_0x24651f[_0x519bf5(0x189)](_0x55aa7c,_0x50344a[_0x519bf5(0xe8)]);_0x55aa7c++){if(_0x24651f[_0x519bf5(0x141)](_0x24651f[_0x519bf5(0x119)],_0x24651f[_0x519bf5(0x119)]))_0x27cb93=_0x4e2971['replace'](_0x24651f[_0x519bf5(0x109)],'')['trim']();else{const _0x3949e4=_0x50344a[_0x55aa7c],_0x4561db=_0x24651f[_0x519bf5(0xee)](_0x55aa7c,-0x7*0x17f+-0x3c8*0x8+0x4b*0x8b);let _0x33e793=null;const _0x2e8867=_0x4561db&&_0x4e1754[_0x519bf5(0xe8)]>-0x38b+-0x153d+0x18c8,_0x158b5e=async(_0x3a871c,_0x467967)=>{const _0x16e3e6=_0x519bf5,_0x5a5f7d={'access_token':_0x1535dd,'media_type':_0x467967};if(_0x24651f[_0x16e3e6(0xb2)](_0x467967,_0x24651f[_0x16e3e6(0x1ae)]))_0x5a5f7d[_0x16e3e6(0x1bf)]=_0x3a871c;else _0x5a5f7d[_0x16e3e6(0xd4)]=_0x3a871c;const _0x2bab21=await axios_1['default']['post'](_0x563b0c+'/'+_0x7070ef+_0x16e3e6(0x1a9),_0x5a5f7d);return _0x2bab21[_0x16e3e6(0x9d)]['id'];};try{if(_0x2e8867&&[_0x519bf5(0x1a3),_0x24651f[_0x519bf5(0xc3)],_0x519bf5(0x76)][_0x519bf5(0xd7)](_0x20ef66)){if(_0x24651f['GIwkG'](_0x24651f['DfyUe'],_0x24651f['DfyUe'])){if(_0x24651f[_0x519bf5(0x17a)](_0x20ef66,_0x24651f[_0x519bf5(0x83)]))_0x33e793=await _0x24651f[_0x519bf5(0xf8)](_0x158b5e,_0x4e1754[0x1*0x3d6+-0x1805+-0x142f*-0x1],_0x24651f[_0x519bf5(0x1ae)]);else{if(_0x20ef66===_0x519bf5(0xc9))_0x33e793=await _0x24651f[_0x519bf5(0xf8)](_0x158b5e,_0x4e1754[0x941+-0x7af*0x5+-0x1d2a*-0x1],_0x24651f[_0x519bf5(0x182)]);else{if(_0x24651f[_0x519bf5(0x1e0)](_0x20ef66,_0x519bf5(0x76))){const _0x5a8843=[];for(const _0x49a137 of _0x4e1754){if(_0x24651f[_0x519bf5(0xb2)](_0x24651f[_0x519bf5(0xc7)],_0x24651f['oHudU'])){const _0x59103f=_0x49a137['match'](/\.(mp4|mov)$/i),_0x3b647f=await _0x24651f['VrHVD'](_0x158b5e,_0x49a137,_0x59103f?_0x24651f[_0x519bf5(0x182)]:_0x519bf5(0x144));await _0x24651f[_0x519bf5(0x73)](_0x5b8b2a,_0x1535dd,_0x3b647f),_0x5a8843[_0x519bf5(0x1da)](_0x3b647f);}else{const _0x4a5094=_0x3c80eb?function(){const _0x48b53a=_0x519bf5;if(_0x363b80){const _0x3d5c18=_0x386474[_0x48b53a(0x16a)](_0xdd1827,arguments);return _0x122cd6=null,_0x3d5c18;}}:function(){};return _0x5e633f=![],_0x4a5094;}}const _0x362b8c=await axios_1[_0x519bf5(0x11c)]['post'](_0x563b0c+'/'+_0x7070ef+'/threads',{'access_token':_0x1535dd,'media_type':_0x24651f[_0x519bf5(0xbb)],'children':_0x5a8843[_0x519bf5(0xfe)](','),'text':_0x3949e4});_0x33e793=_0x362b8c[_0x519bf5(0x9d)]['id'];}}}if(_0x20ef66!==_0x519bf5(0x76)){if(_0x24651f['BIIHU']!==_0x24651f['qaFFJ']){const _0x354ea0={'access_token':_0x1535dd,'media_type':_0x20ef66[_0x519bf5(0x188)+'e'](),'text':_0x3949e4};if(_0x24651f[_0x519bf5(0x121)](_0x20ef66,_0x519bf5(0x1a3)))_0x354ea0[_0x519bf5(0x1bf)]=_0x4e1754[-0xd9c+0x227c*-0x1+0x2ac*0x12];else _0x354ea0[_0x519bf5(0xd4)]=_0x4e1754[-0x1*-0x22df+-0xa99+-0x1*0x1846];const _0x3e8881=await axios_1[_0x519bf5(0x11c)]['post'](_0x563b0c+'/'+_0x7070ef+_0x519bf5(0x1a9),_0x354ea0);_0x33e793=_0x3e8881[_0x519bf5(0x9d)]['id'];}else _0xdad90d=_0x24651f[_0x519bf5(0xb2)](typeof _0x25f48e,_0x24651f[_0x519bf5(0x114)])?_0xc53a73:_0x185b2e[_0x519bf5(0x1d9)](_0x13c4bf);}}else throw new _0x2f8d99[(_0x519bf5(0xc4))+(_0x519bf5(0xe4))](this['getNode'](),'No\x20Access\x20'+_0x519bf5(0x1bc)+_0x519bf5(0x168)+'provided\x20v'+_0x519bf5(0x6a)+_0x519bf5(0x1d3)+_0x519bf5(0x1c9)+_0x519bf5(0xf1)+_0x519bf5(0x106)+_0x519bf5(0x1bb)+_0x519bf5(0x19e));}else{const _0x1776a3={'access_token':_0x1535dd,'media_type':_0x24651f[_0x519bf5(0x92)],'text':_0x3949e4};if(_0x39cc3c)_0x1776a3['reply_to_i'+'d']=_0x39cc3c;const _0x4b473c=await axios_1[_0x519bf5(0x11c)][_0x519bf5(0x93)](_0x563b0c+'/'+_0x7070ef+_0x519bf5(0x1a9),_0x1776a3);_0x33e793=_0x4b473c[_0x519bf5(0x9d)]['id'];}if(_0x33e793){if(_0x2e8867)await _0x24651f[_0x519bf5(0x96)](_0x5b8b2a,_0x1535dd,_0x33e793);const _0x65e964=await _0x24651f[_0x519bf5(0x6d)](_0xdf8e25,_0x1535dd,_0x7070ef,_0x33e793);_0x3ff2e4[_0x519bf5(0x1da)](_0x65e964),_0x39cc3c=_0x65e964;}}catch(_0x4ba058){throw new Error('Threads\x20Er'+'ror:\x20'+_0x4ba058['message']+'\x20'+(((_0x4db351=_0x4ba058[_0x519bf5(0x162)])===null||_0x24651f[_0x519bf5(0x1e0)](_0x4db351,void(0x29+-0x25c2*-0x1+0x25eb*-0x1))?void(-0x1a52+-0x315*0x5+0x29bb):_0x4db351[_0x519bf5(0x9d)])?JSON[_0x519bf5(0x95)](_0x4ba058[_0x519bf5(0x162)][_0x519bf5(0x9d)]):''));}}}_0x2d0b34[_0x519bf5(0x1da)]({'json':{'ids':_0x3ff2e4,'success':!![]}});}}catch(_0x4c1125){if(this['continueOn'+_0x519bf5(0xf3)]()){_0x2d0b34[_0x519bf5(0x1da)]({'json':{'error':_0x4c1125['message']}});continue;}throw _0x4c1125;}}return[_0x2d0b34];}}exports[_0x219dec(0x16d)+'lish']=ThreadsPublish;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ThreadsPublish = void 0;
|
|
7
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
8
|
+
const axios_1 = __importDefault(require("axios"));
|
|
9
|
+
class ThreadsPublish {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.description = {
|
|
12
|
+
displayName: 'Threads Publish',
|
|
13
|
+
name: 'threadsPublish',
|
|
14
|
+
icon: 'file:threads.svg',
|
|
15
|
+
group: ['transform'],
|
|
16
|
+
version: 1,
|
|
17
|
+
description: 'Publish content to Threads with HTTP-like Interface',
|
|
18
|
+
defaults: {
|
|
19
|
+
name: 'Threads Publish',
|
|
20
|
+
},
|
|
21
|
+
inputs: ['main'],
|
|
22
|
+
outputs: ['main'],
|
|
23
|
+
credentials: [
|
|
24
|
+
{
|
|
25
|
+
name: 'socialProLicense',
|
|
26
|
+
required: true,
|
|
27
|
+
displayOptions: {
|
|
28
|
+
show: {
|
|
29
|
+
licenseAuthentication: ['socialProLicense'],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'socialProToken',
|
|
35
|
+
required: true,
|
|
36
|
+
displayOptions: {
|
|
37
|
+
show: {
|
|
38
|
+
authentication: ['predefinedCredentialType'],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'httpHeaderAuth',
|
|
44
|
+
required: true,
|
|
45
|
+
displayOptions: {
|
|
46
|
+
show: {
|
|
47
|
+
authentication: ['genericCredentialType'],
|
|
48
|
+
genericAuthType: ['httpHeaderAuth'],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'httpBearerAuth',
|
|
54
|
+
required: true,
|
|
55
|
+
displayOptions: {
|
|
56
|
+
show: {
|
|
57
|
+
authentication: ['genericCredentialType'],
|
|
58
|
+
genericAuthType: ['httpBearerAuth'],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
properties: [
|
|
64
|
+
// 1. Platform
|
|
65
|
+
{
|
|
66
|
+
displayName: 'Platform',
|
|
67
|
+
name: 'platform',
|
|
68
|
+
type: 'options',
|
|
69
|
+
options: [
|
|
70
|
+
{ name: 'Threads', value: 'Threads' },
|
|
71
|
+
],
|
|
72
|
+
default: 'Threads',
|
|
73
|
+
noDataExpression: true,
|
|
74
|
+
description: 'Select the social platform to publish to',
|
|
75
|
+
},
|
|
76
|
+
// 1.5 License Authentication
|
|
77
|
+
{
|
|
78
|
+
displayName: 'License Authentication',
|
|
79
|
+
name: 'licenseAuthentication',
|
|
80
|
+
type: 'options',
|
|
81
|
+
options: [
|
|
82
|
+
{ name: 'None', value: 'none' },
|
|
83
|
+
{ name: 'Social Pro License', value: 'socialProLicense' },
|
|
84
|
+
],
|
|
85
|
+
default: 'none',
|
|
86
|
+
description: 'Verify your license key for additional features',
|
|
87
|
+
},
|
|
88
|
+
// License Server URL Removed (Now in Credential)
|
|
89
|
+
// 2. Authentication
|
|
90
|
+
{
|
|
91
|
+
displayName: 'Authentication',
|
|
92
|
+
name: 'authentication',
|
|
93
|
+
type: 'options',
|
|
94
|
+
options: [
|
|
95
|
+
{ name: 'Predefined Credential Type', value: 'predefinedCredentialType' },
|
|
96
|
+
{ name: 'Generic Credential Type', value: 'genericCredentialType' },
|
|
97
|
+
{ name: 'None', value: 'none' },
|
|
98
|
+
],
|
|
99
|
+
default: 'predefinedCredentialType',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
displayName: 'Generic Auth Type',
|
|
103
|
+
name: 'genericAuthType',
|
|
104
|
+
type: 'options',
|
|
105
|
+
options: [
|
|
106
|
+
{ name: 'Header Auth', value: 'httpHeaderAuth' },
|
|
107
|
+
{ name: 'Bearer Auth', value: 'httpBearerAuth' },
|
|
108
|
+
],
|
|
109
|
+
default: 'httpHeaderAuth',
|
|
110
|
+
displayOptions: {
|
|
111
|
+
show: {
|
|
112
|
+
authentication: ['genericCredentialType'],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
// 3. Headers
|
|
117
|
+
{
|
|
118
|
+
displayName: 'Send Headers',
|
|
119
|
+
name: 'sendHeaders',
|
|
120
|
+
type: 'boolean',
|
|
121
|
+
default: false,
|
|
122
|
+
noDataExpression: true,
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
displayName: 'Header Parameters',
|
|
126
|
+
name: 'headerParameters',
|
|
127
|
+
type: 'fixedCollection',
|
|
128
|
+
displayOptions: {
|
|
129
|
+
show: {
|
|
130
|
+
sendHeaders: [true],
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
typeOptions: {
|
|
134
|
+
multipleValues: true,
|
|
135
|
+
},
|
|
136
|
+
placeholder: 'Add Header',
|
|
137
|
+
default: {},
|
|
138
|
+
options: [
|
|
139
|
+
{
|
|
140
|
+
name: 'parameter',
|
|
141
|
+
displayName: 'Parameter',
|
|
142
|
+
values: [
|
|
143
|
+
{
|
|
144
|
+
displayName: 'Name',
|
|
145
|
+
name: 'name',
|
|
146
|
+
type: 'string',
|
|
147
|
+
default: '',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
displayName: 'Value',
|
|
151
|
+
name: 'value',
|
|
152
|
+
type: 'string',
|
|
153
|
+
default: '',
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
},
|
|
159
|
+
// 4. Body
|
|
160
|
+
{
|
|
161
|
+
displayName: 'Send Body',
|
|
162
|
+
name: 'sendBody',
|
|
163
|
+
type: 'boolean',
|
|
164
|
+
default: true,
|
|
165
|
+
noDataExpression: true,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
displayName: 'Body Content Type',
|
|
169
|
+
name: 'contentType',
|
|
170
|
+
type: 'options',
|
|
171
|
+
displayOptions: {
|
|
172
|
+
show: {
|
|
173
|
+
sendBody: [true],
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
options: [
|
|
177
|
+
{ name: 'JSON', value: 'json' },
|
|
178
|
+
{ name: 'Using JSON', value: 'raw' },
|
|
179
|
+
],
|
|
180
|
+
default: 'raw',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
displayName: 'Body Parameters',
|
|
184
|
+
name: 'bodyParameters',
|
|
185
|
+
type: 'fixedCollection',
|
|
186
|
+
displayOptions: {
|
|
187
|
+
show: {
|
|
188
|
+
sendBody: [true],
|
|
189
|
+
contentType: ['json'],
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
typeOptions: {
|
|
193
|
+
multipleValues: true,
|
|
194
|
+
},
|
|
195
|
+
placeholder: 'Add Parameter',
|
|
196
|
+
default: {},
|
|
197
|
+
options: [
|
|
198
|
+
{
|
|
199
|
+
name: 'parameter',
|
|
200
|
+
displayName: 'Parameter',
|
|
201
|
+
values: [
|
|
202
|
+
{
|
|
203
|
+
displayName: 'Name',
|
|
204
|
+
name: 'name',
|
|
205
|
+
type: 'string',
|
|
206
|
+
default: '',
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
displayName: 'Value',
|
|
210
|
+
name: 'value',
|
|
211
|
+
type: 'string',
|
|
212
|
+
default: '',
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
displayName: 'Body',
|
|
220
|
+
name: 'jsonBody',
|
|
221
|
+
type: 'json',
|
|
222
|
+
displayOptions: {
|
|
223
|
+
show: {
|
|
224
|
+
sendBody: [true],
|
|
225
|
+
contentType: ['raw'],
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
default: '',
|
|
229
|
+
description: 'Valid JSON string. Expected keys: text, media_type, media_files, etc.',
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
async execute() {
|
|
235
|
+
var _a;
|
|
236
|
+
const items = this.getInputData();
|
|
237
|
+
const returnData = [];
|
|
238
|
+
const apiBase = 'https://graph.threads.net/v1.0';
|
|
239
|
+
// Helper to check status
|
|
240
|
+
const checkStatus = async (accessToken, mediaId) => {
|
|
241
|
+
let status = '';
|
|
242
|
+
let attempts = 0;
|
|
243
|
+
while (status !== 'FINISHED' && attempts < 30) {
|
|
244
|
+
await new Promise(res => setTimeout(res, 2000));
|
|
245
|
+
try {
|
|
246
|
+
const res = await axios_1.default.get(`${apiBase}/${mediaId}`, {
|
|
247
|
+
params: { access_token: accessToken, fields: 'status,error_message' }
|
|
248
|
+
});
|
|
249
|
+
status = res.data.status;
|
|
250
|
+
if (status === 'ERROR')
|
|
251
|
+
throw new Error(`Media Upload Failed: ${res.data.error_message}`);
|
|
252
|
+
}
|
|
253
|
+
catch (e) { /* ignore transient */ }
|
|
254
|
+
attempts++;
|
|
255
|
+
}
|
|
256
|
+
if (status !== 'FINISHED')
|
|
257
|
+
throw new Error('Media Processing Timeout');
|
|
258
|
+
};
|
|
259
|
+
// Helper: Publish Container
|
|
260
|
+
const publishContainer = async (accessToken, userId, creationId) => {
|
|
261
|
+
const res = await axios_1.default.post(`${apiBase}/${userId}/threads_publish`, {
|
|
262
|
+
access_token: accessToken,
|
|
263
|
+
creation_id: creationId
|
|
264
|
+
});
|
|
265
|
+
return res.data.id;
|
|
266
|
+
};
|
|
267
|
+
// Helper: Verify License (GET Request)
|
|
268
|
+
const verifyLicense = async (serverUrl, licenseKey) => {
|
|
269
|
+
var _a, _b;
|
|
270
|
+
// Ensure no trailing slash
|
|
271
|
+
const baseUrl = serverUrl.replace(/\/$/, '');
|
|
272
|
+
try {
|
|
273
|
+
const res = await axios_1.default.get(`${baseUrl}/api/v1/verify-license`, {
|
|
274
|
+
headers: { 'x-api-key': licenseKey },
|
|
275
|
+
timeout: 5000
|
|
276
|
+
});
|
|
277
|
+
// If it returns 200 but explicitly says invalid
|
|
278
|
+
if (res.data.valid === false)
|
|
279
|
+
throw new Error('License Invalid (Check Response)');
|
|
280
|
+
return res.data;
|
|
281
|
+
}
|
|
282
|
+
catch (e) {
|
|
283
|
+
const errMsg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) || e.message;
|
|
284
|
+
throw new Error(`License Verification Failed: ${errMsg}`);
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
288
|
+
try {
|
|
289
|
+
// 0. Verify License
|
|
290
|
+
const licenseAuth = this.getNodeParameter('licenseAuthentication', itemIndex, 'none');
|
|
291
|
+
if (licenseAuth === 'socialProLicense') {
|
|
292
|
+
// Get License Key AND URL from Credential
|
|
293
|
+
let licenseCreds;
|
|
294
|
+
try {
|
|
295
|
+
licenseCreds = await this.getCredentials('socialProLicense');
|
|
296
|
+
}
|
|
297
|
+
catch (e) {
|
|
298
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'License Credential missing.');
|
|
299
|
+
}
|
|
300
|
+
const licenseKey = licenseCreds.licenseKey;
|
|
301
|
+
const serverUrl = licenseCreds.serverUrl;
|
|
302
|
+
if (!serverUrl)
|
|
303
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'License Server URL is missing in Credential.');
|
|
304
|
+
if (!licenseKey)
|
|
305
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'License Key is missing in Credential.');
|
|
306
|
+
try {
|
|
307
|
+
await verifyLicense(serverUrl, licenseKey);
|
|
308
|
+
}
|
|
309
|
+
catch (e) {
|
|
310
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), e.message);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
// 1. Resolve Auth (Initial)
|
|
314
|
+
const authMode = this.getNodeParameter('authentication', itemIndex);
|
|
315
|
+
let accessToken = '';
|
|
316
|
+
if (authMode === 'predefinedCredentialType') {
|
|
317
|
+
// Try/Catch for optional credential scenarios or if user just wants to override
|
|
318
|
+
try {
|
|
319
|
+
const creds = await this.getCredentials('socialProToken');
|
|
320
|
+
accessToken = creds.accessToken;
|
|
321
|
+
}
|
|
322
|
+
catch (e) { }
|
|
323
|
+
}
|
|
324
|
+
else if (authMode === 'genericCredentialType') {
|
|
325
|
+
try {
|
|
326
|
+
const genericType = this.getNodeParameter('genericAuthType', itemIndex);
|
|
327
|
+
const creds = await this.getCredentials(genericType);
|
|
328
|
+
if (genericType === 'httpHeaderAuth') {
|
|
329
|
+
let val = creds.value || '';
|
|
330
|
+
if (val.startsWith('Bearer '))
|
|
331
|
+
val = val.replace('Bearer ', '').trim();
|
|
332
|
+
accessToken = val;
|
|
333
|
+
}
|
|
334
|
+
else if (genericType === 'httpBearerAuth') {
|
|
335
|
+
accessToken = creds.token;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
catch (e) { }
|
|
339
|
+
}
|
|
340
|
+
// 2. Resolve Body
|
|
341
|
+
const sendBody = this.getNodeParameter('sendBody', itemIndex, false);
|
|
342
|
+
let bodyData = {};
|
|
343
|
+
if (sendBody) {
|
|
344
|
+
const contentType = this.getNodeParameter('contentType', itemIndex);
|
|
345
|
+
if (contentType === 'json') {
|
|
346
|
+
const params = this.getNodeParameter('bodyParameters.parameter', itemIndex, []);
|
|
347
|
+
for (const p of params) {
|
|
348
|
+
bodyData[p.name] = p.value;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
const raw = this.getNodeParameter('jsonBody', itemIndex, '');
|
|
353
|
+
if (raw) {
|
|
354
|
+
try {
|
|
355
|
+
bodyData = typeof raw === 'object' ? raw : JSON.parse(raw);
|
|
356
|
+
}
|
|
357
|
+
catch (e) {
|
|
358
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid JSON Body');
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
// 3. Token Override from Headers (User Request)
|
|
364
|
+
const sendHeaders = this.getNodeParameter('sendHeaders', itemIndex, false);
|
|
365
|
+
if (sendHeaders) {
|
|
366
|
+
const headers = this.getNodeParameter('headerParameters.parameter', itemIndex, []);
|
|
367
|
+
for (const h of headers) {
|
|
368
|
+
if (h.name.toLowerCase() === 'authorization') {
|
|
369
|
+
const val = h.value;
|
|
370
|
+
if (val.startsWith('Bearer ')) {
|
|
371
|
+
accessToken = val.replace('Bearer ', '').trim();
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
accessToken = val.trim();
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
// 4. Token Override from Body (Low Priority than Headers)
|
|
380
|
+
if (bodyData.access_token)
|
|
381
|
+
accessToken = bodyData.access_token;
|
|
382
|
+
if (bodyData.longLiveToken)
|
|
383
|
+
accessToken = bodyData.longLiveToken;
|
|
384
|
+
if (bodyData.accessToken)
|
|
385
|
+
accessToken = bodyData.accessToken;
|
|
386
|
+
if (!accessToken) {
|
|
387
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No Access Token found. Please provided via Authentication, Header (Authorization), or Body (access_token).');
|
|
388
|
+
}
|
|
389
|
+
// 5. Resolve Platform & User
|
|
390
|
+
const platform = this.getNodeParameter('platform', itemIndex);
|
|
391
|
+
let userId = 'me';
|
|
392
|
+
if (bodyData.user_id)
|
|
393
|
+
userId = bodyData.user_id;
|
|
394
|
+
if (bodyData.userId)
|
|
395
|
+
userId = bodyData.userId;
|
|
396
|
+
let text = bodyData.text || bodyData.caption || bodyData.content || '';
|
|
397
|
+
let type = bodyData.media_type || bodyData.type || 'Text'; // Default
|
|
398
|
+
// Collect Media
|
|
399
|
+
let mediaItems = [];
|
|
400
|
+
if (Array.isArray(bodyData.media_files))
|
|
401
|
+
mediaItems = bodyData.media_files;
|
|
402
|
+
if (Array.isArray(bodyData.media))
|
|
403
|
+
mediaItems = bodyData.media;
|
|
404
|
+
// Check flat urls
|
|
405
|
+
for (let i = 1; i <= 20; i++) {
|
|
406
|
+
if (bodyData[`url_${i}`])
|
|
407
|
+
mediaItems.push(bodyData[`url_${i}`]);
|
|
408
|
+
}
|
|
409
|
+
// Smart Fallback
|
|
410
|
+
if (type === 'Article')
|
|
411
|
+
type = 'Text';
|
|
412
|
+
// Reuse existing Logic
|
|
413
|
+
const textParts = text.split('===');
|
|
414
|
+
const publishedIds = [];
|
|
415
|
+
let previousPostId = null;
|
|
416
|
+
for (let i = 0; i < textParts.length; i++) {
|
|
417
|
+
const currentText = textParts[i];
|
|
418
|
+
const isFirstPost = i === 0;
|
|
419
|
+
let creationId = null;
|
|
420
|
+
// Detect Media Type
|
|
421
|
+
const hasMedia = isFirstPost && mediaItems.length > 0;
|
|
422
|
+
// Helper: Upload Media
|
|
423
|
+
const uploadMedia = async (url, mType) => {
|
|
424
|
+
const payload = { access_token: accessToken, media_type: mType };
|
|
425
|
+
if (mType === 'IMAGE')
|
|
426
|
+
payload.image_url = url;
|
|
427
|
+
else
|
|
428
|
+
payload.video_url = url;
|
|
429
|
+
const res = await axios_1.default.post(`${apiBase}/${userId}/threads`, payload);
|
|
430
|
+
return res.data.id;
|
|
431
|
+
};
|
|
432
|
+
try {
|
|
433
|
+
if (hasMedia && ['Image', 'Video', 'Carousel'].includes(type)) {
|
|
434
|
+
if (type === 'Image') {
|
|
435
|
+
creationId = await uploadMedia(mediaItems[0], 'IMAGE');
|
|
436
|
+
}
|
|
437
|
+
else if (type === 'Video') {
|
|
438
|
+
creationId = await uploadMedia(mediaItems[0], 'VIDEO');
|
|
439
|
+
}
|
|
440
|
+
else if (type === 'Carousel') {
|
|
441
|
+
const children = [];
|
|
442
|
+
for (const m of mediaItems) {
|
|
443
|
+
// Simple detection
|
|
444
|
+
const isVid = m.match(/\.(mp4|mov)$/i);
|
|
445
|
+
const childId = await uploadMedia(m, isVid ? 'VIDEO' : 'IMAGE');
|
|
446
|
+
await checkStatus(accessToken, childId);
|
|
447
|
+
children.push(childId);
|
|
448
|
+
}
|
|
449
|
+
const res = await axios_1.default.post(`${apiBase}/${userId}/threads`, {
|
|
450
|
+
access_token: accessToken,
|
|
451
|
+
media_type: 'CAROUSEL',
|
|
452
|
+
children: children.join(','),
|
|
453
|
+
text: currentText
|
|
454
|
+
});
|
|
455
|
+
creationId = res.data.id;
|
|
456
|
+
}
|
|
457
|
+
if (type !== 'Carousel') {
|
|
458
|
+
const payload = {
|
|
459
|
+
access_token: accessToken,
|
|
460
|
+
media_type: type.toUpperCase(),
|
|
461
|
+
text: currentText
|
|
462
|
+
};
|
|
463
|
+
if (type === 'Image')
|
|
464
|
+
payload.image_url = mediaItems[0];
|
|
465
|
+
else
|
|
466
|
+
payload.video_url = mediaItems[0];
|
|
467
|
+
const res = await axios_1.default.post(`${apiBase}/${userId}/threads`, payload);
|
|
468
|
+
creationId = res.data.id;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
else {
|
|
472
|
+
// Text
|
|
473
|
+
const payload = {
|
|
474
|
+
access_token: accessToken,
|
|
475
|
+
media_type: 'TEXT',
|
|
476
|
+
text: currentText
|
|
477
|
+
};
|
|
478
|
+
if (previousPostId)
|
|
479
|
+
payload.reply_to_id = previousPostId;
|
|
480
|
+
const res = await axios_1.default.post(`${apiBase}/${userId}/threads`, payload);
|
|
481
|
+
creationId = res.data.id;
|
|
482
|
+
}
|
|
483
|
+
if (creationId) {
|
|
484
|
+
if (hasMedia)
|
|
485
|
+
await checkStatus(accessToken, creationId);
|
|
486
|
+
const pubId = await publishContainer(accessToken, userId, creationId);
|
|
487
|
+
publishedIds.push(pubId);
|
|
488
|
+
previousPostId = pubId;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
catch (err) {
|
|
492
|
+
throw new Error(`Threads Error: ${err.message} ${((_a = err.response) === null || _a === void 0 ? void 0 : _a.data) ? JSON.stringify(err.response.data) : ''}`);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
returnData.push({ json: { ids: publishedIds, success: true } });
|
|
496
|
+
}
|
|
497
|
+
catch (error) {
|
|
498
|
+
if (this.continueOnFail()) {
|
|
499
|
+
returnData.push({ json: { error: error.message } });
|
|
500
|
+
continue;
|
|
501
|
+
}
|
|
502
|
+
throw error;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
return [returnData];
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
exports.ThreadsPublish = ThreadsPublish;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-charlsondou-social-pro",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.23",
|
|
4
4
|
"description": "n8n Community Node for Social Media Publishing (FB, IG, X, LinkedIn) with Obfuscation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"author": "Charlson Dou",
|
|
10
10
|
"main": "index.js",
|
|
11
11
|
"scripts": {
|
|
12
|
-
"build": "tsc
|
|
12
|
+
"build": "tsc",
|
|
13
13
|
"dev": "tsc --watch",
|
|
14
14
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
15
15
|
},
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"dist/credentials/SocialProFacebook.credentials.js",
|
|
23
23
|
"dist/credentials/SocialProTwitter.credentials.js",
|
|
24
24
|
"dist/credentials/SocialProToken.credentials.js",
|
|
25
|
-
"dist/credentials/SocialProLinkedIn.credentials.js"
|
|
25
|
+
"dist/credentials/SocialProLinkedIn.credentials.js",
|
|
26
|
+
"dist/credentials/SocialProLicense.credentials.js"
|
|
26
27
|
]
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|