@norskhelsenett/zeniki
v0.6.4
Published
A API communication library for commonly used network hardware and tools
Readme
Zeniki
A TypeScript API communication library for commonly used network hardware and tools
Zeniki is a modern TypeScript library that provides type-safe, well-documented drivers for network infrastructure platforms including NetBox IPAM, F5 BIG-IP load balancers, FortiGate firewalls, VMware NSX, VMware AVI (NSX Advanced Load Balancer), ROR (Resource Orchestration Registry), and Network Architecture Management (NAM) v2. Features comprehensive type safety with NHN-specific custom field types, immutable API responses, and enterprise-grade network automation capabilities.
⚠️ Breaking Changes in v0.5.0
SubDriver Architecture: Version 0.5.0 introduces a new SubDriver architecture that changes how you access driver methods. The last version supporting the old implementation is 0.4.x.
Migration Guide
Old Implementation (v0.4.x and earlier):
const netbox = new NetboxDriver({ baseURL: '...', headers: {...} });
// Methods called directly on driver instance
const prefixes = await netbox.getPrefixes({ status: 'active' });
const prefix = await netbox.addPrefix({ prefix: '10.0.0.0/24' });
const devices = await netbox.getDevices({ site: 1 });New Implementation (v0.5.0+):
const netbox = new NetboxDriver({ baseURL: '...', headers: {...} });
// Methods organized into sub-drivers by resource type
const prefixes = await netbox.prefixes.getPrefixes({ status: 'active' });
const prefix = await netbox.prefixes.addPrefix({ prefix: '10.0.0.0/24' });
const devices = await netbox.devices.getDevices({ site: 1 });Key Changes:
- Access methods through resource-specific sub-drivers (e.g.,
netbox.prefixes,netbox.devices,netbox.vlans) - Better organization and discoverability of API methods
- Improved type safety and IntelliSense support
Installation
Install from npm
Zeniki is now publicly available on npm:
npm install @norskhelsenett/zenikiDeno installation
# Add to your import map or import directly
deno add npm:@norskhelsenett/zenikiOr import directly in your Deno code:
import { NetboxDriver } from "npm:@norskhelsenett/zeniki";Quick Start
NetBox Integration Example
import {
NetboxDriver,
NetboxPrefixStatus,
NHN_CommonNetboxExtraChoicesEnvironment,
} from "@norskhelsenett/zeniki";
const netbox = new NetboxDriver({
baseURL: "https://netbox.example.com/api",
headers: { "Authorization": "Token your-api-token" },
});
// Create prefix using sub-driver with type-safe enums
const prefix = await netbox.prefixes.addPrefix({
prefix: "192.168.1.0/24",
description: "Development Network",
status: NetboxPrefixStatus.Active,
site: 1,
custom_fields: {
environment: NHN_CommonNetboxExtraChoicesEnvironment.dev,
domain: "dev.example.com",
},
});
// Get prefixes using sub-driver
const prefixes = await netbox.prefixes.getPrefixes({
status: "active",
family: 4,
});
// Access other sub-drivers
const devices = await netbox.devices.getDevices({ site: 1 });
const vlans = await netbox.vlans.getVlans({ status: "active" });
console.log(`Created prefix: ${prefix.prefix}`);
console.log(`Found ${prefixes.count} active prefixes`);Documentation
Driver Documentation
- 📖 NetBox Driver - Complete IPAM and DCIM management
- � F5 BIG-IP Driver - Load balancer and application delivery controller management
- �🛡️ FortiOS Driver - Enterprise firewall management
- 🔧 VMware NSX Driver - Software-defined networking
- ⚖️ VMware AVI Driver - NSX Advanced Load Balancer management
- 🌐 NAM v2 Driver - Network architecture management
- 🔄 ROR v1 Driver - Resource orchestration and registry
Utilities
- ⚙️ EnvLoader - Configuration and secrets management
Logging
- 📊 Winston HEC Logger - Splunk HTTP Event Collector transport
Testing & Examples
- 📝 Test Suite Documentation - Unit tests, integration tests, and examples
- 🎮 Playground - Manual testing and driver verification
Development
See Development Guide for building, testing, project structure, and contribution guidelines.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Support
For support and questions:
- 🌐 Website: https://www.nhn.no/
- 📝 Issues: GitHub Issues
Made with ❤️ by NHN
