@seranking/n8n-nodes-seranking 1.5.13 → 2.0.1
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 +60 -29
- 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/BacklinkCheckerDescription.js +14 -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 +7 -7
- 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 +13 -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
|
@@ -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}`);
|
|
@@ -1,28 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SearchVolumeOperations = SearchVolumeOperations;
|
|
4
|
-
const apiRequest_1 = require("../../utils/apiRequest");
|
|
5
4
|
async function SearchVolumeOperations(index) {
|
|
6
5
|
const operation = this.getNodeParameter('operation', index);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
case 'listVolumeChecks': {
|
|
14
|
-
return await apiRequest_1.apiRequest.call(this, 'GET', '/key-volume/', {}, {}, index);
|
|
15
|
-
}
|
|
16
|
-
case 'getVolumeResults': {
|
|
17
|
-
const taskId = this.getNodeParameter('taskId', index);
|
|
18
|
-
return await apiRequest_1.apiRequest.call(this, 'GET', `/key-volume/${taskId}`, {}, {}, index);
|
|
19
|
-
}
|
|
20
|
-
case 'deleteVolumeCheck': {
|
|
21
|
-
const taskId = this.getNodeParameter('taskId', index);
|
|
22
|
-
await apiRequest_1.apiRequest.call(this, 'DELETE', `/key-volume/${taskId}`, {}, {}, index);
|
|
23
|
-
return { success: true, deleted: true, task_id: taskId };
|
|
24
|
-
}
|
|
25
|
-
default:
|
|
26
|
-
throw new Error(`Unknown Search Volume operation: ${operation}`);
|
|
27
|
-
}
|
|
6
|
+
const message = `Search Volume operation "${operation}" is unavailable under the unified SE Ranking API ` +
|
|
7
|
+
'(the legacy /key-volume async task endpoints return HTTP 404 as of 2026-05-22). ' +
|
|
8
|
+
'Use Data API → Keyword Research → Export Keyword Metrics (/v1/keywords/export) instead — ' +
|
|
9
|
+
'it returns volume, CPC, competition, difficulty, intents, and history for up to 5000 keywords per request.';
|
|
10
|
+
throw new Error(message);
|
|
28
11
|
}
|
|
@@ -12,11 +12,11 @@ async function SubAccountOperations(index) {
|
|
|
12
12
|
query.limit = additionalFields.limit;
|
|
13
13
|
if (additionalFields.offset !== undefined)
|
|
14
14
|
query.offset = additionalFields.offset;
|
|
15
|
-
return await apiRequest_1.apiRequest.call(this, 'GET', '/users', {}, query, index);
|
|
15
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/users', {}, query, index);
|
|
16
16
|
}
|
|
17
17
|
case 'getSubAccount': {
|
|
18
18
|
const id = this.getNodeParameter('subAccountId', index);
|
|
19
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
19
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/users', {}, { user_id: id }, index);
|
|
20
20
|
}
|
|
21
21
|
case 'createSubAccount': {
|
|
22
22
|
const email = this.getNodeParameter('accountEmail', index);
|
|
@@ -43,11 +43,11 @@ async function SubAccountOperations(index) {
|
|
|
43
43
|
data.push({ access: accessArr });
|
|
44
44
|
}
|
|
45
45
|
const body = [{ key: 'data', value: data }];
|
|
46
|
-
return await apiRequest_1.apiRequest.call(this, 'POST', '/users', body, {}, index);
|
|
46
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/users', body, {}, index);
|
|
47
47
|
}
|
|
48
48
|
case 'deleteSubAccount': {
|
|
49
49
|
const id = this.getNodeParameter('subAccountId', index);
|
|
50
|
-
await apiRequest_1.apiRequest.call(this, 'DELETE',
|
|
50
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', '/project-management/users', {}, { user_id: id }, index);
|
|
51
51
|
return { success: true, deleted: true, account_id: id };
|
|
52
52
|
}
|
|
53
53
|
case 'updateSubAccount': {
|
|
@@ -75,22 +75,27 @@ async function SubAccountOperations(index) {
|
|
|
75
75
|
data.push({ access: accessArr });
|
|
76
76
|
}
|
|
77
77
|
const body = [{ key: 'data', value: data }];
|
|
78
|
-
await apiRequest_1.apiRequest.call(this, 'PATCH', `/users
|
|
78
|
+
await apiRequest_1.apiRequest.call(this, 'PATCH', `/project-management/users?user_id=${id}`, body, {}, index);
|
|
79
79
|
return { success: true, account_id: id };
|
|
80
80
|
}
|
|
81
81
|
case 'listSharedSites': {
|
|
82
82
|
const id = this.getNodeParameter('subAccountId', index);
|
|
83
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
83
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/users/shared-sites', {}, { user_id: id }, index);
|
|
84
84
|
}
|
|
85
85
|
case 'listOwnedSites': {
|
|
86
86
|
const id = this.getNodeParameter('subAccountId', index);
|
|
87
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
87
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/users/owned-sites', {}, { user_id: id }, index);
|
|
88
88
|
}
|
|
89
89
|
case 'shareProjects': {
|
|
90
90
|
const id = this.getNodeParameter('subAccountId', index);
|
|
91
91
|
const siteIdsStr = this.getNodeParameter('siteIds', index);
|
|
92
92
|
const siteIds = siteIdsStr.split(',').map((s) => parseInt(s.trim(), 10));
|
|
93
|
-
|
|
93
|
+
const shared = [];
|
|
94
|
+
for (const siteId of siteIds) {
|
|
95
|
+
await apiRequest_1.apiRequest.call(this, 'POST', `/project-management/users/shared-sites?user_id=${id}`, { site_ids: siteId }, {}, index);
|
|
96
|
+
shared.push(siteId);
|
|
97
|
+
}
|
|
98
|
+
return { success: true, user_id: id, shared_sites: shared };
|
|
94
99
|
}
|
|
95
100
|
default:
|
|
96
101
|
throw new Error(`Unknown Sub-Account operation: ${operation}`);
|
|
@@ -7,7 +7,7 @@ async function UrlTagsOperations(index) {
|
|
|
7
7
|
switch (operation) {
|
|
8
8
|
case 'listTags': {
|
|
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/sites/url-tags', {}, { site_id: siteId }, index);
|
|
11
11
|
}
|
|
12
12
|
case 'addTag': {
|
|
13
13
|
const siteId = this.getNodeParameter('siteId', index);
|
|
@@ -20,7 +20,7 @@ async function UrlTagsOperations(index) {
|
|
|
20
20
|
if (additionalFields.domains) {
|
|
21
21
|
body.domains = additionalFields.domains.split(',').map((d) => d.trim());
|
|
22
22
|
}
|
|
23
|
-
return await apiRequest_1.apiRequest.call(this, 'POST',
|
|
23
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/sites/url-tags', body, { site_id: siteId }, index);
|
|
24
24
|
}
|
|
25
25
|
case 'updateAssignment': {
|
|
26
26
|
const siteId = this.getNodeParameter('siteId', index);
|
|
@@ -34,13 +34,13 @@ async function UrlTagsOperations(index) {
|
|
|
34
34
|
if (additionalFields.domains) {
|
|
35
35
|
body.domains = additionalFields.domains.split(',').map((d) => d.trim());
|
|
36
36
|
}
|
|
37
|
-
await apiRequest_1.apiRequest.call(this, '
|
|
37
|
+
await apiRequest_1.apiRequest.call(this, 'PATCH', `/project-management/sites/url-tags?site_id=${siteId}`, body, {}, index);
|
|
38
38
|
return { success: true, tag_ids: tagIds };
|
|
39
39
|
}
|
|
40
40
|
case 'deleteTag': {
|
|
41
41
|
const siteId = this.getNodeParameter('siteId', index);
|
|
42
42
|
const tagId = this.getNodeParameter('tagId', index);
|
|
43
|
-
await apiRequest_1.apiRequest.call(this, 'DELETE',
|
|
43
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', '/project-management/sites/url-tags', {}, { site_id: siteId, tag_id: tagId }, index);
|
|
44
44
|
return { success: true, deleted: true, tag_id: tagId };
|
|
45
45
|
}
|
|
46
46
|
default:
|
|
@@ -17,7 +17,7 @@ async function WebsiteAuditOperations(index) {
|
|
|
17
17
|
: additionalFields.settingsJson;
|
|
18
18
|
body.settings = settings;
|
|
19
19
|
}
|
|
20
|
-
return await apiRequest_1.apiRequest.call(this, 'POST', '/
|
|
20
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/audits', body, {}, index);
|
|
21
21
|
}
|
|
22
22
|
case 'listAudits': {
|
|
23
23
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
@@ -32,52 +32,52 @@ async function WebsiteAuditOperations(index) {
|
|
|
32
32
|
query.date_start = additionalFields.dateStart;
|
|
33
33
|
if (additionalFields.dateEnd)
|
|
34
34
|
query.date_end = additionalFields.dateEnd;
|
|
35
|
-
return await apiRequest_1.apiRequest.call(this, 'GET', '/
|
|
35
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/audits', {}, query, index);
|
|
36
36
|
}
|
|
37
37
|
case 'getStatus': {
|
|
38
38
|
const auditId = this.getNodeParameter('auditId', index);
|
|
39
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
39
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/audits/status', {}, { audit_id: auditId }, index);
|
|
40
40
|
}
|
|
41
41
|
case 'getReport': {
|
|
42
42
|
const auditId = this.getNodeParameter('auditId', index);
|
|
43
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
43
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/audits/report', {}, { audit_id: auditId }, index);
|
|
44
44
|
}
|
|
45
45
|
case 'getPages': {
|
|
46
46
|
const auditId = this.getNodeParameter('auditId', index);
|
|
47
47
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
48
|
-
const query = {};
|
|
48
|
+
const query = { audit_id: auditId };
|
|
49
49
|
if (additionalFields.limit !== undefined)
|
|
50
50
|
query.limit = additionalFields.limit;
|
|
51
51
|
if (additionalFields.offset !== undefined)
|
|
52
52
|
query.offset = additionalFields.offset;
|
|
53
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
53
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/audits/pages', {}, query, index);
|
|
54
54
|
}
|
|
55
55
|
case 'getPagesByIssue': {
|
|
56
56
|
const auditId = this.getNodeParameter('auditId', index);
|
|
57
57
|
const code = this.getNodeParameter('issueCode', index);
|
|
58
58
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
59
|
-
const query = { code };
|
|
59
|
+
const query = { audit_id: auditId, code };
|
|
60
60
|
if (additionalFields.limit !== undefined)
|
|
61
61
|
query.limit = additionalFields.limit;
|
|
62
62
|
if (additionalFields.offset !== undefined)
|
|
63
63
|
query.offset = additionalFields.offset;
|
|
64
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
64
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/audits/issue-pages', {}, query, index);
|
|
65
65
|
}
|
|
66
66
|
case 'getIssues': {
|
|
67
67
|
const auditId = this.getNodeParameter('auditId', index);
|
|
68
|
-
const query = {};
|
|
68
|
+
const query = { audit_id: auditId };
|
|
69
69
|
const urlId = this.getNodeParameter('urlId', index, 0);
|
|
70
70
|
const pageUrl = this.getNodeParameter('pageUrl', index, '');
|
|
71
71
|
if (urlId)
|
|
72
72
|
query.url_id = urlId;
|
|
73
73
|
if (pageUrl)
|
|
74
74
|
query.url = pageUrl;
|
|
75
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
75
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/audits/issues', {}, query, index);
|
|
76
76
|
}
|
|
77
77
|
case 'getLinks': {
|
|
78
78
|
const auditId = this.getNodeParameter('auditId', index);
|
|
79
79
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
80
|
-
const query = {};
|
|
80
|
+
const query = { audit_id: auditId };
|
|
81
81
|
if (additionalFields.pageType)
|
|
82
82
|
query.page_type = additionalFields.pageType;
|
|
83
83
|
if (additionalFields.limit !== undefined)
|
|
@@ -99,27 +99,68 @@ async function WebsiteAuditOperations(index) {
|
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
102
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/audits/found-links', {}, query, index);
|
|
103
103
|
}
|
|
104
104
|
case 'getHistory': {
|
|
105
105
|
const auditId = this.getNodeParameter('auditId', index);
|
|
106
106
|
const date = this.getNodeParameter('historyDate', index);
|
|
107
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
107
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/audits/history', {}, { audit_id: auditId, date }, index);
|
|
108
108
|
}
|
|
109
109
|
case 'updateTitle': {
|
|
110
110
|
const auditId = this.getNodeParameter('auditId', index);
|
|
111
111
|
const title = this.getNodeParameter('newTitle', index);
|
|
112
|
-
await apiRequest_1.apiRequest.call(this, '
|
|
112
|
+
await apiRequest_1.apiRequest.call(this, 'PATCH', `/project-management/audits?audit_id=${auditId}`, { title }, {}, index);
|
|
113
113
|
return { success: true, audit_id: auditId };
|
|
114
114
|
}
|
|
115
115
|
case 'deleteAudit': {
|
|
116
116
|
const auditId = this.getNodeParameter('auditId', index);
|
|
117
|
-
await apiRequest_1.apiRequest.call(this, '
|
|
117
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', '/project-management/audits', {}, { audit_id: auditId }, index);
|
|
118
118
|
return { success: true, deleted: true, audit_id: auditId };
|
|
119
119
|
}
|
|
120
120
|
case 'recheckAudit': {
|
|
121
121
|
const auditId = this.getNodeParameter('auditId', index);
|
|
122
|
-
return await apiRequest_1.apiRequest.call(this, 'POST',
|
|
122
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/audits/recheck', {}, { audit_id: auditId }, index);
|
|
123
|
+
}
|
|
124
|
+
case 'getAuditSettings': {
|
|
125
|
+
const auditId = this.getNodeParameter('auditId', index);
|
|
126
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/audits/settings', {}, { audit_id: auditId }, index);
|
|
127
|
+
}
|
|
128
|
+
case 'updateAuditSettings': {
|
|
129
|
+
const auditId = this.getNodeParameter('auditId', index);
|
|
130
|
+
const settingsJson = this.getNodeParameter('settingsJson', index);
|
|
131
|
+
const settings = typeof settingsJson === 'string' ? JSON.parse(settingsJson) : settingsJson;
|
|
132
|
+
await apiRequest_1.apiRequest.call(this, 'PATCH', `/project-management/audits/settings?audit_id=${auditId}`, { settings }, {}, index);
|
|
133
|
+
return { success: true, audit_id: auditId };
|
|
134
|
+
}
|
|
135
|
+
case 'resetAuditSettings': {
|
|
136
|
+
const auditId = this.getNodeParameter('auditId', index);
|
|
137
|
+
await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/audits/settings/reset', {}, { audit_id: auditId }, index);
|
|
138
|
+
return { success: true, reset: true, audit_id: auditId };
|
|
139
|
+
}
|
|
140
|
+
case 'listAuditSitemaps': {
|
|
141
|
+
const auditId = this.getNodeParameter('auditId', index);
|
|
142
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/audits/sitemaps', {}, { audit_id: auditId }, index);
|
|
143
|
+
}
|
|
144
|
+
case 'addAuditSitemap': {
|
|
145
|
+
const auditId = this.getNodeParameter('auditId', index);
|
|
146
|
+
const url = this.getNodeParameter('sitemapUrl', index);
|
|
147
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/audits/sitemaps', { url }, { audit_id: auditId }, index);
|
|
148
|
+
}
|
|
149
|
+
case 'deleteAuditSitemap': {
|
|
150
|
+
const auditId = this.getNodeParameter('auditId', index);
|
|
151
|
+
const sitemapId = this.getNodeParameter('sitemapId', index);
|
|
152
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', '/project-management/audits/sitemaps', {}, { audit_id: auditId, sitemap_id: sitemapId }, index);
|
|
153
|
+
return { success: true, deleted: true, sitemap_id: sitemapId };
|
|
154
|
+
}
|
|
155
|
+
case 'listAuditSourcePages': {
|
|
156
|
+
const auditId = this.getNodeParameter('auditId', index);
|
|
157
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/audits/source_pages', {}, { audit_id: auditId }, index);
|
|
158
|
+
}
|
|
159
|
+
case 'deleteAuditSourcePages': {
|
|
160
|
+
const auditId = this.getNodeParameter('auditId', index);
|
|
161
|
+
const listId = this.getNodeParameter('sourcePagesListId', index);
|
|
162
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', '/project-management/audits/source_pages', {}, { audit_id: auditId, list_id: listId }, index);
|
|
163
|
+
return { success: true, deleted: true, list_id: listId };
|
|
123
164
|
}
|
|
124
165
|
default:
|
|
125
166
|
throw new Error(`Unknown Website Audit operation: ${operation}`);
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.apiRequest = apiRequest;
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const BASE_URL = 'https://api.seranking.com/v1';
|
|
6
|
+
const CREDENTIAL_TYPE = 'seRankingApi';
|
|
5
7
|
let lastRequestTime = 0;
|
|
6
8
|
const MIN_REQUEST_INTERVAL = 300;
|
|
7
9
|
async function apiRequest(method, endpoint, body = {}, query = {}, itemIndex = 0) {
|
|
@@ -13,23 +15,6 @@ async function apiRequest(method, endpoint, body = {}, query = {}, itemIndex = 0
|
|
|
13
15
|
await (0, n8n_workflow_1.sleep)(waitTime);
|
|
14
16
|
}
|
|
15
17
|
lastRequestTime = Date.now();
|
|
16
|
-
const DATA_API_RESOURCES = new Set([
|
|
17
|
-
'aiSearch',
|
|
18
|
-
'backlinks',
|
|
19
|
-
'domainAnalysis',
|
|
20
|
-
'keywordResearch',
|
|
21
|
-
'serpClassic',
|
|
22
|
-
'websiteAudit',
|
|
23
|
-
]);
|
|
24
|
-
let resource;
|
|
25
|
-
try {
|
|
26
|
-
resource = this.getNodeParameter('resource', itemIndex);
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
resource = '';
|
|
30
|
-
}
|
|
31
|
-
const isDataApi = DATA_API_RESOURCES.has(resource);
|
|
32
|
-
const credentialType = isDataApi ? 'seRankingApi' : 'seRankingProjectApi';
|
|
33
18
|
const httpMethod = method.toUpperCase();
|
|
34
19
|
const options = {
|
|
35
20
|
method: httpMethod,
|
|
@@ -44,10 +29,7 @@ async function apiRequest(method, endpoint, body = {}, query = {}, itemIndex = 0
|
|
|
44
29
|
options.json = false;
|
|
45
30
|
}
|
|
46
31
|
else {
|
|
47
|
-
|
|
48
|
-
? 'https://api.seranking.com/v1'
|
|
49
|
-
: 'https://api4.seranking.com';
|
|
50
|
-
options.url = `${baseUrl}${endpoint}`;
|
|
32
|
+
options.url = `${BASE_URL}${endpoint}`;
|
|
51
33
|
options.json = true;
|
|
52
34
|
}
|
|
53
35
|
if (Object.keys(query).length > 0) {
|
|
@@ -106,20 +88,14 @@ async function apiRequest(method, endpoint, body = {}, query = {}, itemIndex = 0
|
|
|
106
88
|
}
|
|
107
89
|
}
|
|
108
90
|
try {
|
|
109
|
-
const response = await this.helpers.httpRequestWithAuthentication.call(this,
|
|
91
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, CREDENTIAL_TYPE, options);
|
|
110
92
|
return response;
|
|
111
93
|
}
|
|
112
94
|
catch (error) {
|
|
113
95
|
if (((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('does not require credentials')) || ((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('No credentials'))) {
|
|
114
|
-
|
|
115
|
-
? 'SE Ranking API credential not configured'
|
|
116
|
-
: 'SE Ranking Project API credential not configured';
|
|
117
|
-
const missingDesc = isDataApi
|
|
118
|
-
? 'This resource requires the SE Ranking API credential. Click the node, find the "SE Ranking API" credential slot, and create/select your Data API token.'
|
|
119
|
-
: 'This resource requires the SE Ranking Project API credential. Click the node, find the "SE Ranking Project API" credential slot, and create/select your Project API token.';
|
|
120
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), missingCred, {
|
|
96
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'SE Ranking API credential not configured', {
|
|
121
97
|
itemIndex,
|
|
122
|
-
description:
|
|
98
|
+
description: 'Click the node, find the "SE Ranking API" credential slot, and create/select your API token. As of 2026-05 a single unified token covers all endpoints.',
|
|
123
99
|
});
|
|
124
100
|
}
|
|
125
101
|
const errorData = ((_c = error.response) === null || _c === void 0 ? void 0 : _c.body) || ((_d = error.response) === null || _d === void 0 ? void 0 : _d.data) || {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seranking/n8n-nodes-seranking",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "n8n connector for SE Ranking API
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "n8n connector for SE Ranking API (unified host, single token). Resources: AI Search, Backlinks, Domain Analysis, Keyword Research, Website Audit, Project Management, Project Groups, AI Result Tracker, AIRT Groups, Keyword Groups, Competitors, URL Tags, Analytics Traffic, Account System, Sub-Account Management, General Data, Marketing Plan, Backlink Checker, Search Volume",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/seranking/n8n-nodes-seranking",
|
|
7
7
|
"author": {
|
|
@@ -51,8 +51,7 @@
|
|
|
51
51
|
"dist/nodes/SeRanking/SeRanking.node.js"
|
|
52
52
|
],
|
|
53
53
|
"credentials": [
|
|
54
|
-
"dist/credentials/SeRankingApi.credentials.js"
|
|
55
|
-
"dist/credentials/SeRankingProjectApi.credentials.js"
|
|
54
|
+
"dist/credentials/SeRankingApi.credentials.js"
|
|
56
55
|
]
|
|
57
56
|
},
|
|
58
57
|
"scripts": {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
export declare class SeRankingProjectApi implements ICredentialType {
|
|
3
|
-
name: string;
|
|
4
|
-
displayName: string;
|
|
5
|
-
documentationUrl: string;
|
|
6
|
-
properties: INodeProperties[];
|
|
7
|
-
authenticate: IAuthenticateGeneric;
|
|
8
|
-
test: ICredentialTestRequest;
|
|
9
|
-
}
|