@seranking/n8n-nodes-seranking 1.5.13 → 2.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/README.md +17 -10
- package/dist/credentials/SeRankingApi.credentials.js +2 -2
- package/dist/nodes/SeRanking/SeRanking.node.js +3 -39
- package/dist/nodes/SeRanking/projectApi/descriptions/AiResultTrackerDescription.js +11 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/ProjectManagementDescription.js +127 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/WebsiteAuditDescription.js +107 -1
- package/dist/nodes/SeRanking/projectApi/operations/AccountSystemOperations.js +2 -2
- package/dist/nodes/SeRanking/projectApi/operations/AiResultTrackerOperations.js +20 -18
- package/dist/nodes/SeRanking/projectApi/operations/AirtGroupsOperations.js +9 -9
- package/dist/nodes/SeRanking/projectApi/operations/AnalyticsTrafficOperations.js +3 -3
- package/dist/nodes/SeRanking/projectApi/operations/BacklinkCheckerOperations.js +19 -20
- package/dist/nodes/SeRanking/projectApi/operations/CompetitorsOperations.js +11 -8
- package/dist/nodes/SeRanking/projectApi/operations/GeneralDataOperations.js +7 -8
- package/dist/nodes/SeRanking/projectApi/operations/KeywordGroupsOperations.js +6 -6
- package/dist/nodes/SeRanking/projectApi/operations/MarketingPlanOperations.js +5 -5
- package/dist/nodes/SeRanking/projectApi/operations/ProjectGroupsOperations.js +6 -6
- package/dist/nodes/SeRanking/projectApi/operations/ProjectManagementOperations.js +70 -32
- package/dist/nodes/SeRanking/projectApi/operations/SearchVolumeOperations.js +5 -22
- package/dist/nodes/SeRanking/projectApi/operations/SubAccountOperations.js +8 -8
- package/dist/nodes/SeRanking/projectApi/operations/UrlTagsOperations.js +4 -4
- package/dist/nodes/SeRanking/projectApi/operations/WebsiteAuditOperations.js +57 -16
- package/dist/nodes/SeRanking/utils/apiRequest.js +6 -30
- package/package.json +3 -4
- package/dist/credentials/SeRankingProjectApi.credentials.d.ts +0 -9
- package/dist/credentials/SeRankingProjectApi.credentials.js +0 -39
|
@@ -7,18 +7,18 @@ async function AnalyticsTrafficOperations(index) {
|
|
|
7
7
|
const siteId = this.getNodeParameter('siteId', index);
|
|
8
8
|
switch (operation) {
|
|
9
9
|
case 'getGscData': {
|
|
10
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
10
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/analytics/gsc/queries', {}, { site_id: siteId }, index);
|
|
11
11
|
}
|
|
12
12
|
case 'getSeoPotential': {
|
|
13
13
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
14
|
-
const query = {};
|
|
14
|
+
const query = { site_id: siteId };
|
|
15
15
|
if (additionalFields.topN !== undefined)
|
|
16
16
|
query.top_n = additionalFields.topN;
|
|
17
17
|
if (additionalFields.leadPrice !== undefined)
|
|
18
18
|
query.lead_price = additionalFields.leadPrice;
|
|
19
19
|
if (additionalFields.conversionRate !== undefined)
|
|
20
20
|
query.conversion_rate = additionalFields.conversionRate;
|
|
21
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
21
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/analytics/seo-potential', {}, query, index);
|
|
22
22
|
}
|
|
23
23
|
default:
|
|
24
24
|
throw new Error(`Unknown Analytics Traffic operation: ${operation}`);
|
|
@@ -8,12 +8,12 @@ async function BacklinkCheckerOperations(index) {
|
|
|
8
8
|
switch (operation) {
|
|
9
9
|
case 'listBacklinks': {
|
|
10
10
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
11
|
-
const query = {};
|
|
11
|
+
const query = { site_id: siteId };
|
|
12
12
|
if (additionalFields.limit !== undefined)
|
|
13
13
|
query.limit = additionalFields.limit;
|
|
14
14
|
if (additionalFields.offset !== undefined)
|
|
15
15
|
query.offset = additionalFields.offset;
|
|
16
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
16
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/backlinks', {}, query, index);
|
|
17
17
|
}
|
|
18
18
|
case 'addBacklink': {
|
|
19
19
|
const url = this.getNodeParameter('backlinkUrl', index);
|
|
@@ -27,7 +27,7 @@ async function BacklinkCheckerOperations(index) {
|
|
|
27
27
|
body.charge_period = additionalFields.chargePeriod;
|
|
28
28
|
if (additionalFields.chargeStart)
|
|
29
29
|
body.charge_start = additionalFields.chargeStart;
|
|
30
|
-
return await apiRequest_1.apiRequest.call(this, 'POST',
|
|
30
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/backlinks', body, { site_id: siteId }, index);
|
|
31
31
|
}
|
|
32
32
|
case 'importList': {
|
|
33
33
|
const urlsStr = this.getNodeParameter('backlinkUrls', index);
|
|
@@ -46,24 +46,23 @@ async function BacklinkCheckerOperations(index) {
|
|
|
46
46
|
body.group_id = additionalFields.groupId;
|
|
47
47
|
if (additionalFields.manager)
|
|
48
48
|
body.manager = additionalFields.manager;
|
|
49
|
-
return await apiRequest_1.apiRequest.call(this, 'POST',
|
|
49
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/backlinks/import', body, { site_id: siteId }, index);
|
|
50
50
|
}
|
|
51
51
|
case 'updateImportSettings': {
|
|
52
52
|
const gscAutoimport = this.getNodeParameter('gscAutoimport', index);
|
|
53
|
-
await apiRequest_1.apiRequest.call(this, '
|
|
53
|
+
await apiRequest_1.apiRequest.call(this, 'PATCH', `/project-management/backlinks/gsc/settings?site_id=${siteId}`, { gsc_autoimport: gscAutoimport }, {}, index);
|
|
54
54
|
return { success: true, gsc_autoimport: gscAutoimport };
|
|
55
55
|
}
|
|
56
56
|
case 'startGscImport': {
|
|
57
|
-
return await apiRequest_1.apiRequest.call(this, 'POST',
|
|
57
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/backlinks/gsc/import', {}, { site_id: siteId }, index);
|
|
58
58
|
}
|
|
59
59
|
case 'getGscImportStatus': {
|
|
60
|
-
|
|
61
|
-
return await apiRequest_1.apiRequest.call(this, 'GET', `/backlinks/${siteId}/import-gsc/${token}`, {}, {}, index);
|
|
60
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/backlinks/gsc/import', {}, { site_id: siteId }, index);
|
|
62
61
|
}
|
|
63
62
|
case 'deleteBacklinks': {
|
|
64
63
|
const idsStr = this.getNodeParameter('backlinkIds', index);
|
|
65
64
|
const backlinkIds = idsStr.split(',').map((id) => parseInt(id.trim(), 10));
|
|
66
|
-
await apiRequest_1.apiRequest.call(this, 'POST',
|
|
65
|
+
await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/backlinks/delete', { backlink_ids: backlinkIds }, { site_id: siteId }, index);
|
|
67
66
|
return { success: true, deleted: true, backlink_ids: backlinkIds };
|
|
68
67
|
}
|
|
69
68
|
case 'recheckBacklinks': {
|
|
@@ -73,46 +72,46 @@ async function BacklinkCheckerOperations(index) {
|
|
|
73
72
|
const body = { backlink_ids: backlinkIds };
|
|
74
73
|
if (additionalFields.recheckType)
|
|
75
74
|
body.recheck_type = additionalFields.recheckType;
|
|
76
|
-
return await apiRequest_1.apiRequest.call(this, 'POST',
|
|
75
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/backlinks/recheck', body, { site_id: siteId }, index);
|
|
77
76
|
}
|
|
78
77
|
case 'getStats': {
|
|
79
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
78
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/backlinks/stats', {}, { site_id: siteId }, index);
|
|
80
79
|
}
|
|
81
80
|
case 'listDisavowed': {
|
|
82
81
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
83
|
-
const query = {};
|
|
82
|
+
const query = { site_id: siteId };
|
|
84
83
|
if (additionalFields.limit !== undefined)
|
|
85
84
|
query.limit = additionalFields.limit;
|
|
86
85
|
if (additionalFields.offset !== undefined)
|
|
87
86
|
query.offset = additionalFields.offset;
|
|
88
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
87
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/backlinks/disavowed', {}, query, index);
|
|
89
88
|
}
|
|
90
89
|
case 'addDisavowed': {
|
|
91
90
|
const urlsStr = this.getNodeParameter('disavowUrls', index);
|
|
92
91
|
const list = urlsStr.split(',').map((u) => u.trim()).filter((u) => u.length > 0);
|
|
93
|
-
return await apiRequest_1.apiRequest.call(this, 'POST',
|
|
92
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/backlinks/disavowed', { list }, { site_id: siteId }, index);
|
|
94
93
|
}
|
|
95
94
|
case 'deleteDisavowed': {
|
|
96
95
|
const disavowId = this.getNodeParameter('disavowId', index);
|
|
97
|
-
await apiRequest_1.apiRequest.call(this, 'DELETE',
|
|
96
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', '/project-management/backlinks/disavowed', {}, { site_id: siteId, id: disavowId }, index);
|
|
98
97
|
return { success: true, deleted: true, id: disavowId };
|
|
99
98
|
}
|
|
100
99
|
case 'listGroups': {
|
|
101
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
100
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/backlinks/groups', {}, { site_id: siteId }, index);
|
|
102
101
|
}
|
|
103
102
|
case 'createGroup': {
|
|
104
103
|
const name = this.getNodeParameter('groupName', index);
|
|
105
|
-
return await apiRequest_1.apiRequest.call(this, 'POST',
|
|
104
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/backlinks/groups', { name }, { site_id: siteId }, index);
|
|
106
105
|
}
|
|
107
106
|
case 'deleteGroup': {
|
|
108
107
|
const groupId = this.getNodeParameter('groupId', index);
|
|
109
|
-
await apiRequest_1.apiRequest.call(this, 'DELETE',
|
|
108
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', '/project-management/backlinks/groups', {}, { site_id: siteId, id: groupId }, index);
|
|
110
109
|
return { success: true, deleted: true, group_id: groupId };
|
|
111
110
|
}
|
|
112
111
|
case 'renameGroup': {
|
|
113
112
|
const groupId = this.getNodeParameter('groupId', index);
|
|
114
113
|
const name = this.getNodeParameter('newGroupName', index);
|
|
115
|
-
await apiRequest_1.apiRequest.call(this, '
|
|
114
|
+
await apiRequest_1.apiRequest.call(this, 'PATCH', `/project-management/backlinks/groups?site_id=${siteId}`, { id: groupId, name }, {}, index);
|
|
116
115
|
return { success: true, group_id: groupId };
|
|
117
116
|
}
|
|
118
117
|
case 'moveToGroup': {
|
|
@@ -126,7 +125,7 @@ async function BacklinkCheckerOperations(index) {
|
|
|
126
125
|
if (groupIdsStr) {
|
|
127
126
|
body.group_ids = groupIdsStr.split(',').map((id) => parseInt(id.trim(), 10));
|
|
128
127
|
}
|
|
129
|
-
return await apiRequest_1.apiRequest.call(this, 'POST',
|
|
128
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/backlinks/groups/move', body, { site_id: siteId }, index);
|
|
130
129
|
}
|
|
131
130
|
default:
|
|
132
131
|
throw new Error(`Unknown Backlink Checker operation: ${operation}`);
|
|
@@ -17,16 +17,16 @@ async function CompetitorsOperations(index) {
|
|
|
17
17
|
body.name = additionalFields.name;
|
|
18
18
|
if (additionalFields.subdomainMatch !== undefined)
|
|
19
19
|
body.subdomain_match = additionalFields.subdomainMatch;
|
|
20
|
-
return await apiRequest_1.apiRequest.call(this, 'POST', '/competitors', body, {}, index);
|
|
20
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/competitors', body, {}, index);
|
|
21
21
|
}
|
|
22
22
|
case 'listCompetitors': {
|
|
23
23
|
const siteId = this.getNodeParameter('siteId', index);
|
|
24
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
24
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/competitors', {}, { site_id: siteId }, index);
|
|
25
25
|
}
|
|
26
26
|
case 'getPositions': {
|
|
27
27
|
const competitorId = this.getNodeParameter('competitorId', index);
|
|
28
28
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
29
|
-
const query = {};
|
|
29
|
+
const query = { competitor_id: competitorId };
|
|
30
30
|
if (additionalFields.dateFrom)
|
|
31
31
|
query.date_from = additionalFields.dateFrom;
|
|
32
32
|
if (additionalFields.dateTo)
|
|
@@ -35,11 +35,11 @@ async function CompetitorsOperations(index) {
|
|
|
35
35
|
query.site_engine_id = additionalFields.siteEngineId;
|
|
36
36
|
if (additionalFields.withSerpFeatures !== undefined)
|
|
37
37
|
query.with_serp_features = additionalFields.withSerpFeatures;
|
|
38
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
38
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/competitors/positions', {}, query, index);
|
|
39
39
|
}
|
|
40
40
|
case 'deleteCompetitor': {
|
|
41
41
|
const competitorId = this.getNodeParameter('competitorId', index);
|
|
42
|
-
await apiRequest_1.apiRequest.call(this, 'DELETE',
|
|
42
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', '/project-management/competitors', {}, { competitor_id: competitorId }, index);
|
|
43
43
|
return { success: true, deleted: true, competitor_id: competitorId };
|
|
44
44
|
}
|
|
45
45
|
case 'getTop10': {
|
|
@@ -48,11 +48,12 @@ async function CompetitorsOperations(index) {
|
|
|
48
48
|
const siteEngineId = this.getNodeParameter('siteEngineId', index);
|
|
49
49
|
const keywordId = this.getNodeParameter('keywordId', index);
|
|
50
50
|
const query = {
|
|
51
|
+
site_id: siteId,
|
|
51
52
|
date,
|
|
52
53
|
site_engine_id: siteEngineId,
|
|
53
54
|
keyword_id: keywordId,
|
|
54
55
|
};
|
|
55
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
56
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/competitors/serp10', {}, query, index);
|
|
56
57
|
}
|
|
57
58
|
case 'getTop100': {
|
|
58
59
|
const siteId = this.getNodeParameter('siteId', index);
|
|
@@ -61,13 +62,14 @@ async function CompetitorsOperations(index) {
|
|
|
61
62
|
const keywordId = this.getNodeParameter('keywordId', index);
|
|
62
63
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
63
64
|
const query = {
|
|
65
|
+
site_id: siteId,
|
|
64
66
|
date,
|
|
65
67
|
site_engine_id: siteEngineId,
|
|
66
68
|
keyword_id: keywordId,
|
|
67
69
|
};
|
|
68
70
|
if (additionalFields.top !== undefined)
|
|
69
71
|
query.top = additionalFields.top;
|
|
70
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
72
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/competitors/serp100', {}, query, index);
|
|
71
73
|
}
|
|
72
74
|
case 'getAllCompetitors': {
|
|
73
75
|
const siteId = this.getNodeParameter('siteId', index);
|
|
@@ -75,6 +77,7 @@ async function CompetitorsOperations(index) {
|
|
|
75
77
|
const siteEngineId = this.getNodeParameter('siteEngineId', index);
|
|
76
78
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
77
79
|
const query = {
|
|
80
|
+
site_id: siteId,
|
|
78
81
|
date,
|
|
79
82
|
site_engine_id: siteEngineId,
|
|
80
83
|
};
|
|
@@ -86,7 +89,7 @@ async function CompetitorsOperations(index) {
|
|
|
86
89
|
query[`tags[${i}]`] = id;
|
|
87
90
|
});
|
|
88
91
|
}
|
|
89
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
92
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/competitors/metrics', {}, query, index);
|
|
90
93
|
}
|
|
91
94
|
default:
|
|
92
95
|
throw new Error(`Unknown Competitors operation: ${operation}`);
|
|
@@ -6,20 +6,19 @@ async function GeneralDataOperations(index) {
|
|
|
6
6
|
const operation = this.getNodeParameter('operation', index);
|
|
7
7
|
switch (operation) {
|
|
8
8
|
case 'listSearchEngines': {
|
|
9
|
-
return await apiRequest_1.apiRequest.call(this, 'GET', '/system/search-engines', {}, {}, index);
|
|
9
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/system/search-engines', {}, {}, index);
|
|
10
10
|
}
|
|
11
11
|
case 'listGoogleLangs': {
|
|
12
|
-
return await apiRequest_1.apiRequest.call(this, 'GET', '/system/google
|
|
12
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/system/google/languages', {}, {}, index);
|
|
13
13
|
}
|
|
14
14
|
case 'listVolumeRegions': {
|
|
15
|
-
|
|
15
|
+
throw new Error('listVolumeRegions: The /system/volume-regions endpoint is not available under the unified API (HTTP 404 as of 2026-05-22). ' +
|
|
16
|
+
'SE Ranking has not yet published a replacement in the unified docs. ' +
|
|
17
|
+
'For keyword volume data, use the Data API endpoint Keyword Research → Export Keyword Metrics (/v1/keywords/export) instead.');
|
|
16
18
|
}
|
|
17
19
|
case 'getKeywordVolume': {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const keywords = keywordsStr.split(',').map((k) => k.trim()).filter((k) => k.length > 0);
|
|
21
|
-
const query = { region_id: regionId, _keywordArray: keywords };
|
|
22
|
-
return await apiRequest_1.apiRequest.call(this, 'GET', '/system/volume', {}, query, index);
|
|
20
|
+
throw new Error('getKeywordVolume: The /system/volume endpoint is not available under the unified API (HTTP 404 as of 2026-05-22). ' +
|
|
21
|
+
'Use the Data API endpoint Keyword Research → Export Keyword Metrics (/v1/keywords/export) instead — it returns the same volume + CPC + difficulty data for up to 5000 keywords per request.');
|
|
23
22
|
}
|
|
24
23
|
default:
|
|
25
24
|
throw new Error(`Unknown General Data operation: ${operation}`);
|
|
@@ -7,7 +7,7 @@ async function KeywordGroupsOperations(index) {
|
|
|
7
7
|
switch (operation) {
|
|
8
8
|
case 'listGroups': {
|
|
9
9
|
const siteId = this.getNodeParameter('siteId', index);
|
|
10
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
10
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/keywords/groups', {}, { site_id: siteId }, index);
|
|
11
11
|
}
|
|
12
12
|
case 'addGroup': {
|
|
13
13
|
const siteId = this.getNodeParameter('siteId', index);
|
|
@@ -15,7 +15,7 @@ async function KeywordGroupsOperations(index) {
|
|
|
15
15
|
if (!name || name.trim() === '') {
|
|
16
16
|
throw new Error('Group name cannot be empty');
|
|
17
17
|
}
|
|
18
|
-
return await apiRequest_1.apiRequest.call(this, 'POST', '/
|
|
18
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/keywords/groups', {
|
|
19
19
|
name: name.trim(),
|
|
20
20
|
site_id: siteId,
|
|
21
21
|
}, {}, index);
|
|
@@ -24,9 +24,9 @@ async function KeywordGroupsOperations(index) {
|
|
|
24
24
|
const groupId = this.getNodeParameter('groupId', index);
|
|
25
25
|
const keywordIdsStr = this.getNodeParameter('keywordIds', index);
|
|
26
26
|
const keywordIds = keywordIdsStr.split(',').map((id) => parseInt(id.trim(), 10));
|
|
27
|
-
await apiRequest_1.apiRequest.call(this, 'POST',
|
|
27
|
+
await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/keywords/groups/move', {
|
|
28
28
|
keyword_ids: keywordIds,
|
|
29
|
-
}, {}, index);
|
|
29
|
+
}, { group_id: groupId }, index);
|
|
30
30
|
return { success: true, group_id: groupId, moved_keywords: keywordIds };
|
|
31
31
|
}
|
|
32
32
|
case 'renameGroup': {
|
|
@@ -35,14 +35,14 @@ async function KeywordGroupsOperations(index) {
|
|
|
35
35
|
if (!name || name.trim() === '') {
|
|
36
36
|
throw new Error('Group name cannot be empty');
|
|
37
37
|
}
|
|
38
|
-
await apiRequest_1.apiRequest.call(this, '
|
|
38
|
+
await apiRequest_1.apiRequest.call(this, 'PATCH', `/project-management/keywords/groups?group_id=${groupId}`, {
|
|
39
39
|
name: name.trim(),
|
|
40
40
|
}, {}, index);
|
|
41
41
|
return { success: true, group_id: groupId, name: name.trim() };
|
|
42
42
|
}
|
|
43
43
|
case 'deleteGroup': {
|
|
44
44
|
const groupId = this.getNodeParameter('groupId', index);
|
|
45
|
-
await apiRequest_1.apiRequest.call(this, 'DELETE',
|
|
45
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', '/project-management/keywords/groups', {}, { group_id: groupId }, index);
|
|
46
46
|
return { success: true, deleted: true, group_id: groupId };
|
|
47
47
|
}
|
|
48
48
|
default:
|
|
@@ -7,7 +7,7 @@ async function MarketingPlanOperations(index) {
|
|
|
7
7
|
const siteId = this.getNodeParameter('siteId', index);
|
|
8
8
|
switch (operation) {
|
|
9
9
|
case 'listPlanItems': {
|
|
10
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
10
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/marketing-plan', {}, { site_id: siteId }, index);
|
|
11
11
|
}
|
|
12
12
|
case 'addTask': {
|
|
13
13
|
const title = this.getNodeParameter('taskTitle', index);
|
|
@@ -16,13 +16,13 @@ async function MarketingPlanOperations(index) {
|
|
|
16
16
|
const body = { title, text };
|
|
17
17
|
if (additionalFields.forAll !== undefined)
|
|
18
18
|
body.for_all = additionalFields.forAll;
|
|
19
|
-
return await apiRequest_1.apiRequest.call(this, 'POST',
|
|
19
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/marketing-plan/tasks', body, { site_id: siteId }, index);
|
|
20
20
|
}
|
|
21
21
|
case 'updateTask': {
|
|
22
22
|
const taskId = this.getNodeParameter('taskId', index);
|
|
23
23
|
const title = this.getNodeParameter('taskTitle', index);
|
|
24
24
|
const text = this.getNodeParameter('taskText', index);
|
|
25
|
-
await apiRequest_1.apiRequest.call(this, '
|
|
25
|
+
await apiRequest_1.apiRequest.call(this, 'PATCH', `/project-management/marketing-plan/tasks?site_id=${siteId}`, {
|
|
26
26
|
task_id: taskId,
|
|
27
27
|
title,
|
|
28
28
|
text,
|
|
@@ -32,7 +32,7 @@ async function MarketingPlanOperations(index) {
|
|
|
32
32
|
case 'setTaskStatus': {
|
|
33
33
|
const taskId = this.getNodeParameter('taskId', index);
|
|
34
34
|
const checked = this.getNodeParameter('checked', index);
|
|
35
|
-
await apiRequest_1.apiRequest.call(this, '
|
|
35
|
+
await apiRequest_1.apiRequest.call(this, 'PATCH', `/project-management/marketing-plan/tasks?site_id=${siteId}`, {
|
|
36
36
|
task_id: taskId,
|
|
37
37
|
checked,
|
|
38
38
|
}, {}, index);
|
|
@@ -40,7 +40,7 @@ async function MarketingPlanOperations(index) {
|
|
|
40
40
|
}
|
|
41
41
|
case 'deleteTask': {
|
|
42
42
|
const taskId = this.getNodeParameter('deleteTaskId', index);
|
|
43
|
-
await apiRequest_1.apiRequest.call(this, 'DELETE',
|
|
43
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', '/project-management/marketing-plan/tasks', {}, { site_id: siteId, task_id: taskId }, index);
|
|
44
44
|
return { success: true, deleted: true, task_id: taskId };
|
|
45
45
|
}
|
|
46
46
|
default:
|
|
@@ -10,7 +10,7 @@ async function ProjectGroupsOperations(index) {
|
|
|
10
10
|
if (!name || name.trim() === '') {
|
|
11
11
|
throw new Error('Group name cannot be empty');
|
|
12
12
|
}
|
|
13
|
-
return await apiRequest_1.apiRequest.call(this, 'POST', '/
|
|
13
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/sites/groups', { name: name.trim() }, {}, index);
|
|
14
14
|
}
|
|
15
15
|
case 'renameGroup': {
|
|
16
16
|
const groupId = this.getNodeParameter('groupId', index);
|
|
@@ -18,24 +18,24 @@ async function ProjectGroupsOperations(index) {
|
|
|
18
18
|
if (!name || name.trim() === '') {
|
|
19
19
|
throw new Error('Group name cannot be empty');
|
|
20
20
|
}
|
|
21
|
-
await apiRequest_1.apiRequest.call(this, '
|
|
21
|
+
await apiRequest_1.apiRequest.call(this, 'PATCH', `/project-management/sites/groups?group_id=${groupId}`, { name: name.trim() }, {}, index);
|
|
22
22
|
return { success: true, group_id: groupId, name: name.trim() };
|
|
23
23
|
}
|
|
24
24
|
case 'deleteGroup': {
|
|
25
25
|
const groupId = this.getNodeParameter('groupId', index);
|
|
26
|
-
await apiRequest_1.apiRequest.call(this, 'DELETE',
|
|
26
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', '/project-management/sites/groups', {}, { group_id: groupId }, index);
|
|
27
27
|
return { success: true, deleted: true, group_id: groupId };
|
|
28
28
|
}
|
|
29
29
|
case 'listGroups': {
|
|
30
|
-
return await apiRequest_1.apiRequest.call(this, 'GET', '/
|
|
30
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/sites/groups', {}, {}, index);
|
|
31
31
|
}
|
|
32
32
|
case 'moveProjects': {
|
|
33
33
|
const groupId = this.getNodeParameter('groupId', index);
|
|
34
34
|
const siteIdsStr = this.getNodeParameter('siteIds', index);
|
|
35
35
|
const siteIds = siteIdsStr.split(',').map((id) => parseInt(id.trim(), 10));
|
|
36
|
-
await apiRequest_1.apiRequest.call(this, 'POST',
|
|
36
|
+
await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/sites/groups/move', {
|
|
37
37
|
site_ids: siteIds,
|
|
38
|
-
}, {}, index);
|
|
38
|
+
}, { group_id: groupId }, index);
|
|
39
39
|
return { success: true, group_id: groupId, moved_sites: siteIds };
|
|
40
40
|
}
|
|
41
41
|
default:
|
|
@@ -6,32 +6,32 @@ async function ProjectManagementOperations(index) {
|
|
|
6
6
|
const operation = this.getNodeParameter('operation', index);
|
|
7
7
|
switch (operation) {
|
|
8
8
|
case 'listProjects': {
|
|
9
|
-
return await apiRequest_1.apiRequest.call(this, 'GET', '/sites', {}, {}, index);
|
|
9
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/sites', {}, {}, index);
|
|
10
10
|
}
|
|
11
11
|
case 'addProject': {
|
|
12
12
|
const url = this.getNodeParameter('projectUrl', index);
|
|
13
13
|
const title = this.getNodeParameter('projectTitle', index);
|
|
14
14
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
15
|
-
const
|
|
15
|
+
const item = { url, title };
|
|
16
16
|
if (additionalFields.depth !== undefined)
|
|
17
|
-
|
|
17
|
+
item.depth = additionalFields.depth;
|
|
18
18
|
if (additionalFields.subdomainMatch !== undefined)
|
|
19
|
-
|
|
19
|
+
item.subdomain_match = additionalFields.subdomainMatch;
|
|
20
20
|
if (additionalFields.exactUrl !== undefined)
|
|
21
|
-
|
|
21
|
+
item.exact_url = additionalFields.exactUrl;
|
|
22
22
|
if (additionalFields.checkFreq)
|
|
23
|
-
|
|
23
|
+
item.check_freq = additionalFields.checkFreq;
|
|
24
24
|
if (additionalFields.checkDay)
|
|
25
|
-
|
|
25
|
+
item.check_day = additionalFields.checkDay;
|
|
26
26
|
if (additionalFields.siteGroupId)
|
|
27
|
-
|
|
27
|
+
item.site_group_id = additionalFields.siteGroupId;
|
|
28
28
|
if (additionalFields.autoReports !== undefined)
|
|
29
|
-
|
|
29
|
+
item.auto_reports = additionalFields.autoReports;
|
|
30
30
|
if (additionalFields.disableAudit !== undefined)
|
|
31
|
-
|
|
31
|
+
item.disable_audit = additionalFields.disableAudit;
|
|
32
32
|
if (additionalFields.isActive !== undefined)
|
|
33
|
-
|
|
34
|
-
return await apiRequest_1.apiRequest.call(this, 'POST', '/sites',
|
|
33
|
+
item.is_active = additionalFields.isActive;
|
|
34
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/sites', [item], {}, index);
|
|
35
35
|
}
|
|
36
36
|
case 'changeProject': {
|
|
37
37
|
const siteId = this.getNodeParameter('siteId', index);
|
|
@@ -55,17 +55,17 @@ async function ProjectManagementOperations(index) {
|
|
|
55
55
|
body.site_group_id = updateFields.siteGroupId;
|
|
56
56
|
if (updateFields.isActive !== undefined)
|
|
57
57
|
body.is_active = updateFields.isActive;
|
|
58
|
-
await apiRequest_1.apiRequest.call(this, '
|
|
58
|
+
await apiRequest_1.apiRequest.call(this, 'PATCH', `/project-management/sites?site_id=${siteId}`, body, {}, index);
|
|
59
59
|
return { success: true, site_id: siteId };
|
|
60
60
|
}
|
|
61
61
|
case 'deleteProject': {
|
|
62
62
|
const siteId = this.getNodeParameter('siteId', index);
|
|
63
|
-
await apiRequest_1.apiRequest.call(this, 'DELETE',
|
|
63
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', '/project-management/sites', {}, { site_id: siteId }, index);
|
|
64
64
|
return { success: true, deleted: true, site_id: siteId };
|
|
65
65
|
}
|
|
66
66
|
case 'listSearchEngines': {
|
|
67
67
|
const siteId = this.getNodeParameter('siteId', index);
|
|
68
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
68
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/sites/search-engines', {}, { site_id: siteId }, index);
|
|
69
69
|
}
|
|
70
70
|
case 'addSearchEngine': {
|
|
71
71
|
const siteId = this.getNodeParameter('siteId', index);
|
|
@@ -88,7 +88,7 @@ async function ProjectManagementOperations(index) {
|
|
|
88
88
|
body.paid_results = additionalFields.paidResults;
|
|
89
89
|
if (additionalFields.featuredSnippet !== undefined)
|
|
90
90
|
body.featured_snippet = additionalFields.featuredSnippet;
|
|
91
|
-
return await apiRequest_1.apiRequest.call(this, 'POST',
|
|
91
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/sites/search-engines', body, { site_id: siteId }, index);
|
|
92
92
|
}
|
|
93
93
|
case 'changeSearchEngine': {
|
|
94
94
|
const siteId = this.getNodeParameter('siteId', index);
|
|
@@ -111,48 +111,48 @@ async function ProjectManagementOperations(index) {
|
|
|
111
111
|
body.paid_results = updateFields.paidResults;
|
|
112
112
|
if (updateFields.featuredSnippet !== undefined)
|
|
113
113
|
body.featured_snippet = updateFields.featuredSnippet;
|
|
114
|
-
await apiRequest_1.apiRequest.call(this, '
|
|
114
|
+
await apiRequest_1.apiRequest.call(this, 'PATCH', `/project-management/sites/search-engines?site_id=${siteId}&site_engine_id=${siteEngineId}`, body, {}, index);
|
|
115
115
|
return { success: true, site_id: siteId, site_engine_id: siteEngineId };
|
|
116
116
|
}
|
|
117
117
|
case 'deleteSearchEngine': {
|
|
118
118
|
const siteId = this.getNodeParameter('siteId', index);
|
|
119
119
|
const siteEngineId = this.getNodeParameter('siteEngineId', index);
|
|
120
|
-
await apiRequest_1.apiRequest.call(this, 'DELETE',
|
|
120
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', '/project-management/sites/search-engines', {}, { site_id: siteId, site_engine_id: siteEngineId }, index);
|
|
121
121
|
return { success: true, deleted: true, site_id: siteId, site_engine_id: siteEngineId };
|
|
122
122
|
}
|
|
123
123
|
case 'listKeywords': {
|
|
124
124
|
const siteId = this.getNodeParameter('siteId', index);
|
|
125
125
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
126
|
-
const query = {};
|
|
126
|
+
const query = { site_id: siteId };
|
|
127
127
|
if (additionalFields.siteEngineId)
|
|
128
128
|
query.site_engine_id = additionalFields.siteEngineId;
|
|
129
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
129
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/keywords', {}, query, index);
|
|
130
130
|
}
|
|
131
131
|
case 'addKeywords': {
|
|
132
132
|
const siteId = this.getNodeParameter('siteId', index);
|
|
133
133
|
const keywordsJson = this.getNodeParameter('keywordsJson', index);
|
|
134
134
|
const keywords = typeof keywordsJson === 'string' ? JSON.parse(keywordsJson) : keywordsJson;
|
|
135
|
-
return await apiRequest_1.apiRequest.call(this, 'POST',
|
|
135
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/keywords', keywords, { site_id: siteId }, index);
|
|
136
136
|
}
|
|
137
137
|
case 'deleteKeywords': {
|
|
138
138
|
const siteId = this.getNodeParameter('siteId', index);
|
|
139
139
|
const keywordIdsStr = this.getNodeParameter('keywordIds', index);
|
|
140
140
|
const keywordIds = keywordIdsStr.split(',').map((id) => parseInt(id.trim(), 10));
|
|
141
|
-
const query = {};
|
|
141
|
+
const query = { site_id: siteId };
|
|
142
142
|
keywordIds.forEach((id, i) => {
|
|
143
143
|
query[`keywords_ids[${i}]`] = id;
|
|
144
144
|
});
|
|
145
|
-
await apiRequest_1.apiRequest.call(this, 'DELETE',
|
|
145
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', '/project-management/keywords', {}, query, index);
|
|
146
146
|
return { success: true, deleted: true, keyword_ids: keywordIds };
|
|
147
147
|
}
|
|
148
148
|
case 'getStats': {
|
|
149
149
|
const siteId = this.getNodeParameter('siteId', index);
|
|
150
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
150
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/sites/summary', {}, { site_id: siteId }, index);
|
|
151
151
|
}
|
|
152
152
|
case 'getPositions': {
|
|
153
153
|
const siteId = this.getNodeParameter('siteId', index);
|
|
154
154
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
155
|
-
const query = {};
|
|
155
|
+
const query = { site_id: siteId };
|
|
156
156
|
if (additionalFields.dateFrom)
|
|
157
157
|
query.date_from = additionalFields.dateFrom;
|
|
158
158
|
if (additionalFields.dateTo)
|
|
@@ -165,12 +165,12 @@ async function ProjectManagementOperations(index) {
|
|
|
165
165
|
query.with_landing_pages = additionalFields.withLandingPages;
|
|
166
166
|
if (additionalFields.withSerpFeatures !== undefined)
|
|
167
167
|
query.with_serp_features = additionalFields.withSerpFeatures;
|
|
168
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
168
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/sites/positions', {}, query, index);
|
|
169
169
|
}
|
|
170
170
|
case 'getAds': {
|
|
171
171
|
const siteId = this.getNodeParameter('siteId', index);
|
|
172
172
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
173
|
-
const query = {};
|
|
173
|
+
const query = { site_id: siteId };
|
|
174
174
|
if (additionalFields.dateFrom)
|
|
175
175
|
query.date_from = additionalFields.dateFrom;
|
|
176
176
|
if (additionalFields.dateTo)
|
|
@@ -185,15 +185,15 @@ async function ProjectManagementOperations(index) {
|
|
|
185
185
|
query[`keywords_ids[${i}]`] = parseInt(id.trim(), 10);
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
188
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/sites/ads-stats', {}, query, index);
|
|
189
189
|
}
|
|
190
190
|
case 'getHistoricalDates': {
|
|
191
191
|
const siteId = this.getNodeParameter('siteId', index);
|
|
192
192
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
193
|
-
const query = {};
|
|
193
|
+
const query = { site_id: siteId };
|
|
194
194
|
if (additionalFields.siteEngineId)
|
|
195
195
|
query.site_engine_id = additionalFields.siteEngineId;
|
|
196
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
196
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/sites/positions/checkpoints', {}, query, index);
|
|
197
197
|
}
|
|
198
198
|
case 'setManualPosition': {
|
|
199
199
|
const siteId = this.getNodeParameter('siteId', index);
|
|
@@ -201,7 +201,7 @@ async function ProjectManagementOperations(index) {
|
|
|
201
201
|
const date = this.getNodeParameter('date', index);
|
|
202
202
|
const siteEngineId = this.getNodeParameter('manualSiteEngineId', index);
|
|
203
203
|
const position = this.getNodeParameter('position', index);
|
|
204
|
-
await apiRequest_1.apiRequest.call(this, '
|
|
204
|
+
await apiRequest_1.apiRequest.call(this, 'PATCH', `/project-management/sites/positions?site_id=${siteId}`, {
|
|
205
205
|
keyword_id: keywordId,
|
|
206
206
|
date,
|
|
207
207
|
site_engine_id: siteEngineId,
|
|
@@ -220,7 +220,45 @@ async function ProjectManagementOperations(index) {
|
|
|
220
220
|
const keywordsJson = this.getNodeParameter('recheckKeywords', index);
|
|
221
221
|
body.keywords = typeof keywordsJson === 'string' ? JSON.parse(keywordsJson) : keywordsJson;
|
|
222
222
|
}
|
|
223
|
-
return await apiRequest_1.apiRequest.call(this, 'POST',
|
|
223
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/sites/positions/recheck', body, { site_id: siteId }, index);
|
|
224
|
+
}
|
|
225
|
+
case 'listCheckDates': {
|
|
226
|
+
const siteId = this.getNodeParameter('siteId', index);
|
|
227
|
+
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
228
|
+
const query = { site_id: siteId };
|
|
229
|
+
if (additionalFields.siteEngineId)
|
|
230
|
+
query.site_engine_id = additionalFields.siteEngineId;
|
|
231
|
+
if (additionalFields.dateFrom)
|
|
232
|
+
query.date_from = additionalFields.dateFrom;
|
|
233
|
+
if (additionalFields.dateTo)
|
|
234
|
+
query.date_to = additionalFields.dateTo;
|
|
235
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/sites/check-dates', {}, query, index);
|
|
236
|
+
}
|
|
237
|
+
case 'getRankingTrends': {
|
|
238
|
+
const siteId = this.getNodeParameter('siteId', index);
|
|
239
|
+
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
240
|
+
const query = { site_id: siteId };
|
|
241
|
+
if (additionalFields.siteEngineId)
|
|
242
|
+
query.site_engine_id = additionalFields.siteEngineId;
|
|
243
|
+
if (additionalFields.dateFrom)
|
|
244
|
+
query.date_from = additionalFields.dateFrom;
|
|
245
|
+
if (additionalFields.dateTo)
|
|
246
|
+
query.date_to = additionalFields.dateTo;
|
|
247
|
+
if (additionalFields.metricType)
|
|
248
|
+
query.type = additionalFields.metricType;
|
|
249
|
+
if (additionalFields.groupId)
|
|
250
|
+
query.group_id = additionalFields.groupId;
|
|
251
|
+
if (additionalFields.keywordsIds) {
|
|
252
|
+
additionalFields.keywordsIds.split(',').forEach((id, i) => {
|
|
253
|
+
query[`keywords_ids[${i}]`] = parseInt(id.trim(), 10);
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
if (additionalFields.tagsIds) {
|
|
257
|
+
additionalFields.tagsIds.split(',').forEach((id, i) => {
|
|
258
|
+
query[`tags_ids[${i}]`] = parseInt(id.trim(), 10);
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/sites/positions/history', {}, query, index);
|
|
224
262
|
}
|
|
225
263
|
default:
|
|
226
264
|
throw new Error(`Unknown Project Management operation: ${operation}`);
|