@aborruso/ckan-mcp-server 0.4.0 → 0.4.2
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/CLAUDE.md +2 -2
- package/EXAMPLES.md +50 -0
- package/LOG.md +21 -0
- package/PRD.md +1 -1
- package/REFACTORING.md +2 -1
- package/dist/index.js +30 -19
- package/dist/worker.js +23 -23
- package/package.json +1 -1
- package/.claude/commands/openspec/apply.md +0 -23
- package/.claude/commands/openspec/archive.md +0 -27
- package/.claude/commands/openspec/proposal.md +0 -28
- package/.claude/settings.local.json +0 -33
- package/.gemini/commands/openspec/apply.toml +0 -21
- package/.gemini/commands/openspec/archive.toml +0 -25
- package/.gemini/commands/openspec/proposal.toml +0 -26
- package/.mcp.json +0 -12
- package/.opencode/command/openspec-apply.md +0 -24
- package/.opencode/command/openspec-archive.md +0 -27
- package/.opencode/command/openspec-proposal.md +0 -29
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/coverage-final.json +0 -7
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -146
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -210
- package/spunti.md +0 -19
- package/tasks/todo.md +0 -124
- package/tmp/test-org-search.js +0 -55
package/tmp/test-org-search.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
// Test manuale del tool ckan_organization_search
|
|
2
|
-
import axios from 'axios';
|
|
3
|
-
|
|
4
|
-
async function testOrgSearch() {
|
|
5
|
-
const serverUrl = 'https://www.dati.gov.it/opendata';
|
|
6
|
-
const pattern = 'toscana';
|
|
7
|
-
const query = `organization:*${pattern}*`;
|
|
8
|
-
|
|
9
|
-
console.log('Testing organization search...');
|
|
10
|
-
console.log('Pattern:', pattern);
|
|
11
|
-
console.log('Query:', query);
|
|
12
|
-
console.log('');
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
const url = `${serverUrl}/api/3/action/package_search`;
|
|
16
|
-
const response = await axios.get(url, {
|
|
17
|
-
params: {
|
|
18
|
-
q: query,
|
|
19
|
-
rows: 0,
|
|
20
|
-
'facet.field': JSON.stringify(['organization']),
|
|
21
|
-
'facet.limit': 500
|
|
22
|
-
},
|
|
23
|
-
timeout: 30000,
|
|
24
|
-
headers: {
|
|
25
|
-
'User-Agent': 'CKAN-MCP-Server/1.0'
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const result = response.data.result;
|
|
30
|
-
const orgFacets = result.search_facets?.organization?.items || [];
|
|
31
|
-
const totalDatasets = result.count || 0;
|
|
32
|
-
|
|
33
|
-
console.log('Organizations found:', orgFacets.length);
|
|
34
|
-
console.log('Total datasets:', totalDatasets);
|
|
35
|
-
console.log('');
|
|
36
|
-
|
|
37
|
-
const jsonResult = {
|
|
38
|
-
count: orgFacets.length,
|
|
39
|
-
total_datasets: totalDatasets,
|
|
40
|
-
organizations: orgFacets.map((item) => ({
|
|
41
|
-
name: item.name,
|
|
42
|
-
display_name: item.display_name,
|
|
43
|
-
dataset_count: item.count
|
|
44
|
-
}))
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
console.log(JSON.stringify(jsonResult, null, 2));
|
|
48
|
-
|
|
49
|
-
} catch (error) {
|
|
50
|
-
console.error('Error:', error.message);
|
|
51
|
-
process.exit(1);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
testOrgSearch();
|