@seranking/n8n-nodes-seranking 1.5.12 → 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.d.ts +6 -1
- package/dist/nodes/SeRanking/SeRanking.node.js +41 -36
- package/dist/nodes/SeRanking/projectApi/descriptions/AiResultTrackerDescription.js +11 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/AirtGroupsDescription.d.ts +3 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/AirtGroupsDescription.js +231 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/ProjectManagementDescription.js +127 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/WebsiteAuditDescription.js +114 -5
- 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.d.ts +2 -0
- package/dist/nodes/SeRanking/projectApi/operations/AirtGroupsOperations.js +93 -0
- 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
|
@@ -85,6 +85,54 @@ exports.websiteAuditOperations = [
|
|
|
85
85
|
description: 'Update the title of an audit',
|
|
86
86
|
action: 'Update audit title',
|
|
87
87
|
},
|
|
88
|
+
{
|
|
89
|
+
name: 'Get Audit Settings',
|
|
90
|
+
value: 'getAuditSettings',
|
|
91
|
+
description: 'Get the full configuration of an audit',
|
|
92
|
+
action: 'Get audit settings',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'Update Audit Settings',
|
|
96
|
+
value: 'updateAuditSettings',
|
|
97
|
+
description: 'Partially update audit configuration',
|
|
98
|
+
action: 'Update audit settings',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'Reset Audit Settings',
|
|
102
|
+
value: 'resetAuditSettings',
|
|
103
|
+
description: 'Restore all audit settings to defaults',
|
|
104
|
+
action: 'Reset audit settings',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'List Audit Sitemaps',
|
|
108
|
+
value: 'listAuditSitemaps',
|
|
109
|
+
description: 'List configured sitemaps for an audit',
|
|
110
|
+
action: 'List audit sitemaps',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'Add Audit Sitemap',
|
|
114
|
+
value: 'addAuditSitemap',
|
|
115
|
+
description: 'Register a sitemap URL as a crawl source',
|
|
116
|
+
action: 'Add audit sitemap',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: 'Delete Audit Sitemap',
|
|
120
|
+
value: 'deleteAuditSitemap',
|
|
121
|
+
description: 'Remove a sitemap from crawl sources',
|
|
122
|
+
action: 'Delete audit sitemap',
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'List Audit Source Pages',
|
|
126
|
+
value: 'listAuditSourcePages',
|
|
127
|
+
description: 'List uploaded custom page lists',
|
|
128
|
+
action: 'List audit source pages',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: 'Delete Audit Source Pages',
|
|
132
|
+
value: 'deleteAuditSourcePages',
|
|
133
|
+
description: 'Remove an uploaded custom page list',
|
|
134
|
+
action: 'Delete audit source pages',
|
|
135
|
+
},
|
|
88
136
|
],
|
|
89
137
|
default: 'listAudits',
|
|
90
138
|
},
|
|
@@ -98,7 +146,7 @@ exports.websiteAuditFields = [
|
|
|
98
146
|
displayOptions: {
|
|
99
147
|
show: {
|
|
100
148
|
resource: ['websiteAuditProject'],
|
|
101
|
-
operation: ['getStatus', 'getReport', 'getPages', 'getPagesByIssue', 'getIssues', 'getLinks', 'getHistory', 'updateTitle', 'deleteAudit', 'recheckAudit'],
|
|
149
|
+
operation: ['getStatus', 'getReport', 'getPages', 'getPagesByIssue', 'getIssues', 'getLinks', 'getHistory', 'updateTitle', 'deleteAudit', 'recheckAudit', 'getAuditSettings', 'updateAuditSettings', 'resetAuditSettings', 'listAuditSitemaps', 'addAuditSitemap', 'deleteAuditSitemap', 'listAuditSourcePages', 'deleteAuditSourcePages'],
|
|
102
150
|
},
|
|
103
151
|
},
|
|
104
152
|
default: 0,
|
|
@@ -230,10 +278,14 @@ exports.websiteAuditFields = [
|
|
|
230
278
|
],
|
|
231
279
|
},
|
|
232
280
|
{
|
|
233
|
-
displayName: 'Issue Code',
|
|
281
|
+
displayName: 'Issue Code Name or ID',
|
|
234
282
|
name: 'issueCode',
|
|
235
|
-
type: '
|
|
283
|
+
type: 'options',
|
|
236
284
|
required: true,
|
|
285
|
+
typeOptions: {
|
|
286
|
+
loadOptionsMethod: 'getAuditIssueCodes',
|
|
287
|
+
loadOptionsDependsOn: ['auditId'],
|
|
288
|
+
},
|
|
237
289
|
displayOptions: {
|
|
238
290
|
show: {
|
|
239
291
|
resource: ['websiteAuditProject'],
|
|
@@ -241,8 +293,7 @@ exports.websiteAuditFields = [
|
|
|
241
293
|
},
|
|
242
294
|
},
|
|
243
295
|
default: '',
|
|
244
|
-
|
|
245
|
-
description: 'Unique issue code',
|
|
296
|
+
description: 'Issue code from the audit report. Set the Audit ID first; the dropdown will populate from the audit\'s issue codes. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
246
297
|
},
|
|
247
298
|
{
|
|
248
299
|
displayName: 'Additional Fields',
|
|
@@ -376,4 +427,62 @@ exports.websiteAuditFields = [
|
|
|
376
427
|
default: '',
|
|
377
428
|
description: 'New title for the audit report (max 300 characters)',
|
|
378
429
|
},
|
|
430
|
+
{
|
|
431
|
+
displayName: 'Settings JSON',
|
|
432
|
+
name: 'settingsJson',
|
|
433
|
+
type: 'string',
|
|
434
|
+
typeOptions: { rows: 5 },
|
|
435
|
+
required: true,
|
|
436
|
+
displayOptions: {
|
|
437
|
+
show: {
|
|
438
|
+
resource: ['websiteAuditProject'],
|
|
439
|
+
operation: ['updateAuditSettings'],
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
default: '{}',
|
|
443
|
+
description: 'JSON object of settings to update (partial update — only send changed fields). E.g. {"max_pages": 5000, "schedule_type": "week"}',
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
displayName: 'Sitemap URL',
|
|
447
|
+
name: 'sitemapUrl',
|
|
448
|
+
type: 'string',
|
|
449
|
+
required: true,
|
|
450
|
+
displayOptions: {
|
|
451
|
+
show: {
|
|
452
|
+
resource: ['websiteAuditProject'],
|
|
453
|
+
operation: ['addAuditSitemap'],
|
|
454
|
+
},
|
|
455
|
+
},
|
|
456
|
+
default: '',
|
|
457
|
+
placeholder: 'https://example.com/sitemap.xml',
|
|
458
|
+
description: 'Absolute URL of the sitemap to register as a crawl source',
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
displayName: 'Sitemap ID',
|
|
462
|
+
name: 'sitemapId',
|
|
463
|
+
type: 'number',
|
|
464
|
+
required: true,
|
|
465
|
+
displayOptions: {
|
|
466
|
+
show: {
|
|
467
|
+
resource: ['websiteAuditProject'],
|
|
468
|
+
operation: ['deleteAuditSitemap'],
|
|
469
|
+
},
|
|
470
|
+
},
|
|
471
|
+
default: 0,
|
|
472
|
+
description: 'ID of the sitemap to remove (from List Audit Sitemaps)',
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
displayName: 'Source Pages List ID',
|
|
476
|
+
name: 'sourcePagesListId',
|
|
477
|
+
type: 'string',
|
|
478
|
+
required: true,
|
|
479
|
+
displayOptions: {
|
|
480
|
+
show: {
|
|
481
|
+
resource: ['websiteAuditProject'],
|
|
482
|
+
operation: ['deleteAuditSourcePages'],
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
default: '',
|
|
486
|
+
description: 'ID of the uploaded page list to remove (from List Audit Source Pages)',
|
|
487
|
+
},
|
|
379
488
|
];
|
|
@@ -6,10 +6,10 @@ async function AccountSystemOperations(index) {
|
|
|
6
6
|
const operation = this.getNodeParameter('operation', index);
|
|
7
7
|
switch (operation) {
|
|
8
8
|
case 'getBalance': {
|
|
9
|
-
return await apiRequest_1.apiRequest.call(this, 'GET', '/account/
|
|
9
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/account/subscription', {}, {}, index);
|
|
10
10
|
}
|
|
11
11
|
case 'getProfile': {
|
|
12
|
-
return await apiRequest_1.apiRequest.call(this, 'GET', '/
|
|
12
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/users/me', {}, {}, index);
|
|
13
13
|
}
|
|
14
14
|
case 'getSubscription': {
|
|
15
15
|
return await apiRequest_1.apiRequest.call(this, 'GET', '/account/subscription', {}, {}, index);
|
|
@@ -7,7 +7,7 @@ async function AiResultTrackerOperations(index) {
|
|
|
7
7
|
const siteId = this.getNodeParameter('siteId', index);
|
|
8
8
|
switch (operation) {
|
|
9
9
|
case 'getSiteBrand': {
|
|
10
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
10
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/airt/brand', {}, { site_id: siteId }, index);
|
|
11
11
|
}
|
|
12
12
|
case 'saveSiteBrand': {
|
|
13
13
|
const brand = this.getNodeParameter('brandName', index);
|
|
@@ -17,14 +17,14 @@ async function AiResultTrackerOperations(index) {
|
|
|
17
17
|
if (brand.trim().length > 255) {
|
|
18
18
|
throw new Error('Brand name cannot exceed 255 characters');
|
|
19
19
|
}
|
|
20
|
-
return await apiRequest_1.apiRequest.call(this, 'POST',
|
|
20
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/airt/brand', { brand: brand.trim() }, { site_id: siteId }, index);
|
|
21
21
|
}
|
|
22
22
|
case 'listLlmEngines': {
|
|
23
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
23
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/airt/llm', {}, { site_id: siteId }, index);
|
|
24
24
|
}
|
|
25
25
|
case 'getLlmEngine': {
|
|
26
26
|
const llmId = this.getNodeParameter('llmId', index);
|
|
27
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
27
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/airt/llm', {}, { site_id: siteId, llm_id: llmId }, index);
|
|
28
28
|
}
|
|
29
29
|
case 'createLlmEngine': {
|
|
30
30
|
const baseName = this.getNodeParameter('baseName', index);
|
|
@@ -38,7 +38,7 @@ async function AiResultTrackerOperations(index) {
|
|
|
38
38
|
body.region_name = additionalFields.regionName;
|
|
39
39
|
if (additionalFields.langCode)
|
|
40
40
|
body.lang_code = additionalFields.langCode;
|
|
41
|
-
return await apiRequest_1.apiRequest.call(this, 'POST',
|
|
41
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/airt/llm', body, { site_id: siteId }, index);
|
|
42
42
|
}
|
|
43
43
|
case 'updateLlmEngine': {
|
|
44
44
|
const llmId = this.getNodeParameter('llmId', index);
|
|
@@ -48,38 +48,38 @@ async function AiResultTrackerOperations(index) {
|
|
|
48
48
|
body.region_name = updateFields.regionName || null;
|
|
49
49
|
if (updateFields.langCode !== undefined)
|
|
50
50
|
body.lang_code = updateFields.langCode || null;
|
|
51
|
-
return await apiRequest_1.apiRequest.call(this, 'PATCH', `/
|
|
51
|
+
return await apiRequest_1.apiRequest.call(this, 'PATCH', `/project-management/airt/llm?site_id=${siteId}&llm_id=${llmId}`, body, {}, index);
|
|
52
52
|
}
|
|
53
53
|
case 'deleteLlmEngine': {
|
|
54
54
|
const llmId = this.getNodeParameter('llmId', index);
|
|
55
|
-
await apiRequest_1.apiRequest.call(this, 'DELETE',
|
|
55
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', '/project-management/airt/llm', {}, { site_id: siteId, llm_id: llmId }, index);
|
|
56
56
|
return { success: true, deleted: true, llm_id: llmId };
|
|
57
57
|
}
|
|
58
58
|
case 'getLlmStatus': {
|
|
59
59
|
const llmId = this.getNodeParameter('llmId', index);
|
|
60
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
60
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/airt/llm/status', {}, { site_id: siteId, llm_id: llmId }, index);
|
|
61
61
|
}
|
|
62
62
|
case 'getLlmStatistics': {
|
|
63
63
|
const llmId = this.getNodeParameter('llmId', index);
|
|
64
64
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
65
|
-
const query = {};
|
|
65
|
+
const query = { site_id: siteId, llm_id: llmId };
|
|
66
66
|
if (additionalFields.from)
|
|
67
67
|
query.from = additionalFields.from;
|
|
68
68
|
if (additionalFields.to)
|
|
69
69
|
query.to = additionalFields.to;
|
|
70
70
|
if (additionalFields.top !== undefined)
|
|
71
71
|
query.top = additionalFields.top;
|
|
72
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
72
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/airt/llm/statistics', {}, query, index);
|
|
73
73
|
}
|
|
74
74
|
case 'listPrompts': {
|
|
75
75
|
const llmId = this.getNodeParameter('llmId', index);
|
|
76
76
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
77
|
-
const query = {};
|
|
77
|
+
const query = { site_id: siteId, llm_id: llmId };
|
|
78
78
|
if (additionalFields.limit !== undefined)
|
|
79
79
|
query.limit = additionalFields.limit;
|
|
80
80
|
if (additionalFields.offset !== undefined)
|
|
81
81
|
query.offset = additionalFields.offset;
|
|
82
|
-
let endpoint =
|
|
82
|
+
let endpoint = '/project-management/airt/prompts';
|
|
83
83
|
if (additionalFields.groupIds) {
|
|
84
84
|
const ids = additionalFields.groupIds.split(',').map((id) => id.trim());
|
|
85
85
|
endpoint += '?' + ids.map((id) => `group_ids[]=${encodeURIComponent(id)}`).join('&');
|
|
@@ -94,19 +94,19 @@ async function AiResultTrackerOperations(index) {
|
|
|
94
94
|
const body = { prompts };
|
|
95
95
|
if (additionalFields.groupId)
|
|
96
96
|
body.group_id = additionalFields.groupId;
|
|
97
|
-
return await apiRequest_1.apiRequest.call(this, 'POST',
|
|
97
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/airt/prompts', body, { site_id: siteId, llm_id: llmId }, index);
|
|
98
98
|
}
|
|
99
99
|
case 'deletePrompts': {
|
|
100
100
|
const llmId = this.getNodeParameter('llmId', index);
|
|
101
101
|
const idsStr = this.getNodeParameter('k2siteLlmIds', index);
|
|
102
102
|
const k2siteLlmIds = idsStr.split(',').map((id) => parseInt(id.trim(), 10));
|
|
103
|
-
await apiRequest_1.apiRequest.call(this, '
|
|
103
|
+
await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/airt/prompts/delete', { k2site_llm_ids: k2siteLlmIds }, { site_id: siteId, llm_id: llmId }, index);
|
|
104
104
|
return { success: true, deleted: true, k2site_llm_ids: k2siteLlmIds };
|
|
105
105
|
}
|
|
106
106
|
case 'getPromptRankings': {
|
|
107
107
|
const llmId = this.getNodeParameter('llmId', index);
|
|
108
108
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
109
|
-
const query = {};
|
|
109
|
+
const query = { site_id: siteId, llm_id: llmId };
|
|
110
110
|
if (additionalFields.dateFrom)
|
|
111
111
|
query.date_from = additionalFields.dateFrom;
|
|
112
112
|
if (additionalFields.dateTo)
|
|
@@ -115,7 +115,9 @@ async function AiResultTrackerOperations(index) {
|
|
|
115
115
|
query.limit = additionalFields.limit;
|
|
116
116
|
if (additionalFields.offset !== undefined)
|
|
117
117
|
query.offset = additionalFields.offset;
|
|
118
|
-
|
|
118
|
+
if (additionalFields.mode)
|
|
119
|
+
query.mode = additionalFields.mode;
|
|
120
|
+
let endpoint = '/project-management/airt/prompts/rankings';
|
|
119
121
|
if (additionalFields.groupIds) {
|
|
120
122
|
const ids = additionalFields.groupIds.split(',').map((id) => id.trim());
|
|
121
123
|
endpoint += '?' + ids.map((id) => `group_ids[]=${encodeURIComponent(id)}`).join('&');
|
|
@@ -126,10 +128,10 @@ async function AiResultTrackerOperations(index) {
|
|
|
126
128
|
const llmId = this.getNodeParameter('llmId', index);
|
|
127
129
|
const k2siteLlmId = this.getNodeParameter('k2siteLlmId', index);
|
|
128
130
|
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
129
|
-
const query = {};
|
|
131
|
+
const query = { site_id: siteId, llm_id: llmId, k2site_llm_id: k2siteLlmId };
|
|
130
132
|
if (additionalFields.date)
|
|
131
133
|
query.date = additionalFields.date;
|
|
132
|
-
return await apiRequest_1.apiRequest.call(this, 'GET',
|
|
134
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/airt/prompts/answer', {}, query, index);
|
|
133
135
|
}
|
|
134
136
|
default:
|
|
135
137
|
throw new Error(`Unknown AI Result Tracker operation: ${operation}`);
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AirtGroupsOperations = AirtGroupsOperations;
|
|
4
|
+
const apiRequest_1 = require("../../utils/apiRequest");
|
|
5
|
+
async function AirtGroupsOperations(index) {
|
|
6
|
+
const operation = this.getNodeParameter('operation', index);
|
|
7
|
+
const siteId = this.getNodeParameter('siteId', index);
|
|
8
|
+
switch (operation) {
|
|
9
|
+
case 'listPromptGroups': {
|
|
10
|
+
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
11
|
+
const query = { site_id: siteId };
|
|
12
|
+
if (additionalFields.keysCount === true) {
|
|
13
|
+
query.keys_count = 1;
|
|
14
|
+
}
|
|
15
|
+
if (additionalFields.siteLlmIds) {
|
|
16
|
+
const ids = additionalFields.siteLlmIds
|
|
17
|
+
.split(',')
|
|
18
|
+
.map((s) => parseInt(s.trim(), 10))
|
|
19
|
+
.filter((n) => !Number.isNaN(n));
|
|
20
|
+
if (ids.length > 0) {
|
|
21
|
+
query['site_llm_ids[]'] = ids;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/project-management/airt/prompts/groups', {}, query, index);
|
|
25
|
+
}
|
|
26
|
+
case 'createPromptGroup': {
|
|
27
|
+
const name = this.getNodeParameter('groupName', index);
|
|
28
|
+
if (!name || name.trim() === '') {
|
|
29
|
+
throw new Error('Group name cannot be empty');
|
|
30
|
+
}
|
|
31
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/airt/prompts/groups', { name: name.trim() }, { site_id: siteId }, index);
|
|
32
|
+
}
|
|
33
|
+
case 'renamePromptGroup': {
|
|
34
|
+
const groupId = this.getNodeParameter('groupId', index);
|
|
35
|
+
const name = this.getNodeParameter('groupName', index);
|
|
36
|
+
if (!name || name.trim() === '') {
|
|
37
|
+
throw new Error('Group name cannot be empty');
|
|
38
|
+
}
|
|
39
|
+
return await apiRequest_1.apiRequest.call(this, 'PATCH', `/project-management/airt/prompts/groups?site_id=${siteId}&group_id=${groupId}`, { name: name.trim() }, {}, index);
|
|
40
|
+
}
|
|
41
|
+
case 'deletePromptGroup': {
|
|
42
|
+
const groupId = this.getNodeParameter('groupId', index);
|
|
43
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', '/project-management/airt/prompts/groups', {}, { site_id: siteId, group_id: groupId }, index);
|
|
44
|
+
return { success: true, deleted: true, group_id: groupId };
|
|
45
|
+
}
|
|
46
|
+
case 'changeGroupOrder': {
|
|
47
|
+
const groupId = this.getNodeParameter('groupId', index);
|
|
48
|
+
const beforeId = this.getNodeParameter('beforeId', index, 0);
|
|
49
|
+
const afterId = this.getNodeParameter('afterId', index, 0);
|
|
50
|
+
const hasBefore = beforeId > 0;
|
|
51
|
+
const hasAfter = afterId > 0;
|
|
52
|
+
if (hasBefore === hasAfter) {
|
|
53
|
+
throw new Error('Provide exactly one of "Place Before Group ID" or "Place After Group ID" (not both, not neither)');
|
|
54
|
+
}
|
|
55
|
+
const body = {};
|
|
56
|
+
if (hasBefore)
|
|
57
|
+
body.before_id = beforeId;
|
|
58
|
+
if (hasAfter)
|
|
59
|
+
body.after_id = afterId;
|
|
60
|
+
await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/airt/prompts/groups/order', body, { site_id: siteId, group_id: groupId }, index);
|
|
61
|
+
return { success: true, group_id: groupId, ...body };
|
|
62
|
+
}
|
|
63
|
+
case 'deleteAllPromptsInGroup': {
|
|
64
|
+
const groupId = this.getNodeParameter('groupId', index);
|
|
65
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', '/project-management/airt/prompts/groups/prompts', {}, { site_id: siteId, group_id: groupId }, index);
|
|
66
|
+
return { success: true, emptied: true, group_id: groupId };
|
|
67
|
+
}
|
|
68
|
+
case 'movePromptsToGroup': {
|
|
69
|
+
const groupId = this.getNodeParameter('groupId', index);
|
|
70
|
+
const idsStr = this.getNodeParameter('k2siteLlmIds', index);
|
|
71
|
+
const ids = idsStr
|
|
72
|
+
.split(',')
|
|
73
|
+
.map((s) => parseInt(s.trim(), 10))
|
|
74
|
+
.filter((n) => !Number.isNaN(n));
|
|
75
|
+
if (ids.length === 0) {
|
|
76
|
+
throw new Error('Provide at least one k2site_llm_id');
|
|
77
|
+
}
|
|
78
|
+
await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/airt/prompts/groups/move', { k2site_llm_ids: ids }, { site_id: siteId, group_id: groupId }, index);
|
|
79
|
+
return { success: true, group_id: groupId, moved: ids };
|
|
80
|
+
}
|
|
81
|
+
case 'moveAllPromptsBetweenGroups': {
|
|
82
|
+
const fromGroupId = this.getNodeParameter('fromGroupId', index);
|
|
83
|
+
const toGroupId = this.getNodeParameter('toGroupId', index);
|
|
84
|
+
if (fromGroupId === toGroupId) {
|
|
85
|
+
throw new Error('Source and Target Group ID must differ');
|
|
86
|
+
}
|
|
87
|
+
await apiRequest_1.apiRequest.call(this, 'POST', '/project-management/airt/prompts/groups/transfer', { from_group_id: fromGroupId, to_group_id: toGroupId }, { site_id: siteId }, index);
|
|
88
|
+
return { success: true, from_group_id: fromGroupId, to_group_id: toGroupId };
|
|
89
|
+
}
|
|
90
|
+
default:
|
|
91
|
+
throw new Error(`Unknown AIRT Groups operation: ${operation}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -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}`);
|