mirror of
https://github.com/unraid/api.git
synced 2026-01-19 06:59:40 -06:00
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - sizeRootFs now reported in bytes as BigInt. - Container listings include size only when requested; caching distinguishes size vs no-size. - New Docker-related fields: per-container update statuses, rebuild/update indicators, spinning state, and a mutation to refresh docker digests. - **Tests** - Added unit tests for GraphQL field inspection and container size/cache behavior. - **Chores** - Version bumped to 4.22.2. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
@unraid-api-plugin-connect/src
This directory contains the core source code for the Unraid Connect API plugin, built as a modular NestJS application. It provides remote access, cloud integration, and configuration management for Unraid servers.
Structure
- index.ts: Main entry, conforming to the
nestjsAPI plugin schema. - authn/: Authentication services.
- config/: Configuration management, persistence, and settings.
- connection-status/: Connection state monitoring and status tracking.
- graphql/: GraphQL request definitions and generated client code.
- helper/: Utility functions and constants.
- internal-rpc/: Internal RPC communication services.
- mothership-proxy/: Mothership server proxy and communication.
- network/: Network services including UPnP, DNS, URL resolution, and WAN access.
- remote-access/: Remote access services (static, dynamic, UPnP).
- unraid-connect/: Core Unraid Connect functionality and settings.
- __test__/: Vitest-based unit and integration tests.
Each feature directory follows a consistent pattern:
*.module.ts: NestJS module definition*.service.ts: Business logic implementation*.resolver.ts: GraphQL resolvers*.model.ts: TypeScript and GraphQL models, DTOs, and types*.events.ts: Event handlers for event-driven operations*.config.ts: Configuration definitions
Usage
This package is intended to be used as a NestJS plugin/module. Import ApiModule from index.ts and add it to your NestJS app's module imports.
import { ApiModule } from '@unraid-api-plugin-connect/src';
@Module({
imports: [ApiModule],
})
export class AppModule {}
Development
- Install dependencies from the monorepo root:
pnpm install - Build:
pnpm run build(from the package root) - Codegen (GraphQL):
pnpm run codegen - Tests:
vitest(see__test__/for examples) - Format:
pnpm run formatto format all files in project
Notes
- Designed for Unraid server environments.
- Relies on other Unraid workspace packages (e.g.,
@unraid/shared). - For plugin installation and system integration, see the main project documentation.