feat(05-01): implement NinjaRMM ZIP and intunewin package export endpoints
- GET /printers/{id}/packages/ninja: in-memory ZIP with install.ps1 + driver files in named subfolder
- GET /printers/{id}/packages/intunewin: temp dir build of .intunewin via build_intunewin()
- _get_printer_and_driver() helper validates printer, driver, inf, desc
- Driver ZIP file existence check before processing (RESEARCH pitfall 3)
- TemporaryDirectory context manager for auto-cleanup (RESEARCH pitfall 1)
- Router registered in main.py after scripts router
- All 9 package tests pass, 84 total tests green
This commit is contained in:
+5
-2
@@ -5,8 +5,8 @@ from pathlib import Path
|
||||
from fastapi import FastAPI
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
|
||||
from imptune.api import clients, drivers, health, pages, printers, scripts
|
||||
from imptune.config import DATA_DIR, DRIVERS_DIR
|
||||
from imptune.api import clients, drivers, health, icons, pages, packages, printers, scripts
|
||||
from imptune.config import DATA_DIR, DRIVERS_DIR, ICONS_DIR
|
||||
from imptune.db.database import db, init_db
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ from imptune.db.database import db, init_db
|
||||
async def lifespan(app: FastAPI):
|
||||
os.makedirs(DATA_DIR, exist_ok=True)
|
||||
os.makedirs(DRIVERS_DIR, exist_ok=True)
|
||||
os.makedirs(ICONS_DIR, exist_ok=True)
|
||||
init_db()
|
||||
yield
|
||||
# Close DB connection on shutdown so test fixtures can re-initialize cleanly
|
||||
@@ -34,3 +35,5 @@ app.include_router(drivers.router)
|
||||
app.include_router(printers.router)
|
||||
app.include_router(clients.router)
|
||||
app.include_router(scripts.router)
|
||||
app.include_router(packages.router)
|
||||
app.include_router(icons.router)
|
||||
|
||||
Reference in New Issue
Block a user