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,24 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SocialProFacebook = void 0;
|
|
4
|
+
class SocialProFacebook {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'socialProFacebook';
|
|
7
|
+
this.displayName = 'Social Pro Facebook/Instagram API';
|
|
8
|
+
this.documentationUrl = 'https://developers.facebook.com/docs/graph-api';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Access Token',
|
|
12
|
+
name: 'accessToken',
|
|
13
|
+
type: 'string',
|
|
14
|
+
typeOptions: {
|
|
15
|
+
password: true,
|
|
16
|
+
},
|
|
17
|
+
default: '',
|
|
18
|
+
required: true,
|
|
19
|
+
description: 'Long-lived User Access Token or Page Access Token',
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.SocialProFacebook = SocialProFacebook;
|
|
@@ -1 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SocialProLicense = void 0;
|
|
4
|
+
class SocialProLicense {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'socialProLicense';
|
|
7
|
+
this.displayName = 'Charlsondou API Key';
|
|
8
|
+
this.documentationUrl = 'https://github.com/charlsondou/n8n-nodes-social-pro';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'License Server URL',
|
|
12
|
+
name: 'serverUrl', // Renamed from licenseServerUrl in Node to serverUrl in Credential
|
|
13
|
+
type: 'string',
|
|
14
|
+
default: 'https://your-backend-app.zeabur.app',
|
|
15
|
+
required: true,
|
|
16
|
+
description: 'The base URL of your backend server (e.g. https://api.example.com)',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
displayName: 'License Key',
|
|
20
|
+
name: 'licenseKey',
|
|
21
|
+
type: 'string',
|
|
22
|
+
typeOptions: { password: true },
|
|
23
|
+
default: '',
|
|
24
|
+
required: true,
|
|
25
|
+
description: 'The License Key provided by Charlson Dou',
|
|
26
|
+
}
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.SocialProLicense = SocialProLicense;
|
|
@@ -1 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SocialProLinkedIn = void 0;
|
|
4
|
+
class SocialProLinkedIn {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'socialProLinkedIn';
|
|
7
|
+
this.displayName = 'Social Pro LinkedIn API';
|
|
8
|
+
this.documentationUrl = 'https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Access Token',
|
|
12
|
+
name: 'accessToken',
|
|
13
|
+
type: 'string',
|
|
14
|
+
typeOptions: {
|
|
15
|
+
password: true,
|
|
16
|
+
},
|
|
17
|
+
default: '',
|
|
18
|
+
required: true,
|
|
19
|
+
description: 'OAuth 2.0 Access Token with w_member_social, r_liteprofile permissions',
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.SocialProLinkedIn = SocialProLinkedIn;
|
|
@@ -1 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SocialProToken = void 0;
|
|
4
|
+
class SocialProToken {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'socialProToken';
|
|
7
|
+
this.displayName = 'Social Pro Token';
|
|
8
|
+
this.documentationUrl = 'https://github.com/charlsondou/n8n-nodes-social-pro';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Access Token',
|
|
12
|
+
name: 'accessToken',
|
|
13
|
+
type: 'string',
|
|
14
|
+
typeOptions: { password: true },
|
|
15
|
+
default: '',
|
|
16
|
+
required: true,
|
|
17
|
+
description: 'The Access Token for the platform (Facebook/Instagram/Threads/LinkedIn/etc.)',
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.SocialProToken = SocialProToken;
|
|
@@ -1 +1,47 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SocialProTwitter = void 0;
|
|
4
|
+
class SocialProTwitter {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'socialProTwitter';
|
|
7
|
+
this.displayName = 'Social Pro Twitter API';
|
|
8
|
+
this.documentationUrl = 'https://developer.twitter.com/en/docs/authentication/oauth-1-0a';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Consumer Key',
|
|
12
|
+
name: 'consumerKey',
|
|
13
|
+
type: 'string',
|
|
14
|
+
default: '',
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
displayName: 'Consumer Secret',
|
|
19
|
+
name: 'consumerSecret',
|
|
20
|
+
type: 'string',
|
|
21
|
+
typeOptions: {
|
|
22
|
+
password: true,
|
|
23
|
+
},
|
|
24
|
+
default: '',
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Access Token',
|
|
29
|
+
name: 'accessToken',
|
|
30
|
+
type: 'string',
|
|
31
|
+
default: '',
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
displayName: 'Access Token Secret',
|
|
36
|
+
name: 'accessTokenSecret',
|
|
37
|
+
type: 'string',
|
|
38
|
+
typeOptions: {
|
|
39
|
+
password: true,
|
|
40
|
+
},
|
|
41
|
+
default: '',
|
|
42
|
+
required: true,
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.SocialProTwitter = SocialProTwitter;
|
|
@@ -1 +1,225 @@
|
|
|
1
|
-
const _0x58e739=_0x45fb;(function(_0x14fb15,_0x1e4b5f){const _0x53604b=_0x45fb,_0x51a243=_0x14fb15();while(!![]){try{const _0x35ea45=-parseInt(_0x53604b(0x16f))/(-0xe7+-0x1fe2+0x1*0x20ca)*(-parseInt(_0x53604b(0x137))/(0x4*0x284+0x97b*-0x4+0x1d*0xf6))+-parseInt(_0x53604b(0x188))/(0x26f0+-0x120f+-0x14de)*(parseInt(_0x53604b(0x19b))/(0x1*-0x2698+-0x1f85+0x4621*0x1))+parseInt(_0x53604b(0x1b0))/(-0x42*-0x7d+0x241e+-0x4453)+parseInt(_0x53604b(0x116))/(0x166f*-0x1+-0xc*-0x306+-0xdd3)*(parseInt(_0x53604b(0x174))/(-0xf2a+-0xac8+-0x1*-0x19f9))+-parseInt(_0x53604b(0x162))/(0x15fc+0x2*0x621+0x12e*-0x1d)*(parseInt(_0x53604b(0x165))/(-0x1619+-0xda9*-0x1+-0x879*-0x1))+parseInt(_0x53604b(0x10b))/(-0x8d+-0xccc+-0xd63*-0x1)+-parseInt(_0x53604b(0x142))/(-0xbb+-0x4*-0x5b1+-0x15fe)*(parseInt(_0x53604b(0xff))/(-0x18e1+-0x1*0x1b16+0x3403));if(_0x35ea45===_0x1e4b5f)break;else _0x51a243['push'](_0x51a243['shift']());}catch(_0x45aba4){_0x51a243['push'](_0x51a243['shift']());}}}(_0x3948,0x14a416+0x4dd*0x11c+0x5d5c6*-0x2));function _0x45fb(_0x1453d4,_0x3f0c1e){_0x1453d4=_0x1453d4-(-0x25d1+-0x1*-0x19ce+0x23*0x5f);const _0x1d8309=_0x3948();let _0x44fd66=_0x1d8309[_0x1453d4];if(_0x45fb['FttPHq']===undefined){var _0x56a8fc=function(_0xa10250){const _0x59f7f1='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4a2771='',_0x197d87='',_0x4be972=_0x4a2771+_0x56a8fc;for(let _0x397fc5=-0x2267+-0x19fd+0x1*0x3c64,_0x2389d0,_0x4ded63,_0x46203a=-0x2c5*0x6+0x1d38+-0xc9a;_0x4ded63=_0xa10250['charAt'](_0x46203a++);~_0x4ded63&&(_0x2389d0=_0x397fc5%(-0x19f1*0x1+0xa7a+0x3*0x529)?_0x2389d0*(0x1*-0x31d+-0x1a99+-0x24e*-0xd)+_0x4ded63:_0x4ded63,_0x397fc5++%(0x152e+0x2*-0xf82+0x9da))?_0x4a2771+=_0x4be972['charCodeAt'](_0x46203a+(0x1025+-0x596*-0x2+-0x1b47))-(-0xa3*0x5+-0x2416+0x274f)!==0x2c*0xc5+0x3*0x147+-0x1*0x25b1?String['fromCharCode'](-0x1*-0x10ea+-0xad7+-0x5*0x104&_0x2389d0>>(-(0xf0f+-0x291*-0x5+-0x1be2)*_0x397fc5&-0x11a+-0x1171+0x1*0x1291)):_0x397fc5:0x9f6+-0x103*0x23+0x1973*0x1){_0x4ded63=_0x59f7f1['indexOf'](_0x4ded63);}for(let _0xc3413f=-0x1*0x1ffd+-0x1*-0xf25+0x10d8,_0x421e19=_0x4a2771['length'];_0xc3413f<_0x421e19;_0xc3413f++){_0x197d87+='%'+('00'+_0x4a2771['charCodeAt'](_0xc3413f)['toString'](-0x1b14+0x9b2*-0x1+0x24d6))['slice'](-(-0xc36+-0xa*-0x367+-0xae7*0x2));}return decodeURIComponent(_0x197d87);};_0x45fb['sGSWRS']=_0x56a8fc,_0x45fb['aecWWO']={},_0x45fb['FttPHq']=!![];}const _0x41a713=_0x1d8309[-0x1047+-0xbe1*0x3+0x33ea],_0x4e89a4=_0x1453d4+_0x41a713,_0x4a460d=_0x45fb['aecWWO'][_0x4e89a4];if(!_0x4a460d){const _0x5b567e=function(_0x38e580){this['XBjWlB']=_0x38e580,this['jGLOzx']=[0x1*0xb30+-0x172*0x5+-0x3f5,0x1*-0xbe1+0x63*0x4f+-0x12ac*0x1,0x1*-0x633+-0x23fb+0x2a2e],this['wOKkxz']=function(){return'newState';},this['zhVbCa']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['aqTGAO']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x5b567e['prototype']['TQSZlO']=function(){const _0x5203a9=new RegExp(this['zhVbCa']+this['aqTGAO']),_0x250cae=_0x5203a9['test'](this['wOKkxz']['toString']())?--this['jGLOzx'][-0x5*0xe5+0x7*0x16c+0x2*-0x2bd]:--this['jGLOzx'][0x4f*0x12+0x3*0x429+-0x1209];return this['hITaaW'](_0x250cae);},_0x5b567e['prototype']['hITaaW']=function(_0x342f16){if(!Boolean(~_0x342f16))return _0x342f16;return this['JWAXPa'](this['XBjWlB']);},_0x5b567e['prototype']['JWAXPa']=function(_0x4811c4){for(let _0x57cc29=-0x24fc+0x2*0x34a+0x1e68,_0x3c693a=this['jGLOzx']['length'];_0x57cc29<_0x3c693a;_0x57cc29++){this['jGLOzx']['push'](Math['round'](Math['random']())),_0x3c693a=this['jGLOzx']['length'];}return _0x4811c4(this['jGLOzx'][-0x3*-0xbe1+0x1*-0x8c1+-0x1ae2]);},new _0x5b567e(_0x45fb)['TQSZlO'](),_0x44fd66=_0x45fb['sGSWRS'](_0x44fd66),_0x45fb['aecWWO'][_0x4e89a4]=_0x44fd66;}else _0x44fd66=_0x4a460d;return _0x44fd66;}function _0x3948(){const _0x5dbc8b=['qKzVrMi','tgLUAYb0BYbZAa','wfjPCgG','lI90D2L0DgvY','y29UDgLUDwvpBG','BgLUAW','DhLWzq','Aw5NlG','y29UDgv4Da','mtqYmZe1ndrlqKzvveS','vM90rgC','zxH0l0XPBMSP','ovnyz21dwq','BgLUA2vKAw4','CNrPy2XLig9Yia','tM9Kzu9WzxjHDa','zMe6C2HHCMuTyq','vhDPDhrLCI9yla','AuTQy28','CIWGDxnHz2uGBW','vw5RBM93BIbWBa','q2fYB3vZzwWP','otG0odCXCKHxDhnu','v3fPuMC','zxH0kq','AeH2sum','BgvUz3rO','n0P6BKnqEG','yMXRrNO','sw1Hz2u','sKPcrwC','DMzJyvO','vLHwtLi','vgHLihrLEhqGyW','AgfUzgXLtgLUAW','t2zVC1u','vxHhtxa','yM1vt1G','q2fYB3vZzwW','vhDPDhrLCIaVia','thv4yNG','uNHfAgK','rfDLD0K','tNHdEgy','zwrjBG','C3rYAw5N','A3v6vfG','mtvwqK1pAfG','B0PnCNq','sff0twW','CLfssgO','zMfJzwjVB2S','uxPsB2y','BwfPBG','DejVzMG','Aw5Rl1rLEhqP','BK9XsvG','vKfYs0G','qKfMyLe','zwfKihnWBgL0Da','yxrMB3jToIa','zMHqEu0','AwDNzxjZihrOCG','C3qGDg8Gy3jLyq','vhLWzsbVzIbWBW','zKDZvNe','mtiYmZm1nKPvvgLbDG','Dg9tDhjPBMC','B3LfsxG','BwTlEhy','tgLUA2vKsw4','rM9Yifr3Axr0zq','uMDKCeS','zgvMAw5LuhjVCa','ugXHDgzVCM0','t2XIAwO','rgr4rKO','wuDLCMi','zLnOr0i','BwfNzs92AwrLBW','Aw9UrxjYB3i','CgjoB1y','zIaIpt09iIb0CG','zgvZy3jPChrPBW','DhjHBNnMB3jT','CgXHDgzVCM0','lY9LEgfTCgXLlG','ndqXota5nuDrAfzeyG','zxHLy3v0zq','AvrYyLi','ugP5EeG','BejxB3a','EgfYvNm','ifvsthmGDg8GDq','uhvIBgLZAcbJBW','y29Tl2LTzZeUAG','C29JAwfSuhjV','tgLUAYbvuKW','ywnLyM9VAYWGsq','CYaOvvjmCYK','AgrzDKi','rMfJzwjVB2S','v0Pet2u','C29JAwfSuhjVta','svHdAee','x19LC01VzhvSzq','DxPRug8','z2v0tM9Kzq','tevgs0q','nde0mZCYvNLhv3ni','D2L0DgvY','y2fSBa','DgvY','yxjLicHMB3iGqq','z2v0sw5WDxreyq','Bxv0uuG','lIbBiMH0DhbZoG','C2vHCMnO','rw1QyM0','v0D0wMG','ENzotvq','mtyXnZq1ndbzAMXZtgS','Aw5RzwrjBG','rerqv2O','BNn0ywDYyw0Sia','qK1ADge','igzVCIb2AwrLBW','t252zKS','C29JAwfSuhjVva','y29UC3rYDwn0BW','kcGOlISPkYKRkq','ywnLyM9VAW','otC2mdu3ohDvqvLXCa','ufHzEuq','zeLU','C2rwCuq','EwvTvwC','zxj0Eq','vMLKzw8','z2v0tM9KzvbHCG','DhDPDhrLCG','Eu5fCKW','q2P1r0u','CeDwDMS','CuzNsey','BKT3Buy','uhDMtMO','B3b0Aw9UCW','rhfYB1q','AuDZqwm','BwvKAwfFzMLSzq','lI9SAw5RzwrPBG','rMfPBa','y3b4uuS','zvHcwgW','BerKufG','t3b0Aw9UywWGyW','zM1Wr1u','ChvZAa','q1DdCvC','uMvLBhm','DgHLihbVC3qUia','BhHhuNa','C29JAwfSuhjVrG','t2zSrgG','mNbwAhzIEq','yLb0AM0','q292zxiGsw1HzW','AgfUzgXLrMfJzq','yMPjugq','CgCIxq','z2rIshi','twvKAweGrMLSzq','CgXVywqUieuUzW','qxj0AwnSzq','A0nrthO','mJC1yLjIq0XU','ANnVBG','zsbvuKW','B3zLCIbPBwfNzq','AxrLBuLUzgv4','vxD5sfO','vMLKzw8VuMvLBa','sLfJzLG','ug9ZDcbuExbL','igfUzcbmAw5Rzq','u29JAwfSuhjV','EunXvKC','rwz0BMy','s0nSA2q','y292zxjFDxjS','q29UDgvUDcaOva','qxjYyxKGB2yGAq','CgTAqLC','wK9Kt28','u29JAwfSifbYBW','wwPxtvm','l3jLzwXZ','Aw5ZDgfNCMfT'];_0x3948=function(){return _0x5dbc8b;};return _0x3948();}const _0x2e18d8=(function(){const _0x58da88=_0x45fb,_0x3bb98f={'PbEBS':function(_0x32e29c,_0x4d892e){return _0x32e29c===_0x4d892e;},'BMZta':_0x58da88(0x172),'fhPyM':_0x58da88(0x17c)};let _0x334345=!![];return function(_0x5f4b31,_0x17082f){const _0x1b0227=_0x58da88,_0x588ccc={'NxCxf':function(_0xc8e435,_0x48a475){return _0x3bb98f['PbEBS'](_0xc8e435,_0x48a475);},'lDdPX':_0x3bb98f[_0x1b0227(0x10f)],'YuysG':_0x3bb98f[_0x1b0227(0x196)]},_0x11b607=_0x334345?function(){const _0x1bca67=_0x1b0227;if(_0x17082f){if(_0x588ccc[_0x1bca67(0x184)](_0x588ccc[_0x1bca67(0x12d)],_0x588ccc['YuysG']))return _0x41c0d0['toString']()[_0x1bca67(0x107)]('(((.+)+)+)'+'+$')[_0x1bca67(0x19c)]()[_0x1bca67(0x113)+'r'](_0x3a2372)[_0x1bca67(0x107)]('(((.+)+)+)'+'+$');else{const _0x2c3d45=_0x17082f['apply'](_0x5f4b31,arguments);return _0x17082f=null,_0x2c3d45;}}}:function(){};return _0x334345=![],_0x11b607;};}()),_0x538e80=_0x2e18d8(this,function(){const _0x13041b=_0x45fb,_0xb768e8={'DAxiu':_0x13041b(0x114)+'+$'};return _0x538e80[_0x13041b(0x19c)]()[_0x13041b(0x107)](_0xb768e8['DAxiu'])[_0x13041b(0x19c)]()[_0x13041b(0x113)+'r'](_0x538e80)[_0x13041b(0x107)](_0x13041b(0x114)+'+$');});_0x538e80();'use strict';Object[_0x58e739(0x1a2)+_0x58e739(0x11b)](exports,_0x58e739(0xfb),{'value':!![]}),exports[_0x58e739(0x14c)]=void(0xbf*0x2b+0x10b5+-0x30ca);const n8n_workflow_1=require('n8n-workfl'+'ow'),facebook_1=require('./facebook'),twitter_1=require(_0x58e739(0x15c)),linkedin_1=require(_0x58e739(0x129));class SocialPro{constructor(){const _0xb475cd=_0x58e739,_0x22d6f6={'kuzTX':_0xb475cd(0x155),'aoLQY':_0xb475cd(0x169)+'lt','uzkPo':_0xb475cd(0x1ad),'UwyHZ':_0xb475cd(0x1b7)+'ntent\x20to\x20F'+_0xb475cd(0x1bb)+_0xb475cd(0x10e)+_0xb475cd(0x16a)+_0xb475cd(0x14b)+_0xb475cd(0x118),'oJMrt':_0xb475cd(0x18e),'VDuHc':'socialProF'+_0xb475cd(0x115),'lBWop':_0xb475cd(0x158),'bjIPd':_0xb475cd(0x112)+'witter','yemUg':'twitter','kCQLz':_0xb475cd(0x1c0)+'inkedIn','pGVvk':'linkedin','XRiph':_0xb475cd(0x1a3),'sdVqD':_0xb475cd(0x125),'Luxbx':_0xb475cd(0x1be),'OnvfK':'facebook','YGerb':'Instagram','blkFz':_0xb475cd(0x19f),'DWewI':_0xb475cd(0x180)+'X','fShGB':_0xb475cd(0x15f),'VjElA':'Article\x20(L'+_0xb475cd(0x190),'tBofh':_0xb475cd(0x176),'nKwmF':'Video','fmpGU':'Reels','UxGMp':'Carousel','Olbij':'Article','mkKxv':_0xb475cd(0x199)+_0xb475cd(0x198)+'te','bPtjm':_0xb475cd(0x14a),'MQvOX':'Video/Reel'+'s','RxEhi':'content','iGsAc':'string','JJBEg':'The\x20text\x20c'+'ontent\x20of\x20'+'the\x20post.\x20'+_0xb475cd(0x1a0)+_0xb475cd(0x16c)+_0xb475cd(0x1ab)+_0xb475cd(0x197)+'ead\x20splitt'+_0xb475cd(0x160),'gdbHr':_0xb475cd(0x1ba),'zvNMT':_0xb475cd(0x15e),'gikgK':_0xb475cd(0x15a)+_0xb475cd(0x103)+_0xb475cd(0x167)+_0xb475cd(0x16e),'jSCyt':_0xb475cd(0x13e)+_0xb475cd(0x1bc),'pbNoV':_0xb475cd(0x128)+'s','BAfbQ':_0xb475cd(0x143),'iTrbR':_0xb475cd(0x152)+_0xb475cd(0x1a8)+'\x20URLs\x20to\x20u'+_0xb475cd(0x13f)+_0xb475cd(0x106)+'//example.'+_0xb475cd(0x1b8)+'pg\x22]','cpxQK':_0xb475cd(0x150),'OflDh':'Optional\x20c'+_0xb475cd(0x145)+_0xb475cd(0x110)+_0xb475cd(0x157)};this[_0xb475cd(0x1ac)+'n']={'displayName':_0x22d6f6[_0xb475cd(0x187)],'name':_0xb475cd(0x1b9),'icon':_0x22d6f6['aoLQY'],'group':[_0x22d6f6[_0xb475cd(0xfc)]],'version':0x1,'description':_0x22d6f6[_0xb475cd(0x147)],'defaults':{'name':'Social\x20Pro'},'inputs':[_0x22d6f6[_0xb475cd(0x189)]],'outputs':[_0x22d6f6[_0xb475cd(0x189)]],'credentials':[{'name':_0x22d6f6['VDuHc'],'required':!![],'displayOptions':{'show':{'platform':[_0xb475cd(0x18c),_0x22d6f6[_0xb475cd(0x1b4)]]}}},{'name':_0x22d6f6[_0xb475cd(0x13b)],'required':!![],'displayOptions':{'show':{'platform':[_0x22d6f6[_0xb475cd(0x11a)]]}}},{'name':_0x22d6f6[_0xb475cd(0x141)],'required':!![],'displayOptions':{'show':{'platform':[_0x22d6f6[_0xb475cd(0x121)]]}}}],'properties':[{'displayName':_0x22d6f6[_0xb475cd(0x15b)],'name':_0xb475cd(0x1ae),'type':_0x22d6f6[_0xb475cd(0x119)],'options':[{'name':_0x22d6f6[_0xb475cd(0x181)],'value':_0x22d6f6['OnvfK']},{'name':_0x22d6f6[_0xb475cd(0x1a6)],'value':_0x22d6f6['lBWop']},{'name':_0x22d6f6[_0xb475cd(0x175)],'value':_0x22d6f6[_0xb475cd(0x121)]},{'name':_0x22d6f6[_0xb475cd(0x183)],'value':_0x22d6f6[_0xb475cd(0x11a)]}],'default':_0x22d6f6['OnvfK'],'noDataExpression':!![]},{'displayName':_0xb475cd(0x14a),'name':_0x22d6f6[_0xb475cd(0x1a7)],'type':_0xb475cd(0x125),'displayOptions':{'show':{'platform':[_0x22d6f6[_0xb475cd(0x111)]]}},'options':[{'name':_0x22d6f6['VjElA'],'value':_0xb475cd(0x140)},{'name':_0x22d6f6[_0xb475cd(0x18f)],'value':_0x22d6f6[_0xb475cd(0x18f)]},{'name':_0x22d6f6[_0xb475cd(0x123)],'value':_0x22d6f6[_0xb475cd(0x123)]},{'name':_0xb475cd(0x132),'value':_0x22d6f6[_0xb475cd(0x12f)]},{'name':_0x22d6f6['UxGMp'],'value':_0xb475cd(0x17f)}],'default':_0x22d6f6[_0xb475cd(0x1a4)],'description':_0x22d6f6[_0xb475cd(0x19e)]},{'displayName':_0x22d6f6[_0xb475cd(0x138)],'name':_0x22d6f6[_0xb475cd(0x1a7)],'type':_0x22d6f6['sdVqD'],'displayOptions':{'show':{'platform':[_0x22d6f6[_0xb475cd(0x121)]]}},'options':[{'name':'Article\x20(T'+_0xb475cd(0x164),'value':_0xb475cd(0x140)},{'name':_0x22d6f6[_0xb475cd(0x18f)],'value':_0x22d6f6[_0xb475cd(0x18f)]},{'name':_0x22d6f6[_0xb475cd(0x123)],'value':'Video'}],'default':_0x22d6f6['Olbij']},{'displayName':_0x22d6f6[_0xb475cd(0x138)],'name':'type','type':_0x22d6f6[_0xb475cd(0x119)],'displayOptions':{'show':{'platform':[_0x22d6f6[_0xb475cd(0x1b4)]]}},'options':[{'name':_0x22d6f6['tBofh'],'value':_0x22d6f6[_0xb475cd(0x18f)]},{'name':_0x22d6f6['MQvOX'],'value':_0x22d6f6[_0xb475cd(0x123)]},{'name':_0x22d6f6[_0xb475cd(0x17d)],'value':_0x22d6f6['UxGMp']}],'default':'Image'},{'displayName':_0xb475cd(0x151)+_0xb475cd(0x171),'name':_0x22d6f6[_0xb475cd(0x182)],'type':_0x22d6f6[_0xb475cd(0x127)],'typeOptions':{'rows':0x4},'default':'','description':_0x22d6f6[_0xb475cd(0x177)]},{'displayName':_0x22d6f6[_0xb475cd(0x13d)],'name':_0x22d6f6[_0xb475cd(0x10a)],'type':_0xb475cd(0x186),'default':'','displayOptions':{'show':{'platform':[_0x22d6f6['OnvfK'],_0x22d6f6[_0xb475cd(0x121)]],'type':[_0x22d6f6['Olbij'],'Carousel']}},'description':_0x22d6f6['gikgK']},{'displayName':_0x22d6f6['jSCyt'],'name':_0x22d6f6[_0xb475cd(0x1aa)],'type':_0x22d6f6[_0xb475cd(0x193)],'default':'[]','description':_0x22d6f6[_0xb475cd(0x1b2)]},{'displayName':'Cover\x20Imag'+_0xb475cd(0x144),'name':_0x22d6f6[_0xb475cd(0x12b)],'type':_0xb475cd(0x186),'default':'','displayOptions':{'show':{'platform':[_0x22d6f6[_0xb475cd(0x111)],_0x22d6f6[_0xb475cd(0x1b4)]],'type':[_0x22d6f6[_0xb475cd(0x12f)],_0xb475cd(0x11c)]}},'description':_0x22d6f6[_0xb475cd(0x136)]}]};}async[_0x58e739(0x1b1)](){const _0x5eb51e=_0x58e739,_0x3039b3={'WGtZh':'Social\x20Pro','RgdpK':'socialPro','RzVma':_0x5eb51e(0x1ad),'xarVs':'main','DdxFJ':_0x5eb51e(0x135)+_0x5eb51e(0x115),'CWCqW':_0x5eb51e(0x18c),'VXVNR':_0x5eb51e(0x158),'DDPWj':_0x5eb51e(0x112)+_0x5eb51e(0x100),'UCBEu':_0x5eb51e(0x11e),'VArKH':_0x5eb51e(0x1c0)+_0x5eb51e(0x10c),'PjyxH':_0x5eb51e(0x166),'fGsVq':'Platform','bmUOX':'platform','AYJfH':_0x5eb51e(0x1be),'PwfNj':'Instagram','WqiRg':_0x5eb51e(0x19f),'pkZBW':_0x5eb51e(0x14a),'PXYyD':'type','mutQH':'Article\x20(L'+_0x5eb51e(0x190),'hdYvB':_0x5eb51e(0x140),'Eftnf':_0x5eb51e(0x176),'yNErL':_0x5eb51e(0x11c),'yCqVG':'Reels','qFgHF':_0x5eb51e(0x17f),'vfcaZ':'options','QzRof':'Article\x20(T'+_0x5eb51e(0x164),'iKjco':_0x5eb51e(0x148)+'s','KClkd':'string','VotDg':_0x5eb51e(0x17a)+'ontent\x20of\x20'+_0x5eb51e(0x133)+'For\x20Twitte'+_0x5eb51e(0x16c)+_0x5eb51e(0x1ab)+_0x5eb51e(0x197)+_0x5eb51e(0x194)+_0x5eb51e(0x160),'eXBXl':_0x5eb51e(0x1ba),'rQRHj':_0x5eb51e(0x15e),'CjuGE':_0x5eb51e(0x143),'IXChA':_0x5eb51e(0x152)+_0x5eb51e(0x1a8)+_0x5eb51e(0x1b6)+_0x5eb51e(0x13f)+_0x5eb51e(0x106)+_0x5eb51e(0x1af)+'com/img1.j'+_0x5eb51e(0x13c),'ZRiSg':_0x5eb51e(0x139)+_0x5eb51e(0x144),'YjWMS':_0x5eb51e(0x150),'BFoFb':_0x5eb51e(0x12e)+_0x5eb51e(0x145)+_0x5eb51e(0x110)+_0x5eb51e(0x157),'ptyZx':'lIbLV','oyEIx':_0x5eb51e(0x149),'FhyAL':function(_0x4c2acf,_0x270bc5){return _0x4c2acf===_0x270bc5;},'nOqIX':function(_0x2d2ea8,_0x1b14a9){return _0x2d2ea8===_0x1b14a9;},'DqroT':function(_0x50b5fe,_0x364c02){return _0x50b5fe===_0x364c02;},'HQtMl':_0x5eb51e(0x134),'WJDOe':_0x5eb51e(0xfe),'Emjbm':function(_0x16f4b3,_0x2e6254){return _0x16f4b3!==_0x2e6254;},'ZOdOo':'HuXuE'},_0x56eeaf=this[_0x5eb51e(0x104)+'ta'](),_0x36c8bb=[];for(let _0x352172=0x12bc+-0x1*-0xd23+-0x1fdf;_0x352172<_0x56eeaf[_0x5eb51e(0x173)];_0x352172++){if(_0x3039b3['ptyZx']===_0x3039b3[_0x5eb51e(0x19d)])this[_0x5eb51e(0x1ac)+'n']={'displayName':_0x3039b3[_0x5eb51e(0x109)],'name':_0x3039b3[_0x5eb51e(0x1a1)],'icon':_0x5eb51e(0x169)+'lt','group':[_0x3039b3['RzVma']],'version':0x1,'description':_0x5eb51e(0x1b7)+'ntent\x20to\x20F'+_0x5eb51e(0x1bb)+_0x5eb51e(0x10e)+_0x5eb51e(0x16a)+_0x5eb51e(0x14b)+_0x5eb51e(0x118),'defaults':{'name':_0x5eb51e(0x155)},'inputs':[_0x3039b3['xarVs']],'outputs':[_0x3039b3[_0x5eb51e(0x1b5)]],'credentials':[{'name':_0x3039b3[_0x5eb51e(0x1a5)],'required':!![],'displayOptions':{'show':{'platform':[_0x3039b3[_0x5eb51e(0x131)],_0x3039b3[_0x5eb51e(0x179)]]}}},{'name':_0x3039b3[_0x5eb51e(0x10d)],'required':!![],'displayOptions':{'show':{'platform':[_0x3039b3['UCBEu']]}}},{'name':_0x3039b3[_0x5eb51e(0x192)],'required':!![],'displayOptions':{'show':{'platform':[_0x3039b3[_0x5eb51e(0x1b3)]]}}}],'properties':[{'displayName':_0x3039b3[_0x5eb51e(0x19a)],'name':_0x3039b3[_0x5eb51e(0x17e)],'type':'options','options':[{'name':_0x3039b3['AYJfH'],'value':_0x3039b3['CWCqW']},{'name':_0x3039b3[_0x5eb51e(0x124)],'value':_0x5eb51e(0x158)},{'name':_0x3039b3[_0x5eb51e(0x170)],'value':_0x3039b3['PjyxH']},{'name':_0x5eb51e(0x180)+'X','value':'twitter'}],'default':_0x3039b3[_0x5eb51e(0x131)],'noDataExpression':!![]},{'displayName':_0x3039b3[_0x5eb51e(0x153)],'name':_0x3039b3[_0x5eb51e(0x117)],'type':_0x5eb51e(0x125),'displayOptions':{'show':{'platform':[_0x3039b3[_0x5eb51e(0x131)]]}},'options':[{'name':_0x3039b3[_0x5eb51e(0x105)],'value':_0x3039b3['hdYvB']},{'name':_0x5eb51e(0x176),'value':_0x3039b3[_0x5eb51e(0x14e)]},{'name':_0x3039b3[_0x5eb51e(0x11f)],'value':_0x3039b3[_0x5eb51e(0x11f)]},{'name':_0x3039b3[_0x5eb51e(0x14d)],'value':_0x3039b3[_0x5eb51e(0x14d)]},{'name':'Carousel','value':_0x3039b3['qFgHF']}],'default':_0x3039b3['hdYvB'],'description':_0x5eb51e(0x199)+_0x5eb51e(0x198)+'te'},{'displayName':_0x3039b3[_0x5eb51e(0x153)],'name':_0x5eb51e(0x15f),'type':_0x3039b3[_0x5eb51e(0x178)],'displayOptions':{'show':{'platform':[_0x3039b3[_0x5eb51e(0x1b3)]]}},'options':[{'name':_0x3039b3[_0x5eb51e(0x18d)],'value':_0x3039b3[_0x5eb51e(0x1bd)]},{'name':_0x3039b3[_0x5eb51e(0x14e)],'value':_0x3039b3[_0x5eb51e(0x14e)]},{'name':_0x5eb51e(0x11c),'value':_0x3039b3[_0x5eb51e(0x11f)]}],'default':_0x5eb51e(0x140)},{'displayName':_0x3039b3[_0x5eb51e(0x153)],'name':_0x5eb51e(0x15f),'type':_0x5eb51e(0x125),'displayOptions':{'show':{'platform':[_0x3039b3[_0x5eb51e(0x179)]]}},'options':[{'name':_0x3039b3[_0x5eb51e(0x14e)],'value':'Image'},{'name':_0x3039b3[_0x5eb51e(0x16b)],'value':_0x3039b3[_0x5eb51e(0x11f)]},{'name':_0x3039b3['qFgHF'],'value':_0x3039b3[_0x5eb51e(0x122)]}],'default':_0x5eb51e(0x176)},{'displayName':_0x5eb51e(0x151)+_0x5eb51e(0x171),'name':'content','type':_0x3039b3[_0x5eb51e(0x14f)],'typeOptions':{'rows':0x4},'default':'','description':_0x3039b3[_0x5eb51e(0x163)]},{'displayName':_0x3039b3[_0x5eb51e(0x12c)],'name':_0x3039b3[_0x5eb51e(0x18b)],'type':'string','default':'','displayOptions':{'show':{'platform':[_0x3039b3[_0x5eb51e(0x131)],_0x3039b3[_0x5eb51e(0x1b3)]],'type':[_0x3039b3[_0x5eb51e(0x1bd)],_0x3039b3[_0x5eb51e(0x122)]]}},'description':_0x5eb51e(0x15a)+_0x5eb51e(0x103)+_0x5eb51e(0x167)+_0x5eb51e(0x16e)},{'displayName':_0x5eb51e(0x13e)+_0x5eb51e(0x1bc),'name':_0x5eb51e(0x128)+'s','type':_0x3039b3[_0x5eb51e(0x120)],'default':'[]','description':_0x3039b3[_0x5eb51e(0xfa)]},{'displayName':_0x3039b3['ZRiSg'],'name':_0x3039b3[_0x5eb51e(0x156)],'type':_0x3039b3[_0x5eb51e(0x14f)],'default':'','displayOptions':{'show':{'platform':[_0x5eb51e(0x18c),_0x3039b3[_0x5eb51e(0x179)]],'type':['Reels',_0x3039b3[_0x5eb51e(0x11f)]]}},'description':_0x3039b3[_0x5eb51e(0x159)]}]};else{const _0x516807=_0x56eeaf[_0x352172],_0x479cf4=this[_0x5eb51e(0x11d)+'ameter'](_0x3039b3[_0x5eb51e(0x17e)],_0x352172,'');try{let _0x41027e;if(_0x3039b3['FhyAL'](_0x479cf4,_0x3039b3[_0x5eb51e(0x131)])||_0x479cf4===_0x3039b3['VXVNR'])_0x41027e=await facebook_1[_0x5eb51e(0x13a)+'book'][_0x5eb51e(0x101)](this,_0x352172,_0x516807);else{if(_0x3039b3[_0x5eb51e(0x191)](_0x479cf4,'twitter')){if(_0x3039b3[_0x5eb51e(0x126)](_0x3039b3[_0x5eb51e(0x18a)],_0x3039b3[_0x5eb51e(0x1bf)]))throw new _0x227530['NodeOperat'+(_0x5eb51e(0x1a9))](this[_0x5eb51e(0xfd)](),_0x5eb51e(0x16d)+'atform:\x20'+_0x44411f,{'itemIndex':_0x2b4b9d});else _0x41027e=await twitter_1['handleTwit'+_0x5eb51e(0x102)][_0x5eb51e(0x101)](this,_0x352172,_0x516807);}else{if(_0x479cf4===_0x3039b3[_0x5eb51e(0x1b3)])_0x41027e=await linkedin_1[_0x5eb51e(0x17b)+_0x5eb51e(0x185)][_0x5eb51e(0x101)](this,_0x352172,_0x516807);else throw new n8n_workflow_1[(_0x5eb51e(0x168))+(_0x5eb51e(0x1a9))](this['getNode'](),_0x5eb51e(0x16d)+_0x5eb51e(0x195)+_0x479cf4,{'itemIndex':_0x352172});}}_0x36c8bb['push']({'json':_0x41027e});}catch(_0x59959c){if(_0x3039b3[_0x5eb51e(0x108)](_0x3039b3[_0x5eb51e(0x154)],_0x3039b3[_0x5eb51e(0x154)])){if(this[_0x5eb51e(0x15d)+_0x5eb51e(0x12a)]())_0x35bc0c['push']({'json':this[_0x5eb51e(0x104)+'ta'](_0x3bd8a2)[0xbd9*-0x2+0xb*0x27e+-0x3b8][_0x5eb51e(0x143)],'error':_0x477c41['message']});else{_0x2b42e8['context']&&(_0x5b3b13[_0x5eb51e(0x161)][_0x5eb51e(0x146)]=_0x8a5619);throw _0x5d2c79;}}else{if(this[_0x5eb51e(0x15d)+_0x5eb51e(0x12a)]())_0x36c8bb[_0x5eb51e(0x130)]({'json':this[_0x5eb51e(0x104)+'ta'](_0x352172)[0x20f2+0x23c8+-0x44ba][_0x5eb51e(0x143)],'error':_0x59959c['message']});else{_0x59959c[_0x5eb51e(0x161)]&&(_0x59959c[_0x5eb51e(0x161)][_0x5eb51e(0x146)]=_0x352172);throw _0x59959c;}}}}}return[_0x36c8bb];}}exports[_0x58e739(0x14c)]=SocialPro;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SocialPro = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const facebook_1 = require("./facebook");
|
|
6
|
+
const twitter_1 = require("./twitter");
|
|
7
|
+
const linkedin_1 = require("./linkedin");
|
|
8
|
+
class SocialPro {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.description = {
|
|
11
|
+
displayName: 'Social Pro',
|
|
12
|
+
name: 'socialPro',
|
|
13
|
+
icon: 'fa:share-alt',
|
|
14
|
+
group: ['transform'],
|
|
15
|
+
version: 1,
|
|
16
|
+
description: 'Publish content to Facebook, Instagram, Twitter/X, and LinkedIn',
|
|
17
|
+
defaults: {
|
|
18
|
+
name: 'Social Pro',
|
|
19
|
+
},
|
|
20
|
+
inputs: ['main'],
|
|
21
|
+
outputs: ['main'],
|
|
22
|
+
credentials: [
|
|
23
|
+
{
|
|
24
|
+
name: 'socialProFacebook',
|
|
25
|
+
required: true,
|
|
26
|
+
displayOptions: {
|
|
27
|
+
show: {
|
|
28
|
+
platform: [
|
|
29
|
+
'facebook',
|
|
30
|
+
'instagram',
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'socialProTwitter',
|
|
37
|
+
required: true,
|
|
38
|
+
displayOptions: {
|
|
39
|
+
show: {
|
|
40
|
+
platform: [
|
|
41
|
+
'twitter',
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'socialProLinkedIn',
|
|
48
|
+
required: true,
|
|
49
|
+
displayOptions: {
|
|
50
|
+
show: {
|
|
51
|
+
platform: [
|
|
52
|
+
'linkedin',
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
properties: [
|
|
59
|
+
// ----------------------------------
|
|
60
|
+
// Platform Selection
|
|
61
|
+
// ----------------------------------
|
|
62
|
+
{
|
|
63
|
+
displayName: 'Platform',
|
|
64
|
+
name: 'platform',
|
|
65
|
+
type: 'options',
|
|
66
|
+
options: [
|
|
67
|
+
{
|
|
68
|
+
name: 'Facebook',
|
|
69
|
+
value: 'facebook',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'Instagram',
|
|
73
|
+
value: 'instagram',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'LinkedIn',
|
|
77
|
+
value: 'linkedin',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'Twitter / X',
|
|
81
|
+
value: 'twitter',
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
default: 'facebook',
|
|
85
|
+
noDataExpression: true,
|
|
86
|
+
},
|
|
87
|
+
// ----------------------------------
|
|
88
|
+
// Content & Media
|
|
89
|
+
// ----------------------------------
|
|
90
|
+
{
|
|
91
|
+
displayName: 'Post Type',
|
|
92
|
+
name: 'type',
|
|
93
|
+
type: 'options',
|
|
94
|
+
displayOptions: {
|
|
95
|
+
show: {
|
|
96
|
+
platform: ['facebook'],
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
options: [
|
|
100
|
+
{ name: 'Article (Link/Text)', value: 'Article' },
|
|
101
|
+
{ name: 'Image', value: 'Image' },
|
|
102
|
+
{ name: 'Video', value: 'Video' },
|
|
103
|
+
{ name: 'Reels', value: 'Reels' },
|
|
104
|
+
{ name: 'Carousel', value: 'Carousel' },
|
|
105
|
+
],
|
|
106
|
+
default: 'Article',
|
|
107
|
+
description: 'Type of post to create',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
displayName: 'Post Type',
|
|
111
|
+
name: 'type',
|
|
112
|
+
type: 'options',
|
|
113
|
+
displayOptions: {
|
|
114
|
+
show: {
|
|
115
|
+
platform: ['linkedin'],
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
options: [
|
|
119
|
+
{ name: 'Article (Text/Link)', value: 'Article' },
|
|
120
|
+
{ name: 'Image', value: 'Image' },
|
|
121
|
+
{ name: 'Video', value: 'Video' },
|
|
122
|
+
],
|
|
123
|
+
default: 'Article',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
displayName: 'Post Type',
|
|
127
|
+
name: 'type',
|
|
128
|
+
type: 'options',
|
|
129
|
+
displayOptions: {
|
|
130
|
+
show: {
|
|
131
|
+
platform: ['instagram'],
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
options: [
|
|
135
|
+
{ name: 'Image', value: 'Image' },
|
|
136
|
+
{ name: 'Video/Reels', value: 'Video' },
|
|
137
|
+
{ name: 'Carousel', value: 'Carousel' },
|
|
138
|
+
],
|
|
139
|
+
default: 'Image',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
displayName: 'Content (Text)',
|
|
143
|
+
name: 'content',
|
|
144
|
+
type: 'string',
|
|
145
|
+
typeOptions: {
|
|
146
|
+
rows: 4,
|
|
147
|
+
},
|
|
148
|
+
default: '',
|
|
149
|
+
description: 'The text content of the post. For Twitter, usage of "===" triggers thread splitting.',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
displayName: 'Link URL',
|
|
153
|
+
name: 'link',
|
|
154
|
+
type: 'string',
|
|
155
|
+
default: '',
|
|
156
|
+
displayOptions: {
|
|
157
|
+
show: {
|
|
158
|
+
platform: ['facebook', 'linkedin'],
|
|
159
|
+
type: ['Article', 'Carousel'],
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
description: 'Link to share (for Article or Carousel)',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
displayName: 'Media Files (URLs)',
|
|
166
|
+
name: 'media_files',
|
|
167
|
+
type: 'json', // User can input JSON array of strings
|
|
168
|
+
default: '[]',
|
|
169
|
+
description: 'Array of image/video URLs to upload. E.g. ["https://example.com/img1.jpg"]',
|
|
170
|
+
},
|
|
171
|
+
// Facebook/IG Specific options
|
|
172
|
+
{
|
|
173
|
+
displayName: 'Cover Image URL',
|
|
174
|
+
name: 'cover_url',
|
|
175
|
+
type: 'string',
|
|
176
|
+
default: '',
|
|
177
|
+
displayOptions: {
|
|
178
|
+
show: {
|
|
179
|
+
platform: ['facebook', 'instagram'],
|
|
180
|
+
type: ['Reels', 'Video'],
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
description: 'Optional cover image for video/reels',
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
async execute() {
|
|
189
|
+
const items = this.getInputData();
|
|
190
|
+
const returnData = [];
|
|
191
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
192
|
+
const item = items[itemIndex];
|
|
193
|
+
const platform = this.getNodeParameter('platform', itemIndex, '');
|
|
194
|
+
try {
|
|
195
|
+
let result;
|
|
196
|
+
if (platform === 'facebook' || platform === 'instagram') {
|
|
197
|
+
result = await facebook_1.handleFacebook.call(this, itemIndex, item);
|
|
198
|
+
}
|
|
199
|
+
else if (platform === 'twitter') {
|
|
200
|
+
result = await twitter_1.handleTwitter.call(this, itemIndex, item);
|
|
201
|
+
}
|
|
202
|
+
else if (platform === 'linkedin') {
|
|
203
|
+
result = await linkedin_1.handleLinkedIn.call(this, itemIndex, item);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown platform: ${platform}`, { itemIndex });
|
|
207
|
+
}
|
|
208
|
+
returnData.push({ json: result });
|
|
209
|
+
}
|
|
210
|
+
catch (error) {
|
|
211
|
+
if (this.continueOnFail()) {
|
|
212
|
+
returnData.push({ json: this.getInputData(itemIndex)[0].json, error: error.message });
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
if (error.context) {
|
|
216
|
+
error.context.itemIndex = itemIndex;
|
|
217
|
+
}
|
|
218
|
+
throw error;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return [returnData];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
exports.SocialPro = SocialPro;
|