Commit graph

32 commits

Author SHA1 Message Date
ce340ccf2e feat: implement storeGroupValue and getGroupValue with unified locator
- API Refactoring: Extracted GroupValueLocator input type to unify parameters for storeGroupValue (mutation) and getGroupValue (query).

- Data Retrieval: Implemented getGroupValue query to allow direct retrieval of JSON values stored in host groups via Zabbix Trapper items.

- Enhanced Logic: Added ZabbixGetGroupValueRequest to fetch latest history values for group-associated items.

- Improved Verification: Updated the regression suite (REG-STORE) to include a full 'Store-Update-Retrieve' verification cycle.

- Documentation:

    - Updated docs/howtos/cookbook.md recipes to use the new locator structure and getGroupValue for verification.

    - Updated sample query files (docs/queries/) with corrected variables and verification queries.

- Tests:

    - Added unit and integration tests for getGroupValue.

    - Updated existing tests to match the refactored storeGroupValue schema.

- Verification: Verified 100% pass rate for all 16 regression steps and all unit/integration tests.
2026-02-20 12:26:39 +01:00
0acef818c6 docs: add TSDoc to core components
- Added detailed JSDoc documentation to all core datasource classes in src/datasources/

- Documented execution logic classes in src/execution/

- Added TSDoc to API utility functions and resolvers in src/api/

- Documented shared models and enums in src/model/
2026-02-11 13:32:28 +01:00
fb5e9cbe81 feat: improve Zabbix multi-version compatibility and introduce local development environment
This update enhances compatibility across multiple Zabbix versions and introduces tools for easier local development and testing.

Key improvements and verified version support:
- Verified Zabbix version support: 6.2, 6.4, 7.0, and 7.4.
- Version-specific feature handling:
  - `history.push` is enabled only for Zabbix 7.0+; older versions skip it with a clear error or notice.
  - Conditional JSON-RPC authentication: the `auth` field is automatically added to the request body for versions older than 6.4.
  - Implemented static Zabbix version caching in the datasource to minimize redundant API calls.
- Query optimization refinements:
  - Added mapping for implied fields (e.g., `state` -> `items`, `deviceType` -> `tags`).
  - Automatically prune unnecessary Zabbix parameters (like `selectItems` or `selectTags`) when not requested.
- Local development environment:
  - Added a new `zabbix-local` Docker Compose profile that includes PostgreSQL, Zabbix Server, and Zabbix Web.
  - Supports testing different versions by passing the `ZABBIX_VERSION` environment variable (e.g., 6.2, 6.4, 7.0, 7.4).
  - Provided a sample environment file at `samples/zabbix-local.env`.
- Documentation and Roadmap:
  - Updated README with a comprehensive version compatibility matrix and local environment instructions.
  - Created a new guide: `docs/howtos/local_development.md`.
  - Updated maintenance guides and added "Local Development Environment" as an achieved milestone in the roadmap.
- Test suite enhancements:
  - Improved Smoketest and RegressionTest executors with more reliable resource cleanup and error reporting.
  - Made tests version-aware to prevent failures on older Zabbix instances.

BREAKING CHANGE: Dropped Zabbix 6.0 specific workarounds; the minimum supported version is now 6.2.
2026-02-04 14:01:53 +01:00
7c2dee2b6c feat: implement history push mutation and enhanced MCP logging
- Implement pushHistory mutation to support pushing telemetry data to Zabbix trapper items.

- Add VERBOSITY and MCP_LOG_* environment variables for controllable request/response logging in both API and MCP server.

- Enhance ZabbixRESTDataSource with better session handling and error logging.

- Update ZabbixHistory datasource to support history push operations.

- Expand documentation with new cookbook recipes and MCP integration guides.

- Add integration tests for history pushing (src/test/history_push*).

- Reorganize documentation, moving technical product info PDF to docs/use-cases/.

- Update GraphQL generated types and VCR templates.
2026-02-03 13:29:42 +01:00
b646b8c606 feat: optimize Zabbix queries and enhance specialized device support
- Implement query optimization (reduced output, parameter skipping) to minimize Zabbix API traffic.

- Add indirect dependency handling: deviceType implies tags and state implies items.

- Move schema extensions to samples/extensions/ to clarify their role as samples.

- Enhance DistanceTrackerDevice with String time fields to support optional date portions.

- Ensure allDevices strictly filters by deviceType and populates the field in results.

- Refactor runAllRegressionTests mutation to use internal unique names and improve stability.

- Fix unnecessary Zabbix API calls for item preprocessing during template and host imports.

- Update documentation including cookbook recipes, test specifications, and optimization guides.

