n8n-nodes-ume-v4 4.0.0
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/LICENSE +21 -0
- package/README.md +204 -0
- package/dist/credentials/UmeApi.credentials.d.ts +7 -0
- package/dist/credentials/UmeApi.credentials.js +41 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +9 -0
- package/dist/nodes/FacebookComment/FacebookComment.node.d.ts +5 -0
- package/dist/nodes/FacebookComment/FacebookComment.node.js +155 -0
- package/dist/nodes/FacebookCommentLike/FacebookCommentLike.node.d.ts +5 -0
- package/dist/nodes/FacebookCommentLike/FacebookCommentLike.node.js +122 -0
- package/dist/nodes/FacebookLike/FacebookLike.node.d.ts +5 -0
- package/dist/nodes/FacebookLike/FacebookLike.node.js +160 -0
- package/dist/nodes/FacebookShare/FacebookShare.node.d.ts +5 -0
- package/dist/nodes/FacebookShare/FacebookShare.node.js +141 -0
- package/dist/nodes/FacebookStoryView/FacebookStoryView.node.d.ts +5 -0
- package/dist/nodes/FacebookStoryView/FacebookStoryView.node.js +122 -0
- package/dist/nodes/FacebookView/FacebookView.node.d.ts +5 -0
- package/dist/nodes/FacebookView/FacebookView.node.js +127 -0
- package/dist/nodes/InstagramComment/InstagramComment.node.d.ts +5 -0
- package/dist/nodes/InstagramComment/InstagramComment.node.js +145 -0
- package/dist/nodes/InstagramLike/InstagramLike.node.d.ts +5 -0
- package/dist/nodes/InstagramLike/InstagramLike.node.js +138 -0
- package/dist/nodes/InstagramView/InstagramView.node.d.ts +5 -0
- package/dist/nodes/InstagramView/InstagramView.node.js +151 -0
- package/dist/nodes/TikTokComment/TikTokComment.node.d.ts +5 -0
- package/dist/nodes/TikTokComment/TikTokComment.node.js +136 -0
- package/dist/nodes/TikTokCommentLike/TikTokCommentLike.node.d.ts +5 -0
- package/dist/nodes/TikTokCommentLike/TikTokCommentLike.node.js +122 -0
- package/dist/nodes/TikTokFavorite/TikTokFavorite.node.d.ts +5 -0
- package/dist/nodes/TikTokFavorite/TikTokFavorite.node.js +127 -0
- package/dist/nodes/TikTokLike/TikTokLike.node.d.ts +5 -0
- package/dist/nodes/TikTokLike/TikTokLike.node.js +141 -0
- package/dist/nodes/TikTokShare/TikTokShare.node.d.ts +5 -0
- package/dist/nodes/TikTokShare/TikTokShare.node.js +131 -0
- package/dist/nodes/TikTokView/TikTokView.node.d.ts +5 -0
- package/dist/nodes/TikTokView/TikTokView.node.js +136 -0
- package/dist/nodes/Ume/Ume.node.d.ts +5 -0
- package/dist/nodes/Ume/Ume.node.js +244 -0
- package/dist/nodes/Ume/operations-data.json +2246 -0
- package/dist/nodes/UmeSocialSeeding/UmeSocialSeeding.node.d.ts +5 -0
- package/dist/nodes/UmeSocialSeeding/UmeSocialSeeding.node.js +203 -0
- package/dist/nodes/UmeSocialSeeding/UmeSocialSeedingHelpers.d.ts +4 -0
- package/dist/nodes/UmeSocialSeeding/UmeSocialSeedingHelpers.js +382 -0
- package/dist/nodes/UmeSocialSeeding/operations-data.json +673 -0
- package/dist/nodes/UmeSocialSeeding/reaction.png +0 -0
- package/dist/nodes/UmeSocialSeeding/server-info.json +431 -0
- package/dist/nodes/UmeSocialSeeding/services-data-backup.json +3525 -0
- package/dist/nodes/UmeSocialSeeding/services-data-old.json +2704 -0
- package/dist/nodes/UmeSocialSeeding/services-data.json +7341 -0
- package/dist/nodes/UmeSocialSeeding/services-data.json.backup +3525 -0
- package/dist/nodes/UmeSocialSeeding/services-data.json.backup.1759909364606 +1927 -0
- package/dist/nodes/YouTubeComment/YouTubeComment.node.d.ts +5 -0
- package/dist/nodes/YouTubeComment/YouTubeComment.node.js +152 -0
- package/dist/nodes/YouTubeLike/YouTubeLike.node.d.ts +5 -0
- package/dist/nodes/YouTubeLike/YouTubeLike.node.js +141 -0
- package/dist/nodes/YouTubeView/YouTubeView.node.d.ts +5 -0
- package/dist/nodes/YouTubeView/YouTubeView.node.js +142 -0
- package/package.json +62 -0
@@ -0,0 +1,160 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.FacebookLike = void 0;
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
5
|
+
const BASE_URL_FALLBACK = "https://ume.com.vn/api";
|
6
|
+
class FacebookLike {
|
7
|
+
constructor() {
|
8
|
+
this.description = {
|
9
|
+
displayName: "🌱 Facebook Like",
|
10
|
+
name: "facebookLike",
|
11
|
+
group: ["transform"],
|
12
|
+
version: 1,
|
13
|
+
subtitle: '={{$parameter["server"]}}',
|
14
|
+
description: "Tăng like bài viết Facebook",
|
15
|
+
defaults: {
|
16
|
+
name: "🌱 Facebook Like",
|
17
|
+
},
|
18
|
+
inputs: ["main"],
|
19
|
+
outputs: ["main"],
|
20
|
+
credentials: [
|
21
|
+
{
|
22
|
+
name: "umeApi",
|
23
|
+
required: true,
|
24
|
+
},
|
25
|
+
],
|
26
|
+
properties: [
|
27
|
+
{
|
28
|
+
displayName: "Server",
|
29
|
+
name: "server",
|
30
|
+
type: "options",
|
31
|
+
noDataExpression: true,
|
32
|
+
options: [
|
33
|
+
{
|
34
|
+
name: "Server 3 - Like việt. Tốc độ ổn (94.5₫/like)",
|
35
|
+
value: "3",
|
36
|
+
description: "Like, love, care, haha, wow, sad, angry. Tối thiểu: 50, Tối đa: 10,000",
|
37
|
+
},
|
38
|
+
{
|
39
|
+
name: "Server 6 - Like việt. (99.1₫/like)",
|
40
|
+
value: "6",
|
41
|
+
description: "Được phép dồn số lượng. Tối thiểu: 50, Tối đa: 200,000",
|
42
|
+
},
|
43
|
+
{
|
44
|
+
name: "Server 15 - Like việt (144.5₫/like)",
|
45
|
+
value: "15",
|
46
|
+
description: "Được phép dồn số lượng. Tối thiểu: 50, Tối đa: 100,000",
|
47
|
+
},
|
48
|
+
],
|
49
|
+
default: "3",
|
50
|
+
description: "Chọn server để tăng like",
|
51
|
+
},
|
52
|
+
{
|
53
|
+
displayName: "Link bài viết",
|
54
|
+
name: "link",
|
55
|
+
type: "string",
|
56
|
+
required: true,
|
57
|
+
default: "",
|
58
|
+
description: "Link bài viết Facebook cần tăng like",
|
59
|
+
},
|
60
|
+
{
|
61
|
+
displayName: "Số lượng",
|
62
|
+
name: "amount",
|
63
|
+
type: "number",
|
64
|
+
required: true,
|
65
|
+
default: 100,
|
66
|
+
description: "Số lượng like cần tăng",
|
67
|
+
typeOptions: {
|
68
|
+
minValue: 50,
|
69
|
+
maxValue: 200000,
|
70
|
+
},
|
71
|
+
validateType: 'number',
|
72
|
+
},
|
73
|
+
{
|
74
|
+
displayName: "Loại cảm xúc",
|
75
|
+
name: "type",
|
76
|
+
type: "options",
|
77
|
+
noDataExpression: true,
|
78
|
+
options: [
|
79
|
+
{ name: "Like", value: "like" },
|
80
|
+
{ name: "Love", value: "love" },
|
81
|
+
{ name: "Care", value: "care" },
|
82
|
+
{ name: "Haha", value: "haha" },
|
83
|
+
{ name: "Wow", value: "wow" },
|
84
|
+
{ name: "Sad", value: "sad" },
|
85
|
+
{ name: "Angry", value: "angry" },
|
86
|
+
],
|
87
|
+
default: "like",
|
88
|
+
description: "Chọn loại cảm xúc",
|
89
|
+
},
|
90
|
+
],
|
91
|
+
};
|
92
|
+
}
|
93
|
+
async execute() {
|
94
|
+
var _a;
|
95
|
+
const returnData = [];
|
96
|
+
const items = this.getInputData();
|
97
|
+
const credentials = (await this.getCredentials("umeApi"));
|
98
|
+
if (!credentials || !credentials.token) {
|
99
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "API token is missing in the UME credentials.");
|
100
|
+
}
|
101
|
+
const baseUrl = ((_a = credentials.baseUrl) !== null && _a !== void 0 ? _a : BASE_URL_FALLBACK).replace(/\/+$/, "");
|
102
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex += 1) {
|
103
|
+
const server = this.getNodeParameter("server", itemIndex);
|
104
|
+
const link = this.getNodeParameter("link", itemIndex);
|
105
|
+
const amount = this.getNodeParameter("amount", itemIndex);
|
106
|
+
const type = this.getNodeParameter("type", itemIndex);
|
107
|
+
// Validate min/max based on server
|
108
|
+
let minAmount = 50;
|
109
|
+
let maxAmount = 10000;
|
110
|
+
if (server === "6") {
|
111
|
+
maxAmount = 200000;
|
112
|
+
}
|
113
|
+
else if (server === "15") {
|
114
|
+
maxAmount = 100000;
|
115
|
+
}
|
116
|
+
if (amount < minAmount || amount > maxAmount) {
|
117
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Số lượng phải từ ${minAmount} đến ${maxAmount} cho server ${server}`, { itemIndex });
|
118
|
+
}
|
119
|
+
const formBody = {
|
120
|
+
token: credentials.token,
|
121
|
+
link: link,
|
122
|
+
amount: amount.toString(),
|
123
|
+
type: type,
|
124
|
+
};
|
125
|
+
const requestOptions = {
|
126
|
+
method: "POST",
|
127
|
+
uri: `${baseUrl}/facebook/${server}/like`,
|
128
|
+
form: formBody,
|
129
|
+
json: true,
|
130
|
+
};
|
131
|
+
let responseData;
|
132
|
+
try {
|
133
|
+
responseData = await this.helpers.request(requestOptions);
|
134
|
+
}
|
135
|
+
catch (error) {
|
136
|
+
if (error instanceof n8n_workflow_1.NodeOperationError) {
|
137
|
+
throw error;
|
138
|
+
}
|
139
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex });
|
140
|
+
}
|
141
|
+
const responseObject = typeof responseData === "object" && responseData !== null
|
142
|
+
? responseData
|
143
|
+
: { data: responseData };
|
144
|
+
returnData.push({
|
145
|
+
json: {
|
146
|
+
...responseObject,
|
147
|
+
server,
|
148
|
+
link,
|
149
|
+
amount,
|
150
|
+
type,
|
151
|
+
},
|
152
|
+
pairedItem: {
|
153
|
+
item: itemIndex,
|
154
|
+
},
|
155
|
+
});
|
156
|
+
}
|
157
|
+
return [returnData];
|
158
|
+
}
|
159
|
+
}
|
160
|
+
exports.FacebookLike = FacebookLike;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from "n8n-workflow";
|
2
|
+
export declare class FacebookShare implements INodeType {
|
3
|
+
description: INodeTypeDescription;
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
5
|
+
}
|
@@ -0,0 +1,141 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.FacebookShare = void 0;
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
5
|
+
const BASE_URL_FALLBACK = "https://ume.com.vn/api";
|
6
|
+
class FacebookShare {
|
7
|
+
constructor() {
|
8
|
+
this.description = {
|
9
|
+
displayName: "🌱 Facebook Share",
|
10
|
+
name: "facebookShare",
|
11
|
+
group: ["transform"],
|
12
|
+
version: 1,
|
13
|
+
subtitle: '={{$parameter["server"]}}',
|
14
|
+
description: "Tăng share bài viết Facebook",
|
15
|
+
defaults: {
|
16
|
+
name: "🌱 Facebook Share",
|
17
|
+
},
|
18
|
+
inputs: ["main"],
|
19
|
+
outputs: ["main"],
|
20
|
+
credentials: [
|
21
|
+
{
|
22
|
+
name: "umeApi",
|
23
|
+
required: true,
|
24
|
+
},
|
25
|
+
],
|
26
|
+
properties: [
|
27
|
+
{
|
28
|
+
displayName: "Server",
|
29
|
+
name: "server",
|
30
|
+
type: "options",
|
31
|
+
noDataExpression: true,
|
32
|
+
options: [
|
33
|
+
{
|
34
|
+
name: "Server 2 - Chia sẻ việt, tốc độ nhanh (1,046.5₫/share)",
|
35
|
+
value: "2",
|
36
|
+
description: "Hỗ trợ tất cả các link. Tối thiểu: 30, Tối đa: 10,000",
|
37
|
+
},
|
38
|
+
{
|
39
|
+
name: "Server 6 - Share việt, tốc độ siêu tốc (1,319.5₫/share)",
|
40
|
+
value: "6",
|
41
|
+
description: "Tốc độ chạy rất nhanh. Tối thiểu: 20, Tối đa: 10,000",
|
42
|
+
},
|
43
|
+
{
|
44
|
+
name: "Server 5 - Share ảo [Siêu Tốc] (91₫/share)",
|
45
|
+
value: "5",
|
46
|
+
description: "Share ảo max 100 triệu. Hỗ trợ tất cả link. Tối thiểu: 1,000, Tối đa: 100,000,000",
|
47
|
+
},
|
48
|
+
],
|
49
|
+
default: "2",
|
50
|
+
description: "Chọn server để tăng share",
|
51
|
+
},
|
52
|
+
{
|
53
|
+
displayName: "Link bài viết",
|
54
|
+
name: "link",
|
55
|
+
type: "string",
|
56
|
+
required: true,
|
57
|
+
default: "",
|
58
|
+
description: "Link bài viết Facebook cần tăng share",
|
59
|
+
},
|
60
|
+
{
|
61
|
+
displayName: "Số lượng",
|
62
|
+
name: "amount",
|
63
|
+
type: "number",
|
64
|
+
required: true,
|
65
|
+
default: 100,
|
66
|
+
description: "Số lượng share cần tăng",
|
67
|
+
typeOptions: {
|
68
|
+
minValue: 20,
|
69
|
+
maxValue: 100000000,
|
70
|
+
},
|
71
|
+
validateType: 'number',
|
72
|
+
},
|
73
|
+
],
|
74
|
+
};
|
75
|
+
}
|
76
|
+
async execute() {
|
77
|
+
var _a;
|
78
|
+
const returnData = [];
|
79
|
+
const items = this.getInputData();
|
80
|
+
const credentials = (await this.getCredentials("umeApi"));
|
81
|
+
if (!credentials || !credentials.token) {
|
82
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "API token is missing in the UME credentials.");
|
83
|
+
}
|
84
|
+
const baseUrl = ((_a = credentials.baseUrl) !== null && _a !== void 0 ? _a : BASE_URL_FALLBACK).replace(/\/+$/, "");
|
85
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex += 1) {
|
86
|
+
const server = this.getNodeParameter("server", itemIndex);
|
87
|
+
const link = this.getNodeParameter("link", itemIndex);
|
88
|
+
const amount = this.getNodeParameter("amount", itemIndex);
|
89
|
+
// Validate min/max based on server
|
90
|
+
let minAmount = 30;
|
91
|
+
let maxAmount = 10000;
|
92
|
+
if (server === "6") {
|
93
|
+
minAmount = 20;
|
94
|
+
}
|
95
|
+
else if (server === "5") {
|
96
|
+
minAmount = 1000;
|
97
|
+
maxAmount = 100000000;
|
98
|
+
}
|
99
|
+
if (amount < minAmount || amount > maxAmount) {
|
100
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Số lượng phải từ ${minAmount} đến ${maxAmount} cho server ${server}`, { itemIndex });
|
101
|
+
}
|
102
|
+
const formBody = {
|
103
|
+
token: credentials.token,
|
104
|
+
link: link,
|
105
|
+
amount: amount.toString(),
|
106
|
+
};
|
107
|
+
const requestOptions = {
|
108
|
+
method: "POST",
|
109
|
+
uri: `${baseUrl}/facebook/${server}/share`,
|
110
|
+
form: formBody,
|
111
|
+
json: true,
|
112
|
+
};
|
113
|
+
let responseData;
|
114
|
+
try {
|
115
|
+
responseData = await this.helpers.request(requestOptions);
|
116
|
+
}
|
117
|
+
catch (error) {
|
118
|
+
if (error instanceof n8n_workflow_1.NodeOperationError) {
|
119
|
+
throw error;
|
120
|
+
}
|
121
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex });
|
122
|
+
}
|
123
|
+
const responseObject = typeof responseData === "object" && responseData !== null
|
124
|
+
? responseData
|
125
|
+
: { data: responseData };
|
126
|
+
returnData.push({
|
127
|
+
json: {
|
128
|
+
...responseObject,
|
129
|
+
server,
|
130
|
+
link,
|
131
|
+
amount,
|
132
|
+
},
|
133
|
+
pairedItem: {
|
134
|
+
item: itemIndex,
|
135
|
+
},
|
136
|
+
});
|
137
|
+
}
|
138
|
+
return [returnData];
|
139
|
+
}
|
140
|
+
}
|
141
|
+
exports.FacebookShare = FacebookShare;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from "n8n-workflow";
|
2
|
+
export declare class FacebookStoryView implements INodeType {
|
3
|
+
description: INodeTypeDescription;
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
5
|
+
}
|
@@ -0,0 +1,122 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.FacebookStoryView = void 0;
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
5
|
+
const BASE_URL_FALLBACK = "https://ume.com.vn/api";
|
6
|
+
class FacebookStoryView {
|
7
|
+
constructor() {
|
8
|
+
this.description = {
|
9
|
+
displayName: "🌱 Facebook Story View",
|
10
|
+
name: "facebookStoryView",
|
11
|
+
group: ["transform"],
|
12
|
+
version: 1,
|
13
|
+
subtitle: '={{$parameter["server"]}}',
|
14
|
+
description: "Tăng view story Facebook",
|
15
|
+
defaults: {
|
16
|
+
name: "🌱 Facebook Story View",
|
17
|
+
},
|
18
|
+
inputs: ["main"],
|
19
|
+
outputs: ["main"],
|
20
|
+
credentials: [
|
21
|
+
{
|
22
|
+
name: "umeApi",
|
23
|
+
required: true,
|
24
|
+
},
|
25
|
+
],
|
26
|
+
properties: [
|
27
|
+
{
|
28
|
+
displayName: "Server",
|
29
|
+
name: "server",
|
30
|
+
type: "options",
|
31
|
+
noDataExpression: true,
|
32
|
+
options: [
|
33
|
+
{
|
34
|
+
name: "Server 3 - Tốc độ tốt (217.4₫/view)",
|
35
|
+
value: "3",
|
36
|
+
description: "View ảo, đẩy lên bảng tin 24h. Tối thiểu: 200, Tối đa: 100,000",
|
37
|
+
},
|
38
|
+
],
|
39
|
+
default: "3",
|
40
|
+
description: "Chọn server để tăng view story",
|
41
|
+
},
|
42
|
+
{
|
43
|
+
displayName: "Link story",
|
44
|
+
name: "link",
|
45
|
+
type: "string",
|
46
|
+
required: true,
|
47
|
+
default: "",
|
48
|
+
description: "Link story Facebook cần tăng view",
|
49
|
+
},
|
50
|
+
{
|
51
|
+
displayName: "Số lượng",
|
52
|
+
name: "amount",
|
53
|
+
type: "number",
|
54
|
+
required: true,
|
55
|
+
default: 500,
|
56
|
+
description: "Số lượng view cần tăng",
|
57
|
+
typeOptions: {
|
58
|
+
minValue: 200,
|
59
|
+
maxValue: 100000,
|
60
|
+
},
|
61
|
+
validateType: 'number',
|
62
|
+
},
|
63
|
+
],
|
64
|
+
};
|
65
|
+
}
|
66
|
+
async execute() {
|
67
|
+
var _a;
|
68
|
+
const returnData = [];
|
69
|
+
const items = this.getInputData();
|
70
|
+
const credentials = (await this.getCredentials("umeApi"));
|
71
|
+
if (!credentials || !credentials.token) {
|
72
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "API token is missing in the UME credentials.");
|
73
|
+
}
|
74
|
+
const baseUrl = ((_a = credentials.baseUrl) !== null && _a !== void 0 ? _a : BASE_URL_FALLBACK).replace(/\/+$/, "");
|
75
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex += 1) {
|
76
|
+
const server = this.getNodeParameter("server", itemIndex);
|
77
|
+
const link = this.getNodeParameter("link", itemIndex);
|
78
|
+
const amount = this.getNodeParameter("amount", itemIndex);
|
79
|
+
// Validate min/max
|
80
|
+
if (amount < 200 || amount > 100000) {
|
81
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "Số lượng phải từ 200 đến 100,000", { itemIndex });
|
82
|
+
}
|
83
|
+
const formBody = {
|
84
|
+
token: credentials.token,
|
85
|
+
link: link,
|
86
|
+
amount: amount.toString(),
|
87
|
+
};
|
88
|
+
const requestOptions = {
|
89
|
+
method: "POST",
|
90
|
+
uri: `${baseUrl}/facebook/${server}/view_story`,
|
91
|
+
form: formBody,
|
92
|
+
json: true,
|
93
|
+
};
|
94
|
+
let responseData;
|
95
|
+
try {
|
96
|
+
responseData = await this.helpers.request(requestOptions);
|
97
|
+
}
|
98
|
+
catch (error) {
|
99
|
+
if (error instanceof n8n_workflow_1.NodeOperationError) {
|
100
|
+
throw error;
|
101
|
+
}
|
102
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex });
|
103
|
+
}
|
104
|
+
const responseObject = typeof responseData === "object" && responseData !== null
|
105
|
+
? responseData
|
106
|
+
: { data: responseData };
|
107
|
+
returnData.push({
|
108
|
+
json: {
|
109
|
+
...responseObject,
|
110
|
+
server,
|
111
|
+
link,
|
112
|
+
amount,
|
113
|
+
},
|
114
|
+
pairedItem: {
|
115
|
+
item: itemIndex,
|
116
|
+
},
|
117
|
+
});
|
118
|
+
}
|
119
|
+
return [returnData];
|
120
|
+
}
|
121
|
+
}
|
122
|
+
exports.FacebookStoryView = FacebookStoryView;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from "n8n-workflow";
|
2
|
+
export declare class FacebookView implements INodeType {
|
3
|
+
description: INodeTypeDescription;
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
5
|
+
}
|
@@ -0,0 +1,127 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.FacebookView = void 0;
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
5
|
+
const BASE_URL_FALLBACK = "https://ume.com.vn/api";
|
6
|
+
class FacebookView {
|
7
|
+
constructor() {
|
8
|
+
this.description = {
|
9
|
+
displayName: "🌱 Facebook View",
|
10
|
+
name: "facebookView",
|
11
|
+
group: ["transform"],
|
12
|
+
version: 1,
|
13
|
+
subtitle: '={{$parameter["server"]}}',
|
14
|
+
description: "Tăng view video Facebook",
|
15
|
+
defaults: {
|
16
|
+
name: "🌱 Facebook View",
|
17
|
+
},
|
18
|
+
inputs: ["main"],
|
19
|
+
outputs: ["main"],
|
20
|
+
credentials: [
|
21
|
+
{
|
22
|
+
name: "umeApi",
|
23
|
+
required: true,
|
24
|
+
},
|
25
|
+
],
|
26
|
+
properties: [
|
27
|
+
{
|
28
|
+
displayName: "Server",
|
29
|
+
name: "server",
|
30
|
+
type: "options",
|
31
|
+
noDataExpression: true,
|
32
|
+
options: [
|
33
|
+
{
|
34
|
+
name: "Server 4 - Gói view giá tốt (38.9₫/view)",
|
35
|
+
value: "4",
|
36
|
+
description: "Tốc độ khá tốt. Tối thiểu: 500, Tối đa: 5,000,000",
|
37
|
+
},
|
38
|
+
{
|
39
|
+
name: "Server 7 - Tốc độ lên ổn (50.1₫/view)",
|
40
|
+
value: "7",
|
41
|
+
description: "Có thể yêu cầu hủy sau 12h. Tối thiểu: 500, Tối đa: 10,000,000",
|
42
|
+
},
|
43
|
+
],
|
44
|
+
default: "4",
|
45
|
+
description: "Chọn server để tăng view",
|
46
|
+
},
|
47
|
+
{
|
48
|
+
displayName: "Link video",
|
49
|
+
name: "link",
|
50
|
+
type: "string",
|
51
|
+
required: true,
|
52
|
+
default: "",
|
53
|
+
description: "Link video Facebook cần tăng view",
|
54
|
+
},
|
55
|
+
{
|
56
|
+
displayName: "Số lượng",
|
57
|
+
name: "amount",
|
58
|
+
type: "number",
|
59
|
+
required: true,
|
60
|
+
default: 1000,
|
61
|
+
description: "Số lượng view cần tăng",
|
62
|
+
typeOptions: {
|
63
|
+
minValue: 500,
|
64
|
+
maxValue: 10000000,
|
65
|
+
},
|
66
|
+
validateType: 'number',
|
67
|
+
},
|
68
|
+
],
|
69
|
+
};
|
70
|
+
}
|
71
|
+
async execute() {
|
72
|
+
var _a;
|
73
|
+
const returnData = [];
|
74
|
+
const items = this.getInputData();
|
75
|
+
const credentials = (await this.getCredentials("umeApi"));
|
76
|
+
if (!credentials || !credentials.token) {
|
77
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "API token is missing in the UME credentials.");
|
78
|
+
}
|
79
|
+
const baseUrl = ((_a = credentials.baseUrl) !== null && _a !== void 0 ? _a : BASE_URL_FALLBACK).replace(/\/+$/, "");
|
80
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex += 1) {
|
81
|
+
const server = this.getNodeParameter("server", itemIndex);
|
82
|
+
const link = this.getNodeParameter("link", itemIndex);
|
83
|
+
const amount = this.getNodeParameter("amount", itemIndex);
|
84
|
+
// Validate min/max
|
85
|
+
if (amount < 500 || amount > 10000000) {
|
86
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "Số lượng phải từ 500 đến 10,000,000", { itemIndex });
|
87
|
+
}
|
88
|
+
const formBody = {
|
89
|
+
token: credentials.token,
|
90
|
+
link: link,
|
91
|
+
amount: amount.toString(),
|
92
|
+
};
|
93
|
+
const requestOptions = {
|
94
|
+
method: "POST",
|
95
|
+
uri: `${baseUrl}/facebook/${server}/view`,
|
96
|
+
form: formBody,
|
97
|
+
json: true,
|
98
|
+
};
|
99
|
+
let responseData;
|
100
|
+
try {
|
101
|
+
responseData = await this.helpers.request(requestOptions);
|
102
|
+
}
|
103
|
+
catch (error) {
|
104
|
+
if (error instanceof n8n_workflow_1.NodeOperationError) {
|
105
|
+
throw error;
|
106
|
+
}
|
107
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex });
|
108
|
+
}
|
109
|
+
const responseObject = typeof responseData === "object" && responseData !== null
|
110
|
+
? responseData
|
111
|
+
: { data: responseData };
|
112
|
+
returnData.push({
|
113
|
+
json: {
|
114
|
+
...responseObject,
|
115
|
+
server,
|
116
|
+
link,
|
117
|
+
amount,
|
118
|
+
},
|
119
|
+
pairedItem: {
|
120
|
+
item: itemIndex,
|
121
|
+
},
|
122
|
+
});
|
123
|
+
}
|
124
|
+
return [returnData];
|
125
|
+
}
|
126
|
+
}
|
127
|
+
exports.FacebookView = FacebookView;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from "n8n-workflow";
|
2
|
+
export declare class InstagramComment implements INodeType {
|
3
|
+
description: INodeTypeDescription;
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
5
|
+
}
|