Files
adam-acs/app/domain/device/device_record.ts
T
Kevin L'Hereec f3eb8e1650 feat: restore strong typing on TR-069/CWMP protocol layer
- Copy cwmp-1-0..4.ts source classes from cwmp-connector (papaye) into
  app/protocol/ as local files (ts-nocheck, external dependency)
- Add soap_envelope.ts: SoapEnvelope, SoapEnvelopeHeader, CwmpID, NAMESPACES
- Add tr069_types.ts: re-exports all CWMP classes + CwmpMessage discriminated
  union + typed task payload interfaces (CWMPTaskType, CWMPTaskPayload, etc.)
- Rewrite cwmp_message_builder.ts to use class-based builders instead of raw
  XML template strings; add transferCompleteResponse() and soapFault()
- soap.ts: extractCwmpMessage returns CwmpMessage union, adds runtime allowlist
  guard against unknown CWMP method names from CPE
- cwmp_middleware.ts: envelope typed SoapEnvelope|null, message CwmpMessage|null
- cwmp_controller.ts: handleInform(informData: Inform), remove any, migrate
  TransferComplete and fault to new builder path, drop buildSoapEnvelope import
- task_queue.ts: CWMPTask.type → CWMPTaskType literal union, payload →
  CWMPTaskPayload, result → CWMPTaskResultData
- device_action_executor.ts: GPV/GPN/GPA responses typed, no more any
- main_state_machine.ts: DeviceContext.message.data → CWMPTaskResultData,
  organizeParameters receives ParameterInfoStruct[] directly
- device.ts: tmpParamValues typed ParameterValueStruct[], organizeParameters
  signature updated, updateFromValues typed
- device_id.ts: fromInform typed with DeviceIdStruct
- soap_envelope.ts: remove unconditional <cwmp:noMoreRequests> header
  (CPE→ACS only per TR-069 §3.7.1.4)
2026-07-20 15:25:26 +02:00

26 lines
879 B
TypeScript

import { type DeviceId } from './device_id.js'
import { type PropertySnapshot, type ParameterSnapshot } from './device_parameter.js'
import { type DeviceComplianceInfo } from '../configuration/compliance.js'
import { type DataModel, type GpnStatus, type GpnCircuitBreaker } from './device.js'
import type { DeviceReference } from '../../services/references/types.js'
export interface DeviceRecord {
identifier?: string
deviceId: DeviceId
properties: PropertySnapshot[]
parameters: ParameterSnapshot[]
gpnStatus?: GpnStatus
dataModel?: DataModel
gpnCircuitBreaker?: GpnCircuitBreaker
lastGpnSentDate?: Date | null
operationalStatus?: string
lastFailureReason?: string
compliance?: DeviceComplianceInfo
provisioningCode?: string
references?: DeviceReference[]
lastPeriodicInformAt?: Date
lastRemoteIp?: string
updatedAt?: Date
createdAt?: Date
}