n8n-nodes-charlsondou-social-pro 0.2.21 → 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 _0x4be53d=_0x29bc;(function(_0x3a5537,_0xf8d03a){const _0x38de93=_0x29bc,_0x23f5b2=_0x3a5537();while(!![]){try{const _0x3a177e=parseInt(_0x38de93(0x18c))/(-0x21ce+0xb66+0x1669)*(parseInt(_0x38de93(0x111))/(-0x137+-0x1*0x8f6+0xa2f))+parseInt(_0x38de93(0x88))/(0x1394+-0x438+-0xf59)+-parseInt(_0x38de93(0x142))/(-0x1ea3+-0x121f+0x30c6)*(-parseInt(_0x38de93(0x194))/(-0x3a*-0x13+0xd76+-0x11bf))+-parseInt(_0x38de93(0x1b7))/(0x44a+0x10f*0x1d+-0x22f7*0x1)*(parseInt(_0x38de93(0x123))/(-0x228f+0xc*-0x37+-0x8e*-0x43))+-parseInt(_0x38de93(0x117))/(-0x26c+-0x1d30+0x1fa4)+-parseInt(_0x38de93(0xed))/(0x29*0x83+0x35*-0x55+0x359*-0x1)*(-parseInt(_0x38de93(0xdb))/(-0x20a3+-0x14ea+0x3597))+-parseInt(_0x38de93(0x153))/(-0x772*0x3+-0x1*-0x1f7f+-0x1*0x91e)*(parseInt(_0x38de93(0x15e))/(-0x5a6+-0x1*0x241+0x7f3));if(_0x3a177e===_0xf8d03a)break;else _0x23f5b2['push'](_0x23f5b2['shift']());}catch(_0x5cbd54){_0x23f5b2['push'](_0x23f5b2['shift']());}}}(_0x195d,0x246fe*0x2+0x595*-0xb5+0x3*0x2c03f));function _0x29bc(_0x4d6351,_0x1bf226){_0x4d6351=_0x4d6351-(-0x120d+0x10fd+-0x6*-0x43);const _0x258f6f=_0x195d();let _0x808802=_0x258f6f[_0x4d6351];if(_0x29bc['SHVkSY']===undefined){var _0x2a5b5e=function(_0x5359e3){const _0x3cabf7='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x32a768='',_0x3a44b6='',_0x326f86=_0x32a768+_0x2a5b5e;for(let _0x208ff1=-0x4e0+0x71*-0x2+0xb*0x86,_0x20c2d4,_0x137fe0,_0x2b1735=0x5*-0x685+0x1cfd*-0x1+0x3d96;_0x137fe0=_0x5359e3['charAt'](_0x2b1735++);~_0x137fe0&&(_0x20c2d4=_0x208ff1%(0xe20+0x1069*0x1+0x259*-0xd)?_0x20c2d4*(-0x711*0x3+0x33*0x66+-0x11*-0x11)+_0x137fe0:_0x137fe0,_0x208ff1++%(0x1294+0x1cbd+-0x2f4d))?_0x32a768+=_0x326f86['charCodeAt'](_0x2b1735+(0x7*0x1c9+-0x2636*-0x1+-0x32ab))-(-0x10f3+-0x1*-0x92f+-0xde*-0x9)!==-0x11ab+-0xd98+-0x1f43*-0x1?String['fromCharCode'](-0x2597*-0x1+0x1*-0x86e+-0x1c2a&_0x20c2d4>>(-(-0x22+-0xcdd*-0x1+-0xcb9*0x1)*_0x208ff1&-0xbf*-0x2+0x235+-0x3ad)):_0x208ff1:0x71*0x1d+0x552*0x3+-0x1cc3){_0x137fe0=_0x3cabf7['indexOf'](_0x137fe0);}for(let _0x2cc004=0xd*-0x2e7+0x257e+0x3d,_0x2b58de=_0x32a768['length'];_0x2cc004<_0x2b58de;_0x2cc004++){_0x3a44b6+='%'+('00'+_0x32a768['charCodeAt'](_0x2cc004)['toString'](0x1888+0x1a0+-0x1a18))['slice'](-(0x2af+0x3*-0xa0b+0x3ec*0x7));}return decodeURIComponent(_0x3a44b6);};_0x29bc['KuajCE']=_0x2a5b5e,_0x29bc['gzBxhg']={},_0x29bc['SHVkSY']=!![];}const _0x28dd48=_0x258f6f[-0x24d3+-0x2b*-0xba+0x595],_0xa4e644=_0x4d6351+_0x28dd48,_0x4b0f79=_0x29bc['gzBxhg'][_0xa4e644];if(!_0x4b0f79){const _0x28990f=function(_0x11cefa){this['mlPUnD']=_0x11cefa,this['ZsAjEE']=[-0x1156+0x3da+0x47f*0x3,0x73*0xd+-0x1c9c+0x16c5,-0x59d*0x2+-0x23bd*0x1+0x2ef7],this['SzSfQd']=function(){return'newState';},this['YbZOuA']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['ryegkX']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x28990f['prototype']['zkoTgy']=function(){const _0x1b733b=new RegExp(this['YbZOuA']+this['ryegkX']),_0xf9b174=_0x1b733b['test'](this['SzSfQd']['toString']())?--this['ZsAjEE'][-0x2651*0x1+0x1033+-0x1*-0x161f]:--this['ZsAjEE'][-0x756*0x1+-0x6b*-0x42+0x12*-0x120];return this['jRdKPb'](_0xf9b174);},_0x28990f['prototype']['jRdKPb']=function(_0xb73765){if(!Boolean(~_0xb73765))return _0xb73765;return this['BuZiqu'](this['mlPUnD']);},_0x28990f['prototype']['BuZiqu']=function(_0x3acc82){for(let _0x5e18c2=0x4*0x407+0x1*-0x1f16+0x1*0xefa,_0x581a75=this['ZsAjEE']['length'];_0x5e18c2<_0x581a75;_0x5e18c2++){this['ZsAjEE']['push'](Math['round'](Math['random']())),_0x581a75=this['ZsAjEE']['length'];}return _0x3acc82(this['ZsAjEE'][-0x1*0x254c+-0x7f7*-0x2+0x155e]);},new _0x28990f(_0x29bc)['zkoTgy'](),_0x808802=_0x29bc['KuajCE'](_0x808802),_0x29bc['gzBxhg'][_0xa4e644]=_0x808802;}else _0x808802=_0x4b0f79;return _0x808802;}const _0x59575a=(function(){let _0x59e072=!![];return function(_0x5b47a6,_0x46106c){const _0x63db8f=_0x59e072?function(){const _0x494abe=_0x29bc;if(_0x46106c){const _0x7c70ce=_0x46106c[_0x494abe(0x122)](_0x5b47a6,arguments);return _0x46106c=null,_0x7c70ce;}}:function(){};return _0x59e072=![],_0x63db8f;};}()),_0x1f0364=_0x59575a(this,function(){const _0x5a10ae=_0x29bc,_0x179e35={'owlqd':_0x5a10ae(0xc6)+'+$'};return _0x1f0364[_0x5a10ae(0x197)]()['search'](_0x179e35[_0x5a10ae(0xbf)])['toString']()['constructo'+'r'](_0x1f0364)[_0x5a10ae(0xf1)](_0x179e35[_0x5a10ae(0xbf)]);});_0x1f0364();'use strict';function _0x195d(){const _0x5f3e3d=['tK5py0i','qxv0AgvUDgLJyq','wKDSAey','ANnVBG','lwfWCc56zwfIDq','yM9KEvbHCMfTzq','yxnxvhK','zMLSztP0AhjLyq','u2vUzcbizwfKzq','y3zKv3q','C0vhzLe','ugXHDgzVCM0','CgfYC2u','zML4zwrdB2XSzq','mJKXmtDqEgndsxG','BMDfsMm','CI5HCha','CNzLCIbvuKW','zw91Da','zxrLCG','EsbPCYbLBxb0Eq','Dg9vChbLCKnHCW','DgGGvhLWzq','teLxzwG','BwvKAwfFDhLWzq','mta1otzUufrgwwO','ChvIBgLZAcb0BW','z010A2G','Aw9U','BNP3yKC','C3rHDhvZ','twvKAweGvxbSBW','Ahr0CejLyxjLCG','sMLovhe','tgLJzw5Zzsbwzq','CwTYvve','A2v5igzVCIbHza','tgjmywS','l3rOCMvHzhm','y29UDgvUDfr5Ca','yLfYAKy','EwPktNK','Bg9Uz0XPDMvuBW','BxLRq20','tgLJzw5ZzsbjBG','CgfYyw1LDgvY','igXPy2vUC2uGDG','zxjYB3jFBwvZCW','z2vUzxjPy0nYzq','zhrTrKW','DhjPBq','C2vKuhq','zhHkt0u','iezHAwXLzdOG','Ahr0Chm6lY95BW','y29UDgvUDa','yxbPlMv4yw1WBa','rxzjDKW','zc4GugXLyxnLia','EMvhEge','yxv0Ag9YAxPHDa','t04GqM9KEq','s2TQru8','t21Qzvy','yw1LDgvY','ANLZs0e','C2vUzeHLywrLCG','CMLMAwnHDgLVBG','B2jQzwn0','ANnHvvy','svrStMG','nJq5mdC5BwPJDgz0','CM9YoIa','rKLosvniruq','DwjSAxnO','yujsshK','vhHoDha','DhLWzq','z2vUzxjPy0f1Da','mtu1quXQEeTj','weTbsNG','AwnHDgLVBI4','Dg9tDhjPBMC','lIbODhrWCZOVlW','EuTrEKS','Dg9mB3DLCKnHCW','vxnPBMCGsLnptG','BgvUz3rO','ihnVy2LHBcbWBa','CwjNyKK','icHHy2nLC3nFDa','vg9Rzw4GzM91BG','CMvZCg9UC2u','wvnABuq','tgLJzw5Zzsblzq','BgLJzw5ZzvnLCG','vevyva','zLvguvi','DxnLCL9Pza','BxzrwMO','C3rHCNrZv2L0Aa','zgvZy3jPChrPBW','AgvUDgLJyxrPBW','vgHYzwfKCYbfCG','C29JAwfSuhjVva','DMfSAwq','B2TLBIKU','AhPpEfe','ANnVBKjVzhK','u2vUzcbcB2r5','whLxv2G','DhjHBNnMB3jT','sLjTChC','uNbky2i','nKTUu1DOAW','igjHy2TLBMqGCW','Dg9Rzw4','AcbivfrqlwXPAW','B2TLBG','vMLKzw8','ywnJzxnZx3rVAW','ru9Pq0y','DMfSAwqGkenOzq','r3rprLe','uKWGB2yGEw91CG','r2vUzxjPyYbdCG','AxnbCNjHEq','zs5JB20PigzVCG','ienYzwrLBNrPyq','quzcvLi','wMXvwu8','wLjUruy','BwvKAwe','BcbuExbL','sgvHzgvYifbHCG','zgj1uum','zsbjBNrLCMzHyW','CMvWBhLFDg9FAq','q2fYB3vZzwW','v2DrDvG','ExbL','Afr5Cgu','zhmUC3zN','vgv4Da','rw1stNG','AM9PBG','tgLJzw5Zzsbtzq','Ahr0Chm6lY9NCG','C3bSAxq','u2vSzwn0ihrOzq','mZiXotKZnKDuD3v3tW','t0zLuuO','reHVCNO','ywDL','ChjVDMLKzwqGDG','BgLJzw5Zzuf1Da','uhvIBgLZAcbJBW','pt09','su1br0u','BNqGvhLWzq','sKDnt3O','qNfzAxu','rMnbufq','CgXHDgzVCM0','lcbTzwrPyv9MAq','CK9ICfy','uLr2q2m','BM9Uzq','BgvZlcbLDgmU','ANPeuNK','wwrQt0y','sgvHzgvYief1Da','z2v0tM9Kzq','zgf0yq','qM9KEsbqyxjHBq','CgjvEgO','C3rHDhvZlgvYCG','yvHQtNq','Dhb0wuG','s3jgtMK','Aw1Hz2vFDxjS','qxj0AwnSzq','x19PBxbVCNrezq','tuX2s28','rMfPBa','tevWCfy','CNzLCIbvuKWGAq','vMfSAwqGsLnptG','C2vUzejVzhK','v0rnzfK','vMfSDwu','ChvZAa','yM9VBgvHBG','yxv0AgvUDgLJyq','zgvMyxvSDa','ExL3EKe','yxbPufq','uLjbyLe','C3rYAw5NAwz5','ihn0CMLUzY4Grq','zNzcDvu','wKv6wKm','q3DPug4','zxjPzMLJyxrPBW','qMvHCMvYia','B3DSCwq','x19LC01VzhvSzq','ieXPy2vUC2u','tePutuW','B3jFBwvZC2fNzq','q3jLzgvUDgLHBa','BNbtC0q','kcGOlISPkYKRkq','BwvKAwfFzMLSzq','DM5jEuC','zwrLBNrPywWGva','vvv1zxm','yxbOlNrOCMvHza','AwnLBNnL','DMLKzw9FDxjS','z2v0','rvbMtuO','uvP4yNm','Dezls08','vvL4uwK','r2vUzxjPyYbbDq','whbMC2y','AwTmuMm','AweGqxv0AgvUDa','Bwv0zxjZ','Aw9UrxjYB3i','BujOA0W','wKfnvKS','nJqWqMv5yuD4','DgvYCW','vKLeru8','zfj3Ahm','DxnLCKLK','tMfTzq','Cfj3wKm','u3LODeK','BJHUlxDVCMTMBa','weLItMO','BNrLBNqGDg8Gva','t2XOte4','uhjLzgvMAw5Lza','DgHYzwfKC1b1yG','DgvYCY5WyxjHBq','vxLdEhm','qwjuqMK','Dhr4ww8','mte5mZmXA05ksgnX','zwfKzxiGkef1Da','l3rOCMvHzhnFCa','CY5UzxqVDJeUma','C2vHCMnO','zMf1Bhq','qxv0Aa','qwPWtNK','q2fAt2m','v05lCuO','CYbYzxf1AxjLza','DNn1uwm','rNHkrw4','Ag5rzhK','BxPNExq','AwfSCW','C29JAwfSuhjVta','yMXPC2G','Cg5rq2G','AwnHDgLVBIWGsa','DxjSxW','z2v0q3jLzgvUDa','BgLJzw5ZzuTLEq','qMnLAxC','ALfUvgK','qM9KEq','BwfPBG','zgvUDgLHBfr5Ca','zxnZAw5NifrPBq','CMvWBgfJzq','z0Pvq1C','swzwu2i','BMfTzq','ChjLzgvMAw5Lza','DMfSDwu','BwvZC2fNzq','mNLPAfPVza','CMf3','y2fWDgLVBG','z2v0tM9KzvbHCG','BgLZAa','zxHLy3v0zq','mZG4ntyZmKPRCgrrsa','DgLVBG','Ahr0CeHLywrLCG','B0n5rxy','vhLWzq','zwf0DxjLCW','AMTHwLa','AgvHzgvYugfYyq','C3rYAw5N','B251D2K','twvKAweGuhjVyW','yxbWBhK','mJi1mdu4nhbXvujHBq','ruz1C2C','uLjwqwy','sLPyvvC','Dhb3A3u','qwrKifbHCMfTzq','r0vIuuO','B3b0Aw9UCW','uNL3CLe','DMvYvxjS','r0vjsKe','rvjst1i','Cg9ZDa','l2fWAs92ms92zq','sw1Hz2u','tM9Kzu9WzxjHDa','q1P0zfi','vw5WrM0','sw52ywXPzcbkuW','B0vcwMK','AuDfDhO','DxiTyMfJA2vUza','DhPbz1m','AKvWBgS','r05SzNG','yNf6Awu','Ag9YAxPHDgLVBG','y3rPB24','u29JAwfSifbYBW','CIbSAwnLBNnLia','AhjLywrZihDPDa','mtq4otm2CvHTsejs','zxj2zxiGkguUzW','se9qu0C'];_0x195d=function(){return _0x5f3e3d;};return _0x195d();}var __importDefault=this&&this[_0x4be53d(0xa8)+_0x4be53d(0xf2)]||function(_0x4f063a){const _0x40f468=_0x4be53d;return _0x4f063a&&_0x4f063a[_0x40f468(0xc0)]?_0x4f063a:{'default':_0x4f063a};};Object['defineProp'+'erty'](exports,_0x4be53d(0xc0),{'value':!![]}),exports['ThreadsPub'+_0x4be53d(0x115)]=void(-0x11ce+0x103e+0x190);const n8n_workflow_1=require(_0x4be53d(0xe3)+'ow'),axios_1=__importDefault(require('axios'));class ThreadsPublish{constructor(){const _0xeab98a=_0x4be53d,_0x143b3f={'DHorz':'Threads\x20Pu'+_0xeab98a(0xfe),'jsaUV':_0xeab98a(0xe8)+_0xeab98a(0x115),'eUmPL':_0xeab98a(0x1b4),'pnQCh':_0xeab98a(0x8e)+_0xeab98a(0xe5)+_0xeab98a(0x141)+_0xeab98a(0x1ba)+_0xeab98a(0x1cd)+'e','asWTy':_0xeab98a(0x107),'JRmpw':_0xeab98a(0xfd)+_0xeab98a(0xcc),'NYlrg':_0xeab98a(0x1ad)+_0xeab98a(0x1bb),'bqzie':'predefined'+'Credential'+_0xeab98a(0x11b),'fUFQR':_0xeab98a(0x119)+_0xeab98a(0xf3),'OlhLN':'genericCre'+_0xeab98a(0x108)+'e','UYxQi':_0xeab98a(0x165)+'Auth','SyhtI':_0xeab98a(0x150),'ISqvj':'platform','UyCxs':_0xeab98a(0x12a),'sEGfQ':'Threads','RRAbQ':_0xeab98a(0x8d)+_0xeab98a(0x1ab)+'n','yjJNy':'None','sedPt':'none','ZlUYO':_0xeab98a(0x13f)+_0xeab98a(0xc1),'YYCAk':_0xeab98a(0x1a4)+_0xeab98a(0x12c),'RTvCc':_0xeab98a(0x11f),'iMMMd':'The\x20base\x20U'+_0xeab98a(0x1c1)+_0xeab98a(0x1b8)+_0xeab98a(0x143)+_0xeab98a(0x198)+_0xeab98a(0x17d)+_0xeab98a(0x1c4)+_0xeab98a(0x173)+_0xeab98a(0xbd)+'n','ZAMVK':'authentica'+_0xeab98a(0x118),'WNKqJ':_0xeab98a(0xe7)+_0xeab98a(0x1c5)+_0xeab98a(0x1ca),'mzgyt':_0xeab98a(0x1c2)+_0xeab98a(0xc9)+_0xeab98a(0x1d1),'PZJNY':_0xeab98a(0x9d)+'h','WScSS':'Bearer\x20Aut'+'h','UrfEw':'sendHeader'+'s','yKQzK':_0xeab98a(0xb2),'ZRnEF':_0xeab98a(0x1cb)+'ameters','vsuQc':_0xeab98a(0x11e)+_0xeab98a(0xd7),'EOiCF':_0xeab98a(0x152)+_0xeab98a(0x13e),'mBhkL':'Add\x20Header','YdjOF':_0xeab98a(0x10d),'XIbNj':_0xeab98a(0xb0),'zeGxa':_0xeab98a(0x10f),'MLvKo':_0xeab98a(0x1b2),'cvdWt':'sendBody','RKIwJ':'Body\x20Conte'+_0xeab98a(0x91),'jQnTi':'JSON','GEIJA':_0xeab98a(0x148),'YSZmD':_0xeab98a(0x19b),'EFusg':_0xeab98a(0x112),'QZxbs':_0xeab98a(0x128)+'ter','bQrjF':'parameter','YUJXg':'Parameter','UUues':_0xeab98a(0xe0),'EmRNx':_0xeab98a(0x1b1),'tzAgS':_0xeab98a(0xad)+_0xeab98a(0xb9)+'xpected\x20ke'+'ys:\x20text,\x20'+'media_type'+_0xeab98a(0x96)+_0xeab98a(0x9a)};this[_0xeab98a(0x1aa)+'n']={'displayName':_0x143b3f[_0xeab98a(0x8a)],'name':_0x143b3f[_0xeab98a(0x18a)],'icon':_0xeab98a(0x14c)+_0xeab98a(0x1d3),'group':[_0x143b3f['eUmPL']],'version':0x1,'description':_0x143b3f[_0xeab98a(0xff)],'defaults':{'name':_0x143b3f[_0xeab98a(0x8a)]},'inputs':[_0x143b3f[_0xeab98a(0x14b)]],'outputs':[_0xeab98a(0x107)],'credentials':[{'name':_0x143b3f[_0xeab98a(0x1b5)],'required':!![],'displayOptions':{'show':{'licenseAuthentication':[_0x143b3f['JRmpw']]}}},{'name':_0x143b3f['NYlrg'],'required':!![],'displayOptions':{'show':{'authentication':[_0x143b3f[_0xeab98a(0x13c)]]}}},{'name':_0x143b3f[_0xeab98a(0x1a6)],'required':!![],'displayOptions':{'show':{'authentication':[_0x143b3f[_0xeab98a(0xe6)]],'genericAuthType':[_0x143b3f[_0xeab98a(0x1a6)]]}}},{'name':_0x143b3f['UYxQi'],'required':!![],'displayOptions':{'show':{'authentication':[_0x143b3f['OlhLN']],'genericAuthType':['httpBearer'+_0xeab98a(0xf3)]}}}],'properties':[{'displayName':_0x143b3f[_0xeab98a(0xe2)],'name':_0x143b3f['ISqvj'],'type':_0x143b3f[_0xeab98a(0xea)],'options':[{'name':_0x143b3f[_0xeab98a(0x14f)],'value':_0x143b3f[_0xeab98a(0x14f)]}],'default':_0x143b3f['sEGfQ'],'noDataExpression':!![],'description':_0xeab98a(0x87)+_0xeab98a(0x19d)+'atform\x20to\x20'+_0xeab98a(0x15f)},{'displayName':'License\x20Au'+'thenticati'+'on','name':_0x143b3f[_0xeab98a(0xb7)],'type':_0x143b3f[_0xeab98a(0xea)],'options':[{'name':_0x143b3f[_0xeab98a(0x16e)],'value':_0x143b3f[_0xeab98a(0x178)]},{'name':_0x143b3f[_0xeab98a(0x1c7)],'value':_0x143b3f[_0xeab98a(0x1b5)]}],'default':_0x143b3f[_0xeab98a(0x178)],'description':'Verify\x20you'+_0xeab98a(0x140)+_0xeab98a(0x169)+'ditional\x20f'+_0xeab98a(0x11c)},{'displayName':_0xeab98a(0x84)+_0xeab98a(0x156),'name':_0x143b3f['YYCAk'],'type':_0x143b3f[_0xeab98a(0x98)],'default':_0xeab98a(0x17b)+_0xeab98a(0x138)+_0xeab98a(0x149)+_0xeab98a(0x155),'description':_0x143b3f['iMMMd'],'displayOptions':{'show':{'licenseAuthentication':[_0x143b3f[_0xeab98a(0x1b5)]]}}},{'displayName':_0xeab98a(0x146)+_0xeab98a(0x118),'name':_0x143b3f[_0xeab98a(0xda)],'type':_0x143b3f[_0xeab98a(0xea)],'options':[{'name':_0x143b3f[_0xeab98a(0xf6)],'value':_0xeab98a(0x10e)+_0xeab98a(0xc4)+'Type'},{'name':_0x143b3f[_0xeab98a(0xfb)],'value':_0x143b3f[_0xeab98a(0xe6)]},{'name':_0x143b3f[_0xeab98a(0x16e)],'value':_0xeab98a(0x99)}],'default':_0x143b3f[_0xeab98a(0x13c)]},{'displayName':_0xeab98a(0xd3)+_0xeab98a(0x15b),'name':'genericAut'+_0xeab98a(0x1d2),'type':_0x143b3f[_0xeab98a(0xea)],'options':[{'name':_0x143b3f['PZJNY'],'value':_0x143b3f[_0xeab98a(0x1a6)]},{'name':_0x143b3f['WScSS'],'value':_0x143b3f[_0xeab98a(0xd2)]}],'default':_0x143b3f[_0xeab98a(0x1a6)],'displayOptions':{'show':{'authentication':[_0xeab98a(0x175)+_0xeab98a(0x108)+'e']}}},{'displayName':_0xeab98a(0x14d)+'rs','name':_0x143b3f['UrfEw'],'type':_0x143b3f[_0xeab98a(0x199)],'default':![],'noDataExpression':!![]},{'displayName':_0x143b3f[_0xeab98a(0x1c8)],'name':_0x143b3f[_0xeab98a(0xf8)],'type':_0x143b3f[_0xeab98a(0x1be)],'displayOptions':{'show':{'sendHeaders':[!![]]}},'typeOptions':{'multipleValues':!![]},'placeholder':_0x143b3f[_0xeab98a(0xd9)],'default':{},'options':[{'name':_0xeab98a(0x172),'displayName':'Parameter','values':[{'displayName':'Name','name':_0x143b3f[_0xeab98a(0x9c)],'type':_0x143b3f[_0xeab98a(0x98)],'default':''},{'displayName':_0x143b3f[_0xeab98a(0xe4)],'name':_0x143b3f[_0xeab98a(0x180)],'type':'string','default':''}]}]},{'displayName':_0x143b3f[_0xeab98a(0xa9)],'name':_0x143b3f[_0xeab98a(0x14e)],'type':_0xeab98a(0xb2),'default':!![],'noDataExpression':!![]},{'displayName':_0x143b3f['RKIwJ'],'name':'contentTyp'+'e','type':_0x143b3f[_0xeab98a(0xea)],'displayOptions':{'show':{'sendBody':[!![]]}},'options':[{'name':_0x143b3f[_0xeab98a(0x105)],'value':_0x143b3f[_0xeab98a(0x12d)]},{'name':_0x143b3f[_0xeab98a(0x1a2)],'value':_0x143b3f['EFusg']}],'default':_0x143b3f[_0xeab98a(0x124)]},{'displayName':_0xeab98a(0xa0)+'eters','name':'bodyParame'+_0xeab98a(0xdc),'type':_0x143b3f[_0xeab98a(0x1be)],'displayOptions':{'show':{'sendBody':[!![]],'contentType':[_0x143b3f[_0xeab98a(0x12d)]]}},'typeOptions':{'multipleValues':!![]},'placeholder':_0x143b3f[_0xeab98a(0xd0)],'default':{},'options':[{'name':_0x143b3f[_0xeab98a(0x16d)],'displayName':_0x143b3f['YUJXg'],'values':[{'displayName':_0x143b3f[_0xeab98a(0xca)],'name':_0x143b3f['YdjOF'],'type':_0xeab98a(0x11f),'default':''},{'displayName':_0x143b3f[_0xeab98a(0xe4)],'name':'value','type':_0x143b3f[_0xeab98a(0x98)],'default':''}]}]},{'displayName':_0xeab98a(0x106),'name':_0x143b3f[_0xeab98a(0x82)],'type':_0x143b3f['GEIJA'],'displayOptions':{'show':{'sendBody':[!![]],'contentType':[_0x143b3f[_0xeab98a(0x124)]]}},'default':'','description':_0x143b3f[_0xeab98a(0x139)]}]};}async[_0x4be53d(0x116)](){const _0x242e01=_0x4be53d,_0x28cccc={'ikLRc':function(_0x212542,_0x3bd627){return _0x212542!==_0x3bd627;},'FcAPT':_0x242e01(0x18e),'TxNtp':function(_0x138ad8,_0x4dfe92){return _0x138ad8<_0x4dfe92;},'TLlwB':_0x242e01(0xa2)+_0x242e01(0xc3),'Bceiw':function(_0x270119,_0x4487af){return _0x270119===_0x4487af;},'ZGlhF':_0x242e01(0x12e),'IfVSb':_0x242e01(0x121)+_0x242e01(0x109)+_0x242e01(0x157),'Xpfsf':_0x242e01(0xc8),'tFKKO':'No\x20Access\x20'+_0x242e01(0x1a0)+_0x242e01(0x17f)+_0x242e01(0x8c)+_0x242e01(0xd6)+_0x242e01(0x100)+_0x242e01(0xee)+_0x242e01(0x13d)+'),\x20or\x20Body'+_0x242e01(0x19f)+_0x242e01(0x1af),'tptYH':function(_0x499aa0,_0x233a07){return _0x499aa0===_0x233a07;},'RpJcb':'DkGqZ','oEBZi':_0x242e01(0x171)+_0x242e01(0x1bf)+'ck\x20Respons'+'e)','XyWWh':function(_0x522a00,_0x530ec6){return _0x522a00===_0x530ec6;},'CwiPn':function(_0x287656,_0x2fd3c9){return _0x287656===_0x2fd3c9;},'ZEzZC':_0x242e01(0x189),'oCyEv':_0x242e01(0xbe),'FxJEn':_0x242e01(0x84)+_0x242e01(0xac)+_0x242e01(0xf7)+'\x20for\x20verif'+_0x242e01(0x196),'yywzA':function(_0x1c0006,_0x510e06){return _0x1c0006===_0x510e06;},'apiPT':_0x242e01(0x181)+_0x242e01(0x161),'EvIvL':_0x242e01(0x85)+_0x242e01(0xcb)+_0x242e01(0xf0),'WgQuX':_0x242e01(0xaf),'IldeG':'none','ngEJc':_0x242e01(0xfd)+_0x242e01(0xcc),'LIWeh':function(_0x2fe1ef,_0x5a78a5){return _0x2fe1ef!==_0x5a78a5;},'OmjeV':'BYtti','jzDRy':_0x242e01(0x1a8),'mpeaI':'licenseSer'+_0x242e01(0x12c),'nTglY':'RRVAf','YmxHH':_0x242e01(0x1a3)+_0x242e01(0x159),'gMtkh':function(_0x5a509d,_0x5b74ec,_0x32e6fe){return _0x5a509d(_0x5b74ec,_0x32e6fe);},'iGEtz':'bYgdc','npSsD':'CMgOq','ttxYo':_0x242e01(0xb3)+_0x242e01(0x118),'CZtdR':_0x242e01(0x175)+'dentialTyp'+'e','HOPSG':_0x242e01(0x195),'AbTBi':function(_0x8a55e8,_0x39a97a){return _0x8a55e8===_0x39a97a;},'jEplk':_0x242e01(0x119)+_0x242e01(0xf3),'tpwku':function(_0x1dfb4a,_0x3968b5){return _0x1dfb4a===_0x3968b5;},'aBRHy':'hYHic','EPfMJ':_0x242e01(0x145),'CaZOc':_0x242e01(0x165)+_0x242e01(0xf3),'dRwhs':_0x242e01(0x134),'OFeQJ':_0x242e01(0xae),'qkrUQ':_0x242e01(0x148),'AjpNy':_0x242e01(0x14a)+_0x242e01(0xe9)+_0x242e01(0x158),'KrFNi':_0x242e01(0x1b1),'dxJOE':function(_0x17e323,_0x553b7b){return _0x17e323===_0x553b7b;},'gJUCW':_0x242e01(0xa3),'nvmkU':_0x242e01(0xa1),'aECxw':function(_0x226689,_0x44d706){return _0x226689===_0x44d706;},'MwSZE':_0x242e01(0x11d),'RywrQ':_0x242e01(0x1b0),'fvBuU':_0x242e01(0x129),'onuwi':_0x242e01(0x95),'LEppV':function(_0x3fbd3d,_0x22077e){return _0x3fbd3d<=_0x22077e;},'VnfXG':function(_0x32ac37,_0x9ad00a){return _0x32ac37===_0x9ad00a;},'mgrSm':_0x242e01(0xa7),'MKxGE':_0x242e01(0x8f),'atzqL':function(_0x47681d,_0x40f604){return _0x47681d<_0x40f604;},'nzwbG':function(_0x4cd298,_0x58781b){return _0x4cd298>_0x58781b;},'dbuQC':_0x242e01(0xc2),'jysKA':_0x242e01(0x131),'mykCm':_0x242e01(0x1bc),'uyajj':function(_0x45437c,_0x210a57,_0x565942){return _0x45437c(_0x210a57,_0x565942);},'dtmFL':_0x242e01(0x90),'jIQiT':function(_0x5c4e30,_0x3eb712){return _0x5c4e30===_0x3eb712;},'GtOFQ':'Carousel','JGMOz':function(_0x19e819,_0x24442f){return _0x19e819===_0x24442f;},'pRwZC':_0x242e01(0x126),'rObpV':_0x242e01(0xdd),'hbBuI':'CAROUSEL','BqYiu':function(_0x539f03,_0x5b6700){return _0x539f03===_0x5b6700;},'OPItm':_0x242e01(0x1c6),'hnQdy':_0x242e01(0x18b),'smGJG':_0x242e01(0x1a5),'qbgbI':function(_0x197f62,_0x981aa3,_0x11e6da){return _0x197f62(_0x981aa3,_0x11e6da);},'QwRzq':function(_0xf12fc8,_0x4b1a63,_0x2dde4a,_0x40ef66){return _0xf12fc8(_0x4b1a63,_0x2dde4a,_0x40ef66);}};var _0x161e12;const _0x179c13=this['getInputDa'+'ta'](),_0xe8d61=[],_0x523cf2=_0x28cccc[_0x242e01(0x17e)],_0x4c2dfc=async(_0x492fb8,_0x18a902)=>{const _0x3ceda9=_0x242e01;let _0x3ce1e0='',_0x4c2b9b=-0xc6*0x2+-0x18c+0x318;while(_0x28cccc[_0x3ceda9(0xd5)](_0x3ce1e0,_0x28cccc[_0x3ceda9(0x94)])&&_0x28cccc[_0x3ceda9(0x191)](_0x4c2b9b,-0xbd4+0x17*0xbf+-0x537)){await new Promise(_0x8400af=>setTimeout(_0x8400af,-0x265e+0xfe8*0x1+0x1e46));try{const _0x1383c1=await axios_1['default'][_0x3ceda9(0xce)](_0x523cf2+'/'+_0x18a902,{'params':{'access_token':_0x492fb8,'fields':_0x28cccc['TLlwB']}});_0x3ce1e0=_0x1383c1[_0x3ceda9(0x9f)][_0x3ceda9(0x163)];if(_0x28cccc[_0x3ceda9(0x104)](_0x3ce1e0,_0x28cccc[_0x3ceda9(0x147)]))throw new Error(_0x3ceda9(0x164)+'ad\x20Failed:'+'\x20'+_0x1383c1[_0x3ceda9(0x9f)][_0x3ceda9(0x174)+_0x3ceda9(0x8b)]);}catch(_0x352a28){}_0x4c2b9b++;}if(_0x28cccc['ikLRc'](_0x3ce1e0,_0x28cccc[_0x3ceda9(0x94)]))throw new Error(_0x28cccc[_0x3ceda9(0x10c)]);},_0x4a5b21=async(_0x509518,_0x85b5bc,_0x3bd39b)=>{const _0x3f0b3b=_0x242e01;if(_0x28cccc[_0x3f0b3b(0x104)](_0x28cccc[_0x3f0b3b(0xd4)],'vnIyG')){const _0x4984c7=await axios_1[_0x3f0b3b(0xb4)][_0x3f0b3b(0x12f)](_0x523cf2+'/'+_0x85b5bc+(_0x3f0b3b(0xef)+_0x3f0b3b(0x18f)),{'access_token':_0x509518,'creation_id':_0x3bd39b});return _0x4984c7[_0x3f0b3b(0x9f)]['id'];}else{if(_0x92f021){const _0x269ab8=_0x46e2f0[_0x3f0b3b(0x122)](_0x42b5bb,arguments);return _0x46cd8f=null,_0x269ab8;}}},_0x257a8a=async(_0x10c1c9,_0x3f3ef8)=>{const _0x4dcb50=_0x242e01,_0x224ca0={'JiNTq':_0x28cccc['tFKKO']};var _0x514a26,_0x3d4a6f;const _0x240a35=_0x10c1c9[_0x4dcb50(0x10a)](/\/$/,'');try{if(_0x28cccc[_0x4dcb50(0xa4)](_0x28cccc[_0x4dcb50(0x1b6)],_0x28cccc['RpJcb'])){const _0x1e5ccf=await axios_1['default'][_0x4dcb50(0xce)](_0x240a35+(_0x4dcb50(0x130)+'rify-licen'+'se'),{'headers':{'x-api-key':_0x3f3ef8},'timeout':0x1388});if(_0x28cccc[_0x4dcb50(0xa4)](_0x1e5ccf[_0x4dcb50(0x9f)][_0x4dcb50(0x1ae)],![]))throw new Error(_0x28cccc[_0x4dcb50(0x136)]);return _0x1e5ccf[_0x4dcb50(0x9f)];}else throw new _0x30cffa[(_0x4dcb50(0x132))+(_0x4dcb50(0xd8))](this[_0x4dcb50(0x9e)](),_0x224ca0[_0x4dcb50(0x166)]);}catch(_0x4b425a){const _0x568de1=(_0x28cccc[_0x4dcb50(0x104)](_0x3d4a6f=_0x28cccc['tptYH'](_0x514a26=_0x4b425a['response'],null)||_0x28cccc[_0x4dcb50(0x1b3)](_0x514a26,void(0x181d*-0x1+0xa79+0xda4))?void(-0x2*-0x3ee+0x70+0x213*-0x4):_0x514a26[_0x4dcb50(0x9f)],null)||_0x28cccc['tptYH'](_0x3d4a6f,void(0x1d8d+-0x653*0x5+0x1*0x212))?void(-0x95*-0x2e+-0x3*0x233+-0x409*0x5):_0x3d4a6f['error'])||_0x4b425a['message'];throw new Error(_0x4dcb50(0x167)+_0x4dcb50(0x188)+_0x4dcb50(0x17a)+_0x568de1);}};for(let _0x186533=0xbd7*-0x2+-0x19f0+-0x1b6*-0x1d;_0x186533<_0x179c13[_0x242e01(0x19c)];_0x186533++){if(_0x28cccc[_0x242e01(0x1b3)](_0x242e01(0x183),_0x28cccc[_0x242e01(0x1d0)]))throw new _0x1bf226[(_0x242e01(0x132))+(_0x242e01(0xd8))](this[_0x242e01(0x9e)](),_0x242e01(0x135)+'ON\x20Body');else try{const _0x3ce75a=this[_0x242e01(0x114)+'ameter']('licenseAut'+_0x242e01(0x1ab)+'n',_0x186533,_0x28cccc['IldeG']);if(_0x3ce75a===_0x28cccc[_0x242e01(0x154)]){if(_0x28cccc[_0x242e01(0x15c)](_0x28cccc[_0x242e01(0x184)],_0x28cccc[_0x242e01(0x9b)])){const _0x2a0769=this[_0x242e01(0x114)+_0x242e01(0x185)](_0x28cccc['mpeaI'],_0x186533,'');if(!_0x2a0769){if(_0x28cccc[_0x242e01(0x1b3)](_0x242e01(0x125),_0x28cccc['nTglY']))throw new n8n_workflow_1[(_0x242e01(0x132))+(_0x242e01(0xd8))](this[_0x242e01(0x9e)](),'License\x20Se'+_0x242e01(0xac)+'s\x20required'+'\x20for\x20verif'+_0x242e01(0x196));else{const _0x5eaa80=_0x2b4c4a?function(){const _0x4dd98c=_0x242e01;if(_0x5b092f){const _0x128c79=_0x46ae43[_0x4dd98c(0x122)](_0x8ca903,arguments);return _0x3b816e=null,_0x128c79;}}:function(){};return _0x5187cc=![],_0x5eaa80;}}try{const _0x5debf9=await this[_0x242e01(0x102)+_0x242e01(0xfc)](_0x242e01(0xfd)+_0x242e01(0xcc)),_0x40fa78=_0x5debf9[_0x242e01(0x103)];if(!_0x40fa78)throw new Error(_0x28cccc['YmxHH']);await _0x28cccc[_0x242e01(0x160)](_0x257a8a,_0x2a0769,_0x40fa78);}catch(_0x334a33){if(_0x28cccc[_0x242e01(0x137)]===_0x28cccc[_0x242e01(0xc5)])return _0x2566f8&&_0x3fa632[_0x242e01(0xc0)]?_0x15b1b3:{'default':_0x30e943};else throw new n8n_workflow_1[(_0x242e01(0x132))+(_0x242e01(0xd8))](this[_0x242e01(0x9e)](),_0x334a33[_0x242e01(0x110)]);}}else _0x2d6bb0=_0x32f68d[_0x242e01(0x1b9)];}const _0xa16c7b=this[_0x242e01(0x114)+'ameter'](_0x28cccc[_0x242e01(0xec)],_0x186533);let _0x2efc9e='';if(_0x28cccc[_0x242e01(0x104)](_0xa16c7b,_0x242e01(0x10e)+_0x242e01(0xc4)+'Type'))try{const _0x428d74=await this['getCredent'+_0x242e01(0xfc)](_0x242e01(0x1ad)+_0x242e01(0x1bb));_0x2efc9e=_0x428d74['accessToke'+'n'];}catch(_0x5cfb3e){}else{if(_0x28cccc[_0x242e01(0xb5)](_0xa16c7b,_0x28cccc[_0x242e01(0x133)])){if(_0x28cccc[_0x242e01(0xa4)](_0x242e01(0x13b),_0x28cccc[_0x242e01(0x144)]))_0x3cbb02=_0x28cccc[_0x242e01(0xbc)](typeof _0x2ea64a,'object')?_0x4ee0e1:_0x15bcc6[_0x242e01(0x151)](_0xfa5a1c);else try{const _0x38a5b4=this['getNodePar'+'ameter'](_0x242e01(0x193)+_0x242e01(0x1d2),_0x186533),_0x5a0537=await this[_0x242e01(0x102)+_0x242e01(0xfc)](_0x38a5b4);if(_0x28cccc[_0x242e01(0xeb)](_0x38a5b4,_0x28cccc[_0x242e01(0x13a)])){if(_0x28cccc[_0x242e01(0x127)](_0x28cccc[_0x242e01(0x190)],_0x28cccc[_0x242e01(0xcf)]))try{_0x15a82b=_0x28cccc[_0x242e01(0xa4)](typeof _0x3e6c8b,_0x28cccc[_0x242e01(0xbb)])?_0x3d02aa:_0x435a45[_0x242e01(0x151)](_0x9bf90c);}catch(_0x24dd39){throw new _0x46f5f6[(_0x242e01(0x132))+'ionError'](this['getNode'](),_0x242e01(0x135)+_0x242e01(0x182));}else{let _0x42b2c5=_0x5a0537[_0x242e01(0x10f)]||'';if(_0x42b2c5[_0x242e01(0x1a9)](_0x28cccc[_0x242e01(0x11a)]))_0x42b2c5=_0x42b2c5['replace'](_0x28cccc[_0x242e01(0x11a)],'')[_0x242e01(0x177)]();_0x2efc9e=_0x42b2c5;}}else{if(_0x38a5b4===_0x28cccc[_0x242e01(0xf5)]){if(_0x28cccc[_0x242e01(0xd5)](_0x242e01(0x16a),_0x28cccc[_0x242e01(0xde)]))_0x2efc9e=_0x5a0537['token'];else throw new _0x36e936(_0x242e01(0x1ac)+_0x242e01(0x18d)+_0x546484[_0x242e01(0x110)]+'\x20'+((_0x28cccc[_0x242e01(0xa4)](_0x12276c=_0x4530ad[_0x242e01(0x1a1)],null)||_0x28cccc[_0x242e01(0xa4)](_0x12b530,void(-0x19b+-0x5*-0xb0+-0x43*0x7))?void(0x10*0x182+0x1*0x171b+0x71*-0x6b):_0x58ed09[_0x242e01(0x9f)])?_0x20acd3[_0x242e01(0xb8)](_0x598fef[_0x242e01(0x1a1)][_0x242e01(0x9f)]):''));}}}catch(_0x532973){}}}const _0x5cc425=this[_0x242e01(0x114)+'ameter'](_0x28cccc[_0x242e01(0x89)],_0x186533,![]);let _0x12ea46={};if(_0x5cc425){const _0x250980=this[_0x242e01(0x114)+'ameter'](_0x242e01(0x16c)+'e',_0x186533);if(_0x250980===_0x28cccc[_0x242e01(0x168)]){const _0x49950f=this[_0x242e01(0x114)+_0x242e01(0x185)](_0x28cccc[_0x242e01(0xf4)],_0x186533,[]);for(const _0x57b31f of _0x49950f){_0x12ea46[_0x57b31f[_0x242e01(0x10d)]]=_0x57b31f[_0x242e01(0x10f)];}}else{const _0x4e0f18=this['getNodePar'+'ameter'](_0x28cccc[_0x242e01(0xa5)],_0x186533,'');if(_0x4e0f18){if(_0x28cccc[_0x242e01(0x179)](_0x28cccc[_0x242e01(0x10b)],_0x28cccc['nvmkU']))_0x10dd00=_0x47321a[_0x242e01(0x10a)](_0x28cccc[_0x242e01(0x11a)],'')[_0x242e01(0x177)]();else try{if(_0x28cccc['aECxw'](_0x28cccc['MwSZE'],_0x28cccc[_0x242e01(0x12b)]))throw new _0x5570f8[(_0x242e01(0x132))+(_0x242e01(0xd8))](this['getNode'](),_0x28cccc[_0x242e01(0xf9)]);else _0x12ea46=_0x28cccc[_0x242e01(0xb5)](typeof _0x4e0f18,_0x28cccc[_0x242e01(0xbb)])?_0x4e0f18:JSON[_0x242e01(0x151)](_0x4e0f18);}catch(_0xe969b9){throw new n8n_workflow_1[(_0x242e01(0x132))+(_0x242e01(0xd8))](this['getNode'](),_0x242e01(0x135)+_0x242e01(0x182));}}}}const _0x29c4b2=this['getNodePar'+_0x242e01(0x185)](_0x242e01(0x187)+'s',_0x186533,![]);if(_0x29c4b2){const _0x39c63b=this['getNodePar'+_0x242e01(0x185)](_0x242e01(0x11e)+'meters.par'+_0x242e01(0x185),_0x186533,[]);for(const _0xd963d1 of _0x39c63b){if(_0x28cccc[_0x242e01(0x127)](_0xd963d1[_0x242e01(0x10d)][_0x242e01(0x19a)+'e'](),_0x28cccc[_0x242e01(0xb6)])){const _0x32e527=_0xd963d1[_0x242e01(0x10f)];if(_0x32e527[_0x242e01(0x1a9)](_0x28cccc[_0x242e01(0x11a)])){if(_0x28cccc['fvBuU']!==_0x28cccc[_0x242e01(0xba)]){const _0x1617e1=_0x28990f[_0x242e01(0x10f)];_0x1617e1[_0x242e01(0x1a9)](_0x28cccc['oCyEv'])?_0xf9b174=_0x1617e1['replace'](_0x28cccc[_0x242e01(0x11a)],'')[_0x242e01(0x177)]():_0xb73765=_0x1617e1[_0x242e01(0x177)]();}else _0x2efc9e=_0x32e527[_0x242e01(0x10a)](_0x28cccc[_0x242e01(0x11a)],'')[_0x242e01(0x177)]();}else _0x2efc9e=_0x32e527[_0x242e01(0x177)]();}}}if(_0x12ea46[_0x242e01(0x1bd)+'en'])_0x2efc9e=_0x12ea46[_0x242e01(0x1bd)+'en'];if(_0x12ea46[_0x242e01(0x16f)+'ken'])_0x2efc9e=_0x12ea46[_0x242e01(0x16f)+'ken'];if(_0x12ea46['accessToke'+'n'])_0x2efc9e=_0x12ea46['accessToke'+'n'];if(!_0x2efc9e)throw new n8n_workflow_1[(_0x242e01(0x132))+(_0x242e01(0xd8))](this[_0x242e01(0x9e)](),_0x28cccc[_0x242e01(0xd1)]);const _0x3b6374=this[_0x242e01(0x114)+_0x242e01(0x185)](_0x28cccc[_0x242e01(0x120)],_0x186533);let _0x41bc89='me';if(_0x12ea46[_0x242e01(0x1a7)])_0x41bc89=_0x12ea46[_0x242e01(0x1a7)];if(_0x12ea46['userId'])_0x41bc89=_0x12ea46[_0x242e01(0xdf)];let _0x465690=_0x12ea46['text']||_0x12ea46[_0x242e01(0x113)]||_0x12ea46[_0x242e01(0x17c)]||'',_0x3e2886=_0x12ea46[_0x242e01(0x15d)]||_0x12ea46[_0x242e01(0x192)]||'Text',_0x40ada6=[];if(Array[_0x242e01(0x1c3)](_0x12ea46[_0x242e01(0xc7)+'s']))_0x40ada6=_0x12ea46[_0x242e01(0xc7)+'s'];if(Array[_0x242e01(0x1c3)](_0x12ea46[_0x242e01(0x1c9)]))_0x40ada6=_0x12ea46[_0x242e01(0x1c9)];for(let _0x4a5515=0xd6c*-0x1+-0x2331+0xe*0x379;_0x28cccc[_0x242e01(0xab)](_0x4a5515,0x2124+0x1801+0x827*-0x7);_0x4a5515++){if(_0x12ea46[_0x242e01(0x101)+_0x4a5515])_0x40ada6[_0x242e01(0xb1)](_0x12ea46[_0x242e01(0x101)+_0x4a5515]);}if(_0x28cccc['VnfXG'](_0x3e2886,_0x28cccc['mgrSm']))_0x3e2886=_0x242e01(0x1d4);const _0x5c0811=_0x465690[_0x242e01(0x86)](_0x28cccc['MKxGE']),_0x1d546d=[];let _0x49b357=null;for(let _0x21271a=-0x1*0xe01+-0x217b*0x1+0x3*0xfd4;_0x28cccc['atzqL'](_0x21271a,_0x5c0811[_0x242e01(0x19c)]);_0x21271a++){const _0x2b40e6=_0x5c0811[_0x21271a],_0x340db5=_0x21271a===-0x17c4+-0x10fd+0x28c1;let _0x144ece=null;const _0xf5e15=_0x340db5&&_0x28cccc[_0x242e01(0x162)](_0x40ada6[_0x242e01(0x19c)],-0x1*0x196f+0x27*-0x99+0x30be),_0x1abaf6=async(_0xb2687a,_0x170f0e)=>{const _0x40443a=_0x242e01,_0x391e7f={'access_token':_0x2efc9e,'media_type':_0x170f0e};if(_0x170f0e==='IMAGE')_0x391e7f[_0x40443a(0xa6)]=_0xb2687a;else _0x391e7f[_0x40443a(0xcd)]=_0xb2687a;const _0x4daa32=await axios_1[_0x40443a(0xb4)][_0x40443a(0x12f)](_0x523cf2+'/'+_0x41bc89+'/threads',_0x391e7f);return _0x4daa32[_0x40443a(0x9f)]['id'];};try{if(_0x28cccc['AbTBi'](_0x28cccc[_0x242e01(0x1cc)],_0x28cccc['dbuQC'])){if(_0xf5e15&&[_0x28cccc[_0x242e01(0x186)],_0x28cccc[_0x242e01(0x170)],_0x242e01(0x1cf)]['includes'](_0x3e2886)){if(_0x28cccc['AbTBi'](_0x3e2886,_0x28cccc[_0x242e01(0x186)]))_0x144ece=await _0x28cccc['uyajj'](_0x1abaf6,_0x40ada6[-0x68c*-0x1+0x1*0x25b+0x1*-0x8e7],_0x28cccc[_0x242e01(0x176)]);else{if(_0x28cccc['jIQiT'](_0x3e2886,_0x28cccc[_0x242e01(0x170)]))_0x144ece=await _0x28cccc['uyajj'](_0x1abaf6,_0x40ada6[0x4f*-0x69+-0x1a57*0x1+-0xce*-0x49],_0x242e01(0xdd));else{if(_0x3e2886===_0x28cccc[_0x242e01(0x1c0)]){if(_0x28cccc[_0x242e01(0x92)](_0x28cccc[_0x242e01(0xe1)],_0x242e01(0x126))){const _0x22e3f2=[];for(const _0x240c11 of _0x40ada6){const _0x331f7a=_0x240c11['match'](/\.(mp4|mov)$/i),_0x57a1f1=await _0x1abaf6(_0x240c11,_0x331f7a?_0x28cccc[_0x242e01(0x97)]:_0x242e01(0x90));await _0x28cccc[_0x242e01(0x160)](_0x4c2dfc,_0x2efc9e,_0x57a1f1),_0x22e3f2[_0x242e01(0xb1)](_0x57a1f1);}const _0x5dc8c9=await axios_1[_0x242e01(0xb4)][_0x242e01(0x12f)](_0x523cf2+'/'+_0x41bc89+_0x242e01(0x16b),{'access_token':_0x2efc9e,'media_type':_0x28cccc['hbBuI'],'children':_0x22e3f2[_0x242e01(0x83)](','),'text':_0x2b40e6});_0x144ece=_0x5dc8c9[_0x242e01(0x9f)]['id'];}else{if(_0x28cccc[_0x242e01(0xb5)](_0xa4e644['name'][_0x242e01(0x19a)+'e'](),_0x28cccc[_0x242e01(0xb6)])){const _0x3b8538=_0x32a768[_0x242e01(0x10f)];_0x3b8538[_0x242e01(0x1a9)](_0x28cccc[_0x242e01(0x11a)])?_0x208ff1=_0x3b8538['replace'](_0x28cccc[_0x242e01(0x11a)],'')[_0x242e01(0x177)]():_0x20c2d4=_0x3b8538[_0x242e01(0x177)]();}}}}}if(_0x3e2886!==_0x28cccc[_0x242e01(0x1c0)]){const _0x3fb821={'access_token':_0x2efc9e,'media_type':_0x3e2886[_0x242e01(0x15a)+'e'](),'text':_0x2b40e6};if(_0x28cccc[_0x242e01(0x179)](_0x3e2886,_0x242e01(0x131)))_0x3fb821[_0x242e01(0xa6)]=_0x40ada6[0x2367+-0x1d*-0xb3+0x37ae*-0x1];else _0x3fb821[_0x242e01(0xcd)]=_0x40ada6[0x1b3c+-0x2*-0x12c3+0x1b*-0x266];const _0x473e46=await axios_1[_0x242e01(0xb4)]['post'](_0x523cf2+'/'+_0x41bc89+_0x242e01(0x16b),_0x3fb821);_0x144ece=_0x473e46[_0x242e01(0x9f)]['id'];}}else{if(_0x28cccc[_0x242e01(0x93)](_0x28cccc['OPItm'],_0x28cccc[_0x242e01(0xfa)]))throw new _0x5d72f1[(_0x242e01(0x132))+(_0x242e01(0xd8))](this[_0x242e01(0x9e)](),_0x38a994[_0x242e01(0x110)]);else{const _0x462eae={'access_token':_0x2efc9e,'media_type':_0x28cccc['smGJG'],'text':_0x2b40e6};if(_0x49b357)_0x462eae[_0x242e01(0x1ce)+'d']=_0x49b357;const _0x62581e=await axios_1[_0x242e01(0xb4)][_0x242e01(0x12f)](_0x523cf2+'/'+_0x41bc89+_0x242e01(0x16b),_0x462eae);_0x144ece=_0x62581e['data']['id'];}}if(_0x144ece){if(_0xf5e15)await _0x28cccc[_0x242e01(0x19e)](_0x4c2dfc,_0x2efc9e,_0x144ece);const _0x4ee424=await _0x28cccc['QwRzq'](_0x4a5b21,_0x2efc9e,_0x41bc89,_0x144ece);_0x1d546d['push'](_0x4ee424),_0x49b357=_0x4ee424;}}else _0x1da7c5=_0x4b3d12[_0x242e01(0x177)]();}catch(_0x363514){throw new Error(_0x242e01(0x1ac)+'ror:\x20'+_0x363514[_0x242e01(0x110)]+'\x20'+(((_0x161e12=_0x363514[_0x242e01(0x1a1)])===null||_0x28cccc[_0x242e01(0x93)](_0x161e12,void(-0x5*0x711+0x1256+0x13*0xe5))?void(0x1a97*-0x1+-0xe6d*0x2+0x3771):_0x161e12[_0x242e01(0x9f)])?JSON[_0x242e01(0xb8)](_0x363514[_0x242e01(0x1a1)][_0x242e01(0x9f)]):''));}}_0xe8d61[_0x242e01(0xb1)]({'json':{'ids':_0x1d546d,'success':!![]}});}catch(_0x2fe417){if(this['continueOn'+_0x242e01(0xaa)]()){_0xe8d61['push']({'json':{'error':_0x2fe417[_0x242e01(0x110)]}});continue;}throw _0x2fe417;}}return[_0xe8d61];}}exports['ThreadsPub'+'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": {
|