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

+12 -12
View File
@@ -1,17 +1,17 @@
import type { HttpContext } from '@adonisjs/core/http'
import { CWMPMessageBuilder } from '../protocol/common/cwmp_message_builder.js'
import { StateMachineManager } from '../services/cwmp/state_machine_manager.js'
import { Device, detectDataModelFromParams } from '../domain/device/device.js'
import { DeviceId } from '../domain/device/device_id.js'
import { DeviceParameter, DeviceProperty } from '../domain/device/device_parameter.js'
import DeviceModel from '../models/device.js'
import { getDeviceHashIdentifier } from '../utils/device_utils.js'
import { getReferenceEngine } from '../services/references/reference_engine.js'
import { normalizeEventCode } from '../utils/cwmp-events.js'
import { CWMPMessageBuilder } from '#protocol/common/cwmp_message_builder'
import { StateMachineManager } from '#services/cwmp/state_machine_manager'
import { Device, detectDataModelFromParams } from '#domain/device/device'
import { DeviceId } from '#domain/device/device_id'
import { DeviceParameter, DeviceProperty } from '#domain/device/device_parameter'
import DeviceModel from '#models/device'
import { getDeviceHashIdentifier } from '#utils/device_utils'
import { getReferenceEngine } from '#services/references/reference_engine'
import { normalizeEventCode } from '#utils/cwmp-events'
import logger from '@adonisjs/core/services/logger'
import type { Inform, CwmpMessage, ParameterValueStruct } from '../protocol/tr069_types.js'
import { ParameterType } from '../domain/shared/types.js'
import { FaultCodeType } from '../protocol/tr069_types.js'
import type { Inform, CwmpMessage, ParameterValueStruct } from '#protocol/tr069_types'
import { ParameterType } from '#domain/shared/types'
import { FaultCodeType } from '#protocol/tr069_types'
export default class CwmpController {
private static managerInitialized = false