-
Notifications
You must be signed in to change notification settings - Fork 297
Expand file tree
/
Copy pathspider.js
More file actions
52 lines (47 loc) · 1.21 KB
/
spider.js
File metadata and controls
52 lines (47 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import apiClient from './client'
export const spiderApi = {
// List all sources via MCP
async listSources() {
const response = await apiClient.post('/admin/mcp', {
name: 'list_sources',
arguments: {}
})
// Transform response format from {spider/js, spider/catvod} to {js, catvod}
return {
js: response['spider/js'] || [],
catvod: response['spider/catvod'] || []
}
},
// Validate spider via MCP
async validateSpider(path) {
const response = await apiClient.post('/admin/mcp', {
name: 'validate_spider',
arguments: { path }
})
return response
},
// Check syntax via MCP
async checkSyntax(path) {
const response = await apiClient.post('/admin/mcp', {
name: 'check_syntax',
arguments: { path }
})
return response
},
// Get spider template via MCP
async getTemplate() {
const response = await apiClient.post('/admin/mcp', {
name: 'get_spider_template',
arguments: {}
})
return response
},
// Debug spider rule via MCP
async debugRule(params) {
const response = await apiClient.post('/admin/mcp', {
name: 'debug_spider_rule',
arguments: params
})
return response
}
}