@seranking/n8n-nodes-seranking 1.4.0 → 1.5.7
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 +198 -5
- package/dist/nodes/SeRanking/SeRanking.node.js +200 -1
- package/dist/nodes/SeRanking/projectApi/descriptions/AccountSystemDescription.d.ts +3 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/AccountSystemDescription.js +38 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/AiResultTrackerDescription.d.ts +3 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/AiResultTrackerDescription.js +389 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/AnalyticsTrafficDescription.d.ts +3 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/AnalyticsTrafficDescription.js +84 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/BacklinkCheckerDescription.d.ts +3 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/BacklinkCheckerDescription.js +541 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/CompetitorsDescription.d.ts +3 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/CompetitorsDescription.js +283 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/GeneralDataDescription.d.ts +3 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/GeneralDataDescription.js +74 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/KeywordGroupsDescription.d.ts +3 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/KeywordGroupsDescription.js +124 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/MarketingPlanDescription.d.ts +3 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/MarketingPlanDescription.js +186 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/ProjectGroupsDescription.d.ts +3 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/ProjectGroupsDescription.js +110 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/ProjectManagementDescription.d.ts +3 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/ProjectManagementDescription.js +810 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/SearchVolumeDescription.d.ts +3 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/SearchVolumeDescription.js +74 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/SubAccountDescription.d.ts +3 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/SubAccountDescription.js +329 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/UrlTagsDescription.d.ts +3 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/UrlTagsDescription.js +164 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/WebsiteAuditDescription.d.ts +3 -0
- package/dist/nodes/SeRanking/projectApi/descriptions/WebsiteAuditDescription.js +379 -0
- package/dist/nodes/SeRanking/projectApi/operations/AccountSystemOperations.d.ts +2 -0
- package/dist/nodes/SeRanking/projectApi/operations/AccountSystemOperations.js +20 -0
- package/dist/nodes/SeRanking/projectApi/operations/AiResultTrackerOperations.d.ts +2 -0
- package/dist/nodes/SeRanking/projectApi/operations/AiResultTrackerOperations.js +114 -0
- package/dist/nodes/SeRanking/projectApi/operations/AnalyticsTrafficOperations.d.ts +2 -0
- package/dist/nodes/SeRanking/projectApi/operations/AnalyticsTrafficOperations.js +26 -0
- package/dist/nodes/SeRanking/projectApi/operations/BacklinkCheckerOperations.d.ts +2 -0
- package/dist/nodes/SeRanking/projectApi/operations/BacklinkCheckerOperations.js +134 -0
- package/dist/nodes/SeRanking/projectApi/operations/CompetitorsOperations.d.ts +2 -0
- package/dist/nodes/SeRanking/projectApi/operations/CompetitorsOperations.js +94 -0
- package/dist/nodes/SeRanking/projectApi/operations/GeneralDataOperations.d.ts +2 -0
- package/dist/nodes/SeRanking/projectApi/operations/GeneralDataOperations.js +27 -0
- package/dist/nodes/SeRanking/projectApi/operations/KeywordGroupsOperations.d.ts +2 -0
- package/dist/nodes/SeRanking/projectApi/operations/KeywordGroupsOperations.js +51 -0
- package/dist/nodes/SeRanking/projectApi/operations/MarketingPlanOperations.d.ts +2 -0
- package/dist/nodes/SeRanking/projectApi/operations/MarketingPlanOperations.js +49 -0
- package/dist/nodes/SeRanking/projectApi/operations/ProjectGroupsOperations.d.ts +2 -0
- package/dist/nodes/SeRanking/projectApi/operations/ProjectGroupsOperations.js +44 -0
- package/dist/nodes/SeRanking/projectApi/operations/ProjectManagementOperations.d.ts +2 -0
- package/dist/nodes/SeRanking/projectApi/operations/ProjectManagementOperations.js +228 -0
- package/dist/nodes/SeRanking/projectApi/operations/SearchVolumeOperations.d.ts +2 -0
- package/dist/nodes/SeRanking/projectApi/operations/SearchVolumeOperations.js +28 -0
- package/dist/nodes/SeRanking/projectApi/operations/SubAccountOperations.d.ts +2 -0
- package/dist/nodes/SeRanking/projectApi/operations/SubAccountOperations.js +98 -0
- package/dist/nodes/SeRanking/projectApi/operations/UrlTagsOperations.d.ts +2 -0
- package/dist/nodes/SeRanking/projectApi/operations/UrlTagsOperations.js +49 -0
- package/dist/nodes/SeRanking/projectApi/operations/WebsiteAuditOperations.d.ts +2 -0
- package/dist/nodes/SeRanking/projectApi/operations/WebsiteAuditOperations.js +127 -0
- package/dist/nodes/SeRanking/utils/apiRequest.js +14 -2
- package/package.json +18 -3
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.websiteAuditFields = exports.websiteAuditOperations = void 0;
|
|
4
|
+
exports.websiteAuditOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: {
|
|
12
|
+
resource: ['websiteAuditProject'],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
options: [
|
|
16
|
+
{
|
|
17
|
+
name: 'Create Audit',
|
|
18
|
+
value: 'createAudit',
|
|
19
|
+
description: 'Launch a website audit',
|
|
20
|
+
action: 'Create audit',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'Delete Audit',
|
|
24
|
+
value: 'deleteAudit',
|
|
25
|
+
description: 'Delete an audit',
|
|
26
|
+
action: 'Delete audit',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'Get All Issues for URL',
|
|
30
|
+
value: 'getIssues',
|
|
31
|
+
description: 'Get all issues found for a specific URL',
|
|
32
|
+
action: 'Get all issues for URL',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'Get All Links',
|
|
36
|
+
value: 'getLinks',
|
|
37
|
+
description: 'Get all links found during the audit',
|
|
38
|
+
action: 'Get all links',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Get Audit History',
|
|
42
|
+
value: 'getHistory',
|
|
43
|
+
description: 'Get historical audit data for a specific date',
|
|
44
|
+
action: 'Get audit history',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'Get Audit Pages by Issue',
|
|
48
|
+
value: 'getPagesByIssue',
|
|
49
|
+
description: 'Get pages affected by a specific issue',
|
|
50
|
+
action: 'Get audit pages by issue',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'Get Audit Report',
|
|
54
|
+
value: 'getReport',
|
|
55
|
+
description: 'Get the full audit report',
|
|
56
|
+
action: 'Get audit report',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'Get Audit Status',
|
|
60
|
+
value: 'getStatus',
|
|
61
|
+
description: 'Get the current status of an audit',
|
|
62
|
+
action: 'Get audit status',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'Get Crawled Pages',
|
|
66
|
+
value: 'getPages',
|
|
67
|
+
description: 'Get all crawled pages from an audit',
|
|
68
|
+
action: 'Get crawled pages',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'List Audits',
|
|
72
|
+
value: 'listAudits',
|
|
73
|
+
description: 'Get a list of all audits',
|
|
74
|
+
action: 'List audits',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'Recheck Audit',
|
|
78
|
+
value: 'recheckAudit',
|
|
79
|
+
description: 'Recheck an existing audit',
|
|
80
|
+
action: 'Recheck audit',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'Update Audit Title',
|
|
84
|
+
value: 'updateTitle',
|
|
85
|
+
description: 'Update the title of an audit',
|
|
86
|
+
action: 'Update audit title',
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
default: 'listAudits',
|
|
90
|
+
},
|
|
91
|
+
];
|
|
92
|
+
exports.websiteAuditFields = [
|
|
93
|
+
{
|
|
94
|
+
displayName: 'Audit ID',
|
|
95
|
+
name: 'auditId',
|
|
96
|
+
type: 'number',
|
|
97
|
+
required: true,
|
|
98
|
+
displayOptions: {
|
|
99
|
+
show: {
|
|
100
|
+
resource: ['websiteAuditProject'],
|
|
101
|
+
operation: ['getStatus', 'getReport', 'getPages', 'getPagesByIssue', 'getIssues', 'getLinks', 'getHistory', 'updateTitle', 'deleteAudit', 'recheckAudit'],
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
default: 0,
|
|
105
|
+
description: 'Unique audit ID',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
displayName: 'Domain',
|
|
109
|
+
name: 'domain',
|
|
110
|
+
type: 'string',
|
|
111
|
+
required: true,
|
|
112
|
+
displayOptions: {
|
|
113
|
+
show: {
|
|
114
|
+
resource: ['websiteAuditProject'],
|
|
115
|
+
operation: ['createAudit'],
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
default: '',
|
|
119
|
+
placeholder: 'example.com',
|
|
120
|
+
description: 'Domain to be audited',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
displayName: 'Additional Fields',
|
|
124
|
+
name: 'additionalFields',
|
|
125
|
+
type: 'collection',
|
|
126
|
+
placeholder: 'Add Field',
|
|
127
|
+
default: {},
|
|
128
|
+
displayOptions: {
|
|
129
|
+
show: {
|
|
130
|
+
resource: ['websiteAuditProject'],
|
|
131
|
+
operation: ['createAudit'],
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
options: [
|
|
135
|
+
{
|
|
136
|
+
displayName: 'Title',
|
|
137
|
+
name: 'title',
|
|
138
|
+
type: 'string',
|
|
139
|
+
default: '',
|
|
140
|
+
description: 'Custom title of the audit report (max 300 characters)',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
displayName: 'Settings (JSON)',
|
|
144
|
+
name: 'settingsJson',
|
|
145
|
+
type: 'json',
|
|
146
|
+
default: '{}',
|
|
147
|
+
description: 'Audit settings as JSON object (source_site, source_sitemap, check_robots, max_pages, csr, etc.)',
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
displayName: 'Additional Fields',
|
|
153
|
+
name: 'additionalFields',
|
|
154
|
+
type: 'collection',
|
|
155
|
+
placeholder: 'Add Field',
|
|
156
|
+
default: {},
|
|
157
|
+
displayOptions: {
|
|
158
|
+
show: {
|
|
159
|
+
resource: ['websiteAuditProject'],
|
|
160
|
+
operation: ['listAudits'],
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
options: [
|
|
164
|
+
{
|
|
165
|
+
displayName: 'Limit',
|
|
166
|
+
name: 'limit',
|
|
167
|
+
type: 'number',
|
|
168
|
+
default: 100,
|
|
169
|
+
description: 'Number of audits to return',
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
displayName: 'Offset',
|
|
173
|
+
name: 'offset',
|
|
174
|
+
type: 'number',
|
|
175
|
+
default: 0,
|
|
176
|
+
description: 'Number of audits to skip',
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
displayName: 'Search',
|
|
180
|
+
name: 'search',
|
|
181
|
+
type: 'string',
|
|
182
|
+
default: '',
|
|
183
|
+
description: 'Filter audits by matching title or URL',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
displayName: 'Date Start',
|
|
187
|
+
name: 'dateStart',
|
|
188
|
+
type: 'string',
|
|
189
|
+
default: '',
|
|
190
|
+
placeholder: 'YYYY-MM-DD',
|
|
191
|
+
description: 'Start date for filtering audits',
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
displayName: 'Date End',
|
|
195
|
+
name: 'dateEnd',
|
|
196
|
+
type: 'string',
|
|
197
|
+
default: '',
|
|
198
|
+
placeholder: 'YYYY-MM-DD',
|
|
199
|
+
description: 'End date for filtering audits',
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
displayName: 'Additional Fields',
|
|
205
|
+
name: 'additionalFields',
|
|
206
|
+
type: 'collection',
|
|
207
|
+
placeholder: 'Add Field',
|
|
208
|
+
default: {},
|
|
209
|
+
displayOptions: {
|
|
210
|
+
show: {
|
|
211
|
+
resource: ['websiteAuditProject'],
|
|
212
|
+
operation: ['getPages'],
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
options: [
|
|
216
|
+
{
|
|
217
|
+
displayName: 'Limit',
|
|
218
|
+
name: 'limit',
|
|
219
|
+
type: 'number',
|
|
220
|
+
default: 100,
|
|
221
|
+
description: 'Number of pages to return',
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
displayName: 'Offset',
|
|
225
|
+
name: 'offset',
|
|
226
|
+
type: 'number',
|
|
227
|
+
default: 0,
|
|
228
|
+
description: 'Number of pages to skip',
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
displayName: 'Issue Code',
|
|
234
|
+
name: 'issueCode',
|
|
235
|
+
type: 'string',
|
|
236
|
+
required: true,
|
|
237
|
+
displayOptions: {
|
|
238
|
+
show: {
|
|
239
|
+
resource: ['websiteAuditProject'],
|
|
240
|
+
operation: ['getPagesByIssue'],
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
default: '',
|
|
244
|
+
placeholder: 'title_duplicate',
|
|
245
|
+
description: 'Unique issue code',
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
displayName: 'Additional Fields',
|
|
249
|
+
name: 'additionalFields',
|
|
250
|
+
type: 'collection',
|
|
251
|
+
placeholder: 'Add Field',
|
|
252
|
+
default: {},
|
|
253
|
+
displayOptions: {
|
|
254
|
+
show: {
|
|
255
|
+
resource: ['websiteAuditProject'],
|
|
256
|
+
operation: ['getPagesByIssue'],
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
options: [
|
|
260
|
+
{
|
|
261
|
+
displayName: 'Limit',
|
|
262
|
+
name: 'limit',
|
|
263
|
+
type: 'number',
|
|
264
|
+
default: 100,
|
|
265
|
+
description: 'Number of URLs to return',
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
displayName: 'Offset',
|
|
269
|
+
name: 'offset',
|
|
270
|
+
type: 'number',
|
|
271
|
+
default: 0,
|
|
272
|
+
description: 'Number of URLs to skip',
|
|
273
|
+
},
|
|
274
|
+
],
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
displayName: 'URL ID',
|
|
278
|
+
name: 'urlId',
|
|
279
|
+
type: 'number',
|
|
280
|
+
displayOptions: {
|
|
281
|
+
show: {
|
|
282
|
+
resource: ['websiteAuditProject'],
|
|
283
|
+
operation: ['getIssues'],
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
default: 0,
|
|
287
|
+
description: 'Unique page ID. Either URL ID or URL must be provided.',
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
displayName: 'URL',
|
|
291
|
+
name: 'pageUrl',
|
|
292
|
+
type: 'string',
|
|
293
|
+
displayOptions: {
|
|
294
|
+
show: {
|
|
295
|
+
resource: ['websiteAuditProject'],
|
|
296
|
+
operation: ['getIssues'],
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
default: '',
|
|
300
|
+
description: 'Full page URL. Either URL ID or URL must be provided.',
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
displayName: 'Additional Fields',
|
|
304
|
+
name: 'additionalFields',
|
|
305
|
+
type: 'collection',
|
|
306
|
+
placeholder: 'Add Field',
|
|
307
|
+
default: {},
|
|
308
|
+
displayOptions: {
|
|
309
|
+
show: {
|
|
310
|
+
resource: ['websiteAuditProject'],
|
|
311
|
+
operation: ['getLinks'],
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
options: [
|
|
315
|
+
{
|
|
316
|
+
displayName: 'Page Type',
|
|
317
|
+
name: 'pageType',
|
|
318
|
+
type: 'options',
|
|
319
|
+
options: [
|
|
320
|
+
{ name: 'All', value: 'all' },
|
|
321
|
+
{ name: 'Internal', value: 'internal' },
|
|
322
|
+
{ name: 'External', value: 'external' },
|
|
323
|
+
],
|
|
324
|
+
default: 'all',
|
|
325
|
+
description: 'Filter links by type',
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
displayName: 'Limit',
|
|
329
|
+
name: 'limit',
|
|
330
|
+
type: 'number',
|
|
331
|
+
default: 100,
|
|
332
|
+
description: 'Number of links to return',
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
displayName: 'Offset',
|
|
336
|
+
name: 'offset',
|
|
337
|
+
type: 'number',
|
|
338
|
+
default: 0,
|
|
339
|
+
description: 'Number of links to skip',
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
displayName: 'Filter (JSON)',
|
|
343
|
+
name: 'filterJson',
|
|
344
|
+
type: 'json',
|
|
345
|
+
default: '[]',
|
|
346
|
+
description: 'Array of filter objects, e.g. [{"param":"status","value":"broken"}]',
|
|
347
|
+
},
|
|
348
|
+
],
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
displayName: 'Date',
|
|
352
|
+
name: 'historyDate',
|
|
353
|
+
type: 'string',
|
|
354
|
+
required: true,
|
|
355
|
+
displayOptions: {
|
|
356
|
+
show: {
|
|
357
|
+
resource: ['websiteAuditProject'],
|
|
358
|
+
operation: ['getHistory'],
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
default: '',
|
|
362
|
+
placeholder: 'YYYY-MM-DD',
|
|
363
|
+
description: 'The specific date of the historical audit to retrieve',
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
displayName: 'New Title',
|
|
367
|
+
name: 'newTitle',
|
|
368
|
+
type: 'string',
|
|
369
|
+
required: true,
|
|
370
|
+
displayOptions: {
|
|
371
|
+
show: {
|
|
372
|
+
resource: ['websiteAuditProject'],
|
|
373
|
+
operation: ['updateTitle'],
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
default: '',
|
|
377
|
+
description: 'New title for the audit report (max 300 characters)',
|
|
378
|
+
},
|
|
379
|
+
];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccountSystemOperations = AccountSystemOperations;
|
|
4
|
+
const apiRequest_1 = require("../../utils/apiRequest");
|
|
5
|
+
async function AccountSystemOperations(index) {
|
|
6
|
+
const operation = this.getNodeParameter('operation', index);
|
|
7
|
+
switch (operation) {
|
|
8
|
+
case 'getBalance': {
|
|
9
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/account/balance', {}, {}, index);
|
|
10
|
+
}
|
|
11
|
+
case 'getProfile': {
|
|
12
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/account/profile', {}, {}, index);
|
|
13
|
+
}
|
|
14
|
+
case 'getSubscription': {
|
|
15
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', '/account/subscription', {}, {}, index);
|
|
16
|
+
}
|
|
17
|
+
default:
|
|
18
|
+
throw new Error(`Unknown Account System operation: ${operation}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AiResultTrackerOperations = AiResultTrackerOperations;
|
|
4
|
+
const apiRequest_1 = require("../../utils/apiRequest");
|
|
5
|
+
async function AiResultTrackerOperations(index) {
|
|
6
|
+
const operation = this.getNodeParameter('operation', index);
|
|
7
|
+
const siteId = this.getNodeParameter('siteId', index);
|
|
8
|
+
switch (operation) {
|
|
9
|
+
case 'getSiteBrand': {
|
|
10
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', `/sites/${siteId}/airt/brands`, {}, {}, index);
|
|
11
|
+
}
|
|
12
|
+
case 'saveSiteBrand': {
|
|
13
|
+
const brand = this.getNodeParameter('brandName', index);
|
|
14
|
+
if (!brand || brand.trim() === '') {
|
|
15
|
+
throw new Error('Brand name cannot be empty');
|
|
16
|
+
}
|
|
17
|
+
if (brand.trim().length > 255) {
|
|
18
|
+
throw new Error('Brand name cannot exceed 255 characters');
|
|
19
|
+
}
|
|
20
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', `/sites/${siteId}/airt/brands`, { brand: brand.trim() }, {}, index);
|
|
21
|
+
}
|
|
22
|
+
case 'listLlmEngines': {
|
|
23
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', `/sites/${siteId}/airt/llm`, {}, {}, index);
|
|
24
|
+
}
|
|
25
|
+
case 'getLlmEngine': {
|
|
26
|
+
const llmId = this.getNodeParameter('llmId', index);
|
|
27
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', `/sites/${siteId}/airt/llm/${llmId}`, {}, {}, index);
|
|
28
|
+
}
|
|
29
|
+
case 'createLlmEngine': {
|
|
30
|
+
const baseName = this.getNodeParameter('baseName', index);
|
|
31
|
+
const countryCode = this.getNodeParameter('countryCode', index);
|
|
32
|
+
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
33
|
+
const body = {
|
|
34
|
+
base_name: baseName,
|
|
35
|
+
country_code: countryCode,
|
|
36
|
+
};
|
|
37
|
+
if (additionalFields.regionName)
|
|
38
|
+
body.region_name = additionalFields.regionName;
|
|
39
|
+
if (additionalFields.langCode)
|
|
40
|
+
body.lang_code = additionalFields.langCode;
|
|
41
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', `/sites/${siteId}/airt/llm`, body, {}, index);
|
|
42
|
+
}
|
|
43
|
+
case 'updateLlmEngine': {
|
|
44
|
+
const llmId = this.getNodeParameter('llmId', index);
|
|
45
|
+
const updateFields = this.getNodeParameter('updateFields', index, {});
|
|
46
|
+
const body = {};
|
|
47
|
+
if (updateFields.regionName !== undefined)
|
|
48
|
+
body.region_name = updateFields.regionName || null;
|
|
49
|
+
if (updateFields.langCode !== undefined)
|
|
50
|
+
body.lang_code = updateFields.langCode || null;
|
|
51
|
+
return await apiRequest_1.apiRequest.call(this, 'PATCH', `/sites/${siteId}/airt/llm/${llmId}`, body, {}, index);
|
|
52
|
+
}
|
|
53
|
+
case 'deleteLlmEngine': {
|
|
54
|
+
const llmId = this.getNodeParameter('llmId', index);
|
|
55
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', `/sites/${siteId}/airt/llm/${llmId}`, {}, {}, index);
|
|
56
|
+
return { success: true, deleted: true, llm_id: llmId };
|
|
57
|
+
}
|
|
58
|
+
case 'getLlmStatus': {
|
|
59
|
+
const llmId = this.getNodeParameter('llmId', index);
|
|
60
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', `/sites/${siteId}/airt/llm/${llmId}/status`, {}, {}, index);
|
|
61
|
+
}
|
|
62
|
+
case 'getLlmStatistics': {
|
|
63
|
+
const llmId = this.getNodeParameter('llmId', index);
|
|
64
|
+
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
65
|
+
const query = {};
|
|
66
|
+
if (additionalFields.from)
|
|
67
|
+
query.from = additionalFields.from;
|
|
68
|
+
if (additionalFields.to)
|
|
69
|
+
query.to = additionalFields.to;
|
|
70
|
+
if (additionalFields.top !== undefined)
|
|
71
|
+
query.top = additionalFields.top;
|
|
72
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', `/sites/${siteId}/airt/llm/${llmId}/statistics`, {}, query, index);
|
|
73
|
+
}
|
|
74
|
+
case 'listPrompts': {
|
|
75
|
+
const llmId = this.getNodeParameter('llmId', index);
|
|
76
|
+
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
77
|
+
const query = {};
|
|
78
|
+
if (additionalFields.limit !== undefined)
|
|
79
|
+
query.limit = additionalFields.limit;
|
|
80
|
+
if (additionalFields.offset !== undefined)
|
|
81
|
+
query.offset = additionalFields.offset;
|
|
82
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', `/sites/${siteId}/airt/llm/${llmId}/prompts`, {}, query, index);
|
|
83
|
+
}
|
|
84
|
+
case 'addPrompts': {
|
|
85
|
+
const llmId = this.getNodeParameter('llmId', index);
|
|
86
|
+
const promptsStr = this.getNodeParameter('prompts', index);
|
|
87
|
+
const prompts = promptsStr.split(',').map((p) => p.trim()).filter((p) => p.length > 0);
|
|
88
|
+
return await apiRequest_1.apiRequest.call(this, 'POST', `/sites/${siteId}/airt/llm/${llmId}/prompts`, { prompts }, {}, index);
|
|
89
|
+
}
|
|
90
|
+
case 'deletePrompts': {
|
|
91
|
+
const llmId = this.getNodeParameter('llmId', index);
|
|
92
|
+
const idsStr = this.getNodeParameter('k2siteLlmIds', index);
|
|
93
|
+
const k2siteLlmIds = idsStr.split(',').map((id) => parseInt(id.trim(), 10));
|
|
94
|
+
await apiRequest_1.apiRequest.call(this, 'DELETE', `/sites/${siteId}/airt/llm/${llmId}/prompts`, { k2site_llm_ids: k2siteLlmIds }, {}, index);
|
|
95
|
+
return { success: true, deleted: true, k2site_llm_ids: k2siteLlmIds };
|
|
96
|
+
}
|
|
97
|
+
case 'getPromptRankings': {
|
|
98
|
+
const llmId = this.getNodeParameter('llmId', index);
|
|
99
|
+
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
100
|
+
const query = {};
|
|
101
|
+
if (additionalFields.dateFrom)
|
|
102
|
+
query.date_from = additionalFields.dateFrom;
|
|
103
|
+
if (additionalFields.dateTo)
|
|
104
|
+
query.date_to = additionalFields.dateTo;
|
|
105
|
+
if (additionalFields.limit !== undefined)
|
|
106
|
+
query.limit = additionalFields.limit;
|
|
107
|
+
if (additionalFields.offset !== undefined)
|
|
108
|
+
query.offset = additionalFields.offset;
|
|
109
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', `/sites/${siteId}/airt/llm/${llmId}/prompts/rankings`, {}, query, index);
|
|
110
|
+
}
|
|
111
|
+
default:
|
|
112
|
+
throw new Error(`Unknown AI Result Tracker operation: ${operation}`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnalyticsTrafficOperations = AnalyticsTrafficOperations;
|
|
4
|
+
const apiRequest_1 = require("../../utils/apiRequest");
|
|
5
|
+
async function AnalyticsTrafficOperations(index) {
|
|
6
|
+
const operation = this.getNodeParameter('operation', index);
|
|
7
|
+
const siteId = this.getNodeParameter('siteId', index);
|
|
8
|
+
switch (operation) {
|
|
9
|
+
case 'getGscData': {
|
|
10
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', `/analytics/${siteId}/google`, {}, {}, index);
|
|
11
|
+
}
|
|
12
|
+
case 'getSeoPotential': {
|
|
13
|
+
const additionalFields = this.getNodeParameter('additionalFields', index, {});
|
|
14
|
+
const query = {};
|
|
15
|
+
if (additionalFields.topN !== undefined)
|
|
16
|
+
query.top_n = additionalFields.topN;
|
|
17
|
+
if (additionalFields.leadPrice !== undefined)
|
|
18
|
+
query.lead_price = additionalFields.leadPrice;
|
|
19
|
+
if (additionalFields.conversionRate !== undefined)
|
|
20
|
+
query.conversion_rate = additionalFields.conversionRate;
|
|
21
|
+
return await apiRequest_1.apiRequest.call(this, 'GET', `/analytics/${siteId}/potential`, {}, query, index);
|
|
22
|
+
}
|
|
23
|
+
default:
|
|
24
|
+
throw new Error(`Unknown Analytics Traffic operation: ${operation}`);
|
|
25
|
+
}
|
|
26
|
+
}
|