refactor: migrate all internal imports to package.json subpath aliases

- Add #domain, #protocol, #utils aliases to package.json imports map
- Replace all relative imports (./, ../, ../..) in app/ and
  database/mongo_migrations/ with the corresponding #alias imports,
  eliminating relative path traversal across the codebase
- Remove dead code: ConfigurationVersionModel.findByConfigurationIdentifier
  (unused, superseded by paginateVersions) and unused exception classes
  (NotFoundException, UnprocessableEntityException, DatabaseException)
  from app/exceptions/index.ts, keeping only BadRequestException
- Fix pre-existing syntax error in configuration_version.ts (mismatched
  parenthesis) that broke tsc
- Fix eqeqeq violation in configuration_service.ts and isNaN ->
  Number.isNaN in configuration_engine.ts / cwmp-1-0.ts / exchange_controller.ts
- Fix no-shadow violation in cwmp-1-0.ts EventStruct constructor
- Prettier formatting pass on touched files

Validated: tsc --noEmit clean, eslint app/ clean, full test suite green.
This commit is contained in:
Kevin L'Hereec committed 2026-07-22 11:45:14 +02:00
1 parent 4177f1adbd
commit f9e56c78b1
74 files changed
+1243 -863

No files matched your search

+13 -3
View File
@@ -37,9 +37,15 @@ const scheduleWindowSchema = vine.object({
export const createConfigurationValidator = vine.compile(
vine.object({
identifier: vine.string().trim().regex(/^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$/),
identifier: vine
.string()
.trim()
.regex(/^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$/),
name: vine.string().trim().minLength(1),
version: vine.string().trim().regex(/^\d+\.\d+\.\d+$/),
version: vine
.string()
.trim()
.regex(/^\d+\.\d+\.\d+$/),
priority: vine.number().positive(),
policy: vine.enum(['once', 'maintain']),
enabled: vine.boolean().optional(),
@@ -55,7 +61,11 @@ export const createConfigurationValidator = vine.compile(
export const updateConfigurationValidator = vine.compile(
vine.object({
name: vine.string().trim().minLength(1).optional(),
version: vine.string().trim().regex(/^\d+\.\d+\.\d+$/).optional(),
version: vine
.string()
.trim()
.regex(/^\d+\.\d+\.\d+$/)
.optional(),
priority: vine.number().positive().optional(),
policy: vine.enum(['once', 'maintain']).optional(),
enabled: vine.boolean().optional(),
+8 -2
View File
@@ -2,7 +2,10 @@ import vine from '@vinejs/vine'
export const createFirmwareEntryValidator = vine.compile(
vine.object({
identifier: vine.string().trim().regex(/^[a-z0-9]+(-[a-z0-9]+)*$/),
identifier: vine
.string()
.trim()
.regex(/^[a-z0-9]+(-[a-z0-9]+)*$/),
productClass: vine.string().trim().minLength(1),
version: vine.string().trim().minLength(1),
downloadUrl: vine.string().trim().url(),
@@ -25,7 +28,10 @@ export const updateFirmwareEntryValidator = vine.compile(
export const createMigrationRouteValidator = vine.compile(
vine.object({
identifier: vine.string().trim().regex(/^[a-z0-9]+(-[a-z0-9]+)*$/),
identifier: vine
.string()
.trim()
.regex(/^[a-z0-9]+(-[a-z0-9]+)*$/),
productClass: vine.string().trim().minLength(1),
sourceVersionPattern: vine.string().trim().minLength(1),
targetVersion: vine.string().trim().minLength(1),