This commit introduces several improvements to ensure the API works seamlessly across Zabbix 6.0, 6.4, and 7.0+, while also optimizing data fetching performance.
Key changes:
- Zabbix Version Compatibility:
- Added Zabbix version detection and static caching in ZabbixAPI.
- Implemented name-based fallback for host/template group permissions to support Zabbix 6.0 (which lacks UUIDs for host groups).
- Added manual host group expansion for Zabbix versions < 6.2.0 during user group import.
- Added version-based guards for history.push (7.0+) and hostgroup.propagate (6.2+).
- Updated documentation with detailed version compatibility notes.
- Added src/test/zabbix_6_0_compatibility.test.ts to verify compatibility logic.
- Query Optimization:
- Implemented dynamic output selection in ZabbixRequest to fetch only fields requested in GraphQL queries.
- Added GraphqlParamsToNeededZabbixOutput to map GraphQL selections to Zabbix API output parameters.
- Moved "Query Optimization" to achieved milestones in roadmap.md.
- Other:
- Updated various tests to support the new version-aware logic.
- Optimized imports and synchronized IDE settings.
- Add runSmoketest mutation to automate end-to-end verification.
- Add SmoketestExecutor and HostDeleter to support automated testing and cleanup.
- Extend createHost and importHosts to allow linking templates by name or ID.
- Update docs/howtos/cookbook.md with new recipe steps and AI/MCP guidance.
- Update .junie/guidelines.md with new verification and deployment standards.
- Add src/test/template_link.test.ts and update existing tests to cover new functionality.
- Regenerate GraphQL types to match schema updates.
- Moved GraphQL query samples into a new `docs/queries` directory for better organization.
- Added new queries and mutations, including `createHost.graphql` and `GetApiVersion.graphql`.
- Introduced `mcp-config.yaml` and updated `docker-compose.yml` for MCP integration.
- Updated IntelliJ `.idea/workspace.xml` settings to reflect project changes.
- Added new how-to guides (`docs/howtos`) for permissions, tags, MCP integration, and schema usage.
- Enhanced tests by updating file paths and improving sample data locations.
- Refined permissions and host group structures in `zabbix-hostgroups.ts` and `resolvers.ts`.
- Added unit tests for schema loader, mocking Config variables and resolvers.
- Added unit tests for Zabbix API configuration, verifying constants derived from Config.
- Mocked relevant modules and filesystem behaviors to enable isolated testing.
- Optimized imports on all files and include this within a new .junie/guidelines.md file
- Added GraphQL sample queries and mutations for host and user rights endpoints in the 'docs' directory.
- Implemented unit tests for all remaining GraphQL endpoints, including hosts, devices, host groups, locations, and user permissions.
- Created dedicated integration tests for host and user rights workflows, utilizing the new sample files.
- Fixed a bug in 'HostImporter.getHostGroupHierarchyNames' to correctly process and sort nested host group hierarchies.
- Refined Zabbix API mocking in tests to improve reliability and support path-based routing.
- Verified all 38 tests across 11 suites pass successfully.