n8n-nodes-repliz 1.0.1 → 1.0.2
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/README.md +112 -98
- package/dist/nodes/GenericFunctions.d.ts +3 -0
- package/dist/nodes/GenericFunctions.js +37 -0
- package/dist/nodes/GenericFunctions.js.map +1 -0
- package/dist/nodes/ReplizAccount/ReplizAccount.node.d.ts +5 -0
- package/dist/nodes/ReplizAccount/ReplizAccount.node.js +145 -0
- package/dist/nodes/ReplizAccount/ReplizAccount.node.js.map +1 -0
- package/dist/nodes/ReplizAccount/repliz.svg +4 -0
- package/dist/nodes/ReplizAccountFacebook/ReplizAccountFacebook.node.d.ts +5 -0
- package/dist/nodes/ReplizAccountFacebook/ReplizAccountFacebook.node.js +94 -0
- package/dist/nodes/ReplizAccountFacebook/ReplizAccountFacebook.node.js.map +1 -0
- package/dist/nodes/ReplizAccountFacebook/repliz.svg +4 -0
- package/dist/nodes/ReplizAccountInstagram/ReplizAccountInstagram.node.d.ts +5 -0
- package/dist/nodes/ReplizAccountInstagram/ReplizAccountInstagram.node.js +73 -0
- package/dist/nodes/ReplizAccountInstagram/ReplizAccountInstagram.node.js.map +1 -0
- package/dist/nodes/ReplizAccountInstagram/repliz.svg +4 -0
- package/dist/nodes/ReplizAccountLinkedIn/ReplizAccountLinkedIn.node.d.ts +5 -0
- package/dist/nodes/ReplizAccountLinkedIn/ReplizAccountLinkedIn.node.js +89 -0
- package/dist/nodes/ReplizAccountLinkedIn/ReplizAccountLinkedIn.node.js.map +1 -0
- package/dist/nodes/ReplizAccountLinkedIn/repliz.svg +4 -0
- package/dist/nodes/ReplizAccountShopee/ReplizAccountShopee.node.d.ts +5 -0
- package/dist/nodes/ReplizAccountShopee/ReplizAccountShopee.node.js +73 -0
- package/dist/nodes/ReplizAccountShopee/ReplizAccountShopee.node.js.map +1 -0
- package/dist/nodes/ReplizAccountShopee/repliz.svg +4 -0
- package/dist/nodes/ReplizAccountThreads/ReplizAccountThreads.node.d.ts +5 -0
- package/dist/nodes/ReplizAccountThreads/ReplizAccountThreads.node.js +73 -0
- package/dist/nodes/ReplizAccountThreads/ReplizAccountThreads.node.js.map +1 -0
- package/dist/nodes/ReplizAccountThreads/repliz.svg +4 -0
- package/dist/nodes/ReplizAccountTikTok/ReplizAccountTikTok.node.d.ts +5 -0
- package/dist/nodes/ReplizAccountTikTok/ReplizAccountTikTok.node.js +73 -0
- package/dist/nodes/ReplizAccountTikTok/ReplizAccountTikTok.node.js.map +1 -0
- package/dist/nodes/ReplizAccountTikTok/repliz.svg +4 -0
- package/dist/nodes/ReplizAccountYoutube/ReplizAccountYoutube.node.d.ts +5 -0
- package/dist/nodes/ReplizAccountYoutube/ReplizAccountYoutube.node.js +89 -0
- package/dist/nodes/ReplizAccountYoutube/ReplizAccountYoutube.node.js.map +1 -0
- package/dist/nodes/ReplizAccountYoutube/repliz.svg +4 -0
- package/dist/nodes/ReplizAddon/ReplizAddon.node.d.ts +5 -0
- package/dist/nodes/ReplizAddon/ReplizAddon.node.js +146 -0
- package/dist/nodes/ReplizAddon/ReplizAddon.node.js.map +1 -0
- package/dist/nodes/ReplizAddon/repliz.svg +4 -0
- package/dist/nodes/ReplizChat/ReplizChat.node.d.ts +5 -0
- package/dist/nodes/ReplizChat/ReplizChat.node.js +197 -0
- package/dist/nodes/ReplizChat/ReplizChat.node.js.map +1 -0
- package/dist/nodes/ReplizChat/repliz.svg +4 -0
- package/dist/nodes/ReplizComment/ReplizComment.node.d.ts +5 -0
- package/dist/nodes/ReplizComment/ReplizComment.node.js +181 -0
- package/dist/nodes/ReplizComment/ReplizComment.node.js.map +1 -0
- package/dist/nodes/ReplizComment/repliz.svg +4 -0
- package/dist/nodes/ReplizContent/ReplizContent.node.d.ts +5 -0
- package/dist/nodes/ReplizContent/ReplizContent.node.js +168 -0
- package/dist/nodes/ReplizContent/ReplizContent.node.js.map +1 -0
- package/dist/nodes/ReplizContent/repliz.svg +4 -0
- package/dist/nodes/ReplizSchedule/ReplizSchedule.node.d.ts +5 -0
- package/dist/nodes/ReplizSchedule/ReplizSchedule.node.js +202 -0
- package/dist/nodes/ReplizSchedule/ReplizSchedule.node.js.map +1 -0
- package/dist/nodes/ReplizSchedule/repliz.svg +4 -0
- package/package.json +18 -6
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReplizAccountInstagram = void 0;
|
|
4
|
+
const GenericFunctions_1 = require("../GenericFunctions");
|
|
5
|
+
class ReplizAccountInstagram {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: 'Repliz Account Instagram',
|
|
9
|
+
name: 'replizAccountInstagram',
|
|
10
|
+
icon: 'file:repliz.svg',
|
|
11
|
+
group: ['transform'],
|
|
12
|
+
version: 1,
|
|
13
|
+
subtitle: '={{$parameter["operation"]}}',
|
|
14
|
+
description: 'Connect and manage Instagram accounts in Repliz (Gold+)',
|
|
15
|
+
defaults: { name: 'Repliz Account Instagram' },
|
|
16
|
+
inputs: ['main'],
|
|
17
|
+
outputs: ['main'],
|
|
18
|
+
credentials: [{ name: 'replizApi', required: true }],
|
|
19
|
+
properties: [
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Operation',
|
|
22
|
+
name: 'operation',
|
|
23
|
+
type: 'options',
|
|
24
|
+
noDataExpression: true,
|
|
25
|
+
options: [
|
|
26
|
+
{ name: 'Authorize', value: 'authorize', description: 'Get Instagram OAuth authorization URL', action: 'Authorize Instagram' },
|
|
27
|
+
{ name: 'Connect', value: 'connect', description: 'Connect Instagram account using auth code', action: 'Connect Instagram' },
|
|
28
|
+
{ name: 'Reconnect', value: 'reconnect', description: 'Re-authenticate an existing Instagram account', action: 'Reconnect Instagram' },
|
|
29
|
+
],
|
|
30
|
+
default: 'authorize',
|
|
31
|
+
},
|
|
32
|
+
{ displayName: 'Redirect URL', name: 'redirect', type: 'string', required: true, displayOptions: { show: { operation: ['authorize'] } }, default: '', description: 'The URL to redirect to after OAuth authorization' },
|
|
33
|
+
{ displayName: 'Authorization Code', name: 'code', type: 'string', required: true, displayOptions: { show: { operation: ['connect'] } }, default: '', description: 'The authorization code from Instagram OAuth callback' },
|
|
34
|
+
{ displayName: 'Account ID', name: 'accountId', type: 'string', required: true, displayOptions: { show: { operation: ['reconnect'] } }, default: '', description: 'The existing Repliz account ID to reconnect' },
|
|
35
|
+
{ displayName: 'Authorization Code', name: 'code', type: 'string', required: true, displayOptions: { show: { operation: ['reconnect'] } }, default: '', description: 'New authorization code from Instagram OAuth' },
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async execute() {
|
|
40
|
+
const items = this.getInputData();
|
|
41
|
+
const returnData = [];
|
|
42
|
+
for (let i = 0; i < items.length; i++) {
|
|
43
|
+
try {
|
|
44
|
+
const operation = this.getNodeParameter('operation', i);
|
|
45
|
+
let responseData;
|
|
46
|
+
if (operation === 'authorize') {
|
|
47
|
+
const redirect = this.getNodeParameter('redirect', i);
|
|
48
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'GET', '/public/account/instagram/authorize', {}, { redirect });
|
|
49
|
+
}
|
|
50
|
+
else if (operation === 'connect') {
|
|
51
|
+
const code = this.getNodeParameter('code', i);
|
|
52
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'POST', '/public/account/instagram/connect', { code });
|
|
53
|
+
}
|
|
54
|
+
else if (operation === 'reconnect') {
|
|
55
|
+
const accountId = this.getNodeParameter('accountId', i);
|
|
56
|
+
const code = this.getNodeParameter('code', i);
|
|
57
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'POST', `/public/account/instagram/connect/${accountId}`, { code });
|
|
58
|
+
}
|
|
59
|
+
returnData.push(...this.helpers.returnJsonArray(responseData));
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
if (this.continueOnFail()) {
|
|
63
|
+
returnData.push({ json: { error: error.message } });
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return [returnData];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.ReplizAccountInstagram = ReplizAccountInstagram;
|
|
73
|
+
//# sourceMappingURL=ReplizAccountInstagram.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReplizAccountInstagram.node.js","sourceRoot":"","sources":["../../../nodes/ReplizAccountInstagram/ReplizAccountInstagram.node.ts"],"names":[],"mappings":";;;AACA,0DAAuD;AAEvD,MAAa,sBAAsB;IAAnC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,0BAA0B;YACvC,IAAI,EAAE,wBAAwB;YAC9B,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8BAA8B;YACxC,WAAW,EAAE,yDAAyD;YACtE,QAAQ,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE;YAC9C,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACpD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,uCAAuC,EAAE,MAAM,EAAE,qBAAqB,EAAE;wBAC9H,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,2CAA2C,EAAE,MAAM,EAAE,mBAAmB,EAAE;wBAC5H,EAAE,IAAI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AY,CAAC,CAAC,CAAC;YAChE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAAC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;oBAAC,SAAS;gBAAC,CAAC;gBACxG,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QACD,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA9DD,wDA8DC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="180" height="180" viewBox="0 0 180 180" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M0 90C0 40.2944 40.2944 0 90 0C139.706 0 180 40.2944 180 90C180 139.706 139.706 180 90 180C40.2944 180 0 139.706 0 90Z" fill="black"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M115 45C121.63 45 127.989 47.6339 132.678 52.3223C137.366 57.0107 140 63.3696 140 70V110C140 116.63 137.366 122.989 132.678 127.678C127.989 132.366 121.63 135 115 135H45C43.6739 135 42.4021 134.473 41.4645 133.536C40.5268 132.598 40 131.326 40 130V70C40 63.3696 42.6339 57.0107 47.3223 52.3223C52.0107 47.6339 58.3696 45 65 45H115ZM75 80C73.7753 80.0002 72.5933 80.4498 71.6781 81.2636C70.763 82.0774 70.1783 83.1987 70.035 84.415L70 85V95C70.0014 96.2744 70.4894 97.5002 71.3642 98.4268C72.2391 99.3535 73.4348 99.9112 74.707 99.9859C75.9792 100.061 77.2319 99.6466 78.2092 98.8287C79.1864 98.0107 79.8145 96.8505 79.965 95.585L80 95V85C80 83.6739 79.4732 82.4021 78.5355 81.4645C77.5978 80.5268 76.3261 80 75 80ZM105 80C103.674 80 102.402 80.5268 101.464 81.4645C100.527 82.4021 100 83.6739 100 85V95C100 96.3261 100.527 97.5979 101.464 98.5355C102.402 99.4732 103.674 100 105 100C106.326 100 107.598 99.4732 108.536 98.5355C109.473 97.5979 110 96.3261 110 95V85C110 83.6739 109.473 82.4021 108.536 81.4645C107.598 80.5268 106.326 80 105 80Z" fill="white"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class ReplizAccountLinkedIn implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReplizAccountLinkedIn = void 0;
|
|
4
|
+
const GenericFunctions_1 = require("../GenericFunctions");
|
|
5
|
+
class ReplizAccountLinkedIn {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: 'Repliz Account LinkedIn',
|
|
9
|
+
name: 'replizAccountLinkedIn',
|
|
10
|
+
icon: 'file:repliz.svg',
|
|
11
|
+
group: ['transform'],
|
|
12
|
+
version: 1,
|
|
13
|
+
subtitle: '={{$parameter["operation"]}}',
|
|
14
|
+
description: 'Connect and manage LinkedIn accounts in Repliz (Gold+)',
|
|
15
|
+
defaults: { name: 'Repliz Account LinkedIn' },
|
|
16
|
+
inputs: ['main'],
|
|
17
|
+
outputs: ['main'],
|
|
18
|
+
credentials: [{ name: 'replizApi', required: true }],
|
|
19
|
+
properties: [
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Operation',
|
|
22
|
+
name: 'operation',
|
|
23
|
+
type: 'options',
|
|
24
|
+
noDataExpression: true,
|
|
25
|
+
options: [
|
|
26
|
+
{ name: 'Authorize', value: 'authorize', description: 'Get LinkedIn OAuth authorization URL', action: 'Authorize LinkedIn' },
|
|
27
|
+
{ name: 'Get Organization', value: 'getOrganization', description: 'Retrieve available LinkedIn organizations for a token', action: 'Get LinkedIn organizations' },
|
|
28
|
+
{ name: 'Exchange Token', value: 'exchange', description: 'Exchange auth code for a LinkedIn access token', action: 'Exchange LinkedIn token' },
|
|
29
|
+
{ name: 'Connect', value: 'connect', description: 'Connect a LinkedIn organization to your workspace', action: 'Connect LinkedIn organization' },
|
|
30
|
+
{ name: 'Reconnect', value: 'reconnect', description: 'Re-authenticate an existing LinkedIn account', action: 'Reconnect LinkedIn account' },
|
|
31
|
+
],
|
|
32
|
+
default: 'authorize',
|
|
33
|
+
},
|
|
34
|
+
{ displayName: 'Redirect URL', name: 'redirect', type: 'string', required: true, displayOptions: { show: { operation: ['authorize'] } }, default: '', description: 'The URL to redirect to after OAuth authorization' },
|
|
35
|
+
{ displayName: 'Access Token', name: 'token', type: 'string', typeOptions: { password: true }, required: true, displayOptions: { show: { operation: ['getOrganization'] } }, default: '', description: 'LinkedIn access token to list available organizations' },
|
|
36
|
+
{ displayName: 'Authorization Code', name: 'code', type: 'string', required: true, displayOptions: { show: { operation: ['exchange'] } }, default: '', description: 'The authorization code from LinkedIn OAuth callback' },
|
|
37
|
+
{ displayName: 'Access Token', name: 'token', type: 'string', typeOptions: { password: true }, required: true, displayOptions: { show: { operation: ['connect'] } }, default: '', description: 'LinkedIn long-lived access token' },
|
|
38
|
+
{ displayName: 'Organization ID', name: 'organizationId', type: 'string', required: true, displayOptions: { show: { operation: ['connect'] } }, default: '', description: 'The LinkedIn Organization ID to connect' },
|
|
39
|
+
{ displayName: 'Account ID', name: 'accountId', type: 'string', required: true, displayOptions: { show: { operation: ['reconnect'] } }, default: '', description: 'The existing Repliz account ID to reconnect' },
|
|
40
|
+
{ displayName: 'Access Token', name: 'token', type: 'string', typeOptions: { password: true }, required: true, displayOptions: { show: { operation: ['reconnect'] } }, default: '', description: 'New LinkedIn access token' },
|
|
41
|
+
{ displayName: 'Organization ID', name: 'organizationId', type: 'string', required: true, displayOptions: { show: { operation: ['reconnect'] } }, default: '', description: 'The LinkedIn Organization ID' },
|
|
42
|
+
],
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
async execute() {
|
|
46
|
+
const items = this.getInputData();
|
|
47
|
+
const returnData = [];
|
|
48
|
+
for (let i = 0; i < items.length; i++) {
|
|
49
|
+
try {
|
|
50
|
+
const operation = this.getNodeParameter('operation', i);
|
|
51
|
+
let responseData;
|
|
52
|
+
if (operation === 'authorize') {
|
|
53
|
+
const redirect = this.getNodeParameter('redirect', i);
|
|
54
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'GET', '/public/account/linkedin/authorize', {}, { redirect });
|
|
55
|
+
}
|
|
56
|
+
else if (operation === 'getOrganization') {
|
|
57
|
+
const token = this.getNodeParameter('token', i);
|
|
58
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'GET', '/public/account/linkedin/organization', {}, { token });
|
|
59
|
+
}
|
|
60
|
+
else if (operation === 'exchange') {
|
|
61
|
+
const code = this.getNodeParameter('code', i);
|
|
62
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'POST', '/public/account/linkedin/exchange', { code });
|
|
63
|
+
}
|
|
64
|
+
else if (operation === 'connect') {
|
|
65
|
+
const token = this.getNodeParameter('token', i);
|
|
66
|
+
const organizationId = this.getNodeParameter('organizationId', i);
|
|
67
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'POST', '/public/account/linkedin/connect', { token, organizationId });
|
|
68
|
+
}
|
|
69
|
+
else if (operation === 'reconnect') {
|
|
70
|
+
const accountId = this.getNodeParameter('accountId', i);
|
|
71
|
+
const token = this.getNodeParameter('token', i);
|
|
72
|
+
const organizationId = this.getNodeParameter('organizationId', i);
|
|
73
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'POST', `/public/account/linkedin/connect/${accountId}`, { token, organizationId });
|
|
74
|
+
}
|
|
75
|
+
returnData.push(...this.helpers.returnJsonArray(responseData));
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
if (this.continueOnFail()) {
|
|
79
|
+
returnData.push({ json: { error: error.message } });
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
throw error;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return [returnData];
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.ReplizAccountLinkedIn = ReplizAccountLinkedIn;
|
|
89
|
+
//# sourceMappingURL=ReplizAccountLinkedIn.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReplizAccountLinkedIn.node.js","sourceRoot":"","sources":["../../../nodes/ReplizAccountLinkedIn/ReplizAccountLinkedIn.node.ts"],"names":[],"mappings":";;;AACA,0DAAuD;AAEvD,MAAa,qBAAqB;IAAlC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,yBAAyB;YACtC,IAAI,EAAE,uBAAuB;YAC7B,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8BAA8B;YACxC,WAAW,EAAE,wDAAwD;YACrE,QAAQ,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAE;YAC7C,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACpD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,sCAAsC,EAAE,MAAM,EAAE,oBAAoB,EAAE;wBAC5H,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,iBAAiB,EA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b,CAAC;QACF,CAAC;QACD,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA5ED,sDA4EC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="180" height="180" viewBox="0 0 180 180" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M0 90C0 40.2944 40.2944 0 90 0C139.706 0 180 40.2944 180 90C180 139.706 139.706 180 90 180C40.2944 180 0 139.706 0 90Z" fill="black"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M115 45C121.63 45 127.989 47.6339 132.678 52.3223C137.366 57.0107 140 63.3696 140 70V110C140 116.63 137.366 122.989 132.678 127.678C127.989 132.366 121.63 135 115 135H45C43.6739 135 42.4021 134.473 41.4645 133.536C40.5268 132.598 40 131.326 40 130V70C40 63.3696 42.6339 57.0107 47.3223 52.3223C52.0107 47.6339 58.3696 45 65 45H115ZM75 80C73.7753 80.0002 72.5933 80.4498 71.6781 81.2636C70.763 82.0774 70.1783 83.1987 70.035 84.415L70 85V95C70.0014 96.2744 70.4894 97.5002 71.3642 98.4268C72.2391 99.3535 73.4348 99.9112 74.707 99.9859C75.9792 100.061 77.2319 99.6466 78.2092 98.8287C79.1864 98.0107 79.8145 96.8505 79.965 95.585L80 95V85C80 83.6739 79.4732 82.4021 78.5355 81.4645C77.5978 80.5268 76.3261 80 75 80ZM105 80C103.674 80 102.402 80.5268 101.464 81.4645C100.527 82.4021 100 83.6739 100 85V95C100 96.3261 100.527 97.5979 101.464 98.5355C102.402 99.4732 103.674 100 105 100C106.326 100 107.598 99.4732 108.536 98.5355C109.473 97.5979 110 96.3261 110 95V85C110 83.6739 109.473 82.4021 108.536 81.4645C107.598 80.5268 106.326 80 105 80Z" fill="white"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class ReplizAccountShopee implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReplizAccountShopee = void 0;
|
|
4
|
+
const GenericFunctions_1 = require("../GenericFunctions");
|
|
5
|
+
class ReplizAccountShopee {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: 'Repliz Account Shopee',
|
|
9
|
+
name: 'replizAccountShopee',
|
|
10
|
+
icon: 'file:repliz.svg',
|
|
11
|
+
group: ['transform'],
|
|
12
|
+
version: 1,
|
|
13
|
+
subtitle: '={{$parameter["operation"]}}',
|
|
14
|
+
description: 'Connect and manage Shopee accounts in Repliz (Gold+)',
|
|
15
|
+
defaults: { name: 'Repliz Account Shopee' },
|
|
16
|
+
inputs: ['main'],
|
|
17
|
+
outputs: ['main'],
|
|
18
|
+
credentials: [{ name: 'replizApi', required: true }],
|
|
19
|
+
properties: [
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Operation',
|
|
22
|
+
name: 'operation',
|
|
23
|
+
type: 'options',
|
|
24
|
+
noDataExpression: true,
|
|
25
|
+
options: [
|
|
26
|
+
{ name: 'Authorize', value: 'authorize', description: 'Get Shopee OAuth authorization URL', action: 'Authorize Shopee' },
|
|
27
|
+
{ name: 'Connect', value: 'connect', description: 'Connect Shopee account using auth code', action: 'Connect Shopee' },
|
|
28
|
+
{ name: 'Reconnect', value: 'reconnect', description: 'Re-authenticate an existing Shopee account', action: 'Reconnect Shopee' },
|
|
29
|
+
],
|
|
30
|
+
default: 'authorize',
|
|
31
|
+
},
|
|
32
|
+
{ displayName: 'Redirect URL', name: 'redirect', type: 'string', required: true, displayOptions: { show: { operation: ['authorize'] } }, default: '', description: 'The URL to redirect to after OAuth authorization' },
|
|
33
|
+
{ displayName: 'Authorization Code', name: 'code', type: 'string', required: true, displayOptions: { show: { operation: ['connect'] } }, default: '', description: 'The authorization code from Shopee OAuth callback' },
|
|
34
|
+
{ displayName: 'Account ID', name: 'accountId', type: 'string', required: true, displayOptions: { show: { operation: ['reconnect'] } }, default: '', description: 'The existing Repliz account ID to reconnect' },
|
|
35
|
+
{ displayName: 'Authorization Code', name: 'code', type: 'string', required: true, displayOptions: { show: { operation: ['reconnect'] } }, default: '', description: 'New authorization code from Shopee OAuth' },
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async execute() {
|
|
40
|
+
const items = this.getInputData();
|
|
41
|
+
const returnData = [];
|
|
42
|
+
for (let i = 0; i < items.length; i++) {
|
|
43
|
+
try {
|
|
44
|
+
const operation = this.getNodeParameter('operation', i);
|
|
45
|
+
let responseData;
|
|
46
|
+
if (operation === 'authorize') {
|
|
47
|
+
const redirect = this.getNodeParameter('redirect', i);
|
|
48
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'GET', '/public/account/shopee/authorize', {}, { redirect });
|
|
49
|
+
}
|
|
50
|
+
else if (operation === 'connect') {
|
|
51
|
+
const code = this.getNodeParameter('code', i);
|
|
52
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'POST', '/public/account/shopee/connect', { code });
|
|
53
|
+
}
|
|
54
|
+
else if (operation === 'reconnect') {
|
|
55
|
+
const accountId = this.getNodeParameter('accountId', i);
|
|
56
|
+
const code = this.getNodeParameter('code', i);
|
|
57
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'POST', `/public/account/shopee/connect/${accountId}`, { code });
|
|
58
|
+
}
|
|
59
|
+
returnData.push(...this.helpers.returnJsonArray(responseData));
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
if (this.continueOnFail()) {
|
|
63
|
+
returnData.push({ json: { error: error.message } });
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return [returnData];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.ReplizAccountShopee = ReplizAccountShopee;
|
|
73
|
+
//# sourceMappingURL=ReplizAccountShopee.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReplizAccountShopee.node.js","sourceRoot":"","sources":["../../../nodes/ReplizAccountShopee/ReplizAccountShopee.node.ts"],"names":[],"mappings":";;;AACA,0DAAuD;AAEvD,MAAa,mBAAmB;IAAhC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,uBAAuB;YACpC,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8BAA8B;YACxC,WAAW,EAAE,sDAAsD;YACnE,QAAQ,EAAE,EAAE,IAAI,EAAE,uBAAuB,EAAE;YAC3C,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACpD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,oCAAoC,EAAE,MAAM,EAAE,kBAAkB,EAAE;wBACxH,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,wCAAwC,EAAE,MAAM,EAAE,gBAAgB,EAAE;wBACtH,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,4CAA4C,EAAE,MAAM,EAAE,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,CAAC,cAAc,EAAE,EAAE,CAAC;oBAAC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;oBAAC,SAAS;gBAAC,CAAC;gBACxG,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QACD,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA9DD,kDA8DC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="180" height="180" viewBox="0 0 180 180" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M0 90C0 40.2944 40.2944 0 90 0C139.706 0 180 40.2944 180 90C180 139.706 139.706 180 90 180C40.2944 180 0 139.706 0 90Z" fill="black"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M115 45C121.63 45 127.989 47.6339 132.678 52.3223C137.366 57.0107 140 63.3696 140 70V110C140 116.63 137.366 122.989 132.678 127.678C127.989 132.366 121.63 135 115 135H45C43.6739 135 42.4021 134.473 41.4645 133.536C40.5268 132.598 40 131.326 40 130V70C40 63.3696 42.6339 57.0107 47.3223 52.3223C52.0107 47.6339 58.3696 45 65 45H115ZM75 80C73.7753 80.0002 72.5933 80.4498 71.6781 81.2636C70.763 82.0774 70.1783 83.1987 70.035 84.415L70 85V95C70.0014 96.2744 70.4894 97.5002 71.3642 98.4268C72.2391 99.3535 73.4348 99.9112 74.707 99.9859C75.9792 100.061 77.2319 99.6466 78.2092 98.8287C79.1864 98.0107 79.8145 96.8505 79.965 95.585L80 95V85C80 83.6739 79.4732 82.4021 78.5355 81.4645C77.5978 80.5268 76.3261 80 75 80ZM105 80C103.674 80 102.402 80.5268 101.464 81.4645C100.527 82.4021 100 83.6739 100 85V95C100 96.3261 100.527 97.5979 101.464 98.5355C102.402 99.4732 103.674 100 105 100C106.326 100 107.598 99.4732 108.536 98.5355C109.473 97.5979 110 96.3261 110 95V85C110 83.6739 109.473 82.4021 108.536 81.4645C107.598 80.5268 106.326 80 105 80Z" fill="white"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class ReplizAccountThreads implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReplizAccountThreads = void 0;
|
|
4
|
+
const GenericFunctions_1 = require("../GenericFunctions");
|
|
5
|
+
class ReplizAccountThreads {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: 'Repliz Account Threads',
|
|
9
|
+
name: 'replizAccountThreads',
|
|
10
|
+
icon: 'file:repliz.svg',
|
|
11
|
+
group: ['transform'],
|
|
12
|
+
version: 1,
|
|
13
|
+
subtitle: '={{$parameter["operation"]}}',
|
|
14
|
+
description: 'Connect and manage Threads accounts in Repliz (Gold+)',
|
|
15
|
+
defaults: { name: 'Repliz Account Threads' },
|
|
16
|
+
inputs: ['main'],
|
|
17
|
+
outputs: ['main'],
|
|
18
|
+
credentials: [{ name: 'replizApi', required: true }],
|
|
19
|
+
properties: [
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Operation',
|
|
22
|
+
name: 'operation',
|
|
23
|
+
type: 'options',
|
|
24
|
+
noDataExpression: true,
|
|
25
|
+
options: [
|
|
26
|
+
{ name: 'Authorize', value: 'authorize', description: 'Get Threads OAuth authorization URL', action: 'Authorize Threads' },
|
|
27
|
+
{ name: 'Connect', value: 'connect', description: 'Connect Threads account using auth code', action: 'Connect Threads' },
|
|
28
|
+
{ name: 'Reconnect', value: 'reconnect', description: 'Re-authenticate an existing Threads account', action: 'Reconnect Threads' },
|
|
29
|
+
],
|
|
30
|
+
default: 'authorize',
|
|
31
|
+
},
|
|
32
|
+
{ displayName: 'Redirect URL', name: 'redirect', type: 'string', required: true, displayOptions: { show: { operation: ['authorize'] } }, default: '', description: 'The URL to redirect to after OAuth authorization' },
|
|
33
|
+
{ displayName: 'Authorization Code', name: 'code', type: 'string', required: true, displayOptions: { show: { operation: ['connect'] } }, default: '', description: 'The authorization code from Threads OAuth callback' },
|
|
34
|
+
{ displayName: 'Account ID', name: 'accountId', type: 'string', required: true, displayOptions: { show: { operation: ['reconnect'] } }, default: '', description: 'The existing Repliz account ID to reconnect' },
|
|
35
|
+
{ displayName: 'Authorization Code', name: 'code', type: 'string', required: true, displayOptions: { show: { operation: ['reconnect'] } }, default: '', description: 'New authorization code from Threads OAuth' },
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async execute() {
|
|
40
|
+
const items = this.getInputData();
|
|
41
|
+
const returnData = [];
|
|
42
|
+
for (let i = 0; i < items.length; i++) {
|
|
43
|
+
try {
|
|
44
|
+
const operation = this.getNodeParameter('operation', i);
|
|
45
|
+
let responseData;
|
|
46
|
+
if (operation === 'authorize') {
|
|
47
|
+
const redirect = this.getNodeParameter('redirect', i);
|
|
48
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'GET', '/public/account/threads/authorize', {}, { redirect });
|
|
49
|
+
}
|
|
50
|
+
else if (operation === 'connect') {
|
|
51
|
+
const code = this.getNodeParameter('code', i);
|
|
52
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'POST', '/public/account/threads/connect', { code });
|
|
53
|
+
}
|
|
54
|
+
else if (operation === 'reconnect') {
|
|
55
|
+
const accountId = this.getNodeParameter('accountId', i);
|
|
56
|
+
const code = this.getNodeParameter('code', i);
|
|
57
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'POST', `/public/account/threads/connect/${accountId}`, { code });
|
|
58
|
+
}
|
|
59
|
+
returnData.push(...this.helpers.returnJsonArray(responseData));
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
if (this.continueOnFail()) {
|
|
63
|
+
returnData.push({ json: { error: error.message } });
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return [returnData];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.ReplizAccountThreads = ReplizAccountThreads;
|
|
73
|
+
//# sourceMappingURL=ReplizAccountThreads.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReplizAccountThreads.node.js","sourceRoot":"","sources":["../../../nodes/ReplizAccountThreads/ReplizAccountThreads.node.ts"],"names":[],"mappings":";;;AACA,0DAAuD;AAEvD,MAAa,oBAAoB;IAAjC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,sBAAsB;YAC5B,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8BAA8B;YACxC,WAAW,EAAE,uDAAuD;YACpE,QAAQ,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAE;YAC5C,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACpD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,qCAAqC,EAAE,MAAM,EAAE,mBAAmB,EAAE;wBAC1H,EAAE,IAAI,EAAE,SAAS,EAA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C,CAAC;gBACpH,CAAC;gBAED,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;YAChE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAAC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;oBAAC,SAAS;gBAAC,CAAC;gBACxG,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QACD,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA9DD,oDA8DC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="180" height="180" viewBox="0 0 180 180" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M0 90C0 40.2944 40.2944 0 90 0C139.706 0 180 40.2944 180 90C180 139.706 139.706 180 90 180C40.2944 180 0 139.706 0 90Z" fill="black"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M115 45C121.63 45 127.989 47.6339 132.678 52.3223C137.366 57.0107 140 63.3696 140 70V110C140 116.63 137.366 122.989 132.678 127.678C127.989 132.366 121.63 135 115 135H45C43.6739 135 42.4021 134.473 41.4645 133.536C40.5268 132.598 40 131.326 40 130V70C40 63.3696 42.6339 57.0107 47.3223 52.3223C52.0107 47.6339 58.3696 45 65 45H115ZM75 80C73.7753 80.0002 72.5933 80.4498 71.6781 81.2636C70.763 82.0774 70.1783 83.1987 70.035 84.415L70 85V95C70.0014 96.2744 70.4894 97.5002 71.3642 98.4268C72.2391 99.3535 73.4348 99.9112 74.707 99.9859C75.9792 100.061 77.2319 99.6466 78.2092 98.8287C79.1864 98.0107 79.8145 96.8505 79.965 95.585L80 95V85C80 83.6739 79.4732 82.4021 78.5355 81.4645C77.5978 80.5268 76.3261 80 75 80ZM105 80C103.674 80 102.402 80.5268 101.464 81.4645C100.527 82.4021 100 83.6739 100 85V95C100 96.3261 100.527 97.5979 101.464 98.5355C102.402 99.4732 103.674 100 105 100C106.326 100 107.598 99.4732 108.536 98.5355C109.473 97.5979 110 96.3261 110 95V85C110 83.6739 109.473 82.4021 108.536 81.4645C107.598 80.5268 106.326 80 105 80Z" fill="white"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class ReplizAccountTikTok implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReplizAccountTikTok = void 0;
|
|
4
|
+
const GenericFunctions_1 = require("../GenericFunctions");
|
|
5
|
+
class ReplizAccountTikTok {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: 'Repliz Account TikTok',
|
|
9
|
+
name: 'replizAccountTikTok',
|
|
10
|
+
icon: 'file:repliz.svg',
|
|
11
|
+
group: ['transform'],
|
|
12
|
+
version: 1,
|
|
13
|
+
subtitle: '={{$parameter["operation"]}}',
|
|
14
|
+
description: 'Connect and manage TikTok accounts in Repliz (Gold+)',
|
|
15
|
+
defaults: { name: 'Repliz Account TikTok' },
|
|
16
|
+
inputs: ['main'],
|
|
17
|
+
outputs: ['main'],
|
|
18
|
+
credentials: [{ name: 'replizApi', required: true }],
|
|
19
|
+
properties: [
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Operation',
|
|
22
|
+
name: 'operation',
|
|
23
|
+
type: 'options',
|
|
24
|
+
noDataExpression: true,
|
|
25
|
+
options: [
|
|
26
|
+
{ name: 'Authorize', value: 'authorize', description: 'Get TikTok OAuth authorization URL', action: 'Authorize TikTok' },
|
|
27
|
+
{ name: 'Connect', value: 'connect', description: 'Connect TikTok account using auth code', action: 'Connect TikTok' },
|
|
28
|
+
{ name: 'Reconnect', value: 'reconnect', description: 'Re-authenticate an existing TikTok account', action: 'Reconnect TikTok' },
|
|
29
|
+
],
|
|
30
|
+
default: 'authorize',
|
|
31
|
+
},
|
|
32
|
+
{ displayName: 'Redirect URL', name: 'redirect', type: 'string', required: true, displayOptions: { show: { operation: ['authorize'] } }, default: '', description: 'The URL to redirect to after OAuth authorization' },
|
|
33
|
+
{ displayName: 'Authorization Code', name: 'code', type: 'string', required: true, displayOptions: { show: { operation: ['connect'] } }, default: '', description: 'The authorization code from TikTok OAuth callback' },
|
|
34
|
+
{ displayName: 'Account ID', name: 'accountId', type: 'string', required: true, displayOptions: { show: { operation: ['reconnect'] } }, default: '', description: 'The existing Repliz account ID to reconnect' },
|
|
35
|
+
{ displayName: 'Authorization Code', name: 'code', type: 'string', required: true, displayOptions: { show: { operation: ['reconnect'] } }, default: '', description: 'New authorization code from TikTok OAuth' },
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async execute() {
|
|
40
|
+
const items = this.getInputData();
|
|
41
|
+
const returnData = [];
|
|
42
|
+
for (let i = 0; i < items.length; i++) {
|
|
43
|
+
try {
|
|
44
|
+
const operation = this.getNodeParameter('operation', i);
|
|
45
|
+
let responseData;
|
|
46
|
+
if (operation === 'authorize') {
|
|
47
|
+
const redirect = this.getNodeParameter('redirect', i);
|
|
48
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'GET', '/public/account/tiktok/authorize', {}, { redirect });
|
|
49
|
+
}
|
|
50
|
+
else if (operation === 'connect') {
|
|
51
|
+
const code = this.getNodeParameter('code', i);
|
|
52
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'POST', '/public/account/tiktok/connect', { code });
|
|
53
|
+
}
|
|
54
|
+
else if (operation === 'reconnect') {
|
|
55
|
+
const accountId = this.getNodeParameter('accountId', i);
|
|
56
|
+
const code = this.getNodeParameter('code', i);
|
|
57
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'POST', `/public/account/tiktok/connect/${accountId}`, { code });
|
|
58
|
+
}
|
|
59
|
+
returnData.push(...this.helpers.returnJsonArray(responseData));
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
if (this.continueOnFail()) {
|
|
63
|
+
returnData.push({ json: { error: error.message } });
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return [returnData];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.ReplizAccountTikTok = ReplizAccountTikTok;
|
|
73
|
+
//# sourceMappingURL=ReplizAccountTikTok.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReplizAccountTikTok.node.js","sourceRoot":"","sources":["../../../nodes/ReplizAccountTikTok/ReplizAccountTikTok.node.ts"],"names":[],"mappings":";;;AACA,0DAAuD;AAEvD,MAAa,mBAAmB;IAAhC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,uBAAuB;YACpC,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8BAA8B;YACxC,WAAW,EAAE,sDAAsD;YACnE,QAAQ,EAAE,EAAE,IAAI,EAAE,uBAAuB,EAAE;YAC3C,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACpD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,WAAW;oBACjB,IA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AAC;oBAClE,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAW,CAAC;oBACxD,YAAY,GAAG,MAAM,mCAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,kCAAkC,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;gBACnH,CAAC;gBAED,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;YAChE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAAC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;oBAAC,SAAS;gBAAC,CAAC;gBACxG,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QACD,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA9DD,kDA8DC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="180" height="180" viewBox="0 0 180 180" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M0 90C0 40.2944 40.2944 0 90 0C139.706 0 180 40.2944 180 90C180 139.706 139.706 180 90 180C40.2944 180 0 139.706 0 90Z" fill="black"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M115 45C121.63 45 127.989 47.6339 132.678 52.3223C137.366 57.0107 140 63.3696 140 70V110C140 116.63 137.366 122.989 132.678 127.678C127.989 132.366 121.63 135 115 135H45C43.6739 135 42.4021 134.473 41.4645 133.536C40.5268 132.598 40 131.326 40 130V70C40 63.3696 42.6339 57.0107 47.3223 52.3223C52.0107 47.6339 58.3696 45 65 45H115ZM75 80C73.7753 80.0002 72.5933 80.4498 71.6781 81.2636C70.763 82.0774 70.1783 83.1987 70.035 84.415L70 85V95C70.0014 96.2744 70.4894 97.5002 71.3642 98.4268C72.2391 99.3535 73.4348 99.9112 74.707 99.9859C75.9792 100.061 77.2319 99.6466 78.2092 98.8287C79.1864 98.0107 79.8145 96.8505 79.965 95.585L80 95V85C80 83.6739 79.4732 82.4021 78.5355 81.4645C77.5978 80.5268 76.3261 80 75 80ZM105 80C103.674 80 102.402 80.5268 101.464 81.4645C100.527 82.4021 100 83.6739 100 85V95C100 96.3261 100.527 97.5979 101.464 98.5355C102.402 99.4732 103.674 100 105 100C106.326 100 107.598 99.4732 108.536 98.5355C109.473 97.5979 110 96.3261 110 95V85C110 83.6739 109.473 82.4021 108.536 81.4645C107.598 80.5268 106.326 80 105 80Z" fill="white"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class ReplizAccountYoutube implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReplizAccountYoutube = void 0;
|
|
4
|
+
const GenericFunctions_1 = require("../GenericFunctions");
|
|
5
|
+
class ReplizAccountYoutube {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: 'Repliz Account YouTube',
|
|
9
|
+
name: 'replizAccountYoutube',
|
|
10
|
+
icon: 'file:repliz.svg',
|
|
11
|
+
group: ['transform'],
|
|
12
|
+
version: 1,
|
|
13
|
+
subtitle: '={{$parameter["operation"]}}',
|
|
14
|
+
description: 'Connect and manage YouTube accounts in Repliz (Gold+)',
|
|
15
|
+
defaults: { name: 'Repliz Account YouTube' },
|
|
16
|
+
inputs: ['main'],
|
|
17
|
+
outputs: ['main'],
|
|
18
|
+
credentials: [{ name: 'replizApi', required: true }],
|
|
19
|
+
properties: [
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Operation',
|
|
22
|
+
name: 'operation',
|
|
23
|
+
type: 'options',
|
|
24
|
+
noDataExpression: true,
|
|
25
|
+
options: [
|
|
26
|
+
{ name: 'Authorize', value: 'authorize', description: 'Get YouTube OAuth authorization URL', action: 'Authorize YouTube' },
|
|
27
|
+
{ name: 'Get Channels', value: 'getChannel', description: 'Retrieve available YouTube channels for a token', action: 'Get YouTube channels' },
|
|
28
|
+
{ name: 'Exchange Token', value: 'exchange', description: 'Exchange auth code for a YouTube access token', action: 'Exchange YouTube token' },
|
|
29
|
+
{ name: 'Connect', value: 'connect', description: 'Connect a YouTube channel to your workspace', action: 'Connect YouTube channel' },
|
|
30
|
+
{ name: 'Reconnect', value: 'reconnect', description: 'Re-authenticate an existing YouTube account', action: 'Reconnect YouTube account' },
|
|
31
|
+
],
|
|
32
|
+
default: 'authorize',
|
|
33
|
+
},
|
|
34
|
+
{ displayName: 'Redirect URL', name: 'redirect', type: 'string', required: true, displayOptions: { show: { operation: ['authorize'] } }, default: '', description: 'The URL to redirect to after OAuth authorization' },
|
|
35
|
+
{ displayName: 'Access Token', name: 'token', type: 'string', typeOptions: { password: true }, required: true, displayOptions: { show: { operation: ['getChannel'] } }, default: '', description: 'YouTube access token to list available channels' },
|
|
36
|
+
{ displayName: 'Authorization Code', name: 'code', type: 'string', required: true, displayOptions: { show: { operation: ['exchange'] } }, default: '', description: 'The authorization code from YouTube OAuth callback' },
|
|
37
|
+
{ displayName: 'Access Token', name: 'token', type: 'string', typeOptions: { password: true }, required: true, displayOptions: { show: { operation: ['connect'] } }, default: '', description: 'YouTube long-lived access token' },
|
|
38
|
+
{ displayName: 'Channel ID', name: 'channelId', type: 'string', required: true, displayOptions: { show: { operation: ['connect'] } }, default: '', description: 'The YouTube Channel ID to connect' },
|
|
39
|
+
{ displayName: 'Account ID', name: 'accountId', type: 'string', required: true, displayOptions: { show: { operation: ['reconnect'] } }, default: '', description: 'The existing Repliz account ID to reconnect' },
|
|
40
|
+
{ displayName: 'Access Token', name: 'token', type: 'string', typeOptions: { password: true }, required: true, displayOptions: { show: { operation: ['reconnect'] } }, default: '', description: 'New YouTube access token' },
|
|
41
|
+
{ displayName: 'Channel ID', name: 'channelId', type: 'string', required: true, displayOptions: { show: { operation: ['reconnect'] } }, default: '', description: 'The YouTube Channel ID' },
|
|
42
|
+
],
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
async execute() {
|
|
46
|
+
const items = this.getInputData();
|
|
47
|
+
const returnData = [];
|
|
48
|
+
for (let i = 0; i < items.length; i++) {
|
|
49
|
+
try {
|
|
50
|
+
const operation = this.getNodeParameter('operation', i);
|
|
51
|
+
let responseData;
|
|
52
|
+
if (operation === 'authorize') {
|
|
53
|
+
const redirect = this.getNodeParameter('redirect', i);
|
|
54
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'GET', '/public/account/youtube/authorize', {}, { redirect });
|
|
55
|
+
}
|
|
56
|
+
else if (operation === 'getChannel') {
|
|
57
|
+
const token = this.getNodeParameter('token', i);
|
|
58
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'GET', '/public/account/youtube/channel', {}, { token });
|
|
59
|
+
}
|
|
60
|
+
else if (operation === 'exchange') {
|
|
61
|
+
const code = this.getNodeParameter('code', i);
|
|
62
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'POST', '/public/account/youtube/exchange', { code });
|
|
63
|
+
}
|
|
64
|
+
else if (operation === 'connect') {
|
|
65
|
+
const token = this.getNodeParameter('token', i);
|
|
66
|
+
const channelId = this.getNodeParameter('channelId', i);
|
|
67
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'POST', '/public/account/youtube/connect', { token, channelId });
|
|
68
|
+
}
|
|
69
|
+
else if (operation === 'reconnect') {
|
|
70
|
+
const accountId = this.getNodeParameter('accountId', i);
|
|
71
|
+
const token = this.getNodeParameter('token', i);
|
|
72
|
+
const channelId = this.getNodeParameter('channelId', i);
|
|
73
|
+
responseData = await GenericFunctions_1.replizApiRequest.call(this, 'POST', `/public/account/youtube/connect/${accountId}`, { token, channelId });
|
|
74
|
+
}
|
|
75
|
+
returnData.push(...this.helpers.returnJsonArray(responseData));
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
if (this.continueOnFail()) {
|
|
79
|
+
returnData.push({ json: { error: error.message } });
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
throw error;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return [returnData];
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.ReplizAccountYoutube = ReplizAccountYoutube;
|
|
89
|
+
//# sourceMappingURL=ReplizAccountYoutube.node.js.map
|