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.
Files changed (58) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +204 -0
  3. package/dist/credentials/UmeApi.credentials.d.ts +7 -0
  4. package/dist/credentials/UmeApi.credentials.js +41 -0
  5. package/dist/index.d.ts +4 -0
  6. package/dist/index.js +9 -0
  7. package/dist/nodes/FacebookComment/FacebookComment.node.d.ts +5 -0
  8. package/dist/nodes/FacebookComment/FacebookComment.node.js +155 -0
  9. package/dist/nodes/FacebookCommentLike/FacebookCommentLike.node.d.ts +5 -0
  10. package/dist/nodes/FacebookCommentLike/FacebookCommentLike.node.js +122 -0
  11. package/dist/nodes/FacebookLike/FacebookLike.node.d.ts +5 -0
  12. package/dist/nodes/FacebookLike/FacebookLike.node.js +160 -0
  13. package/dist/nodes/FacebookShare/FacebookShare.node.d.ts +5 -0
  14. package/dist/nodes/FacebookShare/FacebookShare.node.js +141 -0
  15. package/dist/nodes/FacebookStoryView/FacebookStoryView.node.d.ts +5 -0
  16. package/dist/nodes/FacebookStoryView/FacebookStoryView.node.js +122 -0
  17. package/dist/nodes/FacebookView/FacebookView.node.d.ts +5 -0
  18. package/dist/nodes/FacebookView/FacebookView.node.js +127 -0
  19. package/dist/nodes/InstagramComment/InstagramComment.node.d.ts +5 -0
  20. package/dist/nodes/InstagramComment/InstagramComment.node.js +145 -0
  21. package/dist/nodes/InstagramLike/InstagramLike.node.d.ts +5 -0
  22. package/dist/nodes/InstagramLike/InstagramLike.node.js +138 -0
  23. package/dist/nodes/InstagramView/InstagramView.node.d.ts +5 -0
  24. package/dist/nodes/InstagramView/InstagramView.node.js +151 -0
  25. package/dist/nodes/TikTokComment/TikTokComment.node.d.ts +5 -0
  26. package/dist/nodes/TikTokComment/TikTokComment.node.js +136 -0
  27. package/dist/nodes/TikTokCommentLike/TikTokCommentLike.node.d.ts +5 -0
  28. package/dist/nodes/TikTokCommentLike/TikTokCommentLike.node.js +122 -0
  29. package/dist/nodes/TikTokFavorite/TikTokFavorite.node.d.ts +5 -0
  30. package/dist/nodes/TikTokFavorite/TikTokFavorite.node.js +127 -0
  31. package/dist/nodes/TikTokLike/TikTokLike.node.d.ts +5 -0
  32. package/dist/nodes/TikTokLike/TikTokLike.node.js +141 -0
  33. package/dist/nodes/TikTokShare/TikTokShare.node.d.ts +5 -0
  34. package/dist/nodes/TikTokShare/TikTokShare.node.js +131 -0
  35. package/dist/nodes/TikTokView/TikTokView.node.d.ts +5 -0
  36. package/dist/nodes/TikTokView/TikTokView.node.js +136 -0
  37. package/dist/nodes/Ume/Ume.node.d.ts +5 -0
  38. package/dist/nodes/Ume/Ume.node.js +244 -0
  39. package/dist/nodes/Ume/operations-data.json +2246 -0
  40. package/dist/nodes/UmeSocialSeeding/UmeSocialSeeding.node.d.ts +5 -0
  41. package/dist/nodes/UmeSocialSeeding/UmeSocialSeeding.node.js +203 -0
  42. package/dist/nodes/UmeSocialSeeding/UmeSocialSeedingHelpers.d.ts +4 -0
  43. package/dist/nodes/UmeSocialSeeding/UmeSocialSeedingHelpers.js +382 -0
  44. package/dist/nodes/UmeSocialSeeding/operations-data.json +673 -0
  45. package/dist/nodes/UmeSocialSeeding/reaction.png +0 -0
  46. package/dist/nodes/UmeSocialSeeding/server-info.json +431 -0
  47. package/dist/nodes/UmeSocialSeeding/services-data-backup.json +3525 -0
  48. package/dist/nodes/UmeSocialSeeding/services-data-old.json +2704 -0
  49. package/dist/nodes/UmeSocialSeeding/services-data.json +7341 -0
  50. package/dist/nodes/UmeSocialSeeding/services-data.json.backup +3525 -0
  51. package/dist/nodes/UmeSocialSeeding/services-data.json.backup.1759909364606 +1927 -0
  52. package/dist/nodes/YouTubeComment/YouTubeComment.node.d.ts +5 -0
  53. package/dist/nodes/YouTubeComment/YouTubeComment.node.js +152 -0
  54. package/dist/nodes/YouTubeLike/YouTubeLike.node.d.ts +5 -0
  55. package/dist/nodes/YouTubeLike/YouTubeLike.node.js +141 -0
  56. package/dist/nodes/YouTubeView/YouTubeView.node.d.ts +5 -0
  57. package/dist/nodes/YouTubeView/YouTubeView.node.js +142 -0
  58. package/package.json +62 -0
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TikTokCommentLike = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const BASE_URL_FALLBACK = "https://ume.com.vn/api";
6
+ class TikTokCommentLike {
7
+ constructor() {
8
+ this.description = {
9
+ displayName: "🌱 TikTok Like Bình Luận",
10
+ name: "tiktokCommentLike",
11
+ group: ["transform"],
12
+ version: 1,
13
+ subtitle: '={{$parameter["server"]}}',
14
+ description: "Tăng like cho bình luận TikTok",
15
+ defaults: {
16
+ name: "🌱 TikTok Like Bình Luận",
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 - Tốc độ nhanh (77.4₫/like)",
35
+ value: "2",
36
+ description: "User có nhiều dấu chấm có thể không nhận diện. Tối thiểu: 50, Tối đa: 10,000",
37
+ },
38
+ ],
39
+ default: "2",
40
+ description: "Chọn server để tăng like bình luận",
41
+ },
42
+ {
43
+ displayName: "Link bình luận",
44
+ name: "link",
45
+ type: "string",
46
+ required: true,
47
+ default: "",
48
+ description: "Link bình luận TikTok cần tăng like",
49
+ },
50
+ {
51
+ displayName: "Số lượng",
52
+ name: "amount",
53
+ type: "number",
54
+ required: true,
55
+ default: 100,
56
+ description: "Số lượng like cần tăng",
57
+ typeOptions: {
58
+ minValue: 50,
59
+ maxValue: 10000,
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 < 50 || amount > 10000) {
81
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), "Số lượng phải từ 50 đến 10,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}/tiktok/${server}/like_comment`,
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.TikTokCommentLike = TikTokCommentLike;
@@ -0,0 +1,5 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from "n8n-workflow";
2
+ export declare class TikTokFavorite 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.TikTokFavorite = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const BASE_URL_FALLBACK = "https://ume.com.vn/api";
6
+ class TikTokFavorite {
7
+ constructor() {
8
+ this.description = {
9
+ displayName: "🌱 TikTok Yêu Thích/Save",
10
+ name: "tiktokFavorite",
11
+ group: ["transform"],
12
+ version: 1,
13
+ subtitle: '={{$parameter["server"]}}',
14
+ description: "Tăng yêu thích/save video TikTok",
15
+ defaults: {
16
+ name: "🌱 TikTok Yêu Thích/Save",
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 1 - Tốc độ tốt (30.8₫/save)",
35
+ value: "1",
36
+ description: "Tốc độ có thể rất nhanh. Tối thiểu: 100, Tối đa: 1,000,000",
37
+ },
38
+ {
39
+ name: "Server 2 - Tốc độ trung bình (36.4₫/save)",
40
+ value: "2",
41
+ description: "Tốc độ trung bình. Tối thiểu: 100, Tối đa: 1,000,000",
42
+ },
43
+ ],
44
+ default: "1",
45
+ description: "Chọn server để tăng yêu thích",
46
+ },
47
+ {
48
+ displayName: "Link video TikTok",
49
+ name: "link",
50
+ type: "string",
51
+ required: true,
52
+ default: "",
53
+ description: "Link video TikTok cần tăng yêu thích",
54
+ },
55
+ {
56
+ displayName: "Số lượng",
57
+ name: "amount",
58
+ type: "number",
59
+ required: true,
60
+ default: 500,
61
+ description: "Số lượng yêu thích cần tăng",
62
+ typeOptions: {
63
+ minValue: 100,
64
+ maxValue: 1000000,
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 < 100 || amount > 1000000) {
86
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), "Số lượng phải từ 100 đến 1,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}/tiktok/${server}/favorite`,
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.TikTokFavorite = TikTokFavorite;
@@ -0,0 +1,5 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from "n8n-workflow";
2
+ export declare class TikTokLike 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.TikTokLike = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const BASE_URL_FALLBACK = "https://ume.com.vn/api";
6
+ class TikTokLike {
7
+ constructor() {
8
+ this.description = {
9
+ displayName: "🌱 TikTok Like",
10
+ name: "tiktokLike",
11
+ group: ["transform"],
12
+ version: 1,
13
+ subtitle: '={{$parameter["server"]}}',
14
+ description: "Tăng like video TikTok",
15
+ defaults: {
16
+ name: "🌱 TikTok 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 1 - Like việt [5k-10k/24h] (54.6₫/like)",
35
+ value: "1",
36
+ description: "Phù hợp gói nhỏ dưới 1k, tốc độ rất nhanh. Tối thiểu: 50, Tối đa: 10,000",
37
+ },
38
+ {
39
+ name: "Server 3 - Like việt [5k/24h] (57.1₫/like)",
40
+ value: "3",
41
+ description: "Nên mua 1k/1 lần. Không hủy gói. Tối thiểu: 200, Tối đa: 10,000",
42
+ },
43
+ {
44
+ name: "Server 5 - Like việt [5k/24h] (61.6₫/like)",
45
+ value: "5",
46
+ description: "Nên mua 2k/1 lần. Không hủy gói. Tối thiểu: 100, Tối đa: 15,000",
47
+ },
48
+ ],
49
+ default: "1",
50
+ description: "Chọn server để tăng like",
51
+ },
52
+ {
53
+ displayName: "Link video TikTok",
54
+ name: "link",
55
+ type: "string",
56
+ required: true,
57
+ default: "",
58
+ description: "Link video TikTok cần tăng like",
59
+ },
60
+ {
61
+ displayName: "Số lượng",
62
+ name: "amount",
63
+ type: "number",
64
+ required: true,
65
+ default: 200,
66
+ description: "Số lượng like cần tăng",
67
+ typeOptions: {
68
+ minValue: 50,
69
+ maxValue: 15000,
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 = 50;
91
+ let maxAmount = 10000;
92
+ if (server === "3") {
93
+ minAmount = 200;
94
+ }
95
+ else if (server === "5") {
96
+ minAmount = 100;
97
+ maxAmount = 15000;
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}/tiktok/${server}/like`,
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.TikTokLike = TikTokLike;
@@ -0,0 +1,5 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from "n8n-workflow";
2
+ export declare class TikTokShare implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TikTokShare = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const BASE_URL_FALLBACK = "https://ume.com.vn/api";
6
+ class TikTokShare {
7
+ constructor() {
8
+ this.description = {
9
+ displayName: "🌱 TikTok Share",
10
+ name: "tiktokShare",
11
+ group: ["transform"],
12
+ version: 1,
13
+ subtitle: '={{$parameter["server"]}}',
14
+ description: "Tăng share video TikTok",
15
+ defaults: {
16
+ name: "🌱 TikTok 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 1 - Bảo hành 30 ngày (62.6₫/share)",
35
+ value: "1",
36
+ description: "Tốc độ khá ổn. Tối thiểu: 100, Tối đa: 10,000,000",
37
+ },
38
+ {
39
+ name: "Server 2 - Ổn định, BH 30 ngày (26.3₫/share)",
40
+ value: "2",
41
+ description: "Thường lên dư. Tối thiểu: 100, Tối đa: 50,000,000",
42
+ },
43
+ ],
44
+ default: "1",
45
+ description: "Chọn server để tăng share",
46
+ },
47
+ {
48
+ displayName: "Link video TikTok",
49
+ name: "link",
50
+ type: "string",
51
+ required: true,
52
+ default: "",
53
+ description: "Link video TikTok cần tăng share",
54
+ },
55
+ {
56
+ displayName: "Số lượng",
57
+ name: "amount",
58
+ type: "number",
59
+ required: true,
60
+ default: 500,
61
+ description: "Số lượng share cần tăng",
62
+ typeOptions: {
63
+ minValue: 100,
64
+ maxValue: 50000000,
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 based on server
85
+ let maxAmount = 10000000;
86
+ if (server === "2") {
87
+ maxAmount = 50000000;
88
+ }
89
+ if (amount < 100 || amount > maxAmount) {
90
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Số lượng phải từ 100 đến ${maxAmount} cho server ${server}`, { itemIndex });
91
+ }
92
+ const formBody = {
93
+ token: credentials.token,
94
+ link: link,
95
+ amount: amount.toString(),
96
+ };
97
+ const requestOptions = {
98
+ method: "POST",
99
+ uri: `${baseUrl}/tiktok/${server}/share`,
100
+ form: formBody,
101
+ json: true,
102
+ };
103
+ let responseData;
104
+ try {
105
+ responseData = await this.helpers.request(requestOptions);
106
+ }
107
+ catch (error) {
108
+ if (error instanceof n8n_workflow_1.NodeOperationError) {
109
+ throw error;
110
+ }
111
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex });
112
+ }
113
+ const responseObject = typeof responseData === "object" && responseData !== null
114
+ ? responseData
115
+ : { data: responseData };
116
+ returnData.push({
117
+ json: {
118
+ ...responseObject,
119
+ server,
120
+ link,
121
+ amount,
122
+ },
123
+ pairedItem: {
124
+ item: itemIndex,
125
+ },
126
+ });
127
+ }
128
+ return [returnData];
129
+ }
130
+ }
131
+ exports.TikTokShare = TikTokShare;
@@ -0,0 +1,5 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from "n8n-workflow";
2
+ export declare class TikTokView implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TikTokView = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const BASE_URL_FALLBACK = "https://ume.com.vn/api";
6
+ class TikTokView {
7
+ constructor() {
8
+ this.description = {
9
+ displayName: "🌱 TikTok View",
10
+ name: "tiktokView",
11
+ group: ["transform"],
12
+ version: 1,
13
+ subtitle: '={{$parameter["server"]}}',
14
+ description: "Tăng view video TikTok",
15
+ defaults: {
16
+ name: "🌱 TikTok 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 - Ổn định (3.2₫/view)",
35
+ value: "3",
36
+ description: "Nên dùng hẹn giờ 10k/1 đơn cách 12-24h. Tối thiểu: 1,000, Tối đa: 100,000",
37
+ },
38
+ {
39
+ name: "Server 4 - Ổn định (3.2₫/view)",
40
+ value: "4",
41
+ description: "Nên dùng hẹn giờ 10k/1 đơn cách 12-24h. Tối thiểu: 1,000, Tối đa: 100,000",
42
+ },
43
+ {
44
+ name: "Server 5 - Lên mượt, tốt nhất (4.2₫/view)",
45
+ value: "5",
46
+ description: "Bảo hành 30 ngày. Tối thiểu: 1,000, Tối đa: 11,000",
47
+ },
48
+ ],
49
+ default: "3",
50
+ description: "Chọn server để tăng view",
51
+ },
52
+ {
53
+ displayName: "Link video TikTok",
54
+ name: "link",
55
+ type: "string",
56
+ required: true,
57
+ default: "",
58
+ description: "Link video TikTok cần tăng view",
59
+ },
60
+ {
61
+ displayName: "Số lượng",
62
+ name: "amount",
63
+ type: "number",
64
+ required: true,
65
+ default: 1000,
66
+ description: "Số lượng view cần tăng",
67
+ typeOptions: {
68
+ minValue: 1000,
69
+ maxValue: 100000,
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 maxAmount = 100000;
91
+ if (server === "5") {
92
+ maxAmount = 11000;
93
+ }
94
+ if (amount < 1000 || amount > maxAmount) {
95
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Số lượng phải từ 1,000 đến ${maxAmount} cho server ${server}`, { itemIndex });
96
+ }
97
+ const formBody = {
98
+ token: credentials.token,
99
+ link: link,
100
+ amount: amount.toString(),
101
+ };
102
+ const requestOptions = {
103
+ method: "POST",
104
+ uri: `${baseUrl}/tiktok/${server}/view`,
105
+ form: formBody,
106
+ json: true,
107
+ };
108
+ let responseData;
109
+ try {
110
+ responseData = await this.helpers.request(requestOptions);
111
+ }
112
+ catch (error) {
113
+ if (error instanceof n8n_workflow_1.NodeOperationError) {
114
+ throw error;
115
+ }
116
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex });
117
+ }
118
+ const responseObject = typeof responseData === "object" && responseData !== null
119
+ ? responseData
120
+ : { data: responseData };
121
+ returnData.push({
122
+ json: {
123
+ ...responseObject,
124
+ server,
125
+ link,
126
+ amount,
127
+ },
128
+ pairedItem: {
129
+ item: itemIndex,
130
+ },
131
+ });
132
+ }
133
+ return [returnData];
134
+ }
135
+ }
136
+ exports.TikTokView = TikTokView;