- Add extensive unit, integration, and regression tests covering all implemented changes.

- Update docker-compose.yml to mount the samples/ directory as a volume.

- Update IntelliJ .idea run configurations to reflect the new sample extension paths.
2026-02-02 13:20:06 +01:00
41e4c4da1f feat: add weather sensor support and fix device status mapping
This commit introduces support for provisioning weather sensors with geo-coordinates
via user macros and fixes a critical mapping bug in device status.

Changes:
- fix: Corrected DeviceStatus enum mapping (0=ENABLED, 1=DISABLED).
- feat: Added 'status' field to CreateTemplateItem input in GraphQL schema.
- feat: Enabled user macro assignment during host and template creation/import.
- feat: Added regression tests for user macro assignment and HTTP agent URL support.
- docs: Updated cookbook and sample queries to use {$LAT} and {$LON} macros.
- test: Added unit tests for macro assignment in HostImporter and TemplateImporter.
- chore: Regenerated GraphQL types.
2026-02-01 16:23:35 +01:00
67357d0bc3 feat: implement smoketest and extend host provisioning with template linking
- 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.
2026-01-31 11:46:02 +01:00
bbf7357e93 docs: enhance documentation and automate MCP setup
This commit introduces several improvements to the project's documentation,
roadmap, and AI agent integration (MCP).

Key changes:
- Created and styled roadmap.md to track project milestones and future plans.
- Updated .junie/guidelines.md with strict documentation style standards.
- Automated GraphQL schema concatenation for the MCP server using a schema-gen init-container.
- Updated MCP setup recipes in cookbook.md and mcp.md to reflect the new automation.
- Added .ai/mcp/mcp.json for connecting to existing MCP services via HTTP.
- Improved development workflow by updating package.json to watch .graphql files.
- Cleaned up the root directory by moving schema.graphql to .gitignore and removing redundant files.
- Standardized visual style and formatting across all markdown files.
2026-01-30 19:04:05 +01:00
91a1523d71 docs: complete documentation refactoring and structure optimization
This commit finalizes the documentation improvement plan by:
- Centralizing reference material in README.md.
- Creating a dedicated Technical Maintenance guide (docs/howtos/maintenance.md).
- Creating a categorized Sample Queries & Mutations overview (docs/queries/README.md).
- Eliminating redundant information across the doc set (DRY principle).
- Optimizing cross-references between reference documentation and the Cookbook.
- Updating the improvement plan to reflect all tasks as completed.
2026-01-30 15:08:19 +01:00
a01bfabfba docs: refactor documentation and upgrade to Node.js 24
This commit upgrades the project to Node.js 24 (LTS) and performs a major refactoring of the documentation to support both advanced users and AI-based automation (MCP).

Changes:
- Environment & CI/CD:
  - Set Node.js version to >=24 in package.json and .nvmrc.
  - Updated Dockerfile to use Node 24 base image.
  - Updated @types/node to ^24.10.9.
- Documentation:
  - Refactored README.md with comprehensive technical reference, configuration details, and Zabbix-to-GraphQL mapping.
  - Created docs/howtos/cookbook.md with practical recipes for common tasks and AI test generation.
  - Updated docs/howtos/mcp.md to emphasize GraphQL's advantages for AI agents and Model Context Protocol.
  - Added readme.improvement.plan.md to track documentation evolution.
  - Enhanced all how-to guides with improved cross-references and up-to-date information.
- Guidelines:
  - Updated .junie/guidelines.md with Node 24 requirements and enhanced commit message standards (Conventional Commits 1.0.0).
- Infrastructure & Code:
  - Updated docker-compose.yml with Apollo MCP server integration.
  - Refined configuration and schema handling in src/api/ and src/datasources/.
  - Synchronized generated TypeScript types with schema updates.
2026-01-30 14:35:31 +01:00
4ec61ffba1 chore: add MCP integration and refactor documentation into modular how-to guides
- 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`.
2026-01-30 00:47:02 +01:00
2a82fe6cf2 chore: update .idea/workspace.xml and project guidelines
- Refined IntelliJ IDEA settings in `.idea/workspace.xml`, including updates to `ProblemsViewState` and `PropertiesComponent` for project consistency.
- Renamed and expanded `.junie/guidelines.md` to reflect updated best practices, project structure, and development workflows.
2026-01-28 11:52:20 +01:00
7adaf82c1b chore: add tests for schema and API config mocking
- 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
2026-01-28 07:34:08 +01:00
5e41aa5cc4 chore: add default filters for host and host group queries
- Introduced `HOST_TYPE_FILTER_DEFAULT` and `HOST_GROUP_FILTER_DEFAULT` constants in the `Config` class.
- Updated resolvers to use these defaults when `tag_hostType` or `search_name` arguments are not provided.
- Added corresponding tests to verify default behavior in host and host group queries.
- Added documentation on overriding 'HOST_GROUP_FILTER_DEFAULT' by explicitly setting the 'search_name' argument in the 'allHostGroups' query.
- Explained the usage of the '*' wildcard in 'search_name' with a concrete example for subgroup matching.
2026-01-27 18:46:48 +01:00
2a8ff989f3 chore: centralize configuration management using a new Config class
- Replaced all direct `process.env` references with `Config` class constants.
- Added `dotenv` package to manage environment variables.
- Updated affected files, including schema loader, Zabbix API, resolvers, logging system, and integration points.
- Improved maintainability and consistency in environment variable handling.
2026-01-27 17:28:22 +01:00
6312c3a2f7 chore: update base host group name from "Baustellen-Devices" to "Roadwork" in code, tests, and documentation 2026-01-27 15:55:09 +01:00
dd9908221b chore: update Docker image path in workflows and README 2026-01-27 12:05:58 +01:00
e61b5f4f11 docs: enhance GraphQL schema documentation
- Added comprehensive descriptions to all types, interfaces, and fields in 'schema/api_commons.graphql'.

- Improved documentation for mutations and input/response types in 'schema/mutations.graphql'.

- Added detailed descriptions for all queries and their arguments in 'schema/queries.graphql'.

- Enhanced documentation for core Zabbix types and enums in 'schema/zabbix.graphql'.

- Updated extension schemas under 'schema/extensions/' with proper GraphQL descriptions.

- Verified schema validity via 'graphql-codegen' and ran all tests to ensure consistency.
2026-01-26 19:18:59 +01:00
a3ed4886a3 feat: add template and template group management via GraphQL
- Implemented GraphQL endpoints for importing, querying, and deleting Zabbix templates and template groups. - Added support for full template data import, including items, preprocessing steps, tags, and linked templates. - Implemented dependent item support by deferred creation logic in the template importer. - Added ability to query templates and template groups with name pattern filtering (supporting Zabbix wildcards). - Implemented batch deletion for templates and template groups by ID or name pattern. - Improved error reporting by including detailed Zabbix API error data in GraphQL responses. - Added comprehensive unit and integration tests covering all new functionality. - Provided GraphQL sample queries and mutations in the 'docs' directory for all new endpoints.
2026-01-24 15:42:13 +01:00
e641f8e610 chore: Add allDevices query resolver, update Zabbix device query handling, and enhance schema with DeviceConfig and WidgetPreview types 2026-01-20 17:10:08 +01:00
c1035cd614 chore: Enhance schema with DeviceConfig tags resolver and update IntelliJ workspace adjustments 2026-01-16 20:37:49 +01:00
0c1f585909 chore: Update tags field schema to use DeviceConfig, enhance isDevice type check, and adjust IntelliJ workspace 2026-01-16 20:24:08 +01:00
8e5fbc3f57 chore: Update Dockerfile CMD for schema path, log schema loading path in schema.ts, and adjust IntelliJ workspace 2026-01-14 14:21:14 +01:00
437321ef6d chore: Add copy-schema script, update Dockerfile schema path, and adjust npm prod workflow 2026-01-14 12:06:16 +01:00
70e64448e5 chore: Move schema directory away from src; Migrate extensions to schema directory, update Dockerfile and configuration paths 2026-01-14 10:03:38 +01:00
874a22f53a chore: Add test for Zabbix API arguments parsing 2026-01-13 15:01:06 +01:00
058ff42b4a chore: Add dry-run mode and configure logger for operation mode logging 2026-01-13 14:51:40 +01:00
fbe1e4ed05 chore: Update IntelliJ workspace and fix Docker image tag in workflow 2026-01-13 14:48:52 +01:00
98c612fc56 chore: Add missing ".js" extensions to imports and improve Node.js compatibility for dynamic schema loading 2026-01-13 14:42:11 +01:00
1c1aeb4519 chore: Update IntelliJ workspace settings and add GitHub Actions workflow for Docker deployment 2026-01-13 14:16:10 +01:00
47640ff13e refactor!: Rename "devices" to "hosts" in "exportHistory" - operation. Prepare extraction of device specific types and alignment with integration layer 2026-01-06 12:42:43 +01:00
92ffe71684 Initial commit: Extract base Zabbix GraphQl - API functionality from VCR Project and add dynamic schema samples 2026-01-05 21:05:35 +01:00